@ledgerhq/live-common 34.37.0-nightly.1 → 34.37.0-nightly.3

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.
Files changed (55) hide show
  1. package/lib/e2e/speculos.d.ts.map +1 -1
  2. package/lib/e2e/speculos.js +3 -0
  3. package/lib/e2e/speculos.js.map +1 -1
  4. package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
  5. package/lib/exchange/swap/completeExchange.js +7 -0
  6. package/lib/exchange/swap/completeExchange.js.map +1 -1
  7. package/lib/families/evm/config.js +2 -2
  8. package/lib/families/evm/config.js.map +1 -1
  9. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  10. package/lib/featureFlags/defaultFeatures.js +1 -0
  11. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  12. package/lib/hooks/useOFACGeoBlockCheck.js +1 -1
  13. package/lib/hooks/useOFACGeoBlockCheck.js.map +1 -1
  14. package/lib/wallet-api/Exchange/server.d.ts +2 -0
  15. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  16. package/lib/wallet-api/Exchange/server.js +6 -0
  17. package/lib/wallet-api/Exchange/server.js.map +1 -1
  18. package/lib/wallet-api/ModularDrawer/types.d.ts +30 -25
  19. package/lib/wallet-api/ModularDrawer/types.d.ts.map +1 -1
  20. package/lib/wallet-api/ModularDrawer/types.js +15 -11
  21. package/lib/wallet-api/ModularDrawer/types.js.map +1 -1
  22. package/lib/wallet-api/ModularDrawer/utils.js +1 -1
  23. package/lib/wallet-api/ModularDrawer/utils.js.map +1 -1
  24. package/lib-es/e2e/speculos.d.ts.map +1 -1
  25. package/lib-es/e2e/speculos.js +3 -0
  26. package/lib-es/e2e/speculos.js.map +1 -1
  27. package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
  28. package/lib-es/exchange/swap/completeExchange.js +7 -0
  29. package/lib-es/exchange/swap/completeExchange.js.map +1 -1
  30. package/lib-es/families/evm/config.js +2 -2
  31. package/lib-es/families/evm/config.js.map +1 -1
  32. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  33. package/lib-es/featureFlags/defaultFeatures.js +1 -0
  34. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  35. package/lib-es/hooks/useOFACGeoBlockCheck.js +1 -1
  36. package/lib-es/hooks/useOFACGeoBlockCheck.js.map +1 -1
  37. package/lib-es/wallet-api/Exchange/server.d.ts +2 -0
  38. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  39. package/lib-es/wallet-api/Exchange/server.js +6 -0
  40. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  41. package/lib-es/wallet-api/ModularDrawer/types.d.ts +30 -25
  42. package/lib-es/wallet-api/ModularDrawer/types.d.ts.map +1 -1
  43. package/lib-es/wallet-api/ModularDrawer/types.js +9 -5
  44. package/lib-es/wallet-api/ModularDrawer/types.js.map +1 -1
  45. package/lib-es/wallet-api/ModularDrawer/utils.js +1 -1
  46. package/lib-es/wallet-api/ModularDrawer/utils.js.map +1 -1
  47. package/package.json +61 -61
  48. package/src/e2e/speculos.ts +3 -0
  49. package/src/exchange/swap/completeExchange.ts +15 -0
  50. package/src/families/evm/config.ts +2 -2
  51. package/src/featureFlags/defaultFeatures.ts +1 -0
  52. package/src/hooks/useOFACGeoBlockCheck.ts +1 -1
  53. package/src/wallet-api/Exchange/server.ts +8 -0
  54. package/src/wallet-api/ModularDrawer/types.ts +9 -5
  55. package/src/wallet-api/ModularDrawer/utils.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.37.0-nightly.1",
4
+ "version": "34.37.0-nightly.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/LedgerHQ/ledger-live.git"
@@ -162,72 +162,72 @@
162
162
  "xstate": "^5.19.2",
163
163
  "yargs": "^17.0.0",
164
164
  "zod": "^3.22.4",
