@ledgerhq/live-common 34.48.0-nightly.8 → 34.48.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.
Files changed (419) hide show
  1. package/lib/__tests__/test-helpers/environment.js +0 -1
  2. package/lib/__tests__/test-helpers/environment.js.map +1 -1
  3. package/lib/apps/inlineAppInstall.d.ts +3 -1
  4. package/lib/apps/inlineAppInstall.d.ts.map +1 -1
  5. package/lib/apps/inlineAppInstall.js +2 -2
  6. package/lib/apps/inlineAppInstall.js.map +1 -1
  7. package/lib/apps/react.d.ts +2 -1
  8. package/lib/apps/react.d.ts.map +1 -1
  9. package/lib/apps/react.js +2 -2
  10. package/lib/apps/react.js.map +1 -1
  11. package/lib/apps/runner.d.ts +4 -2
  12. package/lib/apps/runner.d.ts.map +1 -1
  13. package/lib/apps/runner.js +4 -3
  14. package/lib/apps/runner.js.map +1 -1
  15. package/lib/bridge/generic-alpaca/accountBridge.d.ts +1 -2
  16. package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  17. package/lib/bridge/generic-alpaca/accountBridge.js +2 -2
  18. package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
  19. package/lib/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  20. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  21. package/lib/bridge/generic-alpaca/alpaca/index.js +6 -10
  22. package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  23. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +9 -37
  24. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
  25. package/lib/bridge/generic-alpaca/createTransaction.d.ts +1 -1
  26. package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  27. package/lib/bridge/generic-alpaca/createTransaction.js +0 -8
  28. package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
  29. package/lib/bridge/generic-alpaca/currencyBridge.d.ts +1 -2
  30. package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  31. package/lib/bridge/generic-alpaca/currencyBridge.js +2 -3
  32. package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  33. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  34. package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
  35. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  36. package/lib/bridge/generic-alpaca/signer/index.d.ts +10 -2
  37. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  38. package/lib/bridge/generic-alpaca/signer/index.js +2 -2
  39. package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
  40. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +3 -2
  41. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  42. package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  43. package/lib/bridge/generic-alpaca/signer/types.d.ts +0 -11
  44. package/lib/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  45. package/lib/bridge/generic-alpaca/utils.d.ts +0 -2
  46. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  47. package/lib/bridge/generic-alpaca/utils.js +1 -15
  48. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  49. package/lib/bridge/generic-alpaca/utils.test.js +0 -21
  50. package/lib/bridge/generic-alpaca/utils.test.js.map +1 -1
  51. package/lib/config/sharedConfig.d.ts.map +1 -1
  52. package/lib/config/sharedConfig.js +28 -30
  53. package/lib/config/sharedConfig.js.map +1 -1
  54. package/lib/e2e/enum/Account.d.ts +0 -2
  55. package/lib/e2e/enum/Account.d.ts.map +1 -1
  56. package/lib/e2e/enum/Account.js +0 -2
  57. package/lib/e2e/enum/Account.js.map +1 -1
  58. package/lib/e2e/enum/AppInfos.d.ts +0 -1
  59. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  60. package/lib/e2e/enum/AppInfos.js +0 -1
  61. package/lib/e2e/enum/AppInfos.js.map +1 -1
  62. package/lib/e2e/enum/Currency.d.ts +0 -1
  63. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  64. package/lib/e2e/enum/Currency.js +0 -1
  65. package/lib/e2e/enum/Currency.js.map +1 -1
  66. package/lib/e2e/enum/Network.d.ts +1 -2
  67. package/lib/e2e/enum/Network.d.ts.map +1 -1
  68. package/lib/e2e/enum/Network.js +0 -1
  69. package/lib/e2e/enum/Network.js.map +1 -1
  70. package/lib/e2e/index.d.ts +4 -1
  71. package/lib/e2e/index.d.ts.map +1 -1
  72. package/lib/e2e/speculos.d.ts.map +1 -1
  73. package/lib/e2e/speculos.js +0 -12
  74. package/lib/e2e/speculos.js.map +1 -1
  75. package/lib/env.react.d.ts +1 -1
  76. package/lib/env.react.d.ts.map +1 -1
  77. package/lib/exchange/swap/transactionStrategies.d.ts +11 -38
  78. package/lib/exchange/swap/transactionStrategies.d.ts.map +1 -1
  79. package/lib/exchange/swap/transactionStrategies.js +47 -93
  80. package/lib/exchange/swap/transactionStrategies.js.map +1 -1
  81. package/lib/families/canton/config.d.ts.map +1 -1
  82. package/lib/families/canton/config.js +5 -3
  83. package/lib/families/canton/config.js.map +1 -1
  84. package/lib/families/canton/setup.d.ts.map +1 -1
  85. package/lib/families/canton/setup.js +5 -5
  86. package/lib/families/canton/setup.js.map +1 -1
  87. package/lib/families/evm/config.js +2 -2
  88. package/lib/families/evm/config.js.map +1 -1
  89. package/lib/families/xrp/setup.d.ts +2 -2
  90. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  91. package/lib/featureFlags/defaultFeatures.js +2 -4
  92. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  93. package/lib/featureFlags/useFeature.d.ts +1 -1
  94. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  95. package/lib/generated/bridge/js.d.ts +0 -1
  96. package/lib/generated/bridge/js.d.ts.map +1 -1
  97. package/lib/generated/bridge/js.js +22 -24
  98. package/lib/generated/bridge/js.js.map +1 -1
  99. package/lib/generated/bridge/mock.d.ts +1 -1
  100. package/lib/generated/cli-transaction.d.ts +2 -13
  101. package/lib/generated/cli-transaction.d.ts.map +1 -1
  102. package/lib/generated/cli-transaction.js +26 -28
  103. package/lib/generated/cli-transaction.js.map +1 -1
  104. package/lib/generated/deviceTransactionConfig.d.ts +0 -2
  105. package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
  106. package/lib/generated/deviceTransactionConfig.js +22 -24
  107. package/lib/generated/deviceTransactionConfig.js.map +1 -1
  108. package/lib/generated/hw-getAddress.d.ts +0 -1
  109. package/lib/generated/hw-getAddress.d.ts.map +1 -1
  110. package/lib/generated/hw-getAddress.js +26 -28
  111. package/lib/generated/hw-getAddress.js.map +1 -1
  112. package/lib/generated/platformAdapter.d.ts +1 -1
  113. package/lib/generated/specs.d.ts +1 -1
  114. package/lib/generated/transaction.d.ts +3 -11
  115. package/lib/generated/transaction.d.ts.map +1 -1
  116. package/lib/generated/transaction.js +26 -28
  117. package/lib/generated/transaction.js.map +1 -1
  118. package/lib/generated/types.d.ts +4 -5
  119. package/lib/generated/types.d.ts.map +1 -1
  120. package/lib/generated/walletApiAdapter.d.ts +1 -1
  121. package/lib/hw/actions/app.d.ts.map +1 -1
  122. package/lib/hw/actions/app.js.map +1 -1
  123. package/lib/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  124. package/lib/hw/getDeviceNameMaxLength.js +0 -2
  125. package/lib/hw/getDeviceNameMaxLength.js.map +1 -1
  126. package/lib/hw/getDeviceNameMaxLength.test.js +0 -12
  127. package/lib/hw/getDeviceNameMaxLength.test.js.map +1 -1
  128. package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  129. package/lib/modularDrawer/data/state-manager/api.js +2 -3
  130. package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
  131. package/lib/modularDrawer/data/state-manager/types.d.ts +0 -1
  132. package/lib/modularDrawer/data/state-manager/types.d.ts.map +1 -1
  133. package/lib/modularDrawer/hooks/useAssetsData.d.ts +1 -3
  134. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  135. package/lib/modularDrawer/hooks/useAssetsData.js +3 -6
  136. package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
  137. package/lib/wallet-api/ACRE/server.d.ts +6 -13
  138. package/lib/wallet-api/ACRE/server.d.ts.map +1 -1
  139. package/lib/wallet-api/ACRE/server.js +1 -142
  140. package/lib/wallet-api/ACRE/server.js.map +1 -1
  141. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  142. package/lib/wallet-api/Exchange/server.js +13 -16
  143. package/lib/wallet-api/Exchange/server.js.map +1 -1
  144. package/lib-es/__tests__/test-helpers/environment.js +0 -1
  145. package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
  146. package/lib-es/apps/inlineAppInstall.d.ts +3 -1
  147. package/lib-es/apps/inlineAppInstall.d.ts.map +1 -1
  148. package/lib-es/apps/inlineAppInstall.js +2 -2
  149. package/lib-es/apps/inlineAppInstall.js.map +1 -1
  150. package/lib-es/apps/react.d.ts +2 -1
  151. package/lib-es/apps/react.d.ts.map +1 -1
  152. package/lib-es/apps/react.js +2 -2
  153. package/lib-es/apps/react.js.map +1 -1
  154. package/lib-es/apps/runner.d.ts +4 -2
  155. package/lib-es/apps/runner.d.ts.map +1 -1
  156. package/lib-es/apps/runner.js +4 -3
  157. package/lib-es/apps/runner.js.map +1 -1
  158. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +1 -2
  159. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  160. package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -2
  161. package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
  162. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  163. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  164. package/lib-es/bridge/generic-alpaca/alpaca/index.js +6 -10
  165. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  166. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +9 -37
  167. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
  168. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +1 -1
  169. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  170. package/lib-es/bridge/generic-alpaca/createTransaction.js +0 -8
  171. package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
  172. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +1 -2
  173. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  174. package/lib-es/bridge/generic-alpaca/currencyBridge.js +2 -3
  175. package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  176. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  177. package/lib-es/bridge/generic-alpaca/getAccountShape.js +4 -4
  178. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  179. package/lib-es/bridge/generic-alpaca/signer/index.d.ts +10 -2
  180. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  181. package/lib-es/bridge/generic-alpaca/signer/index.js +2 -2
  182. package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
  183. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +3 -2
  184. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  185. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  186. package/lib-es/bridge/generic-alpaca/signer/types.d.ts +0 -11
  187. package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  188. package/lib-es/bridge/generic-alpaca/utils.d.ts +0 -2
  189. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  190. package/lib-es/bridge/generic-alpaca/utils.js +0 -13
  191. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  192. package/lib-es/bridge/generic-alpaca/utils.test.js +1 -22
  193. package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -1
  194. package/lib-es/config/sharedConfig.d.ts.map +1 -1
  195. package/lib-es/config/sharedConfig.js +0 -2
  196. package/lib-es/config/sharedConfig.js.map +1 -1
  197. package/lib-es/e2e/enum/Account.d.ts +0 -2
  198. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  199. package/lib-es/e2e/enum/Account.js +0 -2
  200. package/lib-es/e2e/enum/Account.js.map +1 -1
  201. package/lib-es/e2e/enum/AppInfos.d.ts +0 -1
  202. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  203. package/lib-es/e2e/enum/AppInfos.js +0 -1
  204. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  205. package/lib-es/e2e/enum/Currency.d.ts +0 -1
  206. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  207. package/lib-es/e2e/enum/Currency.js +0 -1
  208. package/lib-es/e2e/enum/Currency.js.map +1 -1
  209. package/lib-es/e2e/enum/Network.d.ts +1 -2
  210. package/lib-es/e2e/enum/Network.d.ts.map +1 -1
  211. package/lib-es/e2e/enum/Network.js +0 -1
  212. package/lib-es/e2e/enum/Network.js.map +1 -1
  213. package/lib-es/e2e/index.d.ts +4 -1
  214. package/lib-es/e2e/index.d.ts.map +1 -1
  215. package/lib-es/e2e/speculos.d.ts.map +1 -1
  216. package/lib-es/e2e/speculos.js +0 -12
  217. package/lib-es/e2e/speculos.js.map +1 -1
  218. package/lib-es/env.react.d.ts +1 -1
  219. package/lib-es/env.react.d.ts.map +1 -1
  220. package/lib-es/exchange/swap/transactionStrategies.d.ts +11 -38
  221. package/lib-es/exchange/swap/transactionStrategies.d.ts.map +1 -1
  222. package/lib-es/exchange/swap/transactionStrategies.js +44 -87
  223. package/lib-es/exchange/swap/transactionStrategies.js.map +1 -1
  224. package/lib-es/families/canton/config.d.ts.map +1 -1
  225. package/lib-es/families/canton/config.js +5 -3
  226. package/lib-es/families/canton/config.js.map +1 -1
  227. package/lib-es/families/canton/setup.d.ts.map +1 -1
  228. package/lib-es/families/canton/setup.js +5 -5
  229. package/lib-es/families/canton/setup.js.map +1 -1
  230. package/lib-es/families/evm/config.js +2 -2
  231. package/lib-es/families/evm/config.js.map +1 -1
  232. package/lib-es/families/xrp/setup.d.ts +2 -2
  233. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  234. package/lib-es/featureFlags/defaultFeatures.js +2 -4
  235. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  236. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  237. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  238. package/lib-es/generated/bridge/js.d.ts +0 -1
  239. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  240. package/lib-es/generated/bridge/js.js +0 -2
  241. package/lib-es/generated/bridge/js.js.map +1 -1
  242. package/lib-es/generated/bridge/mock.d.ts +1 -1
  243. package/lib-es/generated/cli-transaction.d.ts +2 -13
  244. package/lib-es/generated/cli-transaction.d.ts.map +1 -1
  245. package/lib-es/generated/cli-transaction.js +0 -2
  246. package/lib-es/generated/cli-transaction.js.map +1 -1
  247. package/lib-es/generated/deviceTransactionConfig.d.ts +0 -2
  248. package/lib-es/generated/deviceTransactionConfig.d.ts.map +1 -1
  249. package/lib-es/generated/deviceTransactionConfig.js +0 -2
  250. package/lib-es/generated/deviceTransactionConfig.js.map +1 -1
  251. package/lib-es/generated/hw-getAddress.d.ts +0 -1
  252. package/lib-es/generated/hw-getAddress.d.ts.map +1 -1
  253. package/lib-es/generated/hw-getAddress.js +0 -2
  254. package/lib-es/generated/hw-getAddress.js.map +1 -1
  255. package/lib-es/generated/platformAdapter.d.ts +1 -1
  256. package/lib-es/generated/specs.d.ts +1 -1
  257. package/lib-es/generated/transaction.d.ts +3 -11
  258. package/lib-es/generated/transaction.d.ts.map +1 -1
  259. package/lib-es/generated/transaction.js +0 -2
  260. package/lib-es/generated/transaction.js.map +1 -1
  261. package/lib-es/generated/types.d.ts +4 -5
  262. package/lib-es/generated/types.d.ts.map +1 -1
  263. package/lib-es/generated/walletApiAdapter.d.ts +1 -1
  264. package/lib-es/hw/actions/app.d.ts.map +1 -1
  265. package/lib-es/hw/actions/app.js.map +1 -1
  266. package/lib-es/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  267. package/lib-es/hw/getDeviceNameMaxLength.js +0 -2
  268. package/lib-es/hw/getDeviceNameMaxLength.js.map +1 -1
  269. package/lib-es/hw/getDeviceNameMaxLength.test.js +0 -12
  270. package/lib-es/hw/getDeviceNameMaxLength.test.js.map +1 -1
  271. package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  272. package/lib-es/modularDrawer/data/state-manager/api.js +2 -3
  273. package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
  274. package/lib-es/modularDrawer/data/state-manager/types.d.ts +0 -1
  275. package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +1 -1
  276. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +1 -3
  277. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  278. package/lib-es/modularDrawer/hooks/useAssetsData.js +3 -6
  279. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
  280. package/lib-es/wallet-api/ACRE/server.d.ts +6 -13
  281. package/lib-es/wallet-api/ACRE/server.d.ts.map +1 -1
  282. package/lib-es/wallet-api/ACRE/server.js +2 -140
  283. package/lib-es/wallet-api/ACRE/server.js.map +1 -1
  284. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  285. package/lib-es/wallet-api/Exchange/server.js +13 -16
  286. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  287. package/package.json +53 -56
  288. package/src/__tests__/test-helpers/environment.ts +0 -1
  289. package/src/apps/inlineAppInstall.ts +4 -1
  290. package/src/apps/react.ts +3 -1
  291. package/src/apps/runner.ts +8 -1
  292. package/src/bridge/generic-alpaca/accountBridge.ts +3 -8
  293. package/src/bridge/generic-alpaca/alpaca/index.ts +18 -13
  294. package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +10 -38
  295. package/src/bridge/generic-alpaca/createTransaction.ts +1 -9
  296. package/src/bridge/generic-alpaca/currencyBridge.ts +2 -8
  297. package/src/bridge/generic-alpaca/getAccountShape.ts +5 -4
  298. package/src/bridge/generic-alpaca/signer/index.ts +15 -5
  299. package/src/bridge/generic-alpaca/signer/signTransaction.ts +3 -4
  300. package/src/bridge/generic-alpaca/signer/types.ts +0 -14
  301. package/src/bridge/generic-alpaca/utils.test.ts +1 -29
  302. package/src/bridge/generic-alpaca/utils.ts +0 -15
  303. package/src/config/sharedConfig.ts +0 -2
  304. package/src/e2e/enum/Account.ts +0 -14
  305. package/src/e2e/enum/AppInfos.ts +0 -2
  306. package/src/e2e/enum/Currency.ts +0 -2
  307. package/src/e2e/enum/Network.ts +0 -1
  308. package/src/e2e/speculos.ts +0 -12
  309. package/src/exchange/swap/transactionStrategies.ts +73 -121
  310. package/src/families/canton/config.ts +6 -3
  311. package/src/families/canton/setup.ts +5 -6
  312. package/src/families/evm/config.ts +2 -2
  313. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +2 -2
  314. package/src/featureFlags/defaultFeatures.ts +2 -4
  315. package/src/generated/bridge/js.ts +0 -2
  316. package/src/generated/cli-transaction.ts +0 -2
  317. package/src/generated/deviceTransactionConfig.ts +0 -2
  318. package/src/generated/hw-getAddress.ts +0 -2
  319. package/src/generated/transaction.ts +0 -2
  320. package/src/generated/types.ts +0 -10
  321. package/src/hw/actions/app.ts +1 -0
  322. package/src/hw/getDeviceNameMaxLength.test.ts +0 -16
  323. package/src/hw/getDeviceNameMaxLength.ts +0 -2
  324. package/src/modularDrawer/data/state-manager/api.ts +2 -4
  325. package/src/modularDrawer/data/state-manager/types.ts +0 -1
  326. package/src/modularDrawer/hooks/useAssetsData.ts +9 -24
  327. package/src/wallet-api/ACRE/server.ts +14 -202
  328. package/src/wallet-api/Exchange/server.ts +14 -17
  329. package/lib/bridge/generic-alpaca/signer/Eth.d.ts +0 -8
  330. package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +0 -1
  331. package/lib/bridge/generic-alpaca/signer/Eth.js +0 -51
  332. package/lib/bridge/generic-alpaca/signer/Eth.js.map +0 -1
  333. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.d.ts +0 -2
  334. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.d.ts.map +0 -1
  335. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js +0 -144
  336. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js.map +0 -1
  337. package/lib/e2e/families/kaspa.d.ts +0 -4
  338. package/lib/e2e/families/kaspa.d.ts.map +0 -1
  339. package/lib/e2e/families/kaspa.js +0 -23
  340. package/lib/e2e/families/kaspa.js.map +0 -1
  341. package/lib/families/kaspa/bridge.integration.test.d.ts +0 -2
  342. package/lib/families/kaspa/bridge.integration.test.d.ts.map +0 -1
  343. package/lib/families/kaspa/bridge.integration.test.js +0 -7
  344. package/lib/families/kaspa/bridge.integration.test.js.map +0 -1
  345. package/lib/families/kaspa/config.d.ts +0 -3
  346. package/lib/families/kaspa/config.d.ts.map +0 -1
  347. package/lib/families/kaspa/config.js +0 -14
  348. package/lib/families/kaspa/config.js.map +0 -1
  349. package/lib/families/kaspa/react.d.ts +0 -4
  350. package/lib/families/kaspa/react.d.ts.map +0 -1
  351. package/lib/families/kaspa/react.js +0 -18
  352. package/lib/families/kaspa/react.js.map +0 -1
  353. package/lib/families/kaspa/setup.d.ts +0 -18
  354. package/lib/families/kaspa/setup.d.ts.map +0 -1
  355. package/lib/families/kaspa/setup.js +0 -24
  356. package/lib/families/kaspa/setup.js.map +0 -1
  357. package/lib/families/kaspa/types.d.ts +0 -2
  358. package/lib/families/kaspa/types.d.ts.map +0 -1
  359. package/lib/families/kaspa/types.js +0 -18
  360. package/lib/families/kaspa/types.js.map +0 -1
  361. package/lib/modularDrawer/hooks/useSearch.d.ts +0 -16
  362. package/lib/modularDrawer/hooks/useSearch.d.ts.map +0 -1
  363. package/lib/modularDrawer/hooks/useSearch.js +0 -24
  364. package/lib/modularDrawer/hooks/useSearch.js.map +0 -1
  365. package/lib/wallet-api/ACRE/server.test.d.ts +0 -2
  366. package/lib/wallet-api/ACRE/server.test.d.ts.map +0 -1
  367. package/lib/wallet-api/ACRE/server.test.js +0 -393
  368. package/lib/wallet-api/ACRE/server.test.js.map +0 -1
  369. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +0 -8
  370. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +0 -1
  371. package/lib-es/bridge/generic-alpaca/signer/Eth.js +0 -47
  372. package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +0 -1
  373. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.d.ts +0 -2
  374. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.d.ts.map +0 -1
  375. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js +0 -139
  376. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js.map +0 -1
  377. package/lib-es/e2e/families/kaspa.d.ts +0 -4
  378. package/lib-es/e2e/families/kaspa.d.ts.map +0 -1
  379. package/lib-es/e2e/families/kaspa.js +0 -15
  380. package/lib-es/e2e/families/kaspa.js.map +0 -1
  381. package/lib-es/families/kaspa/bridge.integration.test.d.ts +0 -2
  382. package/lib-es/families/kaspa/bridge.integration.test.d.ts.map +0 -1
  383. package/lib-es/families/kaspa/bridge.integration.test.js +0 -5
  384. package/lib-es/families/kaspa/bridge.integration.test.js.map +0 -1
  385. package/lib-es/families/kaspa/config.d.ts +0 -3
  386. package/lib-es/families/kaspa/config.d.ts.map +0 -1
  387. package/lib-es/families/kaspa/config.js +0 -11
  388. package/lib-es/families/kaspa/config.js.map +0 -1
  389. package/lib-es/families/kaspa/react.d.ts +0 -4
  390. package/lib-es/families/kaspa/react.d.ts.map +0 -1
  391. package/lib-es/families/kaspa/react.js +0 -14
  392. package/lib-es/families/kaspa/react.js.map +0 -1
  393. package/lib-es/families/kaspa/setup.d.ts +0 -18
  394. package/lib-es/families/kaspa/setup.d.ts.map +0 -1
  395. package/lib-es/families/kaspa/setup.js +0 -16
  396. package/lib-es/families/kaspa/setup.js.map +0 -1
  397. package/lib-es/families/kaspa/types.d.ts +0 -2
  398. package/lib-es/families/kaspa/types.d.ts.map +0 -1
  399. package/lib-es/families/kaspa/types.js +0 -2
  400. package/lib-es/families/kaspa/types.js.map +0 -1
  401. package/lib-es/modularDrawer/hooks/useSearch.d.ts +0 -16
  402. package/lib-es/modularDrawer/hooks/useSearch.d.ts.map +0 -1
  403. package/lib-es/modularDrawer/hooks/useSearch.js +0 -20
  404. package/lib-es/modularDrawer/hooks/useSearch.js.map +0 -1
  405. package/lib-es/wallet-api/ACRE/server.test.d.ts +0 -2
  406. package/lib-es/wallet-api/ACRE/server.test.d.ts.map +0 -1
  407. package/lib-es/wallet-api/ACRE/server.test.js +0 -388
  408. package/lib-es/wallet-api/ACRE/server.test.js.map +0 -1
  409. package/src/bridge/generic-alpaca/signer/Eth.ts +0 -70
  410. package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +0 -173
  411. package/src/e2e/families/kaspa.ts +0 -17
  412. package/src/families/kaspa/__snapshots__/bridge.integration.test.ts.snap +0 -66
  413. package/src/families/kaspa/bridge.integration.test.ts +0 -5
  414. package/src/families/kaspa/config.ts +0 -12
  415. package/src/families/kaspa/react.ts +0 -19
  416. package/src/families/kaspa/setup.ts +0 -27
  417. package/src/families/kaspa/types.ts +0 -1
  418. package/src/modularDrawer/hooks/useSearch.ts +0 -52
  419. package/src/wallet-api/ACRE/server.test.ts +0 -470
