diff --git a/components/forms/TransactionSigning.js b/components/forms/TransactionSigning.js index 3605b516..df86c790 100644 --- a/components/forms/TransactionSigning.js +++ b/components/forms/TransactionSigning.js @@ -7,7 +7,7 @@ import { useAppContext } from "../../context/AppContext"; import Button from "../inputs/Button"; import HashView from "../dataViews/HashView"; import StackableContainer from "../layout/StackableContainer"; -import { AminoTypes } from "@cosmjs/stargate"; +import { pubkeyToAddress } from "@cosmjs/amino"; const TransactionSigning = (props) => { const { state } = useAppContext(); @@ -32,6 +32,13 @@ const TransactionSigning = (props) => { window.keplr_wallet = tempWalletAccount; }; + const isValidSigner = + props.accountOnChain && + props.accountOnChain.pubkey.value.pubkeys.find( + (pubkey) => + pubkeyToAddress(pubkey, state.chain.addressPrefix) === walletAccount.bech32Address, + ); + const signTransaction = async () => { window.keplr.defaultOptions = { sign: { @@ -86,7 +93,7 @@ const TransactionSigning = (props) => {

You've signed this transaction.

- ) : ( + ) : isValidSigner ? ( <>

Sign this transaction

{walletAccount ? ( @@ -95,6 +102,11 @@ const TransactionSigning = (props) => {