diff --git a/yarn-project/circuits.js/src/structs/header.ts b/yarn-project/circuits.js/src/structs/header.ts index e5910a3d10ec..9f78ac3a1a02 100644 --- a/yarn-project/circuits.js/src/structs/header.ts +++ b/yarn-project/circuits.js/src/structs/header.ts @@ -95,6 +95,14 @@ export class Header { ); } + /** + * Serializes this instance into a string. + * @returns Encoded string. + */ + public toString(): string { + return this.toBuffer().toString('hex'); + } + static fromString(str: string): Header { const buffer = Buffer.from(str.replace(/^0x/i, ''), 'hex'); return Header.fromBuffer(buffer);