Skip to content

Transactions

This section covers how to fetch transaction history, cancel pending operations, and manually confirm bridge or CCIP transactions when automatic indexing is insufficient.


Fetch a paginated list of recent transactions for the current tenant.

// Fetch page 1, 20 results per page
const recentTx = await sdk.bridge.getRecentTransactions(1, 20);
console.log('Transactions:', recentTx.items);
console.log('Total:', recentTx.totalItems);
console.log('Pages:', recentTx.totalPages);
PropertyTypeDescription
itemsApiTransactionItem[]Array of transaction records for the current page.
pagenumberCurrent page number.
limitnumberNumber of items per page.
totalItemsnumberTotal number of transactions.
totalPagesnumberTotal number of pages.

Pending transactions that have not yet been finalized on-chain can be cancelled. The available method depends on the operation type.

const result = await sdk.bridge.cancelBridgeSwap({
uuid: 'transaction-uuid',
fromToken: 'wtao',
toToken: 'tao',
});
console.log('Cancelled:', result.success);
const result = await sdk.bridge.cancelRouterSwap({
uuid: 'transaction-uuid',
});
console.log('Cancelled:', result.success);
const result = await sdk.bridge.cancelCcipRoute({
uuid: 'transaction-uuid',
operationType: 'CCIP',
fromToken: 'wtao',
toToken: 'wtao',
});
console.log('Cancelled:', result.success);

All cancel methods return a CancelOperationResponse:

PropertyTypeDescription
successbooleanWhether the cancellation was accepted.
messagestringHuman-readable status message.

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.

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);

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);
MethodKey ParametersWhen to Use
confirmCcipTransactiontransactionId, txnHash, txnStatusCCIP transaction needs manual finality confirmation.
validateBurnTransactiontransactionHash, identifierEVM burn was not automatically detected by the indexer.