diff --git a/app/scripts/lib/offscreen-bridge/ledger-offscreen-bridge.ts b/app/scripts/lib/offscreen-bridge/ledger-offscreen-bridge.ts index 608d1ee8156b..1ff85111f54a 100644 --- a/app/scripts/lib/offscreen-bridge/ledger-offscreen-bridge.ts +++ b/app/scripts/lib/offscreen-bridge/ledger-offscreen-bridge.ts @@ -1,4 +1,8 @@ -import { LedgerBridge } from '@metamask/eth-ledger-bridge-keyring'; +import { + LedgerBridge, + LedgerSignTypedDataParams, + LedgerSignTypedDataResponse, +} from '@metamask/eth-ledger-bridge-keyring'; import { LedgerAction, OffscreenCommunicationEvents, @@ -161,11 +165,9 @@ export class LedgerOffscreenBridge }); } - deviceSignTypedData(params: { - hdPath: string; - domainSeparatorHex: string; - hashStructMessageHex: string; - }) { + deviceSignTypedData( + params: LedgerSignTypedDataParams, + ): Promise { return new Promise<{ v: number; s: string; diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 42c0b3ff7385..19996bfdbac4 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -844,7 +844,8 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-ledger-bridge-keyring>@ethereumjs/rlp": true, "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true, - "@metamask/eth-sig-util": true, + "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, "webpack>events": true @@ -1001,6 +1002,32 @@ "define": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-sig-util>tweetnacl": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true + } + }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-query": { "packages": { "@metamask/eth-query>json-rpc-random-id": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 42c0b3ff7385..19996bfdbac4 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -844,7 +844,8 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-ledger-bridge-keyring>@ethereumjs/rlp": true, "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true, - "@metamask/eth-sig-util": true, + "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, "webpack>events": true @@ -1001,6 +1002,32 @@ "define": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-sig-util>tweetnacl": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true + } + }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-query": { "packages": { "@metamask/eth-query>json-rpc-random-id": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 42c0b3ff7385..19996bfdbac4 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -844,7 +844,8 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-ledger-bridge-keyring>@ethereumjs/rlp": true, "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true, - "@metamask/eth-sig-util": true, + "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, "webpack>events": true @@ -1001,6 +1002,32 @@ "define": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-sig-util>tweetnacl": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true + } + }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-query": { "packages": { "@metamask/eth-query>json-rpc-random-id": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index cd8c3a1c7396..88dbf88db76a 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -936,7 +936,8 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-ledger-bridge-keyring>@ethereumjs/rlp": true, "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true, - "@metamask/eth-sig-util": true, + "@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, "webpack>events": true @@ -1093,6 +1094,32 @@ "define": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-sig-util>tweetnacl": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true + } + }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/eth-query": { "packages": { "@metamask/eth-query>json-rpc-random-id": true, diff --git a/offscreen/scripts/ledger.ts b/offscreen/scripts/ledger.ts index c08fdc6ac85a..4cff2f3a6748 100644 --- a/offscreen/scripts/ledger.ts +++ b/offscreen/scripts/ledger.ts @@ -96,7 +96,7 @@ function setupMessageListeners(iframe: HTMLIFrameElement) { export default async function init() { return new Promise((resolve) => { const iframe = document.createElement('iframe'); - iframe.src = 'https://metamask.github.io/eth-ledger-bridge-keyring'; + iframe.src = 'https://metamask.github.io/ledger-iframe-bridge/8.0.0/'; iframe.allow = 'hid'; iframe.onload = () => { setupMessageListeners(iframe); diff --git a/package.json b/package.json index cca9f509c9b5..f07f6b6c9304 100644 --- a/package.json +++ b/package.json @@ -297,7 +297,7 @@ "@metamask/ens-resolver-snap": "^0.1.2", "@metamask/eth-json-rpc-filters": "^9.0.0", "@metamask/eth-json-rpc-middleware": "^15.0.0", - "@metamask/eth-ledger-bridge-keyring": "^5.0.1", + "@metamask/eth-ledger-bridge-keyring": "^8.0.0", "@metamask/eth-query": "^4.0.0", "@metamask/eth-sig-util": "^7.0.1", "@metamask/eth-snap-keyring": "^5.0.1", diff --git a/yarn.lock b/yarn.lock index 0359c83c1da9..afcb83922eca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5298,17 +5298,17 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-ledger-bridge-keyring@npm:^5.0.1": - version: 5.0.1 - resolution: "@metamask/eth-ledger-bridge-keyring@npm:5.0.1" +"@metamask/eth-ledger-bridge-keyring@npm:^8.0.0": + version: 8.0.1 + resolution: "@metamask/eth-ledger-bridge-keyring@npm:8.0.1" dependencies: "@ethereumjs/rlp": "npm:^5.0.2" "@ethereumjs/tx": "npm:^4.2.0" "@ethereumjs/util": "npm:^8.1.0" "@ledgerhq/hw-app-eth": "npm:^6.39.0" - "@metamask/eth-sig-util": "npm:^7.0.3" + "@metamask/eth-sig-util": "npm:^8.0.0" hdkey: "npm:^2.1.0" - checksum: 10/5ac967d7c88c2f1f2853118cfe65ee081a90c2633fb468eae8049c3a78a4985f03130bff3071e9fb893e4c97bc55aeb2196e2b6e9e363ac6235379b80e7cfc7e + checksum: 10/1fe3782ab224cd55e825c41226451ec52141b12387e23a49f9786b4d1edbb1e16be02e13ec07ed26547c8d9651a9951060b72432d8adefd7975d3a313d701f2f languageName: node linkType: hard @@ -26546,7 +26546,7 @@ __metadata: "@metamask/eth-json-rpc-filters": "npm:^9.0.0" "@metamask/eth-json-rpc-middleware": "npm:^15.0.0" "@metamask/eth-json-rpc-provider": "npm:^4.1.6" - "@metamask/eth-ledger-bridge-keyring": "npm:^5.0.1" + "@metamask/eth-ledger-bridge-keyring": "npm:^8.0.0" "@metamask/eth-query": "npm:^4.0.0" "@metamask/eth-sig-util": "npm:^7.0.1" "@metamask/eth-snap-keyring": "npm:^5.0.1"