@dedot/chaintypes 0.73.1-next.25bbf96b.0 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,97 @@
1
1
  # @dedot/chaintypes
2
2
 
3
- Chaintypes for Substrate-based chains
3
+ TypeScript definitions for various PolkadotSDK-based known networks.
4
4
 
5
- Docs & instructions coming soon!
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Install dedot
9
+ npm i dedot
10
+
11
+ # Install chaintypes as a dev dependency
12
+ npm i -D @dedot/chaintypes
13
+ ```
14
+
15
+ > Note:
16
+ > `@dedot/chaintypes` should be installed as a dev dependency since it only provides TypeScript type definitions for known-chains and is not needed at runtime.
17
+
18
+ ## Usage
19
+
20
+ Import types for specific networks:
21
+
22
+ ```typescript
23
+ // Import types for Polkadot
24
+ import type { PolkadotApi } from '@dedot/chaintypes';
25
+
26
+ // Import types for Kusama
27
+ import type { KusamaApi } from '@dedot/chaintypes';
28
+
29
+ // Import types for other networks
30
+ import type {
31
+ AstarApi,
32
+ MoonbeamApi,
33
+ // ... other networks
34
+ } from '@dedot/chaintypes';
35
+ ```
36
+
37
+ You can also import types for specific networks directly:
38
+
39
+ ```typescript
40
+ // Import types for Polkadot directly
41
+ import type { PolkadotApi } from '@dedot/chaintypes/polkadot';
42
+ ```
43
+
44
+ ## Initializing DedotClient with ChainTypes
45
+
46
+ To get full TypeScript support when working with a specific network, you can initialize a DedotClient with the appropriate `ChainApi`:
47
+
48
+ ```typescript
49
+ import { DedotClient, WsProvider } from 'dedot';
50
+ import type { PolkadotApi } from '@dedot/chaintypes';
51
+
52
+ // Initialize a typed client for Polkadot
53
+ const client = await DedotClient.new<PolkadotApi>(new WsProvider('wss://rpc.polkadot.io'));
54
+
55
+ // Now you get full TypeScript support for Polkadot-specific APIs
56
+ const balance = await client.query.system.account('ADDRESS');
57
+ ```
58
+
59
+ ### Examples for Different Networks
60
+
61
+ ```typescript
62
+ import { DedotClient, WsProvider } from 'dedot';
63
+ import type { PolkadotApi, KusamaApi, AstarApi, PolkadotAssetHubApi } from '@dedot/chaintypes';
64
+
65
+ // For Kusama
66
+ const kusamaClient = await DedotClient.new<KusamaApi>(new WsProvider('wss://kusama-rpc.polkadot.io'));
67
+
68
+ // For Astar
69
+ const astarClient = await DedotClient.new<AstarApi>(new WsProvider('wss://rpc.astar.network'));
70
+
71
+ // For Polkadot Asset Hub
72
+ const polkadotAssetHubClient = await DedotClient.new<PolkadotAssetHubApi>(
73
+ new WsProvider('wss://polkadot-asset-hub-rpc.polkadot.io')
74
+ );
75
+ ```
76
+
77
+ For more detailed information on connecting to networks, see the [official documentation](https://docs.dedot.dev/getting-started/connect-to-network#pick-chainapi-interface-for-the-network-youre-working-with).
78
+
79
+ ## Supported Networks
80
+
81
+ - Polkadot
82
+ - Kusama
83
+ - Astar
84
+ - Moonbeam
85
+ - Polkadot Asset Hub
86
+ - Kusama Asset Hub
87
+ - Aleph
88
+ - Westend
89
+ - Westend Asset Hub
90
+ - Westend People
91
+ - Paseo
92
+
93
+ > Don't see your network? We welcome Pull Requests to add support for additional PolkadotSDK-based networks!
94
+
95
+ ## License
96
+
97
+ Apache-2.0
package/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export type { SubstrateApi } from './substrate';
2
- export type { PolkadotApi } from './polkadot';
3
- export type { KusamaApi } from './kusama';
4
- export type { MoonbeamApi } from './moonbeam';
5
- export type { AstarApi } from './astar';
6
- export type { KusamaAssetHubApi } from './kusama-asset-hub';
7
- export type { AlephApi } from './aleph';
8
- export type { PolkadotAssetHubApi } from './polkadot-asset-hub';
9
- export type { WestendApi } from './westend';
10
- export type { WestendPeopleApi } from './westend-people';
11
- export type { WestendAssetHubApi } from './westend-asset-hub';
12
- export type { PaseoApi } from './paseo';
1
+ export type { SubstrateApi } from './substrate/index.js';
2
+ export type { PolkadotApi } from './polkadot/index.js';
3
+ export type { KusamaApi } from './kusama/index.js';
4
+ export type { MoonbeamApi } from './moonbeam/index.js';
5
+ export type { AstarApi } from './astar/index.js';
6
+ export type { KusamaAssetHubApi } from './kusama-asset-hub/index.js';
7
+ export type { AlephApi } from './aleph/index.js';
8
+ export type { PolkadotAssetHubApi } from './polkadot-asset-hub/index.js';
9
+ export type { WestendApi } from './westend/index.js';
10
+ export type { WestendPeopleApi } from './westend-people/index.js';
11
+ export type { WestendAssetHubApi } from './westend-asset-hub/index.js';
12
+ export type { PaseoApi } from './paseo/index.js';
@@ -5,16 +5,16 @@ import type { JsonRpcApis } from 'dedot/types/json-rpc';
5
5
 
6
6
  export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
7
7
  JsonRpcApis,
8
- | 'archive_unstable_body'
9
- | 'archive_unstable_call'
10
- | 'archive_unstable_finalizedHeight'
11
- | 'archive_unstable_genesisHash'
12
- | 'archive_unstable_hashByHeight'
13
- | 'archive_unstable_header'
14
- | 'archive_unstable_stopStorage'
15
- | 'archive_unstable_storage'
16
- | 'archive_unstable_storageDiff'
17
- | 'archive_unstable_storageDiff_stopStorageDiff'
8
+ | 'archive_v1_body'
9
+ | 'archive_v1_call'
10
+ | 'archive_v1_finalizedHeight'
11
+ | 'archive_v1_genesisHash'
12
+ | 'archive_v1_hashByHeight'
13
+ | 'archive_v1_header'
14
+ | 'archive_v1_stopStorage'
15
+ | 'archive_v1_storage'
16
+ | 'archive_v1_storageDiff'
17
+ | 'archive_v1_storageDiff_stopStorageDiff'
18
18
  | 'author_hasKey'
19
19
  | 'author_hasSessionKeys'
20
20
  | 'author_insertKey'
@@ -57,6 +57,7 @@ export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
57
57
  | 'mmr_root'
58
58
  | 'mmr_verifyProof'
59
59
  | 'mmr_verifyProofStateless'
60
+ | 'offchain_localStorageClear'
60
61
  | 'offchain_localStorageGet'
61
62
  | 'offchain_localStorageSet'
62
63
  | 'payment_queryFeeDetails'
@@ -5,16 +5,16 @@ import type { JsonRpcApis } from 'dedot/types/json-rpc';
5
5
 
6
6
  export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
7
7
  JsonRpcApis,
8
- | 'archive_unstable_body'
9
- | 'archive_unstable_call'
10
- | 'archive_unstable_finalizedHeight'
11
- | 'archive_unstable_genesisHash'
12
- | 'archive_unstable_hashByHeight'
13
- | 'archive_unstable_header'
14
- | 'archive_unstable_stopStorage'
15
- | 'archive_unstable_storage'
16
- | 'archive_unstable_storageDiff'
17
- | 'archive_unstable_storageDiff_stopStorageDiff'
8
+ | 'archive_v1_body'
9
+ | 'archive_v1_call'
10
+ | 'archive_v1_finalizedHeight'
11
+ | 'archive_v1_genesisHash'
12
+ | 'archive_v1_hashByHeight'
13
+ | 'archive_v1_header'
14
+ | 'archive_v1_stopStorage'
15
+ | 'archive_v1_storage'
16
+ | 'archive_v1_storageDiff'
17
+ | 'archive_v1_storageDiff_stopStorageDiff'
18
18
  | 'author_hasKey'
19
19
  | 'author_hasSessionKeys'
20
20
  | 'author_insertKey'
@@ -48,6 +48,7 @@ export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
48
48
  | 'childstate_getStorageHash'
49
49
  | 'childstate_getStorageSize'
50
50
  | 'dev_getBlockStats'
51
+ | 'offchain_localStorageClear'
51
52
  | 'offchain_localStorageGet'
52
53
  | 'offchain_localStorageSet'
53
54
  | 'payment_queryFeeDetails'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/chaintypes",
3
- "version": "0.73.1-next.25bbf96b.0+25bbf96",
3
+ "version": "0.76.0",
4
4
  "description": "Types for substrate-based chains",
5
5
  "author": "Thang X. Vu <thang@coongcrafts.io>",
6
6
  "main": "",
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "build": "tsc --project tsconfig.build.json && yarn copy",
11
11
  "clean": "rm -rf ./dist && rm -rf ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo",
12
- "copy": "cp -R ./src/* ./dist"
12
+ "copy": "cp -R ./src/* ./dist && rm ./dist/index.ts"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "dedot": ">=0.7.1"
@@ -19,7 +19,50 @@
19
19
  "directory": "dist"
20
20
  },
21
21
  "license": "Apache-2.0",
22
- "gitHead": "25bbf96bbb84969caebbca2eacc02681a9093bc9",
22
+ "gitHead": "5dd963c008a87ec0591105bb22e3f026a85770ce",
23
23
  "module": "./index.js",
24
- "types": "./index.d.ts"
24
+ "types": "./index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./index.d.ts",
28
+ "import": "./index.js",
29
+ "default": "./index.js"
30
+ },
31
+ "./aleph": {
32
+ "types": "./aleph/index.d.ts"
33
+ },
34
+ "./astar": {
35
+ "types": "./astar/index.d.ts"
36
+ },
37
+ "./kusama": {
38
+ "types": "./kusama/index.d.ts"
39
+ },
40
+ "./kusama-asset-hub": {
41
+ "types": "./kusama-asset-hub/index.d.ts"
42
+ },
43
+ "./moonbeam": {
44
+ "types": "./moonbeam/index.d.ts"
45
+ },
46
+ "./paseo": {
47
+ "types": "./paseo/index.d.ts"
48
+ },
49
+ "./polkadot": {
50
+ "types": "./polkadot/index.d.ts"
51
+ },
52
+ "./polkadot-asset-hub": {
53
+ "types": "./polkadot-asset-hub/index.d.ts"
54
+ },
55
+ "./substrate": {
56
+ "types": "./substrate/index.d.ts"
57
+ },
58
+ "./westend": {
59
+ "types": "./westend/index.d.ts"
60
+ },
61
+ "./westend-asset-hub": {
62
+ "types": "./westend-asset-hub/index.d.ts"
63
+ },
64
+ "./westend-people": {
65
+ "types": "./westend-people/index.d.ts"
66
+ }
67
+ }
25
68
  }
@@ -5,16 +5,16 @@ import type { JsonRpcApis } from 'dedot/types/json-rpc';
5
5
 
6
6
  export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
7
7
  JsonRpcApis,
8
- | 'archive_unstable_body'
9
- | 'archive_unstable_call'
10
- | 'archive_unstable_finalizedHeight'
11
- | 'archive_unstable_genesisHash'
12
- | 'archive_unstable_hashByHeight'
13
- | 'archive_unstable_header'
14
- | 'archive_unstable_stopStorage'
15
- | 'archive_unstable_storage'
16
- | 'archive_unstable_storageDiff'
17
- | 'archive_unstable_storageDiff_stopStorageDiff'
8
+ | 'archive_v1_body'
9
+ | 'archive_v1_call'
10
+ | 'archive_v1_finalizedHeight'
11
+ | 'archive_v1_genesisHash'
12
+ | 'archive_v1_hashByHeight'
13
+ | 'archive_v1_header'
14
+ | 'archive_v1_stopStorage'
15
+ | 'archive_v1_storage'
16
+ | 'archive_v1_storageDiff'
17
+ | 'archive_v1_storageDiff_stopStorageDiff'
18
18
  | 'author_hasKey'
19
19
  | 'author_hasSessionKeys'
20
20
  | 'author_insertKey'
@@ -57,6 +57,7 @@ export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
57
57
  | 'mmr_root'
58
58
  | 'mmr_verifyProof'
59
59
  | 'mmr_verifyProofStateless'
60
+ | 'offchain_localStorageClear'
60
61
  | 'offchain_localStorageGet'
61
62
  | 'offchain_localStorageSet'
62
63
  | 'payment_queryFeeDetails'
@@ -5,16 +5,16 @@ import type { JsonRpcApis } from 'dedot/types/json-rpc';
5
5
 
6
6
  export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
7
7
  JsonRpcApis,
8
- | 'archive_unstable_body'
9
- | 'archive_unstable_call'
10
- | 'archive_unstable_finalizedHeight'
11
- | 'archive_unstable_genesisHash'
12
- | 'archive_unstable_hashByHeight'
13
- | 'archive_unstable_header'
14
- | 'archive_unstable_stopStorage'
15
- | 'archive_unstable_storage'
16
- | 'archive_unstable_storageDiff'
17
- | 'archive_unstable_storageDiff_stopStorageDiff'
8
+ | 'archive_v1_body'
9
+ | 'archive_v1_call'
10
+ | 'archive_v1_finalizedHeight'
11
+ | 'archive_v1_genesisHash'
12
+ | 'archive_v1_hashByHeight'
13
+ | 'archive_v1_header'
14
+ | 'archive_v1_stopStorage'
15
+ | 'archive_v1_storage'
16
+ | 'archive_v1_storageDiff'
17
+ | 'archive_v1_storageDiff_stopStorageDiff'
18
18
  | 'author_hasKey'
19
19
  | 'author_hasSessionKeys'
20
20
  | 'author_insertKey'
@@ -57,6 +57,7 @@ export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
57
57
  | 'mmr_root'
58
58
  | 'mmr_verifyProof'
59
59
  | 'mmr_verifyProofStateless'
60
+ | 'offchain_localStorageClear'
60
61
  | 'offchain_localStorageGet'
61
62
  | 'offchain_localStorageSet'
62
63
  | 'payment_queryFeeDetails'
@@ -5,16 +5,16 @@ import type { JsonRpcApis } from 'dedot/types/json-rpc';
5
5
 
6
6
  export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
7
7
  JsonRpcApis,
8
- | 'archive_unstable_body'
9
- | 'archive_unstable_call'
10
- | 'archive_unstable_finalizedHeight'
11
- | 'archive_unstable_genesisHash'
12
- | 'archive_unstable_hashByHeight'
13
- | 'archive_unstable_header'
14
- | 'archive_unstable_stopStorage'
15
- | 'archive_unstable_storage'
16
- | 'archive_unstable_storageDiff'
17
- | 'archive_unstable_storageDiff_stopStorageDiff'
8
+ | 'archive_v1_body'
9
+ | 'archive_v1_call'
10
+ | 'archive_v1_finalizedHeight'
11
+ | 'archive_v1_genesisHash'
12
+ | 'archive_v1_hashByHeight'
13
+ | 'archive_v1_header'
14
+ | 'archive_v1_stopStorage'
15
+ | 'archive_v1_storage'
16
+ | 'archive_v1_storageDiff'
17
+ | 'archive_v1_storageDiff_stopStorageDiff'
18
18
  | 'author_hasKey'
19
19
  | 'author_hasSessionKeys'
20
20
  | 'author_insertKey'
@@ -48,6 +48,7 @@ export type ChainJsonRpcApis<Rv extends RpcVersion> = Pick<
48
48
  | 'childstate_getStorageHash'
49
49
  | 'childstate_getStorageSize'
50
50
  | 'dev_getBlockStats'
51
+ | 'offchain_localStorageClear'
51
52
  | 'offchain_localStorageGet'
52
53
  | 'offchain_localStorageSet'
53
54
  | 'payment_queryFeeDetails'
package/index.ts DELETED
@@ -1,12 +0,0 @@
1
- export type { SubstrateApi } from './substrate';
2
- export type { PolkadotApi } from './polkadot';
3
- export type { KusamaApi } from './kusama';
4
- export type { MoonbeamApi } from './moonbeam';
5
- export type { AstarApi } from './astar';
6
- export type { KusamaAssetHubApi } from './kusama-asset-hub';
7
- export type { AlephApi } from './aleph';
8
- export type { PolkadotAssetHubApi } from './polkadot-asset-hub';
9
- export type { WestendApi } from './westend';
10
- export type { WestendPeopleApi } from './westend-people';
11
- export type { WestendAssetHubApi } from './westend-asset-hub';
12
- export type { PaseoApi } from './paseo';