Currently, developers need to write code to compute ledger account identifiers of their canisters.
This approach is error-prone and can result in lost ICP.
We need to extend the dfx ledger account-id command to support the computation of canister accounts.
Examples:
dfx ledger account-id --of-canister my_canister [--subaccount 000...]
<hex of a ledger account, canister alias is given>
dfx ledger account-id --of-principal 54yea-6qaaa-aaaaa-qaabq-cai [--subaccount 000...]
<hex of a ledger account, canister id is given>
dfx ledger account-id --of-principal sp3em-jkiyw-tospm-2huim-jor4p-et4s7-ay35f-q7tnm-hi4k2-pyicb-xae [--subaccount 0000...]
<hex of a user ledger account>