@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.
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +3 -0
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +7 -0
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/families/evm/config.js +2 -2
- package/lib/families/evm/config.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/hooks/useOFACGeoBlockCheck.js +1 -1
- package/lib/hooks/useOFACGeoBlockCheck.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts +2 -0
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +6 -0
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/ModularDrawer/types.d.ts +30 -25
- package/lib/wallet-api/ModularDrawer/types.d.ts.map +1 -1
- package/lib/wallet-api/ModularDrawer/types.js +15 -11
- package/lib/wallet-api/ModularDrawer/types.js.map +1 -1
- package/lib/wallet-api/ModularDrawer/utils.js +1 -1
- package/lib/wallet-api/ModularDrawer/utils.js.map +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +3 -0
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +7 -0
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/families/evm/config.js +2 -2
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js +1 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts +2 -0
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +6 -0
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/ModularDrawer/types.d.ts +30 -25
- package/lib-es/wallet-api/ModularDrawer/types.d.ts.map +1 -1
- package/lib-es/wallet-api/ModularDrawer/types.js +9 -5
- package/lib-es/wallet-api/ModularDrawer/types.js.map +1 -1
- package/lib-es/wallet-api/ModularDrawer/utils.js +1 -1
- package/lib-es/wallet-api/ModularDrawer/utils.js.map +1 -1
- package/package.json +61 -61
- package/src/e2e/speculos.ts +3 -0
- package/src/exchange/swap/completeExchange.ts +15 -0
- package/src/families/evm/config.ts +2 -2
- package/src/featureFlags/defaultFeatures.ts +1 -0
- package/src/hooks/useOFACGeoBlockCheck.ts +1 -1
- package/src/wallet-api/Exchange/server.ts +8 -0
- package/src/wallet-api/ModularDrawer/types.ts +9 -5
- 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.
|
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.
|
166
|
-
"@ledgerhq/coin-aptos": "^2.
|
167
|
-
"@ledgerhq/coin-bitcoin": "^0.15.9-nightly.
|
168
|
-
"@ledgerhq/coin-cardano": "^0.8.9-nightly.
|
169
|
-
"@ledgerhq/coin-casper": "^1.7.4-nightly.
|
170
|
-
"@ledgerhq/coin-celo": "^1.1.7-nightly.
|
171
|
-
"@ledgerhq/coin-cosmos": "^0.15.1-nightly.
|
172
|
-
"@ledgerhq/coin-evm": "^2.22.3-nightly.
|
173
|
-
"@ledgerhq/coin-filecoin": "^1.9.9-nightly.
|
174
|
-
"@ledgerhq/coin-framework": "^5.
|
175
|
-
"@ledgerhq/coin-hedera": "^1.7.1-nightly.
|
176
|
-
"@ledgerhq/coin-icon": "^0.10.9-nightly.
|
177
|
-
"@ledgerhq/coin-internet_computer": "^1.7.9-nightly.
|
178
|
-
"@ledgerhq/coin-mina": "^1.1.8-nightly.
|
179
|
-
"@ledgerhq/coin-multiversx": "^0.4.9-nightly.
|
180
|
-
"@ledgerhq/coin-near": "^0.11.9-nightly.
|
181
|
-
"@ledgerhq/coin-polkadot": "^6.1.3-nightly.
|
182
|
-
"@ledgerhq/coin-solana": "^0.25.1-nightly.
|
183
|
-
"@ledgerhq/coin-stacks": "^0.8.9-nightly.
|
184
|
-
"@ledgerhq/coin-stellar": "^5.1.2-nightly.
|
185
|
-
"@ledgerhq/coin-sui": "^0.4.2-nightly.
|
186
|
-
"@ledgerhq/coin-tezos": "^5.2.2-nightly.
|
187
|
-
"@ledgerhq/coin-ton": "^0.12.1-nightly.
|
188
|
-
"@ledgerhq/coin-tron": "^4.2.0-nightly.
|
189
|
-
"@ledgerhq/coin-vechain": "^2.7.9-nightly.
|
190
|
-
"@ledgerhq/coin-xrp": "^6.1.4-nightly.
|
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.
|
194
|
-
"@ledgerhq/devices": "8.4.
|
195
|
-
"@ledgerhq/errors": "^6.
|
196
|
-
"@ledgerhq/hw-app-algorand": "^6.31.
|
197
|
-
"@ledgerhq/hw-app-aptos": "^6.34.
|
198
|
-
"@ledgerhq/hw-app-btc": "^10.9.
|
199
|
-
"@ledgerhq/hw-app-celo": "^6.33.5-nightly.
|
200
|
-
"@ledgerhq/hw-app-cosmos": "^6.32.
|
201
|
-
"@ledgerhq/hw-app-eth": "^6.45.7-nightly.
|
202
|
-
"@ledgerhq/hw-app-exchange": "^0.10.
|
203
|
-
"@ledgerhq/hw-app-hedera": "^1.2.
|
204
|
-
"@ledgerhq/hw-app-icon": "^1.3.
|
205
|
-
"@ledgerhq/hw-app-multiversx": "^6.24.
|
206
|
-
"@ledgerhq/hw-app-near": "^6.31.
|
207
|
-
"@ledgerhq/hw-app-polkadot": "^6.34.
|
208
|
-
"@ledgerhq/hw-app-str": "^7.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.
|
211
|
-
"@ledgerhq/hw-app-trx": "^6.31.
|
212
|
-
"@ledgerhq/hw-app-vet": "^0.5.
|
213
|
-
"@ledgerhq/hw-app-xrp": "^6.31.
|
214
|
-
"@ledgerhq/hw-transport": "^6.31.
|
215
|
-
"@ledgerhq/hw-transport-mocker": "^6.29.
|
216
|
-
"@ledgerhq/ledger-cal-service": "^0.6.0-nightly.
|
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.
|
219
|
-
"@ledgerhq/live-dmk-shared": "^0.9.0",
|
220
|
-
"@ledgerhq/live-countervalues-react": "^0.2.38-nightly.
|
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.
|
224
|
-
"@ledgerhq/live-nft": "^0.8.9-nightly.
|
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.
|
227
|
-
"@ledgerhq/live-signer-solana": "^0.2.1-nightly.
|
228
|
-
"@ledgerhq/live-wallet": "^0.10.12-nightly.
|
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.
|
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.
|
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.
|
283
|
+
"@ledgerhq/types-live": "^6.73.0-nightly.1"
|
284
284
|
},
|
285
285
|
"scripts": {
|
286
286
|
"build": "zx ./scripts/build-ts.mjs",
|
package/src/e2e/speculos.ts
CHANGED
@@ -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:
|
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:
|
269
|
+
showNfts: false,
|
270
270
|
},
|
271
271
|
},
|
272
272
|
config_currency_reosc: {
|
@@ -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/
|
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 = [
|
19
|
-
|
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("
|
22
|
+
console.warn("Modular Drawer invalid configuration received:", result.error);
|
23
23
|
return {};
|
24
24
|
}
|
25
25
|
|