Skip to content

his library provides additional typing information for user to access Dust Chain

License

Notifications You must be signed in to change notification settings

dustprotocol/dust.js

Repository files navigation

license npm

@dust-defi

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

Getting Started

More documentation and examples on wiki.

  • Install dependencies
yarn add @polkadot/api @dust-defi/api@beta
  • Create API instance
import { ApiPromise } from '@polkadot/api';
import { WsProvider } from '@polkadot/rpc-provider';
import { options } from '@dust-defi/api';

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

    // use api
}

main()
  • Use api to interact with node
// query and display account data
const data = await api.query.system.account('5F98oWfz2r5rcRVnP9VCndg33DAAsky3iuoBSpaPUbgN9AJn');
console.log(data.toHuman())

Packages

  • api
    • Contains necessary options to create a polkadot.js API instance
  • api-derive
    • Additional polkadot.js derives for Dust Chain
  • app-util
    • Utilities to work with Dust Chain
  • types
    • Polkadot.js type definations for Dust Chain

About

his library provides additional typing information for user to access Dust Chain

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published