fix(widget): distinguish balance read failures from insufficient funds - #889
Open
BiscuitCoder wants to merge 1 commit into
Open
BiscuitCoder wants to merge 1 commit into
BiscuitCoder wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 2f0b4fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
BiscuitCoder
force-pushed
the
codex/balance-read-error
branch
from
September 29, 2026 15:16
d268e69 to
2f0b4fc
Compare
This branch has not been deployed
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.
Which Linear task is linked to this PR?
No Linear task; external bug-fix contribution.
Why was it implemented this way?
The SDK uses
LiFiErrorCode.BalanceErrorboth for insufficient funds and for balances it cannot read. The Widget currently maps every such error to “The balance is too low” and a message claiming the requested amount remains in the wallet. An unavailable RPC, missing balance or timeout does not establish either fact.Recognize the SDK's specific
Could not read wallet balance.message within theBalanceErrorcase and show “Could not read wallet balance” / “Your wallet balance could not be checked. Please try again.” Other balance errors and error codes retain their existing behavior.The execution state only carries the error code and message, not a structured balance-failure reason. The check deliberately matches the SDK message exactly rather than guessing from HTTP statuses or arbitrary provider errors. Regression tests run the installed SDK's
CheckBalanceTaskwith failing, missing, stalled and insufficient balances, then pass its serialized error fields to the Widget. This also detects a future change to the SDK message contract.English source strings follow the repository's Crowdin workflow. No dependency changes, RPC requests or timeout changes. Includes a Widget patch changeset.
Validation:
Visual showcase (Screenshots or Videos)
For an SDK balance read failure:
A confirmed shortfall still uses the existing insufficient-balance message.
Checklist before requesting a review