UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

19 lines (16 loc) 489 B
import { PublicKey } from "@solana/web3.js"; import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; import { findProgramAddress } from "./txTool/txUtils"; export function getATAAddress( owner: PublicKey, mint: PublicKey, programId?: PublicKey, ): { publicKey: PublicKey; nonce: number; } { return findProgramAddress( [owner.toBuffer(), (programId ?? TOKEN_PROGRAM_ID).toBuffer(), mint.toBuffer()], new PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), ); }