This package provides runtime type definitions for data structures and transaction types used on the KILT blockchain.
It is required when using @polkadot/api
to interact with the KILT blockchain.
To install, run:
yarn add @kiltprotocol/augment-api
Import typesBundle
from the package and pass it to the API initialization options, as exemplified in the following snippet:
import { ApiPromise, WsProvider } from '@polkadot/api'
import { typesBundle } from '@kiltprotocol/type-definitions'
const provider = new WsProvider('wss://spiritnet.kilt.io')
const api = await ApiPromise.create({
provider,
typesBundle,
})
This package contains type definitions for all runtime versions of various production and test networks.
@polkadot/api
will automatically select the right type definitions for the current network and runtime version.
Make sure you are on the latest version of these type definitions when a runtime upgrade is incoming to ensure your application remains compatible with the upgrade.