Function getOrCreateAssociatedTokenAccount

  • Retrieve the associated token account, or create it if it doesn't exist

    Parameters

    • connection: Connection

      Connection to use

    • payer: Signer

      Payer of the transaction and initialization fees

    • mint: PublicKey

      Mint associated with the account to set or verify

    • owner: PublicKey

      Owner of the account to set or verify

    • allowOwnerOffCurve: boolean = false

      Allow the owner account to be a PDA (Program Derived Address)

    • Optional commitment: Commitment

      Desired level of commitment for querying the state

    • Optional confirmOptions: ConfirmOptions

      Options for confirming the transaction

    • programId: PublicKey = TOKEN_PROGRAM_ID

      SPL Token program account

    • associatedTokenProgramId: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      SPL Associated Token program account

    Returns Promise<Account>

    Address of the new associated token account

Generated using TypeDoc