@dedot/api 0.8.1 → 0.8.2-next.6cfafabd.24
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/cjs/client/BaseSubstrateClient.js +30 -1
- package/cjs/executor/StorageQueryExecutor.js +8 -15
- package/cjs/executor/v2/StorageQueryExecutorV2.js +7 -33
- package/cjs/extrinsic/extensions/ExtraSignedExtension.js +24 -5
- package/cjs/extrinsic/extensions/FallbackSignedExtension.js +63 -0
- package/cjs/extrinsic/extensions/index.js +1 -0
- package/cjs/extrinsic/extensions/known/index.js +11 -8
- package/cjs/storage/BaseStorageQuery.js +27 -0
- package/cjs/storage/LegacyStorageQuery.js +67 -0
- package/cjs/storage/NewStorageQuery.js +85 -0
- package/cjs/storage/index.js +3 -0
- package/client/BaseSubstrateClient.d.ts +32 -1
- package/client/BaseSubstrateClient.js +30 -1
- package/client/DedotClient.js +1 -1
- package/executor/StorageQueryExecutor.d.ts +3 -2
- package/executor/StorageQueryExecutor.js +7 -14
- package/executor/v2/StorageQueryExecutorV2.d.ts +4 -6
- package/executor/v2/StorageQueryExecutorV2.js +7 -33
- package/extrinsic/extensions/ExtraSignedExtension.d.ts +6 -0
- package/extrinsic/extensions/ExtraSignedExtension.js +25 -6
- package/extrinsic/extensions/FallbackSignedExtension.d.ts +33 -0
- package/extrinsic/extensions/FallbackSignedExtension.js +58 -0
- package/extrinsic/extensions/index.d.ts +1 -0
- package/extrinsic/extensions/index.js +1 -0
- package/extrinsic/extensions/known/index.d.ts +11 -0
- package/extrinsic/extensions/known/index.js +11 -8
- package/package.json +10 -10
- package/storage/BaseStorageQuery.d.ts +41 -0
- package/storage/BaseStorageQuery.js +23 -0
- package/storage/LegacyStorageQuery.d.ts +35 -0
- package/storage/LegacyStorageQuery.js +63 -0
- package/storage/NewStorageQuery.d.ts +35 -0
- package/storage/NewStorageQuery.js +81 -0
- package/storage/index.d.ts +3 -0
- package/storage/index.js +3 -0
- package/types.d.ts +17 -1
- package/cjs/extrinsic/extensions/known/CheckNonZeroSender.js +0 -10
- package/cjs/extrinsic/extensions/known/CheckWeight.js +0 -10
- package/cjs/extrinsic/extensions/known/PrevalidateAttests.js +0 -11
- package/cjs/extrinsic/extensions/known/StorageWeightReclaim.js +0 -10
- package/extrinsic/extensions/known/CheckNonZeroSender.d.ts +0 -6
- package/extrinsic/extensions/known/CheckNonZeroSender.js +0 -6
- package/extrinsic/extensions/known/CheckWeight.d.ts +0 -6
- package/extrinsic/extensions/known/CheckWeight.js +0 -6
- package/extrinsic/extensions/known/PrevalidateAttests.d.ts +0 -7
- package/extrinsic/extensions/known/PrevalidateAttests.js +0 -7
- package/extrinsic/extensions/known/StorageWeightReclaim.d.ts +0 -6
- package/extrinsic/extensions/known/StorageWeightReclaim.js +0 -6
package/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BlockHash, Hash, Metadata, PortableRegistry } from '@dedot/codecs';
|
|
|
2
2
|
import type { ConnectionStatus, JsonRpcProvider, ProviderEvent } from '@dedot/providers';
|
|
3
3
|
import type { AnyShape } from '@dedot/shape';
|
|
4
4
|
import type { IStorage } from '@dedot/storage';
|
|
5
|
-
import type { GenericSubstrateApi, InjectedSigner, RpcVersion, RuntimeApiName, RuntimeApiSpec, Unsub } from '@dedot/types';
|
|
5
|
+
import type { Callback, GenericStorageQuery, GenericSubstrateApi, InjectedSigner, Query, QueryFnResult, RpcVersion, RuntimeApiName, RuntimeApiSpec, Unsub } from '@dedot/types';
|
|
6
6
|
import type { HashFn, HexString, IEventEmitter } from '@dedot/utils';
|
|
7
7
|
import type { AnySignedExtension } from './extrinsic/index.js';
|
|
8
8
|
export type MetadataKey = `RAW_META/${string}`;
|
|
@@ -119,6 +119,22 @@ export interface ISubstrateClient<ChainApi extends GenericSubstrateApi = Generic
|
|
|
119
119
|
* @param signer
|
|
120
120
|
*/
|
|
121
121
|
setSigner(signer?: InjectedSigner): void;
|
|
122
|
+
/**
|
|
123
|
+
* Perform multiple storage queries in parallel
|
|
124
|
+
* @param queries - An array of query objects
|
|
125
|
+
* @param callback - Optional callback function to handle results
|
|
126
|
+
* @returns A promise resolving to an array of results or an Unsub function
|
|
127
|
+
*/
|
|
128
|
+
queryMulti<Fns extends GenericStorageQuery[]>(queries: {
|
|
129
|
+
[K in keyof Fns]: Query<Fns[K]>;
|
|
130
|
+
}): Promise<{
|
|
131
|
+
[K in keyof Fns]: QueryFnResult<Fns[K]>;
|
|
132
|
+
}>;
|
|
133
|
+
queryMulti<Fns extends GenericStorageQuery[]>(queries: {
|
|
134
|
+
[K in keyof Fns]: Query<Fns[K]>;
|
|
135
|
+
}, callback: Callback<{
|
|
136
|
+
[K in keyof Fns]: QueryFnResult<Fns[K]>;
|
|
137
|
+
}>): Promise<Unsub>;
|
|
122
138
|
}
|
|
123
139
|
/**
|
|
124
140
|
* A generic interface for broadcasting transactions
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckNonZeroSender = void 0;
|
|
4
|
-
const SignedExtension_js_1 = require("../SignedExtension.js");
|
|
5
|
-
/**
|
|
6
|
-
* @description Check to ensure that the sender is not the zero address
|
|
7
|
-
*/
|
|
8
|
-
class CheckNonZeroSender extends SignedExtension_js_1.SignedExtension {
|
|
9
|
-
}
|
|
10
|
-
exports.CheckNonZeroSender = CheckNonZeroSender;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckWeight = void 0;
|
|
4
|
-
const SignedExtension_js_1 = require("../SignedExtension.js");
|
|
5
|
-
/**
|
|
6
|
-
* @description Block resource (weight) limit check.
|
|
7
|
-
*/
|
|
8
|
-
class CheckWeight extends SignedExtension_js_1.SignedExtension {
|
|
9
|
-
}
|
|
10
|
-
exports.CheckWeight = CheckWeight;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PrevalidateAttests = void 0;
|
|
4
|
-
const SignedExtension_js_1 = require("../SignedExtension.js");
|
|
5
|
-
/**
|
|
6
|
-
* @description Validate `attest` calls prior to execution.
|
|
7
|
-
* Needed to avoid a DoS attack since they are otherwise free to place on chain.
|
|
8
|
-
*/
|
|
9
|
-
class PrevalidateAttests extends SignedExtension_js_1.SignedExtension {
|
|
10
|
-
}
|
|
11
|
-
exports.PrevalidateAttests = PrevalidateAttests;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StorageWeightReclaim = void 0;
|
|
4
|
-
const SignedExtension_js_1 = require("../SignedExtension.js");
|
|
5
|
-
/**
|
|
6
|
-
* @description Storage weight reclaim mechanism.
|
|
7
|
-
*/
|
|
8
|
-
class StorageWeightReclaim extends SignedExtension_js_1.SignedExtension {
|
|
9
|
-
}
|
|
10
|
-
exports.StorageWeightReclaim = StorageWeightReclaim;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SignedExtension } from '../SignedExtension.js';
|
|
2
|
-
/**
|
|
3
|
-
* @description Validate `attest` calls prior to execution.
|
|
4
|
-
* Needed to avoid a DoS attack since they are otherwise free to place on chain.
|
|
5
|
-
*/
|
|
6
|
-
export declare class PrevalidateAttests extends SignedExtension {
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SignedExtension } from '../SignedExtension.js';
|
|
2
|
-
/**
|
|
3
|
-
* @description Validate `attest` calls prior to execution.
|
|
4
|
-
* Needed to avoid a DoS attack since they are otherwise free to place on chain.
|
|
5
|
-
*/
|
|
6
|
-
export class PrevalidateAttests extends SignedExtension {
|
|
7
|
-
}
|