Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion token/js/src/actions/createAssociatedTokenAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { getAssociatedTokenAddressSync } from '../state/mint.js';
* @param confirmOptions Options for confirming the transaction
* @param programId SPL Token program account
* @param associatedTokenProgramId SPL Associated Token program account
* @param allowOwnerOffCurve Allow the owner account to be a PDA (Program Derived Address)
*
* @return Address of the new associated token account
*/
Expand All @@ -25,8 +26,9 @@ export async function createAssociatedTokenAccount(
confirmOptions?: ConfirmOptions,
programId = TOKEN_PROGRAM_ID,
associatedTokenProgramId = ASSOCIATED_TOKEN_PROGRAM_ID,
allowOwnerOffCurve = false,
): Promise<PublicKey> {
const associatedToken = getAssociatedTokenAddressSync(mint, owner, false, programId, associatedTokenProgramId);
const associatedToken = getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve, programId, associatedTokenProgramId);

const transaction = new Transaction().add(
createAssociatedTokenAccountInstruction(
Expand Down
Loading