Skip to content

Commit fb5ffd3

Browse files
committed
Merge branch 'develop' into bump/eth-json-rpc-provider-14.0.0
2 parents 3c40934 + f6fc55e commit fb5ffd3

File tree

50 files changed

+662
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+662
-260
lines changed

.github/workflows/add-team-label.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ on:
77

88
jobs:
99
add-team-label:
10-
uses: metamask/github-tools/.github/workflows/add-team-label.yml@main
10+
uses: metamask/github-tools/.github/workflows/add-team-label.yml@7c10eb3bafb3f221111a9e4309ae5dcaee171de5
1111
secrets:
1212
PERSONAL_ACCESS_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }}

app/_locales/en/messages.json

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/controllers/preferences.js

+13
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default class PreferencesController {
5858
useRequestQueue: true,
5959
openSeaEnabled: true, // todo set this to true
6060
securityAlertsEnabled: true,
61+
watchEthereumAccountEnabled: false,
6162
bitcoinSupportEnabled: false,
6263
bitcoinTestnetSupportEnabled: false,
6364
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
@@ -290,6 +291,18 @@ export default class PreferencesController {
290291
}
291292
///: END:ONLY_INCLUDE_IF
292293

294+
/**
295+
* Setter for the `watchEthereumAccountEnabled` property.
296+
*
297+
* @param {boolean} watchEthereumAccountEnabled - Whether or not the user wants to
298+
* enable the "Watch Ethereum account (Beta)" button.
299+
*/
300+
setWatchEthereumAccountEnabled(watchEthereumAccountEnabled) {
301+
this.store.updateState({
302+
watchEthereumAccountEnabled,
303+
});
304+
}
305+
293306
/**
294307
* Setter for the `bitcoinSupportEnabled` property.
295308
*

app/scripts/controllers/swaps/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { CHAIN_IDS } from '../../../../shared/constants/network';
2323
import {
2424
FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER,
2525
FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
26+
FALLBACK_SMART_TRANSACTIONS_DEADLINE,
2627
} from '../../../../shared/constants/smartTransactions';
2728
import {
2829
DEFAULT_ERC20_APPROVE_GAS,
@@ -1082,6 +1083,9 @@ export default class SwapsController extends BaseController<
10821083
_state.swapsState.swapsStxMaxFeeMultiplier =
10831084
swapsNetworkConfig?.stxMaxFeeMultiplier ||
10841085
FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER;
1086+
_state.swapsState.swapsStxStatusDeadline =
1087+
swapsNetworkConfig?.stxStatusDeadline ||
1088+
FALLBACK_SMART_TRANSACTIONS_DEADLINE;
10851089
});
10861090
}
10871091

app/scripts/controllers/swaps/swaps.constants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
FALLBACK_SMART_TRANSACTIONS_DEADLINE,
23
FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER,
34
FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
45
} from '../../../../shared/constants/smartTransactions';
@@ -44,6 +45,7 @@ export function getDefaultSwapsControllerState(): SwapsControllerState {
4445
swapsQuoteRefreshTime: FALLBACK_QUOTE_REFRESH_TIME,
4546
swapsQuotePrefetchingRefreshTime: FALLBACK_QUOTE_REFRESH_TIME,
4647
swapsStxBatchStatusRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
48+
swapsStxStatusDeadline: FALLBACK_SMART_TRANSACTIONS_DEADLINE,
4749
swapsStxGetTransactionsRefreshTime:
4850
FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME,
4951
swapsStxMaxFeeMultiplier: FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER,

app/scripts/controllers/swaps/swaps.test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ describe('SwapsController', function () {
10961096
oldState.swapsState.swapsStxGetTransactionsRefreshTime,
10971097
swapsStxBatchStatusRefreshTime:
10981098
oldState.swapsState.swapsStxBatchStatusRefreshTime,
1099+
swapsStxStatusDeadline: oldState.swapsState.swapsStxStatusDeadline,
10991100
});
11001101
});
11011102

@@ -1171,6 +1172,7 @@ describe('SwapsController', function () {
11711172
const swapsQuotePrefetchingRefreshTime = 0;
11721173
const swapsStxBatchStatusRefreshTime = 0;
11731174
const swapsStxGetTransactionsRefreshTime = 0;
1175+
const swapsStxStatusDeadline = 0;
11741176
swapsController.__test__updateState({
11751177
swapsState: {
11761178
...swapsController.state.swapsState,
@@ -1182,6 +1184,7 @@ describe('SwapsController', function () {
11821184
swapsQuotePrefetchingRefreshTime,
11831185
swapsStxBatchStatusRefreshTime,
11841186
swapsStxGetTransactionsRefreshTime,
1187+
swapsStxStatusDeadline,
11851188
},
11861189
});
11871190

app/scripts/lib/setupSentry.js

+2
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ export const SENTRY_BACKGROUND_STATE = {
352352
swapsQuotePrefetchingRefreshTime: true,
353353
swapsQuoteRefreshTime: true,
354354
swapsStxBatchStatusRefreshTime: true,
355+
swapsStxStatusDeadline: true,
355356
swapsStxGetTransactionsRefreshTime: true,
356357
swapsStxMaxFeeMultiplier: true,
357358
swapsUserFeeLevel: true,
@@ -435,6 +436,7 @@ export const SENTRY_UI_STATE = {
435436
welcomeScreenSeen: true,
436437
confirmationExchangeRates: true,
437438
useSafeChainsListValidation: true,
439+
watchEthereumAccountEnabled: false,
438440
bitcoinSupportEnabled: false,
439441
bitcoinTestnetSupportEnabled: false,
440442
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { SnapId } from '@metamask/snaps-sdk';
2+
import AccountWatcherSnap from '@metamask/account-watcher/dist/preinstalled-snap.json';
3+
4+
export const ACCOUNT_WATCHER_SNAP_ID: SnapId =
5+
AccountWatcherSnap.snapId as SnapId;
6+
7+
export const ACCOUNT_WATCHER_NAME: string =
8+
AccountWatcherSnap.manifest.proposedName;

app/scripts/metamask-controller.js

+4
Original file line numberDiff line numberDiff line change
@@ -3152,6 +3152,10 @@ export default class MetamaskController extends EventEmitter {
31523152
preferencesController,
31533153
),
31543154
///: END:ONLY_INCLUDE_IF
3155+
setWatchEthereumAccountEnabled:
3156+
preferencesController.setWatchEthereumAccountEnabled.bind(
3157+
preferencesController,
3158+
),
31553159
setBitcoinSupportEnabled:
31563160
preferencesController.setBitcoinSupportEnabled.bind(
31573161
preferencesController,

app/scripts/snaps/preinstalled-snaps.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import type { PreinstalledSnap } from '@metamask/snaps-controllers';
22
import MessageSigningSnap from '@metamask/message-signing-snap/dist/preinstalled-snap.json';
3+
import AccountWatcherSnap from '@metamask/account-watcher/dist/preinstalled-snap.json';
34
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
45
import BitcoinWalletSnap from '@metamask/bitcoin-wallet-snap/dist/preinstalled-snap.json';
56
///: END:ONLY_INCLUDE_IF
67

78
// The casts here are less than ideal but we expect the SnapController to validate the inputs.
89
const PREINSTALLED_SNAPS = Object.freeze<PreinstalledSnap[]>([
910
MessageSigningSnap as PreinstalledSnap,
11+
AccountWatcherSnap as PreinstalledSnap,
1012
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
1113
BitcoinWalletSnap as unknown as PreinstalledSnap,
1214
///: END:ONLY_INCLUDE_IF

jest.config.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ module.exports = {
77
'<rootDir>/test/unit-global/**/*.test.(js|ts|tsx)',
88
],
99
coverageDirectory: './coverage',
10-
coveragePathIgnorePatterns: [
11-
'<rootDir>/test/unit-global/protect-intrinsics.test.js',
12-
'.stories.*',
13-
'.snap',
14-
],
10+
coveragePathIgnorePatterns: ['.stories.*', '.snap'],
1511
coverageReporters: process.env.CI ? ['json'] : ['html', 'json'],
1612
reporters: [
1713
'default',
@@ -36,10 +32,7 @@ module.exports = {
3632
'<rootDir>/test/unit-global/**/*.test.(js|ts|tsx)',
3733
'<rootDir>/test/e2e/helpers.test.js',
3834
],
39-
testPathIgnorePatterns: [
40-
'<rootDir>/test/unit-global/protect-intrinsics.test.js',
41-
'<rootDir>/development/webpack/',
42-
],
35+
testPathIgnorePatterns: ['<rootDir>/development/webpack/'],
4336
testTimeout: 5500,
4437
// We have to specify the environment we are running in, which is jsdom. The
4538
// default is 'node'. This can be modified *per file* using a comment at the

lavamoat/browserify/beta/policy.json

+6-34
Original file line numberDiff line numberDiff line change
@@ -174,44 +174,16 @@
174174
"crypto": true
175175
},
176176
"packages": {
177-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true,
178-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true,
179-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true
180-
}
181-
},
182-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": {
183-
"globals": {
184-
"TextEncoder": true
185-
},
186-
"packages": {
187-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true
188-
}
189-
},
190-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": {
191-
"globals": {
192-
"TextEncoder": true,
193-
"crypto": true
177+
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true,
178+
"@metamask/message-signing-snap>@noble/curves": true,
179+
"@noble/hashes": true
194180
}
195181
},
196182
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": {
197183
"packages": {
198-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": true,
199-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true,
200-
"@metamask/utils>@scure/base": true
201-
}
202-
},
203-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": {
204-
"globals": {
205-
"TextEncoder": true
206-
},
207-
"packages": {
208-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true
209-
}
210-
},
211-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": {
212-
"globals": {
213-
"TextEncoder": true,
214-
"crypto": true
184+
"@metamask/message-signing-snap>@noble/curves": true,
185+
"@metamask/utils>@scure/base": true,
186+
"@noble/hashes": true
215187
}
216188
},
217189
"@ethersproject/abi": {

lavamoat/browserify/flask/policy.json

+6-34
Original file line numberDiff line numberDiff line change
@@ -174,44 +174,16 @@
174174
"crypto": true
175175
},
176176
"packages": {
177-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true,
178-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true,
179-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true
180-
}
181-
},
182-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": {
183-
"globals": {
184-
"TextEncoder": true
185-
},
186-
"packages": {
187-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true
188-
}
189-
},
190-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": {
191-
"globals": {
192-
"TextEncoder": true,
193-
"crypto": true
177+
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true,
178+
"@metamask/message-signing-snap>@noble/curves": true,
179+
"@noble/hashes": true
194180
}
195181
},
196182
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": {
197183
"packages": {
198-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": true,
199-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true,
200-
"@metamask/utils>@scure/base": true
201-
}
202-
},
203-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": {
204-
"globals": {
205-
"TextEncoder": true
206-
},
207-
"packages": {
208-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true
209-
}
210-
},
211-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": {
212-
"globals": {
213-
"TextEncoder": true,
214-
"crypto": true
184+
"@metamask/message-signing-snap>@noble/curves": true,
185+
"@metamask/utils>@scure/base": true,
186+
"@noble/hashes": true
215187
}
216188
},
217189
"@ethersproject/abi": {

lavamoat/browserify/main/policy.json

+6-34
Original file line numberDiff line numberDiff line change
@@ -174,44 +174,16 @@
174174
"crypto": true
175175
},
176176
"packages": {
177-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true,
178-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true,
179-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true
180-
}
181-
},
182-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": {
183-
"globals": {
184-
"TextEncoder": true
185-
},
186-
"packages": {
187-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true
188-
}
189-
},
190-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": {
191-
"globals": {
192-
"TextEncoder": true,
193-
"crypto": true
177+
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true,
178+
"@metamask/message-signing-snap>@noble/curves": true,
179+
"@noble/hashes": true
194180
}
195181
},
196182
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": {
197183
"packages": {
198-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": true,
199-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true,
200-
"@metamask/utils>@scure/base": true
201-
}
202-
},
203-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": {
204-
"globals": {
205-
"TextEncoder": true
206-
},
207-
"packages": {
208-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true
209-
}
210-
},
211-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": {
212-
"globals": {
213-
"TextEncoder": true,
214-
"crypto": true
184+
"@metamask/message-signing-snap>@noble/curves": true,
185+
"@metamask/utils>@scure/base": true,
186+
"@noble/hashes": true
215187
}
216188
},
217189
"@ethersproject/abi": {

lavamoat/browserify/mmi/policy.json

+6-34
Original file line numberDiff line numberDiff line change
@@ -174,44 +174,16 @@
174174
"crypto": true
175175
},
176176
"packages": {
177-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true,
178-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true,
179-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true
180-
}
181-
},
182-
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": {
183-
"globals": {
184-
"TextEncoder": true
185-
},
186-
"packages": {
187-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true
188-
}
189-
},
190-
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": {
191-
"globals": {
192-
"TextEncoder": true,
193-
"crypto": true
177+
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": true,
178+
"@metamask/message-signing-snap>@noble/curves": true,
179+
"@noble/hashes": true
194180
}
195181
},
196182
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32": {
197183
"packages": {
198-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": true,
199-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true,
200-
"@metamask/utils>@scure/base": true
201-
}
202-
},
203-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/curves": {
204-
"globals": {
205-
"TextEncoder": true
206-
},
207-
"packages": {
208-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": true
209-
}
210-
},
211-
"@ethereumjs/tx>ethereum-cryptography>@scure/bip32>@noble/hashes": {
212-
"globals": {
213-
"TextEncoder": true,
214-
"crypto": true
184+
"@metamask/message-signing-snap>@noble/curves": true,
185+
"@metamask/utils>@scure/base": true,
186+
"@noble/hashes": true
215187
}
216188
},
217189
"@ethersproject/abi": {

0 commit comments

Comments
 (0)