Skip to content

Commit

Permalink
fix: window injected ext types
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCQL committed Dec 28, 2023
1 parent 86dd77f commit 235279a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/wallet/wallets/cosmostation/CosmostationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class CosmostationController extends WalletController {

protected async connectExtension<T extends string>(chains: ChainInfo<T>[]) {
const wallets = new Map<T, ConnectedWallet>();
const ext = window.cosmostation.providers.keplr;
const ext = window.cosmostation?.providers.keplr;
if (!ext) {
throw new Error("Cosmostation extension is not installed");
}
Expand Down
12 changes: 7 additions & 5 deletions src/wallet/wallets/cosmostation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { Keplr } from "cosmes/registry";
export type Cosmostation = Keplr;

export type Window = {
cosmostation: {
providers: {
keplr: Cosmostation;
};
};
cosmostation?:
| {
providers: {
keplr: Cosmostation;
};
}
| undefined;
};
2 changes: 1 addition & 1 deletion src/wallet/wallets/leap/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { Keplr } from "cosmes/registry";
export type Leap = Keplr;

export type Window = {
leap: Leap;
leap?: Leap | undefined;
};
2 changes: 1 addition & 1 deletion src/wallet/wallets/metamask-injective/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import type { MetaMaskInpageProvider } from "@metamask/providers";
export type Ethereum = MetaMaskInpageProvider;

export type Window = {
ethereum: Ethereum;
ethereum?: Ethereum | undefined;
};
2 changes: 1 addition & 1 deletion src/wallet/wallets/station/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type Window = {
station: Station;
station?: Station | undefined;
};

/**
Expand Down

0 comments on commit 235279a

Please sign in to comment.