Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adds Solana snap to preinstall list #28141

Merged
merged 8 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/scripts/snaps/preinstalled-snaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<PreinstalledSnap[]>([
Expand All @@ -16,6 +19,9 @@ const PREINSTALLED_SNAPS = Object.freeze<PreinstalledSnap[]>([
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;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions shared/lib/accounts/solana-wallet-snap.ts
Original file line number Diff line number Diff line change
@@ -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;
38 changes: 37 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down