xrpl.js icon indicating copy to clipboard operation
xrpl.js copied to clipboard

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

Open yannickrocks opened this issue 1 year ago • 1 comments

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?

yannickrocks avatar Dec 10 '24 15:12 yannickrocks

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

mvadari avatar Dec 12 '24 01:12 mvadari

@yannickrocks Is this still an issue?

Are you auto-filling this transaction? Since the autofill method has changed over the past few months, it would be great if you can share the tx_blob (or) the version of the library.

ckeshava avatar Jun 26 '25 21:06 ckeshava

@yannickrocks Is this still an issue?

Are you auto-filling this transaction? Since the autofill method has changed over the past few months, it would be great if you can share the tx_blob (or) the version of the library.

Found another way around it. Thanks

yannickrocks avatar Jun 27 '25 06:06 yannickrocks

okay. I'll close this issue. If you have any more questions, please re-open it.

ckeshava avatar Jun 30 '25 20:06 ckeshava