Skip to content

Commit

Permalink
added use of accountNonceApi (#5915)
Browse files Browse the repository at this point in the history
  • Loading branch information
bee344 authored Jun 24, 2024
1 parent 5a4d11c commit 058a3ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/api-derive/src/tx/signingInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ function latestNonce (api: DeriveApi, address: string): Observable<Index> {
}

function nextNonce (api: DeriveApi, address: string): Observable<Index> {
return api.rpc.system?.accountNextIndex
? api.rpc.system.accountNextIndex(address)
: latestNonce(api, address);
if (api.call.accountNonceApi) {
return api.call.accountNonceApi.accountNonce(address);
} else {
return api.rpc.system?.accountNextIndex
? api.rpc.system.accountNextIndex(address)
: latestNonce(api, address);
}
}

function signingHeader (api: DeriveApi): Observable<Header> {
Expand Down

0 comments on commit 058a3ac

Please sign in to comment.