β¨Quick Start
Complete your first cross-chain trade with WheelX API in a few minutes.
This guide walks you through a cross-chain trade from USDC on Ethereum to USDT on Soneium, from quote to final status.
Before You Start
Base URL:
https://api.wheelx.fi/v1Requirements:
Node.js
18+an Ethereum RPC URL
an EVM wallet address
a signer or wallet client that can send transactions on Ethereum
a wallet that holds USDC on Ethereum mainnet
a small amount of ETH for gas
System Flow
This is the execution flow for a standard WheelX cross-chain trade.
Try It Step by Step
Request a quote
This example performs a bridge-and-swap flow from Ethereum USDC to Soneium USDT.
You can use the placeholder address above to try the quote request first. Replace both address fields with your own EVM address before sending a real transaction. In the full script below, this value is read from WALLET_ADDRESS.
Review the response
A successful quote returns the transaction payload, the approval requirement, and the order identifier you will use later for status tracking.
Key fields to check:
request_id: save this value for order pollingtx.to: contract address for the source-chain transactiontx.data: calldata to submittx.value: native token value to include with the transactionapprove: approval instructions for the input token; if notnull, approve before the main transactionamount_out: quoted destination amountmin_receive: minimum receive amount after slippageestimated_time: rough route durationrouter: readable route summary
The quote already contains the transaction payload needed for execution. You do not need to build calldata yourself.
Execute the trade
Create a file named wheelx-quickstart.mjs, paste the script below, and connect your own signer before running it. The script focuses on the WheelX flow and leaves wallet setup to your application.
View a local testing version that uses PRIVATE_KEY
If you prefer to run this flow locally without adding wallet connection code first, you can use a private key from an environment variable.
Run it:
Check the order status
For this flow, the order status is simple:
Open: the order has started and is still in progressFilled: the cross-chain trade is completeFailed: the order did not complete successfully
Use this rule in your application:
Submit the source-chain transaction
Keep the
request_idPoll
/order/{request_id}Mark the trade as complete only when the order reaches
Filled
For cross-chain flows, the source-chain transaction receipt is not the final completion signal. Use the order status.
Last updated