@ledgerhq/live-common 34.44.0 → 34.45.0-nightly.1

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 (143) hide show
  1. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +3 -1
  2. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  3. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +6 -0
  4. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  5. package/lib/device/use-cases/listAppsUseCase.test.js +2 -2
  6. package/lib/device/use-cases/listAppsUseCase.test.js.map +1 -1
  7. package/lib/deviceSDK/tasks/core.d.ts +1 -0
  8. package/lib/deviceSDK/tasks/core.d.ts.map +1 -1
  9. package/lib/deviceSDK/tasks/core.js +3 -2
  10. package/lib/deviceSDK/tasks/core.js.map +1 -1
  11. package/lib/e2e/index.d.ts +3 -0
  12. package/lib/e2e/index.d.ts.map +1 -1
  13. package/lib/env.react.d.ts +1 -1
  14. package/lib/env.react.d.ts.map +1 -1
  15. package/lib/exchange/index.d.ts.map +1 -1
  16. package/lib/exchange/index.js +1 -0
  17. package/lib/exchange/index.js.map +1 -1
  18. package/lib/exchange/swap/hooks/usePickDefaultAccount.test.js +22 -10
  19. package/lib/exchange/swap/hooks/usePickDefaultAccount.test.js.map +1 -1
  20. package/lib/exchange/swap/hooks/wrapper.d.ts +3 -0
  21. package/lib/exchange/swap/hooks/wrapper.d.ts.map +1 -0
  22. package/lib/exchange/swap/hooks/wrapper.js +40 -0
  23. package/lib/exchange/swap/hooks/wrapper.js.map +1 -0
  24. package/lib/exchange/swap/postSwapState.d.ts.map +1 -1
  25. package/lib/exchange/swap/postSwapState.js +63 -4
  26. package/lib/exchange/swap/postSwapState.js.map +1 -1
  27. package/lib/exchange/swap/setBroadcastTransaction.d.ts +4 -1
  28. package/lib/exchange/swap/setBroadcastTransaction.d.ts.map +1 -1
  29. package/lib/exchange/swap/setBroadcastTransaction.js +7 -1
  30. package/lib/exchange/swap/setBroadcastTransaction.js.map +1 -1
  31. package/lib/exchange/swap/types.d.ts +7 -0
  32. package/lib/exchange/swap/types.d.ts.map +1 -1
  33. package/lib/families/evm/config.d.ts.map +1 -1
  34. package/lib/families/evm/config.js +8 -2
  35. package/lib/families/evm/config.js.map +1 -1
  36. package/lib/families/stellar/ui.d.ts.map +1 -1
  37. package/lib/families/stellar/ui.js +8 -2
  38. package/lib/families/stellar/ui.js.map +1 -1
  39. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  40. package/lib/featureFlags/defaultFeatures.js +1 -0
  41. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  42. package/lib/featureFlags/useFeature.d.ts +1 -1
  43. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  44. package/lib/hw/customLockScreenLoad.d.ts +1 -9
  45. package/lib/hw/customLockScreenLoad.d.ts.map +1 -1
  46. package/lib/hw/customLockScreenLoad.js +5 -1
  47. package/lib/hw/customLockScreenLoad.js.map +1 -1
  48. package/lib/hw/hooks/useGenuineCheck.d.ts +2 -1
  49. package/lib/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  50. package/lib/hw/hooks/useGenuineCheck.js +10 -2
  51. package/lib/hw/hooks/useGenuineCheck.js.map +1 -1
  52. package/lib/modularDrawer/utils/getBalanceAndFiatValue.d.ts +20 -0
  53. package/lib/modularDrawer/utils/getBalanceAndFiatValue.d.ts.map +1 -0
  54. package/lib/modularDrawer/utils/getBalanceAndFiatValue.js +39 -0
  55. package/lib/modularDrawer/utils/getBalanceAndFiatValue.js.map +1 -0
  56. package/lib/modularDrawer/utils/index.d.ts +2 -1
  57. package/lib/modularDrawer/utils/index.d.ts.map +1 -1
  58. package/lib/modularDrawer/utils/index.js +3 -1
  59. package/lib/modularDrawer/utils/index.js.map +1 -1
  60. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  61. package/lib/wallet-api/Exchange/server.js +10 -0
  62. package/lib/wallet-api/Exchange/server.js.map +1 -1
  63. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +3 -1
  64. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  65. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +6 -0
  66. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  67. package/lib-es/device/use-cases/listAppsUseCase.test.js +1 -1
  68. package/lib-es/device/use-cases/listAppsUseCase.test.js.map +1 -1
  69. package/lib-es/deviceSDK/tasks/core.d.ts +1 -0
  70. package/lib-es/deviceSDK/tasks/core.d.ts.map +1 -1
  71. package/lib-es/deviceSDK/tasks/core.js +1 -1
  72. package/lib-es/deviceSDK/tasks/core.js.map +1 -1
  73. package/lib-es/e2e/index.d.ts +3 -0
  74. package/lib-es/e2e/index.d.ts.map +1 -1
  75. package/lib-es/env.react.d.ts +1 -1
  76. package/lib-es/env.react.d.ts.map +1 -1
  77. package/lib-es/exchange/index.d.ts.map +1 -1
  78. package/lib-es/exchange/index.js +1 -0
  79. package/lib-es/exchange/index.js.map +1 -1
  80. package/lib-es/exchange/swap/hooks/usePickDefaultAccount.test.js +21 -9
  81. package/lib-es/exchange/swap/hooks/usePickDefaultAccount.test.js.map +1 -1
  82. package/lib-es/exchange/swap/hooks/wrapper.d.ts +3 -0
  83. package/lib-es/exchange/swap/hooks/wrapper.d.ts.map +1 -0
  84. package/lib-es/exchange/swap/hooks/wrapper.js +13 -0
  85. package/lib-es/exchange/swap/hooks/wrapper.js.map +1 -0
  86. package/lib-es/exchange/swap/postSwapState.d.ts.map +1 -1
  87. package/lib-es/exchange/swap/postSwapState.js +63 -4
  88. package/lib-es/exchange/swap/postSwapState.js.map +1 -1
  89. package/lib-es/exchange/swap/setBroadcastTransaction.d.ts +4 -1
  90. package/lib-es/exchange/swap/setBroadcastTransaction.d.ts.map +1 -1
  91. package/lib-es/exchange/swap/setBroadcastTransaction.js +7 -1
  92. package/lib-es/exchange/swap/setBroadcastTransaction.js.map +1 -1
  93. package/lib-es/exchange/swap/types.d.ts +7 -0
  94. package/lib-es/exchange/swap/types.d.ts.map +1 -1
  95. package/lib-es/families/evm/config.d.ts.map +1 -1
  96. package/lib-es/families/evm/config.js +8 -2
  97. package/lib-es/families/evm/config.js.map +1 -1
  98. package/lib-es/families/stellar/ui.d.ts.map +1 -1
  99. package/lib-es/families/stellar/ui.js +8 -2
  100. package/lib-es/families/stellar/ui.js.map +1 -1
  101. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  102. package/lib-es/featureFlags/defaultFeatures.js +1 -0
  103. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  104. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  105. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  106. package/lib-es/hw/customLockScreenLoad.d.ts +1 -9
  107. package/lib-es/hw/customLockScreenLoad.d.ts.map +1 -1
  108. package/lib-es/hw/customLockScreenLoad.js +5 -1
  109. package/lib-es/hw/customLockScreenLoad.js.map +1 -1
  110. package/lib-es/hw/hooks/useGenuineCheck.d.ts +2 -1
  111. package/lib-es/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  112. package/lib-es/hw/hooks/useGenuineCheck.js +10 -2
  113. package/lib-es/hw/hooks/useGenuineCheck.js.map +1 -1
  114. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.d.ts +20 -0
  115. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.d.ts.map +1 -0
  116. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.js +32 -0
  117. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.js.map +1 -0
  118. package/lib-es/modularDrawer/utils/index.d.ts +2 -1
  119. package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
  120. package/lib-es/modularDrawer/utils/index.js +2 -1
  121. package/lib-es/modularDrawer/utils/index.js.map +1 -1
  122. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  123. package/lib-es/wallet-api/Exchange/server.js +10 -0
  124. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  125. package/package.json +73 -73
  126. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +10 -0
  127. package/src/device/use-cases/listAppsUseCase.test.ts +1 -1
  128. package/src/deviceSDK/tasks/core.ts +1 -1
  129. package/src/exchange/index.ts +1 -0
  130. package/src/exchange/swap/hooks/usePickDefaultAccount.test.ts +25 -12
  131. package/src/exchange/swap/hooks/wrapper.tsx +18 -0
  132. package/src/exchange/swap/postSwapState.ts +97 -2
  133. package/src/exchange/swap/setBroadcastTransaction.ts +12 -0
  134. package/src/exchange/swap/types.ts +7 -0
  135. package/src/families/evm/config.ts +8 -2
  136. package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +283 -3
  137. package/src/families/stellar/ui.ts +10 -3
  138. package/src/featureFlags/defaultFeatures.ts +1 -0
  139. package/src/hw/customLockScreenLoad.ts +7 -11
  140. package/src/hw/hooks/useGenuineCheck.ts +15 -4
  141. package/src/modularDrawer/utils/getBalanceAndFiatValue.ts +53 -0
  142. package/src/modularDrawer/utils/index.ts +7 -1
  143. package/src/wallet-api/Exchange/server.ts +10 -0
@@ -1,14 +1,60 @@
1
+ import crypto from "crypto";
1
2
  import network from "@ledgerhq/live-network";
2
3
  import { mockPostSwapAccepted, mockPostSwapCancelled } from "./mock";
3
4
  import type { PostSwapAccepted, PostSwapCancelled } from "./types";
4
5
  import { isIntegrationTestEnv } from "./utils/isIntegrationTestEnv";
5
6
  import { getSwapAPIBaseURL, getSwapUserIP } from ".";
6
7
 
8
+ function createSwapIntentHashes({
9
+ provider,
10
+ fromAccountId,
11
+ toAccountId,
12
+ amount,
13
+ }: {
14
+ provider: string;
15
+ fromAccountId?: string;
16
+ toAccountId?: string;
17
+ amount?: string;
18
+ }) {
19
+ // for example '2025-08-01' used to add a one day unique nonce to the swap intent hash
20
+ const currentday = new Date().toISOString().split("T")[0];
21
+
22
+ const swapIntentWithProvider = crypto
23
+ .createHash("sha256")
24
+ .update(
25
+ JSON.stringify({
26
+ provider,
27
+ fromAccountId,
28
+ toAccountId,
29
+ amount,
30
+ currentday,
31
+ }),
32
+ )
33
+ .digest("hex");
34
+
35
+ const swapIntentWithoutProvider = crypto
36
+ .createHash("sha256")
37
+ .update(
38
+ JSON.stringify({
39
+ fromAccountId,
40
+ toAccountId,
41
+ amount,
42
+ currentday,
43
+ }),
44
+ )
45
+ .digest("hex");
46
+
47
+ return { swapIntentWithProvider, swapIntentWithoutProvider };
48
+ }
49
+
7
50
  export const postSwapAccepted: PostSwapAccepted = async ({
8
51
  provider,
9
52
  swapId = "",
10
53
  transactionId,
11
54
  swapAppVersion,
55
+ fromAccountId,
56
+ toAccountId,
57
+ amount,
12
58
  ...rest
13
59
  }) => {
14
60
  if (isIntegrationTestEnv())
@@ -21,6 +67,14 @@ export const postSwapAccepted: PostSwapAccepted = async ({
21
67
  if (!swapId) {
22
68
  return null;
23
69
  }
70
+
71
+ const { swapIntentWithProvider, swapIntentWithoutProvider } = createSwapIntentHashes({
72
+ provider,
73
+ fromAccountId,
74
+ toAccountId,
75
+ amount,
76
+ });
77
+
24
78
  try {
25
79
  const ipHeader = getSwapUserIP();
26
80
  const headers = {
@@ -31,7 +85,7 @@ export const postSwapAccepted: PostSwapAccepted = async ({
31
85
  await network({
32
86
  method: "POST",
33
87
  url: `${getSwapAPIBaseURL()}/swap/accepted`,
34
- data: { provider, swapId, transactionId, ...rest },
88
+ data: { provider, swapId, swapIntentWithProvider, swapIntentWithoutProvider, ...rest },
35
89
  ...(Object.keys(headers).length > 0 ? { headers } : {}),
36
90
  });
37
91
  } catch (error) {
@@ -45,6 +99,13 @@ export const postSwapCancelled: PostSwapCancelled = async ({
45
99
  provider,
46
100
  swapId = "",
47
101
  swapAppVersion,
102
+ fromAccountId,
103
+ toAccountId,
104
+ amount,
105
+ seedIdFrom,
106
+ seedIdTo,
107
+ refundAddress,
108
+ payoutAddress,
48
109
  ...rest
49
110
  }) => {
50
111
  if (isIntegrationTestEnv()) return mockPostSwapCancelled({ provider, swapId, ...rest });
@@ -57,6 +118,22 @@ export const postSwapCancelled: PostSwapCancelled = async ({
57
118
  return null;
58
119
  }
59
120
 
121
+ const { swapIntentWithProvider, swapIntentWithoutProvider } = createSwapIntentHashes({
122
+ provider,
123
+ fromAccountId,
124
+ toAccountId,
125
+ amount,
126
+ });
127
+
128
+ // Check if the refundAddress and payoutAddress match the account addresses, just to eliminate this supposition
129
+ const payloadAddressMatchAccountAddress =
130
+ fromAccountId &&
131
+ toAccountId &&
132
+ refundAddress &&
133
+ payoutAddress &&
134
+ fromAccountId.includes(refundAddress) &&
135
+ toAccountId.includes(payoutAddress);
136
+
60
137
  try {
61
138
  const ipHeader = getSwapUserIP();
62
139
  const headers = {
@@ -64,10 +141,28 @@ export const postSwapCancelled: PostSwapCancelled = async ({
64
141
  ...(swapAppVersion ? { "x-swap-app-version": swapAppVersion } : {}),
65
142
  };
66
143
 
144
+ const shouldIncludeAddresses =
145
+ rest.statusCode === "WrongDeviceForAccountPayout" ||
146
+ rest.statusCode === "WrongDeviceForAccountRefund";
147
+
148
+ const requestData = {
149
+ provider,
150
+ swapId,
151
+ swapIntentWithProvider,
152
+ swapIntentWithoutProvider,
153
+ payloadAddressMatchAccountAddress,
154
+ fromAccountId: shouldIncludeAddresses ? fromAccountId : undefined,
155
+ toAccountId: shouldIncludeAddresses ? toAccountId : undefined,
156
+ payloadRefundAddress: shouldIncludeAddresses ? refundAddress : undefined,
157
+ payloadPayoutAddress: shouldIncludeAddresses ? payoutAddress : undefined,
158
+ maybeSeedMatch: seedIdFrom === seedIdTo, // Only true if both accounts are from the same seed and from the same chain type
159
+ ...rest,
160
+ };
161
+
67
162
  await network({
68
163
  method: "POST",
69
164
  url: `${getSwapAPIBaseURL()}/swap/cancelled`,
70
- data: { provider, swapId, ...rest },
165
+ data: requestData,
71
166
  ...(Object.keys(headers).length > 0 ? { headers } : {}),
72
167
  });
73
168
  } catch (error) {
@@ -12,6 +12,9 @@ export const setBroadcastTransaction = ({
12
12
  hardwareWalletType,
13
13
  swapType,
14
14
  swapAppVersion,
15
+ fromAccountId,
16
+ toAccountId,
17
+ amount,
15
18
  }: {
16
19
  result: { operation: Operation | string; swapId: string };
17
20
  provider: string;
@@ -20,6 +23,9 @@ export const setBroadcastTransaction = ({
20
23
  hardwareWalletType?: DeviceModelId;
21
24
  swapType?: TradeMethod;
22
25
  swapAppVersion?: string;
26
+ fromAccountId?: string;
27
+ toAccountId?: string;
28
+ amount?: string;
23
29
  }) => {
24
30
  const { operation, swapId } = result;
25
31
 
@@ -39,6 +45,9 @@ export const setBroadcastTransaction = ({
39
45
  hardwareWalletType,
40
46
  swapType: swapType,
41
47
  swapAppVersion,
48
+ fromAccountId,
49
+ toAccountId,
50
+ amount,
42
51
  });
43
52
  } else {
44
53
  postSwapAccepted({
@@ -50,6 +59,9 @@ export const setBroadcastTransaction = ({
50
59
  hardwareWalletType,
51
60
  swapType,
52
61
  swapAppVersion,
62
+ fromAccountId,
63
+ toAccountId,
64
+ amount,
53
65
  });
54
66
  }
55
67
  };
@@ -200,6 +200,13 @@ type SwapStateRequest = {
200
200
  hardwareWalletType: DeviceModelId;
201
201
  swapType: TradeMethod;
202
202
  swapAppVersion?: string;
203
+ fromAccountId?: string;
204
+ toAccountId?: string;
205
+ amount?: string;
206
+ seedIdFrom?: string;
207
+ seedIdTo?: string;
208
+ refundAddress?: string;
209
+ payoutAddress?: string;
203
210
  }>;
204
211
 
205
212
  export type SwapStateAcceptedRequest = SwapStateRequest & {
@@ -835,7 +835,10 @@ const evmConfig: CurrencyLiveConfigDefinition = {
835
835
  default: {
836
836
  status: { type: "active" },
837
837
  node: { type: "external", uri: "https://rpc.blast.io" },
838
- explorer: { type: "blockscout", uri: "https://blast.blockscout.com/api" },
838
+ explorer: {
839
+ type: "etherscan",
840
+ uri: "https://proxyetherscan.api.live.ledger.com/v2/api/81457",
841
+ },
839
842
  showNfts: false,
840
843
  },
841
844
  },
@@ -844,7 +847,10 @@ const evmConfig: CurrencyLiveConfigDefinition = {
844
847
  default: {
845
848
  status: { type: "active" },
846
849
  node: { type: "external", uri: "https://sepolia.blast.io" },
847
- explorer: { type: "blockscout", uri: "https://blast-testnet.blockscout.com/api" },
850
+ explorer: {
851
+ type: "etherscan",
852
+ uri: "https://proxyetherscan.api.live.ledger.com/v2/api/168587773",
853
+ },
848
854
  showNfts: false,
849
855
  },
850
856
  },
@@ -3,17 +3,17 @@
3
3
  exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
4
4
  [
5
5
  {
6
- "balance": "341064673",
6
+ "balance": "341064683",
7
7
  "currencyId": "stellar",
8
8
  "derivationMode": "sep5",
9
9
  "freshAddress": "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
10
10
  "freshAddressPath": "44'/148'/0'",
11
11
  "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
12
12
  "index": 0,
13
- "operationsCount": 116,
13
+ "operationsCount": 126,
14
14
  "pendingOperations": [],
15
15
  "seedIdentifier": "27c586f8499294c64d57f8d7956eef4431de58ab20e1c88001f6cf131c97d6f3",
16
- "spendableBalance": "311064573",
16
+ "spendableBalance": "311064583",
17
17
  "subAccounts": [],
18
18
  "swapHistory": [],
19
19
  "syncHash": undefined,
@@ -442,6 +442,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
442
442
  "type": "IN",
443
443
  "value": "1",
444
444
  },
445
+ {
446
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
447
+ "blockHash": "0b101bc4656b48063383c8c7957eb756df6daee9f10f2d89125f2ec176d28f84",
448
+ "blockHeight": 58324373,
449
+ "extra": {
450
+ "blockTime": 2025-08-05T04:22:10.000Z,
451
+ "index": "250501274594967553",
452
+ "ledgerOpType": "IN",
453
+ "memo": {
454
+ "type": "MEMO_TEXT",
455
+ "value": "50% CASHBACK ON yStorm & XLM",
456
+ },
457
+ "pagingToken": "250501274594967553",
458
+ },
459
+ "fee": "10000",
460
+ "hasFailed": false,
461
+ "hash": "10264d8b4e71eee96b3972b99c3ccff8a6b2840232d93126df6014ad236183d2",
462
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-10264d8b4e71eee96b3972b99c3ccff8a6b2840232d93126df6014ad236183d2-IN",
463
+ "recipients": [
464
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
465
+ ],
466
+ "senders": [
467
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
468
+ ],
469
+ "transactionSequenceNumber": 250201623316409700,
470
+ "type": "IN",
471
+ "value": "1",
472
+ },
445
473
  {
446
474
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
447
475
  "blockHash": "de91876967432c18db672925858963de846140dc7cbfc8e73e016a09bec9f719",
@@ -860,6 +888,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
860
888
  "type": "IN",
861
889
  "value": "1",
862
890
  },
891
+ {
892
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
893
+ "blockHash": "28cd3dca0bcb5ff7d3fe6378c0dde4749dfd6e6cc5722c9f26440c4ffc740fc5",
894
+ "blockHeight": 58285530,
895
+ "extra": {
896
+ "blockTime": 2025-08-02T14:24:45.000Z,
897
+ "index": "250334445180477441",
898
+ "ledgerOpType": "IN",
899
+ "memo": {
900
+ "type": "MEMO_TEXT",
901
+ "value": "Buy yStorm Earn Native XLM!",
902
+ },
903
+ "pagingToken": "250334445180477441",
904
+ },
905
+ "fee": "10000",
906
+ "hasFailed": false,
907
+ "hash": "2fc357f2119d08873c8eadba23577052b952f8a136b8f283842f8ba1beb23a26",
908
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-2fc357f2119d08873c8eadba23577052b952f8a136b8f283842f8ba1beb23a26-IN",
909
+ "recipients": [
910
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
911
+ ],
912
+ "senders": [
913
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
914
+ ],
915
+ "transactionSequenceNumber": 250201623316403330,
916
+ "type": "IN",
917
+ "value": "1",
918
+ },
863
919
  {
864
920
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
865
921
  "blockHash": "c63800dd8a5a2c1a62ad7c15fac2de9891243a7fd52c637c1e0f3e61fbc28bad",
@@ -1576,6 +1632,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
1576
1632
  "type": "IN",
1577
1633
  "value": "1",
1578
1634
  },
1635
+ {
1636
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
1637
+ "blockHash": "e03520700e06dc2c1bfae2f0b4a94490277088becb48ea306264fdd8dfd1df62",
1638
+ "blockHeight": 58334484,
1639
+ "extra": {
1640
+ "blockTime": 2025-08-05T20:35:01.000Z,
1641
+ "index": "250544701009068033",
1642
+ "ledgerOpType": "IN",
1643
+ "memo": {
1644
+ "type": "MEMO_TEXT",
1645
+ "value": "Buy yStorm Earn Native XLM!",
1646
+ },
1647
+ "pagingToken": "250544701009068033",
1648
+ },
1649
+ "fee": "10000",
1650
+ "hasFailed": false,
1651
+ "hash": "6be42b9b39e7f99a20f4df57b8513c881caf1de5279b573c262f6e32425d4e25",
1652
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-6be42b9b39e7f99a20f4df57b8513c881caf1de5279b573c262f6e32425d4e25-IN",
1653
+ "recipients": [
1654
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
1655
+ ],
1656
+ "senders": [
1657
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
1658
+ ],
1659
+ "transactionSequenceNumber": 250201623316411780,
1660
+ "type": "IN",
1661
+ "value": "1",
1662
+ },
1579
1663
  {
1580
1664
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
1581
1665
  "blockHash": "025bb8acb9b78ff008daf0b6ffad07bdcc64dc5dfc64605189c3fd4a5fac499c",
@@ -1881,6 +1965,62 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
1881
1965
  "type": "IN",
1882
1966
  "value": "1",
1883
1967
  },
1968
+ {
1969
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
1970
+ "blockHash": "09fd06182f1e9bb78ff2f53e4556aa512d9f13f971d71906a9f91453239eeed9",
1971
+ "blockHeight": 58311936,
1972
+ "extra": {
1973
+ "blockTime": 2025-08-04T08:29:31.000Z,
1974
+ "index": "250447858087116801",
1975
+ "ledgerOpType": "IN",
1976
+ "memo": {
1977
+ "type": "MEMO_TEXT",
1978
+ "value": "50% CASHBACK ON yStorm & XLM",
1979
+ },
1980
+ "pagingToken": "250447858087116801",
1981
+ },
1982
+ "fee": "10000",
1983
+ "hasFailed": false,
1984
+ "hash": "83c0c4837794746edc769650209596d2b10a163ffaa012942cc49b72cd3e201b",
1985
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-83c0c4837794746edc769650209596d2b10a163ffaa012942cc49b72cd3e201b-IN",
1986
+ "recipients": [
1987
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
1988
+ ],
1989
+ "senders": [
1990
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
1991
+ ],
1992
+ "transactionSequenceNumber": 250201623316407580,
1993
+ "type": "IN",
1994
+ "value": "1",
1995
+ },
1996
+ {
1997
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
1998
+ "blockHash": "1a5bfecea672170945dcefce62af99913290d3696d2b5fe8b3c40e756bbe2f04",
1999
+ "blockHeight": 58270682,
2000
+ "extra": {
2001
+ "blockTime": 2025-08-01T14:41:57.000Z,
2002
+ "index": "250270673506594817",
2003
+ "ledgerOpType": "IN",
2004
+ "memo": {
2005
+ "type": "MEMO_TEXT",
2006
+ "value": "Buy yStorm Earn Native XLM!",
2007
+ },
2008
+ "pagingToken": "250270673506594817",
2009
+ },
2010
+ "fee": "10000",
2011
+ "hasFailed": false,
2012
+ "hash": "86cc5be8b2e5e3ac6fe4ee1d0ace67d6dcee9682c428b2df08e90758583666e1",
2013
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-86cc5be8b2e5e3ac6fe4ee1d0ace67d6dcee9682c428b2df08e90758583666e1-IN",
2014
+ "recipients": [
2015
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
2016
+ ],
2017
+ "senders": [
2018
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
2019
+ ],
2020
+ "transactionSequenceNumber": 250201623316400540,
2021
+ "type": "IN",
2022
+ "value": "1",
2023
+ },
1884
2024
  {
1885
2025
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
1886
2026
  "blockHash": "b1dc829d8aeab361098dd6992aa4853c71bdee44d8d814f5bbb17177b93d4188",
@@ -2324,6 +2464,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
2324
2464
  "type": "OUT",
2325
2465
  "value": "10000000",
2326
2466
  },
2467
+ {
2468
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
2469
+ "blockHash": "4d4da61e0ebfb43089bbb1be529d164db5b47a3e74c7ea2471af6dc4d7e222b8",
2470
+ "blockHeight": 58270696,
2471
+ "extra": {
2472
+ "blockTime": 2025-08-01T14:43:15.000Z,
2473
+ "index": "250270733635469313",
2474
+ "ledgerOpType": "IN",
2475
+ "memo": {
2476
+ "type": "MEMO_TEXT",
2477
+ "value": "Buy yStorm Earn Native XLM!",
2478
+ },
2479
+ "pagingToken": "250270733635469313",
2480
+ },
2481
+ "fee": "10000",
2482
+ "hasFailed": false,
2483
+ "hash": "9e29dcd7a4535b565c78cf9984e3b5bc4e45f8789d0c73ba7e95c7f0a2be9be0",
2484
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-9e29dcd7a4535b565c78cf9984e3b5bc4e45f8789d0c73ba7e95c7f0a2be9be0-IN",
2485
+ "recipients": [
2486
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
2487
+ ],
2488
+ "senders": [
2489
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
2490
+ ],
2491
+ "transactionSequenceNumber": 250201623316400540,
2492
+ "type": "IN",
2493
+ "value": "1",
2494
+ },
2327
2495
  {
2328
2496
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
2329
2497
  "blockHash": "54c972c8c8433729c52ca13f65d26ec45388e7ee280986de4c6cf5a6dfc4f5f9",
@@ -2351,6 +2519,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
2351
2519
  "type": "OUT",
2352
2520
  "value": "1000",
2353
2521
  },
2522
+ {
2523
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
2524
+ "blockHash": "ffe2e9c1e5439c3bb5f96db7389fb12c32cfe7709dfda017e42462bd9cc132ab",
2525
+ "blockHeight": 58370660,
2526
+ "extra": {
2527
+ "blockTime": 2025-08-08T06:51:44.000Z,
2528
+ "index": "250700075746578433",
2529
+ "ledgerOpType": "IN",
2530
+ "memo": {
2531
+ "type": "MEMO_TEXT",
2532
+ "value": "Buy RFL & Earn Native XLM",
2533
+ },
2534
+ "pagingToken": "250700075746578433",
2535
+ },
2536
+ "fee": "10000",
2537
+ "hasFailed": false,
2538
+ "hash": "a287cdbdcce41744f541d7fe2771a13addfaf00325720cc1ab2226c13439ce5a",
2539
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-a287cdbdcce41744f541d7fe2771a13addfaf00325720cc1ab2226c13439ce5a-IN",
2540
+ "recipients": [
2541
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
2542
+ ],
2543
+ "senders": [
2544
+ "GC5MXBUKMFBOASOJUKKZUI7TOVI7AM6T3DYU27VS3OSQP5ODGVDGEXLE",
2545
+ ],
2546
+ "transactionSequenceNumber": 250653093098686850,
2547
+ "type": "IN",
2548
+ "value": "1",
2549
+ },
2354
2550
  {
2355
2551
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
2356
2552
  "blockHash": "76ddada621ac15b8e1c819ba57dcea3506457d50d7efc1b6129c05bab4a30b96",
@@ -2491,6 +2687,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
2491
2687
  "type": "IN",
2492
2688
  "value": "1",
2493
2689
  },
2690
+ {
2691
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
2692
+ "blockHash": "4f1ce00a5d3eac5bdb41cf0fd0b81cdb369bfb349884c44d3e2240a70d37f9d7",
2693
+ "blockHeight": 58363096,
2694
+ "extra": {
2695
+ "blockTime": 2025-08-07T18:34:27.000Z,
2696
+ "index": "250667588613849089",
2697
+ "ledgerOpType": "IN",
2698
+ "memo": {
2699
+ "type": "MEMO_TEXT",
2700
+ "value": "Buy RFL & Earn Native XLM",
2701
+ },
2702
+ "pagingToken": "250667588613849089",
2703
+ },
2704
+ "fee": "10000",
2705
+ "hasFailed": false,
2706
+ "hash": "b1a4b775747d4a70444a313f61e7050b804c49ecccc409f8a7ebabd553c66df5",
2707
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-b1a4b775747d4a70444a313f61e7050b804c49ecccc409f8a7ebabd553c66df5-IN",
2708
+ "recipients": [
2709
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
2710
+ ],
2711
+ "senders": [
2712
+ "GC5MXBUKMFBOASOJUKKZUI7TOVI7AM6T3DYU27VS3OSQP5ODGVDGEXLE",
2713
+ ],
2714
+ "transactionSequenceNumber": 250653093098684700,
2715
+ "type": "IN",
2716
+ "value": "1",
2717
+ },
2494
2718
  {
2495
2719
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
2496
2720
  "blockHash": "5af452a0ca0e97f4e0855e212de30fb0506a92f239c62aa82358793cceb1f351",
@@ -2823,6 +3047,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
2823
3047
  "type": "IN",
2824
3048
  "value": "1",
2825
3049
  },
3050
+ {
3051
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
3052
+ "blockHash": "2220076b8d57bd2e0ce2e70ba0765145d47ecf07d06aa67c1999550a85842949",
3053
+ "blockHeight": 58343922,
3054
+ "extra": {
3055
+ "blockTime": 2025-08-06T11:43:04.000Z,
3056
+ "index": "250585236911091713",
3057
+ "ledgerOpType": "IN",
3058
+ "memo": {
3059
+ "type": "MEMO_TEXT",
3060
+ "value": "Buy yStorm Earn Native XLM!",
3061
+ },
3062
+ "pagingToken": "250585236911091713",
3063
+ },
3064
+ "fee": "10000",
3065
+ "hasFailed": false,
3066
+ "hash": "d7156608ccfa85496429722fedfc7b1928b4964ea87bac94a42bf753bbe9794b",
3067
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-d7156608ccfa85496429722fedfc7b1928b4964ea87bac94a42bf753bbe9794b-IN",
3068
+ "recipients": [
3069
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
3070
+ ],
3071
+ "senders": [
3072
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
3073
+ ],
3074
+ "transactionSequenceNumber": 250201623316413820,
3075
+ "type": "IN",
3076
+ "value": "1",
3077
+ },
2826
3078
  {
2827
3079
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
2828
3080
  "blockHash": "348700d9be98e1df277bdad085c71626843870bd80aec3f428aeb06a2519ee43",
@@ -3072,6 +3324,34 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
3072
3324
  "type": "IN",
3073
3325
  "value": "1",
3074
3326
  },
3327
+ {
3328
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
3329
+ "blockHash": "d1709d056a6ee5ef255a9734a3b8a00e2ff86220abea02ca7ecae078fd3150b2",
3330
+ "blockHeight": 58299775,
3331
+ "extra": {
3332
+ "blockTime": 2025-08-03T13:02:48.000Z,
3333
+ "index": "250395626989236225",
3334
+ "ledgerOpType": "IN",
3335
+ "memo": {
3336
+ "type": "MEMO_TEXT",
3337
+ "value": "Buy yStorm Earn Native XLM!",
3338
+ },
3339
+ "pagingToken": "250395626989236225",
3340
+ },
3341
+ "fee": "10000",
3342
+ "hasFailed": false,
3343
+ "hash": "f034bf4a1d9eb1d2660beb03b691de981e01a587ba1377d6ce682142a28c9d48",
3344
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-f034bf4a1d9eb1d2660beb03b691de981e01a587ba1377d6ce682142a28c9d48-IN",
3345
+ "recipients": [
3346
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
3347
+ ],
3348
+ "senders": [
3349
+ "GBCTYLNHE5XJNGD76R7EVQSMFXMT4SC5PD4XKT2P4LBN2BBB42BKC5EA",
3350
+ ],
3351
+ "transactionSequenceNumber": 250201623316405470,
3352
+ "type": "IN",
3353
+ "value": "1",
3354
+ },
3075
3355
  {
3076
3356
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
3077
3357
  "blockHash": "c2dd2af05d842d854d789cf480e11399c915ba041ff44082a6e07d719c3ccf5b",
@@ -1,15 +1,22 @@
1
- import { StellarOperationExtra } from "./types";
1
+ import { StellarMemo, StellarOperationExtra } from "./types";
2
2
 
3
3
  /**
4
4
  * Format stellar memo value for display.
5
5
  */
6
6
  export const formatMemo = (extra: StellarOperationExtra): string | undefined => {
7
- switch (extra?.memo?.type) {
7
+ const memo: StellarMemo | string | undefined = extra.memo;
8
+
9
+ // for backward compatibility for previous operation structure, as there is no
10
+ // data migration system in place
11
+ // noinspection SuspiciousTypeOfGuard
12
+ if (typeof memo == "string") return memo;
13
+
14
+ switch (memo?.type) {
8
15
  case "MEMO_ID":
9
16
  case "MEMO_TEXT":
10
17
  case "MEMO_HASH":
11
18
  case "MEMO_RETURN":
12
- return extra?.memo.value;
19
+ return memo?.value;
13
20
  }
14
21
  return undefined;
15
22
  };
@@ -677,6 +677,7 @@ export const DEFAULT_FEATURES: Features = {
677
677
  ...DEFAULT_FEATURE,
678
678
  params: {},
679
679
  },
680
+ supportDeviceApex: DEFAULT_FEATURE,
680
681
  };
681
682
 
682
683
  // Firebase SDK treat JSON values as strings
@@ -19,7 +19,7 @@ import customLockScreenFetchSize from "./customLockScreenFetchSize";
19
19
  import customLockScreenFetchHash from "./customLockScreenFetchHash";
20
20
  import { gzip } from "pako";
21
21
  import { CLSSupportedDeviceModelId } from "../device/use-cases/isCustomLockScreenSupported";
22
- import { getScreenSpecs } from "../device/use-cases/screenSpecs";
22
+ import { getScreenSpecs, type ScreenSpecs } from "../device/use-cases/screenSpecs";
23
23
  import { DeviceDisconnectedWhileSendingError } from "@ledgerhq/device-management-kit";
24
24
  import { withTransport } from "../deviceSDK/transports/core";
25
25
 
@@ -60,15 +60,6 @@ export type LoadimageResult = {
60
60
  imageSize: number;
61
61
  };
62
62
 
63
- type ScreenSpecs = {
64
- width: number;
65
- height: number;
66
- paddingTop: number;
67
- paddingBottom: number;
68
- paddingLeft: number;
69
- paddingRight: number;
70
- };
71
-
72
63
  export type LoadImageRequest = {
73
64
  hexImage: string; // When provided, will skip the backup if it matches the hash.
74
65
  padImage?: boolean;
@@ -268,6 +259,11 @@ function padHexImage(hexImage: string, screenSpecs: ScreenSpecs): string {
268
259
  return result;
269
260
  }
270
261
 
262
+ const bitsPerPixelToBppIndicator: Record<ScreenSpecs["bitsPerPixel"], number> = {
263
+ 1: 0,
264
+ 4: 2,
265
+ };
266
+
271
267
  export async function generateCustomLockScreenImageFormat(
272
268
  hexImage: string,
273
269
  compressImage: boolean,
@@ -276,7 +272,7 @@ export async function generateCustomLockScreenImageFormat(
276
272
  ) {
277
273
  const width = screenSpecs.width;
278
274
  const height = screenSpecs.height;
279
- const bpp = 2; // value for 4 bits per pixel
275
+ const bpp = bitsPerPixelToBppIndicator[screenSpecs.bitsPerPixel];
280
276
  const compression = compressImage ? 1 : 0;
281
277
 
282
278
  const header = Buffer.alloc(8);