XRPLF / xrpl4j

A 100% Java implementation to interact with the XRP Ledger.
ISC License
80 stars 45 forks source link

LedgerResult Deserialization: Negative TakerPays in Tx Metadata #473

Open nkramer44 opened 11 months ago

nkramer44 commented 11 months ago

Some Offer transactions in historical ledgers have metadata where the TakerPays field is a negative number. MetaOfferObject.takerPays is typed as a CurrencyAmount, which for XRP amounts wraps an UnsignedInteger. We should figure out why in some cases the TakerPays field can be negative.

Ledgers where this is a problem:

sappenin commented 10 months ago

One idea: We can add a boolean method (i.e., a flag) to XrpCurrencyAmount to indicate sign (e.g., isNegative). This should align with the STAmount binary encoding, which also uses a flag to indicate negativity.