Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't decode a transaction which has used encode for signing? #2846

Open
yannickrocks opened this issue Dec 10, 2024 · 1 comment
Open

Can't decode a transaction which has used encode for signing? #2846

yannickrocks opened this issue Dec 10, 2024 · 1 comment

Comments

@yannickrocks
Copy link

Why does the decode function not work for encodeForSigning

here is a basic transaction I have encoded for signing but then when I try to decode it, it throws the error show

{
    "TransactionType": "Payment",
    "Account": "rMFg63bQtKCNQiJt5JSKoGvbcVm2MMu1Bv",
    "Destination": "rD3SybPcGeFuM5sPXuBJu739C6qr5kYeke",
    "Amount": "1000000",
    "Sequence": 2268372,
    "Fee": "12",
    "LastLedgerSequence": 3006397
}

binary-parser.js:126 Uncaught (in promise) Error: Cannot read FieldOrdinal, type_code 0 out of range

What am I missing?

@mvadari
Copy link
Collaborator

mvadari commented Dec 12, 2024

It has a different prefix and includes a different set of fields. It might work if you remove the 0x54584e00 at the beginning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants