@ledgerhq/live-common 34.37.0 → 34.38.0-nightly.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/e2e/enum/Provider.d.ts +1 -1
- package/lib/e2e/enum/Provider.d.ts.map +1 -1
- package/lib/e2e/enum/Provider.js +1 -1
- package/lib/e2e/enum/Provider.js.map +1 -1
- package/lib/e2e/index.d.ts +6 -0
- package/lib/e2e/index.d.ts.map +1 -1
- 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/e2e/speculosCI.js +1 -1
- package/lib/e2e/swap.d.ts.map +1 -1
- package/lib/e2e/swap.js +7 -7
- package/lib/e2e/swap.js.map +1 -1
- package/lib/exchange/providers/swap.d.ts +1 -0
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.integration.test.js +26 -12
- package/lib/exchange/providers/swap.integration.test.js.map +1 -1
- package/lib/exchange/providers/swap.js +25 -0
- package/lib/exchange/providers/swap.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 +34 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/stakePrograms/index.d.ts +8 -2
- package/lib/featureFlags/stakePrograms/index.d.ts.map +1 -1
- package/lib/featureFlags/stakePrograms/index.js +3 -2
- package/lib/featureFlags/stakePrograms/index.js.map +1 -1
- package/lib/featureFlags/stakePrograms/index.test.js +4 -4
- package/lib/featureFlags/stakePrograms/index.test.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/hooks/useOFACGeoBlockCheck.js +1 -1
- package/lib/hooks/useOFACGeoBlockCheck.js.map +1 -1
- package/lib/hooks/useShowProviderLoadingTransition.d.ts +9 -0
- package/lib/hooks/useShowProviderLoadingTransition.d.ts.map +1 -0
- package/lib/hooks/useShowProviderLoadingTransition.js +46 -0
- package/lib/hooks/useShowProviderLoadingTransition.js.map +1 -0
- package/lib/hooks/useShowProviderLoadingTransition.test.d.ts +5 -0
- package/lib/hooks/useShowProviderLoadingTransition.test.d.ts.map +1 -0
- package/lib/hooks/useShowProviderLoadingTransition.test.js +83 -0
- package/lib/hooks/useShowProviderLoadingTransition.test.js.map +1 -0
- 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/enum/Provider.d.ts +1 -1
- package/lib-es/e2e/enum/Provider.d.ts.map +1 -1
- package/lib-es/e2e/enum/Provider.js +1 -1
- package/lib-es/e2e/enum/Provider.js.map +1 -1
- package/lib-es/e2e/index.d.ts +6 -0
- package/lib-es/e2e/index.d.ts.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/e2e/speculosCI.js +1 -1
- package/lib-es/e2e/swap.d.ts.map +1 -1
- package/lib-es/e2e/swap.js +7 -7
- package/lib-es/e2e/swap.js.map +1 -1
- package/lib-es/exchange/providers/swap.d.ts +1 -0
- package/lib-es/exchange/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.integration.test.js +27 -13
- package/lib-es/exchange/providers/swap.integration.test.js.map +1 -1
- package/lib-es/exchange/providers/swap.js +25 -0
- package/lib-es/exchange/providers/swap.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 +34 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.d.ts +8 -2
- package/lib-es/featureFlags/stakePrograms/index.d.ts.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.js +3 -2
- package/lib-es/featureFlags/stakePrograms/index.js.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.test.js +4 -4
- package/lib-es/featureFlags/stakePrograms/index.test.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js +1 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js.map +1 -1
- package/lib-es/hooks/useShowProviderLoadingTransition.d.ts +9 -0
- package/lib-es/hooks/useShowProviderLoadingTransition.d.ts.map +1 -0
- package/lib-es/hooks/useShowProviderLoadingTransition.js +41 -0
- package/lib-es/hooks/useShowProviderLoadingTransition.js.map +1 -0
- package/lib-es/hooks/useShowProviderLoadingTransition.test.d.ts +5 -0
- package/lib-es/hooks/useShowProviderLoadingTransition.test.d.ts.map +1 -0
- package/lib-es/hooks/useShowProviderLoadingTransition.test.js +81 -0
- package/lib-es/hooks/useShowProviderLoadingTransition.test.js.map +1 -0
- 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/enum/Provider.ts +1 -1
- package/src/e2e/speculos.ts +3 -0
- package/src/e2e/speculosCI.ts +1 -1
- package/src/e2e/swap.ts +8 -7
- package/src/exchange/providers/swap.integration.test.ts +33 -16
- package/src/exchange/providers/swap.ts +32 -0
- package/src/families/evm/config.ts +2 -2
- package/src/featureFlags/defaultFeatures.ts +36 -0
- package/src/featureFlags/stakePrograms/index.test.ts +4 -4
- package/src/featureFlags/stakePrograms/index.ts +5 -6
- package/src/hooks/useOFACGeoBlockCheck.ts +1 -1
- package/src/hooks/useShowProviderLoadingTransition.test.ts +112 -0
- package/src/hooks/useShowProviderLoadingTransition.ts +57 -0
- 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
@@ -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
|
|