-
Notifications
You must be signed in to change notification settings - Fork 42
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
MetaMask Snap (unaudited) #107
Conversation
🦋 Changeset detectedLatest commit: c882bbb The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
- Made adjustments to the core mm snap functions to allow for a dynamically passed in snap id - Improved the UI of the snap popups
62edd87
to
5b327c1
Compare
- Change "origin" to "snapId"
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #107 +/- ##
=======================================
Coverage 76.51% 76.51%
=======================================
Files 35 35
Lines 511 511
Branches 121 121
=======================================
Hits 391 391
Misses 120 120 ☔ View full report in Codecov by Sentry. |
- Added notice on Sign Arbitrary requests
- Added mock files (from cosmos-metamask-snap) - Removed unused files from test ui - Improved styles of test ui - Exported helper function to create SeiWallet for MM Snap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
async getAccounts(): Promise<AccountData[]> { | ||
const wallet = await getWallet(0); | ||
const wallet = await getWallet(0, this.snapId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a case where we want to use an index other than 0 for getWallet
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made CosmJSOfflineSigner take in an optional accountIndex and default it to index 0
Looks good to me! For future reference, fixed the above error by building @sei-js/core locally |
MetaMask Snap
This PR contains the ready for audit MetaMask Snap as well as a helpful UI for testing the snap, and helper functions for using the snap from a dapp.
HIghlights
Testing
Can test this version of the snap yourself in production on https://evm.app.sei.io/stake?tab=allValidators with username 'warroom' and password 'clifford'. However, it is encouraged for you to download and run the test UI (as seen in video below) to fully test yourself
Note: You must have MetaMask flask installed to test this as it is an unofficial snap. https://chromewebstore.google.com/detail/metamask-flask-developmen/ljfoeinjpaedjfecbmggjgodbgkmjkjk
Validation performed
This library contains a helpful UI for testing out the metamask snap, particularly one that is being run on your local machine for development purposes. To test this yourself checkout this branch and navigate to the 'test-ui' folder, then run 'yarn install' and then 'yarn dev' to run the UI. You will also need to run 'yarn start' from within the sei-js/packages/metamask-snap directory (to run the snap locally). OR You can simply use the latest hosted version on NPM. Both of these are configurable through the .env.local file by adjusting the VITE_SNAP_ID variable
metamask-snap-testing.mov