-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.d.ts
More file actions
35 lines (32 loc) · 852 Bytes
/
window.d.ts
File metadata and controls
35 lines (32 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// global.d.ts or window.d.ts
import type {
ChainInfoWithoutEndpoints,
Keplr as KeplrType,
Window as KeplrWindow,
} from "@keplr-wallet/types";
interface Ethereum {
isMetaMask?: boolean;
request: (args: { method: string; params?: any[] }) => Promise<any>;
on: (event: string, handler: (...args: any[]) => void) => void;
// Add more types as needed
}
interface Solana {
isPhantom?: boolean;
connect: () => Promise<any>;
disconnect: () => any;
publicKey: string;
}
declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Window extends KeplrWindow {
keplr?: Keplr & {
ethereum: any;
getChainInfoWithoutEndpoints: (
chainId: string
) => Promise<ChainInfoWithoutEndpoints>;
};
ethereum?: Ethereum;
solana?: Solana;
getOfflineSigner: any;
}
}