MetaMask Snap is an open source system that allows anyone to safely extend the functionality of MetaMask, creating new web3 end user experiences. Based on this, We integrated dataverse-kernel into metamask-snap, using the metamask provider as the Ethereum connector by default. At the same time, it exposed system call methods including file system management and other system call methods. For specific call methods, see demo.
Requirements:
- MetaMask Flask - A cryptocurrency wallet browser extension.
- Node.js version >= 18.
- pnpm version >= 8.
Setup the development environment and run the snap:
pnpm install
pnpm start
It will run on localhost:8080 by default.
If you want to run the snap with a demo front-end site:
pnpm demo
Furthermore, if you want to compile this snap:
pnpm build
The dist package will be generated in the root directory.
Notes:
- If you cloud not connect to Metamask Snap, and received an error like
request time out
, please check if you can open the link, which is used by Metamask Snap but sometimes blocked by Cloudflare because of impure IP(may be related to your proxy).
The snap comes with some basic tests, to demonstrate how to write tests for
snaps. To test the snap, run yarn test
in this directory. This will use
@metamask/snaps-jest
to run the tests in src/index.test.ts
.