-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdevTools.ts
50 lines (44 loc) · 1.21 KB
/
devTools.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import browser from "webextension-polyfill";
import BigNumber from "bignumber.js";
import { ethers } from "ethers";
import { Buffer } from "buffer";
import * as profile from "lib/ext/profile";
import * as i18n from "lib/ext/i18n";
import { storage } from "lib/ext/storage";
import { globalStorage } from "lib/ext/globalStorage";
import * as clientStorage from "lib/ext/clientStorage";
import * as cryptoUtils from "lib/crypto-utils";
import { downloadFile } from "lib/download";
import * as types from "core/types";
import * as common from "core/common";
import * as repo from "core/repo";
import * as client from "core/client";
import { reset, getAllStorage } from "./utils";
Object.assign(window, {
...cryptoUtils,
browser,
ethers,
Buffer,
profile,
storage,
globalStorage,
clientStorage,
i18n,
types,
common,
repo,
client,
reset,
getAllStorage,
BigNumber,
downloadFile,
});
if (process.env.RELEASE_ENV === "false") {
const imports = [
import("./importExport"),
process.env.WIGWAM_DEV_CONTROL_PANEL === "true" && import("./controlPanel"),
].filter(Boolean);
Promise.all(imports)
.then((modules) => modules.forEach((m) => m && Object.assign(window, m)))
.catch(console.error);
}