Gets the current status of an operation.
The unique identifier of the operation to check
Promise resolving to the current operation status
This method allows recovery of operations that were interrupted due to:
The method queries the backend for the current operation state without starting a new polling session.
const status = await vana.operations.getStatus('550e8400-e29b-41d4-a716-446655440000');
switch(status.type) {
case 'pending':
console.log('Still processing...');
break;
case 'queued':
console.log(`Position in queue: ${status.position}`);
break;
case 'confirmed':
console.log(`Transaction confirmed: ${status.receipt.transactionHash}`);
break;
case 'failed':
console.error(`Operation failed: ${status.error}`);
break;
}
Waits for an operation to complete and returns the final result.
The unique identifier of the operation to wait for
Optionaloptions: {Optional configuration for polling behavior
Promise resolving when the operation is confirmed
Cancels a pending operation if supported by the backend.
Promise resolving to true if cancellation was successful
Processes queued operations from the operation store.
Configuration for queue processing
Promise resolving to processing results
This method is designed for worker processes that handle asynchronous operation processing. It fetches queued operations, processes them with proper nonce management and gas escalation, and handles retries.
This is typically called from a background worker or cron job to process operations that were queued for asynchronous execution.
// In a worker process
const results = await vana.operations.processQueue({
operationStore,
atomicStore,
walletClient,
publicClient,
maxOperations: 10,
onOperationComplete: (id, success) => {
console.log(`Operation ${id}: ${success ? 'completed' : 'failed'}`);
}
});
console.log(`Processed ${results.processed} operations`);
Burns a stuck nonce by sending a minimal self-transfer.
Configuration for nonce burning
Promise resolving to the burn transaction hash
Controller for managing asynchronous operations.
This controller provides methods to check the status of pending operations and recover from interrupted transactions.
Example