165
- "@ledgerhq/coin-algorand": "^0.9.9-nightly.0",
166
- "@ledgerhq/coin-aptos": "^2.1.1-nightly.0",
167
- "@ledgerhq/coin-bitcoin": "^0.15.9-nightly.0",
168
- "@ledgerhq/coin-cardano": "^0.8.9-nightly.0",
169
- "@ledgerhq/coin-casper": "^1.7.4-nightly.0",
170
- "@ledgerhq/coin-celo": "^1.1.7-nightly.0",
171
- "@ledgerhq/coin-cosmos": "^0.15.1-nightly.0",
172
- "@ledgerhq/coin-evm": "^2.22.3-nightly.0",
173
- "@ledgerhq/coin-filecoin": "^1.9.9-nightly.0",
174
- "@ledgerhq/coin-framework": "^5.2.1-nightly.0",
175
- "@ledgerhq/coin-hedera": "^1.7.1-nightly.0",
176
- "@ledgerhq/coin-icon": "^0.10.9-nightly.0",
177
- "@ledgerhq/coin-internet_computer": "^1.7.9-nightly.0",
178
- "@ledgerhq/coin-mina": "^1.1.8-nightly.0",
179
- "@ledgerhq/coin-multiversx": "^0.4.9-nightly.0",
180
- "@ledgerhq/coin-near": "^0.11.9-nightly.0",
181
- "@ledgerhq/coin-polkadot": "^6.1.3-nightly.0",
182
- "@ledgerhq/coin-solana": "^0.25.1-nightly.0",
183
- "@ledgerhq/coin-stacks": "^0.8.9-nightly.0",
184
- "@ledgerhq/coin-stellar": "^5.1.2-nightly.0",
185
- "@ledgerhq/coin-sui": "^0.4.2-nightly.0",
186
- "@ledgerhq/coin-tezos": "^5.2.2-nightly.0",
187
- "@ledgerhq/coin-ton": "^0.12.1-nightly.0",
188
- "@ledgerhq/coin-tron": "^4.2.0-nightly.1",
189
- "@ledgerhq/coin-vechain": "^2.7.9-nightly.0",
190
- "@ledgerhq/coin-xrp": "^6.1.4-nightly.0",
165
+ "@ledgerhq/coin-algorand": "^0.9.9-nightly.2",
166
+ "@ledgerhq/coin-aptos": "^2.2.0-nightly.2",
167
+ "@ledgerhq/coin-bitcoin": "^0.15.9-nightly.2",
168
+ "@ledgerhq/coin-cardano": "^0.8.9-nightly.2",
169
+ "@ledgerhq/coin-casper": "^1.7.4-nightly.2",
170
+ "@ledgerhq/coin-celo": "^1.1.7-nightly.2",
171
+ "@ledgerhq/coin-cosmos": "^0.15.1-nightly.2",
172
+ "@ledgerhq/coin-evm": "^2.22.3-nightly.2",
173
+ "@ledgerhq/coin-filecoin": "^1.9.9-nightly.2",
174
+ "@ledgerhq/coin-framework": "^5.3.0-nightly.2",
175
+ "@ledgerhq/coin-hedera": "^1.7.1-nightly.2",
176
+ "@ledgerhq/coin-icon": "^0.10.9-nightly.2",
177
+ "@ledgerhq/coin-internet_computer": "^1.7.9-nightly.2",
178
+ "@ledgerhq/coin-mina": "^1.1.8-nightly.2",
179
+ "@ledgerhq/coin-multiversx": "^0.4.9-nightly.2",
180
+ "@ledgerhq/coin-near": "^0.11.9-nightly.2",
181
+ "@ledgerhq/coin-polkadot": "^6.1.3-nightly.2",
182
+ "@ledgerhq/coin-solana": "^0.25.1-nightly.2",
183
+ "@ledgerhq/coin-stacks": "^0.8.9-nightly.2",
184
+ "@ledgerhq/coin-stellar": "^5.1.2-nightly.2",
185
+ "@ledgerhq/coin-sui": "^0.4.2-nightly.2",
186
+ "@ledgerhq/coin-tezos": "^5.2.2-nightly.2",
187
+ "@ledgerhq/coin-ton": "^0.12.1-nightly.2",
188
+ "@ledgerhq/coin-tron": "^4.2.0-nightly.3",
189
+ "@ledgerhq/coin-vechain": "^2.7.9-nightly.2",
190
+ "@ledgerhq/coin-xrp": "^6.1.4-nightly.2",
191
191
  "@ledgerhq/crypto-icons-ui": "^1.15.0-nightly.0",
192
192
  "@ledgerhq/cryptoassets": "^13.18.1-nightly.0",
