diff --git a/app/scripts/snaps/preinstalled-snaps.ts b/app/scripts/snaps/preinstalled-snaps.ts index c725a2cbd837..b596468853b2 100644 --- a/app/scripts/snaps/preinstalled-snaps.ts +++ b/app/scripts/snaps/preinstalled-snaps.ts @@ -6,6 +6,9 @@ import AccountWatcherSnap from '@metamask/account-watcher/dist/preinstalled-snap import BitcoinWalletSnap from '@metamask/bitcoin-wallet-snap/dist/preinstalled-snap.json'; import PreinstalledExampleSnap from '@metamask/preinstalled-example-snap/dist/preinstalled-snap.json'; ///: END:ONLY_INCLUDE_IF +///: BEGIN:ONLY_INCLUDE_IF(solana) +import SolanaWalletSnap from '@metamask/solana-wallet-snap/dist/preinstalled-snap.json'; +///: END:ONLY_INCLUDE_IF // The casts here are less than ideal but we expect the SnapController to validate the inputs. const PREINSTALLED_SNAPS = Object.freeze([ @@ -16,6 +19,9 @@ const PREINSTALLED_SNAPS = Object.freeze([ BitcoinWalletSnap as unknown as PreinstalledSnap, PreinstalledExampleSnap as unknown as PreinstalledSnap, ///: END:ONLY_INCLUDE_IF + ///: BEGIN:ONLY_INCLUDE_IF(solana) + SolanaWalletSnap as unknown as PreinstalledSnap, + ///: END:ONLY_INCLUDE_IF ]); export default PREINSTALLED_SNAPS; diff --git a/package.json b/package.json index 14b38d504c87..b570cc6f9245 100644 --- a/package.json +++ b/package.json @@ -346,6 +346,7 @@ "@metamask/snaps-rpc-methods": "^11.5.1", "@metamask/snaps-sdk": "^6.10.0", "@metamask/snaps-utils": "^8.5.1", + "@metamask/solana-wallet-snap": "^0.1.9", "@metamask/transaction-controller": "^38.1.0", "@metamask/user-operation-controller": "^13.0.0", "@metamask/utils": "^10.0.1", diff --git a/shared/lib/accounts/solana-wallet-snap.ts b/shared/lib/accounts/solana-wallet-snap.ts new file mode 100644 index 000000000000..1f6622c8bbdc --- /dev/null +++ b/shared/lib/accounts/solana-wallet-snap.ts @@ -0,0 +1,9 @@ +import { SnapId } from '@metamask/snaps-sdk'; +// This dependency is still installed as part of the `package.json`, however +// the Snap is being pre-installed only for Flask build (for the moment). +import SolanaWalletSnap from '@metamask/solana-wallet-snap/dist/preinstalled-snap.json'; + +export const SOLANA_WALLET_SNAP_ID: SnapId = SolanaWalletSnap.snapId as SnapId; + +export const SOLANA_WALLET_NAME: string = + SolanaWalletSnap.manifest.proposedName; diff --git a/yarn.lock b/yarn.lock index 9a54de8897d6..aa975513b90a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5575,6 +5575,23 @@ __metadata: languageName: node linkType: hard +"@metamask/keyring-api@npm:^9.0.0": + version: 9.0.0 + resolution: "@metamask/keyring-api@npm:9.0.0" + dependencies: + "@metamask/snaps-sdk": "npm:^6.7.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.2.1" + "@types/uuid": "npm:^9.0.8" + bech32: "npm:^2.0.0" + uuid: "npm:^9.0.1" + webextension-polyfill: "npm:^0.12.0" + peerDependencies: + "@metamask/providers": ^17.2.0 + checksum: 10/ff552c04a4d06c7b1a43d52809a9c141d38772586388f0ab96123bce445f148aa7f7e8165d03fa92ac391351de252c4b299fc2c16e690193f669b5329941fe75 + languageName: node + linkType: hard + "@metamask/keyring-controller@npm:^17.1.0, @metamask/keyring-controller@npm:^17.2.2": version: 17.2.2 resolution: "@metamask/keyring-controller@npm:17.2.2" @@ -6349,6 +6366,17 @@ __metadata: languageName: node linkType: hard +"@metamask/solana-wallet-snap@npm:^0.1.9": + version: 0.1.9 + resolution: "@metamask/solana-wallet-snap@npm:0.1.9" + dependencies: + "@metamask/keyring-api": "npm:^9.0.0" + "@metamask/snaps-sdk": "npm:^6.9.0" + buffer: "npm:^6.0.3" + checksum: 10/ec540948e1b5c693b0a31a32521d84c5d3796a5d62d1dfa0986cae47483040a0381c30419af4a86b2402efa5e95283b45a5d17bb705c11a181d0c6fa70b5be60 + languageName: node + linkType: hard + "@metamask/superstruct@npm:^3.0.0, @metamask/superstruct@npm:^3.1.0": version: 3.1.0 resolution: "@metamask/superstruct@npm:3.1.0" @@ -26550,6 +26578,7 @@ __metadata: "@metamask/snaps-rpc-methods": "npm:^11.5.1" "@metamask/snaps-sdk": "npm:^6.10.0" "@metamask/snaps-utils": "npm:^8.5.1" + "@metamask/solana-wallet-snap": "npm:^0.1.9" "@metamask/test-bundler": "npm:^1.0.0" "@metamask/test-dapp": "npm:8.13.0" "@metamask/transaction-controller": "npm:^38.1.0" @@ -37259,7 +37288,14 @@ __metadata: languageName: node linkType: hard -"webextension-polyfill@npm:>=0.10.0 <1.0, webextension-polyfill@npm:^0.10.0": +"webextension-polyfill@npm:>=0.10.0 <1.0, webextension-polyfill@npm:^0.12.0": + version: 0.12.0 + resolution: "webextension-polyfill@npm:0.12.0" + checksum: 10/77e648b958b573ef075e75a0c180e2bbd74dee17b3145e86d21fcbb168c4999e4a311654fe634b8178997bee9b35ea5808d8d3d3e5ff2ad138f197f4f0ea75d9 + languageName: node + linkType: hard + +"webextension-polyfill@npm:^0.10.0": version: 0.10.0 resolution: "webextension-polyfill@npm:0.10.0" checksum: 10/51ff30ebed4b1aa802b7f0347f05021b2fe492078bb1a597223d43995fcee96e2da8f914a2f6e36f988c1877ed5ab36ca7077f2f3ab828955151a59e4c01bf7e