@ledgerhq/live-env 0.1.1-nightly.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 +7 -1
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +175 -193
- 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 +173 -191
- package/lib-es/env.js.map +1 -1
- package/package.json +2 -3
- package/src/env.ts +10 -5
- package/tsconfig.json +2 -8
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
|
|
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
|
-
|
|
8
|
+
const mapValues_1 = __importDefault(require("lodash/mapValues"));
|
|
20
9
|
// set and get environment & config variables
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
15
|
+
const floatParser = (v) => {
|
|
27
16
|
if (!Number.isNaN(v))
|
|
28
17
|
return parseFloat(v);
|
|
29
18
|
};
|
|
30
|
-
|
|
19
|
+
const boolParser = (v) => {
|
|
31
20
|
if (typeof v === "boolean")
|
|
32
21
|
return v;
|
|
33
22
|
return !(v === "0" || v === "false");
|
|
34
23
|
};
|
|
35
|
-
|
|
36
|
-
|
|
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,451 +32,451 @@ var jsonParser = function (v) {
|
|
|
45
32
|
return undefined;
|
|
46
33
|
}
|
|
47
34
|
};
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
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.",
|
|
443
430
|
},
|
|
444
431
|
LIST_APPS_V2: {
|
|
445
432
|
def: false,
|
|
446
433
|
parser: boolParser,
|
|
447
|
-
desc: "use new version of list apps for My Ledger"
|
|
434
|
+
desc: "use new version of list apps for My Ledger",
|
|
448
435
|
},
|
|
449
436
|
MANAGER_API_BASE: {
|
|
450
437
|
def: "https://manager.api.live.ledger.com/api",
|
|
451
438
|
parser: stringParser,
|
|
452
|
-
desc: "Ledger Manager API"
|
|
439
|
+
desc: "Ledger Manager API",
|
|
453
440
|
},
|
|
454
441
|
MANAGER_DEV_MODE: {
|
|
455
442
|
def: false,
|
|
456
443
|
parser: boolParser,
|
|
457
|
-
desc: "enable visibility of utility apps in Manager"
|
|
444
|
+
desc: "enable visibility of utility apps in Manager",
|
|
458
445
|
},
|
|
459
446
|
MANAGER_INSTALL_DELAY: {
|
|
460
447
|
def: 1000,
|
|
461
448
|
parser: intParser,
|
|
462
|
-
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",
|
|
463
450
|
},
|
|
464
451
|
MAX_ACCOUNT_NAME_SIZE: {
|
|
465
452
|
def: 50,
|
|
466
453
|
parser: intParser,
|
|
467
|
-
desc: "maximum size of account names"
|
|
454
|
+
desc: "maximum size of account names",
|
|
468
455
|
},
|
|
469
456
|
MOCK: {
|
|
470
457
|
def: "",
|
|
471
458
|
parser: stringParser,
|
|
472
|
-
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.",
|
|
473
460
|
},
|
|
474
461
|
MOCK_COUNTERVALUES: {
|
|
475
462
|
def: "",
|
|
476
463
|
parser: stringParser,
|
|
477
|
-
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",
|
|
478
465
|
},
|
|
479
466
|
MOCK_SWAP_KYC: {
|
|
480
467
|
def: "",
|
|
481
468
|
parser: stringParser,
|
|
482
|
-
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'.",
|
|
483
470
|
},
|
|
484
471
|
MOCK_SWAP_CHECK_QUOTE: {
|
|
485
472
|
def: "",
|
|
486
473
|
parser: stringParser,
|
|
487
|
-
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'.",
|
|
488
475
|
},
|
|
489
476
|
MOCK_SWAP_WIDGET_BASE_URL: {
|
|
490
477
|
def: "",
|
|
491
478
|
parser: stringParser,
|
|
492
|
-
desc: "mock the FTX swap widget base url"
|
|
479
|
+
desc: "mock the FTX swap widget base url",
|
|
493
480
|
},
|
|
494
481
|
/**
|
|
495
482
|
* Note: the mocked cryptoassets config and test partner are signed with the
|
|
@@ -498,291 +485,286 @@ var envDefinitions = {
|
|
|
498
485
|
MOCK_EXCHANGE_TEST_CONFIG: {
|
|
499
486
|
def: false,
|
|
500
487
|
parser: boolParser,
|
|
501
|
-
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)",
|
|
502
489
|
},
|
|
503
490
|
MOCK_REMOTE_LIVE_MANIFEST: {
|
|
504
491
|
def: "",
|
|
505
492
|
parser: stringParser,
|
|
506
|
-
desc: "mock remote live app manifest"
|
|
493
|
+
desc: "mock remote live app manifest",
|
|
507
494
|
},
|
|
508
495
|
MOCK_OS_VERSION: {
|
|
509
496
|
def: "",
|
|
510
497
|
parser: stringParser,
|
|
511
|
-
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",
|
|
512
499
|
},
|
|
513
500
|
NFT_CURRENCIES: {
|
|
514
501
|
def: "ethereum,polygon",
|
|
515
502
|
parser: stringParser,
|
|
516
|
-
desc: "set the currencies where NFT is active"
|
|
503
|
+
desc: "set the currencies where NFT is active",
|
|
517
504
|
},
|
|
518
505
|
NFT_ETH_METADATA_SERVICE: {
|
|
519
506
|
def: "https://nft.api.live.ledger.com",
|
|
520
507
|
parser: stringParser,
|
|
521
|
-
desc: "service uri used to get the metadata of an nft"
|
|
508
|
+
desc: "service uri used to get the metadata of an nft",
|
|
522
509
|
},
|
|
523
510
|
OPERATION_ADDRESSES_LIMIT: {
|
|
524
511
|
def: 100,
|
|
525
512
|
parser: intParser,
|
|
526
|
-
desc: "limit the number of addresses in from/to of operations"
|
|
513
|
+
desc: "limit the number of addresses in from/to of operations",
|
|
527
514
|
},
|
|
528
515
|
OPERATION_OPTIMISTIC_RETENTION: {
|
|
529
516
|
def: 30 * 60 * 1000,
|
|
530
517
|
parser: intParser,
|
|
531
|
-
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",
|
|
532
519
|
},
|
|
533
520
|
OPERATION_PAGE_SIZE_INITIAL: {
|
|
534
521
|
def: 100,
|
|
535
522
|
parser: intParser,
|
|
536
|
-
desc: "defines the initial default operation length page to use"
|
|
523
|
+
desc: "defines the initial default operation length page to use",
|
|
537
524
|
},
|
|
538
525
|
POLKADOT_ELECTION_STATUS_THRESHOLD: {
|
|
539
526
|
def: 25,
|
|
540
527
|
parser: intParser,
|
|
541
|
-
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",
|
|
542
529
|
},
|
|
543
530
|
SATSTACK: {
|
|
544
531
|
def: false,
|
|
545
532
|
parser: boolParser,
|
|
546
|
-
desc: "Switch to satstack mode"
|
|
533
|
+
desc: "Switch to satstack mode",
|
|
547
534
|
},
|
|
548
535
|
SCAN_FOR_INVALID_PATHS: {
|
|
549
536
|
def: false,
|
|
550
537
|
parser: boolParser,
|
|
551
|
-
desc: "enable searching accounts in exotic derivation paths"
|
|
538
|
+
desc: "enable searching accounts in exotic derivation paths",
|
|
552
539
|
},
|
|
553
540
|
SEED: {
|
|
554
541
|
def: "",
|
|
555
542
|
parser: stringParser,
|
|
556
|
-
desc: "(dev feature) seed to be used by speculos (device simulator)"
|
|
543
|
+
desc: "(dev feature) seed to be used by speculos (device simulator)",
|
|
557
544
|
},
|
|
558
545
|
SHOW_LEGACY_NEW_ACCOUNT: {
|
|
559
546
|
def: false,
|
|
560
547
|
parser: boolParser,
|
|
561
|
-
desc: "allow the creation of legacy accounts"
|
|
548
|
+
desc: "allow the creation of legacy accounts",
|
|
562
549
|
},
|
|
563
550
|
SKIP_ONBOARDING: {
|
|
564
551
|
def: false,
|
|
565
552
|
parser: boolParser,
|
|
566
|
-
desc: "dev flag to skip onboarding flow"
|
|
553
|
+
desc: "dev flag to skip onboarding flow",
|
|
567
554
|
},
|
|
568
555
|
SPECULOS_PID_OFFSET: {
|
|
569
556
|
def: 0,
|
|
570
557
|
parser: intParser,
|
|
571
|
-
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",
|
|
572
559
|
},
|
|
573
560
|
SWAP_API_BASE: {
|
|
574
561
|
def: "https://swap.ledger.com/v4",
|
|
575
562
|
parser: stringParser,
|
|
576
|
-
desc: "Swap API base"
|
|
563
|
+
desc: "Swap API base",
|
|
577
564
|
},
|
|
578
565
|
SYNC_ALL_INTERVAL: {
|
|
579
566
|
def: 8 * 60 * 1000,
|
|
580
567
|
parser: intParser,
|
|
581
|
-
desc: "delay between successive sync"
|
|
568
|
+
desc: "delay between successive sync",
|
|
582
569
|
},
|
|
583
570
|
SYNC_BOOT_DELAY: {
|
|
584
571
|
def: 2 * 1000,
|
|
585
572
|
parser: intParser,
|
|
586
|
-
desc: "delay before the sync starts"
|
|
573
|
+
desc: "delay before the sync starts",
|
|
587
574
|
},
|
|
588
575
|
SYNC_PENDING_INTERVAL: {
|
|
589
576
|
def: 10 * 1000,
|
|
590
577
|
parser: intParser,
|
|
591
|
-
desc: "delay between sync when an operation is still pending"
|
|
578
|
+
desc: "delay between sync when an operation is still pending",
|
|
592
579
|
},
|
|
593
580
|
SYNC_OUTDATED_CONSIDERED_DELAY: {
|
|
594
581
|
def: 10 * 60 * 1000,
|
|
595
582
|
parser: intParser,
|
|
596
|
-
desc: "delay until Live consider a sync outdated"
|
|
583
|
+
desc: "delay until Live consider a sync outdated",
|
|
597
584
|
},
|
|
598
585
|
SYNC_MAX_CONCURRENT: {
|
|
599
586
|
def: 4,
|
|
600
587
|
parser: intParser,
|
|
601
|
-
desc: "maximum limit to synchronize accounts concurrently to limit overload"
|
|
588
|
+
desc: "maximum limit to synchronize accounts concurrently to limit overload",
|
|
602
589
|
},
|
|
603
590
|
BOT_MAX_CONCURRENT: {
|
|
604
591
|
def: 10,
|
|
605
592
|
parser: intParser,
|
|
606
|
-
desc: "maximum limit to run bot spec in parallel"
|
|
593
|
+
desc: "maximum limit to run bot spec in parallel",
|
|
607
594
|
},
|
|
608
595
|
USER_ID: {
|
|
609
596
|
def: "",
|
|
610
597
|
parser: stringParser,
|
|
611
|
-
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).",
|
|
612
599
|
},
|
|
613
600
|
WALLETCONNECT: {
|
|
614
601
|
def: false,
|
|
615
602
|
parser: boolParser,
|
|
616
|
-
desc: "is walletconnect enabled"
|
|
603
|
+
desc: "is walletconnect enabled",
|
|
617
604
|
},
|
|
618
605
|
WITH_DEVICE_POLLING_DELAY: {
|
|
619
606
|
def: 500,
|
|
620
607
|
parser: floatParser,
|
|
621
|
-
desc: "delay when polling device"
|
|
608
|
+
desc: "delay when polling device",
|
|
622
609
|
},
|
|
623
610
|
ANNOUNCEMENTS_API_URL: {
|
|
624
611
|
def: "https://cdn.live.ledger.com/announcements",
|
|
625
612
|
parser: stringParser,
|
|
626
|
-
desc: "url used to fetch new announcements"
|
|
613
|
+
desc: "url used to fetch new announcements",
|
|
627
614
|
},
|
|
628
615
|
ANNOUNCEMENTS_API_VERSION: {
|
|
629
616
|
def: 1,
|
|
630
617
|
parser: intParser,
|
|
631
|
-
desc: "version used for the announcements api"
|
|
618
|
+
desc: "version used for the announcements api",
|
|
632
619
|
},
|
|
633
620
|
STATUS_API_URL: {
|
|
634
621
|
def: "https://ledger.statuspage.io/api",
|
|
635
622
|
parser: stringParser,
|
|
636
|
-
desc: "url used to fetch ledger status"
|
|
623
|
+
desc: "url used to fetch ledger status",
|
|
637
624
|
},
|
|
638
625
|
STATUS_API_VERSION: {
|
|
639
626
|
def: 2,
|
|
640
627
|
parser: intParser,
|
|
641
|
-
desc: "version used for ledger status api"
|
|
628
|
+
desc: "version used for ledger status api",
|
|
642
629
|
},
|
|
643
630
|
TEZOS_MAX_TX_QUERIES: {
|
|
644
631
|
def: 100,
|
|
645
632
|
parser: intParser,
|
|
646
|
-
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",
|
|
647
634
|
},
|
|
648
635
|
PLATFORM_DEBUG: {
|
|
649
636
|
def: false,
|
|
650
637
|
parser: boolParser,
|
|
651
|
-
desc: "enable visibility of debug apps and tools in Platform Catalog"
|
|
638
|
+
desc: "enable visibility of debug apps and tools in Platform Catalog",
|
|
652
639
|
},
|
|
653
640
|
PLATFORM_EXPERIMENTAL_APPS: {
|
|
654
641
|
def: false,
|
|
655
642
|
parser: boolParser,
|
|
656
|
-
desc: "enable visibility of experimental apps and tools in Platform Catalog"
|
|
643
|
+
desc: "enable visibility of experimental apps and tools in Platform Catalog",
|
|
657
644
|
},
|
|
658
645
|
PLATFORM_MANIFEST_API_URL: {
|
|
659
646
|
def: "https://live-app-catalog.ledger.com/api/v1/apps",
|
|
660
647
|
parser: stringParser,
|
|
661
|
-
desc: "url used to fetch platform app manifests"
|
|
648
|
+
desc: "url used to fetch platform app manifests",
|
|
662
649
|
},
|
|
663
650
|
PLATFORM_LOCAL_MANIFEST_JSON: {
|
|
664
651
|
def: "",
|
|
665
652
|
parser: stringParser,
|
|
666
|
-
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)"',
|
|
667
654
|
},
|
|
668
655
|
PLATFORM_GLOBAL_CATALOG_API_URL: {
|
|
669
656
|
def: "https://cdn.live.ledger.com/platform/catalog/v1/data.json",
|
|
670
657
|
parser: stringParser,
|
|
671
|
-
desc: "url used to fetch platform app manifests"
|
|
658
|
+
desc: "url used to fetch platform app manifests",
|
|
672
659
|
},
|
|
673
660
|
PLATFORM_GLOBAL_CATALOG_STAGING_API_URL: {
|
|
674
661
|
def: "https://cdn.live.ledger-stg.com/platform/catalog/v1/data.json",
|
|
675
662
|
parser: stringParser,
|
|
676
|
-
desc: "url used to fetch platform app manifests (staging)"
|
|
663
|
+
desc: "url used to fetch platform app manifests (staging)",
|
|
677
664
|
},
|
|
678
665
|
PLATFORM_RAMP_CATALOG_API_URL: {
|
|
679
666
|
def: "https://cdn.live.ledger.com/platform/trade/v1/data.json",
|
|
680
667
|
parser: stringParser,
|
|
681
|
-
desc: "url used to fetch platform app manifests"
|
|
668
|
+
desc: "url used to fetch platform app manifests",
|
|
682
669
|
},
|
|
683
670
|
PLATFORM_RAMP_CATALOG_STAGING_API_URL: {
|
|
684
671
|
def: "https://cdn.live.ledger-stg.com/platform/trade/v1/data.json",
|
|
685
672
|
parser: stringParser,
|
|
686
|
-
desc: "url used to fetch platform app manifests (staging)"
|
|
673
|
+
desc: "url used to fetch platform app manifests (staging)",
|
|
687
674
|
},
|
|
688
675
|
PLATFORM_API_URL: {
|
|
689
676
|
def: "",
|
|
690
677
|
parser: stringParser,
|
|
691
|
-
desc: "url used to fetch platform catalog"
|
|
678
|
+
desc: "url used to fetch platform catalog",
|
|
692
679
|
},
|
|
693
680
|
PLATFORM_API_VERSION: {
|
|
694
681
|
def: 1,
|
|
695
682
|
parser: intParser,
|
|
696
|
-
desc: "version used for the platform api"
|
|
683
|
+
desc: "version used for the platform api",
|
|
697
684
|
},
|
|
698
685
|
PLAYWRIGHT_RUN: {
|
|
699
686
|
def: false,
|
|
700
687
|
parser: boolParser,
|
|
701
|
-
desc: "true when launched for E2E testing"
|
|
688
|
+
desc: "true when launched for E2E testing",
|
|
702
689
|
},
|
|
703
690
|
MARKET_API_URL: {
|
|
704
691
|
def: "https://proxycg.api.live.ledger.com/api/v3",
|
|
705
692
|
parser: stringParser,
|
|
706
|
-
desc: "Market data api"
|
|
693
|
+
desc: "Market data api",
|
|
707
694
|
},
|
|
708
695
|
USE_LEARN_STAGING_URL: {
|
|
709
696
|
def: false,
|
|
710
697
|
parser: boolParser,
|
|
711
|
-
desc: "use the staging URL for the learn page"
|
|
698
|
+
desc: "use the staging URL for the learn page",
|
|
712
699
|
},
|
|
713
700
|
DYNAMIC_CAL_BASE_URL: {
|
|
714
701
|
def: "https://cdn.live.ledger.com/cryptoassets",
|
|
715
702
|
parser: stringParser,
|
|
716
|
-
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",
|
|
717
709
|
},
|
|
718
710
|
FEATURE_FLAGS: {
|
|
719
711
|
def: "{}",
|
|
720
712
|
parser: jsonParser,
|
|
721
|
-
desc: "key value map for feature flags: {[key in FeatureId]?: Feature]}"
|
|
713
|
+
desc: "key value map for feature flags: {[key in FeatureId]?: Feature]}",
|
|
722
714
|
},
|
|
723
715
|
PERFORMANCE_CONSOLE: {
|
|
724
716
|
def: false,
|
|
725
717
|
parser: boolParser,
|
|
726
|
-
desc: "Show a performance overlay on the app UI"
|
|
718
|
+
desc: "Show a performance overlay on the app UI",
|
|
727
719
|
},
|
|
728
720
|
ETHEREUM_STUCK_TRANSACTION_TIMEOUT: {
|
|
729
721
|
def: 5 * 60 * 1000,
|
|
730
722
|
parser: intParser,
|
|
731
|
-
desc: "Time after which an optimisc operation is considered stuck"
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
var getDefinition = function (name) {
|
|
735
|
-
return envDefinitions[name];
|
|
723
|
+
desc: "Time after which an optimisc operation is considered stuck",
|
|
724
|
+
},
|
|
736
725
|
};
|
|
726
|
+
const getDefinition = (name) => envDefinitions[name];
|
|
737
727
|
exports.getDefinition = getDefinition;
|
|
738
728
|
envDefinitions;
|
|
739
|
-
|
|
729
|
+
const defaults = (0, mapValues_1.default)(envDefinitions, (o) => o.def);
|
|
740
730
|
// private local state
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
return Object.keys(envDefinitions);
|
|
744
|
-
};
|
|
731
|
+
const env = Object.assign({}, defaults);
|
|
732
|
+
const getAllEnvNames = () => Object.keys(envDefinitions);
|
|
745
733
|
exports.getAllEnvNames = getAllEnvNames;
|
|
746
|
-
|
|
734
|
+
const getAllEnvs = () => (Object.assign({}, env));
|
|
747
735
|
exports.getAllEnvs = getAllEnvs;
|
|
748
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)
|
|
749
|
-
|
|
750
|
-
return env[name];
|
|
751
|
-
};
|
|
737
|
+
const getEnv = (name) => env[name];
|
|
752
738
|
exports.getEnv = getEnv;
|
|
753
|
-
|
|
739
|
+
const getEnvDefault = (name) => defaults[name];
|
|
754
740
|
exports.getEnvDefault = getEnvDefault;
|
|
755
|
-
|
|
756
|
-
return env[name] === defaults[name];
|
|
757
|
-
};
|
|
741
|
+
const isEnvDefault = (name) => env[name] === defaults[name];
|
|
758
742
|
exports.isEnvDefault = isEnvDefault;
|
|
759
|
-
|
|
760
|
-
return envDefinitions[name].desc;
|
|
761
|
-
};
|
|
743
|
+
const getEnvDesc = (name) => envDefinitions[name].desc;
|
|
762
744
|
exports.getEnvDesc = getEnvDesc;
|
|
763
745
|
exports.changes = new rxjs_1.Subject();
|
|
764
746
|
// change one environment
|
|
765
|
-
|
|
766
|
-
|
|
747
|
+
const setEnv = (name, value) => {
|
|
748
|
+
const oldValue = env[name];
|
|
767
749
|
if (oldValue !== value) {
|
|
768
750
|
env[name] = value;
|
|
769
751
|
exports.changes.next({
|
|
770
|
-
name
|
|
771
|
-
value
|
|
772
|
-
oldValue
|
|
752
|
+
name,
|
|
753
|
+
value,
|
|
754
|
+
oldValue,
|
|
773
755
|
});
|
|
774
756
|
}
|
|
775
757
|
};
|
|
776
758
|
exports.setEnv = setEnv;
|
|
777
759
|
// change one environment with safety. returns true if it succeed
|
|
778
|
-
|
|
779
|
-
|
|
760
|
+
const setEnvUnsafe = (name, unsafeValue) => {
|
|
761
|
+
const definition = (0, exports.getDefinition)(name);
|
|
780
762
|
if (!definition)
|
|
781
763
|
return false;
|
|
782
|
-
|
|
783
|
-
|
|
764
|
+
const { parser } = definition;
|
|
765
|
+
const value = parser(unsafeValue);
|
|
784
766
|
if (value === undefined || value === null) {
|
|
785
|
-
console.warn(
|
|
767
|
+
console.warn(`Invalid ENV value for ${name}`);
|
|
786
768
|
return false;
|
|
787
769
|
}
|
|
788
770
|
// $FlowFixMe flow don't seem to type proof it
|