Function getOrCreateAssociatedTokenAccount
- getOrCreateAssociatedTokenAccount(connection: Connection, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean): Promise<{
address: PublicKey;
info: null | AccountInfo<Buffer>;
instructions: null | InstructionReturn;
}>
-
Parameters
-
connection: Connection
-
mint: PublicKey
-
owner: PublicKey
-
Optional
allowOwnerOffCurve: boolean
Returns Promise<{
address: PublicKey;
info: null | AccountInfo<Buffer>;
instructions: null | InstructionReturn;
}>
Get or create an associated token account (ATA)
Gets the ATA address and if needed, the instruction to create it
Returns
Address of the new associated token account and instruction to create it if it doesn't exist