@ledgerhq/live-common 34.55.0-nightly.20251215120904 → 34.55.0-nightly.20251217023943
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/apps/listApps.d.ts.map +1 -1
- package/lib/apps/listApps.js +10 -0
- package/lib/apps/listApps.js.map +1 -1
- package/lib/apps/polyfill.d.ts +2 -2
- package/lib/apps/polyfill.d.ts.map +1 -1
- package/lib/apps/types.d.ts +4 -0
- package/lib/apps/types.d.ts.map +1 -1
- package/lib/apps/types.js.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts +1 -0
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +3 -0
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts +1 -5
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts +1 -4
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib/dada-client/utils/errorUtils.d.ts +28 -0
- package/lib/dada-client/utils/errorUtils.d.ts.map +1 -0
- package/lib/dada-client/utils/errorUtils.js +53 -0
- package/lib/dada-client/utils/errorUtils.js.map +1 -0
- package/lib/e2e/index.d.ts +1 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/swap.js +2 -2
- package/lib/e2e/swap.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/hw/actions/app.d.ts +2 -0
- package/lib/hw/actions/app.d.ts.map +1 -1
- package/lib/hw/actions/app.js +8 -2
- package/lib/hw/actions/app.js.map +1 -1
- package/lib/hw/actions/manager.d.ts +2 -0
- package/lib/hw/actions/manager.d.ts.map +1 -1
- package/lib/hw/actions/manager.js +6 -0
- package/lib/hw/actions/manager.js.map +1 -1
- package/lib/hw/connectApp.d.ts +4 -0
- package/lib/hw/connectApp.d.ts.map +1 -1
- package/lib/hw/connectApp.js.map +1 -1
- package/lib/hw/connectAppEventMapper.d.ts +1 -0
- package/lib/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib/hw/connectAppEventMapper.js +12 -0
- package/lib/hw/connectAppEventMapper.js.map +1 -1
- package/lib/hw/getOnboardingStatePolling.d.ts.map +1 -1
- package/lib/hw/getOnboardingStatePolling.js +11 -1
- package/lib/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts +1 -1
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts.map +1 -1
- package/lib/socket/index.d.ts.map +1 -1
- package/lib/socket/index.js +28 -0
- package/lib/socket/index.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +18 -0
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/Exchange/tracking.d.ts +18 -0
- package/lib/wallet-api/Exchange/tracking.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/tracking.js +22 -0
- package/lib/wallet-api/Exchange/tracking.js.map +1 -1
- package/lib-es/apps/listApps.d.ts.map +1 -1
- package/lib-es/apps/listApps.js +10 -0
- package/lib-es/apps/listApps.js.map +1 -1
- package/lib-es/apps/polyfill.d.ts +2 -2
- package/lib-es/apps/polyfill.d.ts.map +1 -1
- package/lib-es/apps/types.d.ts +4 -0
- package/lib-es/apps/types.d.ts.map +1 -1
- package/lib-es/apps/types.js.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +1 -0
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +3 -0
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts +1 -5
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts +1 -4
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib-es/dada-client/utils/errorUtils.d.ts +28 -0
- package/lib-es/dada-client/utils/errorUtils.d.ts.map +1 -0
- package/lib-es/dada-client/utils/errorUtils.js +45 -0
- package/lib-es/dada-client/utils/errorUtils.js.map +1 -0
- package/lib-es/e2e/index.d.ts +1 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/swap.js +2 -2
- package/lib-es/e2e/swap.js.map +1 -1
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/hw/actions/app.d.ts +2 -0
- package/lib-es/hw/actions/app.d.ts.map +1 -1
- package/lib-es/hw/actions/app.js +8 -2
- package/lib-es/hw/actions/app.js.map +1 -1
- package/lib-es/hw/actions/manager.d.ts +2 -0
- package/lib-es/hw/actions/manager.d.ts.map +1 -1
- package/lib-es/hw/actions/manager.js +6 -0
- package/lib-es/hw/actions/manager.js.map +1 -1
- package/lib-es/hw/connectApp.d.ts +4 -0
- package/lib-es/hw/connectApp.d.ts.map +1 -1
- package/lib-es/hw/connectApp.js.map +1 -1
- package/lib-es/hw/connectAppEventMapper.d.ts +1 -0
- package/lib-es/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib-es/hw/connectAppEventMapper.js +12 -0
- package/lib-es/hw/connectAppEventMapper.js.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.d.ts.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.js +12 -2
- package/lib-es/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts +1 -1
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts.map +1 -1
- package/lib-es/socket/index.d.ts.map +1 -1
- package/lib-es/socket/index.js +28 -0
- package/lib-es/socket/index.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +18 -0
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/Exchange/tracking.d.ts +18 -0
- package/lib-es/wallet-api/Exchange/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/tracking.js +22 -0
- package/lib-es/wallet-api/Exchange/tracking.js.map +1 -1
- package/package.json +76 -76
- package/src/apps/listApps.ts +11 -0
- package/src/apps/types.ts +5 -0
- package/src/dada-client/hooks/useAssetsData.ts +4 -0
- package/src/dada-client/utils/__test__/errorUtils.test.ts +222 -0
- package/src/dada-client/utils/errorUtils.ts +57 -0
- package/src/e2e/swap.ts +2 -2
- package/src/hw/actions/app.ts +12 -3
- package/src/hw/actions/manager.ts +13 -0
- package/src/hw/connectApp.ts +5 -0
- package/src/hw/connectAppEventMapper.ts +12 -0
- package/src/hw/getOnboardingStatePolling.test.ts +64 -1
- package/src/hw/getOnboardingStatePolling.ts +15 -3
- package/src/modularDrawer/utils/getLoadingStatus.ts +1 -1
- package/src/platform/react.ts +1 -1
- package/src/socket/index.ts +35 -0
- package/src/wallet-api/Exchange/server.test.ts +2 -0
- package/src/wallet-api/Exchange/server.ts +20 -0
- package/src/wallet-api/Exchange/tracking.ts +56 -0
- package/src/wallet-api/react.ts +1 -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.55.0-nightly.
|
|
4
|
+
"version": "34.55.0-nightly.20251217023943",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"react": ">=16",
|
|
89
89
|
"react-dom": ">=16",
|
|
90
90
|
"react-native": ">=0.65.1",
|
|
91
|
-
"react-redux": "7.2.9",
|
|
91
|
+
"react-redux": "^7.2.9 || ^9.0.0",
|
|
92
92
|
"redux-actions": "2.6.5"
|
|
93
93
|
},
|
|
94
94
|
"peerDependenciesMeta": {
|
|
@@ -163,7 +163,6 @@
|
|
|
163
163
|
"performance-now": "^2.1.0",
|
|
164
164
|
"prando": "^6.0.1",
|
|
165
165
|
"qs": "^6.10.1",
|
|
166
|
-
"react-redux": "7.2.9",
|
|
167
166
|
"reselect": "^4.1.5",
|
|
168
167
|
"rlp": "^3.0.0",
|
|
169
168
|
"rxjs": "7.8.2",
|
|
@@ -176,78 +175,79 @@
|
|
|
176
175
|
"xstate": "^5.19.2",
|
|
177
176
|
"yargs": "^17.0.0",
|
|
178
177
|
"zod": "^3.22.4",
|
|
179
|
-
"@ledgerhq/coin-algorand": "^0.15.0-nightly.
|
|
180
|
-
"@ledgerhq/coin-aptos": "^3.8.0-nightly.
|
|
181
|
-
"@ledgerhq/coin-bitcoin": "^0.27.0-nightly.
|
|
182
|
-
"@ledgerhq/coin-canton": "^0.12.0-nightly.
|
|
183
|
-
"@ledgerhq/coin-cardano": "^0.16.0-nightly.
|
|
184
|
-
"@ledgerhq/coin-casper": "^2.5.0-nightly.
|
|
185
|
-
"@ledgerhq/coin-celo": "^1.8.0-nightly.
|
|
186
|
-
"@ledgerhq/coin-cosmos": "^0.21.0-nightly.
|
|
187
|
-
"@ledgerhq/coin-evm": "^2.37.0-nightly.
|
|
188
|
-
"@ledgerhq/coin-filecoin": "^1.16.0-nightly.
|
|
189
|
-
"@ledgerhq/coin-framework": "^6.11.0-nightly.
|
|
190
|
-
"@ledgerhq/coin-hedera": "^1.16.0-nightly.
|
|
191
|
-
"@ledgerhq/coin-icon": "^0.16.0-nightly.
|
|
192
|
-
"@ledgerhq/coin-internet_computer": "^1.12.0-nightly.
|
|
193
|
-
"@ledgerhq/coin-kaspa": "^1.6.0-nightly.
|
|
194
|
-
"@ledgerhq/coin-mina": "^1.5.0-nightly.
|
|
195
|
-
"@ledgerhq/coin-multiversx": "^0.9.0-nightly.
|
|
196
|
-
"@ledgerhq/coin-near": "^0.17.0-nightly.
|
|
197
|
-
"@ledgerhq/coin-polkadot": "^6.14.0-nightly.
|
|
198
|
-
"@ledgerhq/coin-solana": "^0.39.0-nightly.
|
|
199
|
-
"@ledgerhq/coin-stacks": "^0.13.0-nightly.
|
|
200
|
-
"@ledgerhq/coin-stellar": "^6.9.0-nightly.
|
|
201
|
-
"@ledgerhq/coin-sui": "^0.19.0-nightly.
|
|
202
|
-
"@ledgerhq/coin-tezos": "^6.11.0-nightly.
|
|
203
|
-
"@ledgerhq/coin-ton": "^0.18.0-nightly.
|
|
204
|
-
"@ledgerhq/coin-tron": "^5.8.0-nightly.
|
|
205
|
-
"@ledgerhq/coin-vechain": "^2.14.0-nightly.
|
|
206
|
-
"@ledgerhq/coin-xrp": "^7.10.0-nightly.
|
|
207
|
-
"@ledgerhq/cryptoassets": "^13.35.0-nightly.
|
|
208
|
-
"@ledgerhq/device-core": "^0.6.10-nightly.
|
|
209
|
-
"@ledgerhq/devices": "8.8.0-nightly.
|
|
210
|
-
"@ledgerhq/errors": "^6.28.0-nightly.
|
|
211
|
-
"@ledgerhq/hw-app-algorand": "^6.31.10-nightly.
|
|
212
|
-
"@ledgerhq/hw-app-aptos": "^6.34.10-nightly.
|
|
213
|
-
"@ledgerhq/hw-app-btc": "^10.14.0-nightly.
|
|
214
|
-
"@ledgerhq/hw-app-celo": "^6.35.5-nightly.
|
|
215
|
-
"@ledgerhq/hw-app-cosmos": "^6.32.10-nightly.
|
|
216
|
-
"@ledgerhq/hw-app-eth": "^7.1.0-nightly.
|
|
217
|
-
"@ledgerhq/hw-app-exchange": "^0.18.1-nightly.
|
|
218
|
-
"@ledgerhq/hw-app-hedera": "^1.2.10-nightly.
|
|
219
|
-
"@ledgerhq/hw-app-icon": "^1.3.10-nightly.
|
|
220
|
-
"@ledgerhq/hw-app-kaspa": "^1.3.3-nightly.
|
|
221
|
-
"@ledgerhq/hw-app-multiversx": "^6.26.1-nightly.
|
|
222
|
-
"@ledgerhq/hw-app-near": "^6.31.10-nightly.
|
|
223
|
-
"@ledgerhq/hw-app-polkadot": "^6.34.10-nightly.
|
|
224
|
-
"@ledgerhq/hw-app-str": "^7.3.0-nightly.
|
|
178
|
+
"@ledgerhq/coin-algorand": "^0.15.0-nightly.20251217023943",
|
|
179
|
+
"@ledgerhq/coin-aptos": "^3.8.0-nightly.20251217023943",
|
|
180
|
+
"@ledgerhq/coin-bitcoin": "^0.27.0-nightly.20251217023943",
|
|
181
|
+
"@ledgerhq/coin-canton": "^0.12.0-nightly.20251217023943",
|
|
182
|
+
"@ledgerhq/coin-cardano": "^0.16.0-nightly.20251217023943",
|
|
183
|
+
"@ledgerhq/coin-casper": "^2.5.0-nightly.20251217023943",
|
|
184
|
+
"@ledgerhq/coin-celo": "^1.8.0-nightly.20251217023943",
|
|
185
|
+
"@ledgerhq/coin-cosmos": "^0.21.0-nightly.20251217023943",
|
|
186
|
+
"@ledgerhq/coin-evm": "^2.37.0-nightly.20251217023943",
|
|
187
|
+
"@ledgerhq/coin-filecoin": "^1.16.0-nightly.20251217023943",
|
|
188
|
+
"@ledgerhq/coin-framework": "^6.11.0-nightly.20251217023943",
|
|
189
|
+
"@ledgerhq/coin-hedera": "^1.16.0-nightly.20251217023943",
|
|
190
|
+
"@ledgerhq/coin-icon": "^0.16.0-nightly.20251217023943",
|
|
191
|
+
"@ledgerhq/coin-internet_computer": "^1.12.0-nightly.20251217023943",
|
|
192
|
+
"@ledgerhq/coin-kaspa": "^1.6.0-nightly.20251217023943",
|
|
193
|
+
"@ledgerhq/coin-mina": "^1.5.0-nightly.20251217023943",
|
|
194
|
+
"@ledgerhq/coin-multiversx": "^0.9.0-nightly.20251217023943",
|
|
195
|
+
"@ledgerhq/coin-near": "^0.17.0-nightly.20251217023943",
|
|
196
|
+
"@ledgerhq/coin-polkadot": "^6.14.0-nightly.20251217023943",
|
|
197
|
+
"@ledgerhq/coin-solana": "^0.39.0-nightly.20251217023943",
|
|
198
|
+
"@ledgerhq/coin-stacks": "^0.13.0-nightly.20251217023943",
|
|
199
|
+
"@ledgerhq/coin-stellar": "^6.9.0-nightly.20251217023943",
|
|
200
|
+
"@ledgerhq/coin-sui": "^0.19.0-nightly.20251217023943",
|
|
201
|
+
"@ledgerhq/coin-tezos": "^6.11.0-nightly.20251217023943",
|
|
202
|
+
"@ledgerhq/coin-ton": "^0.18.0-nightly.20251217023943",
|
|
203
|
+
"@ledgerhq/coin-tron": "^5.8.0-nightly.20251217023943",
|
|
204
|
+
"@ledgerhq/coin-vechain": "^2.14.0-nightly.20251217023943",
|
|
205
|
+
"@ledgerhq/coin-xrp": "^7.10.0-nightly.20251217023943",
|
|
206
|
+
"@ledgerhq/cryptoassets": "^13.35.0-nightly.20251217023943",
|
|
207
|
+
"@ledgerhq/device-core": "^0.6.10-nightly.20251217023943",
|
|
208
|
+
"@ledgerhq/devices": "8.8.0-nightly.20251217023943",
|
|
209
|
+
"@ledgerhq/errors": "^6.28.0-nightly.20251217023943",
|
|
210
|
+
"@ledgerhq/hw-app-algorand": "^6.31.10-nightly.20251217023943",
|
|
211
|
+
"@ledgerhq/hw-app-aptos": "^6.34.10-nightly.20251217023943",
|
|
212
|
+
"@ledgerhq/hw-app-btc": "^10.14.0-nightly.20251217023943",
|
|
213
|
+
"@ledgerhq/hw-app-celo": "^6.35.5-nightly.20251217023943",
|
|
214
|
+
"@ledgerhq/hw-app-cosmos": "^6.32.10-nightly.20251217023943",
|
|
215
|
+
"@ledgerhq/hw-app-eth": "^7.1.0-nightly.20251217023943",
|
|
216
|
+
"@ledgerhq/hw-app-exchange": "^0.18.1-nightly.20251217023943",
|
|
217
|
+
"@ledgerhq/hw-app-hedera": "^1.2.10-nightly.20251217023943",
|
|
218
|
+
"@ledgerhq/hw-app-icon": "^1.3.10-nightly.20251217023943",
|
|
219
|
+
"@ledgerhq/hw-app-kaspa": "^1.3.3-nightly.20251217023943",
|
|
220
|
+
"@ledgerhq/hw-app-multiversx": "^6.26.1-nightly.20251217023943",
|
|
221
|
+
"@ledgerhq/hw-app-near": "^6.31.10-nightly.20251217023943",
|
|
222
|
+
"@ledgerhq/hw-app-polkadot": "^6.34.10-nightly.20251217023943",
|
|
223
|
+
"@ledgerhq/hw-app-str": "^7.3.0-nightly.20251217023943",
|
|
225
224
|
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
226
|
-
"@ledgerhq/hw-app-tezos": "^6.31.10-nightly.
|
|
227
|
-
"@ledgerhq/hw-app-trx": "^6.31.10-nightly.
|
|
228
|
-
"@ledgerhq/hw-app-vet": "^0.8.1-nightly.
|
|
229
|
-
"@ledgerhq/hw-app-xrp": "^6.32.8-nightly.
|
|
230
|
-
"@ledgerhq/hw-bolos": "^6.32.10-nightly.
|
|
231
|
-
"@ledgerhq/hw-transport": "6.31.14-nightly.
|
|
232
|
-
"@ledgerhq/hw-transport-mocker": "^6.30.0-nightly.
|
|
233
|
-
"@ledgerhq/
|
|
234
|
-
"@ledgerhq/ledger-
|
|
235
|
-
"@ledgerhq/
|
|
236
|
-
"@ledgerhq/live-
|
|
237
|
-
"@ledgerhq/live-countervalues
|
|
238
|
-
"@ledgerhq/live-
|
|
239
|
-
"@ledgerhq/live-
|
|
240
|
-
"@ledgerhq/live-
|
|
241
|
-
"@ledgerhq/live-
|
|
225
|
+
"@ledgerhq/hw-app-tezos": "^6.31.10-nightly.20251217023943",
|
|
226
|
+
"@ledgerhq/hw-app-trx": "^6.31.10-nightly.20251217023943",
|
|
227
|
+
"@ledgerhq/hw-app-vet": "^0.8.1-nightly.20251217023943",
|
|
228
|
+
"@ledgerhq/hw-app-xrp": "^6.32.8-nightly.20251217023943",
|
|
229
|
+
"@ledgerhq/hw-bolos": "^6.32.10-nightly.20251217023943",
|
|
230
|
+
"@ledgerhq/hw-transport": "6.31.14-nightly.20251217023943",
|
|
231
|
+
"@ledgerhq/hw-transport-mocker": "^6.30.0-nightly.20251217023943",
|
|
232
|
+
"@ledgerhq/client-ids": "^0.2.0-nightly.20251217023943",
|
|
233
|
+
"@ledgerhq/ledger-cal-service": "^1.9.2-nightly.20251217023943",
|
|
234
|
+
"@ledgerhq/ledger-trust-service": "^0.4.4-nightly.20251217023943",
|
|
235
|
+
"@ledgerhq/live-config": "^3.3.0-nightly.20251217023943",
|
|
236
|
+
"@ledgerhq/live-countervalues": "^0.10.2-nightly.20251217023943",
|
|
237
|
+
"@ledgerhq/live-countervalues-react": "^0.7.4-nightly.20251217023943",
|
|
238
|
+
"@ledgerhq/live-dmk-shared": "^0.16.0-nightly.20251217023943",
|
|
239
|
+
"@ledgerhq/live-env": "^2.23.0-nightly.20251217023943",
|
|
240
|
+
"@ledgerhq/live-hooks": "0.3.0-nightly.20251217023943",
|
|
241
|
+
"@ledgerhq/live-network": "^2.1.3-nightly.20251217023943",
|
|
242
242
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
243
|
-
"@ledgerhq/live-signer-canton": "^0.5.3-nightly.
|
|
244
|
-
"@ledgerhq/live-signer-evm": "^0.11.0-nightly.
|
|
245
|
-
"@ledgerhq/live-signer-solana": "^0.8.0-nightly.
|
|
246
|
-
"@ledgerhq/live-wallet": "^0.17.0-nightly.
|
|
243
|
+
"@ledgerhq/live-signer-canton": "^0.5.3-nightly.20251217023943",
|
|
244
|
+
"@ledgerhq/live-signer-evm": "^0.11.0-nightly.20251217023943",
|
|
245
|
+
"@ledgerhq/live-signer-solana": "^0.8.0-nightly.20251217023943",
|
|
246
|
+
"@ledgerhq/live-wallet": "^0.17.0-nightly.20251217023943",
|
|
247
247
|
"@ledgerhq/logs": "^6.13.0",
|
|
248
|
-
"@ledgerhq/speculos-transport": "^0.4.0-nightly.
|
|
249
|
-
"@ledgerhq/wallet-api-acre-module": "^0.11.0-nightly.
|
|
250
|
-
"@ledgerhq/wallet-api-exchange-module": "^0.20.0-nightly.
|
|
248
|
+
"@ledgerhq/speculos-transport": "^0.4.0-nightly.20251217023943",
|
|
249
|
+
"@ledgerhq/wallet-api-acre-module": "^0.11.0-nightly.20251217023943",
|
|
250
|
+
"@ledgerhq/wallet-api-exchange-module": "^0.20.0-nightly.20251217023943"
|
|
251
251
|
},
|
|
252
252
|
"devDependencies": {
|
|
253
253
|
"@solana/web3.js": "1.95.4",
|
|
@@ -263,7 +263,6 @@
|
|
|
263
263
|
"@types/lodash": "^4.14.179",
|
|
264
264
|
"@types/node": "^22.10.10",
|
|
265
265
|
"@types/react": "^18.2.21",
|
|
266
|
-
"@types/react-redux": "^7.1.33",
|
|
267
266
|
"@types/uuid": "^8.3.4",
|
|
268
267
|
"benchmark": "^2.1.4",
|
|
269
268
|
"buffer": "6.0.3",
|
|
@@ -286,6 +285,7 @@
|
|
|
286
285
|
"react-dom": "18.3.1",
|
|
287
286
|
"react-native": "0.77.3",
|
|
288
287
|
"react-test-renderer": "18.3.1",
|
|
288
|
+
"react-redux": "7.2.9",
|
|
289
289
|
"redux-actions": "2.6.5",
|
|
290
290
|
"timemachine": "^0.3.2",
|
|
291
291
|
"ts-jest": "^29.1.1",
|
|
@@ -294,10 +294,10 @@
|
|
|
294
294
|
"undici": "6.19.2",
|
|
295
295
|
"uuid": "^8.3.2",
|
|
296
296
|
"ws": "8.18.3",
|
|
297
|
-
"@ledgerhq/device-react": "^0.3.4-nightly.
|
|
298
|
-
"@ledgerhq/types-cryptoassets": "^7.31.0-nightly.
|
|
297
|
+
"@ledgerhq/device-react": "^0.3.4-nightly.20251217023943",
|
|
298
|
+
"@ledgerhq/types-cryptoassets": "^7.31.0-nightly.20251217023943",
|
|
299
299
|
"@ledgerhq/types-devices": "^6.27.0",
|
|
300
|
-
"@ledgerhq/types-live": "^6.91.0-nightly.
|
|
300
|
+
"@ledgerhq/types-live": "^6.91.0-nightly.20251217023943"
|
|
301
301
|
},
|
|
302
302
|
"scripts": {
|
|
303
303
|
"build": "zx ./scripts/build-ts.mjs",
|
package/src/apps/listApps.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { getProviderIdUseCase } from "../device/use-cases/getProviderIdUseCase";
|
|
|
16
16
|
import { calculateDependencies, mapApplicationV2ToApp } from "./polyfill";
|
|
17
17
|
import { ManagerApiRepository } from "../device/factories/HttpManagerApiRepositoryFactory";
|
|
18
18
|
import { isCustomLockScreenSupported } from "../device/use-cases/isCustomLockScreenSupported";
|
|
19
|
+
import { DeviceId } from "@ledgerhq/client-ids/ids";
|
|
19
20
|
|
|
20
21
|
// Hash discrepancies for these apps do NOT indicate a potential update,
|
|
21
22
|
// these apps have a mechanism that makes their hash change every time.
|
|
@@ -93,6 +94,16 @@ export const listApps = ({
|
|
|
93
94
|
case "device-permission-requested":
|
|
94
95
|
o.next(e);
|
|
95
96
|
break;
|
|
97
|
+
case "device-id": {
|
|
98
|
+
// Normalize deviceId to DeviceId object (SocketEvent may have string or DeviceId)
|
|
99
|
+
const deviceIdValue =
|
|
100
|
+
typeof e.deviceId === "string" ? DeviceId.fromString(e.deviceId) : e.deviceId;
|
|
101
|
+
o.next({
|
|
102
|
+
type: "device-id",
|
|
103
|
+
deviceId: deviceIdValue,
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
96
107
|
}
|
|
97
108
|
},
|
|
98
109
|
error: reject,
|
package/src/apps/types.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { DeviceModel, DeviceModelId } from "@ledgerhq/devices";
|
|
|
3
3
|
import { App, DeviceInfo, FinalFirmware, LanguagePackage } from "@ledgerhq/types-live";
|
|
4
4
|
import type { Observable, Subject } from "rxjs";
|
|
5
5
|
import { AppStorageType, StorageProvider } from "../device/use-cases/appDataBackup/types";
|
|
6
|
+
import type { DeviceId } from "@ledgerhq/client-ids/ids";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* ExecArgs
|
|
@@ -46,6 +47,10 @@ export type ListAppsEvent =
|
|
|
46
47
|
| {
|
|
47
48
|
type: "device-permission-granted";
|
|
48
49
|
}
|
|
50
|
+
| {
|
|
51
|
+
type: "device-id";
|
|
52
|
+
deviceId: DeviceId;
|
|
53
|
+
}
|
|
49
54
|
| {
|
|
50
55
|
type: "result";
|
|
51
56
|
result: ListAppsResult;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useGetAssetsDataInfiniteQuery } from "../state-manager/api";
|
|
3
3
|
import { AssetsDataWithPagination, GetAssetsDataParams } from "../state-manager/types";
|
|
4
|
+
import { parseError } from "../utils/errorUtils";
|
|
4
5
|
|
|
5
6
|
const emptyData = () => ({
|
|
6
7
|
cryptoAssets: {},
|
|
@@ -77,11 +78,14 @@ export function useAssetsData({
|
|
|
77
78
|
|
|
78
79
|
const isInitialLoading = isLoading || (isFetching && !isFetchingNextPage);
|
|
79
80
|
|
|
81
|
+
const errorInfo = useMemo(() => parseError(error), [error]);
|
|
82
|
+
|
|
80
83
|
return {
|
|
81
84
|
data: joinedPages,
|
|
82
85
|
isLoading: isInitialLoading,
|
|
83
86
|
isFetchingNextPage,
|
|
84
87
|
error,
|
|
88
|
+
errorInfo,
|
|
85
89
|
loadNext: hasMore ? fetchNextPage : undefined,
|
|
86
90
|
isSuccess,
|
|
87
91
|
isError,
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isFetchBaseQueryError,
|
|
3
|
+
isNetworkError,
|
|
4
|
+
isApiError,
|
|
5
|
+
getApiErrorStatus,
|
|
6
|
+
parseError,
|
|
7
|
+
} from "../errorUtils";
|
|
8
|
+
|
|
9
|
+
describe("errorUtils", () => {
|
|
10
|
+
describe("isFetchBaseQueryError", () => {
|
|
11
|
+
it("should return true for FetchBaseQueryError with FETCH_ERROR status", () => {
|
|
12
|
+
const error = { status: "FETCH_ERROR", error: "Failed to fetch" };
|
|
13
|
+
expect(isFetchBaseQueryError(error)).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("should return true for FetchBaseQueryError with numeric status", () => {
|
|
17
|
+
const error = { status: 500, data: { message: "Internal Server Error" } };
|
|
18
|
+
expect(isFetchBaseQueryError(error)).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should return false for null", () => {
|
|
22
|
+
expect(isFetchBaseQueryError(null)).toBe(false);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should return false for undefined", () => {
|
|
26
|
+
expect(isFetchBaseQueryError(undefined)).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("should return false for object without status", () => {
|
|
30
|
+
const error = { message: "Some error" };
|
|
31
|
+
expect(isFetchBaseQueryError(error)).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should return false for primitive values", () => {
|
|
35
|
+
expect(isFetchBaseQueryError("error")).toBe(false);
|
|
36
|
+
expect(isFetchBaseQueryError(123)).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe("isNetworkError", () => {
|
|
41
|
+
it("should return true for FETCH_ERROR", () => {
|
|
42
|
+
const error = { status: "FETCH_ERROR", error: "Failed to fetch" };
|
|
43
|
+
expect(isNetworkError(error)).toBe(true);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("should return true for TIMEOUT_ERROR", () => {
|
|
47
|
+
const error = { status: "TIMEOUT_ERROR", error: "Request timed out" };
|
|
48
|
+
expect(isNetworkError(error)).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("should return false for PARSING_ERROR", () => {
|
|
52
|
+
const error = { status: "PARSING_ERROR", error: "Invalid JSON" };
|
|
53
|
+
expect(isNetworkError(error)).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("should return false for numeric status (API error)", () => {
|
|
57
|
+
const error = { status: 500, data: { message: "Server error" } };
|
|
58
|
+
expect(isNetworkError(error)).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("should return false for undefined", () => {
|
|
62
|
+
expect(isNetworkError(undefined)).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("should return false for non-FetchBaseQueryError", () => {
|
|
66
|
+
const error = { message: "Some error" };
|
|
67
|
+
expect(isNetworkError(error)).toBe(false);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe("isApiError", () => {
|
|
72
|
+
it("should return true for 4xx status codes", () => {
|
|
73
|
+
expect(isApiError({ status: 400, data: {} })).toBe(true);
|
|
74
|
+
expect(isApiError({ status: 401, data: {} })).toBe(true);
|
|
75
|
+
expect(isApiError({ status: 404, data: {} })).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("should return true for 5xx status codes", () => {
|
|
79
|
+
expect(isApiError({ status: 500, data: {} })).toBe(true);
|
|
80
|
+
expect(isApiError({ status: 502, data: {} })).toBe(true);
|
|
81
|
+
expect(isApiError({ status: 503, data: {} })).toBe(true);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("should return false for FETCH_ERROR", () => {
|
|
85
|
+
const error = { status: "FETCH_ERROR", error: "Failed to fetch" };
|
|
86
|
+
expect(isApiError(error)).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("should return false for TIMEOUT_ERROR", () => {
|
|
90
|
+
const error = { status: "TIMEOUT_ERROR", error: "Request timed out" };
|
|
91
|
+
expect(isApiError(error)).toBe(false);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("should return false for undefined", () => {
|
|
95
|
+
expect(isApiError(undefined)).toBe(false);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("should return false for non-FetchBaseQueryError", () => {
|
|
99
|
+
expect(isApiError({ message: "error" })).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe("getApiErrorStatus", () => {
|
|
104
|
+
it("should return status code for API errors", () => {
|
|
105
|
+
expect(getApiErrorStatus({ status: 400, data: {} })).toBe(400);
|
|
106
|
+
expect(getApiErrorStatus({ status: 500, data: {} })).toBe(500);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("should return undefined for FETCH_ERROR", () => {
|
|
110
|
+
const error = { status: "FETCH_ERROR", error: "Failed to fetch" };
|
|
111
|
+
expect(getApiErrorStatus(error)).toBeUndefined();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("should return undefined for TIMEOUT_ERROR", () => {
|
|
115
|
+
const error = { status: "TIMEOUT_ERROR", error: "Request timed out" };
|
|
116
|
+
expect(getApiErrorStatus(error)).toBeUndefined();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("should return undefined for undefined error", () => {
|
|
120
|
+
expect(getApiErrorStatus(undefined)).toBeUndefined();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("should return undefined for non-FetchBaseQueryError", () => {
|
|
124
|
+
expect(getApiErrorStatus({ message: "error" })).toBeUndefined();
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe("parseError", () => {
|
|
129
|
+
it("should return correct ErrorInfo for network error (FETCH_ERROR)", () => {
|
|
130
|
+
const error = { status: "FETCH_ERROR", error: "Failed to fetch" };
|
|
131
|
+
const result = parseError(error);
|
|
132
|
+
|
|
133
|
+
expect(result).toEqual({
|
|
134
|
+
hasError: true,
|
|
135
|
+
isNetworkError: true,
|
|
136
|
+
isApiError: false,
|
|
137
|
+
apiStatus: undefined,
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("should return correct ErrorInfo for network error (TIMEOUT_ERROR)", () => {
|
|
142
|
+
const error = { status: "TIMEOUT_ERROR", error: "Request timed out" };
|
|
143
|
+
const result = parseError(error);
|
|
144
|
+
|
|
145
|
+
expect(result).toEqual({
|
|
146
|
+
hasError: true,
|
|
147
|
+
isNetworkError: true,
|
|
148
|
+
isApiError: false,
|
|
149
|
+
apiStatus: undefined,
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("should return correct ErrorInfo for API error", () => {
|
|
154
|
+
const error = { status: 500, data: { message: "Internal Server Error" } };
|
|
155
|
+
const result = parseError(error);
|
|
156
|
+
|
|
157
|
+
expect(result).toEqual({
|
|
158
|
+
hasError: true,
|
|
159
|
+
isNetworkError: false,
|
|
160
|
+
isApiError: true,
|
|
161
|
+
apiStatus: 500,
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it("should return correct ErrorInfo for 404 error", () => {
|
|
166
|
+
const error = { status: 404, data: { message: "Not Found" } };
|
|
167
|
+
const result = parseError(error);
|
|
168
|
+
|
|
169
|
+
expect(result).toEqual({
|
|
170
|
+
hasError: true,
|
|
171
|
+
isNetworkError: false,
|
|
172
|
+
isApiError: true,
|
|
173
|
+
apiStatus: 404,
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("should return default ErrorInfo for undefined error", () => {
|
|
178
|
+
const result = parseError(undefined);
|
|
179
|
+
|
|
180
|
+
expect(result).toEqual({
|
|
181
|
+
hasError: false,
|
|
182
|
+
isNetworkError: false,
|
|
183
|
+
isApiError: false,
|
|
184
|
+
apiStatus: undefined,
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it("should return default ErrorInfo for null error", () => {
|
|
189
|
+
const result = parseError(null);
|
|
190
|
+
|
|
191
|
+
expect(result).toEqual({
|
|
192
|
+
hasError: false,
|
|
193
|
+
isNetworkError: false,
|
|
194
|
+
isApiError: false,
|
|
195
|
+
apiStatus: undefined,
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("should return ErrorInfo with hasError true for non-FetchBaseQueryError", () => {
|
|
200
|
+
const result = parseError({ message: "Some generic error" });
|
|
201
|
+
|
|
202
|
+
expect(result).toEqual({
|
|
203
|
+
hasError: true,
|
|
204
|
+
isNetworkError: false,
|
|
205
|
+
isApiError: false,
|
|
206
|
+
apiStatus: undefined,
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it("should return ErrorInfo with hasError true for PARSING_ERROR", () => {
|
|
211
|
+
const error = { status: "PARSING_ERROR", error: "Invalid JSON" };
|
|
212
|
+
const result = parseError(error);
|
|
213
|
+
|
|
214
|
+
expect(result).toEqual({
|
|
215
|
+
hasError: true,
|
|
216
|
+
isNetworkError: false,
|
|
217
|
+
isApiError: false,
|
|
218
|
+
apiStatus: undefined,
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FetchBaseQueryError } from "@reduxjs/toolkit/query";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if error is a FetchBaseQueryError
|
|
5
|
+
*/
|
|
6
|
+
export function isFetchBaseQueryError(error: unknown): error is FetchBaseQueryError {
|
|
7
|
+
return typeof error === "object" && error !== null && "status" in error;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Check if the error is a network connectivity error (no internet, timeout, etc.)
|
|
12
|
+
*/
|
|
13
|
+
export function isNetworkError(error: unknown): boolean {
|
|
14
|
+
if (!isFetchBaseQueryError(error)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return error.status === "FETCH_ERROR" || error.status === "TIMEOUT_ERROR";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Check if the error is an API error with HTTP status code (4xx, 5xx)
|
|
22
|
+
*/
|
|
23
|
+
export function isApiError(error: unknown): boolean {
|
|
24
|
+
if (!isFetchBaseQueryError(error)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return typeof error.status === "number";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get HTTP status code from API error, or undefined if not an API error
|
|
32
|
+
*/
|
|
33
|
+
export function getApiErrorStatus(error: unknown): number | undefined {
|
|
34
|
+
if (!isFetchBaseQueryError(error) || typeof error.status !== "number") {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return error.status;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type ErrorInfo = {
|
|
41
|
+
hasError: boolean;
|
|
42
|
+
isNetworkError: boolean;
|
|
43
|
+
isApiError: boolean;
|
|
44
|
+
apiStatus: number | undefined;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Parse error into a structured ErrorInfo object
|
|
49
|
+
*/
|
|
50
|
+
export function parseError(error: unknown): ErrorInfo {
|
|
51
|
+
return {
|
|
52
|
+
hasError: !!error,
|
|
53
|
+
isNetworkError: isNetworkError(error),
|
|
54
|
+
isApiError: isApiError(error),
|
|
55
|
+
apiStatus: getApiErrorStatus(error),
|
|
56
|
+
};
|
|
57
|
+
}
|
package/src/e2e/swap.ts
CHANGED
|
@@ -29,8 +29,8 @@ export async function getMinimumSwapAmount(AccountFrom: Account, AccountTo: Acco
|
|
|
29
29
|
|
|
30
30
|
const minimumAmounts = data
|
|
31
31
|
.filter((item: any) => item.parameter?.minAmount !== undefined)
|
|
32
|
-
.map((item: any) => parseFloat(item.parameter.minAmount))
|
|
33
|
-
.filter((amount: number) => !isNaN(amount));
|
|
32
|
+
.map((item: any) => Number.parseFloat(item.parameter.minAmount))
|
|
33
|
+
.filter((amount: number) => !Number.isNaN(amount));
|
|
34
34
|
|
|
35
35
|
if (minimumAmounts.length === 0) {
|
|
36
36
|
throw new Error("No valid minimum amounts returned from swap quote API.");
|
package/src/hw/actions/app.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { shouldUpgrade } from "../../apps";
|
|
|
20
20
|
import { AppOp, SkippedAppOp } from "../../apps/types";
|
|
21
21
|
import perFamilyAccount from "../../generated/account";
|
|
22
22
|
import type { Account, DeviceInfo, FirmwareUpdateContext } from "@ledgerhq/types-live";
|
|
23
|
+
import { DeviceId } from "@ledgerhq/client-ids/ids";
|
|
23
24
|
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
24
25
|
import { getImplementation, ImplementationType } from "./implementations";
|
|
25
26
|
import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
|
|
@@ -44,6 +45,7 @@ export type State = {
|
|
|
44
45
|
allowManagerGranted: boolean;
|
|
45
46
|
device: Device | null | undefined;
|
|
46
47
|
deviceInfo?: DeviceInfo | null | undefined;
|
|
48
|
+
deviceId: DeviceId | null | undefined;
|
|
47
49
|
latestFirmware?: FirmwareUpdateContext | null | undefined;
|
|
48
50
|
error: Error | null | undefined;
|
|
49
51
|
derivation:
|
|
@@ -144,6 +146,7 @@ const getInitialState = (device?: Device | null | undefined, request?: AppReques
|
|
|
144
146
|
allowManagerGranted: false,
|
|
145
147
|
device: null,
|
|
146
148
|
deviceInfo: null,
|
|
149
|
+
deviceId: null,
|
|
147
150
|
latestFirmware: null,
|
|
148
151
|
opened: false,
|
|
149
152
|
appAndVersion: null,
|
|
@@ -311,6 +314,12 @@ const reducer = (state: State, e: Event): State => {
|
|
|
311
314
|
listedApps: state.listedApps,
|
|
312
315
|
};
|
|
313
316
|
|
|
317
|
+
case "device-id":
|
|
318
|
+
return {
|
|
319
|
+
...state,
|
|
320
|
+
deviceId: e.deviceId,
|
|
321
|
+
};
|
|
322
|
+
|
|
314
323
|
case "app-not-installed":
|
|
315
324
|
return {
|
|
316
325
|
...getInitialState(state.device, state.request),
|
|
@@ -460,9 +469,9 @@ export const createAction = (
|
|
|
460
469
|
() => inferCommandParams(appRequest), // for now i don't have better
|
|
461
470
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
462
471
|
[
|
|
463
|
-
appRequest.appName,
|
|
464
|
-
appRequest.account
|
|
465
|
-
appRequest.currency
|
|
472
|
+
appRequest.appName,
|
|
473
|
+
appRequest.account?.id,
|
|
474
|
+
appRequest.currency?.id,
|
|
466
475
|
appRequest.dependencies,
|
|
467
476
|
],
|
|
468
477
|
);
|
|
@@ -10,6 +10,7 @@ import type { Action, Device } from "./types";
|
|
|
10
10
|
import { currentMode } from "./app";
|
|
11
11
|
import { getImplementation } from "./implementations";
|
|
12
12
|
import { getLatestFirmwareForDeviceUseCase } from "../../device/use-cases/getLatestFirmwareForDeviceUseCase";
|
|
13
|
+
import { DeviceId } from "@ledgerhq/client-ids/ids";
|
|
13
14
|
|
|
14
15
|
type State = {
|
|
15
16
|
isLoading: boolean;
|
|
@@ -19,6 +20,7 @@ type State = {
|
|
|
19
20
|
allowManagerGranted: boolean;
|
|
20
21
|
device: Device | null | undefined;
|
|
21
22
|
deviceInfo: DeviceInfo | null | undefined;
|
|
23
|
+
deviceId: DeviceId | null | undefined;
|
|
22
24
|
result: ListAppsResult | null | undefined;
|
|
23
25
|
error: Error | null | undefined;
|
|
24
26
|
isLocked: boolean;
|
|
@@ -62,6 +64,10 @@ type Event =
|
|
|
62
64
|
| {
|
|
63
65
|
type: "deviceChange";
|
|
64
66
|
device: Device | null | undefined;
|
|
67
|
+
}
|
|
68
|
+
| {
|
|
69
|
+
type: "device-id";
|
|
70
|
+
deviceId: DeviceId;
|
|
65
71
|
};
|
|
66
72
|
|
|
67
73
|
const mapResult = ({ deviceInfo, device, result }): Result | null | undefined =>
|
|
@@ -82,6 +88,7 @@ const getInitialState = (device?: Device | null | undefined): State => ({
|
|
|
82
88
|
allowManagerGranted: false,
|
|
83
89
|
device,
|
|
84
90
|
deviceInfo: null,
|
|
91
|
+
deviceId: null,
|
|
85
92
|
result: null,
|
|
86
93
|
error: null,
|
|
87
94
|
});
|
|
@@ -151,6 +158,12 @@ const reducer = (state: State, e: Event): State => {
|
|
|
151
158
|
allowManagerGranted: true,
|
|
152
159
|
};
|
|
153
160
|
|
|
161
|
+
case "device-id":
|
|
162
|
+
return {
|
|
163
|
+
...state,
|
|
164
|
+
deviceId: e.deviceId,
|
|
165
|
+
};
|
|
166
|
+
|
|
154
167
|
case "result":
|
|
155
168
|
return {
|
|
156
169
|
...state,
|