Skip to content

AcalaNetwork/acala-types.js

Repository files navigation

license npm

@acala-network

This library provides additional typing information for user to access Acala Network by using polkadot.js.

Getting Started

  • 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())

Packages

  • api
    • Contains necessary options to create a polkadot.js API instance
  • types
    • Polkadot.js type definations for Acala Network