• Get or create a token account

    Returns

    the token account address

    Parameters

    • connection: Connection

      Solana connection object

    • wallet: PublicKey

      the owner of the token account

    • mint: PublicKey

      the mint

    • newAccountFunder: PublicKey = wallet

      the payer of the rent for new account if a new account is to be created

    • Optional amountNeededHeuristic: number

      amount needed heuristic. Used to select the minimum acceptable balance in case the wallet has more than one token account

    Returns Promise<{
        tokenAccount: PublicKey;
    } | {
        createInstruction: InstructionReturn;
        tokenAccount: Keypair | PublicKey;
    }>

Generated using TypeDoc