parser_cli tool parses raw transaction data and shows the resulting visualization, making it essential for developing and testing VisualSign parsers.
Installation
Basic usage
Parameters
| Parameter | Description |
|---|---|
--chain | Blockchain type (ethereum, solana, sui, tron) |
-t, --transaction | Raw transaction data (hex encoded) |
--output | Output format: text (default), json, or human |
--condensed-only | Show only condensed view (what users see on hardware wallets) |
-n, --network | Network identifier—chain ID (e.g., 1, 137) or canonical name (e.g., ETHEREUM_MAINNET, POLYGON_MAINNET) |
--abi-json-mappings | Map custom ABI JSON to contract. Format: Name:/path/to/abi.json:0xAddress. Can be used multiple times |
--idl-json-mappings | Map custom IDL JSON to Solana program. Format: Name:/path/to/idl.json:ProgramId. Can be used multiple times |
Real-world examples
Ethereum: Complex Uniswap transaction
The following command parses a real Uniswap Universal Router transaction that includes multiple DeFi operations:Output breakdown
Hardware wallet view
Use--condensed-only to see what users see on hardware wallets with limited screen space:
Available test fixtures
The parser includes real-world transaction examples from production networks:Ethereum fixtures
Located insrc/chain_parsers/visualsign-ethereum/tests/fixtures/:
- legacy.input: Simple ETH transfer
- 1559.input: EIP-1559 transaction example
- uniswap-v2swap.input: Uniswap V2 swap transaction
- uniswap-v3swap.input: Uniswap V3 swap transaction
Solana fixtures
Located insrc/chain_parsers/visualsign-solana/tests/fixtures/:
-
jupiter_swap/: Real mainnet Jupiter aggregator swap
- WSOL → USELESS token swap
- 25 accounts including Whirlpool DEX integration
- Transaction signature:
441ttot8CzpgsiRHvAHnNTCBwbSnPuhuy43pCjzZU9BKwBuJeW8f4TMU7FYLeqBst6WJeMEHprdQxr4thxqZSxRs
-
token_2022/: Token-2022 program transactions
- SPL Token-2022 (Token Extensions) operations
Sui fixtures
Located insrc/chain_parsers/visualsign-sui/src/presets/:
-
cetus/: Concentrated liquidity DEX operations
- Swaps (A→B, B→A, with/without partner fees)
- Liquidity provision at specific price ranges
- coin_transfer/: Native SUI transfer operations
-
momentum/: Liquidity protocol operations
- Position management (open, close, add, remove)
- Fee and reward collection
-
sui_native_staking/: Native staking operations
- Stake and unstake SUI with validators
-
suilend/: Lending protocol operations
- Borrow, deposit, repay operations
- Collateral token management
- Staking and unstaking
Development workflow
1. Testing new parsers
When developing a new parser or modifying existing ones:2. Debugging complex transactions
For complex DeFi transactions with nested operations:3. Validating hardware wallet display
Ensure your parser output works well on constrained devices:Output formats
Human format
Best for development and debugging. Shows hierarchical structure with indentation and Unicode box drawing characters.JSON format
Machine-readable format following the VisualSign JSON schema. Use withjq for analysis:
Developer options
Signed transaction support
The CLI enablesallow_signed_transactions by default, which allows parsing already-signed transactions by extracting the unsigned portion. This is useful for development and debugging — you can paste transactions directly from block explorers.
Important: The production gRPC API does not enable this option. Production wallets should only parse unsigned transactions to ensure users are signing exactly what they see.
allow_signed_transactions is enabled:
- Signed transactions are accepted and the unsigned portion is extracted
- The visualization shows what the user originally approved
- Useful for debugging and verifying production transactions
Best practices
- Always test with real transactions: Use mainnet transactions from block explorers
- Verify both views: Check both expanded and condensed layouts
- Test edge cases: Large numbers, special characters, long addresses
- Validate against hardware: Ensure condensed view fits actual device constraints
- Document complex logic: Add comments for protocol-specific parsing
Common issues and solutions
Issue: Transaction parsing fails
Solution: Verify the hex encoding and chain type matchIssue: Output too verbose for hardware wallet
Solution: Adjust the condensed view to show only critical fieldsIssue: Missing protocol details
Solution: Add protocol-specific presets to decode contract callsNext steps
- Field Types Reference - Understanding VisualSign JSON fields
- Chain Modules - Building parsers for specific chains