Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Base to Smart Transaction supported chains #30678

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b485d75
feat: add Base to allowed STX Chain IDs and relevant tests for Prod &…
httpJunkie Mar 3, 2025
7db8aa9
feat: update STX Opt In Description to say "supported networks" rathe…
httpJunkie Mar 3, 2025
d27ce64
feat: update test for `advanced-tab.component.test.js`
httpJunkie Mar 3, 2025
8135e87
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 3, 2025
5008e47
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 4, 2025
4508701
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 4, 2025
b1321e7
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 4, 2025
4ea2aef
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 5, 2025
39e6866
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 5, 2025
bd031df
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 5, 2025
f782722
feat: bump version of `@metamask/smart-transactions-controller`
httpJunkie Mar 5, 2025
52352a6
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 5, 2025
e8eb886
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 5, 2025
98cc2a9
fix: remove Base from STX production until ready (w/ todo comment)
httpJunkie Mar 6, 2025
3708d6a
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 6, 2025
386e182
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 7, 2025
f3305ff
Merge branch 'main' into feat/add-base-to-stx-supported-chains
httpJunkie Mar 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/en_GB/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
"@metamask/scure-bip39": "^2.0.3",
"@metamask/selected-network-controller": "^19.0.0",
"@metamask/signature-controller": "^23.1.0",
"@metamask/smart-transactions-controller": "^16.0.1",
"@metamask/smart-transactions-controller": "^16.1.0",
"@metamask/snaps-controllers": "^10.0.1",
"@metamask/snaps-execution-environments": "^7.0.0",
"@metamask/snaps-rpc-methods": "^11.13.1",
Expand Down
7 changes: 6 additions & 1 deletion shared/constants/smartTransactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ describe('smartTransactions', () => {
CHAIN_IDS.MAINNET,
CHAIN_IDS.SEPOLIA,
CHAIN_IDS.BSC,
CHAIN_IDS.BASE,
]);
});

it('should return the correct chain IDs for production environment', () => {
mockIsProduction.mockReturnValue(true);
const allowedChainIds = getAllowedSmartTransactionsChainIds();
expect(allowedChainIds).toStrictEqual([CHAIN_IDS.MAINNET, CHAIN_IDS.BSC]);
expect(allowedChainIds).toStrictEqual([
CHAIN_IDS.MAINNET,
CHAIN_IDS.BSC,
// CHAIN_IDS.BASE, // TODO: Add base to production when ready
]);
});
});
});
2 changes: 2 additions & 0 deletions shared/constants/smartTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_DEVELOPMENT: string[] = [
CHAIN_IDS.MAINNET,
CHAIN_IDS.SEPOLIA,
CHAIN_IDS.BSC,
CHAIN_IDS.BASE,
];

const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_PRODUCTION: string[] = [
CHAIN_IDS.MAINNET,
CHAIN_IDS.BSC,
// CHAIN_IDS.BASE, // TODO: Add base to production when ready
];

export const getAllowedSmartTransactionsChainIds = (): string[] => {
Expand Down
2 changes: 1 addition & 1 deletion ui/helpers/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const SETTINGS_CONSTANTS = [
{
tabMessage: (t) => t('advanced'),
sectionMessage: (t) => t('smartTransactions'),
descriptionMessage: (t) => t('stxOptInEthereumBnbDescription'),
descriptionMessage: (t) => t('stxOptInSupportedNetworksDescription'),
route: `${ADVANCED_ROUTE}#smart-transactions`,
icon: 'fas fa-upload',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ exports[`AdvancedTab Component should match snapshot 1`] = `
>
<span>

Turn on Smart Transactions for more reliable and secure transactions on Ethereum Mainnet and BNB Smart Chain.
Turn on Smart Transactions for more reliable and secure transactions on supported networks.
<a
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
href="https://support.metamask.io/transactions-and-gas/transactions/smart-transactions/"
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/settings/advanced-tab/advanced-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export default class AdvancedTab extends PureComponent {
<div className="settings-page__content-item">
<span>{t('smartTransactions')}</span>
<div className="settings-page__content-description">
{t('stxOptInEthereumBnbDescription', [learMoreLink])}
{t('stxOptInSupportedNetworksDescription', [learMoreLink])}
</div>
</div>

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6273,9 +6273,9 @@ __metadata:
languageName: node
linkType: hard

"@metamask/smart-transactions-controller@npm:^16.0.1":
version: 16.0.1
resolution: "@metamask/smart-transactions-controller@npm:16.0.1"
"@metamask/smart-transactions-controller@npm:^16.1.0":
version: 16.1.0
resolution: "@metamask/smart-transactions-controller@npm:16.1.0"
dependencies:
"@babel/runtime": "npm:^7.24.1"
"@ethereumjs/tx": "npm:^5.2.1"
Expand All @@ -6297,7 +6297,7 @@ __metadata:
optional: true
"@metamask/approval-controller":
optional: true
checksum: 10/9a4dba47e01c1e47f099faa74a9fdf3378c77e8ba6d699317f9b38df1d71893e5278d210f6f9cd0ff6d2641db502991f48f923e00847410be33ae1df0f69377c
checksum: 10/1b81adf30ee9b070cf36299110b15703941033cc8470943cbbda391a10c1b4d7014e30892d72b7620193a865c75a8251bc18034b3796f4597317d746554d38e5
languageName: node
linkType: hard

Expand Down Expand Up @@ -27367,7 +27367,7 @@ __metadata:
"@metamask/scure-bip39": "npm:^2.0.3"
"@metamask/selected-network-controller": "npm:^19.0.0"
"@metamask/signature-controller": "npm:^23.1.0"
"@metamask/smart-transactions-controller": "npm:^16.0.1"
"@metamask/smart-transactions-controller": "npm:^16.1.0"
"@metamask/snaps-controllers": "npm:^10.0.1"
"@metamask/snaps-execution-environments": "npm:^7.0.0"
"@metamask/snaps-rpc-methods": "npm:^11.13.1"
Expand Down
Loading