Quote and Execution Types
Types for bridge quotes, route steps, and execution handling.QuoteParams
Parameters for requesting a bridge quote.Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
fromChainId | number | Yes | - | Source chain ID (e.g., 1 for Ethereum) |
toChainId | number | Yes | - | Destination chain ID (typically 999 for HyperEVM) |
fromToken | string | Yes | - | Source token contract address |
toToken | string | Yes | - | Destination token contract address |
fromAmount | string | Yes | - | Amount in smallest unit (e.g., “1000000” for 1 USDC) |
fromAddress | string | Yes | - | User’s wallet address (sender) |
toAddress | string | No | fromAddress | Recipient address on destination chain |
slippageTolerance | number | No | 0.5 | Slippage tolerance as percentage (0.5 = 0.5%) |
slippage | number | No | - | Deprecated: Use slippageTolerance instead |
routePreference | RoutePreference | No | 'recommended' | Route selection preference |
Quote
Complete quote response with route details and pricing.Key Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for tracking this quote |
steps | Step[] | Array of execution steps (swaps, bridges) |
fees | Fees | Detailed fee breakdown |
estimatedTime | number | Total estimated execution time in seconds |
toAmount | string | Expected output amount (before slippage) |
minimumReceived | string | Guaranteed minimum after slippage |
priceImpact | number | Price impact as decimal (0.01 = 1%) |
highImpact | boolean | Warning flag if impact >= 1% |
expiresAt | number | Unix timestamp when quote expires |
includesAutoDeposit | boolean | Whether L1 deposit is automatic |
Step
A single step in a bridge route.Step Types
| Type | Description |
|---|---|
'approve' | Token approval for spending |
'swap' | Token swap on source chain |
'bridge' | Cross-chain bridge transfer |
'deposit' | Deposit to Hyperliquid L1 |
ExecuteOptions
Options for executing a bridge quote.Properties
| Property | Type | Required | Description |
|---|---|---|---|
quote | Quote | Yes | The quote to execute |
signer | TransactionSigner | Yes | Wallet signer for transactions |
onStepChange | OnStepChange | No | Callback when a step’s status changes |
onStatusChange | OnStatusChange | No | Callback for overall execution status |
onApprovalRequest | () => void | No | Called before approval transaction |
onTransactionRequest | () => void | No | Called before main transaction |
infiniteApproval | boolean | No | Set to true for max approval (saves gas on future txs) |
ExecutionResult
Result of executing a bridge transaction.TransactionSigner
Interface for transaction signing, compatible with viem and ethers.Example Implementation (viem)
TransactionRequestData
Data structure for transaction requests.Properties
| Property | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Destination contract address |
data | string | Yes | Encoded transaction data |
value | string | Yes | Native token value to send (in wei) |
gasLimit | string | No | Gas limit for the transaction |
gasPrice | string | No | Gas price in wei |
chainId | number | Yes | Chain ID for the transaction |
