subscriptions: {
    getBeatSubscriptionUrl: ((baseURL: string, options?: BlockSubscriptionOptions) => string);
    getBlockSubscriptionUrl: ((baseURL: string, options?: BlockSubscriptionOptions) => string);
    getEventSubscriptionUrl: ((baseURL: string, event: EventLike, indexedValues?: unknown[], options?: EventSubscriptionOptions) => string);
    getLegacyBeatSubscriptionUrl: ((baseURL: string, options?: BlockSubscriptionOptions) => string);
    getNewTransactionsSubscriptionUrl: ((baseURL: string) => string);
    getVETtransfersSubscriptionUrl: ((baseURL: string, options?: VETtransfersSubscriptionOptions) => string);
} = ...

Subscriptions utilities. Contains functions for obtaining URLs for subscribing to events through a websocket connection.

Type declaration

  • getBeatSubscriptionUrl: ((baseURL: string, options?: BlockSubscriptionOptions) => string)
      • (baseURL, options?): string
      • Returns the URL for subscribing to new beats through a websocket connection.

        Parameters

        • baseURL: string

          The URL of the node to request the subscription from.

        • Optionaloptions: BlockSubscriptionOptions

          (optional) other optional parameters for the request. blockID - The block id to start from, defaults to the best block.

        Returns string

        The websocket subscription URL.

        this subscribes to the updated version of the beats. The new version uses a dynamic size bloom filter.

  • getBlockSubscriptionUrl: ((baseURL: string, options?: BlockSubscriptionOptions) => string)
      • (baseURL, options?): string
      • Returns the URL for subscribing to new blocks through a websocket connection.

        Parameters

        • baseURL: string

          The URL of the node to request the subscription from.

        • Optionaloptions: BlockSubscriptionOptions

          (optional) other optional parameters for the request. blockID - The block id to start from, defaults to the best block.

        Returns string

        The websocket subscription URL.

  • getEventSubscriptionUrl: ((baseURL: string, event: EventLike, indexedValues?: unknown[], options?: EventSubscriptionOptions) => string)
      • (baseURL, event, indexedValues?, options?): string
      • Returns the URL for subscribing to an event through a websocket connection.

        Parameters

        • baseURL: string

          The URL of the node to request the subscription from.

        • event: EventLike

          The event to subscribe to. Can be an event object or a string representing an event.

        • OptionalindexedValues: unknown[]

          The values of the indexed parameters to construct the topic filters.

        • Optionaloptions: EventSubscriptionOptions

          (optional) other optional parameters for the request. blockID - The block id to start from, defaults to the best block. address - The contract address to filter events by.

        Returns string

        The websocket subscription URL.

        Will throw an error if the event is not a valid event or if the indexed values to encode are invalid.

  • getLegacyBeatSubscriptionUrl: ((baseURL: string, options?: BlockSubscriptionOptions) => string)
      • (baseURL, options?): string
      • Returns the URL for subscribing to new beats through a websocket connection.

        Parameters

        • baseURL: string

          The URL of the node to request the subscription from.

        • Optionaloptions: BlockSubscriptionOptions

          (optional) other optional parameters for the request. blockID - The block id to start from, defaults to the best block.

        Returns string

        The websocket subscription URL.

        This subscribes to the legacy beats. Legacy Beat source code

  • getNewTransactionsSubscriptionUrl: ((baseURL: string) => string)
      • (baseURL): string
      • Returns the URL for subscribing to new transactions through a websocket connection.

        Parameters

        • baseURL: string

          The URL of the node to request the subscription from.

        Returns string

        The websocket subscription URL.

  • getVETtransfersSubscriptionUrl: ((baseURL: string, options?: VETtransfersSubscriptionOptions) => string)
      • (baseURL, options?): string
      • Returns the URL for subscribing to new VET transfers through a websocket connection.

        Parameters

        • baseURL: string

          The URL of the node to request the subscription from.

        • Optionaloptions: VETtransfersSubscriptionOptions

          (optional) other optional parameters for the request. blockID - The block id to start from, defaults to the best block. signerAddress - The address of the signer of the transaction to filter transfers by. sender - The sender address to filter transfers by. recipient - The recipient address to filter transfers by.

        Returns string

        The websocket subscription URL.