Skip to content

Conversation

@SeniorZhai
Copy link
Member

…erWallet sheet

@SeniorZhai SeniorZhai requested a review from Copilot January 28, 2026 05:40
@SeniorZhai SeniorZhai added the testing Now testing, but you can review label Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Solana-specific balance check in the GasCheck flow to prevent opening the BrowserWallet sheet when the wallet lacks enough SOL to cover transaction fees.

Changes:

  • Parse Solana raw (versioned) transactions in GasCheckBottomSheetDialogFragment to compute the required fee.
  • Fetch SOL balance for the current wallet and gate BrowserWallet sheet opening on sufficient fee balance.
  • Show TransferWeb3BalanceErrorBottomSheetDialogFragment when SOL balance is insufficient.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

showBrowserWalletBottomSheet()
return
}
val solTokenItem: Web3TokenItem? = chainToken ?: viewModel.web3TokenItemById(Web3Signer.currentWalletId, Chain.Solana.chainId)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chain.Solana.chainId is the WalletConnect-style chain identifier (e.g., solana:...), but web3TokenItemById(walletId, assetId) expects the Mixin chain/asset UUID (e.g., Constants.ChainId.SOLANA_CHAIN_ID, which is Chain.Solana.assetId). Using Chain.Solana.chainId here will likely return null and incorrectly show Data_error, blocking Solana signing when chainToken isn’t provided (e.g., Link flow).

Suggested change
val solTokenItem: Web3TokenItem? = chainToken ?: viewModel.web3TokenItemById(Web3Signer.currentWalletId, Chain.Solana.chainId)
val solTokenItem: Web3TokenItem? = chainToken ?: viewModel.web3TokenItemById(Web3Signer.currentWalletId, Chain.Solana.assetId)

Copilot uses AI. Check for mistakes.
@SeniorZhai SeniorZhai force-pushed the fix/solana-insufficient-sol-gate branch from 7e0d9a2 to 7d84d1f Compare January 28, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Now testing, but you can review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants