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
+1 -1
View File
@@ -33,7 +33,7 @@ However, to make this sane from a developer perspective the injected methods are
import { AccountData, Index } from '@polkadot/types/interfaces';
...
const [nonce, balance] = await api.query.system.account<[Index, AccountData]>(ADDR);
const { nonce, data: balances } = await api.query.system.account<[Index, AccountData]>(ADDR);
```
In both these case we can instruct the TypeScript compiler that the type we are expecting in `Index` and `Balance` respectively, not just pure `Codec`. This means that functions like `.toNumber()` is available on both these types - as opposed to just the [general type defaults](types.basics.md#everything-is-a-type) with `.toHex()` and friends.