Skip to content

feat: Bitcoin alignment: networks#17232

Merged
darioAnongba merged 27 commits into
mainfrom
feat/bitcoin-alignment
Jul 21, 2025
Merged

feat: Bitcoin alignment: networks#17232
darioAnongba merged 27 commits into
mainfrom
feat/bitcoin-alignment

Conversation

@darioAnongba

@darioAnongba darioAnongba commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Description

Align Bitcoin features with extension: Add networks and account types.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/NWNT-404

Manual testing steps

  1. Use Beta build
  2. Create a Bitcoin account
  3. See Bitcoin network in the network list

Screenshots/Recordings

Before

After

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.

@darioAnongba darioAnongba self-assigned this Jul 15, 2025
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-networks Networks team label Jul 15, 2025
@darioAnongba darioAnongba added the No QA Needed Apply this label when your PR does not need any QA effort. label Jul 16, 2025
@github-actions

github-actions Bot commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 4ccb934
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/67688daa-f206-4b42-abc2-102030ed3c62

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Daniel-Cross
Daniel-Cross previously approved these changes Jul 18, 2025
gambinish
gambinish previously approved these changes Jul 18, 2025
ccharly
ccharly previously approved these changes Jul 21, 2025

@ccharly ccharly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM for accounts owned files (haven't tested though):

app/core/SnapKeyring/MultichainWalletSnapClient.test.ts
app/core/SnapKeyring/MultichainWalletSnapClient.ts
app/core/SnapKeyring/utils/getMultichainAccountName.test.ts
app/core/SnapKeyring/utils/getMultichainAccountName.ts

Could you also update the "Manual steps" section, so other would know how to test that during RC validation, thanks! 😄

@darioAnongba darioAnongba dismissed stale reviews from ccharly, gambinish, and Daniel-Cross via da022d2 July 21, 2025 13:01
cursor[bot]

This comment was marked as outdated.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 89.85507% with 7 lines in your changes missing coverage. Please review.

Project coverage is 73.75%. Comparing base (9d8183d) to head (da022d2).

Files with missing lines Patch % Lines
...ents/Views/AddAccountActions/AddAccountActions.tsx 75.00% 1 Missing and 1 partial ⚠️
...mponents/Views/NetworkSelector/NetworkSelector.tsx 80.00% 1 Missing and 1 partial ⚠️
...onents/UI/Tokens/TokenList/TokenListItem/index.tsx 0.00% 1 Missing ⚠️
...nTransactionsView/MultichainTransactionsFooter.tsx 50.00% 1 Missing ⚠️
...ainTransactionsView/MultichainTransactionsView.tsx 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17232      +/-   ##
==========================================
- Coverage   73.75%   73.75%   -0.01%     
==========================================
  Files        2846     2846              
  Lines       63622    63629       +7     
  Branches    10390    10393       +3     
==========================================
+ Hits        46926    46929       +3     
- Misses      13668    13672       +4     
  Partials     3028     3028              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ccharly
ccharly previously approved these changes Jul 21, 2025
gambinish
gambinish previously approved these changes Jul 21, 2025
@darioAnongba darioAnongba dismissed stale reviews from gambinish and ccharly via 16a7004 July 21, 2025 15:01

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Chain ID Mismatch Causes Transaction URL Errors

The ActivityView component passes an incorrect chainId to MultichainTransactionsView when a non-EVM account is selected. The currentChainId is obtained using selectChainId, which returns an EVM chain ID (e.g., "0x1"). However, MultichainTransactionsView expects a CAIP chain ID format (e.g., "eip155:1") for non-EVM transactions. This mismatch results in incorrect block explorer URLs for transactions on non-EVM networks (e.g., Bitcoin, Solana) and can lead to parsing errors.

app/components/Views/ActivityView/index.js#L108-L218

);
const currentChainId = useSelector(selectChainId);
const isAllNetworks = useSelector(selectIsAllNetworks);
const isPopularNetwork = useSelector(selectIsPopularNetwork);
const isEvmSelected = useSelector(selectIsEvmNetworkSelected);
const networkName = useSelector(selectNetworkName);
const hasOrders = useSelector((state) => getHasOrders(state) || false);
const accountsByChainId = useSelector(selectAccountsByChainId);
const tabViewRef = useRef();
const params = useParams();
const isTestnetOrNotPopularNetwork =
isTestNet(currentChainId) || !isPopularNetwork;
const openAccountSelector = useCallback(() => {
navigation.navigate(Routes.MODAL.ROOT_MODAL_FLOW, {
screen: Routes.SHEET.ACCOUNT_SELECTOR,
});
// Track Event: "Opened Acount Switcher"
trackEvent(
createEventBuilder(MetaMetricsEvents.BROWSER_OPEN_ACCOUNT_SWITCH)
.addProperties({
number_of_accounts: Object.keys(
accountsByChainId[selectedAddress] ?? {},
).length,
})
.build(),
);
}, [
navigation,
accountsByChainId,
selectedAddress,
trackEvent,
createEventBuilder,
]);
const showFilterControls = () => {
navigation.navigate(...createTokenBottomSheetFilterNavDetails({}));
};
useEffect(
() => {
const title =
hasOrders ?? false ? 'activity_view.title' : 'transactions_view.title';
navigation.setOptions(
getTransactionsNavbarOptions(
title,
colors,
navigation,
selectedAddress,
openAccountSelector,
),
);
},
/* eslint-disable-next-line */
[navigation, hasOrders, colors, selectedAddress, openAccountSelector],
);
const renderTabBar = () => (hasOrders ? <TabBar /> : <View />);
useFocusEffect(
useCallback(() => {
if (hasOrders && params.redirectToOrders) {
navigation.setParams({ redirectToOrders: false });
tabViewRef.current?.goToPage(1);
}
}, [hasOrders, navigation, params.redirectToOrders]),
);
return (
<ErrorBoundary navigation={navigation} view="ActivityView">
<View style={[styles.header, { marginTop: insets.top }]}>
<Text
style={styles.title}
variant={DEFAULT_HEADERBASE_TITLE_TEXTVARIANT}
>
{strings('transactions_view.title')}
</Text>
</View>
<View style={styles.wrapper}>
<View style={styles.controlButtonOuterWrapper}>
<ButtonBase
testID={WalletViewSelectorsIDs.TOKEN_NETWORK_FILTER}
label={
<Text numberOfLines={1} style={styles.titleText}>
{isAllNetworks && isPopularNetwork && isEvmSelected
? strings('wallet.popular_networks')
: networkName ?? strings('wallet.current_network')}
</Text>
}
isDisabled={isTestnetOrNotPopularNetwork}
onPress={isEvmSelected ? showFilterControls : () => null}
endIconName={isEvmSelected ? IconName.ArrowDown : undefined}
style={
isTestNet(currentChainId) || !isPopularNetwork
? styles.controlButtonDisabled
: styles.controlButton
}
disabled={isTestNet(currentChainId) || !isPopularNetwork}
/>
</View>
<ScrollableTabView
ref={tabViewRef}
renderTabBar={renderTabBar}
locked={!hasOrders}
>
{selectedAddress && isNonEvmAddress(selectedAddress) ? (
<MultichainTransactionsView
tabLabel={strings('transactions_view.title')}
chainId={currentChainId}
/>

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@sonarqubecloud

Copy link
Copy Markdown

@darioAnongba darioAnongba added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit 2737a7d Jul 21, 2025
87 of 100 checks passed
@darioAnongba darioAnongba deleted the feat/bitcoin-alignment branch July 21, 2025 20:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 21, 2025
@metamaskbot metamaskbot added the release-7.53.0 Issue or pull request that will be included in release 7.53.0 label Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.53.0 Issue or pull request that will be included in release 7.53.0 team-networks Networks team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants