From 44e95691849cd67a692ef65a6a9fa2b084668519 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Fri, 14 Apr 2023 17:27:13 +0200 Subject: [PATCH] Check if multisig --- pages/multi/[address]/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pages/multi/[address]/index.tsx b/pages/multi/[address]/index.tsx index 6e4484c..b625281 100644 --- a/pages/multi/[address]/index.tsx +++ b/pages/multi/[address]/index.tsx @@ -1,4 +1,4 @@ -import { MultisigThresholdPubkey, SinglePubkey } from "@cosmjs/amino"; +import { MultisigThresholdPubkey, SinglePubkey, isMultisigThresholdPubkey } from "@cosmjs/amino"; import { Account, StargateClient } from "@cosmjs/stargate"; import { assert } from "@cosmjs/utils"; import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin"; @@ -49,9 +49,10 @@ const Multipage = () => { assert(state.chain.denom, "denom missing"); const tempHoldings = await client.getAllBalances(address); setHoldings(tempHoldings); - const result = await getMultisigAccount(address, client); - setPubkey(result[0]); - setAccountOnChain(result[1]); + const [newPubkey, newAccountOnChain] = await getMultisigAccount(address, client); + assert(isMultisigThresholdPubkey(newPubkey), "pubkey is not multisig"); + setPubkey(newPubkey); + setAccountOnChain(newAccountOnChain); // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { setAccountError(error.message);