zcash-snap-test
v0.4.0
Published
Zcash Metmamask Snap that utilizes WebZjs.
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
For local development, you need to add http://localhost:3000 to the allowedOrigins in snap.manifest.json. The endowment:rpc section should look like this:
"endowment:rpc": {
"allowedOrigins": ["https://webzjs.chainsafe.dev", "http://localhost:3000"]
}Build Scripts
yarn build- Standard build for production (only allows production origins)yarn build:local- Build for local development (automatically adds localhost:3000 to allowedOrigins)yarn build:prePublish- Pre-publish build that ensuresallowedOriginsis reset to["https://webzjs.chainsafe.dev"]and then runsmm-snap build
The build:local script will:
- Create a backup of the original
snap.manifest.json - Modify the manifest to include
http://localhost:3000in allowedOrigins - Run the build process
The build:prePublish script will:
- Overwrite
allowedOriginsinsnap.manifest.jsonto only["https://webzjs.chainsafe.dev"] - Run the production build via
mm-snap build
Development Steps
- Install dependencies with
yarn install - For local development: Build with
yarn build:local - For production: Build with
yarn build - Host snap on localhost http://localhost:8080
yarn serve
