Transactions
Transactions
Section titled “Transactions”This section covers how to fetch transaction history, cancel pending operations, and manually confirm bridge or CCIP transactions when automatic indexing is insufficient.
1. Transaction History
Section titled “1. Transaction History”Fetch a paginated list of recent transactions for the current tenant.
// Fetch page 1, 20 results per pageconst recentTx = await sdk.bridge.getRecentTransactions(1, 20);
console.log('Transactions:', recentTx.items);console.log('Total:', recentTx.totalItems);console.log('Pages:', recentTx.totalPages);Response: ApiTransactionsResponse
Section titled “Response: ApiTransactionsResponse”| Property | Type | Description |
|---|---|---|
items | ApiTransactionItem[] | Array of transaction records for the current page. |
page | number | Current page number. |
limit | number | Number of items per page. |
totalItems | number | Total number of transactions. |
totalPages | number | Total number of pages. |
2. Cancellations
Section titled “2. Cancellations”Pending transactions that have not yet been finalized on-chain can be cancelled. The available method depends on the operation type.
Cancel Bridge Swap
Section titled “Cancel Bridge Swap”const result = await sdk.bridge.cancelBridgeSwap({ uuid: 'transaction-uuid', fromToken: 'wtao', toToken: 'tao',});console.log('Cancelled:', result.success);Cancel Router Swap
Section titled “Cancel Router Swap”const result = await sdk.bridge.cancelRouterSwap({ uuid: 'transaction-uuid',});console.log('Cancelled:', result.success);Cancel CCIP Route
Section titled “Cancel CCIP Route”const result = await sdk.bridge.cancelCcipRoute({ uuid: 'transaction-uuid', operationType: 'CCIP', fromToken: 'wtao', toToken: 'wtao',});console.log('Cancelled:', result.success);Cancellation Response
Section titled “Cancellation Response”All cancel methods return a CancelOperationResponse:
| Property | Type | Description |
|---|---|---|
success | boolean | Whether the cancellation was accepted. |
message | string | Human-readable status message. |
3. Manual Confirmations
Section titled “3. Manual Confirmations”Some operations require manual validation — for example when the automatic indexer does not detect a transaction, or after a required number of block confirmations for CCIP.
Confirm a CCIP Transaction
Section titled “Confirm a CCIP Transaction”const confirm = await sdk.bridge.confirmCcipTransaction({ transactionId: 'void-txn-id-...', // VoidAI transaction ID txnHash: '0x...', // On-chain hash from the source chain operationType: 'ccipBridge', txnStatus: 'CCIP_SOURCE_INITIATED', // Current status code});console.log('Confirmed:', confirm.success);Validate an EVM Burn Transaction
Section titled “Validate an EVM Burn Transaction”Use this if the automatic indexer misses a burn transaction (e.g. during a wTAO → TAO bridge).
const validate = await sdk.bridge.validateBurnTransaction({ transactionHash: '0xBurnTxHash...', identifier: '0xBridgeIdentifier...', // From the original bridge() response});console.log('Validation result:', validate);Manual Confirmation Requests
Section titled “Manual Confirmation Requests”| Method | Key Parameters | When to Use |
|---|---|---|
confirmCcipTransaction | transactionId, txnHash, txnStatus | CCIP transaction needs manual finality confirmation. |
validateBurnTransaction | transactionHash, identifier | EVM burn was not automatically detected by the indexer. |