Monitor cross-chain transaction progress and handle completion with comprehensive tracking tools
The TAC SDK provides sophisticated tracking capabilities to monitor cross-chain transactions from initiation to completion. Whether you need simple status updates or detailed execution profiling, the tracking system offers multiple approaches to fit your application’s needs.
Transaction tracking is essential for providing good user experience in
cross-chain applications. Always implement appropriate error handling and
retry logic to handle network issues gracefully.
Cross-chain transactions go through multiple stages across different blockchain networks. The TAC SDK’s tracking system provides real-time visibility into this complex process through several interfaces:
TransactionLinker: Initial tracking handle returned from transaction submission
OperationTracker: Comprehensive tracking with detailed status information
Simplified Tracking: Helper functions for common tracking scenarios
Stage Profiling: Detailed execution timeline for advanced monitoring
Every cross-chain transaction returns a TransactionLinker object that serves as the primary tracking handle:
Copy
Ask AI
// Send transaction and get tracking handleconst transactionLinker = await tacSdk.sendCrossChainTransaction( evmProxyMsg, sender, assets);// Operation ID may not be immediately available// Use OperationTracker to retrieve itconsole.log("Shard Key:", transactionLinker.shardsKey);console.log("Timestamp:", transactionLinker.timestamp);console.log("Caller:", transactionLinker.caller);
For applications that need basic status information:
Copy
Ask AI
const getSimpleStatus = async (transactionLinker) => { const tracker = new OperationTracker(Network.TESTNET); const status = await tracker.getSimplifiedOperationStatus(transactionLinker); switch (status) { case "PENDING": console.log("Transaction is being processed"); break; case "SUCCESSFUL": console.log("Transaction completed successfully"); break; case "FAILED": console.log("Transaction failed"); break; case "OPERATION_ID_NOT_FOUND": console.log("Operation not found - may still be propagating"); break; } return status;};