diff --git a/CHANGELOG.md b/CHANGELOG.md index 52ff0087a7..8d1b9b6a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.93.0-beta.x +- In extrinsic submission, use `rpc.account.nextIndex` to retrieve the nonce when available - For TypeScript users `api.query.*.*` is now properly typed for default Substrate calls, i.e. `api.query.balances.freeBalance(...)` will return a `Balance` type. Additionally the `api.queryMulti` and `.multi` on queries not allow generic type params. - Add `api.rpc.accounts.nextIndex`, `api.rpc.contracts.call` and `api.rpc.rpc.methods` calls. Optional calls (such as account/contracts) is decorated based on the results from `rpc.methods`, so they don't show up on nodes where they are not active. - Updated types to support the latest Polkadot/Substrate master changes diff --git a/packages/api/src/submittable/Submittable.ts b/packages/api/src/submittable/Submittable.ts index cd3f02c8a4..a08a6bfb41 100644 --- a/packages/api/src/submittable/Submittable.ts +++ b/packages/api/src/submittable/Submittable.ts @@ -193,7 +193,9 @@ export default class Submittable extends _Extrinsic implements Submitta return combineLatest([ // if we have a nonce already, don't retrieve the latest, use what is there isUndefined(options.nonce) - ? this._api.query.system.accountNonce(address) + ? this._api.rpc.account.nextIndex + ? this._api.rpc.account.nextIndex(address) + : this._api.query.system.accountNonce(address) : of(createType('Index', options.nonce)), // if we have an era provided already or eraLength is <= 0 (immortal) // don't get the latest block, just pass null, handle in mergeMap