Use factory methods (create, new) to create DedotClient instances.
Protected Optional_chainProtected Optional_chainProtected Optional_genesisProtected Optional_localProtected Optional_metadataProtected_optionsProtected Optional_registryProtected Optional_runtimeProtected Optional_runtimeProtected Optional_txEntry-point for executing JSON-RPCs to blockchain node.
const client = new JsonRpcClient('wss://rpc.polkadot.io');
await client.connect();
// Subscribe to new heads
client.rpc.chain_subscribeNewHeads((header) => {
console.log(header);
});
// Execute arbitrary rpc method: `module_rpc_name`
const result = await client.rpc.module_rpc_name();
ProtectedafterGet a new API instance at a specific block hash For now, this only supports pinned block hashes from the chain head
ProtectedbeforeProtectedcallProtectedcleanProtectedclearProtecteddoProtecteddoProtecteddoneRest...args: any[]ProtectedensureProtectedfetchOptionalhash: `0x${string}`Optionalruntime: SubstrateRuntimeVersionProtectedgetOptionalruntime: SubstrateRuntimeVersionProtectedgetOptionalruntime: SubstrateRuntimeVersionGet current version of the runtime
This is similar to .runtimeVersion but also ensure
the corresponding metadata of this runtime version is downloaded & setup.
This is helpful when you want to check runtime version to prepare for runtime upgrade
ProtectedinitializeProtectedinitializeProtectednormalizeOptionalhandler: HandlerFnProtectedonProtectedonProtectedonProtectedsetProtectedsetupProtectedshouldProtectedstartProtectedsubscribeProtectedtoStaticcreateFactory method to create a new DedotClient instance
StaticnewAlias for DedotClient.create
Name
DedotClient
Description
New promised-based API Client for Polkadot & Substrate based on JSON-RPC V2
Unstable, use with caution.