How to get a canister's address to send ICRC tokens to, and generate further subaccounts(?) to do the same?

I have a canister I need to send an ICRC token to. (The aim is for the canister to receive and hold an ICRC token balance).

How do I, as owner of the canister,

(a) get the canister’s default address to send ICRC tokens to, and

(b) generate additional addresses (not sure if they’re called subaccounts, whatever they are) controlled by the same canister to send ICRC tokens to?

Actually, does the ICRC-1 standard distinguish between such subaccounts (I don’t know if that’s the term), or does it only recognise one account per canister?

you can get address by referring to examples/ at master · dfinity/examples · GitHub

a. default address is the subaccount with 0(blob) index
b. to get other addresses, just pass the subaccount index 1, 2, 3…

note: to get canister principal : Principal.fromActor(this);

1 Like

See: Completed: - Bounty #26 - ICRC-1 Motoko - up to $10k - #34 by skilesare

1 Like