@@ -24,7 +24,6 @@ export function useAssetsData({
24
24
  areCurrenciesFiltered,
25
25
  product,
26
26
  version,
27
- isStaging,
28
27
  }: {
29
28
  search?: string;
30
29
  currencyIds?: string[];
@@ -32,26 +31,15 @@ export function useAssetsData({
32
31
  areCurrenciesFiltered?: boolean;
33
32
  product: "llm" | "lld";
34
33
  version: string;
35
- isStaging?: boolean;
36
34
  }) {
37
- const {
38
- data,
39
- isLoading,
40
- error,
41
- fetchNextPage,
42
- isSuccess,
43
- refetch,
44
- isFetching,
45
- isError,
46
- isFetchingNextPage,
47
- } = useGetAssetsDataInfiniteQuery({
48
- search,
49
- useCase,
50
- currencyIds: areCurrenciesFiltered ? currencyIds : undefined,
51
- product,
52
- version,
53
- isStaging,
54
- });
35
+ const { data, isLoading, error, fetchNextPage, isSuccess, refetch } =
36
+ useGetAssetsDataInfiniteQuery({
37
+ search,
38
+ useCase,
39
+ currencyIds: areCurrenciesFiltered ? currencyIds : undefined,
40
+ product,
41
+ version,
42
+ });
55
43
 
56
44
  const joinedPages = useMemo(() => {
57
45
  return data?.pages.reduce<AssetsDataWithPagination>((acc, page) => {
@@ -74,15 +62,12 @@ export function useAssetsData({
74
62
 
75
63
  const hasMore = Boolean(joinedPages?.pagination.nextCursor);
76
64
 
77
- const isInitialLoading = isLoading || (isFetching && !isFetchingNextPage);
78
-
79
65
  return {
80
66
  data: joinedPages,
81
- isLoading: isInitialLoading,
67
+ isLoading,
82
68
  error,
83
69
  loadNext: hasMore ? fetchNextPage : undefined,
84
70
  isSuccess,
85
- isError,
86
71
  refetch,
87
72
  };
88
73
  }
@@ -8,8 +8,7 @@ import {
8
8
  isTokenAccount,
9
9
  } from "@ledgerhq/coin-framework/account/index";
10
10
  import { Account, AccountLike, AnyMessage, Operation, SignedOperation } from "@ledgerhq/types-live";
11
- import { findTokenById, findTokenByAddressInCurrency } from "@ledgerhq/cryptoassets";
12
- import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
11
+ import { findTokenById } from "@ledgerhq/cryptoassets";
13
12
  import {
14
13
  MessageSignParams,
15
14
  MessageSignResult,
@@ -19,21 +18,17 @@ import {
19
18
  TransactionSignAndBroadcastResult,
20
19
  TransactionSignParams,
21
20
  TransactionSignResult,
22
- RegisterYieldBearingEthereumAddressParams,
23
- RegisterYieldBearingEthereumAddressResult,
24
21
  } from "@ledgerhq/wallet-api-acre-module";
25
- import { Transaction } from "../../generated/types";
26
- import { AppManifest } from "../types";
27
22
  import { TrackingAPI } from "./tracking";
23
+ import { AppManifest } from "../types";
28
24
  import {
29
25
  getAccountIdFromWalletAccountId,
30
26
  getWalletAPITransactionSignFlowInfos,
31
27
  } from "../converters";
32
28
  import { getAccountBridge } from "../../bridge";
29
+ import { Transaction } from "../../generated/types";
33
30
  import { UserRefusedOnDevice } from "@ledgerhq/errors";
34
31
  import { getEnv } from "@ledgerhq/live-env";
35
- import BigNumber from "bignumber.js";
36
- import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
37
32
 
38
33
  type Handlers = {
39
34
  "custom.acre.messageSign": RPCHandler<MessageSignResult, MessageSignParams>;
@@ -42,13 +37,9 @@ type Handlers = {
42
37
  TransactionSignAndBroadcastResult,
43
38
  TransactionSignAndBroadcastParams
44
39
  >;
45
- "custom.acre.registerYieldBearingEthereumAddress": RPCHandler<
46
- RegisterYieldBearingEthereumAddressResult,
47
- RegisterYieldBearingEthereumAddressParams
48
- >;
49
40
  };
50
41
 
51
- export type ACREUiHooks = {
42
+ type ACREUiHooks = {
52
43
  "custom.acre.messageSign": (params: {
53
44
  account: AccountLike;
54
45
  message: AnyMessage;
@@ -75,117 +66,8 @@ export type ACREUiHooks = {
75
66
  mainAccount: Account,
76
67
  optimisticOperation: Operation,
77
68
  ) => void;
78
- "custom.acre.registerAccount": (params: {
79
- parentAccount: Account;
80
- accountName: string;
81
- existingAccounts: Account[];
82
- onSuccess: () => void;
83
- onError: (error: Error) => void;
84
- }) => void;
85
69
  };
86
70
 
87
- // Helper function to validate Ethereum address format
88
- function isValidEthereumAddress(address: string): boolean {
89
- return /^0x[a-fA-F0-9]{40}$/.test(address);
90
- }
91
-
92
- // Helper function to validate all inputs before account creation
93
- function validateInputs(params: RegisterYieldBearingEthereumAddressParams): {
94
- ethereumAddress: string;
95
- tokenContractAddress?: string;
96
- tokenTicker?: string;
97
- meta?: Record<string, unknown>;
98
- } {
99
- const { ethereumAddress, tokenContractAddress, tokenTicker, meta } = params;
100
-
101
- // Validate Ethereum address format
102
- if (!ethereumAddress) {
103
- throw new Error("Ethereum address is required");
104
- }
105
- if (!isValidEthereumAddress(ethereumAddress)) {
106
- throw new Error("Invalid Ethereum address format");
107
- }
108
-
109
- // Validate that at least one token identifier is provided
110
- if (!tokenContractAddress && !tokenTicker) {
111
- throw new Error("Either tokenContractAddress or tokenTicker must be provided");
112
- }
113
-
114
- return { ethereumAddress, tokenContractAddress, tokenTicker, meta };
115
- }
116
-
117
- // Helper function to find acreToken by address or token id
118
- function findAcreToken(
119
- tokenContractAddress?: string,
120
- tokenTicker?: string,
121
- ): { token: TokenCurrency; contractAddress: string } {
122
- let foundToken: TokenCurrency | undefined;
123
- // Try to find token by contract address first (if provided)
124
- if (tokenContractAddress) {
125
- foundToken = findTokenByAddressInCurrency(tokenContractAddress, "ethereum");
126
- } else if (tokenTicker) {
127
- foundToken = findTokenById(tokenTicker.toLowerCase());
128
- }
129
- if (!foundToken) {
130
- throw new Error(
131
- `Token not found. Tried contract address: ${tokenContractAddress || "not provided"}, ticker: ${tokenTicker || "not provided"}`,
132
- );
133
- }
134
- return { token: foundToken, contractAddress: foundToken.contractAddress };
135
- }
136
-
137
- // Helper function to generate unique account names with suffixes
138
- // This is clearly a hack as we do not have account name on Account type, we leverage on how many accounts have acreBTC as token sub account to define the name
139
- // This is made to help user to identify different ACRE account but not resilient to token account being wiped, emptied
140
- // (empty subAccount would not been included in the list therefore parent account not considered as an acre account anymore).
141
- function generateUniqueAccountName(
142
- existingAccounts: Account[],
143
- baseName: string,
144
- tokenAddress: string,
145
- ): string {
146
- const existingAccountWithAcreToken = existingAccounts.flatMap(
147
- account =>
148
- account.subAccounts?.filter(
149
- subAccount => subAccount.token.contractAddress.toLowerCase() === tokenAddress.toLowerCase(),
150
- ) || [],
151
- );
152
- return existingAccountWithAcreToken.length > 0
153
- ? `${baseName} ${existingAccountWithAcreToken.length}`
154
- : baseName;
155
- }
156
-
157
- // Helper function to create parent Ethereum account
158
- function createParentAccount(ethereumAddress: string, ethereumCurrency: CryptoCurrency): Account {
159
- return {
160
- type: "Account" as const,
161
- id: `js:2:ethereum:${ethereumAddress}:`,
162
- seedIdentifier: `04${ethereumAddress.slice(2)}`,
163
- derivationMode: "" as any,
164
- index: 0,
165
- freshAddress: ethereumAddress,
166
- freshAddressPath: "44'/60'/0'/0/0",
167
- used: false,
168
- blockHeight: 0,
169
- creationDate: new Date(),
170
- balance: new BigNumber(0),
171
- spendableBalance: new BigNumber(0),
172
- operationsCount: 0,
173
- operations: [],
174
- pendingOperations: [],
175
- currency: ethereumCurrency,
176
- lastSyncDate: new Date(),
177
- swapHistory: [],
178
- balanceHistoryCache: {
179
- HOUR: { latestDate: Date.now(), balances: [] },
180
- DAY: { latestDate: Date.now(), balances: [] },
181
- WEEK: { latestDate: Date.now(), balances: [] },
182
- },
183
- syncHash: "0x00000000", // Use proper hash format
184
- subAccounts: [], // Add empty subAccounts array
185
- nfts: [],
186
- };
187
- }
188
-
189
71
  export const handlers = ({
190
72
  accounts,
191
73
  tracking,
@@ -194,7 +76,6 @@ export const handlers = ({
194
76
  "custom.acre.messageSign": uiMessageSign,
195
77
  "custom.acre.transactionSign": uiTransactionSign,
196
78
  "custom.acre.transactionBroadcast": uiTransactionBroadcast,
197
- "custom.acre.registerAccount": uiRegisterAccount,
198
79
  },
199
80
  }: {
200
81
  accounts: AccountLike[];
@@ -211,16 +92,20 @@ export const handlers = ({
211
92
  const transaction = deserializeTransaction(rawTransaction);
212
93
 
213
94
  tracking.signTransactionRequested(manifest);
95
+
214
96
  if (!transaction) {
215
97
  tracking.signTransactionFail(manifest);
216
98
  return Promise.reject(new Error("Transaction required"));
217
99
  }
100
+
218
101
  const accountId = getAccountIdFromWalletAccountId(walletAccountId);
219
102
  if (!accountId) {
220
103
  tracking.signTransactionFail(manifest);
221
104
  return Promise.reject(new Error(`accountId ${walletAccountId} unknown`));
222
105
  }
106
+
223
107
  const account = accounts.find(account => account.id === accountId);
108
+
224
109
  if (!account) {
225
110
  tracking.signTransactionFail(manifest);
226
111
  return Promise.reject(new Error("Account required"));
@@ -235,6 +120,7 @@ export const handlers = ({
235
120
  const mainAccount = getMainAccount(account, parentAccount);
236
121
  const currency = tokenCurrency ? findTokenById(tokenCurrency) : null;
237
122
  const signerAccount = currency ? makeEmptyTokenAccount(mainAccount, currency) : account;
123
+
238
124
  const { canEditFees, liveTx, hasFeesProvided } = getWalletAPITransactionSignFlowInfos({
239
125
  walletApiTransaction: transaction,
240
126
  account,
@@ -276,6 +162,7 @@ export const handlers = ({
276
162
  });
277
163
  });
278
164
  }
165
+
279
166
  return {
280
167
  "custom.acre.messageSign": customWrapper<MessageSignParams, MessageSignResult>(async params => {
281
168
  if (!params) {
@@ -388,6 +275,7 @@ export const handlers = ({
388
275
  const broadcastAccount = getMainAccount(signerAccount, parentAccount);
389
276
 
390
277
  let optimisticOperation: Operation = signedOperation.operation;
278
+
391
279
  if (!getEnv("DISABLE_TRANSACTION_BROADCAST")) {
392
280
  try {
393
281
  optimisticOperation = await bridge.broadcast({
@@ -400,93 +288,17 @@ export const handlers = ({
400
288
  throw error;
401
289
  }
402
290
  }
291
+
403
292
  uiTransactionBroadcast &&
404
293
  uiTransactionBroadcast(account, parentAccount, mainAccount, optimisticOperation);
294
+
405
295
  return {
406
296
  transactionHash: optimisticOperation.hash,
407
297
  };
408
298
  }),
409
- "custom.acre.registerYieldBearingEthereumAddress": customWrapper<
410
- RegisterYieldBearingEthereumAddressParams,
411
- RegisterYieldBearingEthereumAddressResult
412
- >(async params => {
413
- if (!params) {
414
- return Promise.reject(new Error("Parameters required"));
415
- }
416
- const validatedInputs = validateInputs(params);
417
- const ethereumCurrency = getCryptoCurrencyById("ethereum");
418
- const { token: existingToken, contractAddress: finalTokenContractAddress } = findAcreToken(
419
- validatedInputs.tokenContractAddress,
420
- validatedInputs.tokenTicker,
421
- );
422
- const existingBearingAccount = accounts.find(
423
- account =>
424
- "freshAddress" in account &&
425
- (account as any).freshAddress === validatedInputs.ethereumAddress,
426
- );
427
- const baseName = "Yield-bearing BTC on ACRE";
428
- // Account already added, skip registration.
429
- if (existingBearingAccount) {
430
- return {
431
- success: true,
432
- accountName: baseName,
433
- parentAccountId: existingBearingAccount.id,
434
- tokenAccountId: existingBearingAccount.id,
435
- ethereumAddress: validatedInputs.ethereumAddress,
436
- tokenContractAddress: finalTokenContractAddress,
437
- meta: validatedInputs.meta,
438
- };
439
- }
440
-
441
- if (uiRegisterAccount) {
442
- // Create account & manage the case where an ACRE account has been already registered on another Ethereum address
443
- // Filter to have only root accounts
444
- const existingParentAccounts = accounts.filter(
445
- (acc): acc is Account => acc.type === "Account",
446
- );
447
- const accountName = generateUniqueAccountName(
448
- existingParentAccounts,
449
- baseName,
450
- finalTokenContractAddress,
451
- );
452
- const parentAccount = createParentAccount(
453
- validatedInputs.ethereumAddress,
454
- ethereumCurrency,
455
- );
456
- const tokenAccount = makeEmptyTokenAccount(parentAccount, existingToken);
457
- // Add token account as sub-account of parent account
458
- const parentAccountWithSubAccount = {
459
- ...parentAccount,
460
- subAccounts: [tokenAccount],
461
- };
462
-
463
- return new Promise((resolve, reject) => {
464
- uiRegisterAccount({
465
- parentAccount: parentAccountWithSubAccount,
466
- accountName,
467
- existingAccounts: existingParentAccounts,
468
- onSuccess: () => {
469
- resolve({
470
- success: true,
471
- accountName,
472
- parentAccountId: parentAccountWithSubAccount.id,
473
- tokenAccountId: tokenAccount.id,
474
- ethereumAddress: validatedInputs.ethereumAddress,
475
- tokenContractAddress: finalTokenContractAddress,
476
- meta: validatedInputs.meta,
477
- });
478
- },
479
- onError: error => {
480
- reject(error);
481
- },
482
- });
483
- });
484
- } else {
485
- throw new Error("No account registration UI hook available");
486
- }
487
- }),
488
299
  } as const satisfies Handlers;
489
300
  };
301
+
490
302
  function fromRelativePath(basePath: string, derivationPath?: string) {
491
303
  if (!derivationPath) {
492
304
  return basePath;
@@ -53,6 +53,7 @@ import { getSwapStepFromError } from "../../exchange/error";
53
53
  import { postSwapCancelled } from "../../exchange/swap";
54
54
  import { DeviceModelId } from "@ledgerhq/types-devices";
55
55
  import { setBroadcastTransaction } from "../../exchange/swap/setBroadcastTransaction";
56
+ import { FAMILIES_MAPPING_LL_TO_WAPI } from "../constants";
56
57
 
57
58
  export { ExchangeType };
58
59
 
@@ -485,11 +486,14 @@ export const handlers = ({
485
486
  });
486
487
 
487
488
  const mainFromAccount = getMainAccount(fromAccount, fromParentAccount);
489
+ const mainFromAccountFamily =
490
+ FAMILIES_MAPPING_LL_TO_WAPI[mainFromAccount.currency.family] ||
491
+ mainFromAccount.currency.family;
488
492
 
489
- if (transaction.family !== mainFromAccount.currency.family) {
493
+ if (transaction.family !== mainFromAccountFamily) {
490
494
  return Promise.reject(
491
495
  new Error(
492
- `Account and transaction must be from the same family. Account family: ${mainFromAccount.currency.family}, Transaction family: ${transaction.family}`,
496
+ `Account and transaction must be from the same family. Account family: ${mainFromAccountFamily}, Transaction family: ${transaction.family}`,
493
497
  ),
494
498
  );
495
499
  }
@@ -800,34 +804,27 @@ async function getStrategy(
800
804
  delete customFeeConfig.utxoStrategy;
801
805
  }
802
806
 
803
- const strategy = transactionStrategy?.[family];
807
+ // Normalize family key for strategy lookup
808
+ const familyKey = FAMILIES_MAPPING_LL_TO_WAPI[family] || family;
809
+ const strategy = transactionStrategy?.[familyKey];
804
810
 
805
811
  if (!strategy) {
806
- throw new Error(`No transaction strategy found for family: ${family}`);
807
- }
808
-
809
- // Convert customFeeConfig values to BigNumber
810
- const convertedCustomFeeConfig: { [key: string]: BigNumber } = {};
811
- if (customFeeConfig) {
812
- for (const [key, value] of Object.entries(customFeeConfig)) {
813
- convertedCustomFeeConfig[key] = new BigNumber(value?.toString() || 0);
814
- }
812
+ throw new Error(`No transaction strategy found for family: ${familyKey}`);
815
813
  }
816
814
 
817
815
  try {
818
816
  return await strategy({
819
- family,
820
- amount: new BigNumber(amount),
817
+ family: familyKey,
818
+ amount,
821
819
  recipient,
822
- customFeeConfig: convertedCustomFeeConfig,
820
+ customFeeConfig: customFeeConfig || {},
823
821
  payinExtraId,
824
822
  extraTransactionParameters,
825
823
  customErrorType,
826
824
  });
827
825
  } catch (error) {
828
- const errorMessage = error instanceof Error ? error.message : String(error);
829
826
  throw new Error(
830
- `Failed to execute transaction strategy for family: ${family}. Reason: ${errorMessage}`,
827
+ `Failed to execute transaction strategy for family: ${familyKey}. Reason: ${(error as Error).message}`,
831
828
  );
832
829
  }
833
830
  }
@@ -1,8 +0,0 @@
1
- import { EvmAddress } from "@ledgerhq/coin-evm/types/signer";
2
- import { CreateSigner } from "../../setup";
3
- export type Signer = {
4
- getAddress: (path: string) => Promise<EvmAddress>;
5
- signTransaction: (path: string, tx: string) => Promise<string>;
6
- };
7
- export declare const createSigner: CreateSigner<Signer>;
8
- //# sourceMappingURL=Eth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Eth.d.ts","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/signer/Eth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA2B,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C,MAAM,MAAM,MAAM,GAAG;IACnB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAChE,CAAC;AAqBF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CAmC7C,CAAC"}
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSigner = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const live_signer_evm_1 = require("@ledgerhq/live-signer-evm");
6
- const live_env_1 = require("@ledgerhq/live-env");
7
- const ethers_1 = require("ethers");
8
- const isDmkTransport = (transport) => {
9
- return ("dmk" in transport &&
10
- transport.dmk !== undefined &&
11
- "sessionId" in transport &&
12
- transport.sessionId !== undefined);
13
- };
14
- const createLiveSigner = (transport) => {
15
- if (isDmkTransport(transport)) {
16
- return new live_signer_evm_1.DmkSignerEth(transport.dmk, transport.sessionId);
17
- }
18
- return new live_signer_evm_1.LegacySignerEth(transport);
19
- };
20
- const createSigner = (transport) => {
21
- const signer = createLiveSigner(transport);
22
- return {
23
- getAddress: signer.getAddress.bind(signer),
24
- signTransaction: async (path, tx) => {
25
- // Configure type of resolutions necessary for the clear signing
26
- const resolutionConfig = {
27
- externalPlugins: true,
28
- erc20: true,
29
- nft: false,
30
- uniswapV3: true,
31
- };
32
- const loadConfig = {
33
- cryptoassetsBaseURL: (0, live_env_1.getEnv)("DYNAMIC_CAL_BASE_URL"),
34
- nftExplorerBaseURL: (0, live_env_1.getEnv)("NFT_METADATA_SERVICE") + "/v1/ethereum",
35
- };
36
- signer.setLoadConfig(loadConfig);
37
- const observable = signer.clearSignTransaction(path, tx.substring(2), resolutionConfig, true);
38
- const event = observable.pipe((0, rxjs_1.filter)((event) => {
39
- return event.type === "signer.evm.signed";
40
- }));
41
- const { value } = await (0, rxjs_1.firstValueFrom)(event);
42
- return ethers_1.Signature.from({
43
- r: "0x" + value.r,
44
- s: "0x" + value.s,
45
- v: typeof value.v === "number" ? value.v : parseInt(value.v, 16),
46
- }).serialized;
47
- },
48
- };
49
- };
50
- exports.createSigner = createSigner;
51
- //# sourceMappingURL=Eth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Eth.js","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/signer/Eth.ts"],"names":[],"mappings":";;;AAAA,+BAA8C;AAI9C,+DAA0E;AAE1E,iDAA4C;AAE5C,mCAAmC;AAOnC,MAAM,cAAc,GAAG,CACrB,SAAoB,EACsD,EAAE;IAC5E,OAAO,CACL,KAAK,IAAI,SAAS;QAClB,SAAS,CAAC,GAAG,KAAK,SAAS;QAC3B,WAAW,IAAI,SAAS;QACxB,SAAS,CAAC,SAAS,KAAK,SAAS,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAA4B,CAAC,SAAoB,EAAE,EAAE;IACzE,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC7B,OAAO,IAAI,8BAAY,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC7D;IAED,OAAO,IAAI,iCAAe,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAEK,MAAM,YAAY,GAAyB,CAAC,SAAoB,EAAE,EAAE;IACzE,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAE3C,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAC1C,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;YAClC,gEAAgE;YAChE,MAAM,gBAAgB,GAAqB;gBACzC,eAAe,EAAE,IAAI;gBACrB,KAAK,EAAE,IAAI;gBACX,GAAG,EAAE,KAAK;gBACV,SAAS,EAAE,IAAI;aAChB,CAAC;YACF,MAAM,UAAU,GAAe;gBAC7B,mBAAmB,EAAE,IAAA,iBAAM,EAAC,sBAAsB,CAAC;gBACnD,kBAAkB,EAAE,IAAA,iBAAM,EAAC,sBAAsB,CAAC,GAAG,cAAc;aACpE,CAAC;YAEF,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEjC,MAAM,UAAU,GAAG,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;YAC9F,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAC3B,IAAA,aAAM,EAAC,CAAC,KAAK,EAA+D,EAAE;gBAC5E,OAAO,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC;YAC5C,CAAC,CAAC,CACH,CAAC;YACF,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,qBAAc,EAAC,KAAK,CAAC,CAAC;YAE9C,OAAO,kBAAS,CAAC,IAAI,CAAC;gBACpB,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;gBACjB,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;gBACjB,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;aACjE,CAAC,CAAC,UAAU,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAnCW,QAAA,YAAY,gBAmCvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=getAccountShape.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAccountShape.test.d.ts","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/tests/getAccountShape.test.ts"],"names":[],"mappings":""}
@@ -1,144 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
7
- const getAccountShape_1 = require("../getAccountShape");
8
- jest.mock("@ledgerhq/coin-framework/account/index", () => ({
9
- encodeAccountId: jest.fn(() => "accId"),
10
- }));
11
- const mergeOpsMock = jest.fn();
12
- jest.mock("@ledgerhq/coin-framework/bridge/jsHelpers", () => ({
13
- mergeOps: (...args) => mergeOpsMock(...args),
14
- }));
15
- const listOperationsMock = jest.fn();
16
- const getBalanceMock = jest.fn();
17
- const lastBlockMock = jest.fn();
18
- const getTokenFromAssetMock = jest.fn();
19
- const chainSpecificGetAccountShapeMock = jest.fn();
20
- jest.mock("../alpaca", () => ({
21
- getAlpacaApi: () => ({
22
- lastBlock: (...a) => lastBlockMock(...a),
23
- getBalance: (...a) => getBalanceMock(...a),
24
- listOperations: (...a) => listOperationsMock(...a),
25
- getTokenFromAsset: (...a) => getTokenFromAssetMock(...a),
26
- getChainSpecificRules: () => ({
27
- getAccountShape: (...a) => chainSpecificGetAccountShapeMock(...a),
28
- }),
29
- }),
30
- }));
31
- const adaptCoreOperationToLiveOperationMock = jest.fn();
32
- const extractBalanceMock = jest.fn();
33
- jest.mock("../utils", () => ({
34
- adaptCoreOperationToLiveOperation: (...a) => adaptCoreOperationToLiveOperationMock(...a),
35
- extractBalance: (...a) => extractBalanceMock(...a),
36
- }));
37
- const inferSubOperationsMock = jest.fn();
38
- jest.mock("@ledgerhq/coin-framework/serialization", () => ({
39
- inferSubOperations: (...a) => inferSubOperationsMock(...a),
40
- }));
41
- const buildSubAccountsMock = jest.fn();
42
- jest.mock("../buildSubAccounts", () => ({
43
- buildSubAccounts: (...a) => buildSubAccountsMock(...a),
44
- }));
45
- // Test matrix for Stellar & XRP
46
- const chains = [
47
- { currency: { id: "stellar", name: "Stellar" }, network: "testnet" },
48
- { currency: { id: "ripple", name: "XRP" }, network: "mainnet" },
49
- ];
50
- describe("genericGetAccountShape (stellar & xrp)", () => {
51
- beforeEach(() => {
52
- jest.clearAllMocks();
53
- });
54
- describe.each(chains)("$currency.id", ({ currency, network }) => {
55
- test("builds account shape with existing operations, pagination and sub accounts", async () => {
56
- const oldOp = {
57
- hash: "h1",
58
- blockHeight: 10,
59
- type: "OPT_IN",
60
- extra: { pagingToken: "pt1", assetReference: "ar1", assetOwner: "ow1" },
61
- };
62
- const initialAccount = { operations: [oldOp], blockHeight: 10 };
63
- extractBalanceMock.mockReturnValue({ value: "1000", locked: "300" });
64
- getBalanceMock.mockResolvedValue([
65
- { asset: { type: "native" }, value: "1000", locked: "300" },
66
- { asset: { type: "token", symbol: "TOK1" }, value: "42" },
67
- { asset: { type: "token", symbol: "TOK_IGNORE" }, value: "5" },
68
- ]);
69
- getTokenFromAssetMock.mockImplementation(asset => asset.symbol === "TOK1" ? { id: `${currency.id}_token1` } : null);
70
- const coreOp = { hash: "h2", height: 12 };
71
- listOperationsMock.mockResolvedValue([[coreOp]]);
72
- adaptCoreOperationToLiveOperationMock.mockImplementation((_accId, op) => ({
73
- hash: op.hash,
74
- type: "IN",
75
- blockHeight: 12,
76
- extra: { assetReference: "ar2", assetOwner: "ow2" },
77
- }));
78
- mergeOpsMock.mockImplementation((oldOps, newOps) => [...newOps, ...oldOps]);
79
- buildSubAccountsMock.mockReturnValue([
80
- { id: `${currency.id}_subAcc1`, type: "TokenAccount" },
81
- ]);
82
- inferSubOperationsMock.mockImplementation(hash => hash === "h2" ? [{ id: `${currency.id}_subOp1` }] : []);
83
- lastBlockMock.mockResolvedValue({ height: 123 });
84
- const getShape = (0, getAccountShape_1.genericGetAccountShape)(network, currency.id);
85
- const result = await getShape({
86
- address: `${currency.id}_addr1`,
87
- initialAccount,
88
- currency,
89
- derivationMode: "",
90
- }, { paginationConfig: {} });
91
- expect(chainSpecificGetAccountShapeMock).toHaveBeenCalledWith(`${currency.id}_addr1`);
92
- expect(listOperationsMock).toHaveBeenCalledWith(`${currency.id}_addr1`, {
93
- minHeight: 11,
94
- order: "asc",
95
- lastPagingToken: "pt1",
96
- });
97
- const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].assetsBalance;
98
- expect(assetsBalancePassed).toHaveLength(1);
99
- expect(assetsBalancePassed[0].asset.symbol).toBe("TOK1");
100
- const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
101
- expect(assetOpsPassed).toHaveLength(1);
102
- expect(assetOpsPassed[0].hash).toBe("h2");
103
- expect(result).toMatchObject({
104
- balance: new bignumber_js_1.default(1000),
105
- spendableBalance: new bignumber_js_1.default(700),
106
- blockHeight: 123,
107
- operationsCount: 2,
108
- subAccounts: [{ id: `${currency.id}_subAcc1`, type: "TokenAccount" }],
109
- operations: [
110
- {
111
- hash: "h2",
112
- type: "IN",
113
- blockHeight: 12,
114
- subOperations: [{ id: `${currency.id}_subOp1` }],
115
- extra: { assetReference: "ar2", assetOwner: "ow2" },
116
- },
117
- oldOp,
118
- ],
119
- });
120
- });
121
- test("handles empty operations (no old ops, no new ops) and blockHeight=0", async () => {
122
- getBalanceMock.mockResolvedValue([{ asset: { type: "native" }, value: "0", locked: "0" }]);
123
- extractBalanceMock.mockReturnValue({ value: "0", locked: "0" });
124
- listOperationsMock.mockResolvedValue([[]]);
125
- buildSubAccountsMock.mockReturnValue([]);
126
- const getShape = (0, getAccountShape_1.genericGetAccountShape)(network, currency.id);
127
- const result = await getShape({
128
- address: `${currency.id}_addr2`,
129
- initialAccount: undefined,
130
- currency,
131
- derivationMode: "",
132
- }, { paginationConfig: {} });
133
- expect(result).toMatchObject({
134
- operations: [],
135
- blockHeight: 0,
136
- operationsCount: 0,
137
- subAccounts: [],
138
- balance: new bignumber_js_1.default(0),
139
- spendableBalance: new bignumber_js_1.default(0),
140
- });
141
- });
142
- });
143
- });
144
- //# sourceMappingURL=getAccountShape.test.js.map