Decode Squads multisig transactions and render human‑readable instruction details using Anchor IDLs. A minimal Express server serves a static UI and an API endpoint.
- Node.js 18+ and npm
- Internet access (fetches IDLs, calls Squads API and a Solana RPC)
npm install- Dev (auto-restart):
npm run dev- Prod:
npm startThe server listens on http://localhost:5173 by default. Override with:
PORT=3000 npm run dev- Open http://localhost:5173 in a browser.
- Paste a Squads transaction ID (e.g.
BtVmmpGqhvXgonCWU2DUb3mvyzDErFSi5MhZM8Qw5ium). - Click Decode to see:
- Program name and ID
- Accounts (named when available from IDL)
- Decoded data (BN/hex normalized to readable strings)
- Decode a transaction:
curl "http://localhost:5173/api/decode/<TX_ID>"Response shape:
{
"transactionId": "<TX_ID>",
"memo": "...",
"instructions": [
{
"programId": "...",
"programName": "...",
"instructionName": "...",
"accounts": [ { "name": "...", "address": "...", "index": 0 } ],
"decodedData": { "...": "..." },
"rawData": [1,2,3]
}
]
}server/index.js: Express server, servespublic/andGET /api/decode/:txIdsrc/decoder.js: Core decoding (fetch Squads tx, resolve ALT accounts, decode via@coral-xyz/anchor)public/index.html: Simple UI for decoding and viewing results
Known programs and IDL URLs live in PROGRAM_MAPPINGS inside src/decoder.js.
Add entries like:
PROGRAM_MAPPINGS["YourProgramPubkeyHere"] = {
name: "YOUR_PROGRAM",
idlUrl: "https://raw.githubusercontent.com/your-org/your-repo/main/target/idl/your_program.json"
};Restart the server afterward.
- Port:
PORTenv var (default5173). - RPC endpoint: set inside
src/decoder.jsin theConnectionconstructor. Replace with your preferred endpoint if needed.
- Unknown program: add its ID and IDL URL to
PROGRAM_MAPPINGS. - Network/rate limits: the app calls Squads API, GitHub raw (for IDLs), and a Solana RPC. Use reliable endpoints or retry later.
- CORS: enabled on the server for the API.
npm run dev: Start with nodemonnpm start: Start with node
MIT