ripple / ripple-binary-codec

Convert between json and hex representations of transactions and ledger entries on the XRP Ledger. Moved to: https://github.com/XRPLF/xrpl.js/tree/develop/packages/ripple-binary-codec
https://github.com/XRPLF/xrpl.js/tree/develop/packages/ripple-binary-codec
ISC License
18 stars 45 forks source link

Problem with X-Address encoding/serialization #116

Closed mrosendin closed 3 years ago

mrosendin commented 3 years ago

I kept getting this error message when calling RippleAPI's sign() method:

version bytes do not match any of the provided version

I did some debugging and tracked it down to the (X-Address?) serialization: https://github.com/ripple/ripple-binary-codec/blob/master/src/binary.ts#L69

I signed a testnet transaction with a classic address successfully.

natenichols commented 3 years ago

I'm seeing this error occur when trying to encode X-Addresses in issued currencies. This should be fixed in #113.

Does that sound consistent with what you were seeing @mrosendin?

intelliot commented 3 years ago

I don't think RippleAPI's sign() method can accept an X-address directly. Typically, you would convert the X-address prior to signing; for example, this is done automatically by prepareTransaction.

mrosendin commented 3 years ago

Yes @natenichols, that sounds right to me. I was using prepareTransaction for an issued currency payment when I saw this.