@ledgerhq/live-env 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +57 -0
- package/.turbo/turbo-build.log +4 -0
- package/lib/env.d.ts +30 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +793 -0
- package/lib/env.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib-es/env.d.ts +30 -0
- package/lib-es/env.d.ts.map +1 -0
- package/lib-es/env.js +778 -0
- package/lib-es/env.js.map +1 -0
- package/lib-es/index.d.ts +2 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +2 -0
- package/lib-es/index.js.map +1 -0
- package/package.json +51 -0
- package/src/env.ts +800 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +20 -0
package/lib/env.js
ADDED
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
exports.setEnvUnsafe = exports.setEnv = exports.changes = exports.getEnvDesc = exports.isEnvDefault = exports.getEnvDefault = exports.getEnv = exports.getAllEnvs = exports.getAllEnvNames = exports.getDefinition = void 0;
|
|
18
|
+
// TODO: this file will be moved to a @ledgerhq/env library
|
|
19
|
+
var mapValues_1 = __importDefault(require("lodash/mapValues"));
|
|
20
|
+
// set and get environment & config variables
|
|
21
|
+
var rxjs_1 = require("rxjs");
|
|
22
|
+
var intParser = function (v) {
|
|
23
|
+
if (!Number.isNaN(v))
|
|
24
|
+
return parseInt(v, 10);
|
|
25
|
+
};
|
|
26
|
+
var floatParser = function (v) {
|
|
27
|
+
if (!Number.isNaN(v))
|
|
28
|
+
return parseFloat(v);
|
|
29
|
+
};
|
|
30
|
+
var boolParser = function (v) {
|
|
31
|
+
if (typeof v === "boolean")
|
|
32
|
+
return v;
|
|
33
|
+
return !(v === "0" || v === "false");
|
|
34
|
+
};
|
|
35
|
+
var stringParser = function (v) {
|
|
36
|
+
return typeof v === "string" ? v : undefined;
|
|
37
|
+
};
|
|
38
|
+
var jsonParser = function (v) {
|
|
39
|
+
try {
|
|
40
|
+
if (typeof v !== "string")
|
|
41
|
+
throw new Error();
|
|
42
|
+
return JSON.parse(v);
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var stringArrayParser = function (v) {
|
|
49
|
+
var v_array = typeof v === "string" ? v.split(",") : null;
|
|
50
|
+
if (Array.isArray(v_array) && v_array.length > 0)
|
|
51
|
+
return v_array;
|
|
52
|
+
};
|
|
53
|
+
var envDefinitions = {
|
|
54
|
+
ADDRESS_POISONING_FAMILIES: {
|
|
55
|
+
def: "ethereum,evm,tron",
|
|
56
|
+
parser: stringParser,
|
|
57
|
+
desc: "List of families impacted by the address poisoning attack"
|
|
58
|
+
},
|
|
59
|
+
ANALYTICS_CONSOLE: {
|
|
60
|
+
def: false,
|
|
61
|
+
parser: boolParser,
|
|
62
|
+
desc: "Show tracking overlays on the app UI"
|
|
63
|
+
},
|
|
64
|
+
DEBUG_THEME: {
|
|
65
|
+
def: false,
|
|
66
|
+
parser: boolParser,
|
|
67
|
+
desc: "Show theme debug overlay UI"
|
|
68
|
+
},
|
|
69
|
+
API_ALGORAND_BLOCKCHAIN_EXPLORER_API_ENDPOINT: {
|
|
70
|
+
def: "https://algorand.coin.ledger.com",
|
|
71
|
+
parser: stringParser,
|
|
72
|
+
desc: "Node API endpoint for algorand"
|
|
73
|
+
},
|
|
74
|
+
API_CELO_INDEXER: {
|
|
75
|
+
def: "https://celo.coin.ledger.com/indexer/",
|
|
76
|
+
parser: stringParser,
|
|
77
|
+
desc: "Explorer API for celo"
|
|
78
|
+
},
|
|
79
|
+
API_CELO_NODE: {
|
|
80
|
+
def: "https://celo.coin.ledger.com/archive/",
|
|
81
|
+
parser: stringParser,
|
|
82
|
+
desc: "Node endpoint for celo"
|
|
83
|
+
},
|
|
84
|
+
API_COSMOS_BLOCKCHAIN_EXPLORER_API_ENDPOINT: {
|
|
85
|
+
def: "https://cosmoshub4.coin.ledger.com",
|
|
86
|
+
parser: stringParser,
|
|
87
|
+
desc: "Node endpoint for cosmos"
|
|
88
|
+
},
|
|
89
|
+
API_RIPPLE_RPC: {
|
|
90
|
+
parser: stringParser,
|
|
91
|
+
def: "https://xrplcluster.com/ledgerlive",
|
|
92
|
+
desc: "XRP Ledger full history open JSON-RPC endpoint"
|
|
93
|
+
},
|
|
94
|
+
API_FILECOIN_ENDPOINT: {
|
|
95
|
+
parser: stringParser,
|
|
96
|
+
def: "https://filecoin.coin.ledger.com",
|
|
97
|
+
desc: "Filecoin API url"
|
|
98
|
+
},
|
|
99
|
+
API_NEAR_ARCHIVE_NODE: {
|
|
100
|
+
def: "https://near.coin.ledger.com/node/",
|
|
101
|
+
parser: stringParser,
|
|
102
|
+
desc: "Archive node endpoint for NEAR"
|
|
103
|
+
},
|
|
104
|
+
API_NEAR_INDEXER: {
|
|
105
|
+
def: "https://near.coin.ledger.com/indexer/",
|
|
106
|
+
parser: stringParser,
|
|
107
|
+
desc: "Datahub Indexer API for NEAR"
|
|
108
|
+
},
|
|
109
|
+
API_NEAR_STAKING_POSITIONS_API: {
|
|
110
|
+
def: "https://validators-near.coin.ledger.com/",
|
|
111
|
+
parser: stringParser,
|
|
112
|
+
desc: "NEAR staking positions API"
|
|
113
|
+
},
|
|
114
|
+
API_POLKADOT_INDEXER: {
|
|
115
|
+
parser: stringParser,
|
|
116
|
+
def: "https://polkadot.coin.ledger.com",
|
|
117
|
+
desc: "Explorer API for polkadot"
|
|
118
|
+
},
|
|
119
|
+
API_POLKADOT_SIDECAR: {
|
|
120
|
+
parser: stringParser,
|
|
121
|
+
def: "https://polkadot-sidecar.coin.ledger.com",
|
|
122
|
+
desc: "Polkadot Sidecar API url"
|
|
123
|
+
},
|
|
124
|
+
ELROND_API_ENDPOINT: {
|
|
125
|
+
parser: stringParser,
|
|
126
|
+
def: "https://elrond.coin.ledger.com",
|
|
127
|
+
desc: "Elrond API url"
|
|
128
|
+
},
|
|
129
|
+
ELROND_DELEGATION_API_ENDPOINT: {
|
|
130
|
+
parser: stringParser,
|
|
131
|
+
def: "https://delegations-elrond.coin.ledger.com",
|
|
132
|
+
desc: "Elrond DELEGATION API url"
|
|
133
|
+
},
|
|
134
|
+
API_STELLAR_HORIZON: {
|
|
135
|
+
parser: stringParser,
|
|
136
|
+
def: "https://stellar.coin.ledger.com",
|
|
137
|
+
desc: "Stellar Horizon API url"
|
|
138
|
+
},
|
|
139
|
+
API_STELLAR_HORIZON_FETCH_LIMIT: {
|
|
140
|
+
parser: intParser,
|
|
141
|
+
def: 100,
|
|
142
|
+
desc: "Limit of operation that Horizon will fetch per page"
|
|
143
|
+
},
|
|
144
|
+
API_STELLAR_HORIZON_STATIC_FEE: {
|
|
145
|
+
def: false,
|
|
146
|
+
parser: boolParser,
|
|
147
|
+
desc: "Static fee for Stellar account"
|
|
148
|
+
},
|
|
149
|
+
API_OSMOSIS_NODE: {
|
|
150
|
+
def: "https://osmosis.coin.ledger-stg.com",
|
|
151
|
+
parser: stringParser,
|
|
152
|
+
desc: "Endpoint for Osmosis Node"
|
|
153
|
+
},
|
|
154
|
+
API_TEZOS_BAKER: {
|
|
155
|
+
parser: stringParser,
|
|
156
|
+
def: "https://tezos-bakers.api.live.ledger.com",
|
|
157
|
+
desc: "bakers API for tezos"
|
|
158
|
+
},
|
|
159
|
+
API_TEZOS_BLOCKCHAIN_EXPLORER_API_ENDPOINT: {
|
|
160
|
+
def: "https://xtz-explorer.api.live.ledger.com/explorer",
|
|
161
|
+
parser: stringParser,
|
|
162
|
+
desc: "Ledger explorer API for tezos"
|
|
163
|
+
},
|
|
164
|
+
API_TEZOS_TZKT_API: {
|
|
165
|
+
def: "https://xtz-tzkt-explorer.api.live.ledger.com",
|
|
166
|
+
parser: stringParser,
|
|
167
|
+
desc: "tzkt.io explorer"
|
|
168
|
+
},
|
|
169
|
+
API_TEZOS_NODE: {
|
|
170
|
+
def: "https://xtz-node.api.live.ledger.com",
|
|
171
|
+
parser: stringParser,
|
|
172
|
+
desc: "node API for tezos (for broadcast only)"
|
|
173
|
+
},
|
|
174
|
+
API_TRONGRID_PROXY: {
|
|
175
|
+
parser: stringParser,
|
|
176
|
+
def: "https://tron.coin.ledger.com",
|
|
177
|
+
desc: "proxy url for trongrid API"
|
|
178
|
+
},
|
|
179
|
+
API_SOLANA_PROXY: {
|
|
180
|
+
parser: stringParser,
|
|
181
|
+
def: "https://solana.coin.ledger.com",
|
|
182
|
+
desc: "proxy url for solana API"
|
|
183
|
+
},
|
|
184
|
+
SOLANA_VALIDATORS_APP_BASE_URL: {
|
|
185
|
+
parser: stringParser,
|
|
186
|
+
def: "https://validators-solana.coin.ledger.com/api/v1/validators",
|
|
187
|
+
desc: "base url for validators.app validator list"
|
|
188
|
+
},
|
|
189
|
+
SOLANA_TX_CONFIRMATION_TIMEOUT: {
|
|
190
|
+
def: 100 * 1000,
|
|
191
|
+
parser: intParser,
|
|
192
|
+
desc: "solana transaction broadcast confirmation timeout"
|
|
193
|
+
},
|
|
194
|
+
API_HEDERA_MIRROR: {
|
|
195
|
+
def: "https://hedera.coin.ledger.com",
|
|
196
|
+
parser: stringParser,
|
|
197
|
+
desc: "mirror node API for Hedera"
|
|
198
|
+
},
|
|
199
|
+
BASE_SOCKET_URL: {
|
|
200
|
+
def: "wss://scriptrunner.api.live.ledger.com/update",
|
|
201
|
+
parser: stringParser,
|
|
202
|
+
desc: "Ledger script runner API"
|
|
203
|
+
},
|
|
204
|
+
BOT_TIMEOUT_SCAN_ACCOUNTS: {
|
|
205
|
+
def: 10 * 60 * 1000,
|
|
206
|
+
parser: intParser,
|
|
207
|
+
desc: "bot's default timeout for scanAccounts"
|
|
208
|
+
},
|
|
209
|
+
BOT_SPEC_DEFAULT_TIMEOUT: {
|
|
210
|
+
def: 30 * 60 * 1000,
|
|
211
|
+
parser: intParser,
|
|
212
|
+
desc: "define the default value of spec.skipMutationsTimeout (if not overriden by spec)"
|
|
213
|
+
},
|
|
214
|
+
CARDANO_API_ENDPOINT: {
|
|
215
|
+
def: "https://cardano.coin.ledger.com/api",
|
|
216
|
+
parser: stringParser,
|
|
217
|
+
desc: "Cardano API url"
|
|
218
|
+
},
|
|
219
|
+
CARDANO_TESTNET_API_ENDPOINT: {
|
|
220
|
+
def: "https://testnet-ledger.cardanoscan.io/api",
|
|
221
|
+
parser: stringParser,
|
|
222
|
+
desc: "Cardano API url"
|
|
223
|
+
},
|
|
224
|
+
COINAPPS: {
|
|
225
|
+
def: "",
|
|
226
|
+
parser: stringParser,
|
|
227
|
+
desc: "(dev feature) defines the folder for speculos mode that contains Nano apps binaries (.elf) in a specific structure: <device>/<firmware>/<appName>/app_<appVersion>.elf"
|
|
228
|
+
},
|
|
229
|
+
COMPOUND_API: {
|
|
230
|
+
def: "https://api.compound.finance",
|
|
231
|
+
parser: stringParser,
|
|
232
|
+
desc: "location of the compound API"
|
|
233
|
+
},
|
|
234
|
+
CRYPTO_ORG_INDEXER: {
|
|
235
|
+
def: "https://cryptoorg-rpc-indexer.coin.ledger.com",
|
|
236
|
+
parser: stringParser,
|
|
237
|
+
desc: "location of the crypto.org indexer API"
|
|
238
|
+
},
|
|
239
|
+
CRYPTO_ORG_TESTNET_INDEXER: {
|
|
240
|
+
def: "https://crypto.org/explorer/croeseid4",
|
|
241
|
+
parser: stringParser,
|
|
242
|
+
desc: "location of the crypto.org indexer testnet API"
|
|
243
|
+
},
|
|
244
|
+
CRYPTO_ORG_RPC_URL: {
|
|
245
|
+
def: "https://cryptoorg-rpc-node.coin.ledger.com",
|
|
246
|
+
parser: stringParser,
|
|
247
|
+
desc: "location of the crypto.org chain node"
|
|
248
|
+
},
|
|
249
|
+
CRYPTO_ORG_TESTNET_RPC_URL: {
|
|
250
|
+
def: "https://rpc-testnet-croeseid-4.crypto.org",
|
|
251
|
+
parser: stringParser,
|
|
252
|
+
desc: "location of the crypto.org chain testnet node"
|
|
253
|
+
},
|
|
254
|
+
DEBUG_UTXO_DISPLAY: {
|
|
255
|
+
def: 4,
|
|
256
|
+
parser: intParser,
|
|
257
|
+
desc: "define maximum number of utxos to display in CLI"
|
|
258
|
+
},
|
|
259
|
+
DEBUG_HTTP_RESPONSE: {
|
|
260
|
+
def: false,
|
|
261
|
+
parser: boolParser,
|
|
262
|
+
desc: "includes HTTP response body in logs"
|
|
263
|
+
},
|
|
264
|
+
DEVICE_CANCEL_APDU_FLUSH_MECHANISM: {
|
|
265
|
+
def: true,
|
|
266
|
+
parser: boolParser,
|
|
267
|
+
desc: "enable a mechanism that send a 0x00 apdu to force device to awake from its 'Processing' UI state"
|
|
268
|
+
},
|
|
269
|
+
DEVICE_PROXY_URL: {
|
|
270
|
+
def: "",
|
|
271
|
+
parser: stringParser,
|
|
272
|
+
desc: "enable a proxy to use instead of a physical device"
|
|
273
|
+
},
|
|
274
|
+
DEVICE_PROXY_MODEL: {
|
|
275
|
+
def: "nanoS",
|
|
276
|
+
parser: stringParser,
|
|
277
|
+
desc: "allow to override the default model of a proxied device"
|
|
278
|
+
},
|
|
279
|
+
DISABLE_TRANSACTION_BROADCAST: {
|
|
280
|
+
def: false,
|
|
281
|
+
parser: boolParser,
|
|
282
|
+
desc: "disable broadcast of transactions"
|
|
283
|
+
},
|
|
284
|
+
DISABLE_SYNC_TOKEN: {
|
|
285
|
+
def: true,
|
|
286
|
+
parser: boolParser,
|
|
287
|
+
desc: "disable a problematic mechanism of our API"
|
|
288
|
+
},
|
|
289
|
+
DISABLE_FW_UPDATE_VERSION_CHECK: {
|
|
290
|
+
def: false,
|
|
291
|
+
parser: boolParser,
|
|
292
|
+
desc: "disable the version check for firmware update eligibility"
|
|
293
|
+
},
|
|
294
|
+
EIP1559_ENABLED_CURRENCIES: {
|
|
295
|
+
def: "ethereum,ethereum_goerli,polygon",
|
|
296
|
+
parser: stringArrayParser,
|
|
297
|
+
desc: "set the currency ids where EIP1559 is enabled"
|
|
298
|
+
},
|
|
299
|
+
EIP1559_MINIMUM_FEES_GATE: {
|
|
300
|
+
def: true,
|
|
301
|
+
parser: boolParser,
|
|
302
|
+
desc: "prevents the user from doing an EIP1559 transaction with fees too low"
|
|
303
|
+
},
|
|
304
|
+
EIP1559_PRIORITY_FEE_LOWER_GATE: {
|
|
305
|
+
def: 0.85,
|
|
306
|
+
parser: floatParser,
|
|
307
|
+
desc: "minimum priority fee percents allowed compared to network conditions allowed when EIP1559_MINIMUM_FEES_GATE is activated"
|
|
308
|
+
},
|
|
309
|
+
ETHEREUM_GAS_LIMIT_AMPLIFIER: {
|
|
310
|
+
def: 1.2,
|
|
311
|
+
parser: floatParser,
|
|
312
|
+
desc: "Ethereum gasLimit multiplier for contracts to prevent out of gas issue"
|
|
313
|
+
},
|
|
314
|
+
EXPERIMENTAL_BLE: {
|
|
315
|
+
def: false,
|
|
316
|
+
parser: boolParser,
|
|
317
|
+
desc: "enable experimental support of Bluetooth"
|
|
318
|
+
},
|
|
319
|
+
EXPERIMENTAL_CURRENCIES: {
|
|
320
|
+
def: "",
|
|
321
|
+
parser: stringParser,
|
|
322
|
+
desc: "enable experimental support of currencies (comma separated)"
|
|
323
|
+
},
|
|
324
|
+
EXPERIMENTAL_EXPLORERS: {
|
|
325
|
+
def: false,
|
|
326
|
+
parser: boolParser,
|
|
327
|
+
desc: "enable experimental explorer APIs"
|
|
328
|
+
},
|
|
329
|
+
EXPERIMENTAL_LANGUAGES: {
|
|
330
|
+
def: false,
|
|
331
|
+
parser: boolParser,
|
|
332
|
+
desc: "enable experimental languages"
|
|
333
|
+
},
|
|
334
|
+
EXPERIMENTAL_MANAGER: {
|
|
335
|
+
def: false,
|
|
336
|
+
parser: boolParser,
|
|
337
|
+
desc: "enable an experimental version of Manager"
|
|
338
|
+
},
|
|
339
|
+
EXPERIMENTAL_ROI_CALCULATION: {
|
|
340
|
+
def: false,
|
|
341
|
+
parser: boolParser,
|
|
342
|
+
desc: "enable an experimental version of the portfolio percentage calculation"
|
|
343
|
+
},
|
|
344
|
+
EXPERIMENTAL_SEND_MAX: {
|
|
345
|
+
def: false,
|
|
346
|
+
parser: boolParser,
|
|
347
|
+
desc: "force enabling SEND MAX even if not yet stable"
|
|
348
|
+
},
|
|
349
|
+
EXPERIMENTAL_USB: {
|
|
350
|
+
def: false,
|
|
351
|
+
parser: boolParser,
|
|
352
|
+
desc: "enable an experimental implementation of USB support"
|
|
353
|
+
},
|
|
354
|
+
EXPERIMENTAL_SWAP: {
|
|
355
|
+
def: false,
|
|
356
|
+
parser: boolParser,
|
|
357
|
+
desc: "enable an experimental swap interface"
|
|
358
|
+
},
|
|
359
|
+
EXPLORER: {
|
|
360
|
+
def: "https://explorers.api.live.ledger.com",
|
|
361
|
+
parser: stringParser,
|
|
362
|
+
desc: "Ledger generic explorer API"
|
|
363
|
+
},
|
|
364
|
+
EXPLORER_STAGING: {
|
|
365
|
+
def: "https://explorers.api-01.live.ledger-stg.com",
|
|
366
|
+
parser: stringParser,
|
|
367
|
+
desc: "Ledger staging explorer API"
|
|
368
|
+
},
|
|
369
|
+
EXPLORER_BETA: {
|
|
370
|
+
def: "https://explorers.api.live.ledger.com",
|
|
371
|
+
parser: stringParser,
|
|
372
|
+
desc: "Ledger generic explorer beta API"
|
|
373
|
+
},
|
|
374
|
+
EXPLORER_SATSTACK: {
|
|
375
|
+
def: "http://localhost:20000",
|
|
376
|
+
parser: stringParser,
|
|
377
|
+
desc: "Ledger satstack Bitcoin explorer API"
|
|
378
|
+
},
|
|
379
|
+
EXPORT_EXCLUDED_LOG_TYPES: {
|
|
380
|
+
def: "ble-frame",
|
|
381
|
+
parser: stringParser,
|
|
382
|
+
desc: "comma-separated list of excluded log types for exported logs"
|
|
383
|
+
},
|
|
384
|
+
EXPORT_MAX_LOGS: {
|
|
385
|
+
def: 5000,
|
|
386
|
+
parser: intParser,
|
|
387
|
+
desc: "maximum logs to keep for export"
|
|
388
|
+
},
|
|
389
|
+
DISABLE_APP_VERSION_REQUIREMENTS: {
|
|
390
|
+
def: false,
|
|
391
|
+
parser: boolParser,
|
|
392
|
+
desc: "force an old application version to be accepted regardless of its version"
|
|
393
|
+
},
|
|
394
|
+
FORCE_PROVIDER: {
|
|
395
|
+
def: 1,
|
|
396
|
+
parser: intParser,
|
|
397
|
+
desc: "use a different provider for app store (for developers only)"
|
|
398
|
+
},
|
|
399
|
+
FILTER_ZERO_AMOUNT_ERC20_EVENTS: {
|
|
400
|
+
def: true,
|
|
401
|
+
parser: boolParser,
|
|
402
|
+
desc: "Remove filter of address poisoning"
|
|
403
|
+
},
|
|
404
|
+
GET_CALLS_RETRY: {
|
|
405
|
+
def: 2,
|
|
406
|
+
parser: intParser,
|
|
407
|
+
desc: "how many times to retry a GET http call"
|
|
408
|
+
},
|
|
409
|
+
GET_CALLS_TIMEOUT: {
|
|
410
|
+
def: 60 * 1000,
|
|
411
|
+
parser: intParser,
|
|
412
|
+
desc: "how much time to timeout a GET http call"
|
|
413
|
+
},
|
|
414
|
+
HIDE_EMPTY_TOKEN_ACCOUNTS: {
|
|
415
|
+
def: false,
|
|
416
|
+
parser: boolParser,
|
|
417
|
+
desc: "hide the sub accounts when they are empty"
|
|
418
|
+
},
|
|
419
|
+
KEYCHAIN_OBSERVABLE_RANGE: {
|
|
420
|
+
def: 0,
|
|
421
|
+
parser: intParser,
|
|
422
|
+
desc: "overrides the gap limit specified by BIP44 (default to 20)"
|
|
423
|
+
},
|
|
424
|
+
LEDGER_CLIENT_VERSION: {
|
|
425
|
+
def: "",
|
|
426
|
+
parser: stringParser,
|
|
427
|
+
desc: "the 'X-Ledger-Client-Version' HTTP header to use for queries to Ledger APIs"
|
|
428
|
+
},
|
|
429
|
+
LEDGER_COUNTERVALUES_API: {
|
|
430
|
+
def: "https://countervalues.live.ledger.com",
|
|
431
|
+
parser: stringParser,
|
|
432
|
+
desc: "Ledger countervalues API"
|
|
433
|
+
},
|
|
434
|
+
LEDGER_REST_API_BASE: {
|
|
435
|
+
def: "https://explorers.api.live.ledger.com",
|
|
436
|
+
parser: stringParser,
|
|
437
|
+
desc: "DEPRECATED"
|
|
438
|
+
},
|
|
439
|
+
LEGACY_KT_SUPPORT_TO_YOUR_OWN_RISK: {
|
|
440
|
+
def: false,
|
|
441
|
+
parser: boolParser,
|
|
442
|
+
desc: "enable sending to KT accounts. Not tested."
|
|
443
|
+
},
|
|
444
|
+
MANAGER_API_BASE: {
|
|
445
|
+
def: "https://manager.api.live.ledger.com/api",
|
|
446
|
+
parser: stringParser,
|
|
447
|
+
desc: "Ledger Manager API"
|
|
448
|
+
},
|
|
449
|
+
MANAGER_DEV_MODE: {
|
|
450
|
+
def: false,
|
|
451
|
+
parser: boolParser,
|
|
452
|
+
desc: "enable visibility of utility apps in Manager"
|
|
453
|
+
},
|
|
454
|
+
MANAGER_INSTALL_DELAY: {
|
|
455
|
+
def: 1000,
|
|
456
|
+
parser: intParser,
|
|
457
|
+
desc: "defines the time to wait before installing apps to prevent known glitch (<=1.5.5) when chaining installs"
|
|
458
|
+
},
|
|
459
|
+
MAX_ACCOUNT_NAME_SIZE: {
|
|
460
|
+
def: 50,
|
|
461
|
+
parser: intParser,
|
|
462
|
+
desc: "maximum size of account names"
|
|
463
|
+
},
|
|
464
|
+
MOCK: {
|
|
465
|
+
def: "",
|
|
466
|
+
parser: stringParser,
|
|
467
|
+
desc: "switch the app into a MOCK mode for test purpose, the value will be used as a seed for the rng. Avoid falsy values."
|
|
468
|
+
},
|
|
469
|
+
MOCK_COUNTERVALUES: {
|
|
470
|
+
def: "",
|
|
471
|
+
parser: stringParser,
|
|
472
|
+
desc: "switch the countervalues resolution into a MOCK mode for test purpose"
|
|
473
|
+
},
|
|
474
|
+
MOCK_SWAP_KYC: {
|
|
475
|
+
def: "",
|
|
476
|
+
parser: stringParser,
|
|
477
|
+
desc: "mock the server response for the exchange KYC check, options are 'open', 'pending', 'closed' or 'approved'."
|
|
478
|
+
},
|
|
479
|
+
MOCK_SWAP_CHECK_QUOTE: {
|
|
480
|
+
def: "",
|
|
481
|
+
parser: stringParser,
|
|
482
|
+
desc: "mock the server response for the exchange check quote, options are 'RATE_VALID', 'KYC_FAILED', 'KYC_PENDING', 'KYC_UNDEFINED', 'KYC_UPGRADE_REQUIRED', 'MFA_REQUIRED', 'OVER_TRADE_LIMIT', 'UNKNOW_USER' or 'UNKNOWN_ERROR'."
|
|
483
|
+
},
|
|
484
|
+
MOCK_SWAP_WIDGET_BASE_URL: {
|
|
485
|
+
def: "",
|
|
486
|
+
parser: stringParser,
|
|
487
|
+
desc: "mock the FTX swap widget base url"
|
|
488
|
+
},
|
|
489
|
+
/**
|
|
490
|
+
* Note: the mocked cryptoassets config and test partner are signed with the
|
|
491
|
+
* Ledger test private key
|
|
492
|
+
*/
|
|
493
|
+
MOCK_EXCHANGE_TEST_CONFIG: {
|
|
494
|
+
def: false,
|
|
495
|
+
parser: boolParser,
|
|
496
|
+
desc: "mock the cryptoassets config and test partner (in the context of app-exchange)"
|
|
497
|
+
},
|
|
498
|
+
MOCK_REMOTE_LIVE_MANIFEST: {
|
|
499
|
+
def: "",
|
|
500
|
+
parser: stringParser,
|
|
501
|
+
desc: "mock remote live app manifest"
|
|
502
|
+
},
|
|
503
|
+
MOCK_OS_VERSION: {
|
|
504
|
+
def: "",
|
|
505
|
+
parser: stringParser,
|
|
506
|
+
desc: "if defined, overrides the os and version. format: os@version. Example: Windows_NT@6.1.7601"
|
|
507
|
+
},
|
|
508
|
+
NFT_CURRENCIES: {
|
|
509
|
+
def: "ethereum,polygon",
|
|
510
|
+
parser: stringParser,
|
|
511
|
+
desc: "set the currencies where NFT is active"
|
|
512
|
+
},
|
|
513
|
+
NFT_ETH_METADATA_SERVICE: {
|
|
514
|
+
def: "https://nft.api.live.ledger.com",
|
|
515
|
+
parser: stringParser,
|
|
516
|
+
desc: "service uri used to get the metadata of an nft"
|
|
517
|
+
},
|
|
518
|
+
OPERATION_ADDRESSES_LIMIT: {
|
|
519
|
+
def: 100,
|
|
520
|
+
parser: intParser,
|
|
521
|
+
desc: "limit the number of addresses in from/to of operations"
|
|
522
|
+
},
|
|
523
|
+
OPERATION_OPTIMISTIC_RETENTION: {
|
|
524
|
+
def: 30 * 60 * 1000,
|
|
525
|
+
parser: intParser,
|
|
526
|
+
desc: "timeout to keep an optimistic operation that was broadcasted but not yet visible from the coin implementation or the API"
|
|
527
|
+
},
|
|
528
|
+
OPERATION_PAGE_SIZE_INITIAL: {
|
|
529
|
+
def: 100,
|
|
530
|
+
parser: intParser,
|
|
531
|
+
desc: "defines the initial default operation length page to use"
|
|
532
|
+
},
|
|
533
|
+
POLKADOT_ELECTION_STATUS_THRESHOLD: {
|
|
534
|
+
def: 25,
|
|
535
|
+
parser: intParser,
|
|
536
|
+
desc: "in blocks - number of blocks before Polkadot election effectively opens to consider it as open and disable all staking features"
|
|
537
|
+
},
|
|
538
|
+
SATSTACK: {
|
|
539
|
+
def: false,
|
|
540
|
+
parser: boolParser,
|
|
541
|
+
desc: "Switch to satstack mode"
|
|
542
|
+
},
|
|
543
|
+
SCAN_FOR_INVALID_PATHS: {
|
|
544
|
+
def: false,
|
|
545
|
+
parser: boolParser,
|
|
546
|
+
desc: "enable searching accounts in exotic derivation paths"
|
|
547
|
+
},
|
|
548
|
+
SEED: {
|
|
549
|
+
def: "",
|
|
550
|
+
parser: stringParser,
|
|
551
|
+
desc: "(dev feature) seed to be used by speculos (device simulator)"
|
|
552
|
+
},
|
|
553
|
+
SHOW_LEGACY_NEW_ACCOUNT: {
|
|
554
|
+
def: false,
|
|
555
|
+
parser: boolParser,
|
|
556
|
+
desc: "allow the creation of legacy accounts"
|
|
557
|
+
},
|
|
558
|
+
SKIP_ONBOARDING: {
|
|
559
|
+
def: false,
|
|
560
|
+
parser: boolParser,
|
|
561
|
+
desc: "dev flag to skip onboarding flow"
|
|
562
|
+
},
|
|
563
|
+
SPECULOS_PID_OFFSET: {
|
|
564
|
+
def: 0,
|
|
565
|
+
parser: intParser,
|
|
566
|
+
desc: "offset to be added to the speculos pid and avoid collision with other instances"
|
|
567
|
+
},
|
|
568
|
+
SWAP_API_BASE: {
|
|
569
|
+
def: "https://swap.ledger.com/v4",
|
|
570
|
+
parser: stringParser,
|
|
571
|
+
desc: "Swap API base"
|
|
572
|
+
},
|
|
573
|
+
SYNC_ALL_INTERVAL: {
|
|
574
|
+
def: 8 * 60 * 1000,
|
|
575
|
+
parser: intParser,
|
|
576
|
+
desc: "delay between successive sync"
|
|
577
|
+
},
|
|
578
|
+
SYNC_BOOT_DELAY: {
|
|
579
|
+
def: 2 * 1000,
|
|
580
|
+
parser: intParser,
|
|
581
|
+
desc: "delay before the sync starts"
|
|
582
|
+
},
|
|
583
|
+
SYNC_PENDING_INTERVAL: {
|
|
584
|
+
def: 10 * 1000,
|
|
585
|
+
parser: intParser,
|
|
586
|
+
desc: "delay between sync when an operation is still pending"
|
|
587
|
+
},
|
|
588
|
+
SYNC_OUTDATED_CONSIDERED_DELAY: {
|
|
589
|
+
def: 10 * 60 * 1000,
|
|
590
|
+
parser: intParser,
|
|
591
|
+
desc: "delay until Live consider a sync outdated"
|
|
592
|
+
},
|
|
593
|
+
SYNC_MAX_CONCURRENT: {
|
|
594
|
+
def: 4,
|
|
595
|
+
parser: intParser,
|
|
596
|
+
desc: "maximum limit to synchronize accounts concurrently to limit overload"
|
|
597
|
+
},
|
|
598
|
+
BOT_MAX_CONCURRENT: {
|
|
599
|
+
def: 10,
|
|
600
|
+
parser: intParser,
|
|
601
|
+
desc: "maximum limit to run bot spec in parallel"
|
|
602
|
+
},
|
|
603
|
+
USER_ID: {
|
|
604
|
+
def: "",
|
|
605
|
+
parser: stringParser,
|
|
606
|
+
desc: "unique identifier of app instance. used to derivate dissociated ids for difference purposes (e.g. the firmware update incremental deployment)."
|
|
607
|
+
},
|
|
608
|
+
WALLETCONNECT: {
|
|
609
|
+
def: false,
|
|
610
|
+
parser: boolParser,
|
|
611
|
+
desc: "is walletconnect enabled"
|
|
612
|
+
},
|
|
613
|
+
WITH_DEVICE_POLLING_DELAY: {
|
|
614
|
+
def: 500,
|
|
615
|
+
parser: floatParser,
|
|
616
|
+
desc: "delay when polling device"
|
|
617
|
+
},
|
|
618
|
+
ANNOUNCEMENTS_API_URL: {
|
|
619
|
+
def: "https://cdn.live.ledger.com/announcements",
|
|
620
|
+
parser: stringParser,
|
|
621
|
+
desc: "url used to fetch new announcements"
|
|
622
|
+
},
|
|
623
|
+
ANNOUNCEMENTS_API_VERSION: {
|
|
624
|
+
def: 1,
|
|
625
|
+
parser: intParser,
|
|
626
|
+
desc: "version used for the announcements api"
|
|
627
|
+
},
|
|
628
|
+
STATUS_API_URL: {
|
|
629
|
+
def: "https://ledger.statuspage.io/api",
|
|
630
|
+
parser: stringParser,
|
|
631
|
+
desc: "url used to fetch ledger status"
|
|
632
|
+
},
|
|
633
|
+
STATUS_API_VERSION: {
|
|
634
|
+
def: 2,
|
|
635
|
+
parser: intParser,
|
|
636
|
+
desc: "version used for ledger status api"
|
|
637
|
+
},
|
|
638
|
+
TEZOS_MAX_TX_QUERIES: {
|
|
639
|
+
def: 100,
|
|
640
|
+
parser: intParser,
|
|
641
|
+
desc: "safe max on maximum number of queries to synchronize a tezos account"
|
|
642
|
+
},
|
|
643
|
+
PLATFORM_DEBUG: {
|
|
644
|
+
def: false,
|
|
645
|
+
parser: boolParser,
|
|
646
|
+
desc: "enable visibility of debug apps and tools in Platform Catalog"
|
|
647
|
+
},
|
|
648
|
+
PLATFORM_EXPERIMENTAL_APPS: {
|
|
649
|
+
def: false,
|
|
650
|
+
parser: boolParser,
|
|
651
|
+
desc: "enable visibility of experimental apps and tools in Platform Catalog"
|
|
652
|
+
},
|
|
653
|
+
PLATFORM_MANIFEST_API_URL: {
|
|
654
|
+
def: "https://live-app-catalog.ledger.com/api/v1/apps",
|
|
655
|
+
parser: stringParser,
|
|
656
|
+
desc: "url used to fetch platform app manifests"
|
|
657
|
+
},
|
|
658
|
+
PLATFORM_LOCAL_MANIFEST_JSON: {
|
|
659
|
+
def: "",
|
|
660
|
+
parser: stringParser,
|
|
661
|
+
desc: 'json manifest for a local (test) platform app manifests. How to use: PLATFORM_LOCAL_MANIFEST_JSON="$(cat /path/to/file.json)"'
|
|
662
|
+
},
|
|
663
|
+
PLATFORM_GLOBAL_CATALOG_API_URL: {
|
|
664
|
+
def: "https://cdn.live.ledger.com/platform/catalog/v1/data.json",
|
|
665
|
+
parser: stringParser,
|
|
666
|
+
desc: "url used to fetch platform app manifests"
|
|
667
|
+
},
|
|
668
|
+
PLATFORM_GLOBAL_CATALOG_STAGING_API_URL: {
|
|
669
|
+
def: "https://cdn.live.ledger-stg.com/platform/catalog/v1/data.json",
|
|
670
|
+
parser: stringParser,
|
|
671
|
+
desc: "url used to fetch platform app manifests (staging)"
|
|
672
|
+
},
|
|
673
|
+
PLATFORM_RAMP_CATALOG_API_URL: {
|
|
674
|
+
def: "https://cdn.live.ledger.com/platform/trade/v1/data.json",
|
|
675
|
+
parser: stringParser,
|
|
676
|
+
desc: "url used to fetch platform app manifests"
|
|
677
|
+
},
|
|
678
|
+
PLATFORM_RAMP_CATALOG_STAGING_API_URL: {
|
|
679
|
+
def: "https://cdn.live.ledger-stg.com/platform/trade/v1/data.json",
|
|
680
|
+
parser: stringParser,
|
|
681
|
+
desc: "url used to fetch platform app manifests (staging)"
|
|
682
|
+
},
|
|
683
|
+
PLATFORM_API_URL: {
|
|
684
|
+
def: "",
|
|
685
|
+
parser: stringParser,
|
|
686
|
+
desc: "url used to fetch platform catalog"
|
|
687
|
+
},
|
|
688
|
+
PLATFORM_API_VERSION: {
|
|
689
|
+
def: 1,
|
|
690
|
+
parser: intParser,
|
|
691
|
+
desc: "version used for the platform api"
|
|
692
|
+
},
|
|
693
|
+
PLATFORM_DISCOVER_VERSION: {
|
|
694
|
+
def: 1,
|
|
695
|
+
parser: intParser,
|
|
696
|
+
desc: "version used for the descover screen"
|
|
697
|
+
},
|
|
698
|
+
PLAYWRIGHT_RUN: {
|
|
699
|
+
def: false,
|
|
700
|
+
parser: boolParser,
|
|
701
|
+
desc: "true when launched for E2E testing"
|
|
702
|
+
},
|
|
703
|
+
MARKET_API_URL: {
|
|
704
|
+
def: "https://proxycg.api.live.ledger.com/api/v3",
|
|
705
|
+
parser: stringParser,
|
|
706
|
+
desc: "Market data api"
|
|
707
|
+
},
|
|
708
|
+
USE_LEARN_STAGING_URL: {
|
|
709
|
+
def: false,
|
|
710
|
+
parser: boolParser,
|
|
711
|
+
desc: "use the staging URL for the learn page"
|
|
712
|
+
},
|
|
713
|
+
DYNAMIC_CAL_BASE_URL: {
|
|
714
|
+
def: "https://cdn.live.ledger.com/cryptoassets",
|
|
715
|
+
parser: stringParser,
|
|
716
|
+
desc: "bucket S3 of the dynamic cryptoassets list"
|
|
717
|
+
},
|
|
718
|
+
FEATURE_FLAGS: {
|
|
719
|
+
def: "{}",
|
|
720
|
+
parser: jsonParser,
|
|
721
|
+
desc: "key value map for feature flags: {[key in FeatureId]?: Feature]}"
|
|
722
|
+
},
|
|
723
|
+
PERFORMANCE_CONSOLE: {
|
|
724
|
+
def: false,
|
|
725
|
+
parser: boolParser,
|
|
726
|
+
desc: "Show a performance overlay on the app UI"
|
|
727
|
+
},
|
|
728
|
+
ETHEREUM_STUCK_TRANSACTION_TIMEOUT: {
|
|
729
|
+
def: 5 * 60 * 1000,
|
|
730
|
+
parser: intParser,
|
|
731
|
+
desc: "Time after which an optimisc operation is considered stuck"
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
var getDefinition = function (name) {
|
|
735
|
+
return envDefinitions[name];
|
|
736
|
+
};
|
|
737
|
+
exports.getDefinition = getDefinition;
|
|
738
|
+
envDefinitions;
|
|
739
|
+
var defaults = (0, mapValues_1["default"])(envDefinitions, function (o) { return o.def; });
|
|
740
|
+
// private local state
|
|
741
|
+
var env = __assign({}, defaults);
|
|
742
|
+
var getAllEnvNames = function () {
|
|
743
|
+
return Object.keys(envDefinitions);
|
|
744
|
+
};
|
|
745
|
+
exports.getAllEnvNames = getAllEnvNames;
|
|
746
|
+
var getAllEnvs = function () { return (__assign({}, env)); };
|
|
747
|
+
exports.getAllEnvs = getAllEnvs;
|
|
748
|
+
// Usage: you must use getEnv at runtime because the env might be settled over time. typically will allow us to dynamically change them on the interface (e.g. some sort of experimental flags system)
|
|
749
|
+
var getEnv = function (name) {
|
|
750
|
+
return env[name];
|
|
751
|
+
};
|
|
752
|
+
exports.getEnv = getEnv;
|
|
753
|
+
var getEnvDefault = function (name) { return defaults[name]; };
|
|
754
|
+
exports.getEnvDefault = getEnvDefault;
|
|
755
|
+
var isEnvDefault = function (name) {
|
|
756
|
+
return env[name] === defaults[name];
|
|
757
|
+
};
|
|
758
|
+
exports.isEnvDefault = isEnvDefault;
|
|
759
|
+
var getEnvDesc = function (name) {
|
|
760
|
+
return envDefinitions[name].desc;
|
|
761
|
+
};
|
|
762
|
+
exports.getEnvDesc = getEnvDesc;
|
|
763
|
+
exports.changes = new rxjs_1.Subject();
|
|
764
|
+
// change one environment
|
|
765
|
+
var setEnv = function (name, value) {
|
|
766
|
+
var oldValue = env[name];
|
|
767
|
+
if (oldValue !== value) {
|
|
768
|
+
env[name] = value;
|
|
769
|
+
exports.changes.next({
|
|
770
|
+
name: name,
|
|
771
|
+
value: value,
|
|
772
|
+
oldValue: oldValue
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
exports.setEnv = setEnv;
|
|
777
|
+
// change one environment with safety. returns true if it succeed
|
|
778
|
+
var setEnvUnsafe = function (name, unsafeValue) {
|
|
779
|
+
var definition = (0, exports.getDefinition)(name);
|
|
780
|
+
if (!definition)
|
|
781
|
+
return false;
|
|
782
|
+
var parser = definition.parser;
|
|
783
|
+
var value = parser(unsafeValue);
|
|
784
|
+
if (value === undefined || value === null) {
|
|
785
|
+
console.warn("Invalid ENV value for ".concat(name));
|
|
786
|
+
return false;
|
|
787
|
+
}
|
|
788
|
+
// $FlowFixMe flow don't seem to type proof it
|
|
789
|
+
(0, exports.setEnv)(name, value);
|
|
790
|
+
return true;
|
|
791
|
+
};
|
|
792
|
+
exports.setEnvUnsafe = setEnvUnsafe;
|
|
793
|
+
//# sourceMappingURL=env.js.map
|