@polkadot/api -> dedot
Initialize clients
import { ApiPromise, WsProvider } from '@polkadot/api';
const provider = new WsProvider('wss://rpc.polkadot.io');
const client = await ApiPromise.create({ provider });import { DedotClient, WsProvider } from 'dedot';
import type { PolkadotApi } from '@dedot/chaintypes';
const provider = new WsProvider('wss://rpc.polkadot.io');
const client = await DedotClient.new<PolkadotApi>(provider); // or DedotClient.create(...) if you prefer
// OR if you want to put additional api options when initialize the client
const client = await DedotClient.new<PolkadotApi>({ provider, cacheMetadata: true });Type system
Last updated