What is @polkadot/types-known?
@polkadot/types-known is a package that provides known types and constants for the Polkadot and Substrate ecosystem. It is used to manage and decode the types and constants that are specific to different networks and runtime versions.
What are @polkadot/types-known's main functionalities?
Known Types Management
This feature allows you to access and manage the known types for different networks. The code sample demonstrates how to import and log the known types available in the package.
const { knownTypes } = require('@polkadot/types-known');
console.log(knownTypes);
Network-Specific Constants
This feature provides access to network-specific constants such as genesis hashes. The code sample shows how to retrieve the genesis hash for the Polkadot network.
const { knownGenesis } = require('@polkadot/types-known');
console.log(knownGenesis['polkadot']);
Other packages similar to @polkadot/types-known
@polkadot/api
@polkadot/api is a comprehensive library for interacting with Polkadot and Substrate-based blockchains. It includes functionalities for querying chain state, submitting transactions, and managing accounts. While @polkadot/types-known focuses on known types and constants, @polkadot/api provides a broader set of tools for blockchain interaction.
@polkadot/types
@polkadot/types is a package that provides type definitions and utilities for encoding and decoding data on Polkadot and Substrate networks. It is more focused on the type system and serialization/deserialization processes, whereas @polkadot/types-known is specifically about known types and constants for different networks.
@polkadot/types-known
Specific known base type overrides (e.g. Address
, etc) for chains & specs. This does not contain user-specific types.