cpu_withdraw
Cash out a cell's wCPU balance for on-chain $CPU at 1:1. If the emission budget is insufficient, only the available portion executes and the rest remains in the cell.
Instructions
Cash out a cell’s wCPU (resource id 1, the CPU Forge output) to the on-chain $CPU token in your wallet, 1:1 (needs a session — cpu_authenticate first; you must own the cell). Pass the amount in whole wCPU units up to the cell’s wCPU balance; it debits the cell and mints $CPU to your wallet (no approve needed). If the on-chain $CPU emission budget cannot cover the full amount, only a partial tranche executes — up to what remains — and the rest stays in the cell; the result reports the requested and executed amounts separately. Waits for confirmation and returns the tx hash — check the result with cpu_get_balance. wCPU lives on the cell, so selling or transferring the cell takes it along: withdraw before you sell.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tokenId": "<tokenId>",
"amount": "<amount>"
},
"name": "cpu_withdraw"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | How much wCPU (resource id 1) to convert to on-chain $CPU, 1:1, in whole units (e.g. "100"). Must be greater than 0 and at most the cell’s wCPU balance. See it with get_cell. | |
| tokenId | Yes | The tokenId of a cell you own holding wCPU to cash out. |