cpu_withdraw
Withdraw wCPU from a cell to mint on-chain $CPU tokens at a 1:1 exchange rate, directly to your wallet.
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), 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.
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. |