@ledgerhq/live-env 0.1.0 → 0.2.0-next.0

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