@dedot/api 0.15.2 → 0.15.3-next.65898ecf.10

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 (47) hide show
  1. package/chaintypes/substrate/index.d.ts +21 -1
  2. package/chaintypes/substrate/index.js +0 -1
  3. package/cjs/chaintypes/substrate/index.js +0 -1
  4. package/cjs/client/DedotClient.js +39 -6
  5. package/cjs/executor/Executor.js +1 -0
  6. package/cjs/executor/v2/StorageQueryExecutorV2.js +1 -3
  7. package/cjs/executor/v2/TxExecutorV2.js +5 -3
  8. package/cjs/json-rpc/group/Archive.js +226 -0
  9. package/cjs/json-rpc/group/ChainHead/ChainHead.js +121 -44
  10. package/cjs/json-rpc/group/ChainHead/error.js +5 -0
  11. package/cjs/json-rpc/group/index.js +1 -0
  12. package/cjs/json-rpc/subscriptionsInfo.js +4 -0
  13. package/cjs/storage/LegacyStorageQuery.js +5 -0
  14. package/cjs/storage/NewStorageQuery.js +5 -0
  15. package/client/BaseSubstrateClient.d.ts +3 -3
  16. package/client/DedotClient.d.ts +6 -4
  17. package/client/DedotClient.js +42 -9
  18. package/client/LegacyClient.d.ts +2 -2
  19. package/executor/Executor.d.ts +5 -5
  20. package/executor/Executor.js +1 -0
  21. package/executor/StorageQueryExecutor.d.ts +2 -2
  22. package/executor/v2/RuntimeApiExecutorV2.d.ts +2 -2
  23. package/executor/v2/StorageQueryExecutorV2.d.ts +4 -4
  24. package/executor/v2/StorageQueryExecutorV2.js +1 -3
  25. package/executor/v2/TxExecutorV2.d.ts +2 -1
  26. package/executor/v2/TxExecutorV2.js +5 -3
  27. package/executor/v2/ViewFunctionExecutorV2.d.ts +2 -2
  28. package/extrinsic/extensions/SignedExtension.d.ts +3 -3
  29. package/extrinsic/submittable/BaseSubmittableExtrinsic.d.ts +2 -2
  30. package/extrinsic/submittable/SubmittableExtrinsicV2.d.ts +2 -2
  31. package/json-rpc/group/Archive.d.ts +134 -0
  32. package/json-rpc/group/Archive.js +222 -0
  33. package/json-rpc/group/ChainHead/ChainHead.d.ts +10 -0
  34. package/json-rpc/group/ChainHead/ChainHead.js +121 -44
  35. package/json-rpc/group/ChainHead/error.d.ts +3 -0
  36. package/json-rpc/group/ChainHead/error.js +5 -0
  37. package/json-rpc/group/index.d.ts +1 -0
  38. package/json-rpc/group/index.js +1 -0
  39. package/json-rpc/subscriptionsInfo.js +4 -0
  40. package/package.json +9 -9
  41. package/storage/BaseStorageQuery.d.ts +5 -6
  42. package/storage/LegacyStorageQuery.d.ts +4 -3
  43. package/storage/LegacyStorageQuery.js +5 -0
  44. package/storage/NewStorageQuery.d.ts +5 -4
  45. package/storage/NewStorageQuery.js +5 -0
  46. package/storage/QueryableStorage.d.ts +2 -2
  47. package/types.d.ts +10 -5
@@ -13,6 +13,11 @@ import { BaseStorageQuery } from './BaseStorageQuery.js';
13
13
  * - Efficient change detection for subscriptions
14
14
  */
15
15
  export class NewStorageQuery extends BaseStorageQuery {
16
+ client;
17
+ constructor(client) {
18
+ super(client);
19
+ this.client = client;
20
+ }
16
21
  /**
17
22
  * Query multiple storage items in a single call using chainHead_storage
18
23
  *
@@ -5,12 +5,12 @@ import { PortableRegistry, PalletDefLatest, StorageDataLike, StorageEntryLatest,
5
5
  */
6
6
  export declare class QueryableStorage {
7
7
  #private;
8
- readonly registry: PortableRegistry;
8
+ readonly registry: PortableRegistry<any>;
9
9
  readonly palletName: string;
10
10
  readonly storageItem: string;
11
11
  readonly pallet: PalletDefLatest;
12
12
  readonly storageEntry: StorageEntryLatest;
13
- constructor(registry: PortableRegistry, palletName: string, storageItem: string);
13
+ constructor(registry: PortableRegistry<any>, palletName: string, storageItem: string);
14
14
  get prefixKey(): PrefixedStorageKey;
15
15
  get prefixKeyAsU8a(): Uint8Array;
16
16
  /**
package/types.d.ts CHANGED
@@ -83,16 +83,15 @@ export interface IJsonRpcClient<ChainApi extends GenericSubstrateApi = GenericSu
83
83
  rpc: ChainApi['rpc'];
84
84
  }
85
85
  /**
86
- * A generic interface for Substrate clients at a specific block
86
+ * @internal
87
87
  */
88
- export interface ISubstrateClientAt<ChainApi extends GenericSubstrateApi = GenericSubstrateApi> {
89
- atBlockHash?: BlockHash;
88
+ export interface IGenericSubstrateClient<ChainApi extends GenericSubstrateApi = GenericSubstrateApi> {
90
89
  rpcVersion: RpcVersion;
91
90
  options: ApiOptions;
92
91
  genesisHash: Hash;
93
92
  runtimeVersion: SubstrateRuntimeVersion;
94
93
  metadata: Metadata;
95
- registry: PortableRegistry;
94
+ registry: PortableRegistry<ChainApi>;
96
95
  rpc: ChainApi['rpc'];
97
96
  consts: ChainApi['consts'];
98
97
  query: ChainApi['query'];
@@ -101,10 +100,16 @@ export interface ISubstrateClientAt<ChainApi extends GenericSubstrateApi = Gener
101
100
  errors: ChainApi['errors'];
102
101
  view: ChainApi['view'];
103
102
  }
103
+ /**
104
+ * A generic interface for Substrate clients at a specific block
105
+ */
106
+ export interface ISubstrateClientAt<ChainApi extends GenericSubstrateApi = GenericSubstrateApi> extends IGenericSubstrateClient<ChainApi> {
107
+ atBlockHash: BlockHash;
108
+ }
104
109
  /**
105
110
  * A generic interface for Substrate clients
106
111
  */
107
- export interface ISubstrateClient<ChainApi extends GenericSubstrateApi = GenericSubstrateApi, Events extends string = ApiEvent> extends IJsonRpcClient<ChainApi, Events>, ISubstrateClientAt<ChainApi> {
112
+ export interface ISubstrateClient<ChainApi extends GenericSubstrateApi = GenericSubstrateApi, Events extends string = ApiEvent> extends IJsonRpcClient<ChainApi, Events>, IGenericSubstrateClient<ChainApi> {
108
113
  options: ApiOptions;
109
114
  tx: ChainApi['tx'];
110
115
  at<ChainApiAt extends GenericSubstrateApi = ChainApi>(hash: BlockHash): Promise<ISubstrateClientAt<ChainApiAt>>;