Skip to content

Commit

Permalink
fix: update ledger payload to new schema
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiParraCrespo committed Dec 19, 2024
1 parent 7a315f9 commit 1fdf54d
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions packages/ledger/src/lib/nep413/ledger-payload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { serialize } from "borsh";
import { Schema, serialize } from "borsh";

Check failure on line 1 in packages/ledger/src/lib/nep413/ledger-payload.ts

View workflow job for this annotation

GitHub Actions / Test Suite

Import "Schema" is only used as types

export class LedgerPayload {
message: string;
Expand All @@ -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" },
},
};


Check failure on line 28 in packages/ledger/src/lib/nep413/ledger-payload.ts

View workflow job for this annotation

GitHub Actions / Test Suite

Delete `⏎⏎`

export const serializeLedgerNEP413Payload = (
ledgerPayload: LedgerPayload
Expand Down

0 comments on commit 1fdf54d

Please sign in to comment.