@starfetch/sdk
v1.0.4
Published
SDK for the Starfetch apps
Readme
Installation
To use the Starfetch SDK, you need to install the
@starfetch/sdk package and some @polkadot dependencies:
$ yarn add @starfetch/sdk @polkadot/api-augment @polkadot/api
# or
$ npm i @starfetch/sdk @polkadot/api-augment @polkadot/apiUsage
import { Tokens, getApiPromise } from '@starfetch/sdk'
const ALICE_ACCOUNT_ID = '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY'
const api = await getApiPromise(endpoint)
const tokens = new Tokens(api)
// get balance of ALICE
const balance = await tokens.nativeBalance(ALICE_ACCOUNT_ID)