Function getProgramAccountInfoAndSubscribe

  • Fetch an account for the specified public key and subscribe a callback to be invoked whenever the specified account changes.

    Returns

    subscription id

    Type Parameters

    Type Parameters

    • T

    Parameters

    • connection: Connection

      Connection to use

    • publicKey: PublicKey

      Public key of the account to monitor

    • coder: Coder<string, string>
    • accountType: string
    • callback: ((acc: AccountInfo<T>, context: Context) => void)

      Function to invoke whenever the account is changed

        • (acc: AccountInfo<T>, context: Context): void
        • Parameters

          • acc: AccountInfo<T>
          • context: Context

          Returns void

    • Optional commitment: Commitment

      Specify the commitment level account changes must reach before notification

    Returns Promise<number>

Generated using TypeDoc