Skip to content

Commit

Permalink
chore: adds Solana snap to preinstall list (#28141)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Adds the Solana snap to the preinstall list.

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
zone-live authored Nov 7, 2024
1 parent 87299be commit 0064020
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
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

0 comments on commit 0064020

Please sign in to comment.