diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 430b196d5a7f..b73139680e7c 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -809,6 +809,12 @@ "@metamask/eth-json-rpc-middleware>@metamask/utils": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, @@ -1082,7 +1088,8 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": 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, "browserify>buffer": true, "webpack>events": true, "@metamask/eth-trezor-keyring>hdkey": true @@ -1116,6 +1123,17 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -2064,6 +2082,21 @@ "semver": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 430b196d5a7f..b73139680e7c 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -809,6 +809,12 @@ "@metamask/eth-json-rpc-middleware>@metamask/utils": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, @@ -1082,7 +1088,8 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": 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, "browserify>buffer": true, "webpack>events": true, "@metamask/eth-trezor-keyring>hdkey": true @@ -1116,6 +1123,17 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -2064,6 +2082,21 @@ "semver": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 430b196d5a7f..b73139680e7c 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -809,6 +809,12 @@ "@metamask/eth-json-rpc-middleware>@metamask/utils": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, @@ -1082,7 +1088,8 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": 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, "browserify>buffer": true, "webpack>events": true, "@metamask/eth-trezor-keyring>hdkey": true @@ -1116,6 +1123,17 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -2064,6 +2082,21 @@ "semver": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index b5f88a04662a..8b4f7a99f7d9 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -901,6 +901,12 @@ "@metamask/eth-json-rpc-middleware>@metamask/utils": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, @@ -1174,7 +1180,8 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": 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, "browserify>buffer": true, "webpack>events": true, "@metamask/eth-trezor-keyring>hdkey": true @@ -1208,6 +1215,17 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -2156,6 +2174,21 @@ "semver": true } }, + "@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/package.json b/package.json index 10497c69cbb2..886b2a65500f 100644 --- a/package.json +++ b/package.json @@ -306,7 +306,7 @@ "@metamask/ens-resolver-snap": "^0.1.2", "@metamask/eth-json-rpc-filters": "^9.0.0", "@metamask/eth-json-rpc-middleware": "^15.1.2", - "@metamask/eth-ledger-bridge-keyring": "^5.0.1", + "@metamask/eth-ledger-bridge-keyring": "^8.0.1", "@metamask/eth-query": "^4.0.0", "@metamask/eth-sig-util": "^7.0.1", "@metamask/eth-snap-keyring": "^7.0.0", diff --git a/ui/components/app/snaps/snap-home-page/snap-home-renderer.js b/ui/components/app/snaps/snap-home-page/snap-home-renderer.js index d0acd2060f9b..d396ffc7e8c5 100644 --- a/ui/components/app/snaps/snap-home-page/snap-home-renderer.js +++ b/ui/components/app/snaps/snap-home-page/snap-home-renderer.js @@ -64,16 +64,16 @@ export const SnapHomeRenderer = ({ snapId }) => { } }, [unapprovedTemplatedConfirmations, unapprovedConfirmations, history]); - return ( - - {error && ( + if (error) { + return ( + @@ -82,18 +82,19 @@ export const SnapHomeRenderer = ({ snapId }) => { - )} - {(interfaceId || loading) && ( - - )} - + + ); + } + + return ( + ); }; diff --git a/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js b/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js index 481a51a0a202..179d0ca6f203 100644 --- a/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js +++ b/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js @@ -99,6 +99,10 @@ const SnapUIRendererComponent = ({ const { state: initialState, context } = interfaceState; + // The renderer should only have a footer if there is a default cancel action + // or if the footer component has been used. + const hasFooter = onCancel || content?.props?.children?.[1] !== undefined; + return useDelineator ? ( diff --git a/ui/pages/routes/routes.component.js b/ui/pages/routes/routes.component.js index 74f15a5f99c6..15a09a5a2719 100644 --- a/ui/pages/routes/routes.component.js +++ b/ui/pages/routes/routes.component.js @@ -194,9 +194,9 @@ export default class Routes extends Component { totalUnapprovedConfirmationCount: PropTypes.number.isRequired, currentExtensionPopupId: PropTypes.number, clearEditedNetwork: PropTypes.func.isRequired, - oldestPendingApproval: PropTypes.object.isRequired, + oldestPendingApproval: PropTypes.object, pendingApprovals: PropTypes.arrayOf(PropTypes.object).isRequired, - transactionsMetadata: PropTypes.arrayOf(PropTypes.object).isRequired, + transactionsMetadata: PropTypes.object, ///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps) isShowKeyringSnapRemovalResultModal: PropTypes.bool.isRequired, hideShowKeyringSnapRemovalResultModal: PropTypes.func.isRequired, diff --git a/ui/pages/snaps/snap-view/snap-home.js b/ui/pages/snaps/snap-view/snap-home.js deleted file mode 100644 index 08b327b036d2..000000000000 --- a/ui/pages/snaps/snap-view/snap-home.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -import { SnapHomeRenderer } from '../../../components/app/snaps/snap-home-page/snap-home-renderer'; -import { Box } from '../../../components/component-library'; -import { BlockSize, Display } from '../../../helpers/constants/design-system'; - -function SnapHome({ snapId }) { - return ( - - - - ); -} - -SnapHome.propTypes = { - snapId: PropTypes.string.isRequired, -}; - -export default SnapHome; diff --git a/ui/pages/snaps/snap-view/snap-view.js b/ui/pages/snaps/snap-view/snap-view.js index b8849179cabd..7f068cc5f0d1 100644 --- a/ui/pages/snaps/snap-view/snap-view.js +++ b/ui/pages/snaps/snap-view/snap-view.js @@ -18,8 +18,8 @@ import { import { Content, Page } from '../../../components/multichain/pages/page'; import SnapAuthorshipHeader from '../../../components/app/snaps/snap-authorship-header'; import SnapHomeMenu from '../../../components/app/snaps/snap-home-menu'; +import { SnapHomeRenderer } from '../../../components/app/snaps/snap-home-page/snap-home-renderer'; import SnapSettings from './snap-settings'; -import SnapHome from './snap-home'; function SnapView() { const history = useHistory(); @@ -129,7 +129,7 @@ function SnapView() { resetInitRemove={resetInitRemove} /> ) : ( - + )} diff --git a/yarn.lock b/yarn.lock index 183556cd8d81..0765d259c60e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5353,17 +5353,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.1": + 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 @@ -26643,7 +26643,7 @@ __metadata: "@metamask/eth-json-rpc-filters": "npm:^9.0.0" "@metamask/eth-json-rpc-middleware": "npm:^15.1.2" "@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.1" "@metamask/eth-query": "npm:^4.0.0" "@metamask/eth-sig-util": "npm:^7.0.1" "@metamask/eth-snap-keyring": "npm:^7.0.0"