
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
@dedot/chaintypes
Advanced tools
TypeScript definitions for various PolkadotSDK-based known networks.
# Install dedot
npm i dedot
# Install chaintypes as a dev dependency
npm i -D @dedot/chaintypes
Note:
@dedot/chaintypesshould be installed as a dev dependency since it only provides TypeScript type definitions for known-chains and is not needed at runtime.
Import types for specific networks:
// Import types for Polkadot
import type { PolkadotApi } from '@dedot/chaintypes';
// Import types for Kusama
import type { KusamaApi } from '@dedot/chaintypes';
// Import types for other networks
import type {
AstarApi,
MoonbeamApi,
// ... other networks
} from '@dedot/chaintypes';
You can also import types for specific networks directly:
// Import types for Polkadot directly
import type { PolkadotApi } from '@dedot/chaintypes/polkadot';
To get full TypeScript support when working with a specific network, you can initialize a DedotClient with the appropriate ChainApi:
import { DedotClient, WsProvider } from 'dedot';
import type { PolkadotApi } from '@dedot/chaintypes';
// Initialize a typed client for Polkadot
const client = await DedotClient.new<PolkadotApi>(new WsProvider('wss://rpc.polkadot.io'));
// Now you get full TypeScript support for Polkadot-specific APIs
const balance = await client.query.system.account('ADDRESS');
import { DedotClient, WsProvider } from 'dedot';
import type { PolkadotApi, KusamaApi, AstarApi, PolkadotAssetHubApi } from '@dedot/chaintypes';
// For Kusama
const kusamaClient = await DedotClient.new<KusamaApi>(new WsProvider('wss://kusama-rpc.polkadot.io'));
// For Astar
const astarClient = await DedotClient.new<AstarApi>(new WsProvider('wss://rpc.astar.network'));
// For Polkadot Asset Hub
const polkadotAssetHubClient = await DedotClient.new<PolkadotAssetHubApi>(
new WsProvider('wss://polkadot-asset-hub-rpc.polkadot.io')
);
For more detailed information on connecting to networks, see the official documentation.
Don't see your network? We welcome Pull Requests to add support for additional PolkadotSDK-based networks!
Apache-2.0
FAQs
Types for substrate-based chains
We found that @dedot/chaintypes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.