diff --git a/packages/protocol/packages/boundwitness/packages/validator/src/Validator.ts b/packages/protocol/packages/boundwitness/packages/validator/src/Validator.ts index fcfcb14c679..56d241090e7 100644 --- a/packages/protocol/packages/boundwitness/packages/validator/src/Validator.ts +++ b/packages/protocol/packages/boundwitness/packages/validator/src/Validator.ts @@ -72,7 +72,7 @@ export class BoundWitnessValidator = async signatures(): Promise { return [ - ...validateArraysSameLength(this.obj.$meta?.signatures ?? [], this.obj.addresses ?? [], 'Length mismatch: address/_signature'), + ...validateArraysSameLength(this.obj.$meta?.signatures ?? [], this.obj.addresses ?? [], 'Length mismatch: address/signature'), ...( await Promise.all( this.obj.addresses?.map>(async (address, index) => diff --git a/packages/protocol/packages/payload/packages/builder/src/Builder.ts b/packages/protocol/packages/payload/packages/builder/src/Builder.ts index 5c325a809fa..e8968e89f8b 100644 --- a/packages/protocol/packages/payload/packages/builder/src/Builder.ts +++ b/packages/protocol/packages/payload/packages/builder/src/Builder.ts @@ -27,8 +27,9 @@ export class PayloadBuilder> { } static async build(payload: T) { - const builder = new PayloadBuilder({ schema: payload.schema }) - builder.fields(payload) + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { schema, $hash, $meta, ...fields } = payload as WithMeta + const builder = new PayloadBuilder({ fields: fields as T, meta: $meta, schema: payload.schema }) return await builder.build() } @@ -117,8 +118,8 @@ export class PayloadBuilder> { return result } - $meta(fields?: JsonObject) { - this._$meta = fields + $meta(meta?: JsonObject) { + this._$meta = meta return this }