193
- "@ledgerhq/device-core": "^0.4.27-nightly.0",
194
- "@ledgerhq/devices": "8.4.6",
195
- "@ledgerhq/errors": "^6.21.0",
196
- "@ledgerhq/hw-app-algorand": "^6.31.2",
197
- "@ledgerhq/hw-app-aptos": "^6.34.2",
198
- "@ledgerhq/hw-app-btc": "^10.9.2",
199
- "@ledgerhq/hw-app-celo": "^6.33.5-nightly.0",
200
- "@ledgerhq/hw-app-cosmos": "^6.32.2",
201
- "@ledgerhq/hw-app-eth": "^6.45.7-nightly.0",
202
- "@ledgerhq/hw-app-exchange": "^0.10.2",
203
- "@ledgerhq/hw-app-hedera": "^1.2.2",
204
- "@ledgerhq/hw-app-icon": "^1.3.2",
205
- "@ledgerhq/hw-app-multiversx": "^6.24.2",
206
- "@ledgerhq/hw-app-near": "^6.31.2",
207
- "@ledgerhq/hw-app-polkadot": "^6.34.2",
208
- "@ledgerhq/hw-app-str": "^7.2.2",
193
+ "@ledgerhq/device-core": "^0.4.27-nightly.2",
194
+ "@ledgerhq/devices": "8.4.7-nightly.0",
195
+ "@ledgerhq/errors": "^6.22.0-nightly.0",
196
+ "@ledgerhq/hw-app-algorand": "^6.31.3-nightly.0",
197
+ "@ledgerhq/hw-app-aptos": "^6.34.3-nightly.0",
198
+ "@ledgerhq/hw-app-btc": "^10.9.3-nightly.0",
199
+ "@ledgerhq/hw-app-celo": "^6.33.5-nightly.2",
200
+ "@ledgerhq/hw-app-cosmos": "^6.32.3-nightly.0",
201
+ "@ledgerhq/hw-app-eth": "^6.45.7-nightly.2",
202
+ "@ledgerhq/hw-app-exchange": "^0.10.3-nightly.0",
203
+ "@ledgerhq/hw-app-hedera": "^1.2.3-nightly.0",
204
+ "@ledgerhq/hw-app-icon": "^1.3.3-nightly.0",
205
+ "@ledgerhq/hw-app-multiversx": "^6.24.3-nightly.0",
206
+ "@ledgerhq/hw-app-near": "^6.31.3-nightly.0",
207
+ "@ledgerhq/hw-app-polkadot": "^6.34.3-nightly.0",
208
+ "@ledgerhq/hw-app-str": "^7.2.3-nightly.0",
209
209
  "@ledgerhq/hw-app-sui": "^1.1.0",
210
- "@ledgerhq/hw-app-tezos": "^6.31.2",
211
- "@ledgerhq/hw-app-trx": "^6.31.2",
212
- "@ledgerhq/hw-app-vet": "^0.5.5",
213
- "@ledgerhq/hw-app-xrp": "^6.31.2",
214
- "@ledgerhq/hw-transport": "^6.31.6",
215
- "@ledgerhq/hw-transport-mocker": "^6.29.6",
216
- "@ledgerhq/ledger-cal-service": "^0.6.0-nightly.0",
210
+ "@ledgerhq/hw-app-tezos": "^6.31.3-nightly.0",
211
+ "@ledgerhq/hw-app-trx": "^6.31.3-nightly.0",
212
+ "@ledgerhq/hw-app-vet": "^0.5.6-nightly.0",
213
+ "@ledgerhq/hw-app-xrp": "^6.31.3-nightly.0",
214
+ "@ledgerhq/hw-transport": "^6.31.7-nightly.0",
215
+ "@ledgerhq/hw-transport-mocker": "^6.29.7-nightly.0",
216
+ "@ledgerhq/ledger-cal-service": "^0.6.0-nightly.1",
217
217
  "@ledgerhq/live-config": "^3.1.0",
218
- "@ledgerhq/live-countervalues": "^0.5.9-nightly.0",
219
- "@ledgerhq/live-dmk-shared": "^0.9.0",
220
- "@ledgerhq/live-countervalues-react": "^0.2.38-nightly.0",
218
+ "@ledgerhq/live-countervalues": "^0.5.9-nightly.2",
219
+ "@ledgerhq/live-dmk-shared": "^0.9.1-nightly.0",
220
+ "@ledgerhq/live-countervalues-react": "^0.2.38-nightly.2",
221
221
  "@ledgerhq/live-env": "^2.9.1-nightly.0",
222
222
  "@ledgerhq/live-hooks": "0.1.0",
