Pezkuwi API
    Preparing search index...

    Class RpcCore

    Rpc

    It allows for querying a Pezkuwi Client Node. WebSockets provider is recommended since HTTP provider only supports basic querying.

    graph LR;
      A[Api] --> |WebSockets| B[WsProvider];
      B --> |endpoint| C[ws://127.0.0.1:9944]
    

    import Rpc from '@pezkuwi/rpc-core';
    import { WsProvider } from '@pezkuwi/rpc-provider/ws';

    const provider = new WsProvider('ws://127.0.0.1:9944');
    const rpc = new Rpc(provider);
    Index
    • Default constructor for the core RPC handler

      Parameters

      • instanceId: string
      • registry: Registry

        Type Registry

      • Optional__namedParameters: Options

      Returns RpcCore

    mapping: Map<string, DefinitionRpcExt> = ...
    provider: ProviderInterface
    sections: string[] = []
    • get isConnected(): boolean

      Returns boolean

      Returns the connected status of a provider

    • get stats(): RpcCoreStats | undefined

      Returns RpcCoreStats | undefined

      Returns the underlying core stats, including those from teh provider

    • Parameters

      • userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>

      Returns void

    • Returns Promise<void>

      Manually connect from the attached provider

    • Returns Promise<void>

      Manually disconnect from the attached provider

    • Parameters

      • registrySwap: (blockHash: Uint8Array) => Promise<{ registry: Registry }>

      Returns void

      Sets a registry swap (typically from Api)

    • Parameters

      • resolveBlockHash: (blockNumber: AnyNumber) => Promise<Uint8Array>

      Returns void

      Sets a function to resolve block hash from block number