From 058a3ac640df6139c5e03ab9e1e8651a2b50f065 Mon Sep 17 00:00:00 2001 From: Alberto Nicolas Penayo <74352651+bee344@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:41:55 -0300 Subject: [PATCH] added use of accountNonceApi (#5915) --- packages/api-derive/src/tx/signingInfo.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/api-derive/src/tx/signingInfo.ts b/packages/api-derive/src/tx/signingInfo.ts index 21b867deef..8b489d1660 100644 --- a/packages/api-derive/src/tx/signingInfo.ts +++ b/packages/api-derive/src/tx/signingInfo.ts @@ -29,9 +29,13 @@ function latestNonce (api: DeriveApi, address: string): Observable { } function nextNonce (api: DeriveApi, address: string): Observable { - 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
{