Use factory methods (create, new) to create Dedot instances.
Protected Optional_genesisProtected Optional_localProtected Optional_metadataProtected_optionsProtected Optional_registryProtected Optional_runtimeProtected Optional_runtimeProtectedonProtectedonEntry-point for executing runtime api
// Get account nonce
const nonce = await api.call.accountNonceApi.accountNonce(<address>);
// Query transaction payment info
const tx = api.tx.balances.transferKeepAlive(<address>, 2_000_000_000_000n);
const queryInfo = await api.call.transactionPaymentApi.queryInfo(tx.toU8a(), tx.length);
Entry-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();
ProtectedafterCreate a new API instance at a specific block hash This is useful when we want to inspect the state of the chain at a specific block hash
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: HandlerFnProtectedsetProtectedsetupProtectedshouldProtectedstartProtectedtoStaticcreateFactory method to create a new Dedot instance
StaticnewAlias for LegacyClient.create
Name
LegacyClient
Description
Promised-based API Client for Polkadot & Substrate
Initialize API instance and interact with substrate-based network