From 9b7c304ebe855e53e2d4ff72a4e2905912cee8b0 Mon Sep 17 00:00:00 2001 From: klk1236 Date: Wed, 6 Jul 2022 18:25:08 +0400 Subject: [PATCH] Fixed where the keplr overides txn fees. --- components/forms/TransactionSigning.tsx | 3 +++ types/index.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/components/forms/TransactionSigning.tsx b/components/forms/TransactionSigning.tsx index 290d148..25dc3ed 100644 --- a/components/forms/TransactionSigning.tsx +++ b/components/forms/TransactionSigning.tsx @@ -33,6 +33,9 @@ const TransactionSigning = (props: Props) => { try { assert(state.chain.chainId, "chainId missing"); await window.keplr.enable(state.chain.chainId); + window.keplr.defaultOptions = { + sign: { preferNoSetFee: !0, preferNoSetMemo: !0, disableBalanceCheck: !0 }, + }; const tempWalletAccount = await window.keplr.getKey(state.chain.chainId); console.log(tempWalletAccount); const tempHasSigned = props.signatures.some( diff --git a/types/index.ts b/types/index.ts index 1d29077..f6e78f1 100644 --- a/types/index.ts +++ b/types/index.ts @@ -4,6 +4,9 @@ import { EncodeObject } from "@cosmjs/proto-signing"; declare global { interface Window { keplr: { + defaultOptions: { + sign: { preferNoSetFee: boolean; preferNoSetMemo: boolean; disableBalanceCheck: boolean }; + }; // eslint-disable-next-line @typescript-eslint/no-explicit-any enable: (chainId: string) => any; getKey: (chainId: string) => Promise;