223
- "@ledgerhq/live-network": "^2.0.9",
224
- "@ledgerhq/live-nft": "^0.8.9-nightly.0",
223
+ "@ledgerhq/live-network": "^2.0.10-nightly.0",
224
+ "@ledgerhq/live-nft": "^0.8.9-nightly.2",
225
225
  "@ledgerhq/live-promise": "^0.1.1",
226
- "@ledgerhq/live-signer-evm": "^0.5.2-nightly.0",
227
- "@ledgerhq/live-signer-solana": "^0.2.1-nightly.0",
228
- "@ledgerhq/live-wallet": "^0.10.12-nightly.0",
226
+ "@ledgerhq/live-signer-evm": "^0.5.2-nightly.2",
227
+ "@ledgerhq/live-signer-solana": "^0.2.1-nightly.2",
228
+ "@ledgerhq/live-wallet": "^0.10.12-nightly.2",
229
229
  "@ledgerhq/logs": "^6.13.0",
230
- "@ledgerhq/speculos-transport": "^0.2.2",
230
+ "@ledgerhq/speculos-transport": "^0.2.3-nightly.0",
231
231
  "@ledgerhq/wallet-api-acre-module": "^0.5.0",
232
232
  "@ledgerhq/wallet-api-exchange-module": "^0.13.0"
233
233
  },
@@ -277,10 +277,10 @@
277
277
  "undici": "6.19.2",
278
278
  "uuid": "^8.3.2",
279
279
  "ws": "7",
280
- "@ledgerhq/device-react": "^0.2.33-nightly.0",
280
+ "@ledgerhq/device-react": "^0.2.33-nightly.2",
281
281
  "@ledgerhq/types-cryptoassets": "^7.23.0",
282
282
  "@ledgerhq/types-devices": "^6.25.3",
283
- "@ledgerhq/types-live": "^6.73.0-nightly.0"
283
+ "@ledgerhq/types-live": "^6.73.0-nightly.1"
284
284
  },
285
285
  "scripts": {
286
286
  "build": "zx ./scripts/build-ts.mjs",
@@ -569,6 +569,9 @@ export async function expectValidAddressDevice(account: Account, addressDisplaye
569
569
  case Currency.ATOM:
570
570
  deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.CAPS_APPROVE, DeviceLabels.CAPS_REJECT];
571
571
  break;
572
+ case Currency.BTC:
573
+ deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.CONFIRM, DeviceLabels.CANCEL];
574
+ break;
572
575
  default:
573
576
  deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.APPROVE, DeviceLabels.REJECT];
574
577
  break;
@@ -25,6 +25,8 @@ import { CompleteExchangeStep, convertTransportError } from "../error";
25
25
  import type { CompleteExchangeInputSwap, CompleteExchangeRequestEvent } from "../platform/types";
26
26
  import { convertToAppExchangePartnerKey, getSwapProvider } from "../providers";
27
27
  import { CEXProviderConfig } from "../providers/swap";
28
+ import { isAddressSanctioned } from "../../sanction";
29
+ import { RecipientAddressSanctionedError } from "../../sanction/errors";
28
30
 
29
31
  const COMPLETE_EXCHANGE_LOG = "SWAP-CompleteExchange";
30
32
 
@@ -64,6 +66,19 @@ const completeExchange = (
64
66
  const payoutCurrency = getAccountCurrency(toAccount);
65
67
  const refundCurrency = getAccountCurrency(fromAccount);
66
68
  const mainRefundCurrency = getAccountCurrency(refundAccount);
69
+
70
+ const isPayoutSanctioned = await isAddressSanctioned(
71
+ payoutAccount.currency,
72
+ payoutAccount.freshAddress,
73
+ );
74
+ const isRefundSanctioned = await isAddressSanctioned(
75
+ refundAccount.currency,
76
+ refundAccount.freshAddress,
77
+ );
78
+
79
+ if (isPayoutSanctioned || isRefundSanctioned) {
80
+ throw new RecipientAddressSanctionedError();
81
+ }
67
82
  if (mainPayoutCurrency.type !== "CryptoCurrency")
68
83
  throw new Error("This should be a cryptocurrency");
69
84
  if (mainRefundCurrency.type !== "CryptoCurrency")
@@ -104,7 +104,7 @@ const evmConfig: CurrencyLiveConfigDefinition = {
104
104
  type: "ledger",
105
105
  explorerId: "eth",
106
106
  },
107
- showNfts: true,
107
+ showNfts: false,
108
108
  },
109
109
  },
