Buy ETH for gas with 0.50 USDC
buy_gasBuys ETH for Base gas by selling exactly 0.50 USDC from the kit’s own balance, enabling swaps or withdrawals when the kit holds only USDC. Requires user approval because it spends their funds.
Instructions
Buy a little ETH for Base gas with exactly 0.50 USDC from this kit's own balance, so a kit funded with USDC alone can swap and withdraw. This moves the user's funds: call it only after the user says yes, and tell them the 0.50 USDC comes out of their balance. Each yes covers one purchase. It signs one CoW Protocol order that sells 0.50 USDC for ETH paid to this kit's own Base address; a CoW Protocol solver settles it and pays the network fee, so it works with no ETH in the kit. Refused when the kit already has gas (0.00002 ETH or more), holds less than 0.50 USDC, or spending is stopped. While a Base withdrawal or swap lock is still being confirmed, it is refused for 30 s; call it again then. Each call returns within about a minute; while state is 'pending', call it again after call_again_after_seconds, and call again whenever a result asks you to. Once state is 'filled' or 'expired', or 'rejected' with sold 'nothing', that purchase is over: report it, and ask the user again before another. Calling again never places a new order while an earlier one could still fill. Returns state ('pending', 'filled', 'expired', 'rejected' or 'refused'), with uid, order_url, sold, min_eth and, once filled, eth_received when it is known; or reason.
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": "buy_gas"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||