Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.17 KB

README.md

File metadata and controls

42 lines (30 loc) · 1.17 KB

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