How to create ATA account using SPL-TOKEN? Already have minted tokens and would like to distribute in different wallets according to tokenomics
2 Answers
Using the CLI, you can use the --allow-unfunded-recipient
command to create the user's token account if it does not already exist.
spl-token transfer <TOKEN_MINT_ADDRESS> <TOKEN_AMOUNT> <RECIPIENT_WALLET_ADDRESS --allow-unfunded-recipient
Most if not all wallet extensions by default will create the ATA for the recipient wallet address it does not exist.
Along with using --allow-unfunded-recipient
during transfer, you can also create someone's associated-token-account using the create-account
command, ie.:
spl-token create-account <MINT_PUBKEY> --owner <OWNER_PUBKEY>