Skip to content

Commit

Permalink
fix: fix build issue with window object (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hemanthghs authored Oct 31, 2023
1 parent 3ee4e28 commit 18af8d1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/store/features/wallet/walletService.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
declare let window: WalletWindow;

export const isWalletInstalled = (walletName: string): boolean => {
switch (walletName) {
case "keplr":
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/store/features/wallet/walletSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { getWalletAmino } from "../../../txns/execute";
import { isWalletInstalled } from "./walletService";
import { isConnected, setConnected, setWalletName } from "../../../utils/localStorage";

declare let window: WalletWindow;

interface ChainInfo {
walletInfo: {
name: string;
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/txns/execute.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
declare let window: WalletWindow;

export async function getWalletAmino(chainID: string): Promise<[any, string]> {
await window.wallet.enable(chainID);
const offlineSigner = window.wallet.getOfflineSignerOnlyAmino(chainID);
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/types/window.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { KeplrWindow } from "@keplr-wallet/types";
declare global {
interface WalletWindow extends Window {
keplr: KeplrWindow;
leap: any;
wallet: any;
cosmostation: any;
}
}

0 comments on commit 18af8d1

Please sign in to comment.