Skip to main content
Result types define the return values from SDK operations, providing transaction details, explorer URLs, and operation metadata.

Bridge results

BridgeResult

Returned by bridge() operations.
explorerUrl
string
required
Explorer URL for the destination chain transaction
sourceTxs
object[]
required
Array of source chain transactions
intent
ReadableIntent
required
Detailed intent information. See ReadableIntent
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.
transactionHash
string
required
Transaction hash on destination chain
explorerUrl
string
required
Block explorer URL for the transaction
const result = await sdk.bridgeAndTransfer(params);

console.log('Transfer complete:', result.explorerUrl);

BridgeMaxResult

Returned by calculateMaxForBridge().
amountRaw
bigint
required
Maximum bridgeable amount in atomic units
amount
string
required
Maximum bridgeable amount (human-readable)
symbol
string
required
Token symbol
sourceChainIds
number[]
required
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.
transactionHash
string
required
Transaction hash of the executed contract call
explorerUrl
string
required
Block explorer URL for the transaction
chainId
number
required
Chain ID where the transaction was executed
receipt
TransactionReceipt
Transaction receipt (only if waitForReceipt was true)
confirmations
number
Number of block confirmations received
gasUsed
string
Actual gas used by the transaction
effectiveGasPrice
string
Effective gas price paid
approvalTransactionHash
string
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.
executeTransactionHash
string
required
Transaction hash of the contract execution
executeExplorerUrl
string
required
Block explorer URL for the execute transaction
toChainId
number
required
Destination chain ID
bridgeSkipped
boolean
required
Indicates if bridge was skipped due to sufficient funds on destination chain
approvalTransactionHash
string
Token approval transaction hash (if approval was needed)
bridgeExplorerUrl
string
Bridge transaction explorer URL. undefined if bridgeSkipped is true
intent
ReadableIntent
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.
success
boolean
required
Indicates if the swap was successful
result
SuccessfulSwapResult
required
Swap result details when success is true

ChainSwap

Represents a swap executed on a specific chain.
chainId
number
required
Chain ID where swap was executed
txHash
Hex
required
Transaction hash
swaps
Swap[]
required
Array of individual swap operations in the transaction
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.
intent
ReadableIntent
required
Simulated intent with fee breakdown and routing. See ReadableIntent
token
TokenInfo
required
Token information
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().
gasUsed
bigint
required
Estimated gas units to be used
gasPrice
bigint
required
Gas price in wei
gasFee
bigint
required
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`);

Build docs developers (and LLMs) love