@chainsafe/webzjs-zcash-snap
v0.3.0
Published
Zcash Metmamask Snap that utilizes WebZjs.
Keywords
Readme
WebZjs Zcash Snap
🔐 Overview
WebZjs Zcash Snap is a MetaMask Snap that brings Zcash functionality directly into the MetaMask browser extension. WebZjs is the first JavaScript SDK for Zcash, enabling seamless integration of Zcash privacy features for web users.
📘 Project Description
Snap uses a Rust library WebZjs compiled to WebAssembly (Wasm). It is meant to be used in conjunction with WebZjs web-wallet.
🛠 Prerequisites
- Node.js
- Yarn
- MetaMask Browser Extension (MetaMask Flask for development purposes) Install MM Flask
🔨 Development
The snap manifest (snap.manifest.json) controls which origins can communicate with the snap via allowedOrigins. A script (scripts/generate-manifest.js) handles switching between dev and production origins automatically — you should not need to edit the manifest by hand.
Build Scripts
yarn dev/yarn start- Addshttp://localhost:3000toallowedOrigins, then watches for changesyarn build- Strips any localhost origins fromallowedOriginsand runs a production build
Development Steps
- Install dependencies with
yarn install - For local development:
yarn dev(automatically adds localhost to allowed origins) - For production:
yarn build(automatically removes localhost from allowed origins) - Host snap on localhost http://localhost:8080 with
yarn serve
CI: Allowed Origins Check
Two CI workflows (check-snap-manifest.yml and check-snap-allowed-origins.yml) verify that snap.manifest.json on main only contains the production origin ["https://webzjs.chainsafe.dev"]. If localhost is present, the check will fail.
Do not commit snap.manifest.json after running yarn dev — it will contain http://localhost:3000. Run yarn build or yarn manifest:prod first to reset it before committing.
