Update docs for system.account (#1944)

This commit is contained in:
Jaco Greeff
2020-02-25 17:01:41 +01:00
committed by GitHub
parent 67841a9212
commit c17f93a3ec
14 changed files with 24 additions and 24 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ Where possible, the use of multi queries are encouraged since it tracks a number
// Subscribe to balance changes for 2 accounts, ADDR1 & ADDR2 (already defined)
const unsub = await api.query.system.account.multi([ADDR1, ADDR2], (balances) => {
const [[, balance1], [, balance2]] = balances;
const [{ data: balance1 }, { data: balance2 }] = balances;
console.log(`The balances are ${balance1.free} and ${balance2.free}`);
});
@@ -44,7 +44,7 @@ The previous `.multi` examples assumes that we do queries for the same types, i.
const unsub = await api.queryMulti([
api.query.timestamp.now,
[api.query.system.account, ADDR]
], ([now, [nonce, balance]]) => {
], ([now, { nonce, data: balance }]) => {
console.log(`${now}: balance of ${balance.free} and a nonce of ${nonce}`);
});
```