npm.io
1.11502.1 • Published 1 year ago

@kiltprotocol/type-definitions

Licence
BSD-4-Clause
Version
1.11502.1
Deps
0
Size
84 kB
Vulns
0
Weekly
0

Runtime Type Definitions for the KILT Network

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.

Installation

To install, run:

yarn add @kiltprotocol/type-definitions

Usage

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,
})
Mainnet and Testnet Types

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.