-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype_ethers.ts
executable file
·32 lines (27 loc) · 1.13 KB
/
type_ethers.ts
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
// const isNode = typeof window === "undefined";
// const { ethers, HDNodeWallet, Wallet, Mnemonic } = isNode
// ? require("ethers") // CommonJS for Node.js
// : require("https://cdnjs.cloudflare.com/ajax/libs/ethers/6.13.5/ethers.esm.min.js"); // Static import for Browsers
// export { ethers, HDNodeWallet, Wallet, Mnemonic }
// // let ethers: typeof import("ethers");
// // let HDNodeWallet: typeof import("ethers").HDNodeWallet;
// // let Wallet: typeof import("ethers").Wallet;
// // let Mnemonic: typeof import("ethers").Mnemonic;
// // (async () => {
// // if (typeof window !== "undefined") {
// // // Browser environment
// // const module = await import("ethers");
// // ethers = module;
// // HDNodeWallet = module.HDNodeWallet;
// // Wallet = module.Wallet;
// // Mnemonic = module.Mnemonic;
// // } else {
// // // Node.js environment
// // const module = await import("ethers");
// // ethers = module;
// // HDNodeWallet = module.HDNodeWallet;
// // Wallet = module.Wallet;
// // Mnemonic = module.Mnemonic;
// // }
// // })();
// // export { ethers, HDNodeWallet, Wallet, Mnemonic };