• Utility function that checks whether associated token accounts exist and return instructions to populate them if not

    Parameters

    • connection: Connection

      Solana client connection

    • owners: PublicKey[]

      Array of ATA owners

    • mint: PublicKey

      Mint for which ATA will be checked

    • invoker: Keypair | SignerWalletAdapter

      Transaction invoker and payer

    • OptionalprogramId: PublicKey

      Program ID of the Mint

    Returns Promise<TransactionInstruction[]>

    Array of Transaction Instructions that should be added to a transaction