@ledgerhq/live-common 34.51.0-nightly.5 → 34.51.0-nightly.7
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/dada-client/state-manager/api.d.ts.map +1 -1
- package/lib/dada-client/state-manager/api.js +10 -5
- package/lib/dada-client/state-manager/api.js.map +1 -1
- package/lib/dada-client/state-manager/types.d.ts +1 -0
- package/lib/dada-client/state-manager/types.d.ts.map +1 -1
- package/lib/device/use-cases/getAppsCatalogForDevice.d.ts +1 -1
- package/lib/device/use-cases/getAppsCatalogForDevice.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +2 -4
- package/lib/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib/e2e/enum/Device.d.ts +5 -4
- package/lib/e2e/enum/Device.d.ts.map +1 -1
- package/lib/e2e/enum/Device.js +6 -4
- package/lib/e2e/enum/Device.js.map +1 -1
- package/lib/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib/e2e/families/bitcoin.js +4 -3
- package/lib/e2e/families/bitcoin.js.map +1 -1
- package/lib/e2e/families/cardano.js +2 -2
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +3 -2
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +2 -5
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +2 -1
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/index.d.ts +2 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +53 -60
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosAppVersion.d.ts +7 -0
- package/lib/e2e/speculosAppVersion.d.ts.map +1 -0
- package/lib/e2e/speculosAppVersion.js +104 -0
- package/lib/e2e/speculosAppVersion.js.map +1 -0
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/usePickDefaultAccount.js +1 -1
- package/lib/exchange/swap/hooks/usePickDefaultAccount.js.map +1 -1
- package/lib/exchange/swap/hooks/useSwapTransaction.d.ts +3 -2
- package/lib/exchange/swap/hooks/useSwapTransaction.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/useSwapTransaction.js +14 -9
- package/lib/exchange/swap/hooks/useSwapTransaction.js.map +1 -1
- package/lib/exchange/swap/transactionStrategies.d.ts +2 -1
- package/lib/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib/exchange/swap/transactionStrategies.js +3 -1
- package/lib/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib/exchange/swap/types.d.ts +1 -0
- package/lib/exchange/swap/types.d.ts.map +1 -1
- package/lib/families/evm/walletApiAdapter.d.ts.map +1 -1
- package/lib/families/evm/walletApiAdapter.js +5 -0
- package/lib/families/evm/walletApiAdapter.js.map +1 -1
- package/lib/load/speculos.d.ts.map +1 -1
- package/lib/load/speculos.js +1 -0
- package/lib/load/speculos.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts +1 -0
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +5 -2
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +5 -1
- package/lib/wallet-api/react.js.map +1 -1
- package/lib-es/dada-client/state-manager/api.d.ts.map +1 -1
- package/lib-es/dada-client/state-manager/api.js +10 -5
- package/lib-es/dada-client/state-manager/api.js.map +1 -1
- package/lib-es/dada-client/state-manager/types.d.ts +1 -0
- package/lib-es/dada-client/state-manager/types.d.ts.map +1 -1
- package/lib-es/device/use-cases/getAppsCatalogForDevice.d.ts +1 -1
- package/lib-es/device/use-cases/getAppsCatalogForDevice.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.js +2 -4
- package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib-es/e2e/enum/Device.d.ts +5 -4
- package/lib-es/e2e/enum/Device.d.ts.map +1 -1
- package/lib-es/e2e/enum/Device.js +6 -4
- package/lib-es/e2e/enum/Device.js.map +1 -1
- package/lib-es/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib-es/e2e/families/bitcoin.js +4 -3
- package/lib-es/e2e/families/bitcoin.js.map +1 -1
- package/lib-es/e2e/families/cardano.js +2 -2
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +3 -2
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +3 -6
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +2 -1
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/index.d.ts +2 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +19 -25
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosAppVersion.d.ts +7 -0
- package/lib-es/e2e/speculosAppVersion.d.ts.map +1 -0
- package/lib-es/e2e/speculosAppVersion.js +74 -0
- package/lib-es/e2e/speculosAppVersion.js.map +1 -0
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/usePickDefaultAccount.js +2 -2
- package/lib-es/exchange/swap/hooks/usePickDefaultAccount.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useSwapTransaction.d.ts +3 -2
- package/lib-es/exchange/swap/hooks/useSwapTransaction.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/useSwapTransaction.js +14 -9
- package/lib-es/exchange/swap/hooks/useSwapTransaction.js.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.d.ts +2 -1
- package/lib-es/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.js +3 -1
- package/lib-es/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib-es/exchange/swap/types.d.ts +1 -0
- package/lib-es/exchange/swap/types.d.ts.map +1 -1
- package/lib-es/families/evm/walletApiAdapter.d.ts.map +1 -1
- package/lib-es/families/evm/walletApiAdapter.js +5 -0
- package/lib-es/families/evm/walletApiAdapter.js.map +1 -1
- package/lib-es/load/speculos.d.ts.map +1 -1
- package/lib-es/load/speculos.js +1 -0
- package/lib-es/load/speculos.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts +1 -0
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +5 -2
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +5 -1
- package/lib-es/wallet-api/react.js.map +1 -1
- package/package.json +73 -73
- package/src/dada-client/state-manager/api.ts +10 -5
- package/src/dada-client/state-manager/types.ts +1 -0
- package/src/e2e/data/deviceLabelsData.ts +2 -4
- package/src/e2e/enum/Device.ts +7 -4
- package/src/e2e/families/bitcoin.ts +4 -9
- package/src/e2e/families/cardano.ts +2 -2
- package/src/e2e/families/evm.ts +3 -8
- package/src/e2e/families/solana.ts +2 -7
- package/src/e2e/families/tezos.ts +2 -7
- package/src/e2e/speculos.ts +22 -27
- package/src/e2e/speculosAppVersion.ts +86 -0
- package/src/exchange/swap/hooks/usePickDefaultAccount.ts +2 -2
- package/src/exchange/swap/hooks/useSwapTransaction.ts +20 -7
- package/src/exchange/swap/transactionStrategies.ts +4 -0
- package/src/exchange/swap/types.ts +1 -0
- package/src/families/evm/walletApiAdapter.ts +6 -0
- package/src/load/speculos.ts +1 -0
- package/src/wallet-api/Exchange/server.ts +12 -3
- package/src/wallet-api/react.ts +7 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-common",
|
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
|
4
|
-
"version": "34.51.0-nightly.
|
|
4
|
+
"version": "34.51.0-nightly.7",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
"@dfinity/principal": "^0.15.6",
|
|
109
109
|
"@ledgerhq/device-management-kit": "0.9.1",
|
|
110
110
|
"@ledgerhq/live-app-sdk": "^0.8.1",
|
|
111
|
-
"@ledgerhq/wallet-api-client": "^1.12.
|
|
112
|
-
"@ledgerhq/wallet-api-core": "^1.24.
|
|
113
|
-
"@ledgerhq/wallet-api-server": "^1.13.
|
|
111
|
+
"@ledgerhq/wallet-api-client": "^1.12.2",
|
|
112
|
+
"@ledgerhq/wallet-api-core": "^1.24.2",
|
|
113
|
+
"@ledgerhq/wallet-api-server": "^1.13.2",
|
|
114
114
|
"@noble/curves": "^1.9.7",
|
|
115
115
|
"@noble/hashes": "1.8.0",
|
|
116
116
|
"@reduxjs/toolkit": "2.8.2",
|
|
@@ -166,79 +166,79 @@
|
|
|
166
166
|
"xstate": "^5.19.2",
|
|
167
167
|
"yargs": "^17.0.0",
|
|
168
168
|
"zod": "^3.22.4",
|
|
169
|
-
"@ledgerhq/coin-algorand": "^0.11.0-nightly.
|
|
170
|
-
"@ledgerhq/coin-aptos": "^3.4.0-nightly.
|
|
171
|
-
"@ledgerhq/coin-bitcoin": "^0.23.0-nightly.
|
|
172
|
-
"@ledgerhq/coin-canton": "^0.8.0-nightly.
|
|
173
|
-
"@ledgerhq/coin-cardano": "^0.13.0-nightly.
|
|
174
|
-
"@ledgerhq/coin-casper": "^2.2.0-nightly.
|
|
175
|
-
"@ledgerhq/coin-celo": "^1.6.0-nightly.
|
|
176
|
-
"@ledgerhq/coin-cosmos": "^0.18.0-nightly.
|
|
177
|
-
"@ledgerhq/coin-evm": "^2.33.0-nightly.
|
|
178
|
-
"@ledgerhq/coin-filecoin": "^1.13.0-nightly.
|
|
179
|
-
"@ledgerhq/coin-framework": "^6.7.0-nightly.
|
|
180
|
-
"@ledgerhq/coin-hedera": "^1.12.0-nightly.
|
|
181
|
-
"@ledgerhq/coin-icon": "^0.13.0-nightly.
|
|
182
|
-
"@ledgerhq/coin-internet_computer": "^1.9.0-nightly.
|
|
183
|
-
"@ledgerhq/coin-kaspa": "^1.3.0-nightly.
|
|
184
|
-
"@ledgerhq/coin-mina": "^1.3.0-nightly.
|
|
185
|
-
"@ledgerhq/coin-multiversx": "^0.6.0-nightly.
|
|
186
|
-
"@ledgerhq/coin-near": "^0.14.0-nightly.
|
|
187
|
-
"@ledgerhq/coin-polkadot": "^6.11.0-nightly.
|
|
188
|
-
"@ledgerhq/coin-solana": "^0.35.0-nightly.
|
|
189
|
-
"@ledgerhq/coin-stacks": "^0.10.0-nightly.
|
|
190
|
-
"@ledgerhq/coin-stellar": "^6.5.0-nightly.
|
|
191
|
-
"@ledgerhq/coin-
|
|
192
|
-
"@ledgerhq/coin-ton": "^0.15.0-nightly.
|
|
193
|
-
"@ledgerhq/coin-tron": "^5.5.0-nightly.
|
|
194
|
-
"@ledgerhq/coin-vechain": "^2.11.0-nightly.
|
|
195
|
-
"@ledgerhq/coin-
|
|
169
|
+
"@ledgerhq/coin-algorand": "^0.11.0-nightly.5",
|
|
170
|
+
"@ledgerhq/coin-aptos": "^3.4.0-nightly.5",
|
|
171
|
+
"@ledgerhq/coin-bitcoin": "^0.23.0-nightly.5",
|
|
172
|
+
"@ledgerhq/coin-canton": "^0.8.0-nightly.5",
|
|
173
|
+
"@ledgerhq/coin-cardano": "^0.13.0-nightly.5",
|
|
174
|
+
"@ledgerhq/coin-casper": "^2.2.0-nightly.5",
|
|
175
|
+
"@ledgerhq/coin-celo": "^1.6.0-nightly.5",
|
|
176
|
+
"@ledgerhq/coin-cosmos": "^0.18.0-nightly.5",
|
|
177
|
+
"@ledgerhq/coin-evm": "^2.33.0-nightly.5",
|
|
178
|
+
"@ledgerhq/coin-filecoin": "^1.13.0-nightly.5",
|
|
179
|
+
"@ledgerhq/coin-framework": "^6.7.0-nightly.5",
|
|
180
|
+
"@ledgerhq/coin-hedera": "^1.12.0-nightly.5",
|
|
181
|
+
"@ledgerhq/coin-icon": "^0.13.0-nightly.5",
|
|
182
|
+
"@ledgerhq/coin-internet_computer": "^1.9.0-nightly.5",
|
|
183
|
+
"@ledgerhq/coin-kaspa": "^1.3.0-nightly.5",
|
|
184
|
+
"@ledgerhq/coin-mina": "^1.3.0-nightly.5",
|
|
185
|
+
"@ledgerhq/coin-multiversx": "^0.6.0-nightly.5",
|
|
186
|
+
"@ledgerhq/coin-near": "^0.14.0-nightly.5",
|
|
187
|
+
"@ledgerhq/coin-polkadot": "^6.11.0-nightly.5",
|
|
188
|
+
"@ledgerhq/coin-solana": "^0.35.0-nightly.5",
|
|
189
|
+
"@ledgerhq/coin-stacks": "^0.10.0-nightly.5",
|
|
190
|
+
"@ledgerhq/coin-stellar": "^6.5.0-nightly.5",
|
|
191
|
+
"@ledgerhq/coin-tezos": "^6.7.0-nightly.5",
|
|
192
|
+
"@ledgerhq/coin-ton": "^0.15.0-nightly.5",
|
|
193
|
+
"@ledgerhq/coin-tron": "^5.5.0-nightly.5",
|
|
194
|
+
"@ledgerhq/coin-vechain": "^2.11.0-nightly.5",
|
|
195
|
+
"@ledgerhq/coin-sui": "^0.16.0-nightly.6",
|
|
196
|
+
"@ledgerhq/coin-xrp": "^7.6.0-nightly.5",
|
|
196
197
|
"@ledgerhq/crypto-icons-ui": "^1.21.0-nightly.1",
|
|
197
|
-
"@ledgerhq/cryptoassets": "^13.31.0-nightly.
|
|
198
|
-
"@ledgerhq/device-core": "^0.6.6-nightly.
|
|
199
|
-
"@ledgerhq/devices": "8.6.
|
|
200
|
-
"@ledgerhq/errors": "^6.
|
|
201
|
-
"@ledgerhq/hw-app-algorand": "^6.31.
|
|
202
|
-
"@ledgerhq/hw-app-aptos": "^6.34.
|
|
203
|
-
"@ledgerhq/hw-app-btc": "^10.11.
|
|
204
|
-
"@ledgerhq/hw-app-celo": "^6.35.1-nightly.
|
|
205
|
-
"@ledgerhq/hw-app-cosmos": "^6.32.
|
|
206
|
-
"@ledgerhq/hw-app-
|
|
207
|
-
"@ledgerhq/hw-app-
|
|
208
|
-
"@ledgerhq/hw-app-
|
|
209
|
-
"@ledgerhq/hw-app-
|
|
210
|
-
"@ledgerhq/hw-app-
|
|
211
|
-
"@ledgerhq/hw-app-
|
|
212
|
-
"@ledgerhq/hw-app-
|
|
198
|
+
"@ledgerhq/cryptoassets": "^13.31.0-nightly.5",
|
|
199
|
+
"@ledgerhq/device-core": "^0.6.6-nightly.4",
|
|
200
|
+
"@ledgerhq/devices": "8.6.2-nightly.0",
|
|
201
|
+
"@ledgerhq/errors": "^6.27.0-nightly.0",
|
|
202
|
+
"@ledgerhq/hw-app-algorand": "^6.31.9-nightly.0",
|
|
203
|
+
"@ledgerhq/hw-app-aptos": "^6.34.9-nightly.0",
|
|
204
|
+
"@ledgerhq/hw-app-btc": "^10.11.3-nightly.0",
|
|
205
|
+
"@ledgerhq/hw-app-celo": "^6.35.1-nightly.4",
|
|
206
|
+
"@ledgerhq/hw-app-cosmos": "^6.32.9-nightly.0",
|
|
207
|
+
"@ledgerhq/hw-app-hedera": "^1.2.9-nightly.0",
|
|
208
|
+
"@ledgerhq/hw-app-eth": "^6.46.1-nightly.4",
|
|
209
|
+
"@ledgerhq/hw-app-icon": "^1.3.9-nightly.0",
|
|
210
|
+
"@ledgerhq/hw-app-exchange": "^0.15.1-nightly.1",
|
|
211
|
+
"@ledgerhq/hw-app-kaspa": "^1.3.2-nightly.0",
|
|
212
|
+
"@ledgerhq/hw-app-multiversx": "^6.25.4-nightly.0",
|
|
213
|
+
"@ledgerhq/hw-app-polkadot": "^6.34.9-nightly.0",
|
|
214
|
+
"@ledgerhq/hw-app-near": "^6.31.9-nightly.0",
|
|
215
|
+
"@ledgerhq/hw-app-str": "^7.2.9-nightly.0",
|
|
216
|
+
"@ledgerhq/hw-app-tezos": "^6.31.9-nightly.0",
|
|
213
217
|
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
214
|
-
"@ledgerhq/
|
|
215
|
-
"@ledgerhq/hw-app-
|
|
216
|
-
"@ledgerhq/hw-app-
|
|
217
|
-
"@ledgerhq/hw-
|
|
218
|
-
"@ledgerhq/hw-
|
|
219
|
-
"@ledgerhq/
|
|
220
|
-
"@ledgerhq/
|
|
221
|
-
"@ledgerhq/hw-transport": "6.31.12",
|
|
222
|
-
"@ledgerhq/hw-transport-mocker": "^6.29.12",
|
|
223
|
-
"@ledgerhq/ledger-cal-service": "^1.7.0-nightly.0",
|
|
224
|
-
"@ledgerhq/ledger-trust-service": "^0.3.15-nightly.0",
|
|
218
|
+
"@ledgerhq/hw-app-trx": "^6.31.9-nightly.0",
|
|
219
|
+
"@ledgerhq/hw-app-vet": "^0.7.0-nightly.4",
|
|
220
|
+
"@ledgerhq/hw-app-xrp": "^6.32.7-nightly.0",
|
|
221
|
+
"@ledgerhq/hw-bolos": "^6.32.9-nightly.0",
|
|
222
|
+
"@ledgerhq/hw-transport-mocker": "^6.29.13-nightly.0",
|
|
223
|
+
"@ledgerhq/ledger-cal-service": "^1.7.0-nightly.2",
|
|
224
|
+
"@ledgerhq/ledger-trust-service": "^0.3.15-nightly.2",
|
|
225
225
|
"@ledgerhq/live-config": "^3.2.0",
|
|
226
|
-
"@ledgerhq/live-countervalues": "^0.8.0-nightly.
|
|
227
|
-
"@ledgerhq/live-countervalues-react": "^0.7.0-nightly.
|
|
228
|
-
"@ledgerhq/live-dmk-shared": "^0.14.0-nightly.
|
|
229
|
-
"@ledgerhq/live-env": "^2.19.0-nightly.
|
|
226
|
+
"@ledgerhq/live-countervalues": "^0.8.0-nightly.5",
|
|
227
|
+
"@ledgerhq/live-countervalues-react": "^0.7.0-nightly.5",
|
|
228
|
+
"@ledgerhq/live-dmk-shared": "^0.14.0-nightly.2",
|
|
229
|
+
"@ledgerhq/live-env": "^2.19.0-nightly.1",
|
|
230
230
|
"@ledgerhq/live-hooks": "0.2.0-nightly.0",
|
|
231
|
-
"@ledgerhq/live-network": "^2.0.20-nightly.
|
|
231
|
+
"@ledgerhq/live-network": "^2.0.20-nightly.2",
|
|
232
232
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
233
|
-
"@ledgerhq/live-signer-
|
|
234
|
-
"@ledgerhq/
|
|
235
|
-
"@ledgerhq/live-signer-solana": "^0.6.0-nightly.
|
|
236
|
-
"@ledgerhq/live-wallet": "^0.14.3-nightly.
|
|
233
|
+
"@ledgerhq/live-signer-canton": "^0.4.2-nightly.5",
|
|
234
|
+
"@ledgerhq/live-signer-evm": "^0.8.2-nightly.5",
|
|
235
|
+
"@ledgerhq/live-signer-solana": "^0.6.0-nightly.5",
|
|
236
|
+
"@ledgerhq/live-wallet": "^0.14.3-nightly.5",
|
|
237
237
|
"@ledgerhq/logs": "^6.13.0",
|
|
238
|
-
"@ledgerhq/speculos-transport": "^0.2.13-nightly.
|
|
239
|
-
"@ledgerhq/wallet-api-acre-module": "^0.8.0-nightly.
|
|
240
|
-
"@ledgerhq/wallet-api-exchange-module": "^0.17.0-nightly.
|
|
241
|
-
"@ledgerhq/
|
|
238
|
+
"@ledgerhq/speculos-transport": "^0.2.13-nightly.2",
|
|
239
|
+
"@ledgerhq/wallet-api-acre-module": "^0.8.0-nightly.2",
|
|
240
|
+
"@ledgerhq/wallet-api-exchange-module": "^0.17.0-nightly.2",
|
|
241
|
+
"@ledgerhq/hw-transport": "6.31.13-nightly.0"
|
|
242
242
|
},
|
|
243
243
|
"devDependencies": {
|
|
244
244
|
"@solana/web3.js": "1.95.4",
|
|
@@ -286,10 +286,10 @@
|
|
|
286
286
|
"undici": "6.19.2",
|
|
287
287
|
"uuid": "^8.3.2",
|
|
288
288
|
"ws": "7",
|
|
289
|
-
"@ledgerhq/device-react": "^0.3.0-nightly.
|
|
289
|
+
"@ledgerhq/device-react": "^0.3.0-nightly.4",
|
|
290
290
|
"@ledgerhq/types-cryptoassets": "^7.29.0-nightly.0",
|
|
291
291
|
"@ledgerhq/types-devices": "^6.27.0",
|
|
292
|
-
"@ledgerhq/types-live": "^6.87.0-nightly.
|
|
292
|
+
"@ledgerhq/types-live": "^6.87.0-nightly.3"
|
|
293
293
|
},
|
|
294
294
|
"scripts": {
|
|
295
295
|
"build": "zx ./scripts/build-ts.mjs",
|
|
@@ -41,18 +41,20 @@ export const assetsDataApi = createApi({
|
|
|
41
41
|
...(pageParam?.cursor && { cursor: pageParam.cursor }),
|
|
42
42
|
...(queryArg?.useCase && { transaction: queryArg.useCase }),
|
|
43
43
|
...(queryArg?.currencyIds &&
|
|
44
|
-
queryArg?.currencyIds.length > 0 &&
|
|
45
|
-
!queryArg?.useCase && { currencyIds: queryArg.currencyIds }),
|
|
44
|
+
queryArg?.currencyIds.length > 0 && { currencyIds: queryArg.currencyIds }),
|
|
46
45
|
...(queryArg?.search && { search: queryArg.search }),
|
|
47
46
|
product: queryArg.product,
|
|
48
47
|
minVersion: queryArg.version,
|
|
49
|
-
additionalData:
|
|
48
|
+
additionalData: queryArg.additionalData || [
|
|
49
|
+
AssetsAdditionalData.Apy,
|
|
50
|
+
AssetsAdditionalData.MarketTrend,
|
|
51
|
+
],
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
const baseUrl = queryArg.isStaging ? getEnv("DADA_API_STAGING") : getEnv("DADA_API_PROD");
|
|
53
55
|
|
|
54
56
|
return {
|
|
55
|
-
url: `${baseUrl}assets`,
|
|
57
|
+
url: `${baseUrl}/assets`,
|
|
56
58
|
params,
|
|
57
59
|
};
|
|
58
60
|
},
|
|
@@ -81,7 +83,10 @@ export const assetsDataApi = createApi({
|
|
|
81
83
|
queryArg?.currencyIds.length > 0 && { currencyIds: queryArg.currencyIds }),
|
|
82
84
|
product: queryArg.product,
|
|
83
85
|
minVersion: queryArg.version,
|
|
84
|
-
additionalData:
|
|
86
|
+
additionalData: queryArg.additionalData || [
|
|
87
|
+
AssetsAdditionalData.Apy,
|
|
88
|
+
AssetsAdditionalData.MarketTrend,
|
|
89
|
+
],
|
|
85
90
|
};
|
|
86
91
|
|
|
87
92
|
const baseUrl = queryArg.isStaging ? getEnv("DADA_API_STAGING") : getEnv("DADA_API_PROD");
|
|
@@ -65,7 +65,7 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
65
65
|
[AppInfos.ETHEREUM.name]: DeviceLabels.VERIFY_ETHEREUM,
|
|
66
66
|
[AppInfos.POLKADOT.name]: DeviceLabels.PLEASE_REVIEW,
|
|
67
67
|
[AppInfos.POLYGON.name]: DeviceLabels.VERIFY_POLYGON,
|
|
68
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
68
|
+
[AppInfos.SOLANA.name]: DeviceLabels.PUBKEY,
|
|
69
69
|
default: DeviceLabels.ADDRESS,
|
|
70
70
|
},
|
|
71
71
|
receiveConfirm: {
|
|
@@ -75,14 +75,13 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
75
75
|
[AppInfos.ETHEREUM.name]: DeviceLabels.CONFIRM,
|
|
76
76
|
[AppInfos.POLKADOT.name]: DeviceLabels.CAPS_APPROVE,
|
|
77
77
|
[AppInfos.POLYGON.name]: DeviceLabels.CONFIRM,
|
|
78
|
-
[AppInfos.SOLANA.name]: DeviceLabels.CONFIRM,
|
|
79
78
|
default: DeviceLabels.APPROVE,
|
|
80
79
|
},
|
|
81
80
|
delegateVerify: {
|
|
82
81
|
[AppInfos.COSMOS.name]: DeviceLabels.PLEASE_REVIEW,
|
|
83
82
|
[AppInfos.MULTIVERS_X.name]: DeviceLabels.RECEIVER,
|
|
84
83
|
[AppInfos.NEAR.name]: DeviceLabels.VIEW_HEADER,
|
|
85
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
84
|
+
[AppInfos.SOLANA.name]: DeviceLabels.DELEGATE_FROM,
|
|
86
85
|
default: DeviceLabels.REVIEW_OPERATION,
|
|
87
86
|
},
|
|
88
87
|
delegateConfirm: {
|
|
@@ -92,7 +91,6 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
92
91
|
[AppInfos.INJECTIVE.name]: DeviceLabels.CAPS_APPROVE,
|
|
93
92
|
[AppInfos.MULTIVERS_X.name]: DeviceLabels.SIGN,
|
|
94
93
|
[AppInfos.NEAR.name]: DeviceLabels.CONTINUE_TO_ACTION,
|
|
95
|
-
[AppInfos.SOLANA.name]: DeviceLabels.SIGN_TRANSACTION,
|
|
96
94
|
[AppInfos.OSMOSIS.name]: DeviceLabels.CAPS_APPROVE,
|
|
97
95
|
default: DeviceLabels.APPROVE,
|
|
98
96
|
},
|
package/src/e2e/enum/Device.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export class Device {
|
|
2
|
-
constructor(
|
|
2
|
+
constructor(
|
|
3
|
+
public readonly name: string,
|
|
4
|
+
public readonly targetId: number,
|
|
5
|
+
) {}
|
|
3
6
|
|
|
4
|
-
static readonly LNS = "nanoS";
|
|
5
|
-
static readonly LNX = "nanoX";
|
|
6
|
-
static readonly LNSP = "nanoSP";
|
|
7
|
+
static readonly LNS = new Device("nanoS", 823132164);
|
|
8
|
+
static readonly LNX = new Device("nanoX", 855638020);
|
|
9
|
+
static readonly LNSP = new Device("nanoSP", 856686596);
|
|
7
10
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import expect from "expect";
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
pressUntilTextFound,
|
|
6
|
-
waitFor,
|
|
7
|
-
containsSubstringInEvent,
|
|
8
|
-
getSpeculosModel,
|
|
9
|
-
} from "../speculos";
|
|
3
|
+
import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos";
|
|
4
|
+
import { getSpeculosModel } from "../speculosAppVersion";
|
|
10
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
11
6
|
import { Device } from "../enum/Device";
|
|
12
7
|
import invariant from "invariant";
|
|
@@ -27,7 +22,7 @@ export async function sendBTC(tx: Transaction) {
|
|
|
27
22
|
const speculosDevice = getSpeculosModel();
|
|
28
23
|
try {
|
|
29
24
|
const events =
|
|
30
|
-
speculosDevice === Device.LNS
|
|
25
|
+
speculosDevice === Device.LNS.name
|
|
31
26
|
? await pressUntilTextFound(DeviceLabels.CONTINUE)
|
|
32
27
|
: await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
|
|
33
28
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
@@ -35,7 +30,7 @@ export async function sendBTC(tx: Transaction) {
|
|
|
35
30
|
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
36
31
|
expect(isAddressCorrect).toBeTruthy();
|
|
37
32
|
await pressBoth();
|
|
38
|
-
if (speculosDevice === Device.LNS) {
|
|
33
|
+
if (speculosDevice === Device.LNS.name) {
|
|
39
34
|
await pressUntilTextFound(DeviceLabels.SIGN);
|
|
40
35
|
await pressBoth();
|
|
41
36
|
await waitFor(DeviceLabels.BITCOIN_IS_READY);
|
|
@@ -11,7 +11,7 @@ import { DeviceLabels } from "../enum/DeviceLabels";
|
|
|
11
11
|
import { Device } from "../enum/Device";
|
|
12
12
|
|
|
13
13
|
export async function sendCardano(tx: Transaction) {
|
|
14
|
-
const isNanoS = process.env.SPECULOS_DEVICE === Device.LNS;
|
|
14
|
+
const isNanoS = process.env.SPECULOS_DEVICE === Device.LNS.name;
|
|
15
15
|
await waitFor(DeviceLabels.NEW_ORDINARY);
|
|
16
16
|
await (isNanoS ? pressRightButton() : pressBoth());
|
|
17
17
|
if (isNanoS) {
|
|
@@ -66,7 +66,7 @@ export async function delegateCardano() {
|
|
|
66
66
|
[DeviceLabels.CONFIRM, "right"],
|
|
67
67
|
] as const;
|
|
68
68
|
|
|
69
|
-
const steps = process.env.SPECULOS_DEVICE === Device.LNS ? LNSSpecificSteps : commonSteps;
|
|
69
|
+
const steps = process.env.SPECULOS_DEVICE === Device.LNS.name ? LNSSpecificSteps : commonSteps;
|
|
70
70
|
|
|
71
71
|
for (const [label, action] of steps) {
|
|
72
72
|
try {
|
package/src/e2e/families/evm.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import expect from "expect";
|
|
2
2
|
import { NFTTransaction, Transaction } from "../models/Transaction";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
pressUntilTextFound,
|
|
6
|
-
containsSubstringInEvent,
|
|
7
|
-
waitFor,
|
|
8
|
-
getSpeculosModel,
|
|
9
|
-
} from "../speculos";
|
|
3
|
+
import { pressBoth, pressUntilTextFound, containsSubstringInEvent, waitFor } from "../speculos";
|
|
4
|
+
import { getSpeculosModel } from "../speculosAppVersion";
|
|
10
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
11
6
|
import { Device } from "../enum/Device";
|
|
12
7
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
@@ -18,7 +13,7 @@ export async function sendEVM(tx: Transaction) {
|
|
|
18
13
|
: await pressUntilTextFound(DeviceLabels.ACCEPT);
|
|
19
14
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
20
15
|
expect(isAmountCorrect).toBeTruthy();
|
|
21
|
-
if (tx.accountToCredit.ensName && process.env.SPECULOS_DEVICE !== Device.LNS) {
|
|
16
|
+
if (tx.accountToCredit.ensName && process.env.SPECULOS_DEVICE !== Device.LNS.name) {
|
|
22
17
|
const isENSNameCorrect = containsSubstringInEvent(tx.accountToCredit.ensName, events);
|
|
23
18
|
expect(isENSNameCorrect).toBeTruthy();
|
|
24
19
|
} else {
|
|
@@ -4,13 +4,11 @@ import {
|
|
|
4
4
|
pressUntilTextFound,
|
|
5
5
|
containsSubstringInEvent,
|
|
6
6
|
getDelegateEvents,
|
|
7
|
-
getSpeculosModel,
|
|
8
7
|
} from "../speculos";
|
|
9
8
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
10
9
|
import { Device } from "../enum/Device";
|
|
11
10
|
import { Transaction } from "../models/Transaction";
|
|
12
11
|
import { Delegate } from "../models/Delegate";
|
|
13
|
-
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
14
12
|
|
|
15
13
|
export async function delegateSolana(delegatingAccount: Delegate) {
|
|
16
14
|
await getDelegateEvents(delegatingAccount);
|
|
@@ -18,13 +16,10 @@ export async function delegateSolana(delegatingAccount: Delegate) {
|
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
export async function sendSolana(tx: Transaction) {
|
|
21
|
-
const events =
|
|
22
|
-
getSpeculosModel() !== DeviceModelId.nanoS
|
|
23
|
-
? await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION)
|
|
24
|
-
: await pressUntilTextFound(DeviceLabels.APPROVE);
|
|
19
|
+
const events = await pressUntilTextFound(DeviceLabels.APPROVE);
|
|
25
20
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
26
21
|
expect(isAmountCorrect).toBeTruthy();
|
|
27
|
-
if (process.env.SPECULOS_DEVICE !== Device.LNS) {
|
|
22
|
+
if (process.env.SPECULOS_DEVICE !== Device.LNS.name) {
|
|
28
23
|
const isAddressCorrect = containsSubstringInEvent(
|
|
29
24
|
tx.accountToCredit.parentAccount?.address ?? tx.accountToCredit.address,
|
|
30
25
|
events,
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
getDeviceLabels,
|
|
4
|
-
getSpeculosModel,
|
|
5
|
-
pressBoth,
|
|
6
|
-
pressUntilTextFound,
|
|
7
|
-
} from "../speculos";
|
|
1
|
+
import { getDelegateEvents, getDeviceLabels, pressBoth, pressUntilTextFound } from "../speculos";
|
|
2
|
+
import { getSpeculosModel } from "../speculosAppVersion";
|
|
8
3
|
import { Delegate } from "../models/Delegate";
|
|
9
4
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
10
5
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
package/src/e2e/speculos.ts
CHANGED
|
@@ -16,7 +16,6 @@ import { getEnv } from "@ledgerhq/live-env";
|
|
|
16
16
|
import { getCryptoCurrencyById } from "../currencies";
|
|
17
17
|
import { DeviceLabels } from "./enum/DeviceLabels";
|
|
18
18
|
import { Account } from "./enum/Account";
|
|
19
|
-
import { Device as CryptoWallet } from "./enum/Device";
|
|
20
19
|
import { Currency } from "./enum/Currency";
|
|
21
20
|
import expect from "expect";
|
|
22
21
|
import { sendBTC, sendBTCBasedCoin } from "./families/bitcoin";
|
|
@@ -43,6 +42,7 @@ import { delegateOsmosis } from "./families/osmosis";
|
|
|
43
42
|
import { AppInfos } from "./enum/AppInfos";
|
|
44
43
|
import { DEVICE_LABELS_CONFIG } from "./data/deviceLabelsData";
|
|
45
44
|
import { sendSui } from "./families/sui";
|
|
45
|
+
import { getAppVersionFromCatalog, getSpeculosModel } from "./speculosAppVersion";
|
|
46
46
|
|
|
47
47
|
const isSpeculosRemote = process.env.REMOTE_SPECULOS === "true";
|
|
48
48
|
|
|
@@ -51,6 +51,7 @@ export type Spec = {
|
|
|
51
51
|
appQuery: {
|
|
52
52
|
model: DeviceModelId;
|
|
53
53
|
appName: string;
|
|
54
|
+
appVersion?: string;
|
|
54
55
|
};
|
|
55
56
|
/** @deprecated */
|
|
56
57
|
dependency?: string;
|
|
@@ -74,19 +75,6 @@ export function setExchangeDependencies(dependencies: Dependency[]) {
|
|
|
74
75
|
specs["Exchange"].dependencies = Array.from(map.values());
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
export function getSpeculosModel() {
|
|
78
|
-
const speculosDevice = process.env.SPECULOS_DEVICE;
|
|
79
|
-
switch (speculosDevice) {
|
|
80
|
-
case CryptoWallet.LNS:
|
|
81
|
-
return DeviceModelId.nanoS;
|
|
82
|
-
case CryptoWallet.LNX:
|
|
83
|
-
return DeviceModelId.nanoX;
|
|
84
|
-
case CryptoWallet.LNSP:
|
|
85
|
-
default:
|
|
86
|
-
return DeviceModelId.nanoSP;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
78
|
type Specs = {
|
|
91
79
|
[key: string]: Spec;
|
|
92
80
|
};
|
|
@@ -312,7 +300,6 @@ export const specs: Specs = {
|
|
|
312
300
|
},
|
|
313
301
|
dependency: "",
|
|
314
302
|
},
|
|
315
|
-
|
|
316
303
|
Celo: {
|
|
317
304
|
currency: getCryptoCurrencyById("celo"),
|
|
318
305
|
appQuery: {
|
|
@@ -367,13 +354,21 @@ export async function startSpeculos(
|
|
|
367
354
|
invariant(seed, "SEED is not set");
|
|
368
355
|
const coinapps = COINAPPS;
|
|
369
356
|
invariant(coinapps, "COINAPPS is not set");
|
|
370
|
-
|
|
357
|
+
const appCandidates = await listAppCandidates(coinapps);
|
|
371
358
|
|
|
372
|
-
|
|
373
|
-
appCandidates = await listAppCandidates(coinapps);
|
|
374
|
-
}
|
|
359
|
+
const nanoAppCatalogPath = getEnv("E2E_NANO_APP_VERSION_PATH");
|
|
375
360
|
|
|
376
361
|
const { appQuery, dependency, onSpeculosDeviceCreated } = spec;
|
|
362
|
+
try {
|
|
363
|
+
const displayName = spec.currency?.managerAppName || appQuery.appName;
|
|
364
|
+
const catalogVersion = await getAppVersionFromCatalog(displayName, nanoAppCatalogPath);
|
|
365
|
+
if (catalogVersion) {
|
|
366
|
+
appQuery.appVersion = catalogVersion;
|
|
367
|
+
}
|
|
368
|
+
} catch (e) {
|
|
369
|
+
console.warn("[speculos] Unable to fetch app version from catalog", e);
|
|
370
|
+
}
|
|
371
|
+
|
|
377
372
|
const appCandidate = findLatestAppCandidate(appCandidates, appQuery);
|
|
378
373
|
const { model } = appQuery;
|
|
379
374
|
const { dependencies } = spec;
|
|
@@ -806,10 +801,7 @@ export async function getDelegateEvents(delegatingAccount: Delegate): Promise<st
|
|
|
806
801
|
|
|
807
802
|
export async function verifyAmountsAndAcceptSwap(swap: Swap, amount: string) {
|
|
808
803
|
await waitFor(DeviceLabels.REVIEW_TRANSACTION);
|
|
809
|
-
const events =
|
|
810
|
-
getSpeculosModel() === DeviceModelId.nanoS
|
|
811
|
-
? await pressUntilTextFound(DeviceLabels.ACCEPT_AND_SEND)
|
|
812
|
-
: await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
|
|
804
|
+
const events = await pressUntilTextFound(DeviceLabels.ACCEPT_AND_SEND);
|
|
813
805
|
verifySwapData(swap, events, amount);
|
|
814
806
|
await pressBoth();
|
|
815
807
|
}
|
|
@@ -829,11 +821,14 @@ export async function verifyAmountsAndRejectSwap(swap: Swap, amount: string) {
|
|
|
829
821
|
}
|
|
830
822
|
|
|
831
823
|
function verifySwapData(swap: Swap, events: string[], amount: string) {
|
|
832
|
-
|
|
824
|
+
// Uncoment when new exchange nanoApp is in prod
|
|
825
|
+
|
|
826
|
+
// const swapPair = `swap ${swap.getAccountToDebit.currency.ticker} to ${swap.getAccountToCredit.currency.ticker}`;
|
|
827
|
+
|
|
828
|
+
// if (getSpeculosModel() !== DeviceModelId.nanoS) {
|
|
829
|
+
// expectDeviceScreenContains(swapPair, events, "Swap pair not found on the device screen");
|
|
830
|
+
// }
|
|
833
831
|
|
|
834
|
-
if (getSpeculosModel() !== DeviceModelId.nanoS) {
|
|
835
|
-
expectDeviceScreenContains(swapPair, events, "Swap pair not found on the device screen");
|
|
836
|
-
}
|
|
837
832
|
expectDeviceScreenContains(amount, events, `Amount ${amount} not found on the device screen`);
|
|
838
833
|
}
|
|
839
834
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { HttpManagerApiRepository, ApplicationV2Entity } from "@ledgerhq/device-core";
|
|
2
|
+
import { version } from "@ledgerhq/device-core/package.json";
|
|
3
|
+
import { getEnv } from "@ledgerhq/live-env";
|
|
4
|
+
import { DeviceModelId } from "@ledgerhq/devices";
|
|
5
|
+
import { Device as CryptoWallet } from "./enum/Device";
|
|
6
|
+
import * as fs from "fs";
|
|
7
|
+
import * as path from "path";
|
|
8
|
+
|
|
9
|
+
export function getSpeculosModel(): DeviceModelId {
|
|
10
|
+
const speculosDevice = process.env.SPECULOS_DEVICE;
|
|
11
|
+
switch (speculosDevice) {
|
|
12
|
+
case CryptoWallet.LNS.name:
|
|
13
|
+
return DeviceModelId.nanoS;
|
|
14
|
+
case CryptoWallet.LNX.name:
|
|
15
|
+
return DeviceModelId.nanoX;
|
|
16
|
+
case CryptoWallet.LNSP.name:
|
|
17
|
+
default:
|
|
18
|
+
return DeviceModelId.nanoSP;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getDeviceTargetId(device: DeviceModelId): number {
|
|
23
|
+
const modelToTargetIdMap = {
|
|
24
|
+
[DeviceModelId.nanoS]: CryptoWallet.LNS.targetId,
|
|
25
|
+
[DeviceModelId.nanoX]: CryptoWallet.LNX.targetId,
|
|
26
|
+
[DeviceModelId.nanoSP]: CryptoWallet.LNSP.targetId,
|
|
27
|
+
};
|
|
28
|
+
return modelToTargetIdMap[device];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function getNanoAppCatalog(
|
|
32
|
+
device: DeviceModelId,
|
|
33
|
+
deviceFirmware: string,
|
|
34
|
+
): Promise<ApplicationV2Entity[]> {
|
|
35
|
+
const repository = new HttpManagerApiRepository(getEnv("MANAGER_API_BASE"), version);
|
|
36
|
+
const targetId = getDeviceTargetId(device);
|
|
37
|
+
return await repository.catalogForDevice({
|
|
38
|
+
provider: 1,
|
|
39
|
+
targetId: targetId,
|
|
40
|
+
firmwareVersion: deviceFirmware,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getDeviceFirmwareVersion(): string {
|
|
45
|
+
const firmwareVersion = process.env.SPECULOS_FIRMWARE_VERSION;
|
|
46
|
+
if (!firmwareVersion) {
|
|
47
|
+
throw new Error("SPECULOS_FIRMWARE_VERSION environment variable is not set");
|
|
48
|
+
}
|
|
49
|
+
return firmwareVersion;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function createNanoAppJsonFile(nanoAppFilePath: string): Promise<void> {
|
|
53
|
+
try {
|
|
54
|
+
const device = getSpeculosModel();
|
|
55
|
+
const firmware = getDeviceFirmwareVersion();
|
|
56
|
+
const appCatalog = await getNanoAppCatalog(device, firmware);
|
|
57
|
+
const jsonFilePath = path.join(process.cwd(), nanoAppFilePath);
|
|
58
|
+
const dirPath = path.dirname(jsonFilePath);
|
|
59
|
+
if (!fs.existsSync(dirPath)) {
|
|
60
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
61
|
+
}
|
|
62
|
+
fs.writeFileSync(jsonFilePath, JSON.stringify(appCatalog, null, 2), "utf8");
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error("Unable to create app version file:", error);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export async function getAppVersionFromCatalog(
|
|
69
|
+
currency: string,
|
|
70
|
+
nanoAppFilePath: string,
|
|
71
|
+
): Promise<string | undefined> {
|
|
72
|
+
try {
|
|
73
|
+
await createNanoAppJsonFile(nanoAppFilePath);
|
|
74
|
+
const rootDir = process.cwd();
|
|
75
|
+
const jsonFilePath = path.join(rootDir, nanoAppFilePath);
|
|
76
|
+
type CatalogApp = { versionDisplayName: string; version: string };
|
|
77
|
+
const raw = fs.readFileSync(jsonFilePath, "utf8");
|
|
78
|
+
const catalog: CatalogApp[] = JSON.parse(raw);
|
|
79
|
+
|
|
80
|
+
const app = catalog.find(entry => entry.versionDisplayName === currency);
|
|
81
|
+
|
|
82
|
+
return app?.version ?? "";
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error(`Unable to get app version for ${currency} from catalog:`, error);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { AccountLike } from "@ledgerhq/types-live";
|
|
3
3
|
import { useCurrenciesByMarketcap } from "../../../currencies/hooks";
|
|
4
|
-
import { listCryptoCurrencies
|
|
4
|
+
import { listCryptoCurrencies } from "../../../currencies";
|
|
5
5
|
import { getAvailableAccountsById } from "../utils";
|
|
6
6
|
|
|
7
7
|
// Pick a default source account if none are selected.
|
|
@@ -10,7 +10,7 @@ export const usePickDefaultAccount = (
|
|
|
10
10
|
fromAccount: AccountLike | null | undefined,
|
|
11
11
|
setFromAccount: (account: AccountLike) => void,
|
|
12
12
|
): void => {
|
|
13
|
-
const list =
|
|
13
|
+
const list = listCryptoCurrencies();
|
|
14
14
|
const allCurrencies = useCurrenciesByMarketcap(list);
|
|
15
15
|
|
|
16
16
|
useEffect(() => {
|