110
110
  config_currency_sonic: {
@@ -266,7 +266,7 @@ const evmConfig: CurrencyLiveConfigDefinition = {
266
266
  type: "ledger",
267
267
  explorerId: "matic",
268
268
  },
269
- showNfts: true,
269
+ showNfts: false,
270
270
  },
271
271
  },
272
272
  config_currency_reosc: {
@@ -609,6 +609,7 @@ export const DEFAULT_FEATURES: Features = {
609
609
  live_app: true,
610
610
  receive_flow: true,
611
611
  send_flow: true,
612
+ enableModularization: false,
612
613
  },
613
614
  },
614
615
  llNftSupport: DEFAULT_FEATURE,
@@ -20,7 +20,7 @@ export const useOFACGeoBlockCheck = ({
20
20
  queryKey: ["ofac-geo-block", geoBlockingFeatureFlagKey],
21
21
  queryFn: async () => {
22
22
  if (!platformOfacGeoBlocking?.enabled) return false;
23
- const res = await fetch(`${baseURL()}/v3/market`);
23
+ const res = await fetch(`${baseURL()}/v3/markets`);
24
24
  return res.status === 451;
25
25
  },
26
26
  });
@@ -65,6 +65,8 @@ export type CompleteExchangeUiRequest = {
65
65
  swapId?: string;
66
66
  amountExpectedTo?: number;
67
67
  magnitudeAwareRate?: BigNumber;
68
+ refundAddress?: string;
69
+ payoutAddress?: string;
68
70
  };
69
71
 
70
72
  type ExchangeStartParamsUiRequest =
@@ -286,11 +288,15 @@ export const handlers = ({
286
288
 
287
289
  let amountExpectedTo;
288
290
  let magnitudeAwareRate;
291
+ let refundAddress;
292
+ let payoutAddress;
289
293
  if (params.exchangeType === "SWAP") {
290
294
  // Get amountExpectedTo and magnitudeAwareRate from binary payload
291
295
  const decodePayload = await decodeSwapPayload(params.hexBinaryPayload);
292
296
  amountExpectedTo = new BigNumber(decodePayload.amountToWallet.toString());
293
297
  magnitudeAwareRate = tx.amount && amountExpectedTo.dividedBy(tx.amount);
298
+ refundAddress = decodePayload.refundAddress;
299
+ payoutAddress = decodePayload.payoutAddress;
294
300
  }
295
301
 
296
302
  return new Promise((resolve, reject) =>
@@ -306,6 +312,8 @@ export const handlers = ({
306
312
  swapId: params.exchangeType === "SWAP" ? params.swapId : undefined,
307
313
  amountExpectedTo,
308
314
  magnitudeAwareRate,
315
+ refundAddress,
316
+ payoutAddress,
309
317
  },
310
318
  onSuccess: (transactionHash: string) => {
311
319
  tracking.completeExchangeSuccess({
@@ -12,11 +12,15 @@ export type ModularDrawerConfiguration = {
12
12
  };
13
13
  };
14
14
 
15
- const filterOptions = ["topNetworks"] as const;
16
- const assetsLeftElementOptions = ["apy", "priceVariation"] as const;
17
- const assetsRightElementOptions = ["balance", "marketTrend"] as const;
18
- const networksLeftElementOptions = ["numberOfAccounts", "numberOfAccountsAndApy"] as const;
19
- const networksRightElementOptions = ["balance"] as const;
15
+ export const filterOptions = ["topNetworks", "undefined"] as const;
16
+ export const assetsLeftElementOptions = ["apy", "priceVariation", "undefined"] as const;
17
+ export const assetsRightElementOptions = ["balance", "marketTrend", "undefined"] as const;
18
+ export const networksLeftElementOptions = [
19
+ "numberOfAccounts",
20
+ "numberOfAccountsAndApy",
21
+ "undefined",
22
+ ] as const;
23
+ export const networksRightElementOptions = ["balance", "undefined"] as const;
20
24
 
21
25
  export const EnhancedModularDrawerConfigurationSchema = z.object({
22
26
  assets: z
@@ -19,7 +19,7 @@ export function validateAndTransformConfigurationWithZod(
19
19
  const result = EnhancedModularDrawerConfigurationSchema.safeParse(config);
20
20
 
21
21
  if (!result.success) {
22
- console.warn("Modulare Drawer invalid configuration received:", result.error);
22
+ console.warn("Modular Drawer invalid configuration received:", result.error);
23
23
  return {};
24
24
  }
25
25