Function createAssociatedTokenAccountIdempotent

  • Construct a CreateAssociatedTokenAccountIdempotent instruction

    Creates an associated token account for the given wallet address and token mint, if it doesn't already exist. Returns an error if the account exists, but with a different owner.

    Parameters

    • mint: PublicKey

      Mint for the account

    • owner: PublicKey

      Owner of the new account

    • allowOwnerOffCurve: boolean = true

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

    • programId: PublicKey = TOKEN_PROGRAM_ID

      SPL Token program account

    • associatedTokenProgramId: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      SPL Associated Token program account

    Returns {
        address: PublicKey;
        instructions: InstructionReturn;
    }

    Address of the new associated token account

Generated using TypeDoc