Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NewPendingTransactions

Description:

Subscribes to incoming pending transactions

Hierarchy

Index

Constructors

constructor

Properties

connection

connection: W3CWebsocket | WebSocket

emitter

emitter: mitt.Emitter

handlers

handlers: any

jsonRpc

jsonRpc: JsonRpc

messenger

messenger: Messenger

options

options: any

param

param: any

Protected reqMiddleware

reqMiddleware: ReqMiddleware = new Map().set('*', [])

Protected resMiddleware

resMiddleware: ResMiddleware = new Map().set('*', [])

shardID

shardID: number

subscriptionId

subscriptionId: any = null

subscriptions

subscriptions: any

url

url: string

Accessors

connected

  • get connected(): boolean
  • Returns boolean

Methods

addEventListener

  • addEventListener(type: string, handler: mitt.Handler): void
  • Parameters

    • type: string
    • handler: mitt.Handler

    Returns void

clearSubscriptions

  • clearSubscriptions(unsubscribeMethod: string): Promise<boolean>
  • Parameters

    • unsubscribeMethod: string

    Returns Promise<boolean>

constructPayload

  • constructPayload(method: string, param: any, options?: any): RPCRequestPayload<any>
  • Parameters

    • method: string
    • param: any
    • Optional options: any

    Returns RPCRequestPayload<any>

createWebsocketProvider

  • createWebsocketProvider(url: string, options?: any): w3cwebsocket | WebSocket
  • Parameters

    • url: string
    • Default value options: any = {}

    Returns w3cwebsocket | WebSocket

Protected getMiddleware

  • getMiddleware(method: RPCMethod | string): [ReqMiddleware[], ResMiddleware[]]
  • Parameters

    • method: RPCMethod | string

    Returns [ReqMiddleware[], ResMiddleware[]]

getSubscriptionEvent

  • getSubscriptionEvent(subscriptionId: any): any

hasSubscription

  • hasSubscription(subscriptionId: string): boolean
  • Parameters

    • subscriptionId: string

    Returns boolean

isConnecting

  • isConnecting(): boolean

on

  • on(type: string, handler: mitt.Handler): this
  • Parameters

    • type: string
    • handler: mitt.Handler

    Returns this

onClose

  • onClose(closeEvent: any): void
  • Parameters

    • closeEvent: any

    Returns void

onConnect

  • onConnect(): Promise<void>
  • Returns Promise<void>

onData

  • onData(handler: any): this
  • Parameters

    • handler: any

    Returns this

onError

  • onError(event: any): void
  • Parameters

    • event: any

    Returns void

onMessage

  • onMessage(msg: MessageEvent): void
  • Parameters

    • msg: MessageEvent

    Returns void

onNewSubscriptionItem

  • onNewSubscriptionItem(subscriptionItem: any): any

onReady

  • onReady(event: any): void
  • Parameters

    • event: any

    Returns void

once

  • once(type: string, handler: mitt.Handler): void
  • Parameters

    • type: string
    • handler: mitt.Handler

    Returns void

Protected pushMiddleware

  • pushMiddleware(fn: any, type: MiddlewareType, match: string | RPCMethod | RegExp): void
  • Parameters

    • fn: any
    • type: MiddlewareType
    • match: string | RPCMethod | RegExp

    Returns void

reconnect

  • reconnect(): void
  • Returns void

registerEventListeners

  • registerEventListeners(): void

removeAllSocketListeners

  • removeAllSocketListeners(): void
  • Returns void

removeEventListener

  • removeEventListener(type?: string, handler?: mitt.Handler): any
  • Parameters

    • Optional type: string
    • Optional handler: mitt.Handler

    Returns any

reset

  • reset(): void
  • Returns void

resetHandlers

  • resetHandlers(): void
  • Returns void

send

  • send(payload: RPCRequestPayload<object>): Promise<any>
  • Parameters

    • payload: RPCRequestPayload<object>

    Returns Promise<any>

start

  • start(): Promise<this>
  • Returns Promise<this>

subscribe

  • subscribe(payload: RPCRequestPayload<any[]>): Promise<any>
  • Parameters

    • payload: RPCRequestPayload<any[]>

    Returns Promise<any>

unsubscribe

  • unsubscribe(): Promise<any>

validate

  • validate(response: any, payload?: any): true | Error
  • Parameters

    • response: any
    • Optional payload: any

    Returns true | Error

Object literals

middlewares

middlewares: object

request

request: object

use

  • use(fn: ReqMiddleware, match?: string | RPCMethod | RegExp): void
  • Parameters

    • fn: ReqMiddleware
    • Default value match: string | RPCMethod | RegExp = "*"

    Returns void

response

response: object

use

  • use(fn: ResMiddleware, match?: string | RPCMethod | RegExp): void
  • Parameters

    • fn: ResMiddleware
    • Default value match: string | RPCMethod | RegExp = "*"

    Returns void

Generated using TypeDoc