diff --git a/packages/ledger/src/lib/nep413/ledger-payload.ts b/packages/ledger/src/lib/nep413/ledger-payload.ts index 237f91020..2ed8b08ef 100644 --- a/packages/ledger/src/lib/nep413/ledger-payload.ts +++ b/packages/ledger/src/lib/nep413/ledger-payload.ts @@ -1,4 +1,4 @@ -import { serialize } from "borsh"; +import { Schema, serialize } from "borsh"; export class LedgerPayload { message: string; @@ -16,26 +16,16 @@ export class LedgerPayload { } } -export const ledgerPayloadSchema = new Map([ - [ - LedgerPayload, - { - kind: "struct", - fields: [ - ["message", "string"], - ["nonce", [32]], - ["recipient", "string"], - [ - "callbackUrl", - { - kind: "option", - type: "string", - }, - ], - ], - }, - ], -]); +export const ledgerPayloadSchema: Schema = { + struct: { + message: "string", + nonce: { array: { type: "u8", len: 32 } }, + recipient: "string", + callbackUrl: { option: "string" }, + }, +}; + + export const serializeLedgerNEP413Payload = ( ledgerPayload: LedgerPayload