Purpose: Create transactions for every instruction type we've added parsers for, allowing you to verify parsing works correctly in the explorer.
This script executes 23 different instruction types:
- β InitializeMint (with rent sysvar)
- β InitializeMint2 (without rent sysvar)
- β InitializeAccount (with rent sysvar)
- β InitializeAccount2 (owner in data)
- β InitializeAccount3 (no rent sysvar)
- β Create Associated Token Account
- β MintTo
- β MintToChecked
- β Transfer
- β TransferChecked
- β Transfer (by delegate)
- β Approve
- β ApproveChecked
- β Revoke
- β Burn
- β BurnChecked
- β FreezeAccount
- β ThawAccount
- β SetAuthority (change mint authority)
- β SetAuthority (disable freeze)
- β InitializeMultisig
- β SyncNative (wrapped SOL)
- β CloseAccount
bun run devThis starts the Solana RPC server on http://localhost:8899
bun run test:parsersOr directly:
bun run scripts/test-all-parsers.tsThe script will output:
- β /β for each instruction tested
- Transaction signatures
- Direct links to the explorer
Open the explorer at: http://localhost:3000
π Testing All Instruction Parsers
π‘ RPC: http://localhost:8899
π Explorer: http://localhost:3000
π° Funding accounts...
π Test Accounts:
Payer: 7xK8...9dPQ
Owner: 5mN2...8rTY
Delegate: 9pL4...3wQX
π Testing Mint Initialization Instructions...
β
InitializeMint
Signature: 4Zx9K...8mPQ
Explorer: http://localhost:3000/tx/4Zx9K...8mPQ
β
InitializeMint2
Signature: 2Hy7L...5nRW
Explorer: http://localhost:3000/tx/2Hy7L...5nRW
...
π TEST SUMMARY
================================================================================
β
Successful: 24/24
β Failed: 0/24
π Successfully Tested Instructions:
β’ InitializeMint
http://localhost:3000/tx/4Zx9K...8mPQ
β’ InitializeMint2
http://localhost:3000/tx/2Hy7L...5nRW
...
For each transaction, verify:
-
Instruction appears with correct type
- Example: "mintToChecked" instead of "unknown"
-
All fields are populated
- Accounts (source, destination, authority, etc.)
- Amounts in both raw and UI format
- Decimals where applicable
-
Field names match Solana Explorer
- Use mainnet transactions as reference
- Compare field naming and structure
-
Inner instructions are parsed
- For complex transactions with CPIs
-
Logs are visible
- Program logs should be captured
Error: connect ECONNREFUSED 127.0.0.1:8899
Solution: Make sure the RPC server is running: bun run dev
Individual instruction failures are expected if:
- Token accounts are already closed
- Authorities have been changed
- Insufficient balance
The script handles errors gracefully and continues.
Check that:
- RPC server is running on port 8899
- Explorer is accessible at http://localhost:3000
- You're searching for the correct addresses/signatures
You can modify the script to:
Test specific instructions only:
// Comment out sections you don't want to test
// For example, skip multisig tests:
/*
console.log("π₯ Testing Multisig Instructions...\n");
// ... multisig test code ...
*/Use Token-2022 instead:
// Change at the top of the script:
import { TOKEN_2022_PROGRAM_ID as TOKEN_PROGRAM_ID } from "@solana/spl-token";Test with different amounts:
// Modify amounts in the minting/transfer sections
1_000_000_000n, // 1 token -> 5_000_000_000n (5 tokens)To test Token-2022 extensions:
import {
createInitializeTransferFeeConfigInstruction,
createTransferCheckedWithFeeInstruction,
} from "@solana/spl-token";
// Add extension initialization before InitializeMint
// See Token-2022 docs for details- Idempotent: Not safe to run multiple times (accounts get closed)
- Clean state: Restart RPC server between runs if needed
- Development only: Uses test keypairs with airdropped SOL
- No real value: All transactions use test tokens
After running this script:
- Verify all parsers work - Check each transaction in explorer
- Report issues - Note any instruction types that don't parse correctly
- Add extension tests - Once Phase 2 parsers are added
- Create regression suite - Save signatures for automated testing
- parser-progress.md - Parser coverage status
- parser-enhancement-plan.md - Roadmap
- AGENTS.md - Development guidelines