diff --git a/app/scripts/controllers/mmi-controller.ts b/app/scripts/controllers/mmi-controller.ts index 33923f02bde2..9f2701b2c0b9 100644 --- a/app/scripts/controllers/mmi-controller.ts +++ b/app/scripts/controllers/mmi-controller.ts @@ -24,9 +24,9 @@ import { NetworkState } from '@metamask/network-controller'; import { MessageParamsPersonal, MessageParamsTyped, + OriginalRequest, SignatureController, } from '@metamask/signature-controller'; -import { OriginalRequest } from '@metamask/message-manager'; import { InternalAccount } from '@metamask/keyring-api'; import { toHex } from '@metamask/controller-utils'; import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils'; diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 9632e072c70b..029d2b017e67 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -2001,6 +2001,11 @@ export default class MetamaskController extends EventEmitter { ], }), trace, + decodingApiUrl: process.env.DECODING_API_URL, + isDecodeSignatureRequestEnabled: () => + this.preferencesController.state.useExternalServices === true && + this.preferencesController.state.useTransactionSimulations && + process.env.ENABLE_SIGNATURE_DECODING === true, }); this.signatureController.hub.on( diff --git a/builds.yml b/builds.yml index d60365f8bc5a..316e8f943eb1 100644 --- a/builds.yml +++ b/builds.yml @@ -235,6 +235,10 @@ env: # Used to enable confirmation redesigned pages - ENABLE_CONFIRMATION_REDESIGN: '' + # Used to enable signature decoding + - ENABLE_SIGNATURE_DECODING: '' + # URL of the decoding API used to provide additional data from signature requests + - DECODING_API_URL: null # Determines if feature flagged Settings Page - Developer Options should be used - ENABLE_SETTINGS_PAGE_DEV_OPTIONS: false # Used for debugging changes to the phishing warning page. diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 94bf575e610a..2993482ec504 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2603,6 +2603,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 94bf575e610a..2993482ec504 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2603,6 +2603,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 94bf575e610a..2993482ec504 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2603,6 +2603,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 9acbc67302ab..02d73c44f420 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -2695,6 +2695,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/package.json b/package.json index 6c9811cb3ed6..5be5168b34c2 100644 --- a/package.json +++ b/package.json @@ -345,7 +345,7 @@ "@metamask/safe-event-emitter": "^3.1.1", "@metamask/scure-bip39": "^2.0.3", "@metamask/selected-network-controller": "^18.0.2", - "@metamask/signature-controller": "^21.0.0", + "@metamask/signature-controller": "^21.1.0", "@metamask/smart-transactions-controller": "^13.0.0", "@metamask/snaps-controllers": "^9.12.0", "@metamask/snaps-execution-environments": "^6.9.2", diff --git a/yarn.lock b/yarn.lock index d40270b12e9c..3eee3119dc71 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6312,12 +6312,12 @@ __metadata: languageName: node linkType: hard -"@metamask/signature-controller@npm:^21.0.0": - version: 21.0.0 - resolution: "@metamask/signature-controller@npm:21.0.0" +"@metamask/signature-controller@npm:^21.1.0": + version: 21.1.0 + resolution: "@metamask/signature-controller@npm:21.1.0" dependencies: "@metamask/base-controller": "npm:^7.0.2" - "@metamask/controller-utils": "npm:^11.4.1" + "@metamask/controller-utils": "npm:^11.4.2" "@metamask/eth-sig-util": "npm:^8.0.0" "@metamask/utils": "npm:^10.0.0" jsonschema: "npm:^1.2.4" @@ -6328,7 +6328,7 @@ __metadata: "@metamask/keyring-controller": ^17.0.0 "@metamask/logging-controller": ^6.0.0 "@metamask/network-controller": ^22.0.0 - checksum: 10/4c1b1cbf909004099adb3f0d2b01c8fe640ae9a13a8e53ffbcf05c7a1a23384f6077b96b845c22c4edf3bceaaff2a705769d4623f37affac7e429ab0dae06912 + checksum: 10/00d28234d6402632ecf000d7c908a134a0f49cbbdb165a7cfe72895bc91248de82947cd9628dbbe953ffb8b6054f84a0dc1ad824a1aff369d8f2189a78fd56a9 languageName: node linkType: hard @@ -26763,7 +26763,7 @@ __metadata: "@metamask/safe-event-emitter": "npm:^3.1.1" "@metamask/scure-bip39": "npm:^2.0.3" "@metamask/selected-network-controller": "npm:^18.0.2" - "@metamask/signature-controller": "npm:^21.0.0" + "@metamask/signature-controller": "npm:^21.1.0" "@metamask/smart-transactions-controller": "npm:^13.0.0" "@metamask/snaps-controllers": "npm:^9.12.0" "@metamask/snaps-execution-environments": "npm:^6.9.2"