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