fix: assorted fixes - #37
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Fix IOU amount scaling for Ripple Custody. Custody's IOU amount fields are integer counts of the XRPL minimum currency unit (10⁻⁸¹), but the SDK was forwarding the raw human decimal — under-sending every IOU amount by 10⁸¹. Added a
toCustodyIouAmounthelper that scales by 10⁸¹ at the four IOU send-sites (Payment, TrustSet limit, Clawback, offer legs), leaving XRP drops and MPT base-units untouched.Require a real on-ledger
tesSUCCESSbefore reporting success. The native custodian paths previously declared success as soon as the governance intent executed, so an on-chaintecfailure slipped through as a "success." Added a shared on-ledger result gate (on-ledger-result.ts) that resolves the transaction by hash and raises unless it validated withtesSUCCESS, wired into both the Ripple Custody and Palisade native paths.Unify intent polling and termination semantics. Standardized the distinction between an indeterminate outcome (timed out, still in flight → retry the same idempotency key) and a provably dead one (expired/replaced/on-chain failure → needs a fresh key), across the intent inspector, on-chain polling, and Ripple Custody submission.
Add native XRP DEX offer methods. New
xrp.buyOffer/xrp.sellOffer/xrp.cancelOfferon the XRP vertical, mirroring the existing IOU offer surface (order types, permissioned-domain/hybrid options, offer replacement).Clarify idempotency-key behavior per backend. Documented that de-duplication coverage differs by connector (Local: none; Ripple Custody: all operations; Palisade: payment path only), so callers know when a retry is safe versus when it can double-apply.
Tests and demos/examples. Added unit coverage for the scaling helper, the on-ledger gate, and the new XRP offers; added a live contract test that issues an IOU through Custody and asserts the correct on-chain magnitude; updated the examples and demos to match the new behavior.