MetaMask Snaps is a system that allows anyone to safely expand the capabilities of MetaMask. A snap is a program that we run in an isolated environment that can customize the wallet experience.
This snap helps you interact with Mina protocol using MetaMask
To interact with (your) Snaps, you will need to install MetaMask. Note: To interact with the snap hosted on your local machine, you will neeed to install MetaMask Flask
You can run and test the snap by running these commands
yarn install && yarn start
Please check out the documentation in our wiki
-
To load o1js code in your UI, you must set the COOP and COEP headers. These headers enable o1js to use SharedArrayBuffer that o1js relies on to enable important WebAssembly (Wasm) features. Please checkout this link. In the local environment, create a
setupProxy.js
file insidepackages/site/src
. You can find the content of the file in thepackages/site/src/setupProxy.example.js
-
Babel is used for transpiling TypeScript to JavaScript, so when building with the CLI,
transpilationMode
must be set tolocalOnly
(default) orlocalAndDeps
. -
For the global
wallet
type to work, you have to add the following to yourtsconfig.json
:{ "files": ["./node_modules/@metamask/snap-types/global.d.ts"] }