@ledgerhq/live-common 34.41.0 → 34.42.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 (253) hide show
  1. package/lib/DataModel.js +2 -2
  2. package/lib/DataModel.js.map +1 -1
  3. package/lib/DataModel.test.js +4 -4
  4. package/lib/DataModel.test.js.map +1 -1
  5. package/lib/apps/config.js +1 -1
  6. package/lib/bridge/crypto-assets/index.d.ts +4 -0
  7. package/lib/bridge/crypto-assets/index.d.ts.map +1 -0
  8. package/lib/bridge/crypto-assets/index.js +52 -0
  9. package/lib/bridge/crypto-assets/index.js.map +1 -0
  10. package/lib/bridge/crypto-assets/index.test.d.ts +2 -0
  11. package/lib/bridge/crypto-assets/index.test.d.ts.map +1 -0
  12. package/lib/bridge/crypto-assets/index.test.js +69 -0
  13. package/lib/bridge/crypto-assets/index.test.js.map +1 -0
  14. package/lib/bridge/crypto-assets/type.d.ts +9 -0
  15. package/lib/bridge/crypto-assets/type.d.ts.map +1 -0
  16. package/lib/bridge/crypto-assets/type.js +3 -0
  17. package/lib/bridge/crypto-assets/type.js.map +1 -0
  18. package/lib/bridge/generic-alpaca/getAccountShape.js +1 -1
  19. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  20. package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  21. package/lib/bridge/generic-alpaca/signOperation.js +3 -4
  22. package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
  23. package/lib/bridge/impl.d.ts +2 -0
  24. package/lib/bridge/impl.d.ts.map +1 -1
  25. package/lib/bridge/impl.js +6 -1
  26. package/lib/bridge/impl.js.map +1 -1
  27. package/lib/bridge/useBridgeTransaction.test.js +1 -1
  28. package/lib/bridge/useBridgeTransaction.test.js.map +1 -1
  29. package/lib/e2e/enum/DeviceLabels.d.ts +3 -5
  30. package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
  31. package/lib/e2e/enum/DeviceLabels.js +3 -5
  32. package/lib/e2e/enum/DeviceLabels.js.map +1 -1
  33. package/lib/e2e/families/aptos.d.ts +2 -0
  34. package/lib/e2e/families/aptos.d.ts.map +1 -1
  35. package/lib/e2e/families/aptos.js +13 -1
  36. package/lib/e2e/families/aptos.js.map +1 -1
  37. package/lib/e2e/families/cardano.d.ts.map +1 -1
  38. package/lib/e2e/families/cardano.js +29 -26
  39. package/lib/e2e/families/cardano.js.map +1 -1
  40. package/lib/e2e/families/celo.js +1 -1
  41. package/lib/e2e/families/celo.js.map +1 -1
  42. package/lib/e2e/families/evm.js +1 -1
  43. package/lib/e2e/families/evm.js.map +1 -1
  44. package/lib/e2e/index.d.ts +4 -0
  45. package/lib/e2e/index.d.ts.map +1 -1
  46. package/lib/e2e/speculos.d.ts +1 -0
  47. package/lib/e2e/speculos.d.ts.map +1 -1
  48. package/lib/e2e/speculos.js +30 -20
  49. package/lib/e2e/speculos.js.map +1 -1
  50. package/lib/env.react.d.ts +1 -1
  51. package/lib/env.react.d.ts.map +1 -1
  52. package/lib/families/aptos/config.d.ts +4 -0
  53. package/lib/families/aptos/config.d.ts.map +1 -0
  54. package/lib/families/aptos/config.js +13 -0
  55. package/lib/families/aptos/config.js.map +1 -0
  56. package/lib/families/aptos/constants.d.ts +2 -0
  57. package/lib/families/aptos/constants.d.ts.map +1 -0
  58. package/lib/families/aptos/constants.js +19 -0
  59. package/lib/families/aptos/constants.js.map +1 -0
  60. package/lib/families/aptos/logic.d.ts +2 -0
  61. package/lib/families/aptos/logic.d.ts.map +1 -0
  62. package/lib/families/aptos/logic.js +19 -0
  63. package/lib/families/aptos/logic.js.map +1 -0
  64. package/lib/families/aptos/react.d.ts +10 -0
  65. package/lib/families/aptos/react.d.ts.map +1 -0
  66. package/lib/families/aptos/react.js +56 -0
  67. package/lib/families/aptos/react.js.map +1 -0
  68. package/lib/families/aptos/setup.d.ts +1 -1
  69. package/lib/families/aptos/setup.d.ts.map +1 -1
  70. package/lib/families/aptos/setup.js +1 -1
  71. package/lib/families/aptos/setup.js.map +1 -1
  72. package/lib/families/aptos/staking.d.ts +2 -0
  73. package/lib/families/aptos/staking.d.ts.map +1 -0
  74. package/lib/families/aptos/staking.js +19 -0
  75. package/lib/families/aptos/staking.js.map +1 -0
  76. package/lib/families/aptos/types.d.ts +2 -0
  77. package/lib/families/aptos/types.d.ts.map +1 -0
  78. package/lib/families/aptos/types.js +19 -0
  79. package/lib/families/aptos/types.js.map +1 -0
  80. package/lib/families/aptos/utils.d.ts +2 -0
  81. package/lib/families/aptos/utils.d.ts.map +1 -0
  82. package/lib/families/aptos/utils.js +19 -0
  83. package/lib/families/aptos/utils.js.map +1 -0
  84. package/lib/families/evm/walletApiAdapter.js +1 -1
  85. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  86. package/lib/featureFlags/defaultFeatures.js +1 -0
  87. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  88. package/lib/featureFlags/useFeature.d.ts +1 -1
  89. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  90. package/lib/generated/bridge/js.d.ts +1 -1
  91. package/lib/generated/cli-transaction.d.ts +2 -2
  92. package/lib/generated/deviceTransactionConfig.d.ts +1 -2
  93. package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
  94. package/lib/generated/specs.d.ts +1 -1
  95. package/lib/generated/transaction.d.ts +3 -3
  96. package/lib/modularDrawer/utils/index.d.ts +6 -0
  97. package/lib/modularDrawer/utils/index.d.ts.map +1 -0
  98. package/lib/modularDrawer/utils/index.js +21 -0
  99. package/lib/modularDrawer/utils/index.js.map +1 -0
  100. package/lib/modularDrawer/utils/index.test.d.ts +2 -0
  101. package/lib/modularDrawer/utils/index.test.d.ts.map +1 -0
  102. package/lib/modularDrawer/utils/index.test.js +64 -0
  103. package/lib/modularDrawer/utils/index.test.js.map +1 -0
  104. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  105. package/lib/wallet-api/Exchange/server.js +0 -1
  106. package/lib/wallet-api/Exchange/server.js.map +1 -1
  107. package/lib-es/DataModel.js +1 -1
  108. package/lib-es/DataModel.js.map +1 -1
  109. package/lib-es/DataModel.test.js +2 -2
  110. package/lib-es/DataModel.test.js.map +1 -1
  111. package/lib-es/apps/config.js +1 -1
  112. package/lib-es/bridge/crypto-assets/index.d.ts +4 -0
  113. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -0
  114. package/lib-es/bridge/crypto-assets/index.js +24 -0
  115. package/lib-es/bridge/crypto-assets/index.js.map +1 -0
  116. package/lib-es/bridge/crypto-assets/index.test.d.ts +2 -0
  117. package/lib-es/bridge/crypto-assets/index.test.d.ts.map +1 -0
  118. package/lib-es/bridge/crypto-assets/index.test.js +44 -0
  119. package/lib-es/bridge/crypto-assets/index.test.js.map +1 -0
  120. package/lib-es/bridge/crypto-assets/type.d.ts +9 -0
  121. package/lib-es/bridge/crypto-assets/type.d.ts.map +1 -0
  122. package/lib-es/bridge/crypto-assets/type.js +2 -0
  123. package/lib-es/bridge/crypto-assets/type.js.map +1 -0
  124. package/lib-es/bridge/generic-alpaca/getAccountShape.js +1 -1
  125. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  126. package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  127. package/lib-es/bridge/generic-alpaca/signOperation.js +3 -4
  128. package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
  129. package/lib-es/bridge/impl.d.ts +2 -0
  130. package/lib-es/bridge/impl.d.ts.map +1 -1
  131. package/lib-es/bridge/impl.js +4 -0
  132. package/lib-es/bridge/impl.js.map +1 -1
  133. package/lib-es/bridge/useBridgeTransaction.test.js +1 -1
  134. package/lib-es/bridge/useBridgeTransaction.test.js.map +1 -1
  135. package/lib-es/e2e/enum/DeviceLabels.d.ts +3 -5
  136. package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
  137. package/lib-es/e2e/enum/DeviceLabels.js +3 -5
  138. package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
  139. package/lib-es/e2e/families/aptos.d.ts +2 -0
  140. package/lib-es/e2e/families/aptos.d.ts.map +1 -1
  141. package/lib-es/e2e/families/aptos.js +9 -1
  142. package/lib-es/e2e/families/aptos.js.map +1 -1
  143. package/lib-es/e2e/families/cardano.d.ts.map +1 -1
  144. package/lib-es/e2e/families/cardano.js +29 -26
  145. package/lib-es/e2e/families/cardano.js.map +1 -1
  146. package/lib-es/e2e/families/celo.js +1 -1
  147. package/lib-es/e2e/families/celo.js.map +1 -1
  148. package/lib-es/e2e/families/evm.js +1 -1
  149. package/lib-es/e2e/families/evm.js.map +1 -1
  150. package/lib-es/e2e/index.d.ts +4 -0
  151. package/lib-es/e2e/index.d.ts.map +1 -1
  152. package/lib-es/e2e/speculos.d.ts +1 -0
  153. package/lib-es/e2e/speculos.d.ts.map +1 -1
  154. package/lib-es/e2e/speculos.js +28 -19
  155. package/lib-es/e2e/speculos.js.map +1 -1
  156. package/lib-es/env.react.d.ts +1 -1
  157. package/lib-es/env.react.d.ts.map +1 -1
  158. package/lib-es/families/aptos/config.d.ts +4 -0
  159. package/lib-es/families/aptos/config.d.ts.map +1 -0
  160. package/lib-es/families/aptos/config.js +10 -0
  161. package/lib-es/families/aptos/config.js.map +1 -0
  162. package/lib-es/families/aptos/constants.d.ts +2 -0
  163. package/lib-es/families/aptos/constants.d.ts.map +1 -0
  164. package/lib-es/families/aptos/constants.js +3 -0
  165. package/lib-es/families/aptos/constants.js.map +1 -0
  166. package/lib-es/families/aptos/logic.d.ts +2 -0
  167. package/lib-es/families/aptos/logic.d.ts.map +1 -0
  168. package/lib-es/families/aptos/logic.js +3 -0
  169. package/lib-es/families/aptos/logic.js.map +1 -0
  170. package/lib-es/families/aptos/react.d.ts +10 -0
  171. package/lib-es/families/aptos/react.d.ts.map +1 -0
  172. package/lib-es/families/aptos/react.js +49 -0
  173. package/lib-es/families/aptos/react.js.map +1 -0
  174. package/lib-es/families/aptos/setup.d.ts +1 -1
  175. package/lib-es/families/aptos/setup.d.ts.map +1 -1
  176. package/lib-es/families/aptos/setup.js +1 -1
  177. package/lib-es/families/aptos/setup.js.map +1 -1
  178. package/lib-es/families/aptos/staking.d.ts +2 -0
  179. package/lib-es/families/aptos/staking.d.ts.map +1 -0
  180. package/lib-es/families/aptos/staking.js +3 -0
  181. package/lib-es/families/aptos/staking.js.map +1 -0
  182. package/lib-es/families/aptos/types.d.ts +2 -0
  183. package/lib-es/families/aptos/types.d.ts.map +1 -0
  184. package/lib-es/families/aptos/types.js +3 -0
  185. package/lib-es/families/aptos/types.js.map +1 -0
  186. package/lib-es/families/aptos/utils.d.ts +2 -0
  187. package/lib-es/families/aptos/utils.d.ts.map +1 -0
  188. package/lib-es/families/aptos/utils.js +3 -0
  189. package/lib-es/families/aptos/utils.js.map +1 -0
  190. package/lib-es/families/evm/walletApiAdapter.js +1 -1
  191. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  192. package/lib-es/featureFlags/defaultFeatures.js +1 -0
  193. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  194. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  195. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  196. package/lib-es/generated/bridge/js.d.ts +1 -1
  197. package/lib-es/generated/cli-transaction.d.ts +2 -2
  198. package/lib-es/generated/deviceTransactionConfig.d.ts +1 -2
  199. package/lib-es/generated/deviceTransactionConfig.d.ts.map +1 -1
  200. package/lib-es/generated/specs.d.ts +1 -1
  201. package/lib-es/generated/transaction.d.ts +3 -3
  202. package/lib-es/modularDrawer/utils/index.d.ts +6 -0
  203. package/lib-es/modularDrawer/utils/index.d.ts.map +1 -0
  204. package/lib-es/modularDrawer/utils/index.js +17 -0
  205. package/lib-es/modularDrawer/utils/index.js.map +1 -0
  206. package/lib-es/modularDrawer/utils/index.test.d.ts +2 -0
  207. package/lib-es/modularDrawer/utils/index.test.d.ts.map +1 -0
  208. package/lib-es/modularDrawer/utils/index.test.js +62 -0
  209. package/lib-es/modularDrawer/utils/index.test.js.map +1 -0
  210. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  211. package/lib-es/wallet-api/Exchange/server.js +0 -1
  212. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  213. package/package.json +57 -57
  214. package/src/DataModel.test.ts +5 -4
  215. package/src/DataModel.ts +1 -1
  216. package/src/apps/config.ts +1 -1
  217. package/src/bridge/crypto-assets/index.test.ts +53 -0
  218. package/src/bridge/crypto-assets/index.ts +30 -0
  219. package/src/bridge/crypto-assets/type.ts +9 -0
  220. package/src/bridge/generic-alpaca/getAccountShape.ts +1 -1
  221. package/src/bridge/generic-alpaca/signOperation.ts +5 -7
  222. package/src/bridge/impl.ts +6 -0
  223. package/src/bridge/useBridgeTransaction.test.ts +1 -1
  224. package/src/e2e/enum/DeviceLabels.ts +3 -5
  225. package/src/e2e/families/aptos.ts +11 -1
  226. package/src/e2e/families/cardano.ts +31 -29
  227. package/src/e2e/families/celo.ts +1 -1
  228. package/src/e2e/families/evm.ts +1 -1
  229. package/src/e2e/speculos.ts +33 -23
  230. package/src/families/aptos/__snapshots__/bridge.integration.test.ts.snap +84 -3
  231. package/src/families/aptos/config.ts +12 -0
  232. package/src/families/aptos/constants.ts +2 -0
  233. package/src/families/aptos/logic.ts +2 -0
  234. package/src/families/aptos/react.ts +89 -0
  235. package/src/families/aptos/setup.ts +2 -7
  236. package/src/families/aptos/staking.ts +2 -0
  237. package/src/families/aptos/types.ts +2 -0
  238. package/src/families/aptos/utils.ts +2 -0
  239. package/src/families/evm/walletApiAdapter.ts +1 -1
  240. package/src/featureFlags/defaultFeatures.ts +1 -0
  241. package/src/generated/deviceTransactionConfig.ts +0 -2
  242. package/src/modularDrawer/utils/index.test.ts +74 -0
  243. package/src/modularDrawer/utils/index.ts +29 -0
  244. package/src/wallet-api/Exchange/server.ts +0 -2
  245. package/lib/families/aptos/consts.d.ts +0 -4
  246. package/lib/families/aptos/consts.d.ts.map +0 -1
  247. package/lib/families/aptos/consts.js +0 -7
  248. package/lib/families/aptos/consts.js.map +0 -1
  249. package/lib-es/families/aptos/consts.d.ts +0 -4
  250. package/lib-es/families/aptos/consts.d.ts.map +0 -1
  251. package/lib-es/families/aptos/consts.js +0 -4
  252. package/lib-es/families/aptos/consts.js.map +0 -1
  253. package/src/families/aptos/consts.ts +0 -3
