Skip to main content
Module

x/polkadot/mod.ts>rpcCore.RpcCore

Package publishing for deno.land/x/polkadot
Go to Latest
class rpcCore.RpcCore
import { rpcCore } from "https://deno.land/x/polkadot@0.2.33/mod.ts";
const { RpcCore } = rpcCore;

Examples

import Rpc from 'https://deno.land/x/polkadot@0.2.33/rpc-core/mod.ts';
import { WsProvider } from 'https://deno.land/x/polkadot@0.2.33/rpc-provider/ws/index.ts';

const provider = new WsProvider('ws://127.0.0.1:9944');
const rpc = new Rpc(provider);

Constructors

new
RpcCore(
instanceId: string,
registry: Registry,
provider: ProviderInterface,
userRpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>,
)

Properties

readonly
isConnected: boolean
readonly
mapping: Map<string, DefinitionRpcExt>
readonly
provider: ProviderInterface
readonly
sections: string[]

Methods

private
_createMethodSend(
section: string,
method: string,
def: DefinitionRpc,
): RpcInterfaceMethod
private
_createMethodSubscribe(
section: string,
method: string,
def: DefinitionRpcSub,
): RpcInterfaceMethod
private
_createSubscriber(unnamed 0: { subType: string; subName: string; paramsJson: AnyJson[]; update: ProviderInterfaceCallback; }, errorHandler: (error: Error) => void): Promise<number | string>
private
_formatInputs(
registry: Registry,
blockHash:
| Uint8Array
| string
| null
| undefined
,
def: DefinitionRpc,
inputs: unknown[],
): Codec[]
private
_formatOutput(
registry: Registry,
blockHash:
| Uint8Array
| string
| null
| undefined
,
method: string,
rpc: DefinitionRpc,
params: Codec[],
result?: unknown,
): Codec | Codec[]
private
_formatResult<T>(
isScale: boolean,
registry: Registry,
blockHash:
| string
| Uint8Array
| null
| undefined
,
method: string,
def: DefinitionRpc,
params: Codec[],
result: unknown,
): T
private
_formatStorageData(
registry: Registry,
blockHash:
| Uint8Array
| string
| null
| undefined
,
key: StorageKey,
value: string | null,
): Codec
private
_formatStorageSet(
registry: Registry,
blockHash: string,
keys: Vec<StorageKey>,
changes: [string, string | null][],
): Codec[]
private
_formatStorageSetEntry(
registry: Registry,
blockHash: string,
key: StorageKey,
changes: [string, string | null][],
withCache: boolean,
entryIndex: number,
): Codec
private
_memomize(creator: <T>(isScale: boolean) => (...values: unknown[]) => Observable<T>, def: DefinitionRpc): MemoizedRpcInterfaceMethod
private
_newType(
registry: Registry,
blockHash:
| Uint8Array
| string
| null
| undefined
,
key: StorageKey,
input: string | Uint8Array | null,
isEmpty: boolean,
entryIndex?,
): Codec
addUserInterfaces(userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>): void
connect(): Promise<void>
disconnect(): Promise<void>
setRegistrySwap(registrySwap: (blockHash: Uint8Array) => Promise<{ registry: Registry; }>): void
setResolveBlockHash(resolveBlockHash: (blockNumber: AnyNumber) => Promise<Uint8Array>): void