feat: add structured balance errors for Stellar fee computation - #9659
Draft
Julink-eth wants to merge 3 commits into
Draft
feat: add structured balance errors for Stellar fee computation#9659Julink-eth wants to merge 3 commits into
Julink-eth wants to merge 3 commits into
Conversation
Julink-eth
temporarily deployed
to
default-branch
July 27, 2026 08:46 — with
GitHub Actions
Inactive
Julink-eth
marked this pull request as draft
July 27, 2026 12:22
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.
Explanation
Expose structured balance errors when Stellar fee computation fails due to insufficient funds.
References
Checklist
Note
Low Risk
Additive, Stellar-only error handling on the non-EVM fee catch path; success paths and other chains are unchanged.
Overview
When Stellar non-EVM fee computation via the wallet snap fails for insufficient funds, clients can now show specific balance messaging instead of a generic missing-fee state.
The PR introduces and exports
NonEvmBalanceError(codesInsufficientBalance/InsufficientBalanceToCoverFee, asset id, available/required amounts, optionalreserveAmountfor on-chain minimums). That payload is attached on quotes asnonEvmBalanceErroronNonEvmFeesandQuoteMetadata.In
appendNonEvmFees, only Stellar source quotes parse snap rejections: validators read structured data fromerror.dataor nestederror.data.cause.data, ignore malformed payloads, and otherwise keep the existing log-and-undefined-fee behavior for other chains and non-balance failures. Unit tests cover happy paths and validation edge cases.Reviewed by Cursor Bugbot for commit f04571c. Bugbot is set up for automated code reviews on this repo. Configure here.