@@ -1,7 +1,17 @@
1
- import { pressBoth, pressUntilTextFound } from "../speculos";
1
+ import expect from "expect";
2
+ import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos";
2
3
  import { DeviceLabels } from "../enum/DeviceLabels";
4
+ import { Delegate } from "../models/Delegate";
3
5
 
4
6
  export async function sendAptos() {
5
7
  await pressUntilTextFound(DeviceLabels.APPROVE);
6
8
  await pressBoth();
7
9
  }
10
+
11
+ export async function delegateAptos(delegatingAccount: Delegate) {
12
+ await waitFor(DeviceLabels.REVIEW_OPERATION);
13
+ const events = await pressUntilTextFound(DeviceLabels.APPROVE);
14
+ const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
15
+ expect(isAmountCorrect).toBeTruthy();
16
+ await pressBoth();
17
+ }
@@ -29,7 +29,7 @@ export async function sendCardano(tx: Transaction) {
29
29
  await pressBoth();
30
30
  await waitFor(DeviceLabels.TRANSACTION_FEE);
31
31
  await pressBoth();
32
- await waitFor(DeviceLabels.CONFIRM_TRANSACTION);
32
+ await waitFor(DeviceLabels.CONFIRM);
33
33
  if (isNanoS) {
34
34
  await pressRightButton();
35
35
  } else {
@@ -41,38 +41,40 @@ export async function sendCardano(tx: Transaction) {
41
41
 
42
42
  export async function delegateCardano() {
43
43
  const commonSteps = [
44
- { label: DeviceLabels.NEW_ORDINARY, action: "both" },
45
- { label: DeviceLabels.TRANSACTION_FEE, action: "both" },
46
- { label: DeviceLabels.REGISTER, action: "both" },
47
- { label: DeviceLabels.STAKE_KEY, action: "both" },
48
- { label: DeviceLabels.CONFIRM, action: "both" },
49
- { label: DeviceLabels.DELEGATE_STAKE, action: "both" },
50
- { label: DeviceLabels.STAKE_KEY, action: "both" },
51
- { label: DeviceLabels.CONFIRM, action: "both" },
52
- { label: DeviceLabels.CONFIRM, action: "both" },
53
- ];
44
+ [DeviceLabels.NEW_ORDINARY, "both"],
45
+ [DeviceLabels.TRANSACTION_FEE, "both"],
46
+ [DeviceLabels.REGISTER, "both"],
47
+ [DeviceLabels.STAKE_KEY, "both"],
48
+ [DeviceLabels.DEPOSIT, "both"],
49
+ [DeviceLabels.CONFIRM, "both"],
50
+ [DeviceLabels.DELEGATE_STAKE, "both"],
51
+ [DeviceLabels.STAKE_KEY, "both"],
52
+ [DeviceLabels.CONFIRM, "both"],
53
+ [DeviceLabels.CONFIRM, "both"],
54
+ ] as const;
54
55
 
55
56
  const LNSSpecificSteps = [
56
- { label: DeviceLabels.NEW_ORDINARY, action: "right" },
57
- { label: DeviceLabels.TRANSACTION_FEE, action: "both" },
58
- { label: DeviceLabels.REGISTER, action: "both" },
59
- { label: DeviceLabels.STAKE_KEY, action: "both" },
60
- { label: DeviceLabels.CONFIRM, action: "right" },
61
- { label: DeviceLabels.DELEGATE_STAKE, action: "both" },
62
- { label: DeviceLabels.STAKE_KEY, action: "both" },
63
- { label: DeviceLabels.CONFIRM, action: "right" },
64
- { label: DeviceLabels.CONFIRM, action: "right" },
65
- ];
57
+ [DeviceLabels.NEW_ORDINARY, "right"],
58
+ [DeviceLabels.TRANSACTION_FEE, "both"],
59
+ [DeviceLabels.REGISTER, "both"],
60
+ [DeviceLabels.STAKE_KEY, "both"],
61
+ [DeviceLabels.CONFIRM, "right"],
62
+ [DeviceLabels.DELEGATE_STAKE, "both"],
63
+ [DeviceLabels.STAKE_KEY, "both"],
64
+ [DeviceLabels.CONFIRM, "right"],
65
+ [DeviceLabels.CONFIRM, "right"],
66
+ ] as const;
66
67
 
67
- const stepsToExecute =
68
- process.env.SPECULOS_DEVICE === Device.LNS ? LNSSpecificSteps : commonSteps;
68
+ const steps = process.env.SPECULOS_DEVICE === Device.LNS ? LNSSpecificSteps : commonSteps;
69
69
 
70
- for (const step of stepsToExecute) {
71
- await waitFor(step.label);
72
- if (step.action === "both") {
73
- await pressBoth();
74
- } else if (step.action === "right") {
75
- await pressRightButton();
70
+ for (const [label, action] of steps) {
71
+ try {
72
+ await waitFor(label);
73
+ action === "both" ? await pressBoth() : await pressRightButton();
74
+ } catch (error) {
75
+ const message = error instanceof Error ? error.message : String(error);
76
+ console.error(`Error while waiting for "${label}":`, message);
77
+ break;
76
78
  }
77
79
  }
78
80
  }
@@ -4,7 +4,7 @@ import { Delegate } from "../models/Delegate";
4
4
  import expect from "expect";
5
5
 
6
6
  export async function delegateCelo(tx: Delegate) {
7
- await waitFor(DeviceLabels.REVIEW_TRANSACTION);
7
+ await waitFor(DeviceLabels.REVIEW_OPERATION);
8
8
  const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
9
9
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
10
10
  expect(isAmountCorrect).toBeTruthy();
@@ -20,7 +20,7 @@ export async function sendEVM(tx: Transaction) {
20
20
  }
21
21
 
22
22
  export async function sendEvmNFT(tx: NFTTransaction) {
23
- await waitFor(DeviceLabels.REVIEW_TRANSACTION);
23
+ await waitFor(DeviceLabels.REVIEW_OPERATION);
24
24
  const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
25
25
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
26
26
  expect(isAddressCorrect).toBeTruthy();
@@ -33,6 +33,7 @@ import { delegateCosmos, sendCosmos } from "./families/cosmos";
33
33
  import { delegateSolana, sendSolana } from "./families/solana";
34
34
  import { delegateTezos } from "./families/tezos";
35
35
  import { delegateCelo } from "./families/celo";
36
+ import { delegateAptos } from "./families/aptos";
36
37
  import { delegateMultiversX } from "./families/multiversX";
37
38
  import { NFTTransaction, Transaction } from "./models/Transaction";
38
39
  import { Delegate } from "./models/Delegate";
@@ -413,26 +414,23 @@ interface ResponseData {
413
414
  events: Event[];
414
415
  }
415
416
 
416
- export async function waitFor(text: string, maxAttempts: number = 10): Promise<string[]> {
417
- const speculosApiPort = getEnv("SPECULOS_API_PORT");
418
- const speculosAddress = process.env.SPECULOS_ADDRESS || "http://127.0.0.1";
419
- let attempts = 0;
420
- let textFound: boolean = false;
421
- while (attempts < maxAttempts && !textFound) {
422
- const response = await axios.get<ResponseData>(
423
- `${speculosAddress}:${speculosApiPort}/events?stream=false&currentscreenonly=true`,
424
- );
425
- const responseData = response.data;
426
- const texts = responseData.events.map(event => event.text);
427
-
428
- if (texts?.[0]?.includes(text)) {
429
- textFound = true;
417
+ export async function waitFor(text: string, maxAttempts = 10): Promise<string[]> {
418
+ const port = getEnv("SPECULOS_API_PORT");
419
+ const address = process.env.SPECULOS_ADDRESS || "http://127.0.0.1";
420
+ const url = `${address}:${port}/events?stream=false&currentscreenonly=true`;
421
+
422
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
423
+ const { data } = await axios.get<ResponseData>(url);
424
+ const texts = data.events.map(event => event.text);
425
+
426
+ if (texts?.some(t => t?.toLowerCase().includes(text.toLowerCase()))) {
430
427
  return texts;
431
428
  }
432
- attempts++;
429
+
433
430
  await waitForTimeOut(500);
434
431
  }
435
- return [];
432
+
433
+ throw new Error(`Text "${text}" not found on device screen after ${maxAttempts} attempts.`);
436
434
  }
437
435
 
438
436
  export async function pressBoth() {
@@ -558,6 +556,11 @@ export async function activateContractData() {
558
556
  await pressBoth();
559
557
  }
560
558
 
559
+ export async function goToSettings() {
560
+ await pressUntilTextFound(DeviceLabels.SETTINGS);
561
+ await pressBoth();
562
+ }
563
+
561
564
  export async function expectValidAddressDevice(account: Account, addressDisplayed: string) {
562
565
  let deviceLabels: string[];
563
566
 
@@ -567,7 +570,11 @@ export async function expectValidAddressDevice(account: Account, addressDisplaye
567
570
  break;
568
571
  case Currency.DOT:
569
572
  case Currency.ATOM:
570
- deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.CAPS_APPROVE, DeviceLabels.CAPS_REJECT];
573
+ deviceLabels = [
574
+ DeviceLabels.PLEASE_REVIEW,
575
+ DeviceLabels.CAPS_APPROVE,
576
+ DeviceLabels.CAPS_REJECT,
577
+ ];
571
578
  break;
572
579
  case Currency.BTC:
573
580
  deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.CONFIRM, DeviceLabels.CANCEL];
@@ -631,12 +638,10 @@ export async function signSendTransaction(tx: Transaction) {
631
638
 
632
639
  export async function signSendNFTTransaction(tx: NFTTransaction) {
633
640
  const currencyName = tx.accountToDebit.currency;
634
- switch (currencyName) {
635
- case Currency.ETH:
636
- await sendEvmNFT(tx);
637
- break;
638
- default:
639
- throw new Error(`Unsupported currency: ${currencyName.ticker}`);
641
+ if (currencyName === Currency.ETH) {
642
+ await sendEvmNFT(tx);
643
+ } else {
644
+ throw new Error(`Unsupported currency: ${currencyName.ticker}`);
640
645
  }
641
646
  }
642
647
 
@@ -666,18 +671,23 @@ export async function signDelegationTransaction(delegatingAccount: Delegate) {
666
671
  case Account.CELO_1.currency.name:
667
672
  await delegateCelo(delegatingAccount);
668
673
  break;
674
+ case Account.APTOS_1.currency.name:
675
+ await delegateAptos(delegatingAccount);
676
+ break;
669
677
  default:
670
678
  throw new Error(`Unsupported currency: ${currencyName}`);
671
679
  }
672
680
  }
673
681
 
674
682
  export async function verifyAmountsAndAcceptSwap(swap: Swap, amount: string) {
683
+ await waitFor(DeviceLabels.REVIEW_OPERATION);
675
684
  const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
676
685
  await verifySwapData(swap, events, amount);
677
686
  await pressBoth();
678
687
  }
679
688
 
680
689
  export async function verifyAmountsAndRejectSwap(swap: Swap, amount: string) {
690
+ await waitFor(DeviceLabels.REVIEW_OPERATION);
681
691
  const events = await pressUntilTextFound(DeviceLabels.REJECT);
682
692
  await verifySwapData(swap, events, amount);
683
693
  await pressBoth();
@@ -3,6 +3,12 @@
3
3
  exports[`aptos currency bridge scanAccounts aptos seed 1 1`] = `
4
4
  [
5
5
  {
6
+ "aptosResources": {
7
+ "activeBalance": "0",
8
+ "inactiveBalance": "0",
9
+ "pendingInactiveBalance": "0",
10
+ "stakingPositions": [],
11
+ },
6
12
  "balance": "19949100",
7
13
  "currencyId": "aptos",
8
14
  "derivationMode": "aptos",
@@ -21,17 +27,23 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 1`] = `
21
27
  "xpub": "d1a8c6a1cdd52dd40c7ea61ee4571fb51fcae440a594c1eca18636928f1d3956",
22
28
  },
23
29
  {
24
- "balance": "20020000",
30
+ "aptosResources": {
31
+ "activeBalance": "0",
32
+ "inactiveBalance": "0",
33
+ "pendingInactiveBalance": "0",
34
+ "stakingPositions": [],
35
+ },
36
+ "balance": "20050000",
25
37
  "currencyId": "aptos",
26
38
  "derivationMode": "aptos",
27
39
  "freshAddress": "0xd20fa44192f94ba086ab16bfdf57e43ff118ada69b4c66fa9b9a9223cbc068c1",
28
40
  "freshAddressPath": "44'/637'/1'/0'/0'",
29
41
  "id": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos",
30
42
  "index": 1,
31
- "operationsCount": 2,
43
+ "operationsCount": 5,
32
44
  "pendingOperations": [],
33
45
  "seedIdentifier": "d6816f4f22f867b56cf9304b776f452a16d107835d73ee8a33c4ced210300583",
34
- "spendableBalance": "20020000",
46
+ "spendableBalance": "20050000",
35
47
  "subAccounts": [],
36
48
  "swapHistory": [],
37
49
  "syncHash": undefined,
@@ -39,6 +51,12 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 1`] = `
39
51
  "xpub": "6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e",
40
52
  },
41
53
  {
54
+ "aptosResources": {
55
+ "activeBalance": "0",
56
+ "inactiveBalance": "0",
57
+ "pendingInactiveBalance": "0",
58
+ "stakingPositions": [],
59
+ },
42
60
  "balance": "0",
43
61
  "currencyId": "aptos",
44
62
  "derivationMode": "aptos",
@@ -211,6 +229,27 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
211
229
  },
212
230
  ],
213
231
  [
232
+ {
233
+ "accountId": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos",
234
+ "blockHash": "0xb71a59a5f43dc73c945da97ef88043721dab81f658df7a4a4207f95ce7cad0ee",
235
+ "blockHeight": 366009981,
236
+ "extra": {
237
+ "version": "2901622402",
238
+ },
239
+ "fee": "1100",
240
+ "hasFailed": false,
241
+ "hash": "0x1acd500f32be88a62692698502a296dcb977e5629bbbf12e448bc69737c18c40",
242
+ "id": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos-0x1acd500f32be88a62692698502a296dcb977e5629bbbf12e448bc69737c18c40-IN",
243
+ "recipients": [
244
+ "0xd20fa44192f94ba086ab16bfdf57e43ff118ada69b4c66fa9b9a9223cbc068c1",
245
+ ],
246
+ "senders": [
247
+ "0xb69a68cc64f7aa193705193f4dd598320a0a74baf7e4b50c9980c5bd60a82390",
248
+ ],
249
+ "transactionSequenceNumber": 179,
250
+ "type": "IN",
251
+ "value": "10000",
252
+ },
214
253
  {
215
254
  "accountId": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos",
216
255
  "blockHash": "0x27db591a136924b48d10e6e152a3e856a5c38b332654767da252851adbb454b2",
@@ -232,6 +271,48 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
232
271
  "type": "IN",
233
272
  "value": "20000000",
234
273
  },
274
+ {
275
+ "accountId": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos",
276
+ "blockHash": "0xadfce17fba19584616fec77888c41c1bacd18ef8702dfe07ccfbfeafd8edfd17",
277
+ "blockHeight": 366013582,
278
+ "extra": {
279
+ "version": "2901672541",
280
+ },
281
+ "fee": "1100",
282
+ "hasFailed": false,
283
+ "hash": "0x494582adf8f3e2748a30453a687106524f18296bf5924e3c1ead8a2503894970",
284
+ "id": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos-0x494582adf8f3e2748a30453a687106524f18296bf5924e3c1ead8a2503894970-IN",
285
+ "recipients": [
286
+ "0xd20fa44192f94ba086ab16bfdf57e43ff118ada69b4c66fa9b9a9223cbc068c1",
287
+ ],
288
+ "senders": [
289
+ "0xb69a68cc64f7aa193705193f4dd598320a0a74baf7e4b50c9980c5bd60a82390",
290
+ ],
291
+ "transactionSequenceNumber": 182,
292
+ "type": "IN",
293
+ "value": "10000",
294
+ },
295
+ {
296
+ "accountId": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos",
297
+ "blockHash": "0x1647b469fb104624e4e0a9b7f0b0368facec96a232cde5f83be1235c1068b038",
298
+ "blockHeight": 366012016,
299
+ "extra": {
300
+ "version": "2901651004",
301
+ },
302
+ "fee": "1100",
303
+ "hasFailed": false,
304
+ "hash": "0x4f42472b8c92d3d6083d05a3a357f38ed97491f5e0750058da49cc04cef82794",
305
+ "id": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos-0x4f42472b8c92d3d6083d05a3a357f38ed97491f5e0750058da49cc04cef82794-IN",
306
+ "recipients": [
307
+ "0xd20fa44192f94ba086ab16bfdf57e43ff118ada69b4c66fa9b9a9223cbc068c1",
308
+ ],
309
+ "senders": [
310
+ "0xb69a68cc64f7aa193705193f4dd598320a0a74baf7e4b50c9980c5bd60a82390",
311
+ ],
312
+ "transactionSequenceNumber": 181,
313
+ "type": "IN",
314
+ "value": "10000",
315
+ },
235
316
  {
236
317
  "accountId": "js:2:aptos:6a7712fdac0cb4ed27076c707e7798be52cf6c93a2d43d5cf9b874d0a45a111e:aptos",
237
318
  "blockHash": "0xf37ce698cf2e6d9e4a0048cd6d09fb3f19f417ab8251a3cc1f19b8d0e503538f",
@@ -0,0 +1,12 @@
1
+ import { CurrencyLiveConfigDefinition } from "../../config";
2
+
3
+ const aptosConfig: CurrencyLiveConfigDefinition = {
4
+ config_currency_aptos: {
5
+ type: "object",
6
+ default: {
7
+ status: { type: "active" },
8
+ },
9
+ },
10
+ };
11
+
12
+ export { aptosConfig };
@@ -0,0 +1,2 @@
1
+ // Encapsulate for LLD and LLM
2
+ export * from "@ledgerhq/coin-aptos/constants";
@@ -0,0 +1,2 @@
1
+ // Encapsulate for LLD and LLM
2
+ export * from "@ledgerhq/coin-aptos/bridge/logic";
@@ -0,0 +1,89 @@
1
+ import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
2
+ import { useMemo } from "react";
3
+ import { getCurrentAptosPreloadData, getAptosPreloadData } from "@ledgerhq/coin-aptos/preload-data";
4
+ import type {
5
+ AptosAccount,
6
+ AptosMappedStakingPosition,
7
+ AptosPreloadData,
8
+ AptosValidator,
9
+ Transaction,
10
+ } from "./types";
11
+ import { useObservable } from "../../observable";
12
+ import { getAccountCurrency } from "../../account";
13
+ import { mapStakingPositions } from "./staking";
14
+
15
+ export function useAptosPreloadData(currency: CryptoCurrency): AptosPreloadData | undefined | null {
16
+ return useObservable(getAptosPreloadData(currency), getCurrentAptosPreloadData(currency));
17
+ }
18
+
19
+ export function useAptosValidators(currency: CryptoCurrency, search?: string): AptosValidator[] {
20
+ const data = useAptosPreloadData(currency);
21
+
22
+ return useMemo(() => {
23
+ const validators = data?.validators ?? [];
24
+
25
+ if (validators.length === 0 || !search || search === "") {
26
+ return validators;
27
+ }
28
+
29
+ const lowercaseSearch = search.toLowerCase();
30
+
31
+ const filtered = validators.filter(
32
+ validator =>
33
+ validator.name?.toLowerCase().includes(lowercaseSearch) ||
34
+ validator.address.toLowerCase().includes(lowercaseSearch),
35
+ );
36
+
37
+ const flags = [];
38
+ const output: AptosValidator[] = [];
39
+ for (let i = 0; i < filtered.length; i++) {
40
+ if (flags[filtered[i].address]) continue;
41
+ flags[filtered[i].address] = true;
42
+ output.push(filtered[i]);
43
+ }
44
+ return output;
45
+ }, [data, search]);
46
+ }
47
+
48
+ export function useAptosMappedStakingPositions(
49
+ account: AptosAccount,
50
+ ): AptosMappedStakingPosition[] {
51
+ const validators = useAptosValidators(account.currency, "");
52
+ const stakingPositions = account.aptosResources?.stakingPositions;
53
+
54
+ const unit = getAccountCurrency(account).units[0];
55
+
56
+ return useMemo(() => {
57
+ const mappedStakingPositions = mapStakingPositions(stakingPositions || [], validators, unit);
58
+ return mappedStakingPositions;
59
+ }, [stakingPositions, validators, unit]);
60
+ }
61
+
62
+ export function useAptosStakingPositionsQuerySelector(
63
+ account: AptosAccount,
64
+ transaction: Transaction,
65
+ ): {
66
+ options: AptosMappedStakingPosition[];
67
+ value: AptosMappedStakingPosition | undefined;
68
+ } {
69
+ const stakingPositions = useAptosMappedStakingPositions(account);
70
+ const options = useMemo<AptosMappedStakingPosition[]>(
71
+ () =>
72
+ stakingPositions.filter(sp =>
73
+ transaction.mode === "unstake" ? sp.active.gt(0) : sp.inactive.gt(0),
74
+ ),
75
+ [stakingPositions, transaction],
76
+ );
77
+
78
+ const selectedValidatorAddress = transaction.recipient;
79
+
80
+ const value = useMemo(
81
+ () => stakingPositions.find(({ validatorId }) => validatorId === selectedValidatorAddress),
82
+ [stakingPositions, selectedValidatorAddress],
83
+ );
84
+
85
+ return {
86
+ options,
87
+ value,
88
+ };
89
+ }
@@ -1,11 +1,6 @@
1
1
  // Goal of this file is to inject all necessary device/signer dependency to coin-modules
2
-
3
- import {
4
- AptosAccount,
5
- TransactionStatus,
6
- createBridges,
7
- type Transaction,
8
- } from "@ledgerhq/coin-aptos";
2
+ import { createBridges } from "@ledgerhq/coin-aptos";
3
+ import { AptosAccount, TransactionStatus, type Transaction } from "@ledgerhq/coin-aptos/types";
9
4
  import Transport from "@ledgerhq/hw-transport";
10
5
  import Aptos from "@ledgerhq/hw-app-aptos";
11
6
  import type { Bridge } from "@ledgerhq/types-live";
@@ -0,0 +1,2 @@
1
+ // Encapsulate for LLD et LLM
2
+ export * from "@ledgerhq/coin-aptos/logic/staking";
@@ -0,0 +1,2 @@
1
+ // Encapsulate for LLD and LLM
2
+ export * from "@ledgerhq/coin-aptos/types";
@@ -0,0 +1,2 @@
1
+ // Encapsulate for LLD and LLM
2
+ export * from "@ledgerhq/coin-aptos/utils";
@@ -48,7 +48,7 @@ const convertToLiveTransaction: ConvertToLiveTransaction<
48
48
 
49
49
  /**
50
50
  * We explicitly set unrelated type specific fields to undefined to avoid transaction
51
- * type assertion errors during the `prepareTransaction` logic (libs/coin-evm/src/prepareTransaction.ts)
51
+ * type assertion errors during the `prepareTransaction` logic (libs/coin-modules/coin-evm/src/bridge/prepareTransaction.ts)
52
52
  * when performing an `updateTransaction` with a newly created tx
53
53
  * Which is what happen in this case (in apps/ledger-live-desktop/src/renderer/modals/SignTransaction/Body.tsx):
54
54
  // `createTransaction` will create a type 2 tx by default with `maxFeePerGas` and `maxPriorityFeePerGas` set to 0
@@ -667,6 +667,7 @@ export const DEFAULT_FEATURES: Features = {
667
667
  vitalsUpdateFrequency: "AVERAGE",
668
668
  },
669
669
  },
670
+ llmSentry: { enabled: true },
670
671
  };
671
672
 
672
673
  // Firebase SDK treat JSON values as strings
@@ -47,7 +47,6 @@ export default {
47
47
  xrp,
48
48
  mina,
49
49
  };
50
- import { ExtraDeviceTransactionField as ExtraDeviceTransactionField_aptos } from "@ledgerhq/coin-aptos/bridge/deviceTransactionConfig";
51
50
  import { ExtraDeviceTransactionField as ExtraDeviceTransactionField_casper } from "@ledgerhq/coin-casper/bridge/deviceTransactionConfig";
52
51
  import { ExtraDeviceTransactionField as ExtraDeviceTransactionField_filecoin } from "@ledgerhq/coin-filecoin/bridge/deviceTransactionConfig";
53
52
  import { ExtraDeviceTransactionField as ExtraDeviceTransactionField_stacks } from "@ledgerhq/coin-stacks/bridge/deviceTransactionConfig";
@@ -55,7 +54,6 @@ import { ExtraDeviceTransactionField as ExtraDeviceTransactionField_polkadot } f
55
54
  import { ExtraDeviceTransactionField as ExtraDeviceTransactionField_tron } from "@ledgerhq/coin-tron/bridge/deviceTransactionConfig";
56
55
 
57
56
  export type ExtraDeviceTransactionField =
58
- | ExtraDeviceTransactionField_aptos
59
57
  | ExtraDeviceTransactionField_casper
60
58
  | ExtraDeviceTransactionField_filecoin
61
59
  | ExtraDeviceTransactionField_stacks
@@ -0,0 +1,74 @@
1
+ import { isCorrespondingCurrency, getEffectiveCurrency } from "./index";
2
+
3
+ import { createFixtureCryptoCurrency } from "../../mock/fixtures/cryptoCurrencies";
4
+ import { cryptocurrenciesById } from "@ledgerhq/cryptoassets";
5
+ import type { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
6
+ import type { CurrenciesByProviderId } from "../../deposit/type";
7
+
8
+ describe("isCorrespondingCurrency", () => {
9
+ const evmCurrency = createFixtureCryptoCurrency("evm");
10
+ const usdcToken: CryptoOrTokenCurrency = {
11
+ type: "TokenCurrency",
12
+ id: "ethereum/erc20/usdc",
13
+ contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
14
+ parentCurrency: evmCurrency,
15
+ tokenType: "erc20",
16
+ name: "USD Coin",
17
+ ticker: "USDC",
18
+ units: [{ name: "USD Coin", code: "USDC", magnitude: 6 }],
19
+ };
20
+ const evmCrypto: CryptoOrTokenCurrency = evmCurrency;
21
+
22
+ it("returns true for a token whose parentCurrency.id matches the reference crypto", () => {
23
+ expect(isCorrespondingCurrency(usdcToken, evmCurrency)).toBe(true);
24
+ });
25
+
26
+ it("returns true for a token whose id matches the reference crypto", () => {
27
+ expect(isCorrespondingCurrency(usdcToken, usdcToken)).toBe(true);
28
+ });
29
+
30
+ it("returns true for a crypto whose id matches the reference crypto", () => {
31
+ expect(isCorrespondingCurrency(evmCrypto, evmCurrency)).toBe(true);
32
+ });
33
+
34
+ it("returns false for a token whose parentCurrency is different", () => {
35
+ const bitcoinCurrency = cryptocurrenciesById["bitcoin"];
36
+ const tokenWithOtherParent = { ...usdcToken, parentCurrency: bitcoinCurrency };
37
+ expect(isCorrespondingCurrency(tokenWithOtherParent, evmCurrency)).toBe(false);
38
+ });
39
+
40
+ it("returns false for a crypto whose id is different", () => {
41
+ const bitcoinCurrency = cryptocurrenciesById["bitcoin"];
42
+ expect(isCorrespondingCurrency(bitcoinCurrency, evmCurrency)).toBe(false);
43
+ });
44
+ });
45
+
46
+ describe("getEffectiveCurrency", () => {
47
+ const parent = createFixtureCryptoCurrency("evm");
48
+ const token: CryptoOrTokenCurrency = {
49
+ type: "TokenCurrency",
50
+ id: "ethereum/erc20/usdc",
51
+ contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
52
+ parentCurrency: parent,
53
+ tokenType: "erc20",
54
+ name: "USD Coin",
55
+ ticker: "USDC",
56
+ units: [{ name: "USD Coin", code: "USDC", magnitude: 6 }],
57
+ };
58
+ const provider: CurrenciesByProviderId = {
59
+ providerId: "provider1",
60
+ currenciesByNetwork: [parent, token],
61
+ };
62
+
63
+ it("returns currency if id is in currencyIds", () => {
64
+ expect(getEffectiveCurrency(token, provider, [token.id])).toBe(token);
65
+ });
66
+
67
+ it("returns first matching currency from provider if id not in currencyIds", () => {
68
+ expect(getEffectiveCurrency(token, provider, [parent.id])).toBe(parent);
69
+ });
70
+
71
+ it("returns currency if no match in provider", () => {
72
+ expect(getEffectiveCurrency(token, provider, ["notfound"])).toBe(token);
73
+ });
74
+ });
@@ -0,0 +1,29 @@
1
+ import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
2
+ import { CurrenciesByProviderId } from "../../deposit/type";
3
+
4
+ function isCorrespondingCurrency(
5
+ elem: CryptoOrTokenCurrency,
6
+ network: CryptoOrTokenCurrency,
7
+ ): boolean {
8
+ if (elem.type === "TokenCurrency") {
9
+ return elem.parentCurrency?.id === network.id || elem.id === network.id;
10
+ }
11
+ if (elem.type === "CryptoCurrency") {
12
+ return elem.id === network.id;
13
+ }
14
+ return false;
15
+ }
16
+
17
+ const getEffectiveCurrency = (
18
+ currency: CryptoOrTokenCurrency,
19
+ provider: CurrenciesByProviderId,
20
+ currencyIds: string[],
21
+ ) => {
22
+ const isCurrencyFiltered = currencyIds.includes(currency.id);
23
+
24
+ if (isCurrencyFiltered) return currency;
25
+
26
+ return provider.currenciesByNetwork.find(elem => currencyIds.includes(elem.id)) ?? currency;
27
+ };
28
+
29
+ export { isCorrespondingCurrency, getEffectiveCurrency };
@@ -423,8 +423,6 @@ export const handlers = ({
423
423
 
424
424
  // Step 1: Open the drawer and open exchange app
425
425
  const startExchange = async () => {
426
- console.log("LLD custom.exchange.swap uiExchangeStart", exchangeStartParams);
427
-
428
426
  return new Promise<{ transactionId: string; device?: ExchangeStartResult["device"] }>(
429
427
  (resolve, reject) => {
430
428
  uiExchangeStart({
@@ -1,4 +0,0 @@
1
- export declare const APTOS_NON_HARDENED_DERIVATION_PATH_REGEX: RegExp;
2
- export declare const APTOS_NON_HARDENED_DERIVATION_PATH = "44'/637'/0'/0/0";
3
- export declare const APTOS_HARDENED_DERIVATION_PATH = "44'/637'/0'/0'/0'";
4
- //# sourceMappingURL=consts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/families/aptos/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wCAAwC,QAAyC,CAAC;AAC/F,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AACpE,eAAO,MAAM,8BAA8B,sBAAsB,CAAC"}