dedot 0.0.1-alpha.30 → 0.0.1-alpha.32

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.
Files changed (116) hide show
  1. package/README.md +32 -36
  2. package/bin/dedot +3 -0
  3. package/chaintypes/index.d.ts +1 -0
  4. package/chaintypes/index.js +1 -0
  5. package/cjs/{extrinsic → chaintypes}/index.js +1 -2
  6. package/cjs/{extrinsic/extensions → codecs}/index.js +1 -3
  7. package/cjs/index.js +16 -7
  8. package/cjs/{executor → runtime-specs}/index.js +1 -8
  9. package/cjs/{client → shape}/index.js +1 -1
  10. package/cjs/types/index.js +17 -0
  11. package/cjs/types/json-rpc/index.js +17 -0
  12. package/cjs/utils/index.js +17 -0
  13. package/codecs/index.d.ts +1 -0
  14. package/codecs/index.js +1 -0
  15. package/index.d.ts +3 -5
  16. package/index.js +3 -4
  17. package/package.json +69 -37
  18. package/runtime-specs/index.d.ts +1 -0
  19. package/runtime-specs/index.js +1 -0
  20. package/shape/index.d.ts +1 -0
  21. package/shape/index.js +1 -0
  22. package/types/index.d.ts +1 -0
  23. package/types/index.js +1 -0
  24. package/types/json-rpc/index.d.ts +1 -0
  25. package/types/json-rpc/index.js +1 -0
  26. package/utils/index.d.ts +1 -0
  27. package/utils/index.js +1 -0
  28. package/cjs/client/Dedot.js +0 -487
  29. package/cjs/executor/ConstantExecutor.js +0 -20
  30. package/cjs/executor/ErrorExecutor.js +0 -46
  31. package/cjs/executor/EventExecutor.js +0 -52
  32. package/cjs/executor/Executor.js +0 -48
  33. package/cjs/executor/RpcExecutor.js +0 -101
  34. package/cjs/executor/RuntimeApiExecutor.js +0 -114
  35. package/cjs/executor/StorageQueryExecutor.js +0 -59
  36. package/cjs/executor/TxExecutor.js +0 -151
  37. package/cjs/extrinsic/SubmittableResult.js +0 -33
  38. package/cjs/extrinsic/extensions/ExtraSignedExtension.js +0 -87
  39. package/cjs/extrinsic/extensions/SignedExtension.js +0 -41
  40. package/cjs/extrinsic/extensions/known/ChargeAssetTxPayment.js +0 -43
  41. package/cjs/extrinsic/extensions/known/ChargeTransactionPayment.js +0 -16
  42. package/cjs/extrinsic/extensions/known/CheckGenesis.js +0 -19
  43. package/cjs/extrinsic/extensions/known/CheckMortality.js +0 -70
  44. package/cjs/extrinsic/extensions/known/CheckNonZeroSender.js +0 -10
  45. package/cjs/extrinsic/extensions/known/CheckNonce.js +0 -33
  46. package/cjs/extrinsic/extensions/known/CheckSpecVersion.js +0 -19
  47. package/cjs/extrinsic/extensions/known/CheckTxVersion.js +0 -19
  48. package/cjs/extrinsic/extensions/known/CheckWeight.js +0 -10
  49. package/cjs/extrinsic/extensions/known/PrevalidateAttests.js +0 -11
  50. package/cjs/extrinsic/extensions/known/index.js +0 -25
  51. package/cjs/proxychain.js +0 -27
  52. package/cjs/storage/QueryableStorage.js +0 -98
  53. package/cjs/test.js +0 -69
  54. package/cjs/types.js +0 -2
  55. package/client/Dedot.d.ts +0 -201
  56. package/client/Dedot.js +0 -483
  57. package/client/index.d.ts +0 -1
  58. package/client/index.js +0 -1
  59. package/executor/ConstantExecutor.d.ts +0 -11
  60. package/executor/ConstantExecutor.js +0 -16
  61. package/executor/ErrorExecutor.d.ts +0 -11
  62. package/executor/ErrorExecutor.js +0 -42
  63. package/executor/EventExecutor.d.ts +0 -11
  64. package/executor/EventExecutor.js +0 -48
  65. package/executor/Executor.d.ts +0 -151
  66. package/executor/Executor.js +0 -44
  67. package/executor/RpcExecutor.d.ts +0 -14
  68. package/executor/RpcExecutor.js +0 -97
  69. package/executor/RuntimeApiExecutor.d.ts +0 -19
  70. package/executor/RuntimeApiExecutor.js +0 -110
  71. package/executor/StorageQueryExecutor.d.ts +0 -10
  72. package/executor/StorageQueryExecutor.js +0 -55
  73. package/executor/TxExecutor.d.ts +0 -47
  74. package/executor/TxExecutor.js +0 -145
  75. package/executor/index.d.ts +0 -8
  76. package/executor/index.js +0 -8
  77. package/extrinsic/SubmittableResult.d.ts +0 -19
  78. package/extrinsic/SubmittableResult.js +0 -29
  79. package/extrinsic/extensions/ExtraSignedExtension.d.ts +0 -14
  80. package/extrinsic/extensions/ExtraSignedExtension.js +0 -60
  81. package/extrinsic/extensions/SignedExtension.d.ts +0 -40
  82. package/extrinsic/extensions/SignedExtension.js +0 -37
  83. package/extrinsic/extensions/index.d.ts +0 -3
  84. package/extrinsic/extensions/index.js +0 -3
  85. package/extrinsic/extensions/known/ChargeAssetTxPayment.d.ts +0 -14
  86. package/extrinsic/extensions/known/ChargeAssetTxPayment.js +0 -39
  87. package/extrinsic/extensions/known/ChargeTransactionPayment.d.ts +0 -6
  88. package/extrinsic/extensions/known/ChargeTransactionPayment.js +0 -12
  89. package/extrinsic/extensions/known/CheckGenesis.d.ts +0 -10
  90. package/extrinsic/extensions/known/CheckGenesis.js +0 -15
  91. package/extrinsic/extensions/known/CheckMortality.d.ts +0 -15
  92. package/extrinsic/extensions/known/CheckMortality.js +0 -66
  93. package/extrinsic/extensions/known/CheckNonZeroSender.d.ts +0 -6
  94. package/extrinsic/extensions/known/CheckNonZeroSender.js +0 -6
  95. package/extrinsic/extensions/known/CheckNonce.d.ts +0 -10
  96. package/extrinsic/extensions/known/CheckNonce.js +0 -29
  97. package/extrinsic/extensions/known/CheckSpecVersion.d.ts +0 -9
  98. package/extrinsic/extensions/known/CheckSpecVersion.js +0 -15
  99. package/extrinsic/extensions/known/CheckTxVersion.d.ts +0 -9
  100. package/extrinsic/extensions/known/CheckTxVersion.js +0 -15
  101. package/extrinsic/extensions/known/CheckWeight.d.ts +0 -6
  102. package/extrinsic/extensions/known/CheckWeight.js +0 -6
  103. package/extrinsic/extensions/known/PrevalidateAttests.d.ts +0 -7
  104. package/extrinsic/extensions/known/PrevalidateAttests.js +0 -7
  105. package/extrinsic/extensions/known/index.d.ts +0 -3
  106. package/extrinsic/extensions/known/index.js +0 -22
  107. package/extrinsic/index.d.ts +0 -2
  108. package/extrinsic/index.js +0 -2
  109. package/proxychain.d.ts +0 -14
  110. package/proxychain.js +0 -23
  111. package/storage/QueryableStorage.d.ts +0 -16
  112. package/storage/QueryableStorage.js +0 -94
  113. package/test.d.ts +0 -1
  114. package/test.js +0 -67
  115. package/types.d.ts +0 -62
  116. package/types.js +0 -1
