@jamton/sdk
v1.7.2
Published
SDK for the JAMTON apps
Readme
Installation
To use the Jamton SDK, you need to install the
@jamton/sdk package and some @polkadot dependencies:
$ yarn add @jamton/sdk @polkadot/api-augment @polkadot/api
# or
$ npm i @jamton/sdk @polkadot/api-augment @polkadot/apiUsage
import { Tokens, getApiPromise } from '@jamton/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)Testing
Run the deterministic unit suite with:
yarn testLive network checks are kept separate and run serially:
yarn test:integrationThe integration suite uses the current JAMTON devnet endpoints by default. Override them when needed:
JAMTON_PARACHAIN_WS=wss://your-parachain-endpoint \
POLKADOT_RELAYCHAIN_WS=wss://your-relaychain-endpoint \
yarn test:integration