Skip to content

Commit

Permalink
fix(ledger): update to new borsh version
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiParraCrespo committed Dec 19, 2024
1 parent 9a0e570 commit 8836b90
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions packages/ledger/src/lib/nep413/ledger-payload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { serialize } from "borsh";
import type { Schema } from "borsh";

export class LedgerPayload {
message: string;
Expand All @@ -16,26 +17,14 @@ 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
Expand Down

0 comments on commit 8836b90

Please sign in to comment.