Function getAccountInfoAndSubscribe

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

    Returns

    subscription id

    Parameters

    • connection: Connection

      Connection to use

    • publicKey: PublicKey

      Public key of the account to monitor

    • callback: ((acc: AccountInfo<Buffer>, context: Context) => void)

      Function to invoke whenever the account is changed

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

          • acc: AccountInfo<Buffer>
          • context: Context

          Returns void

    • Optional commitment: Commitment

      Specify the commitment level account changes must reach before notification

    Returns Promise<number>

Generated using TypeDoc