Skip to content

Conversation

@OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Nov 20, 2025

Description

Changelog

This PR adds zero balance check before onAmountInput RPC call to nonEVM send flow amount validations.

CHANGELOG entry: null

Related issues

Fixes: #22812

Manual testing steps

  1. Go to send flow
  2. Don't have any Tron / SOL / BTC
  3. Try sending it but see "insufficient balance" error

Screenshots/Recordings

Before

After

implement.zero.balance.check.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adds a zero-balance pre-check for non-EVM assets in amount validation and updates tests to cover it.

  • Validation (useAmountValidation):
    • Add non-EVM pre-check rawBalanceBN.isZero() to return "send.insufficient_funds" before onAmountInput snap validation in useAmountValidation.ts.
    • Update hook dependencies to include rawBalanceBN.
  • Tests:
    • Extend useAmountValidation.test.ts with SOLANA mocks and a test asserting error when non-EVM asset balance is zero.

Written by Cursor Bugbot for commit bf695af. This will update automatically on new commits. Configure here.

@OGPoyraz OGPoyraz requested a review from a team as a code owner November 20, 2025 13:12
@OGPoyraz OGPoyraz added team-confirmations Push issues to confirmations team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Nov 20, 2025
@OGPoyraz OGPoyraz changed the title fix: Implement client based nonEVM zero balance check to send flow fix: Implement nonEVM zero balance check to send flow before onAmountInput Nov 20, 2025
@OGPoyraz OGPoyraz enabled auto-merge November 20, 2025 15:06
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeCore, SmokeConfirmationsRedesigned, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeWalletUX, SmokeAssets, SmokeSwaps, SmokeStake, SmokeCard, SmokeNotifications, SmokeRewards, SmokePerps, SmokeRamps, SmokeMultiChainPermissions, SmokeAnalytics, SmokeMultiChainAPI, SmokePredictions
  • Risk Level: high
  • AI Confidence: %
click to see 🤖 AI reasoning details

Fallback: AI analysis did not complete successfully. Running all tests.

View GitHub Actions results

@sonarqubecloud
Copy link

@OGPoyraz OGPoyraz added this pull request to the merge queue Nov 21, 2025
Merged via the queue into main with commit f124f8c Nov 21, 2025
226 of 230 checks passed
@OGPoyraz OGPoyraz deleted the ogp/22812 branch November 21, 2025 09:32
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2025
@metamaskbot metamaskbot added the release-7.61.0 Issue or pull request that will be included in release 7.61.0 label Nov 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.61.0 Issue or pull request that will be included in release 7.61.0 size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tron send flow can move from amount screen with no balance or setting the amount to 0

5 participants