Skip to main content

Overview

The Quotes API enables you to request price quotes for chain-abstracted swaps, execute those quotes, and monitor their execution status. This is the core API for performing token swaps in the OneBalance system.

API Methods

getQuote

Request a quote for swapping tokens across chains.

Parameters

QuoteRequest
required
The quote request object containing source and destination details

Returns

object
A quote object containing all information needed to execute the swap

Example


executeQuote

Execute a signed quote to perform the swap.
Before calling this function, you must sign the quote’s chain operations using the user’s wallet. The quote parameter should include signed userOp signatures.

Parameters

Quote
required
The quote object with signed user operations. This should be the same quote returned from getQuote(), but with signatures added to each chain operation.

Returns

any
Execution confirmation response from the server

Example


getQuoteStatus

Check the execution status of a quote.
This endpoint should be polled periodically after executing a quote to monitor transaction progress across chains.

Parameters

string
required
The unique identifier of the quote to check (from quote.id)

Returns

object
Current status and transaction details

Example

Complete Workflow Example

Here’s a complete example showing how to request, execute, and monitor a swap:

Error Handling

Best Practices

Check Expiration

Always validate that expirationTimestamp hasn’t passed before executing a quote

Poll Efficiently

Poll status every 1-2 seconds after execution, and stop when status is terminal (COMPLETED/FAILED)

Handle Errors

Implement proper error handling for network failures and transaction rejections

Show Progress

Display transaction hashes and explorer links to users for transparency