Overview
The Web3 Demo App is a fully interactive example that showcases the Mirador Web SDK end-to-end. It connects to browser wallets, sends real blockchain transactions, and tracks the entire lifecycle with Mirador traces. All code snippets below are extracted from the actual demo source code.What It Demonstrates
- Trace creation with descriptive names and structured metadata
- Attributes for wallet, network, and transaction context
- Tags for categorization and filtering
- Events at each stage of the transaction lifecycle
- Transaction hints via
addTxHint()for cross-chain correlation - Flush to send trace data immediately
- Error handling and trace closure on success, failure, or rejection
SDK Integration Walkthrough
The core SDK integration lives in a singlesendTransaction() function. Here’s how it works step by step.
1. Initialize the Client
The client is created once when the user provides their API key:2. Create a Trace with Metadata
When a transaction is initiated, a new trace is created and enriched with attributes and tags:3. Track Events Through the Transaction Lifecycle
Events are added at each significant step, capturing relevant data:4. Link Transactions with addTxHint()
After getting a transaction hash, link it to the trace for blockchain correlation:
5. Flush and Retrieve the Trace ID
After adding the transaction hint, flush the trace to send data to Mirador and retrieve the trace ID:6. Handle Errors and Close the Trace
Always close the trace when the operation completes, whether it succeeds or fails:Example Trace Output
When you send a transaction through the demo, the SDK captures the following data:Supported Networks
The demo supports 12 networks (6 mainnets and 6 testnets):| Network | Chain ID | Symbol | Mirador Chain |
|---|---|---|---|
| Ethereum | 1 | ETH | ethereum |
| Sepolia | 11155111 | ETH | ethereum |
| Polygon | 137 | MATIC | polygon |
| Polygon Amoy | 80002 | MATIC | polygon |
| Arbitrum One | 42161 | ETH | arbitrum |
| Arbitrum Sepolia | 421614 | ETH | arbitrum |
| Optimism | 10 | ETH | optimism |
| Optimism Sepolia | 11155420 | ETH | optimism |
| Base | 8453 | ETH | base |
| Base Sepolia | 84532 | ETH | base |
| BNB Chain | 56 | BNB | bsc |
| BNB Testnet | 97 | BNB | bsc |
Running the Demo
Start the development server
http://localhost:8000.