Update signature for Promise queryMulti (#1975)

This commit is contained in:
Jaco Greeff
2020-02-28 17:05:38 +01:00
committed by GitHub
parent 6c174e6634
commit 5b9b5586d3
3 changed files with 13 additions and 4 deletions
+3 -4
View File
@@ -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/*"
],
+9
View File
@@ -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
+1
View File
@@ -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> =