SmoldotProvider

Hierarchy

  • SubscriptionProvider
    • SmoldotProvider

Constructors

  • Parameters

    • chain: Chain | Promise<Chain>

    Returns SmoldotProvider

Properties

_handlers: Record<number, RequestState<any>>
_onReceiveResponse: ((response: string) => void)
_pendingNotifications: Record<string, JsonRpcResponseNotification<any>[]>
_subscriptions: Record<string, SubscriptionState>

Accessors

  • get status(): ConnectionStatus
  • The current connection status

    Returns ConnectionStatus

Methods

  • Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Returns Promise<Chain>

  • Returns void

  • Returns Promise<SmoldotProvider>

  • Disconnect the provider & remove the chain

    To reconnect again, make sure set a new smoldot.Chain instance via setChain first & call connect

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Parameters

    Returns boolean

  • Parameters

    Returns this

  • Parameters

    Returns Unsub

  • Parameters

    Returns Unsub

  • Send a JSON-RPC request, make sure to connect to the provider first before sending requests

    Type Parameters

    • T = any

    Parameters

    • method: string
    • params: any[]

    Returns Promise<T>

  • Parameters

    • chain: Chain | Promise<Chain>

    Returns void