Module

x/polkadot/rpc-core/mod.ts>RpcCore

Package publishing for deno.land/x/polkadot
Go to Latest
class RpcCore
import { RpcCore } from "https://dotland.deno.dev/x/polkadot@0.2.38/rpc-core/mod.ts";

Examples

import Rpc from 'https://deno.land/x/polkadot@0.2.38/rpc-core/mod.ts';
import { WsProvider } from 'https://deno.land/x/polkadot@0.2.38/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,
unnamed 2: Options,
)

Properties

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

Methods

private
_createMethodSend(
section: string,
method: string,
): RpcInterfaceMethod
private
_createMethodSubscribe(
section: string,
method: string,
): RpcInterfaceMethod
private
_createSubscriber(unnamed 0: { subType: string; subName: string; paramsJson: AnyJson[]; update: ProviderInterfaceCallback; }, errorHandler: (error: Error) => void): Promise<number | string>
private
_formatOutput(
registry: Registry,
blockHash:
| Uint8Array
| string
| null
| undefined
,
method: string,
params: Codec[],
result?: unknown,
): Codec | Codec[]
private
_formatParams(
registry: Registry,
blockHash:
| Uint8Array
| string
| null
| undefined
,
inputs: unknown[],
): Codec[]
private
_formatResult<T>(
isScale: boolean,
registry: Registry,
blockHash:
| string
| Uint8Array
| null
| undefined
,
method: string,
params: Codec[],
result: unknown,
): T
private
_formatStorageData(
registry: Registry,
blockHash:
| Uint8Array
| string
| null
| undefined
,
value: string | null,
): Codec
private
_formatStorageSet(
registry: Registry,
blockHash: string,
keys: Vec<StorageKey>,
changes: [string, string | null][],
): Codec[]
private
_formatStorageSetEntry(
registry: Registry,
blockHash: string,
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
,
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