Repository navigation
Conversation
…nflash#270) `onChainPaymentSendAll` handed IBEX the entire wallet balance, but the rail charges its on-chain fee on top of the amount it forwards, so a full-balance sweep either failed at the rail or left dust behind. Add `getSendAllOnChainAmount`, which asks IBEX for the fee on this payout and returns `balance - fee`, and wire it into the sendAll mutation. Every failure mode of the estimate (IbexError, missing/zero/non-numeric fee, a fee that eats the whole balance) falls back to the previous behaviour of sweeping the full balance, so a degraded estimate never blocks a payment.
Author
|
Submitted in this PR. New helper Wallets.getSendAllOnChainAmount asks IBEX for the on-chain fee for the payout address and sends balance - fee instead of the whole balance, so the sweep lands instead of being rejected for a fee charged on top. If the estimate is unavailable, empty, or covers the whole balance, it falls back to the previous full-balance behaviour. Covered by new unit tests (fee subtraction, fractional cents, all fallback branches) plus a resolver wiring test. jest: 47 suites / 519 tests pass. Handle: nul-quill. Payout wallets: Solana USDC BdznDjc4xwt5Y6WJT5UnrFQzDptka8YnC9oqmmkKpwkd, TRC20 TNEHCVwR2aPMrj5AKfWCQ2rFL3bEDQmsg7. |
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.
onChainPaymentSendAll handed IBEX the entire wallet balance while the rail charges its on-chain fee on top of the forwarded amount, so full-balance sweeps failed or left dust. Adds getSendAllOnChainAmount (estimate via Ibex.estimateOnchainFee, return balance - fee) and wires it into the sendAll mutation. Every estimate failure mode (IbexError, missing/zero/non-numeric fee, fee >= balance) falls back to sweeping the full balance. Verified: tsc clean apart from two pre-existing Express/Application errors; jest 47 suites / 519 tests pass. Handle: nul-quill. Payout wallets: Solana USDC BdznDjc4xwt5Y6WJT5UnrFQzDptka8YnC9oqmmkKpwkd, TRC20 TNEHCVwR2aPMrj5AKfWCQ2rFL3bEDQmsg7.