-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreload.js
37 lines (32 loc) · 870 Bytes
/
preload.js
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
const electronStore = require("electron-store");
const { shell, remote } = require("electron");
const LedgerInterface = require("./MultiSign/ledger-interface");
const trezorConnector = require("./MultiSign/trezor-connector");
window.electronStore = function(...args) {
return new electronStore(...args);
};
window.openExternal = url => shell.openExternal(url);
window.fetchFromWs = ({ url, method, params = [], timeOut = 5000 }) => {
return remote.app.utils.fetchFromWs({ url, method, params, timeOut });
};
window.fetchFromNodeHttp = ({
url,
method = "POST",
methodAlias,
params = [],
body,
timeOut = 5000,
header = {}
}) => {
return remote.app.utils.fetchFromHttp({
url,
method,
methodAlias,
params,
body,
timeOut,
header
});
};
window.LedgerInterface = LedgerInterface;
window.trezorConnector = trezorConnector;