Order native gas with USDC
cleave_get_gasOffers orders for native gas (ETH, BNB or POL) on Ethereum, Arbitrum, Base, BNB Chain, Polygon or Optimism for a wallet that holds USDC on Ethereum, Arbitrum, Base, Optimism or Polygon but has no gas to send transactions. Called with the paying chain, the receiving chain, the recipient, a USDC amount and the paying wallet (without it the offer has nothing to sign), it returns an offer: the minimum native amount, the deadline, the order and one USDC authorization for the wallet to sign; signing costs no gas. If your wallet pays for a person, ask them for the recipient; if theirs pays, it can be the recipient. Use your own only for your own gas. An offer needs 0.8 to 50 USDC (at least 5 USDC when Ethereum is the paying or receiving chain; the fee is included in the price), a recipient that accepts the native coin and is not a token contract, and, for a cross-chain order, the paying wallet or a refundTo on the paying chain; otherwise, or while the route is paused, no offer is returned and the answer says why. Called again with the offer, the signature and the same wallet, it passes the signed order to Cleave's relayer, which may submit it to a contract made for that one order, and returns a requestId for cleave_track_swap. An authorization Cleave accepts is set to end before the order deadline. Cleave does not promise to submit it before it expires, and expiry of an unused authorization is not a promise about funds already paid. No outcome or time is guaranteed, and a settled payment is not delivery. On one chain the order is written to swap the USDC toward the native coin for the recipient. From another chain it is written to bridge the USDC and swap on arrival. USDC on arrival is one possible ending if that swap fails, and it may not happen. If a bridge transfer is not filled, the USDC can come back to the order address on the paying chain, which can take hours or longer, or may not come back. Until someone sends it to the refund address, cleave_track_swap can show it as refund_pending. The relayer may not send it. When the wallet already holds some gas, cleave_plan_swap plans a swap to the native coin.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "cleave_get_gas"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offer | No | The offer value from the answer to a call without offer; when given, the signed order is submitted and only offer, signature and wallet are accepted | |
| amount | No | A decimal amount in token units | |
| wallet | No | The paying wallet; it does not set the recipient. Required with offer. Without offer, the answer holds an authorization to sign only when it is given, and it is the refund address when refundTo is not given | |
| chainId | No | The chain the native gas is for; required without offer, not accepted with it | |
| refundTo | No | The refund address on the paying chain; a cross-chain order needs refundTo or wallet, and a one-chain order with neither uses recipient; not accepted with offer | |
| recipient | No | The wallet that receives the gas: if your wallet pays for a person, ask them for it; use your own only for your own gas; required without offer, not accepted with it | |
| signature | No | The wallet's hex signature of the offer's USDC authorization; required with offer, not accepted without it | |
| payChainId | No | The chain the USDC is paid on; required without offer, not accepted with it |