New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kiltprotocol/type-definitions

Package Overview
Dependencies
Maintainers
3
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kiltprotocol/type-definitions

Type decorations for the KILT blockchain.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
decreased by-30.48%
Maintainers
3
Weekly downloads
 
Created
Source

type-definitions

KILT's type definitions for Polkadot.js

Example usage

Depending on which chain you connect to, the spec name changes. You can check the spec name using api.runtimeVersion.specName. The polkadot.js API will select the correct types matching the spec name of the chain to the keys inside the spec object.

const {
  typeBundleForPolkadot,
} = require('@kiltprotocol/type-definitions')
const { ApiPromise, WsProvider } = require('@polkadot/api')

const api = await ApiPromise.create({
    provider: new WsProvider('wss://peregrine.kilt.io/parachain-public-ws'),
    typesBundle: {
        spec: {
            'mashnet-node': typeBundleForPolkadot,
            'kilt-spiritnet': typeBundleForPolkadot,
        },
    },
})

console.log(`Spec: ${api.runtimeVersion.specName.toString()}`)

Generate the type definitions

To generate the type definitions, run yarn generate-types from the project root. It will generate all the type definitions and save them in the types directory each with the name types/types<min_version>-<max_version>.json, for examples types/types23-24.json.

FAQs

Package last updated on 05 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc