@ledgerhq/live-common 34.37.0-nightly.4 → 34.37.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 (326) hide show
  1. package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
  2. package/lib/__tests__/test-helpers/bridge.js +4 -4
  3. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  4. package/lib/bridge/impl.d.ts.map +1 -1
  5. package/lib/bridge/impl.js +3 -59
  6. package/lib/bridge/impl.js.map +1 -1
  7. package/lib/config/index.d.ts +2 -3
  8. package/lib/config/index.d.ts.map +1 -1
  9. package/lib/config/index.js +1 -9
  10. package/lib/config/index.js.map +1 -1
  11. package/lib/config/sharedConfig.d.ts.map +1 -1
  12. package/lib/config/sharedConfig.js +0 -7
  13. package/lib/config/sharedConfig.js.map +1 -1
  14. package/lib/e2e/index.d.ts +0 -4
  15. package/lib/e2e/index.d.ts.map +1 -1
  16. package/lib/e2e/speculos.d.ts.map +1 -1
  17. package/lib/e2e/speculos.js +0 -3
  18. package/lib/e2e/speculos.js.map +1 -1
  19. package/lib/e2e/speculosCI.js +1 -1
  20. package/lib/exchange/providers/swap.d.ts +0 -1
  21. package/lib/exchange/providers/swap.d.ts.map +1 -1
  22. package/lib/exchange/providers/swap.integration.test.js +12 -26
  23. package/lib/exchange/providers/swap.integration.test.js.map +1 -1
  24. package/lib/exchange/providers/swap.js +0 -25
  25. package/lib/exchange/providers/swap.js.map +1 -1
  26. package/lib/families/evm/config.js +2 -2
  27. package/lib/families/evm/config.js.map +1 -1
  28. package/lib/families/xrp/setup.d.ts +6 -3
  29. package/lib/families/xrp/setup.d.ts.map +1 -1
  30. package/lib/families/xrp/setup.js +7 -1
  31. package/lib/families/xrp/setup.js.map +1 -1
  32. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  33. package/lib/featureFlags/defaultFeatures.js +0 -10
  34. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  35. package/lib/featureFlags/useFeature.d.ts +1 -1
  36. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  37. package/lib/generated/bridge/js.d.ts +1 -0
  38. package/lib/generated/bridge/js.d.ts.map +1 -1
  39. package/lib/generated/bridge/js.js +6 -4
  40. package/lib/generated/bridge/js.js.map +1 -1
  41. package/lib/hooks/useOFACGeoBlockCheck.js +1 -1
  42. package/lib/hooks/useOFACGeoBlockCheck.js.map +1 -1
  43. package/lib/hw/connectAppEventMapper.d.ts.map +1 -1
  44. package/lib/hw/connectAppEventMapper.js +4 -4
  45. package/lib/hw/connectAppEventMapper.js.map +1 -1
  46. package/lib/wallet-api/Exchange/server.d.ts +0 -2
  47. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  48. package/lib/wallet-api/Exchange/server.js +0 -6
  49. package/lib/wallet-api/Exchange/server.js.map +1 -1
  50. package/lib/wallet-api/ModularDrawer/types.d.ts +25 -30
  51. package/lib/wallet-api/ModularDrawer/types.d.ts.map +1 -1
  52. package/lib/wallet-api/ModularDrawer/types.js +11 -15
  53. package/lib/wallet-api/ModularDrawer/types.js.map +1 -1
  54. package/lib/wallet-api/ModularDrawer/utils.js +1 -1
  55. package/lib/wallet-api/ModularDrawer/utils.js.map +1 -1
  56. package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
  57. package/lib-es/__tests__/test-helpers/bridge.js +4 -4
  58. package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
  59. package/lib-es/bridge/impl.d.ts.map +1 -1
  60. package/lib-es/bridge/impl.js +3 -59
  61. package/lib-es/bridge/impl.js.map +1 -1
  62. package/lib-es/config/index.d.ts +2 -3
  63. package/lib-es/config/index.d.ts.map +1 -1
  64. package/lib-es/config/index.js +1 -8
  65. package/lib-es/config/index.js.map +1 -1
  66. package/lib-es/config/sharedConfig.d.ts.map +1 -1
  67. package/lib-es/config/sharedConfig.js +0 -7
  68. package/lib-es/config/sharedConfig.js.map +1 -1
  69. package/lib-es/e2e/index.d.ts +0 -4
  70. package/lib-es/e2e/index.d.ts.map +1 -1
  71. package/lib-es/e2e/speculos.d.ts.map +1 -1
  72. package/lib-es/e2e/speculos.js +0 -3
  73. package/lib-es/e2e/speculos.js.map +1 -1
  74. package/lib-es/e2e/speculosCI.js +1 -1
  75. package/lib-es/exchange/providers/swap.d.ts +0 -1
  76. package/lib-es/exchange/providers/swap.d.ts.map +1 -1
  77. package/lib-es/exchange/providers/swap.integration.test.js +13 -27
  78. package/lib-es/exchange/providers/swap.integration.test.js.map +1 -1
  79. package/lib-es/exchange/providers/swap.js +0 -25
  80. package/lib-es/exchange/providers/swap.js.map +1 -1
  81. package/lib-es/families/evm/config.js +2 -2
  82. package/lib-es/families/evm/config.js.map +1 -1
  83. package/lib-es/families/xrp/setup.d.ts +6 -3
  84. package/lib-es/families/xrp/setup.d.ts.map +1 -1
  85. package/lib-es/families/xrp/setup.js +7 -2
  86. package/lib-es/families/xrp/setup.js.map +1 -1
  87. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  88. package/lib-es/featureFlags/defaultFeatures.js +0 -10
  89. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  90. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  91. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  92. package/lib-es/generated/bridge/js.d.ts +1 -0
  93. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  94. package/lib-es/generated/bridge/js.js +2 -0
  95. package/lib-es/generated/bridge/js.js.map +1 -1
  96. package/lib-es/hooks/useOFACGeoBlockCheck.js +1 -1
  97. package/lib-es/hooks/useOFACGeoBlockCheck.js.map +1 -1
  98. package/lib-es/hw/connectAppEventMapper.d.ts.map +1 -1
  99. package/lib-es/hw/connectAppEventMapper.js +5 -5
  100. package/lib-es/hw/connectAppEventMapper.js.map +1 -1
  101. package/lib-es/wallet-api/Exchange/server.d.ts +0 -2
  102. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  103. package/lib-es/wallet-api/Exchange/server.js +0 -6
  104. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  105. package/lib-es/wallet-api/ModularDrawer/types.d.ts +25 -30
  106. package/lib-es/wallet-api/ModularDrawer/types.d.ts.map +1 -1
  107. package/lib-es/wallet-api/ModularDrawer/types.js +5 -9
  108. package/lib-es/wallet-api/ModularDrawer/types.js.map +1 -1
  109. package/lib-es/wallet-api/ModularDrawer/utils.js +1 -1
  110. package/lib-es/wallet-api/ModularDrawer/utils.js.map +1 -1
  111. package/package.json +69 -69
  112. package/src/__tests__/test-helpers/bridge.ts +4 -2
  113. package/src/bridge/impl.ts +5 -87
  114. package/src/config/index.ts +2 -11
  115. package/src/config/sharedConfig.ts +0 -8
  116. package/src/e2e/speculos.ts +0 -3
  117. package/src/e2e/speculosCI.ts +1 -1
  118. package/src/exchange/providers/swap.integration.test.ts +16 -33
  119. package/src/exchange/providers/swap.ts +0 -32
  120. package/src/families/evm/config.ts +2 -2
  121. package/src/families/xrp/setup.ts +15 -2
  122. package/src/featureFlags/defaultFeatures.ts +0 -12
  123. package/src/generated/bridge/js.ts +2 -0
  124. package/src/hooks/useOFACGeoBlockCheck.ts +1 -1
  125. package/src/hw/connectAppEventMapper.ts +4 -4
  126. package/src/wallet-api/Exchange/server.ts +0 -8
  127. package/src/wallet-api/ModularDrawer/types.ts +5 -9
  128. package/src/wallet-api/ModularDrawer/utils.ts +1 -1
  129. package/lib/bridge/generic-alpaca/accountBridge.d.ts +0 -3
  130. package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +0 -1
  131. package/lib/bridge/generic-alpaca/accountBridge.js +0 -34
  132. package/lib/bridge/generic-alpaca/accountBridge.js.map +0 -1
  133. package/lib/bridge/generic-alpaca/alpaca/index.d.ts +0 -3
  134. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +0 -1
  135. package/lib/bridge/generic-alpaca/alpaca/index.js +0 -20
  136. package/lib/bridge/generic-alpaca/alpaca/index.js.map +0 -1
  137. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +0 -16
  138. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +0 -1
  139. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -123
  140. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +0 -1
  141. package/lib/bridge/generic-alpaca/broadcast.d.ts +0 -3
  142. package/lib/bridge/generic-alpaca/broadcast.d.ts.map +0 -1
  143. package/lib/bridge/generic-alpaca/broadcast.js +0 -11
  144. package/lib/bridge/generic-alpaca/broadcast.js.map +0 -1
  145. package/lib/bridge/generic-alpaca/createTransaction.d.ts +0 -16
  146. package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +0 -1
  147. package/lib/bridge/generic-alpaca/createTransaction.js +0 -20
  148. package/lib/bridge/generic-alpaca/createTransaction.js.map +0 -1
  149. package/lib/bridge/generic-alpaca/currencyBridge.d.ts +0 -3
  150. package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +0 -1
  151. package/lib/bridge/generic-alpaca/currencyBridge.js +0 -20
  152. package/lib/bridge/generic-alpaca/currencyBridge.js.map +0 -1
  153. package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts +0 -3
  154. package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +0 -1
  155. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +0 -26
  156. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +0 -1
  157. package/lib/bridge/generic-alpaca/getAccountShape.d.ts +0 -3
  158. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +0 -1
  159. package/lib/bridge/generic-alpaca/getAccountShape.js +0 -58
  160. package/lib/bridge/generic-alpaca/getAccountShape.js.map +0 -1
  161. package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts +0 -3
  162. package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +0 -1
  163. package/lib/bridge/generic-alpaca/getTransactionStatus.js +0 -36
  164. package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +0 -1
  165. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +0 -3
  166. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +0 -1
  167. package/lib/bridge/generic-alpaca/prepareTransaction.js +0 -21
  168. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +0 -1
  169. package/lib/bridge/generic-alpaca/signOperation.d.ts +0 -7
  170. package/lib/bridge/generic-alpaca/signOperation.d.ts.map +0 -1
  171. package/lib/bridge/generic-alpaca/signOperation.js +0 -49
  172. package/lib/bridge/generic-alpaca/signOperation.js.map +0 -1
  173. package/lib/bridge/generic-alpaca/signer/index.d.ts +0 -11
  174. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +0 -1
  175. package/lib/bridge/generic-alpaca/signer/index.js +0 -28
  176. package/lib/bridge/generic-alpaca/signer/index.js.map +0 -1
  177. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +0 -5
  178. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +0 -1
  179. package/lib/bridge/generic-alpaca/signer/signTransaction.js +0 -11
  180. package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +0 -1
  181. package/lib/bridge/generic-alpaca/signer/types.d.ts +0 -5
  182. package/lib/bridge/generic-alpaca/signer/types.d.ts.map +0 -1
  183. package/lib/bridge/generic-alpaca/signer/types.js +0 -3
  184. package/lib/bridge/generic-alpaca/signer/types.js.map +0 -1
  185. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts +0 -2
  186. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts.map +0 -1
  187. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +0 -90
  188. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +0 -1
  189. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts +0 -2
  190. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts.map +0 -1
  191. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +0 -53
  192. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +0 -1
  193. package/lib/bridge/generic-alpaca/tests/signOperation.test.d.ts +0 -2
  194. package/lib/bridge/generic-alpaca/tests/signOperation.test.d.ts.map +0 -1
  195. package/lib/bridge/generic-alpaca/tests/signOperation.test.js +0 -79
  196. package/lib/bridge/generic-alpaca/tests/signOperation.test.js.map +0 -1
  197. package/lib/bridge/generic-alpaca/utils.d.ts +0 -6
  198. package/lib/bridge/generic-alpaca/utils.d.ts.map +0 -1
  199. package/lib/bridge/generic-alpaca/utils.js +0 -55
  200. package/lib/bridge/generic-alpaca/utils.js.map +0 -1
  201. package/lib/hooks/useShowProviderLoadingTransition.d.ts +0 -9
  202. package/lib/hooks/useShowProviderLoadingTransition.d.ts.map +0 -1
  203. package/lib/hooks/useShowProviderLoadingTransition.js +0 -46
  204. package/lib/hooks/useShowProviderLoadingTransition.js.map +0 -1
  205. package/lib/hooks/useShowProviderLoadingTransition.test.d.ts +0 -5
  206. package/lib/hooks/useShowProviderLoadingTransition.test.d.ts.map +0 -1
  207. package/lib/hooks/useShowProviderLoadingTransition.test.js +0 -83
  208. package/lib/hooks/useShowProviderLoadingTransition.test.js.map +0 -1
  209. package/lib/sanction/errors.d.ts +0 -13
  210. package/lib/sanction/errors.d.ts.map +0 -1
  211. package/lib/sanction/errors.js +0 -36
  212. package/lib/sanction/errors.js.map +0 -1
  213. package/lib/sanction/index.d.ts +0 -3
  214. package/lib/sanction/index.d.ts.map +0 -1
  215. package/lib/sanction/index.js +0 -51
  216. package/lib/sanction/index.js.map +0 -1
  217. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +0 -3
  218. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +0 -1
  219. package/lib-es/bridge/generic-alpaca/accountBridge.js +0 -27
  220. package/lib-es/bridge/generic-alpaca/accountBridge.js.map +0 -1
  221. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +0 -3
  222. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +0 -1
  223. package/lib-es/bridge/generic-alpaca/alpaca/index.js +0 -16
  224. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +0 -1
  225. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +0 -16
  226. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +0 -1
  227. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -116
  228. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +0 -1
  229. package/lib-es/bridge/generic-alpaca/broadcast.d.ts +0 -3
  230. package/lib-es/bridge/generic-alpaca/broadcast.d.ts.map +0 -1
  231. package/lib-es/bridge/generic-alpaca/broadcast.js +0 -7
  232. package/lib-es/bridge/generic-alpaca/broadcast.js.map +0 -1
  233. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +0 -16
  234. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +0 -1
  235. package/lib-es/bridge/generic-alpaca/createTransaction.js +0 -13
  236. package/lib-es/bridge/generic-alpaca/createTransaction.js.map +0 -1
  237. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +0 -3
  238. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +0 -1
  239. package/lib-es/bridge/generic-alpaca/currencyBridge.js +0 -16
  240. package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +0 -1
  241. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts +0 -3
  242. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +0 -1
  243. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +0 -19
  244. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +0 -1
  245. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts +0 -3
  246. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +0 -1
  247. package/lib-es/bridge/generic-alpaca/getAccountShape.js +0 -51
  248. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +0 -1
  249. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts +0 -3
  250. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +0 -1
  251. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +0 -29
  252. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +0 -1
  253. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +0 -3
  254. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +0 -1
  255. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +0 -14
  256. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +0 -1
  257. package/lib-es/bridge/generic-alpaca/signOperation.d.ts +0 -7
  258. package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +0 -1
  259. package/lib-es/bridge/generic-alpaca/signOperation.js +0 -45
  260. package/lib-es/bridge/generic-alpaca/signOperation.js.map +0 -1
  261. package/lib-es/bridge/generic-alpaca/signer/index.d.ts +0 -11
  262. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +0 -1
  263. package/lib-es/bridge/generic-alpaca/signer/index.js +0 -21
  264. package/lib-es/bridge/generic-alpaca/signer/index.js.map +0 -1
  265. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +0 -5
  266. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +0 -1
  267. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js +0 -7
  268. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +0 -1
  269. package/lib-es/bridge/generic-alpaca/signer/types.d.ts +0 -5
  270. package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +0 -1
  271. package/lib-es/bridge/generic-alpaca/signer/types.js +0 -2
  272. package/lib-es/bridge/generic-alpaca/signer/types.js.map +0 -1
  273. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts +0 -2
  274. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts.map +0 -1
  275. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +0 -62
  276. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +0 -1
  277. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts +0 -2
  278. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts.map +0 -1
  279. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +0 -48
  280. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +0 -1
  281. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.d.ts +0 -2
  282. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.d.ts.map +0 -1
  283. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js +0 -77
  284. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js.map +0 -1
  285. package/lib-es/bridge/generic-alpaca/utils.d.ts +0 -6
  286. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +0 -1
  287. package/lib-es/bridge/generic-alpaca/utils.js +0 -46
  288. package/lib-es/bridge/generic-alpaca/utils.js.map +0 -1
  289. package/lib-es/hooks/useShowProviderLoadingTransition.d.ts +0 -9
  290. package/lib-es/hooks/useShowProviderLoadingTransition.d.ts.map +0 -1
  291. package/lib-es/hooks/useShowProviderLoadingTransition.js +0 -41
  292. package/lib-es/hooks/useShowProviderLoadingTransition.js.map +0 -1
  293. package/lib-es/hooks/useShowProviderLoadingTransition.test.d.ts +0 -5
  294. package/lib-es/hooks/useShowProviderLoadingTransition.test.d.ts.map +0 -1
  295. package/lib-es/hooks/useShowProviderLoadingTransition.test.js +0 -81
  296. package/lib-es/hooks/useShowProviderLoadingTransition.test.js.map +0 -1
  297. package/lib-es/sanction/errors.d.ts +0 -13
  298. package/lib-es/sanction/errors.d.ts.map +0 -1
  299. package/lib-es/sanction/errors.js +0 -29
  300. package/lib-es/sanction/errors.js.map +0 -1
  301. package/lib-es/sanction/index.d.ts +0 -3
  302. package/lib-es/sanction/index.d.ts.map +0 -1
  303. package/lib-es/sanction/index.js +0 -44
  304. package/lib-es/sanction/index.js.map +0 -1
  305. package/src/bridge/generic-alpaca/accountBridge.ts +0 -32
  306. package/src/bridge/generic-alpaca/alpaca/index.ts +0 -20
  307. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +0 -182
  308. package/src/bridge/generic-alpaca/broadcast.ts +0 -11
  309. package/src/bridge/generic-alpaca/createTransaction.ts +0 -27
  310. package/src/bridge/generic-alpaca/currencyBridge.ts +0 -17
  311. package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +0 -27
  312. package/src/bridge/generic-alpaca/getAccountShape.ts +0 -62
  313. package/src/bridge/generic-alpaca/getTransactionStatus.ts +0 -38
  314. package/src/bridge/generic-alpaca/prepareTransaction.ts +0 -22
  315. package/src/bridge/generic-alpaca/signOperation.ts +0 -83
  316. package/src/bridge/generic-alpaca/signer/index.ts +0 -33
  317. package/src/bridge/generic-alpaca/signer/signTransaction.ts +0 -13
  318. package/src/bridge/generic-alpaca/signer/types.ts +0 -4
  319. package/src/bridge/generic-alpaca/tests/estimateMaxSpendable.test.ts +0 -76
  320. package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +0 -66
  321. package/src/bridge/generic-alpaca/tests/signOperation.test.ts +0 -96
  322. package/src/bridge/generic-alpaca/utils.ts +0 -63
  323. package/src/hooks/useShowProviderLoadingTransition.test.ts +0 -112
  324. package/src/hooks/useShowProviderLoadingTransition.ts +0 -57
  325. package/src/sanction/errors.ts +0 -31
  326. package/src/sanction/index.ts +0 -59
@@ -1,66 +0,0 @@
1
- import { genericPrepareTransaction } from "../prepareTransaction";
2
- import { getAlpacaApi } from "../alpaca";
3
- import { transactionToIntent } from "../utils";
4
- import BigNumber from "bignumber.js";
5
- import type { TransactionCommon } from "@ledgerhq/types-live";
6
-
7
- jest.mock("../alpaca", () => ({
8
- getAlpacaApi: jest.fn(),
9
- }));
10
-
11
- jest.mock("../utils", () => ({
12
- transactionToIntent: jest.fn(),
13
- }));
14
-
15
- describe("genericPrepareTransaction", () => {
16
- const network = "testnet";
17
- const kind = "local";
18
-
19
- const account = {
20
- id: "test-account",
21
- address: "0xabc",
22
- } as any;
23
-
24
- const baseTransaction: TransactionCommon & { fees: BigNumber } = {
25
- amount: new BigNumber(100_000),
26
- fees: new BigNumber(500),
27
- recipient: "0xrecipient",
28
- };
29
-
30
- const txIntent = { mock: "intent" };
31
-
32
- beforeEach(() => {
33
- jest.clearAllMocks();
34
- (transactionToIntent as jest.Mock).mockReturnValue(txIntent);
35
- });
36
-
37
- it("updates fees if they differ", async () => {
38
- const newFee = new BigNumber(700);
39
-
40
- (getAlpacaApi as jest.Mock).mockReturnValue({
41
- estimateFees: jest.fn().mockResolvedValue({ value: newFee }),
42
- });
43
-
44
- const prepareTransaction = genericPrepareTransaction(network, kind);
45
- const result = await prepareTransaction(account, { ...baseTransaction });
46
-
47
- expect((result as any).fees.toString()).toBe(newFee.toString());
48
- expect(transactionToIntent).toHaveBeenCalledWith(
49
- account,
50
- expect.objectContaining(baseTransaction),
51
- );
52
- });
53
-
54
- it("returns original transaction if fees are the same", async () => {
55
- const sameFee = baseTransaction.fees;
56
-
57
- (getAlpacaApi as jest.Mock).mockReturnValue({
58
- estimateFees: jest.fn().mockResolvedValue({ value: sameFee }),
59
- });
60
-
61
- const prepareTransaction = genericPrepareTransaction(network, kind);
62
- const result = await prepareTransaction(account, { ...baseTransaction });
63
-
64
- expect(result).toStrictEqual(baseTransaction);
65
- });
66
- });
@@ -1,96 +0,0 @@
1
- import { lastValueFrom } from "rxjs";
2
- import { toArray } from "rxjs/operators";
3
- import { genericSignOperation } from "../signOperation";
4
- import { FeeNotLoaded } from "@ledgerhq/errors";
5
- import { getAlpacaApi } from "../alpaca";
6
- import { buildOptimisticOperation, transactionToIntent } from "../utils";
7
-
8
- jest.mock("../alpaca", () => ({
9
- getAlpacaApi: jest.fn(),
10
- }));
11
-
12
- jest.mock("../utils", () => ({
13
- buildOptimisticOperation: jest.fn(),
14
- transactionToIntent: jest.fn(),
15
- }));
16
-
17
- describe("genericSignOperation", () => {
18
- const network = "xrp";
19
- const kind = "local";
20
-
21
- const mockSignerContext = jest.fn();
22
- const mockSigner = {
23
- getAddress: jest.fn(),
24
- signTransaction: jest.fn(),
25
- };
26
-
27
- const account = {
28
- freshAddressPath: "44'/144'/0'/0/0",
29
- address: "rTestAddress",
30
- } as any;
31
-
32
- const transaction = {
33
- amount: 100_000n,
34
- fees: 500n,
35
- tag: 1234,
36
- } as any;
37
-
38
- const deviceId = "mockDevice";
39
-
40
- const txIntent = {
41
- memo: {
42
- type: "map",
43
- memos: new Map(),
44
- },
45
- };
46
-
47
- const unsignedTx = "unsignedTx";
48
- const signedTx = "signedTx";
49
- const pubKey = "pubKey";
50
-
51
- beforeEach(() => {
52
- jest.clearAllMocks();
53
-
54
- (getAlpacaApi as jest.Mock).mockReturnValue({
55
- craftTransaction: jest.fn().mockResolvedValue(unsignedTx),
56
- combine: jest.fn().mockResolvedValue(signedTx),
57
- });
58
-
59
- (transactionToIntent as jest.Mock).mockReturnValue(txIntent);
60
- (buildOptimisticOperation as jest.Mock).mockReturnValue({ id: "mock-op" });
61
-
62
- mockSigner.getAddress.mockResolvedValue({ publicKey: pubKey });
63
- mockSigner.signTransaction.mockResolvedValue("sig");
64
- mockSignerContext.mockImplementation(async (_deviceId, cb) => cb(mockSigner));
65
- });
66
-
67
- it("emits full sign operation flow", async () => {
68
- const signOperation = genericSignOperation(network, kind)(mockSignerContext);
69
- const observable = signOperation({ account, transaction, deviceId });
70
-
71
- const events = await lastValueFrom(observable.pipe(toArray()));
72
-
73
- expect(events[0]).toEqual({ type: "device-signature-requested" });
74
- expect(events[1]).toEqual({ type: "device-signature-granted" });
75
- expect(events[2]).toEqual({
76
- type: "signed",
77
- signedOperation: {
78
- operation: { id: "mock-op" },
79
- signature: signedTx,
80
- },
81
- });
82
-
83
- expect(transactionToIntent).toHaveBeenCalledWith(account, transaction);
84
- expect(txIntent.memo.memos.get("destinationTag")).toBe("1234");
85
- });
86
-
87
- it("throws FeeNotLoaded if fees are missing", async () => {
88
- const txWithoutFees = { ...transaction };
89
- delete txWithoutFees.fees;
90
-
91
- const signOperation = genericSignOperation(network, kind)(mockSignerContext);
92
- const observable = signOperation({ account, transaction: txWithoutFees, deviceId });
93
-
94
- await expect(observable.toPromise()).rejects.toThrow(FeeNotLoaded);
95
- });
96
- });
@@ -1,63 +0,0 @@
1
- import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
2
- import { Account, Operation, OperationType, TransactionCommon } from "@ledgerhq/types-live";
3
- import {
4
- Operation as CoreOperation,
5
- Asset,
6
- TransactionIntent,
7
- } from "@ledgerhq/coin-framework/api/types";
8
- import BigNumber from "bignumber.js";
9
- import { fromBigNumberToBigInt } from "@ledgerhq/coin-framework/utils";
10
-
11
- export function adaptCoreOperationToLiveOperation(
12
- accountId: string,
13
- op: CoreOperation<Asset>,
14
- ): Operation {
15
- return {
16
- id: encodeOperationId(accountId, op.tx.hash, op.type),
17
- hash: op.tx.hash,
18
- accountId,
19
- type: op.type as OperationType,
20
- value: new BigNumber(op.value.toString()),
21
- fee: new BigNumber(op.tx.fees.toString()),
22
- blockHash: op.tx.block.hash,
23
- blockHeight: op.tx.block.height,
24
- senders: op.senders,
25
- recipients: op.recipients,
26
- date: op.tx.date,
27
- transactionSequenceNumber: op.details?.sequence as number,
28
- extra: {},
29
- };
30
- }
31
-
32
- export function transactionToIntent(
33
- _account: Account,
34
- transaction: TransactionCommon,
35
- ): TransactionIntent<any> {
36
- return {
37
- type: "Payment",
38
- sender: _account.freshAddress,
39
- recipient: transaction.recipient,
40
- amount: fromBigNumberToBigInt(transaction.amount, BigInt(0)),
41
- asset: null,
42
- };
43
- }
44
-
45
- export const buildOptimisticOperation = (
46
- account: Account,
47
- transaction: TransactionCommon,
48
- ): Operation => {
49
- return {
50
- id: encodeOperationId(account.id, "", "OUT"),
51
- hash: "",
52
- type: "OUT",
53
- value: transaction.amount,
54
- fee: transaction["fees"] ?? BigNumber(0),
55
- blockHash: null,
56
- blockHeight: null,
57
- senders: [account.freshAddress.toString()],
58
- recipients: [transaction.recipient],
59
- accountId: account.id,
60
- date: new Date(),
61
- extra: {},
62
- };
63
- };
@@ -1,112 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
-
5
- import { renderHook } from "@testing-library/react";
6
- import { LiveAppManifest } from "../platform/types";
7
- import { INTERNAL_APP_IDS } from "../wallet-api/constants";
8
- import { useFeature } from "../featureFlags";
9
- import { useInternalAppIds } from "./useInternalAppIds";
10
-
11
- import { useShowProviderLoadingTransition } from "./useShowProviderLoadingTransition";
12
-
13
- jest.mock("../featureFlags", () => ({
14
- useFeature: jest.fn(),
15
- }));
16
- jest.mock("../wallet-api/constants", () => ({
17
- INTERNAL_APP_IDS: ["internal-app-id-1", "internal-app-id-2"],
18
- }));
19
- jest.mock("./useInternalAppIds", () => ({
20
- useInternalAppIds: jest.fn(),
21
- }));
22
-
23
- describe("useShowProviderLoadingTransition", () => {
24
- const mockUseFeature = useFeature as jest.Mock;
25
- const mockUseInternalAppIds = useInternalAppIds as jest.Mock;
26
-
27
- beforeEach(() => {
28
- jest.clearAllMocks();
29
- });
30
-
31
- it("should return false when feature is disabled", () => {
32
- mockUseFeature.mockReturnValue({ enabled: false, params: {} });
33
- const { result } = renderHook(() =>
34
- useShowProviderLoadingTransition({
35
- manifest: { id: "test-app-id" } as LiveAppManifest,
36
- isLoading: true,
37
- }),
38
- );
39
- expect(result.current).toBe(false);
40
- });
41
-
42
- it("should return false for internal apps", () => {
43
- mockUseFeature.mockReturnValue({ enabled: true, params: {} });
44
- mockUseInternalAppIds.mockReturnValue(INTERNAL_APP_IDS);
45
- const { result } = renderHook(() =>
46
- useShowProviderLoadingTransition({
47
- manifest: { id: "internal-app-id-1" } as LiveAppManifest,
48
- isLoading: true,
49
- }),
50
- );
51
- expect(result.current).toBe(false);
52
- });
53
-
54
- it("should return true when loading and feature is enabled", () => {
55
- mockUseFeature.mockReturnValue({ enabled: true, params: {} });
56
- mockUseInternalAppIds.mockReturnValue([]);
57
- const { result } = renderHook(() =>
58
- useShowProviderLoadingTransition({
59
- manifest: { id: "test-app-id" } as LiveAppManifest,
60
- isLoading: true,
61
- }),
62
- );
63
- expect(result.current).toBe(true);
64
- });
65
-
66
- it("should handle extended loading state", () => {
67
- jest.useFakeTimers();
68
- mockUseFeature.mockReturnValue({ enabled: true, params: { durationMs: 1000 } });
69
- mockUseInternalAppIds.mockReturnValue([]);
70
-
71
- const { result, rerender } = renderHook(
72
- ({ isLoading }) =>
73
- useShowProviderLoadingTransition({
74
- manifest: { id: "test-app-id" } as LiveAppManifest,
75
- isLoading,
76
- }),
77
- {
78
- initialProps: { isLoading: true },
79
- },
80
- );
81
-
82
- expect(result.current).toBe(true);
83
-
84
- // Simulate the timeout
85
- jest.advanceTimersByTime(1000);
86
-
87
- rerender({ isLoading: false });
88
-
89
- expect(result.current).toBe(false);
90
-
91
- jest.useRealTimers();
92
- });
93
- it("should clear timeout on unmount", () => {
94
- jest.useFakeTimers();
95
- mockUseFeature.mockReturnValue({ enabled: true, params: { durationMs: 1000 } });
96
- mockUseInternalAppIds.mockReturnValue([]);
97
-
98
- const { unmount } = renderHook(() =>
99
- useShowProviderLoadingTransition({
100
- manifest: { id: "test-app-id" } as LiveAppManifest,
101
- isLoading: true,
102
- }),
103
- );
104
-
105
- unmount();
106
-
107
- // Advance timers to ensure no memory leaks
108
- jest.advanceTimersByTime(1000);
109
-
110
- jest.useRealTimers();
111
- });
112
- });
@@ -1,57 +0,0 @@
1
- import { useEffect, useRef, useState } from "react";
2
-
3
- import { useFeature } from "../featureFlags/index";
4
- import { INTERNAL_APP_IDS } from "../wallet-api/constants";
5
- import { useInternalAppIds } from "./useInternalAppIds";
6
- import { LiveAppManifest } from "../platform/types";
7
-
8
- export function useShowProviderLoadingTransition({
9
- isLoading,
10
- manifest,
11
- }: {
12
- manifest: LiveAppManifest;
13
- isLoading: boolean;
14
- }) {
15
- const isEnabled = useProviderInterstitalEnabled({ manifest });
16
- const [extendedInitialLoading, setExtendedInitialLoading] = useState(false);
17
-
18
- const timeoutRef = useRef<NodeJS.Timeout | null>(null);
19
- const buySellLoaderFF = useFeature("buySellLoader");
20
- const durationMs = buySellLoaderFF?.params?.durationMs ?? 0;
21
- const internalAppIds = useInternalAppIds() || INTERNAL_APP_IDS;
22
- const isAppInternal = internalAppIds.includes(manifest.id);
23
-
24
- useEffect(() => {
25
- if (isEnabled && isLoading && !extendedInitialLoading) {
26
- setExtendedInitialLoading(true);
27
-
28
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
29
-
30
- timeoutRef.current = setTimeout(() => {
31
- setExtendedInitialLoading(false);
32
- }, durationMs);
33
- }
34
- }, [durationMs, extendedInitialLoading, isAppInternal, isEnabled, isLoading]);
35
-
36
- useEffect(() => {
37
- return () => {
38
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
39
- };
40
- }, []);
41
-
42
- return isEnabled && (isLoading || extendedInitialLoading);
43
- }
44
-
45
- export function useProviderInterstitalEnabled({ manifest }: { manifest?: LiveAppManifest }) {
46
- const buySellLoaderFF = useFeature("buySellLoader");
47
- const internalAppIds = useInternalAppIds() || INTERNAL_APP_IDS;
48
-
49
- if (!manifest) {
50
- return false;
51
- }
52
-
53
- const isAppInternal = internalAppIds.includes(manifest.id);
54
- const isEnabled = buySellLoaderFF?.enabled && !isAppInternal;
55
-
56
- return isEnabled;
57
- }
@@ -1,31 +0,0 @@
1
- export class UserAddressSanctionedError extends Error {
2
- constructor() {
3
- super();
4
- this.message = this.constructor.name;
5
- this.name = this.constructor.name;
6
- }
7
- }
8
-
9
- export class UserAddressSanctionedForSendError extends Error {
10
- constructor() {
11
- super();
12
- this.message = this.constructor.name;
13
- this.name = this.constructor.name;
14
- }
15
- }
16
-
17
- export class UserAddressSanctionedForStakingError extends Error {
18
- constructor() {
19
- super();
20
- this.message = this.constructor.name;
21
- this.name = this.constructor.name;
22
- }
23
- }
24
-
25
- export class RecipientAddressSanctionedError extends Error {
26
- constructor() {
27
- super();
28
- this.message = this.constructor.name;
29
- this.name = this.constructor.name;
30
- }
31
- }
@@ -1,59 +0,0 @@
1
- import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
2
- import axios from "axios";
3
- import { hours, makeLRUCache } from "@ledgerhq/live-network/cache";
4
- import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
5
- import { getCurrencyConfiguration, getSharedConfiguration } from "../config";
6
- import { CurrencyConfig } from "@ledgerhq/coin-framework/config";
7
-
8
- const cache = makeLRUCache(fetchSanctionedAddresses, () => "all_sanctioned_addresses", hours(12));
9
-
10
- async function fetchSanctionedAddresses(): Promise<Record<string, string[]>> {
11
- const { data } = await axios.get(
12
- "https://ofac-compliance.pages.dev/all_sanctioned_addresses.json",
13
- );
14
- return data;
15
- }
16
-
17
- export async function isAddressSanctioned(
18
- currency: CryptoCurrency,
19
- address: string,
20
- ): Promise<boolean> {
21
- if (!isCheckBlacklistAddressEnabled(currency)) {
22
- return false;
23
- }
24
-
25
- // Only for testing, should be deleted after
26
- const temporarySanctionedAddresses: string[] | undefined =
27
- LiveConfig.getValueByKey(`tmp_sanctioned_addresses`);
28
-
29
- const data: Record<string, string[]> = await cache();
30
- const addresses = data[currency.ticker] || [];
31
-
32
- if (temporarySanctionedAddresses) {
33
- return addresses.concat(temporarySanctionedAddresses).includes(address);
34
- }
35
-
36
- return addresses.includes(address);
37
- }
38
-
39
- function isCheckBlacklistAddressEnabled(currency: CryptoCurrency): boolean {
40
- const currencyConfig = tryGetCurrencyConfig(currency);
41
- if (currencyConfig && "checkBlacklistAddress" in currencyConfig) {
42
- return currencyConfig.checkBlacklistAddress === true;
43
- } else {
44
- const sharedConfiguration = getSharedConfiguration();
45
- if ("checkBlacklistAddress" in sharedConfiguration) {
46
- return sharedConfiguration.checkBlacklistAddress === true;
47
- }
48
- }
49
-
50
- return false;
51
- }
52
-
53
- function tryGetCurrencyConfig(currency: CryptoCurrency): CurrencyConfig | undefined {
54
- try {
55
- return getCurrencyConfiguration(currency);
56
- } catch (error) {
57
- return undefined;
58
- }
59
- }