Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • AssociatedToken

Index

Constructors

  • new AssociatedToken(account: AccountInfo<Buffer | ParsedAccountData>, info: Account): AssociatedToken

Properties

account: AccountInfo<Buffer | ParsedAccountData>
address: PublicKey
info: Account

Methods

  • derive(mint: Address, owner: Address): PublicKey
  • Get the address for the associated token account

    static
    memberof

    AssociatedToken

    Parameters

    • mint: Address

      Token mint account

    • owner: Address

      Owner of the new account

    Returns PublicKey

    Public key of the associated token account

  • load(connection: Connection, mint: Address, owner: Address): Promise<undefined | AssociatedToken>
  • loadAux(connection: Connection, address: Address): Promise<undefined | AssociatedToken>
  • loadMint(connection: Connection, mint: Address): Promise<undefined | Mint>
  • TODO: Get mint info

    static
    memberof

    AssociatedToken

    Parameters

    • connection: Connection
    • mint: Address

    Returns Promise<undefined | Mint>

  • loadMultipleAux(connection: Connection, addresses: Address[]): Promise<(undefined | AssociatedToken)[]>
  • use(connection: undefined | Connection, mint: undefined | PublicKey, owner: undefined | PublicKey): undefined | AssociatedToken
  • Use an associated token account

    static
    memberof

    AssociatedToken

    Parameters

    • connection: undefined | Connection
    • mint: undefined | PublicKey
    • owner: undefined | PublicKey

    Returns undefined | AssociatedToken

  • useAddress(mint: undefined | PublicKey, owner: undefined | PublicKey): undefined | PublicKey
  • Use an associated token account address

    static
    memberof

    AssociatedToken

    Parameters

    • mint: undefined | PublicKey
    • owner: undefined | PublicKey

    Returns undefined | PublicKey

  • useAux(connection: undefined | Connection, tokenAddress: undefined | PublicKey): undefined | AssociatedToken
  • Use an aux token account by address. Aux token accounts are not associated account PDA

    static
    memberof

    AssociatedToken

    Parameters

    • connection: undefined | Connection
    • tokenAddress: undefined | PublicKey

    Returns undefined | AssociatedToken

  • useMint(connection: undefined | Connection, address: undefined | PublicKey): undefined | Mint
  • Use a specified token mint.

    static
    memberof

    AssociatedToken

    Parameters

    • connection: undefined | Connection
    • address: undefined | PublicKey

    Returns undefined | Mint

  • withClose(instructions: TransactionInstruction[], owner: PublicKey, mint: PublicKey, rentDestination: PublicKey): Promise<void>
  • Add close associated token account IX

    static
    memberof

    AssociatedToken

    Parameters

    • instructions: TransactionInstruction[]
    • owner: PublicKey
    • mint: PublicKey
    • rentDestination: PublicKey

    Returns Promise<void>

  • withCreate(instructions: TransactionInstruction[], provider: AnchorProvider, owner: PublicKey, mint: PublicKey): Promise<PublicKey>
  • If the associated token account does not exist for this mint, add instruction to create the token account.If ATA exists, do nothing.

    static
    memberof

    AssociatedToken

    Parameters

    • instructions: TransactionInstruction[]
    • provider: AnchorProvider
    • owner: PublicKey
    • mint: PublicKey

    Returns Promise<PublicKey>

    returns the public key of the token account

  • withUnwrapIfNative(instructions: TransactionInstruction[], provider: AnchorProvider, owner: PublicKey, tokenAccount: PublicKey, mint: PublicKey, amount: BN): Promise<void>
  • add unWrap SOL IX

    Parameters

    • instructions: TransactionInstruction[]
    • provider: AnchorProvider
    • owner: PublicKey
    • tokenAccount: PublicKey
    • mint: PublicKey
    • amount: BN

    Returns Promise<void>

  • withWrapIfNativeMint(instructions: TransactionInstruction[], provider: AnchorProvider, owner: PublicKey, mint: PublicKey, amount: BN): Promise<void>
  • Add wrap SOL IX

    Parameters

    • instructions: TransactionInstruction[]
    • provider: AnchorProvider
    • owner: PublicKey
    • mint: PublicKey
    • amount: BN

    Returns Promise<void>

Generated using TypeDoc