@ututrust/utu-metamask-snap
v1.0.0
Published
The 'Hello, world!' of MetaMask Snaps, now written in TypeScript.
Downloads
2
Keywords
Readme
UTU Trust Metamask Snap
This snap does the following:
(i) Intercepts onConnect and checks whether domain is trustworthy or not (Pending SIP-13 being implemented)
(ii) Intercepts onTransaction and checks whether toAddress is trustworthy or not
Run instructions
(i) Install Metamask flask
https://metamask.io/flask/
(ii) cd ~ mkdir workspace git clone https://gitlab.com/ututrust/utu-metamask-snap.git cd utu-metamask-snap
(iii) nvm install 18.18.1 / nvm use 18.18.1
(Note does not work with 20.x or older 18.x versions)
(iv) yarn install
(v) yarn start
(vi) Access in web browser: http://localhost:8000/
(vii) Click reconnect button
(viii) Create 2 addresses in metamask flask wallet
(ix) Choose a test net and transfer some crypto from one address to the next
(x) You should see a panel showing any signal on the toAddress
Testing
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
.
Location of files
(i) utu-metamask-snap/packages/snap/src/index.ts
Main Snap file with insight logic
(ii) utu-metamask-snap/packages/site/src/utils/snap.ts
Main File for installation of snap