reef-defi / reef.js

Libraries for interacting with the Reef Chain
Apache License 2.0
2 stars 2 forks source link

license npm

@reef-defi

This library provides additional typing information for user to access Reef Chain by using polkadot.js.

Getting Started

More documentation and examples on wiki.

yarn add @polkadot/api @reef-defi/api@beta
import { ApiPromise } from '@polkadot/api';
import { WsProvider } from '@polkadot/rpc-provider';
import { options } from '@reef-defi/api';

async function main() {
    const provider = new WsProvider('wss://rpc-testnet.reefscan.com/ws');
    const api = new ApiPromise(options({ provider }));
    await api.isReady;

    // use api
}

main()
// query and display account data
const data = await api.query.system.account('5F98oWfz2r5rcRVnP9VCndg33DAAsky3iuoBSpaPUbgN9AJn');
console.log(data.toHuman())

Packages