@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,20 +0,0 @@
1
- import { createApi as createXrpApi } from "@ledgerhq/coin-xrp/api/index";
2
- import { getCurrencyConfiguration } from "../../../config";
3
- import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
4
- import { getNetworkAlpacaApi } from "./network/network-alpaca";
5
- import { Api } from "@ledgerhq/coin-framework/api/types";
6
- import { XrpCoinConfig } from "@ledgerhq/coin-xrp/config";
7
-
8
- export function getAlpacaApi(network: string, kind: "local" | "remote"): Api<any, any> {
9
- if (kind === "local") {
10
- switch (network) {
11
- case "ripple":
12
- case "xrp":
13
- return createXrpApi(
14
- getCurrencyConfiguration<XrpCoinConfig>(getCryptoCurrencyById("ripple")),
15
- ) as Api<any, any>;
16
- // as unknown as Api<any>; // FIXME: createXrpApi returns a strongly typed Api<XrpSender>, fix Api<any> to allow it
17
- }
18
- }
19
- return getNetworkAlpacaApi(network) satisfies Partial<Api<any, any>> as Api<any, any>;
20
- }
@@ -1,182 +0,0 @@
1
- import type {
2
- // Api,
3
- Account,
4
- Balance,
5
- BlockInfo,
6
- Operation,
7
- FeeEstimation,
8
- Pagination,
9
- TransactionIntent,
10
- Transaction,
11
- TransactionValidation,
12
- Api,
13
- } from "@ledgerhq/coin-framework/api/index";
14
- import network from "@ledgerhq/live-network";
15
-
16
- function adaptOp(backendOp: any): Operation<any> {
17
- const { date } = backendOp.tx;
18
- const newDate = new Date(date);
19
-
20
- return {
21
- ...backendOp,
22
- value: BigInt(backendOp.value),
23
- tx: { ...backendOp.tx, fees: BigInt(backendOp.tx.fees), date: newDate },
24
- };
25
- }
26
-
27
- const ALPACA_URL = "https://localhost:3000";
28
-
29
- const buildBroadcast = networkFamily =>
30
- async function broadcast(signedOperation: string): Promise<string> {
31
- const { data } = await network<
32
- {
33
- transactionIdentifier: string;
34
- },
35
- {
36
- rawTransaction: string;
37
- }
38
- >({
39
- method: "POST",
40
- url: `${ALPACA_URL}/${networkFamily}/transaction/broadcast`,
41
- data: {
42
- rawTransaction: signedOperation,
43
- },
44
- });
45
- return data.transactionIdentifier;
46
- };
47
-
48
- const buildCombine = networkFamily =>
49
- async function combine(tx: string, signature: string, pubKey?: string): Promise<string> {
50
- const { data } = await network<
51
- {
52
- signedTransaction: string;
53
- },
54
- unknown
55
- >({
56
- method: "POST",
57
- url: `${ALPACA_URL}/${networkFamily}/transaction/combine`,
58
- data: {
59
- raw_transaction: tx,
60
- signature: signature,
61
- pubkey: pubKey,
62
- },
63
- });
64
- return data.signedTransaction;
65
- };
66
-
67
- const buildEstimateFees = networkFamily =>
68
- async function estimateFees(intent: TransactionIntent<any>): Promise<FeeEstimation> {
69
- const { data } = await network<{ fee: string }, unknown>({
70
- method: "POST",
71
- url: `${ALPACA_URL}/${networkFamily}/transaction/estimate`,
72
- data: {
73
- intent: {
74
- ...intent,
75
- amount: intent.amount.toString(10),
76
- },
77
- },
78
- });
79
- return {
80
- value: BigInt(data.fee),
81
- };
82
- };
83
-
84
- const buildValidateIntent = networkFamily =>
85
- async function validateIntent(
86
- account: Account,
87
- transaction: Transaction,
88
- ): Promise<TransactionValidation> {
89
- const { data } = await network<
90
- {
91
- errors: Record<string, Error>;
92
- warnings: Record<string, Error>;
93
- estimatedFees: bigint;
94
- amount: bigint;
95
- totalSpent: bigint;
96
- },
97
- unknown
98
- >({
99
- method: "POST",
100
- url: `${ALPACA_URL}/${networkFamily}/transaction/validate`,
101
- data: {
102
- transaction,
103
- account,
104
- },
105
- });
106
- return data;
107
- };
108
-
109
- // FIXME: shouldn't hardcode
110
- type AssetInfo = {
111
- type: "native"; // or "token" if applicable
112
- };
113
-
114
- const buildGetBalance = (networkFamily: string) =>
115
- async function getBalance(address: string): Promise<Balance<AssetInfo>[]> {
116
- const { data } = await network<Balance<AssetInfo>, unknown>({
117
- method: "GET",
118
- url: `${ALPACA_URL}/${networkFamily}/account/${address}/balance`,
119
- });
120
-
121
- return [
122
- {
123
- value: BigInt(data.value),
124
- asset: data.asset,
125
- },
126
- ];
127
- };
128
-
129
- const buildListOperations = networkFamily =>
130
- async function listOperations(
131
- address: string,
132
- pagination: Pagination,
133
- ): Promise<[Operation<any>[], string]> {
134
- const { data } = await network<{ operations: Operation<any>[] }, unknown>({
135
- method: "GET",
136
- url: `${ALPACA_URL}/${networkFamily}/account/${address}/operations`,
137
- data: {
138
- from: pagination.minHeight,
139
- },
140
- });
141
- return [data.operations.map(op => adaptOp(op)), ""];
142
- };
143
-
144
- const buildLastBlock = networkFamily =>
145
- async function lastBlock(): Promise<BlockInfo> {
146
- const { data } = await network<any, unknown>({
147
- method: "GET",
148
- url: `${ALPACA_URL}/${networkFamily}/lastblock`,
149
- });
150
- return {
151
- height: data.height,
152
- time: new Date(data.time),
153
- hash: data.hash,
154
- };
155
- };
156
-
157
- const buildCraftTransaction = networkFamily =>
158
- async function craftTransaction(intent: TransactionIntent<any>): Promise<string> {
159
- const { data } = await network<any, unknown>({
160
- method: "POST",
161
- url: `${ALPACA_URL}/${networkFamily}/transaction/encode`,
162
- data: {
163
- intent: {
164
- ...intent,
165
- amount: intent.amount.toString(10),
166
- },
167
- },
168
- });
169
- return data.rawTransaction;
170
- };
171
-
172
- export const getNetworkAlpacaApi = (networkFamily: string) =>
173
- ({
174
- broadcast: buildBroadcast(networkFamily),
175
- combine: buildCombine(networkFamily),
176
- validateIntent: buildValidateIntent(networkFamily),
177
- estimateFees: buildEstimateFees(networkFamily),
178
- getBalance: buildGetBalance(networkFamily),
179
- listOperations: buildListOperations(networkFamily),
180
- lastBlock: buildLastBlock(networkFamily),
181
- craftTransaction: buildCraftTransaction(networkFamily),
182
- }) satisfies Api<any>;
@@ -1,11 +0,0 @@
1
- import { AccountBridge, TransactionCommon } from "@ledgerhq/types-live";
2
- import { patchOperationWithHash } from "../../operation";
3
- import { getAlpacaApi } from "./alpaca";
4
-
5
- export const genericBroadcast: (network, kind) => AccountBridge<TransactionCommon>["broadcast"] =
6
- (network, kind) =>
7
- async ({ signedOperation: { signature, operation } }) => {
8
- const hash = await getAlpacaApi(network, kind).broadcast(signature);
9
-
10
- return patchOperationWithHash(operation, hash);
11
- };
@@ -1,27 +0,0 @@
1
- import { Account, TransactionCommon } from "@ledgerhq/types-live";
2
- import BigNumber from "bignumber.js";
3
- import type { Unit } from "@ledgerhq/types-cryptoassets";
4
-
5
- export type NetworkInfo = {
6
- family: "xrp";
7
- serverFee: BigNumber;
8
- baseReserve: BigNumber;
9
- };
10
-
11
- export function createTransaction(account: Account): TransactionCommon & {
12
- family: string;
13
- fee: BigNumber | null | undefined;
14
- networkInfo: NetworkInfo | null | undefined;
15
- tag: number | null | undefined;
16
- feeCustomUnit: Unit | null | undefined;
17
- } {
18
- return {
19
- family: account.currency.family,
20
- amount: BigNumber(0),
21
- recipient: "",
22
- fee: null,
23
- tag: undefined,
24
- networkInfo: null,
25
- feeCustomUnit: null,
26
- };
27
- }
@@ -1,17 +0,0 @@
1
- import { makeScanAccounts } from "@ledgerhq/coin-framework/bridge/jsHelpers";
2
- import { CurrencyBridge } from "@ledgerhq/types-live";
3
- import { genericGetAccountShape } from "./getAccountShape";
4
- import { getSigner } from "./signer";
5
-
6
- export function getAlpacaCurrencyBridge(network: string, kind: string): CurrencyBridge {
7
- return {
8
- preload: () => Promise.resolve({}),
9
- hydrate: () => {
10
- return;
11
- },
12
- scanAccounts: makeScanAccounts({
13
- getAccountShape: genericGetAccountShape(network, kind),
14
- getAddressFn: getSigner(network).getAddress,
15
- }),
16
- };
17
- }
@@ -1,27 +0,0 @@
1
- import { AccountBridge } from "@ledgerhq/types-live";
2
- import { getMainAccount } from "../../account";
3
- import { getAlpacaApi } from "./alpaca";
4
- import { createTransaction } from "./createTransaction";
5
- import { transactionToIntent } from "./utils";
6
- import BigNumber from "bignumber.js";
7
-
8
- export function genericEstimateMaxSpendable(
9
- network,
10
- kind,
11
- ): AccountBridge<any>["estimateMaxSpendable"] {
12
- return async ({ account, parentAccount, transaction }) => {
13
- const mainAccount = getMainAccount(account, parentAccount);
14
-
15
- const draftTransaction = {
16
- ...createTransaction(account as any),
17
- ...transaction,
18
- amount: mainAccount.spendableBalance,
19
- };
20
- const fees = await getAlpacaApi(network, kind).estimateFees(
21
- transactionToIntent(mainAccount, draftTransaction),
22
- );
23
-
24
- const bnFee = BigNumber(fees.value.toString());
25
- return BigNumber.max(0, account.spendableBalance.minus(bnFee));
26
- };
27
- }
@@ -1,62 +0,0 @@
1
- import { encodeAccountId } from "@ledgerhq/coin-framework/account/index";
2
- import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers";
3
- import BigNumber from "bignumber.js";
4
- import { getAlpacaApi } from "./alpaca";
5
- import { adaptCoreOperationToLiveOperation } from "./utils";
6
-
7
- export function genericGetAccountShape(network, kind): GetAccountShape {
8
- return async info => {
9
- try {
10
- const { address, initialAccount, currency, derivationMode } = info;
11
- const accountId = encodeAccountId({
12
- type: "js",
13
- version: "2",
14
- currencyId: currency.id,
15
- xpubOrAddress: address,
16
- derivationMode,
17
- });
18
-
19
- const blockInfo = await getAlpacaApi(network, kind).lastBlock();
20
-
21
- const balanceRes = await getAlpacaApi(network, kind).getBalance(address);
22
- // FIXME: fix type Balance -> check "native" balance
23
- // is balance[0] always the native ?
24
- const balance = BigNumber(balanceRes[0].value.toString());
25
-
26
- let spendableBalance: BigNumber;
27
- if (balanceRes[0]?.locked) {
28
- spendableBalance = BigNumber.max(
29
- balance.minus(BigNumber(balanceRes[0].locked.toString())),
30
- BigNumber(0),
31
- );
32
- } else {
33
- spendableBalance = initialAccount?.spendableBalance || balance;
34
- }
35
- const oldOperations = initialAccount?.operations || [];
36
-
37
- const blockHeight = oldOperations.length ? (oldOperations[0].blockHeight ?? 0) + 1 : 0;
38
-
39
- const [newOperations, _] = await getAlpacaApi(network, kind).listOperations(address, {
40
- minHeight: blockHeight,
41
- });
42
-
43
- const operations = mergeOps(
44
- oldOperations,
45
- newOperations.map(op => adaptCoreOperationToLiveOperation(accountId, op)),
46
- );
47
-
48
- return {
49
- id: accountId,
50
- xpub: address,
51
- blockHeight: initialAccount?.blockHeight || blockInfo.height,
52
- balance,
53
- spendableBalance,
54
- operations,
55
- operationsCount: operations.length,
56
- };
57
- } catch (e) {
58
- console.error("Error in getAccountShape", e);
59
- throw e;
60
- }
61
- };
62
- }
@@ -1,38 +0,0 @@
1
- import { AccountBridge, TransactionCommon } from "@ledgerhq/types-live";
2
- import BigNumber from "bignumber.js";
3
- import { getAlpacaApi } from "./alpaca";
4
-
5
- // => alpaca validateIntent
6
- export function genericGetTransactionStatus(
7
- network,
8
- kind,
9
- ): AccountBridge<any>["getTransactionStatus"] {
10
- return async (account, transaction: TransactionCommon & { fees: BigNumber }) => {
11
- const { freshAddress, balance, currency } = account;
12
- const alpacaApi = getAlpacaApi(network, kind);
13
- const { errors, warnings } = await alpacaApi.validateIntent(
14
- {
15
- currencyName: currency.name,
16
- address: freshAddress,
17
- balance: BigInt(balance.toString()),
18
- currencyUnit: currency.units[0],
19
- },
20
- {
21
- type: "PAYMENT", // NOTE: assuming payment by default here
22
- recipient: transaction.recipient,
23
- amount: BigInt(transaction.amount?.toString() ?? "0"),
24
- fee: BigInt(transaction.fees?.toString() ?? "0"),
25
- },
26
- );
27
-
28
- const estimatedFees = transaction.fees || new BigNumber(0);
29
-
30
- return Promise.resolve({
31
- errors,
32
- warnings,
33
- estimatedFees,
34
- amount: transaction.amount,
35
- totalSpent: transaction.amount.plus(transaction.fees),
36
- });
37
- };
38
- }
@@ -1,22 +0,0 @@
1
- import { Account, AccountBridge, TransactionCommon } from "@ledgerhq/types-live";
2
- import { getAlpacaApi } from "./alpaca";
3
- import { transactionToIntent } from "./utils";
4
- import BigNumber from "bignumber.js";
5
-
6
- export function genericPrepareTransaction(
7
- network,
8
- kind,
9
- ): AccountBridge<TransactionCommon, Account, any, any>["prepareTransaction"] {
10
- return async (_account, transaction: TransactionCommon & { fees: BigNumber }) => {
11
- const fees = await getAlpacaApi(network, kind).estimateFees(
12
- transactionToIntent(_account, transaction),
13
- );
14
- const bnFee = BigNumber(fees.value.toString());
15
-
16
- if (transaction.fees !== bnFee) {
17
- return { ...transaction, fees: bnFee };
18
- }
19
-
20
- return transaction;
21
- };
22
- }
@@ -1,83 +0,0 @@
1
- import { Observable } from "rxjs";
2
- import { SignerContext } from "@ledgerhq/coin-framework/signer";
3
- import type {
4
- Account,
5
- DeviceId,
6
- SignOperationEvent,
7
- AccountBridge,
8
- TransactionCommon,
9
- } from "@ledgerhq/types-live";
10
- import { getAlpacaApi } from "./alpaca";
11
- import { buildOptimisticOperation, transactionToIntent } from "./utils";
12
- import { FeeNotLoaded } from "@ledgerhq/errors";
13
- import { Result } from "@ledgerhq/coin-framework/derivation";
14
- import { MapMemo, TransactionIntent } from "@ledgerhq/coin-framework/api/types";
15
-
16
- /**
17
- * Sign Transaction with Ledger hardware
18
- */
19
- export const genericSignOperation =
20
- (network, kind) =>
21
- (signerContext: SignerContext<any>): AccountBridge<TransactionCommon>["signOperation"] =>
22
- ({
23
- account,
24
- transaction,
25
- deviceId,
26
- }: {
27
- account: Account;
28
- transaction: TransactionCommon;
29
- deviceId: DeviceId;
30
- }): Observable<SignOperationEvent> =>
31
- new Observable(o => {
32
- async function main() {
33
- if (!transaction["fees"]) throw new FeeNotLoaded();
34
- o.next({ type: "device-signature-requested" });
35
-
36
- const { publicKey } = (await signerContext(deviceId, signer =>
37
- signer.getAddress(account.freshAddressPath),
38
- )) as Result;
39
-
40
- const transactionIntent = transactionToIntent(account, transaction);
41
- transactionIntent.senderPublicKey = publicKey;
42
- // NOTE: is setting the memo here instead of transactionToIntent sensible?
43
- const txWithMemo = transactionIntent as TransactionIntent<any, MapMemo<string, string>>;
44
- if (transaction["tag"]) {
45
- const txMemo = String(transaction["tag"]);
46
- txWithMemo.memo = {
47
- type: "map",
48
- memos: new Map(),
49
- };
50
- txWithMemo.memo.memos.set("destinationTag", txMemo);
51
- }
52
-
53
- const unsigned = await getAlpacaApi(network, kind).craftTransaction({
54
- ...txWithMemo,
55
- });
56
- const transactionSignature: string = await signerContext(deviceId, signer =>
57
- signer.signTransaction(account.freshAddressPath, unsigned),
58
- );
59
- o.next({ type: "device-signature-granted" });
60
-
61
- const signed = await getAlpacaApi(network, kind).combine(
62
- unsigned,
63
- transactionSignature,
64
- publicKey,
65
- );
66
-
67
- const operation = buildOptimisticOperation(account, transaction);
68
- // NOTE: we set the transactionSequenceNumber before on the operation
69
- // now that we create it in craftTransaction, we might need to return it back from craftTransaction also
70
- o.next({
71
- type: "signed",
72
- signedOperation: {
73
- operation,
74
- signature: signed,
75
- },
76
- });
77
- }
78
-
79
- main().then(
80
- () => o.complete(),
81
- e => o.error(e),
82
- );
83
- });
@@ -1,33 +0,0 @@
1
- import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
2
- import xrpGetAddress from "@ledgerhq/coin-xrp/signer/getAddress";
3
- import { CreateSigner, executeWithSigner } from "../../setup";
4
- import Xrp from "@ledgerhq/hw-app-xrp";
5
-
6
- import Transport from "@ledgerhq/hw-transport";
7
- import { signTransaction } from "./signTransaction";
8
- import { SignerContext } from "@ledgerhq/coin-framework/signer";
9
- import { SignTransactionOptions } from "./types";
10
-
11
- export type AlpacaSigner = {
12
- getAddress: GetAddressFn;
13
- signTransaction?: (deviceId: string, opts: SignTransactionOptions) => Promise<string>;
14
- signMessage?: (message: string) => Promise<string>;
15
- context: SignerContext<any>;
16
- };
17
-
18
- export function getSigner(network): AlpacaSigner {
19
- switch (network) {
20
- case "ripple":
21
- case "xrp": {
22
- const createSigner: CreateSigner<Xrp> = (transport: Transport) => {
23
- return new Xrp(transport);
24
- };
25
- return {
26
- getAddress: xrpGetAddress(executeWithSigner(createSigner)),
27
- signTransaction: signTransaction(executeWithSigner(createSigner)),
28
- context: executeWithSigner(createSigner),
29
- };
30
- }
31
- }
32
- throw new Error(`signer for ${network} not implemented`);
33
- }
@@ -1,13 +0,0 @@
1
- import { SignerContext } from "@ledgerhq/coin-framework/signer";
2
- import { XrpSigner } from "@ledgerhq/coin-xrp/index";
3
- import { SignTransactionOptions } from "./types";
4
-
5
- export const signTransaction = (signerContext: SignerContext<XrpSigner>) => {
6
- return async (deviceId: string, { path, rawTxHex }: SignTransactionOptions) => {
7
- const signedTx = await signerContext(deviceId, signer =>
8
- signer.signTransaction(path, rawTxHex),
9
- );
10
-
11
- return signedTx;
12
- };
13
- };
@@ -1,4 +0,0 @@
1
- export type SignTransactionOptions = {
2
- rawTxHex: string;
3
- path: string;
4
- };
@@ -1,76 +0,0 @@
1
- import BigNumber from "bignumber.js";
2
- import { genericEstimateMaxSpendable } from "../estimateMaxSpendable";
3
- import * as alpaca from "../alpaca";
4
- import { Account } from "@ledgerhq/types-live";
5
-
6
- // Mock the alpaca API
7
- jest.mock("../alpaca", () => ({
8
- getAlpacaApi: jest.fn(),
9
- }));
10
-
11
- const mockedGetAlpacaApi = alpaca.getAlpacaApi as jest.Mock;
12
-
13
- // Dummy data
14
- const dummyAccount = {
15
- id: "js:2:ripple:r123:",
16
- type: "Account", // <-- this is mandatory for getMainAccount to work
17
- spendableBalance: new BigNumber(50000000),
18
- currency: { id: "ripple", name: "XRP", units: [{ name: "XRP", magnitude: 6 }] },
19
- freshAddress: "r123",
20
- } as unknown as Account;
21
-
22
- describe("genericEstimateMaxSpendable", () => {
23
- afterEach(() => {
24
- jest.clearAllMocks();
25
- });
26
-
27
- it("subtracts estimated fee from spendable balance", async () => {
28
- mockedGetAlpacaApi.mockReturnValue({
29
- estimateFees: jest.fn().mockResolvedValue({ value: 10000n }), // 0.01 XRP
30
- });
31
-
32
- const estimate = genericEstimateMaxSpendable("xrp", "local");
33
- const result = await estimate({
34
- account: dummyAccount,
35
- parentAccount: null,
36
- transaction: {},
37
- });
38
-
39
- expect(result.toString()).toBe("49990000"); // 50_000_000 - 10_000
40
- });
41
-
42
- it("returns 0 if fee is higher than spendable", async () => {
43
- const poorAccount = {
44
- ...dummyAccount,
45
- spendableBalance: new BigNumber(5000), // very low
46
- };
47
-
48
- mockedGetAlpacaApi.mockReturnValue({
49
- estimateFees: jest.fn().mockResolvedValue({ value: 10000n }),
50
- });
51
-
52
- const estimate = genericEstimateMaxSpendable("xrp", "local");
53
- const result = await estimate({
54
- account: poorAccount,
55
- parentAccount: null,
56
- transaction: {},
57
- });
58
-
59
- expect(result.toString()).toBe("0");
60
- });
61
-
62
- it("returns full spendable balance if fee is 0", async () => {
63
- mockedGetAlpacaApi.mockReturnValue({
64
- estimateFees: jest.fn().mockResolvedValue({ value: 0n }),
65
- });
66
-
67
- const estimate = genericEstimateMaxSpendable("xrp", "local");
68
- const result = await estimate({
69
- account: dummyAccount,
70
- parentAccount: null,
71
- transaction: {},
72
- });
73
-
74
- expect(result.toString()).toBe("50000000");
75
- });
76
- });