Skip to content

Commit 235279a

Browse files
committed
fix: window injected ext types
1 parent 86dd77f commit 235279a

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

src/wallet/wallets/cosmostation/CosmostationController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class CosmostationController extends WalletController {
5959

6060
protected async connectExtension<T extends string>(chains: ChainInfo<T>[]) {
6161
const wallets = new Map<T, ConnectedWallet>();
62-
const ext = window.cosmostation.providers.keplr;
62+
const ext = window.cosmostation?.providers.keplr;
6363
if (!ext) {
6464
throw new Error("Cosmostation extension is not installed");
6565
}

src/wallet/wallets/cosmostation/types.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import { Keplr } from "cosmes/registry";
44
export type Cosmostation = Keplr;
55

66
export type Window = {
7-
cosmostation: {
8-
providers: {
9-
keplr: Cosmostation;
10-
};
11-
};
7+
cosmostation?:
8+
| {
9+
providers: {
10+
keplr: Cosmostation;
11+
};
12+
}
13+
| undefined;
1214
};

src/wallet/wallets/leap/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { Keplr } from "cosmes/registry";
44
export type Leap = Keplr;
55

66
export type Window = {
7-
leap: Leap;
7+
leap?: Leap | undefined;
88
};

src/wallet/wallets/metamask-injective/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import type { MetaMaskInpageProvider } from "@metamask/providers";
33
export type Ethereum = MetaMaskInpageProvider;
44

55
export type Window = {
6-
ethereum: Ethereum;
6+
ethereum?: Ethereum | undefined;
77
};

src/wallet/wallets/station/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type Window = {
2-
station: Station;
2+
station?: Station | undefined;
33
};
44

55
/**

0 commit comments

Comments
 (0)