From 95d462421bdf7b9e992911edafb38fec494714e9 Mon Sep 17 00:00:00 2001 From: plubber Date: Fri, 10 Jan 2025 15:57:51 -0500 Subject: [PATCH] Add error handling for missing Keplr installation in Cosmos signer setup --- docs/client/getting-started.mdx | 2 ++ docs/general/quickstart-guide.mdx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/client/getting-started.mdx b/docs/client/getting-started.mdx index a10ff798..2f23bdbb 100644 --- a/docs/client/getting-started.mdx +++ b/docs/client/getting-started.mdx @@ -58,6 +58,8 @@ To execute transactions, you need to set up signers for the ecosystems you plan // For Cosmos transactions, we'll use Keplr wallet from the window object const getCosmosSigner = async (chainID: string) => { const key = await window.keplr?.getKey(chainID); + if (!key) throw new Error("Keplr not installed or chain not added"); + return key.isNanoLedger ? window.keplr?.getOfflineSignerOnlyAmino(chainID) : window.keplr?.getOfflineSigner(chainID); diff --git a/docs/general/quickstart-guide.mdx b/docs/general/quickstart-guide.mdx index e797fe67..c3ad468f 100644 --- a/docs/general/quickstart-guide.mdx +++ b/docs/general/quickstart-guide.mdx @@ -39,6 +39,8 @@ import { SkipClient } from "@skip-go/client"; const skipClient = new SkipClient({ getCosmosSigner = async (chainID: string) => { const key = await window.keplr?.getKey(chainID); + if (!key) throw new Error("Keplr not installed or chain not added"); + return key.isNanoLedger ? window.keplr?.getOfflineSignerOnlyAmino(chainID)