Update docs for system.account (#1944)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user