From 7cfc448bb94ead6dc8fe0af309c7506c323871b4 Mon Sep 17 00:00:00 2001 From: Milan Steiner Date: Thu, 10 Feb 2022 13:33:15 +0100 Subject: [PATCH] Remove not needed functions --- src/helpers/keplr.ts | 17 ----------------- src/helpers/setup.ts | 3 +-- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 src/helpers/keplr.ts diff --git a/src/helpers/keplr.ts b/src/helpers/keplr.ts deleted file mode 100644 index e5e1934..0000000 --- a/src/helpers/keplr.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Helper functions for usage with keplr - */ - -// Check if keplr is installed and supported -export function checkExtensionAndBrowser(): boolean { - if (typeof window !== `undefined`) { - if (window.getOfflineSigner && window.keplr && window.keplr.experimentalSuggestChain) { - return true; - } else { - console.error("Keplr extension not found", window); - } - } else { - console.error("Window is undefined :|", window); - } - return false; -} diff --git a/src/helpers/setup.ts b/src/helpers/setup.ts index ba3f358..3084e80 100644 --- a/src/helpers/setup.ts +++ b/src/helpers/setup.ts @@ -11,7 +11,6 @@ import { SigningCosmWasmClient } from "../cosmwasm-stargate"; import { DirectSecp256k1HdWallet } from "../proto-signing"; import { GasPrice } from "../stargate"; -import { checkExtensionAndBrowser } from "./keplr"; /** * All setup functions are using the same config pattern @@ -33,7 +32,7 @@ interface Config { */ export async function setupKeplrWeb(config: Config): Promise { // check browser compatibility - if (!checkExtensionAndBrowser()) { + if (!window.keplr) { throw new Error("Keplr is not supported or installed on this browser!"); }