Skip to content

Commit

Permalink
use preview build from MetaMask/core#4602
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Aug 28, 2024
1 parent 80b561c commit dbdc9f3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
29 changes: 29 additions & 0 deletions app/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ import {
ApprovalControllerEvents,
ApprovalControllerState,
} from '@metamask/approval-controller';
import {
METAMASK_DOMAIN,
SelectedNetworkController,
SelectedNetworkControllerState,
createSelectedNetworkMiddleware,
} from '@metamask/selected-network-controller';
import {
PermissionController,
PermissionControllerActions,
Expand Down Expand Up @@ -336,6 +342,7 @@ export interface EngineState {
LoggingController: LoggingControllerState;
PPOMController: PPOMState;
AccountsController: AccountsControllerState;
SelectedNetworkController: SelectedNetworkControllerState;
}

/**
Expand Down Expand Up @@ -898,6 +905,28 @@ class Engine {
unrestrictedMethods,
});

const selectedNetworkController = new SelectedNetworkController({
messenger: this.controllerMessenger.getRestricted({
name: 'SelectedNetworkController',
allowedActions: [
'NetworkController:getNetworkClientById',
'NetworkController:getState',
'NetworkController:getSelectedNetworkClient',
'PermissionController:hasPermissions',
'PermissionController:getSubjectNames',
],
allowedEvents: [
'NetworkController:stateChange',
'PermissionController:stateChange',
],
}),
state: initialState.SelectedNetworkController || { domains: {} },
useRequestQueuePreference: !!process.env.MULTICHAIN_V1,
// @ts-expect-error TODO: Resolve mismatch between PreferenceController versions.
onPreferencesStateChange,
domainProxyMap: new WeakRefObjectMap(),
});

///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
const subjectMetadataController = new SubjectMetadataController({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"@metamask/rpc-errors": "^6.2.1",
"@metamask/scure-bip39": "^2.1.0",
"@metamask/sdk-communication-layer": "^0.28.1",
"@metamask/selected-network-controller": "^15.0.2",
"@metamask/signature-controller": "^16.0.0",
"@metamask/slip44": "3.1.0",
"@metamask/smart-transactions-controller": "11.0.0",
Expand Down Expand Up @@ -478,12 +479,14 @@
"prettier-plugin-gherkin": "^1.1.1",
"react-dom": "18.2.0",
"react-native-cli": "2.0.1",
"react-native-flipper": "^0.263.0",
"react-native-launch-arguments": "^4.0.1",
"react-native-performance": "^5.1.2",
"react-native-storybook-loader": "^2.0.4",
"react-native-svg-asset-plugin": "^0.5.0",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.2.0",
"redux-flipper": "^2.0.3",
"regenerator-runtime": "0.13.9",
"rn-nodeify": "10.3.0",
"serve-handler": "^6.1.5",
Expand All @@ -495,9 +498,7 @@
"webpack-cli": "^5.1.4",
"xhr2": "^0.2.1",
"xml2js": "^0.5.0",
"yarn-deduplicate": "^6.0.2",
"redux-flipper": "^2.0.3",
"react-native-flipper": "^0.263.0"
"yarn-deduplicate": "^6.0.2"
},
"config": {
"react-native-storybook-loader": {
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5210,6 +5210,18 @@
utf-8-validate "^5.0.2"
uuid "^8.3.2"

"@metamask/selected-network-controller@^15.0.2":
version "15.0.2"
resolved "https://registry.yarnpkg.com/@metamask/selected-network-controller/-/selected-network-controller-15.0.2.tgz#6373156a1e837839ea771b61aa065f69b47a90c9"
integrity sha512-B4jZO0g49NwK78Zh391UOZsGYlHlWw/GMVkb9rXDLBYpbXSgiVMb5mdgdfqSWvi2YnFuwiCDPTszwBTM+M+aLA==
dependencies:
"@metamask/base-controller" "^6.0.0"
"@metamask/json-rpc-engine" "^9.0.0"
"@metamask/network-controller" "^19.0.0"
"@metamask/permission-controller" "^10.0.0"
"@metamask/swappable-obj-proxy" "^2.2.0"
"@metamask/utils" "^8.3.0"

"@metamask/signature-controller@^16.0.0":
version "16.0.0"
resolved "https://registry.yarnpkg.com/@metamask/signature-controller/-/signature-controller-16.0.0.tgz#78c7f23d02da99d4e953eb9b4e8e2909523a3288"
Expand Down

0 comments on commit dbdc9f3

Please sign in to comment.