From 2916794fa228b8f76badf96be776c6f6ebae52d4 Mon Sep 17 00:00:00 2001 From: karzak Date: Thu, 9 Jun 2022 13:57:47 -0500 Subject: [PATCH] fix: handle eth accounts --- src/tx/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tx/index.ts b/src/tx/index.ts index fbbce91..885c3ce 100644 --- a/src/tx/index.ts +++ b/src/tx/index.ts @@ -108,7 +108,14 @@ async function loadMetaData(address: string, base: string, timeout = 2000) { if (res?.data?.result?.type === 'cosmos-sdk/BaseAccount') { accNum = res?.data?.result?.value?.account_number; seqNum = res?.data?.result?.value?.sequence || '0'; - } else { + } else if ((res?.data?.result?.type === 'ethermint/EthAccount') ) { + accNum = + res?.data?.result?.value?.base_account + ?.account_number; + seqNum = + res?.data?.result?.value?.base_account?.sequence || + '0'; + } else { accNum = res?.data?.result?.value?.base_vesting_account?.base_account ?.account_number;