Skip to content

Commit 1e9fd15

Browse files
authored
fix(ramp): cp-7.46.0 non evm address balance (#14858)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Fixes a bug where a solana address was being passed to a function expecting `0x..` addresses. Related: https://consensys.slack.com/archives/C04G8UGLL4R/p1745447050063689 ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to Buy in Solana account 2. App must not crash 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
1 parent deca518 commit 1e9fd15

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ import Text, {
8383
} from '../../../../../component-library/components/Texts/Text';
8484
import ListItemColumnEnd from '../../components/ListItemColumnEnd';
8585
import { BuildQuoteSelectors } from '../../../../../../e2e/selectors/Ramps/BuildQuote.selectors';
86+
import { isNonEvmAddress } from '../../../../../core/Multichain/utils';
8687
import { trace, endTrace, TraceName } from '../../../../../util/trace';
8788

8889
// TODO: Replace "any" with type
@@ -245,9 +246,14 @@ const BuildQuote = () => {
245246
[selectedAsset],
246247
);
247248

249+
const addressForBalance = useMemo(
250+
() => (isNonEvmAddress(selectedAddress) ? undefined : selectedAddress),
251+
[selectedAddress],
252+
);
253+
248254
const { addressBalance } = useAddressBalance(
249255
assetForBalance as Asset,
250-
selectedAddress,
256+
addressForBalance,
251257
true,
252258
);
253259

0 commit comments

Comments
 (0)