Start
Quickstart
From nothing to a refused drain on a local network, with the CLI.
You need Node 20 or later and a Solana network. Everything below runs on a local test network, so nothing real is at risk.
1. Get the code
git clone https://github.com/<org>/<repo> cd <repo> npm install
2. A local network with the program
node _tools/chain-up.mjs
program AWLr...vRG1Q: installed, executable=true
3. Create your guard account, once
node cli/pango.mjs wallet new
node cli/pango.mjs init
guard account created (rent 0.0146 SOL, give it back with "pango close")
4. Preview a transaction from any app
Take the base64 of an unsigned transaction a dapp wants you to sign:
node cli/pango.mjs preview tx.b64 --watch <your token account> --sol 0.05
refused: Your wallet would have lost 3 SOL and you did not allow it. Nothing happened.
5. Wrap it and sign
node cli/pango.mjs wrap tx.b64 --watch <token account> --sol 0.05 --out guarded.b64 node cli/pango.mjs send guarded.b64
wrap keeps every instruction of the original transaction and adds Begin and End. Your wallet signs the result as usual.