The dfx ledger command allows you to interact with the ICP token's ledger canister. You can use it to perform ICP utility token transactions between canisters, top up canisters with cycles by converting ICP, check balances, and manage approvals for spending.
Basic syntax:
dfx ledger [subcommand] [options]
Available subcommands:
account-id: Prints the selected identity's account identifier.approve: Approves a principal to spend ICP on your behalf (ICRC-2).balance: Prints the account balance of a user.create-canister: Creates a canister using ICP.fabricate-cycles: (Local development only) Generates cycles and deposits them into specified canisters.help: Displays usage information for a subcommand.notify: Notifies the ledger of a send transaction to the cycles minting canister.top-up: Tops up a canister with cycles minted from ICP.transfer: Transfers ICP to a destination account identifier or principal.transfer-from: Transfers ICP from an approved spender to another principal.
To see help for a specific subcommand, use --help (e.g., dfx ledger transfer --help).