Update signature for Promise queryMulti (#1975)
This commit is contained in:
+3
-4
@@ -1,9 +1,8 @@
|
||||
{
|
||||
"version": "1.5.0-beta.12",
|
||||
"repository": "https://github.com/polkadot-js/api",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"license": "Apache-2",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"yarn": "^1.10.1"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
|
||||
@@ -60,6 +60,15 @@ async function query (api: ApiPromise, keyring: TestKeyringMap): Promise<void> {
|
||||
multiUnsub();
|
||||
});
|
||||
|
||||
// check multi , Promise result
|
||||
const multiRes = await api.queryMulti([
|
||||
[api.query.system.account, keyring.eve.address],
|
||||
// older chains only
|
||||
[api.query.system.accountNonce, keyring.bob.address]
|
||||
]);
|
||||
|
||||
console.log(multiRes);
|
||||
|
||||
// check entries()
|
||||
await api.query.system.account.entries(); // should not take a param
|
||||
await api.query.staking.nominatorSlashInEra.entries(123); // should take a param
|
||||
|
||||
@@ -71,6 +71,7 @@ export interface QueryableStorageMultiBase<ApiType extends ApiTypes> {
|
||||
|
||||
export interface QueryableStorageMultiPromise<ApiType extends ApiTypes> {
|
||||
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[], callback: Callback<T>): UnsubscribePromise;
|
||||
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Promise<T>;
|
||||
}
|
||||
|
||||
export type QueryableStorageMulti<ApiType extends ApiTypes> =
|
||||
|
||||
Reference in New Issue
Block a user