Documentation Index
Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
Use this file to discover all available pages before exploring further.
WalletSwapNamespace
Wallet swap namespace with full operations including signing.
Provides getQuote() for pricing and execute() for swapping tokens.
Methods
| Function | Description |
|---|
| getQuote() | Get a swap quote with the wallet address as recipient. Ensures calldata is encoded for the real wallet, not a placeholder. |
| getQuotes() | Get quotes from all providers with the wallet address as recipient. |
| getMarket() | Get a specific swap market by ID. |
| getMarkets() | Get available swap markets across all providers |
| supportedChainIds() | Get all supported chain IDs across all providers |
| execute() | Execute a token swap. Accepts either raw params (re-quotes internally) or a pre-built SwapQuote (skips re-quoting). |
getQuote()
Get a swap quote with the wallet address as recipient.
Ensures calldata is encoded for the real wallet, not a placeholder.
| Parameter | Type | Description |
|---|
params | SwapQuoteParams | |
Source ↗
getQuotes()
Get quotes from all providers with the wallet address as recipient.
| Parameter | Type | Description |
|---|
params | SwapQuoteParams | |
Source ↗
getMarket()
Get a specific swap market by ID.
| Parameter | Type | Description |
|---|
params | GetSwapMarketParams | Market identifier (poolId + chainId) |
provider | SwapProviderName | Optional provider name to query directly instead of searching all |
Returns: Market information
Source ↗
getMarkets()
Get available swap markets across all providers
| Parameter | Type | Description |
|---|
params | GetSwapMarketsParams | Optional filtering by chainId or asset |
Returns: Promise resolving to array of markets from all providers
Source ↗
supportedChainIds()
Get all supported chain IDs across all providers
Source ↗
execute()
Execute a token swap.
Accepts either raw params (re-quotes internally) or a pre-built SwapQuote (skips re-quoting).
| Parameter | Type | Description | |
|---|
params | `WalletSwapParams | SwapQuote` | Swap parameters or a pre-built SwapQuote from getQuote() |
Returns: Swap receipt with transaction details
Source ↗