This library provides additional typing information for user to access Acala Network by using polkadot.js.
- install
yarn add @polkadot/api @acala-network/api
- import TS interfaces augmentation
// index.ts
import '@acala-network/types';
- create and use api with Acala type definitions
import { ApiPromise, WsProvider } from '@polkadot/api';
import { options } from '@acala-network/api';
const provider = new WsProvider('wss://karura-rpc.aca-api.network');
const api = new ApiPromise(options({ provider }));
await api.isReady;
// use api
const data = await api.query.system.account('5F98oWfz2r5rcRVnP9VCndg33DAAsky3iuoBSpaPUbgN9AJn');
console.log(data.toHuman())