package/README.md CHANGED
@@ -12,14 +12,16 @@ _Note: The project is still in active development phase, the information on this
12
12
 
13
13
  ---
14
14
  ### Features
15
- - Small bundle size, tree-shakable (no more bn.js (⏳) or wasm-blob (✅) tight dependencies)
15
+ - Small bundle size, tree-shakable (no more bn.js or wasm-blob tight dependencies)
16
16
  - ✅ Built-in metadata caching mechanism
17
17
  - ✅ Types & APIs suggestions for each individual Substrate-based blockchain network ([@dedot/chaintypes](https://github.com/dedotdev/chaintypes))
18
18
  - ✅ Familiar api style with `@polkadot/api`, easy & fast migration!
19
19
  - ✅ Native TypeScript type system for scale-codec
20
20
  - ✅ Compatible with `@polkadot/extension`-based wallets
21
- - ⏳ Use the new JSON-RPC APIs ([v2](https://paritytech.github.io/json-rpc-interface-spec/introduction.html))
22
21
  - ✅ Support Metadata V14, V15 (latest)
22
+ - ✅ Support both the legacy & [new](https://paritytech.github.io/json-rpc-interface-spec/introduction.html) JSON-RPC APIs
23
+ - ✅ Support light clients (e.g: [smoldot](https://www.npmjs.com/package/smoldot))
24
+ - ⏳ Typed Contract APIs
23
25
 
24
26
  ### Have a quick taste
25
27
 
@@ -45,14 +47,15 @@ npm i -D @dedot/chaintypes
45
47
  - Initialize the API client and start interacting with Polkadot network
46
48
  ```typescript
47
49
  // main.ts
48
- import { Dedot } from 'dedot';
50
+ import { Dedot, WsProvider } from 'dedot';
49
51
  import type { PolkadotApi } from '@dedot/chaintypes';
50
52
 
51
53
  const run = async () => {
52
- const api = await Dedot.new<PolkadotApi>('wss://rpc.polkadot.io');
54
+ const provider = new WsProvider('wss://rpc.polkadot.io');
55
+ const api = await Dedot.new<PolkadotApi>(provider);
53
56
 
54
57
  // Call rpc `state_getMetadata` to fetch raw scale-encoded metadata and decode it.
55
- const metadata = await api.rpc.state.getMetadata();
58
+ const metadata = await api.rpc.state_getMetadata();
56
59
  console.log('Metadata:', metadata);
57
60
 
58
61
  // Query on-chain storage
@@ -83,9 +86,10 @@ run().catch(console.error);
83
86
 
84
87
  ```js
85
88
  // main.js
86
- const { Dedot } = require('dedot');
89
+ const { Dedot, WsProvider } = require('dedot');
87
90
  // ...
88
- const api = await Dedot.new('wss://rpc.polkadot.io');
91
+ const provider = new WsProvider('wss://rpc.polkadot.io');
92
+ const api = await Dedot.new(provider);
89
93
  ```
90
94
  ### Table of contents
91
95
  - [Status](#status)
@@ -114,7 +118,7 @@ const api = await Dedot.new('wss://rpc.polkadot.io');
114
118
  | Contract APIs | ⏳ |
115
119
  | Metadata v14 | ✅ |
116
120
  | Metadata v15 | ✅ |
117
- | [RPC v2](https://github.com/dedotdev/dedot/issues/20) | |
121
+ | [RPC v2](https://github.com/dedotdev/dedot/issues/20) | |
118
122
  | [Extrinsic V5](https://github.com/dedotdev/dedot/issues/55) | ⏳ |
119
123
 
120
124
  ### Chain Types & APIs
@@ -132,52 +136,46 @@ npm i -D @dedot/chaintypes
132
136
 
133
137
  Initialize a `Dedot` instance using the `ChainApi` interface for a target chain to enable types & APIs suggestion/autocompletion for that particular chain:
134
138
  ```typescript
135
- import { Dedot } from 'dedot';
139
+ import { Dedot, WsProvider } from 'dedot';
136
140
  import type { PolkadotApi, KusamaApi, MoonbeamApi, AstarApi } from '@dedot/chaintypes';
137
141
 
138
142
  // ...
139
143
 
140
- const polkadotApi = await Dedot.new<PolkadotApi>('wss://rpc.polkadot.io');
144
+ const polkadotApi = await Dedot.new<PolkadotApi>(new WsProvider('wss://rpc.polkadot.io'));
141
145
  console.log(await polkadotApi.query.babe.authorities());
142
146
 
143
- const kusamaApi = await Dedot.new<KusamaApi>('wss://kusama-rpc.polkadot.io');
147
+ const kusamaApi = await Dedot.new<KusamaApi>(new WsProvider('wss://kusama-rpc.polkadot.io'));
144
148
  console.log(await kusamaApi.query.society.memberCount());
145
149
 
146
- const moonbeamApi = await Dedot.new<MoonbeamApi>('wss://wss.api.moonbeam.network');
150
+ const moonbeamApi = await Dedot.new<MoonbeamApi>(new WsProvider('wss://wss.api.moonbeam.network'));
147
151
  console.log(await moonbeamApi.query.ethereumChainId.chainId());
148
152
 
149
- const astarApi = await Dedot.new<AstarApi>('wss://rpc.astar.network');
153
+ const astarApi = await Dedot.new<AstarApi>(new WsProvider('wss://rpc.astar.network'));
150
154
  console.log(await astarApi.query.dappsStaking.blockRewardAccumulator());
151
155
 
152
- const genericApi = await Dedot.new('ws://localhost:9944');
156
+ const genericApi = await Dedot.new(new WsProvider('ws://localhost:9944'));
153
157
 
154
158
  // ...
155
159
  ```
156
160
 
157
- Supported `ChainApi` interfaces are defined [here](https://github.com/dedotdev/dedot/blob/main/packages/chaintypes/src/index.ts), you can also generate the `ChainApi` interface for the chain you want to connect with using `@dedot/cli`.
161
+ Supported `ChainApi` interfaces are defined [here](https://github.com/dedotdev/dedot/blob/main/packages/chaintypes/src/index.ts), you can also generate the `ChainApi` interface for the chain you want to connect with using `dedot` cli.
158
162
 
159
163
  ```shell
160
- # Install @dedot/cli via yarn
161
- yarn add -D @dedot/cli
162
-
163
- # Or via npm
164
- npm i -D @dedot/cli
165
-
166
164
  # Generate ChainApi interface for Polkadot network via rpc endpoint: wss://rpc.polkadot.io
167
165
  npx dedot chaintypes -w wss://rpc.polkadot.io
168
166
  ```
169
167
 
170
168
  ### Execute RPC Methods
171
169
 
172
- RPCs can be executed via `api.rpc` entry point. After creating a `Dedot` instance with a `ChainApi` interface of the network you want to interact with, all RPC methods of the network will be exposed in the autocompletion/suggestion with format: `api.rpc.<module>.<methodName>`. E.g: you can find all supported RPC methods for Polkadot network [here](https://github.com/dedotdev/dedot/blob/main/packages/chaintypes/src/polkadot/rpc.d.ts), similarly for other networks as well.
170
+ RPCs can be executed via `api.rpc` entry point. After creating a `Dedot` instance with a `ChainApi` interface of the network you want to interact with, all RPC methods of the network will be exposed in the autocompletion/suggestion with format: `api.rpc.method_name(param1, param2, ...)`. E.g: you can find all supported RPC methods for Polkadot network [here](https://github.com/dedotdev/dedot/blob/main/packages/chaintypes/src/polkadot/rpc.d.ts), similarly for other networks as well.
173
171
 
174
172
  Examples:
175
173
  ```typescript
176
174
  // Call rpc: `state_getMetadata`
177
- const metadata = await api.rpc.state.getMetadata();
175
+ const metadata = await api.rpc.state_getMetadata();
178
176
 
179
177
  // Call an arbitrary rpc: `module_rpc_name` with arguments ['param1', 'param2']
180
- const result = await api.rpc.module.rpc_name('param1', 'param2');
178
+ const result = await api.rpc.module_rpc_name('param1', 'param2');
181
179
  ```
182
180
 
183
181
  ### Query On-chain Storage
@@ -222,22 +220,22 @@ const queryInfo = await api.call.transactionPaymentApi.queryInfo(tx.toU8a(), tx.
222
220
  const runtimeVersion = await api.call.core.version();
223
221
  ```
224
222
 
225
- For chains that only support Metadata V14, we need to bring in the Runtime Api definitions when initializing the Dedot client instance to encode & decode the calls. You can find all supported Runtime Api definitions in [`@dedot/specs`](https://github.com/dedotdev/dedot/blob/60de0fed8ba19c67a7e174c6168a127fdbf6caef/packages/specs/src/runtime/all.ts#L21-L39) package.
223
+ For chains that only support Metadata V14, we need to bring in the Runtime Api definitions when initializing the Dedot client instance to encode & decode the calls. You can find all supported Runtime Api definitions in [`dedot/runtime-specs`](https://github.com/dedotdev/dedot/blob/60de0fed8ba19c67a7e174c6168a127fdbf6caef/packages/runtime-specs/src/runtime/all.ts#L21-L39) package.
226
224
 
227
225
  Examples:
228
226
  ```typescript
229
- import { RuntimeApis } from '@dedot/specs';
230
- const api = await Dedot.new({ endpoint: 'wss://rpc.mynetwork.com', runtimeApis: RuntimeApis });
227
+ import { RuntimeApis } from 'dedot/runtime-specs';
228
+ const api = await Dedot.new({ provider: new WsProvider('wss://rpc.mynetwork.com'), runtimeApis: RuntimeApis });
231
229
 
232
230
  // Or bring in only the Runtime Api definition that you want to interact with
233
- import { AccountNonceApi } from '@dedot/specs';
234
- const api = await Dedot.new({ endpoint: 'wss://rpc.mynetwork.com', runtimeApis: { AccountNonceApi } });
231
+ import { AccountNonceApi } from 'dedot/runtime-specs';
232
+ const api = await Dedot.new({ provider: new WsProvider('wss://rpc.mynetwork.com'), runtimeApis: { AccountNonceApi } });
235
233
 
236
234
  // Get account nonce
237
235
  const nonce = await api.call.accountNonceApi.accountNonce(<address>);
238
236
  ```
239
237
 
240
- You absolutely can define your own Runtime Api definition if you don't find it in the [supported list](https://github.com/dedotdev/dedot/blob/60de0fed8ba19c67a7e174c6168a127fdbf6caef/packages/specs/src/runtime/all.ts#L21-L39).
238
+ You absolutely can define your own Runtime Api definition if you don't find it in the [supported list](https://github.com/dedotdev/dedot/blob/60de0fed8ba19c67a7e174c6168a127fdbf6caef/packages/runtime-specs/src/runtime/all.ts#L21-L39).
241
239
 
242
240
  ### Transaction APIs
243
241
 
@@ -316,7 +314,7 @@ const unsub = api.tx.utility.batch([transferTx.call, remarkCall])
316
314
 
317
315
  ```typescript
318
316
  import { WestendAssetHubApi, XcmVersionedLocation, XcmVersionedAssets, XcmV3WeightLimit } from '@dedot/chaintypes/westendAssetHub';
319
- import { AccountId32 } from '@dedot/codecs';
317
+ import { AccountId32 } from 'dedot/codecs';
320
318
 
321
319
  const TWO_TOKENS = 2_000_000_000_000n;
322
320
  const destAddress = <bobAddress>;
@@ -434,18 +432,16 @@ const api = await ApiPromise.create({ provider: new WsProvider('wss://rpc.polkad
434
432
  ```
435
433
  - `dedot`
436
434
  ```typescript
437
- import { Dedot } from 'dedot';
435
+ import { Dedot, WsProvider } from 'dedot';
438
436
  import type { PolkadotApi } from '@dedot/chaintypes';
439
437
 
440
- const api = await Dedot.new<PolkadotApi>('wss://rpc.polkadot.io'); // or Dedot.create(...) if you prefer
438
+ const api = await Dedot.new<PolkadotApi>(new WsProvider('wss://rpc.polkadot.io')); // or Dedot.create(...) if you prefer
441
439
 
442
- // OR you want to have a custom provider
443
- import { WsProvider } from 'dedot'
440
+ // OR
444
441
  const api = await Dedot.new<PolkadotApi>({ provider: new WsProvider('wss://rpc.polkadot.io') });
445
442
  ```
446
443
 
447
444
  - Notes:
448
- - Under the hood, a `WsProvider` will be created if you initialize `Dedot` directly with an rpc endpoint.
449
445
  - `dedot` only supports provider can make subscription request (e.g: via Websocket).
450
446
  - We recommend specifying the `ChainApi` interface (e.g: [`PolkadotApi`](https://github.com/dedotdev/dedot/blob/02d7bca4c3c3d12c9591ea43b3410daf8e5aacbb/packages/chaintypes/src/polkadot/index.d.ts) in the example above) of the chain that you want to interact with. This enable apis & types suggestion/autocompletion for that particular chain (via IntelliSense). If you don't specify a `ChainApi` interface, the default [`SubstrateApi`](https://github.com/dedotdev/dedot/blob/a762faf8f6af40d3e4ef163bd538b270a5ca31e8/packages/chaintypes/src/substrate/index.d.ts) interface will be used.
451
447
 
package/bin/dedot ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ require('@dedot/cli').dedot();
@@ -0,0 +1 @@
1
+ export * from '@dedot/api/chaintypes';
@@ -0,0 +1 @@
1
+ export * from '@dedot/api/chaintypes';
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./extensions/index.js"), exports);
18
- __exportStar(require("./SubmittableResult.js"), exports);
17
+ __exportStar(require("@dedot/api/chaintypes"), exports);
@@ -14,6 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./SignedExtension.js"), exports);
18
- __exportStar(require("./known/index.js"), exports);
19
- __exportStar(require("./ExtraSignedExtension.js"), exports);
17
+ __exportStar(require("@dedot/codecs"), exports);
package/cjs/index.js CHANGED
@@ -10,14 +10,23 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
13
25
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
27
  };
16
28
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.WsProvider = exports.Dedot = void 0;
18
- __exportStar(require("./executor/index.js"), exports);
19
- __exportStar(require("./extrinsic/index.js"), exports);
20
- var index_js_1 = require("./client/index.js");
21
- Object.defineProperty(exports, "Dedot", { enumerable: true, get: function () { return index_js_1.Dedot; } });
22
- var providers_1 = require("@dedot/providers");
23
- Object.defineProperty(exports, "WsProvider", { enumerable: true, get: function () { return providers_1.WsProvider; } });
29
+ exports.$ = void 0;
30
+ exports.$ = __importStar(require("@dedot/shape"));
31
+ __exportStar(require("@dedot/api"), exports);
32
+ __exportStar(require("@dedot/providers"), exports);
@@ -14,11 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Executor.js"), exports);
18
- __exportStar(require("./RpcExecutor.js"), exports);
19
- __exportStar(require("./ConstantExecutor.js"), exports);
20
- __exportStar(require("./StorageQueryExecutor.js"), exports);
21
- __exportStar(require("./ErrorExecutor.js"), exports);
22
- __exportStar(require("./EventExecutor.js"), exports);
23
- __exportStar(require("./RuntimeApiExecutor.js"), exports);
24
- __exportStar(require("./TxExecutor.js"), exports);
17
+ __exportStar(require("@dedot/runtime-specs"), exports);
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Dedot.js"), exports);
17
+ __exportStar(require("@dedot/shape"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("@dedot/types"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("@dedot/types/json-rpc"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("@dedot/utils"), exports);
@@ -0,0 +1 @@
1
+ export * from '@dedot/codecs';
@@ -0,0 +1 @@
1
+ export * from '@dedot/codecs';
package/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export type * from './types.js';
2
- export * from './executor/index.js';
3
- export * from './extrinsic/index.js';
4
- export { Dedot } from './client/index.js';
5
- export { WsProvider } from '@dedot/providers';
1
+ export * as $ from '@dedot/shape';
2
+ export * from '@dedot/api';
3
+ export * from '@dedot/providers';
package/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from './executor/index.js';
2
- export * from './extrinsic/index.js';
3
- export { Dedot } from './client/index.js';
4
- export { WsProvider } from '@dedot/providers';
1
+ export * as $ from '@dedot/shape';
2
+ export * from '@dedot/api';
3
+ export * from '@dedot/providers';
package/package.json CHANGED
@@ -1,53 +1,85 @@
1
1
  {
2
2
  "name": "dedot",
3
- "version": "0.0.1-alpha.30",
3
+ "version": "0.0.1-alpha.32",
4
4
  "description": "A delightful JavaScript/TypeScript client for Polkadot & Substrate",
5
5
  "author": "Thang X. Vu <thang@coongcrafts.io>",
6
- "homepage": "https://github.com/dedotdev/dedot",
7
- "repository": {
8
- "directory": "packages/api",
9
- "type": "git",
10
- "url": "https://github.com/dedotdev/dedot.git"
11
- },
12
6
  "main": "./cjs/index.js",
13
- "type": "module",
7
+ "bin": {
8
+ "dedot": "./bin/dedot",
9
+ "djs": "./bin/dedot"
10
+ },
14
11
  "sideEffects": false,
12
+ "type": "module",
13
+ "scripts": {
14
+ "build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json && cp -R ./bin ./dist",
15
+ "clean": "rm -rf ./dist && rm -rf ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo"
16
+ },
15
17
  "dependencies": {
16
- "@dedot/chaintypes": "0.0.1-alpha.35",
17
- "@dedot/codecs": "0.0.1-alpha.30",
18
- "@dedot/providers": "^0.0.1-alpha.30",
19
- "@dedot/shape": "0.0.1-alpha.30",
20
- "@dedot/specs": "0.0.1-alpha.30",
21
- "@dedot/storage": "0.0.1-alpha.30",
22
- "@dedot/utils": "0.0.1-alpha.30"
18
+ "@dedot/api": "0.0.1-alpha.32",
19
+ "@dedot/cli": "0.0.1-alpha.32",
20
+ "@dedot/codecs": "0.0.1-alpha.32",
21
+ "@dedot/providers": "0.0.1-alpha.32",
22
+ "@dedot/runtime-specs": "0.0.1-alpha.32",
23
+ "@dedot/shape": "0.0.1-alpha.32",
24
+ "@dedot/types": "0.0.1-alpha.32",
25
+ "@dedot/utils": "0.0.1-alpha.32"
23
26
  },
24
- "scripts": {
25
- "build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json",
26
- "clean": "rm -rf ./dist && rm -rf ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo",
27
- "test": "vitest --watch=false"
27
+ "exports": {
28
+ ".": {
29
+ "types": "./index.d.ts",
30
+ "import": "./index.js",
31
+ "require": "./cjs/index.js",
32
+ "default": "./index.js"
33
+ },
34
+ "./chaintypes": {
35
+ "types": "./chaintypes/index.d.ts",
36
+ "import": "./chaintypes/index.js",
37
+ "require": "./cjs/chaintypes/index.js",
38
+ "default": "./chaintypes/index.js"
39
+ },
40
+ "./codecs": {
41
+ "types": "./codecs/index.d.ts",
42
+ "import": "./codecs/index.js",
43
+ "require": "./cjs/codecs/index.js",
44
+ "default": "./codecs/index.js"
45
+ },
46
+ "./types": {
47
+ "types": "./types/index.d.ts",
48
+ "import": "./types/index.js",
49
+ "require": "./cjs/types/index.js",
50
+ "default": "./types/index.js"
51
+ },
52
+ "./types/json-rpc": {
53
+ "types": "./types/json-rpc/index.d.ts",
54
+ "import": "./types/json-rpc/index.js",
55
+ "require": "./cjs/types/json-rpc/index.js",
56
+ "default": "./types/json-rpc/index.js"
57
+ },
58
+ "./runtime-specs": {
59
+ "types": "./runtime-specs/index.d.ts",
60
+ "import": "./runtime-specs/index.js",
61
+ "require": "./cjs/runtime-specs/index.js",
62
+ "default": "./runtime-specs/index.js"
63
+ },
64
+ "./utils": {
65
+ "types": "./utils/index.d.ts",
66
+ "import": "./utils/index.js",
67
+ "require": "./cjs/utils/index.js",
68
+ "default": "./utils/index.js"
69
+ },
70
+ "./shape": {
71
+ "types": "./shape/index.d.ts",
72
+ "import": "./shape/index.js",
73
+ "require": "./cjs/shape/index.js",
74
+ "default": "./shape/index.js"
75
+ }
28
76
  },
29
77
  "publishConfig": {
30
78
  "access": "public",
31
79
  "directory": "dist"
32
80
  },
33
81
  "license": "Apache-2.0",
34
- "devDependencies": {
35
- "@polkadot/keyring": "^12.6.2",
36
- "@polkadot/types": "^10.11.2"
37
- },
38
- "gitHead": "ebc78daa1c0786f16dbf3a1f2c7a385142860ebc",
82
+ "gitHead": "43501104eee360a19ae18a70fe506e16d9357835",
39
83
  "module": "./index.js",
40
- "types": "./index.d.ts",
41
- "exports": {
42
- ".": {
43
- "import": {
44
- "types": "./index.d.ts",
45
- "default": "./index.js"
46
- },
47
- "require": {
48
- "types": "./index.d.ts",
49
- "default": "./cjs/index.js"
50
- }
51
- }
52
- }
84
+ "types": "./index.d.ts"
53
85
  }
@@ -0,0 +1 @@
1
+ export * from '@dedot/runtime-specs';
@@ -0,0 +1 @@
1
+ export * from '@dedot/runtime-specs';
@@ -0,0 +1 @@
1
+ export * from '@dedot/shape';
package/shape/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@dedot/shape';
@@ -0,0 +1 @@
1
+ export * from '@dedot/types';
package/types/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@dedot/types';
@@ -0,0 +1 @@
1
+ export * from '@dedot/types/json-rpc';
@@ -0,0 +1 @@
1
+ export * from '@dedot/types/json-rpc';
@@ -0,0 +1 @@
1
+ export * from '@dedot/utils';
package/utils/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@dedot/utils';