Result types define the return values from SDK operations, providing transaction details, explorer URLs, and operation metadata.
Bridge results
BridgeResult
Returned by bridge() operations.
Explorer URL for the destination chain transaction
Array of source chain transactions
Block explorer URL for this transaction
const result = await sdk.bridge(params);
console.log('Destination explorer:', result.explorerUrl);
console.log('Source transactions:', result.sourceTxs.length);
result.sourceTxs.forEach((tx) => {
console.log(`${tx.chain.name}: ${tx.explorerUrl}`);
});
TransferResult
Returned by bridgeAndTransfer() operations.
Transaction hash on destination chain
Block explorer URL for the transaction
const result = await sdk.bridgeAndTransfer(params);
console.log('Transfer complete:', result.explorerUrl);
BridgeMaxResult
Returned by calculateMaxForBridge().
Maximum bridgeable amount in atomic units
Maximum bridgeable amount (human-readable)
Chain IDs with available balance
const max = await sdk.calculateMaxForBridge({
token: 'USDC',
toChainId: 137,
});
console.log(`Max: ${max.amount} ${max.symbol}`);
console.log('From chains:', max.sourceChainIds);
Execute results
ExecuteResult
Returned by execute() and related operations.
Transaction hash of the executed contract call
Block explorer URL for the transaction
Chain ID where the transaction was executed
Transaction receipt (only if waitForReceipt was true)
Number of block confirmations received
Actual gas used by the transaction
Transaction hash of token approval (if approval was needed)
const result = await sdk.execute(params, { waitForReceipt: true });
console.log('Executed on chain:', result.chainId);
console.log('Gas used:', result.gasUsed);
if (result.approvalTransactionHash) {
console.log('Approval tx:', result.approvalTransactionHash);
}
BridgeAndExecuteResult
Returned by bridgeAndExecute() operations.
Transaction hash of the contract execution
Block explorer URL for the execute transaction
Indicates if bridge was skipped due to sufficient funds on destination chain
Token approval transaction hash (if approval was needed)
Bridge transaction explorer URL. undefined if bridgeSkipped is true
Bridge intent details. Only present if bridge was executed
const result = await sdk.bridgeAndExecute(params);
if (result.bridgeSkipped) {
console.log('Used existing balance');
} else {
console.log('Bridge explorer:', result.bridgeExplorerUrl);
console.log('Intent:', result.intent);
}
console.log('Execute explorer:', result.executeExplorerUrl);
Swap results
SwapResult
Returned by swapWithExactIn() and swapWithExactOut() operations.
Indicates if the swap was successful
result
SuccessfulSwapResult
required
Swap result details when success is true
Array of swaps executed on source chains
Swap executed on destination chain, or null if not needed
Block explorer URL for the main transaction
Detailed swap routing information
ChainSwap
Represents a swap executed on a specific chain.
Chain ID where swap was executed
Array of individual swap operations in the transaction
Input token contract address
Input amount in atomic units
Output token contract address
Output amount in atomic units
const result = await sdk.swapWithExactIn(input);
if (result.success) {
console.log('Swap complete:', result.result.explorerURL);
result.result.sourceSwaps.forEach((swap) => {
console.log(`Chain ${swap.chainId}: ${swap.txHash}`);
swap.swaps.forEach((s) => {
console.log(` ${s.inputAmount} → ${s.outputAmount}`);
});
});
if (result.result.destinationSwap) {
console.log('Destination swap:', result.result.destinationSwap.txHash);
}
}
Simulation results
SimulationResult
Returned by simulateBridge() and related simulation methods.
const simulation = await sdk.simulateBridge(params);
console.log('Estimated fees:', simulation.intent.fees.total);
console.log('Source chains:', simulation.intent.sources.length);
console.log('Token:', simulation.token.symbol);
ExecuteSimulation
Returned by simulateExecute().
Estimated gas units to be used
Total estimated gas fee (gasUsed * gasPrice)
const simulation = await sdk.simulateExecute(params);
const feeInEth = Number(simulation.gasFee) / 1e18;
console.log(`Estimated fee: ${feeInEth} ETH`);
BridgeAndExecuteSimulationResult
Returned by simulateBridgeAndExecute().
bridgeSimulation
SimulationResult | null
required
Bridge simulation details, or null if bridge is not needed
executeSimulation
ExecuteSimulation
required
Execute simulation details
const simulation = await sdk.simulateBridgeAndExecute(params);
if (simulation.bridgeSimulation) {
console.log('Bridge fees:', simulation.bridgeSimulation.intent.fees.total);
}
const executeFee = Number(simulation.executeSimulation.gasFee) / 1e18;
console.log(`Execute fee: ${executeFee} ETH`);