Skip to content

Commit

Permalink
Add error handling for missing Keplr installation in Cosmos signer setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ericHgorski committed Jan 10, 2025
1 parent 1354c15 commit 95d4624
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/client/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions docs/general/quickstart-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 95d4624

Please sign in to comment.