Wallets

Spending funds

Debit a wallet to spend funds and inspect the resulting balance.

Spend funds from a wallet by issuing a debit. The debit reduces the wallet's balance immediately.

Basic debit#

Debit $1.00 from a wallet. By default, funds go to the world account (representing the outside world):

fctl wallets debit 100 USD/2 --name my-wallet
POST/api/wallets/wallets/<WALLET_ID>/debit

Setting the destination#

Send debited funds to a specific ledger account instead of world:

fctl wallets debit 100 USD/2 --name my-wallet --destination account=orders:1234
POST/api/wallets/wallets/<WALLET_ID>/debit

Sending to another wallet#

You can also send funds directly to another wallet:

fctl wallets debit 100 USD/2 --name my-wallet --destination wallet=<target-wallet-id>
POST/api/wallets/wallets/<WALLET_ID>/debit

The wallet must have sufficient funds. If it doesn't, the debit fails with an INSUFFICIENT_FUND error.