Use factory methods (create
, new
) to create Dedot
instances.
Protected
Optional
_genesisProtected
Optional
_localProtected
Optional
_metadataProtected
_optionsProtected
Optional
_registryProtected
Optional
_runtimeProtected
Optional
_runtimeProtected
onProtected
onEntry-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();
Protected
afterCreate 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
Protected
beforeProtected
callProtected
cleanProtected
clearProtected
doProtected
doProtected
doneRest
...args: any[]Protected
ensureProtected
fetchOptional
hash: `0x${string}`Optional
runtime: SubstrateRuntimeVersionProtected
getOptional
runtime: SubstrateRuntimeVersionProtected
getOptional
runtime: 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
Protected
initializeProtected
initializeProtected
normalizeOptional
handler: HandlerFnProtected
setProtected
setupProtected
shouldProtected
startProtected
toStatic
createFactory method to create a new Dedot instance
Static
newAlias for LegacyClient.create
Name
LegacyClient
Description
Promised-based API Client for Polkadot & Substrate
Initialize API instance and interact with substrate-based network