Convert Qi to QUAI (Two-Step Confirmation)
convert_qi_to_quaiConvert Qi from a Qi wallet into QUAI and send to any QUAI address. Preview the rate first, then confirm with password to complete the swap.
Instructions
Convert Qi held in a wallet created with create_qi_wallet/import_qi_wallet into QUAI, sent to a QUAI-ledger address. This is the other half of Quai's native ledger swap (see get_conversion_rate and send_transaction's QUAI -> Qi path). Same two-step pattern as send_transaction: first call without "confirm" for a rate-quote preview (no password needed yet); then again with confirm: true, the same confirmationToken, and the wallet's password to actually spend. The preview cannot verify the wallet's Qi balance without the password (Qi requires reconstructing the wallet to check), so a confirm may still fail with insufficient funds even after a clean preview -- that failure is reported plainly, nothing is lost or retried silently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Destination QUAI-ledger address to receive the converted amount. | |
| amount | Yes | Amount to convert, in Qi (e.g. "0.5"), not Qit. | |
| confirm | No | Set true only on the second call, together with confirmationToken and password, to actually convert. | |
| network | No | Which Quai network to query: "mainnet" or "testnet" (the Orchard testnet). Defaults to mainnet. | mainnet |
| password | No | The Qi wallet's password. Required only on the confirm: true call. | |
| walletName | Yes | The name of a Qi wallet previously created with create_qi_wallet or import_qi_wallet. | |
| confirmationToken | No | The token returned by the initial preview call. Required when confirm is true. |