@ledgerhq/coin-xrp 7.22.0 → 7.23.4

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 (386) hide show
  1. package/CHANGELOG.md +74 -28
  2. package/LICENSE +194 -0
  3. package/jest.config.js +4 -1
  4. package/jest.integ.config.js +3 -0
  5. package/knip.json +11 -0
  6. package/lib/api/broadcast.d.ts.map +1 -0
  7. package/lib/{logic → api}/broadcast.js +4 -2
  8. package/lib/api/broadcast.js.map +1 -0
  9. package/lib/api/combine.d.ts.map +1 -0
  10. package/lib/{logic → api}/combine.js +4 -2
  11. package/lib/api/combine.js.map +1 -0
  12. package/lib/{logic → api}/craftRawTransaction.d.ts +1 -1
  13. package/lib/api/craftRawTransaction.d.ts.map +1 -0
  14. package/lib/{logic → api}/craftRawTransaction.js +9 -8
  15. package/lib/api/craftRawTransaction.js.map +1 -0
  16. package/lib/api/craftTransaction.d.ts.map +1 -0
  17. package/lib/{logic → api}/craftTransaction.js +4 -3
  18. package/lib/api/craftTransaction.js.map +1 -0
  19. package/lib/{logic → api}/estimateFees.d.ts +1 -1
  20. package/lib/api/estimateFees.d.ts.map +1 -0
  21. package/lib/{logic → api}/estimateFees.js +5 -3
  22. package/lib/api/estimateFees.js.map +1 -0
  23. package/lib/api/getBalance.d.ts +3 -0
  24. package/lib/api/getBalance.d.ts.map +1 -0
  25. package/lib/{logic → api}/getBalance.js +5 -3
  26. package/lib/api/getBalance.js.map +1 -0
  27. package/lib/api/getBlock.d.ts +3 -0
  28. package/lib/api/getBlock.d.ts.map +1 -0
  29. package/lib/{logic → api}/getBlock.js +14 -12
  30. package/lib/api/getBlock.js.map +1 -0
  31. package/lib/api/getBlockInfo.d.ts +3 -0
  32. package/lib/api/getBlockInfo.d.ts.map +1 -0
  33. package/lib/{logic → api}/getBlockInfo.js +3 -1
  34. package/lib/api/getBlockInfo.js.map +1 -0
  35. package/lib/api/getSequence.d.ts +2 -0
  36. package/lib/api/getSequence.d.ts.map +1 -0
  37. package/lib/api/getSequence.js +11 -0
  38. package/lib/api/getSequence.js.map +1 -0
  39. package/lib/api/index.d.ts +4 -4
  40. package/lib/api/index.d.ts.map +1 -1
  41. package/lib/api/index.js +44 -32
  42. package/lib/api/index.js.map +1 -1
  43. package/lib/api/lastBlock.d.ts +3 -0
  44. package/lib/api/lastBlock.d.ts.map +1 -0
  45. package/lib/{logic → api}/lastBlock.js +2 -0
  46. package/lib/api/lastBlock.js.map +1 -0
  47. package/lib/{logic → api}/listOperations.d.ts +2 -2
  48. package/lib/api/listOperations.d.ts.map +1 -0
  49. package/lib/{logic → api}/listOperations.js +18 -16
  50. package/lib/api/listOperations.js.map +1 -0
  51. package/lib/api/validateAddress.d.ts +3 -0
  52. package/lib/api/validateAddress.d.ts.map +1 -0
  53. package/lib/{logic → api}/validateAddress.js +2 -0
  54. package/lib/api/validateAddress.js.map +1 -0
  55. package/lib/{logic → api}/validateIntent.d.ts +2 -2
  56. package/lib/api/validateIntent.d.ts.map +1 -0
  57. package/lib/{logic → api}/validateIntent.js +17 -15
  58. package/lib/api/validateIntent.js.map +1 -0
  59. package/lib/config.d.ts +1 -1
  60. package/lib/config.d.ts.map +1 -1
  61. package/lib/config.js +2 -0
  62. package/lib/config.js.map +1 -1
  63. package/lib/index.d.ts +2 -2
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/index.js +2 -0
  66. package/lib/index.js.map +1 -1
  67. package/lib/network/index.d.ts +4 -4
  68. package/lib/network/index.d.ts.map +1 -1
  69. package/lib/network/index.js +17 -15
  70. package/lib/network/index.js.map +1 -1
  71. package/lib/network/types.d.ts +4 -4
  72. package/lib/network/types.d.ts.map +1 -1
  73. package/lib/network/types.js +4 -2
  74. package/lib/network/types.js.map +1 -1
  75. package/lib/supportedFeatures.d.ts +1 -1
  76. package/lib/supportedFeatures.d.ts.map +1 -1
  77. package/lib/supportedFeatures.js +3 -1
  78. package/lib/supportedFeatures.js.map +1 -1
  79. package/lib/types/index.d.ts +1 -1
  80. package/lib/types/index.d.ts.map +1 -1
  81. package/lib/types/index.js +2 -0
  82. package/lib/types/index.js.map +1 -1
  83. package/lib/types/model.d.ts +6 -6
  84. package/lib/types/model.d.ts.map +1 -1
  85. package/lib/types/model.js +2 -0
  86. package/lib/types/model.js.map +1 -1
  87. package/lib/utils/common.d.ts +3 -0
  88. package/lib/utils/common.d.ts.map +1 -0
  89. package/lib/{logic → utils}/common.js +7 -2
  90. package/lib/utils/common.js.map +1 -0
  91. package/lib/utils/errors.d.ts.map +1 -0
  92. package/lib/{logic → utils}/errors.js +3 -1
  93. package/lib/utils/errors.js.map +1 -0
  94. package/lib/utils/getAccountInfo.d.ts +3 -0
  95. package/lib/utils/getAccountInfo.d.ts.map +1 -0
  96. package/lib/{logic → utils}/getAccountInfo.js +2 -0
  97. package/lib/utils/getAccountInfo.js.map +1 -0
  98. package/{lib-es/logic/utils.d.ts → lib/utils/index.d.ts} +4 -5
  99. package/lib/utils/index.d.ts.map +1 -0
  100. package/lib/{logic/utils.js → utils/index.js} +7 -25
  101. package/lib/utils/index.js.map +1 -0
  102. package/{lib-es/logic → lib/utils}/validateMemo.d.ts +1 -1
  103. package/lib/utils/validateMemo.d.ts.map +1 -0
  104. package/lib/{logic → utils}/validateMemo.js +2 -0
  105. package/lib/utils/validateMemo.js.map +1 -0
  106. package/lib-es/api/broadcast.d.ts.map +1 -0
  107. package/lib-es/api/broadcast.js +13 -0
  108. package/lib-es/api/broadcast.js.map +1 -0
  109. package/lib-es/api/combine.d.ts.map +1 -0
  110. package/lib-es/{logic → api}/combine.js +5 -3
  111. package/lib-es/api/combine.js.map +1 -0
  112. package/lib-es/{logic → api}/craftRawTransaction.d.ts +1 -1
  113. package/lib-es/api/craftRawTransaction.d.ts.map +1 -0
  114. package/lib-es/{logic → api}/craftRawTransaction.js +12 -11
  115. package/lib-es/api/craftRawTransaction.js.map +1 -0
  116. package/lib-es/api/craftTransaction.d.ts.map +1 -0
  117. package/lib-es/{logic → api}/craftTransaction.js +9 -8
  118. package/lib-es/api/craftTransaction.js.map +1 -0
  119. package/lib-es/{logic → api}/estimateFees.d.ts +1 -1
  120. package/lib-es/api/estimateFees.d.ts.map +1 -0
  121. package/lib-es/{logic → api}/estimateFees.js +7 -5
  122. package/lib-es/api/estimateFees.js.map +1 -0
  123. package/lib-es/api/getBalance.d.ts +3 -0
  124. package/lib-es/api/getBalance.d.ts.map +1 -0
  125. package/lib-es/{logic → api}/getBalance.js +7 -5
  126. package/lib-es/api/getBalance.js.map +1 -0
  127. package/lib-es/api/getBlock.d.ts +3 -0
  128. package/lib-es/api/getBlock.d.ts.map +1 -0
  129. package/lib-es/{logic → api}/getBlock.js +15 -13
  130. package/lib-es/api/getBlock.js.map +1 -0
  131. package/lib-es/api/getBlockInfo.d.ts +3 -0
  132. package/lib-es/api/getBlockInfo.d.ts.map +1 -0
  133. package/lib-es/{logic → api}/getBlockInfo.js +4 -2
  134. package/lib-es/api/getBlockInfo.js.map +1 -0
  135. package/lib-es/api/getSequence.d.ts +2 -0
  136. package/lib-es/api/getSequence.d.ts.map +1 -0
  137. package/lib-es/api/getSequence.js +8 -0
  138. package/lib-es/api/getSequence.js.map +1 -0
  139. package/lib-es/api/index.d.ts +4 -4
  140. package/lib-es/api/index.d.ts.map +1 -1
  141. package/lib-es/api/index.js +35 -23
  142. package/lib-es/api/index.js.map +1 -1
  143. package/lib-es/api/lastBlock.d.ts +3 -0
  144. package/lib-es/api/lastBlock.d.ts.map +1 -0
  145. package/lib-es/{logic → api}/lastBlock.js +3 -1
  146. package/lib-es/api/lastBlock.js.map +1 -0
  147. package/lib-es/{logic → api}/listOperations.d.ts +2 -2
  148. package/lib-es/api/listOperations.d.ts.map +1 -0
  149. package/lib-es/{logic → api}/listOperations.js +19 -17
  150. package/lib-es/api/listOperations.js.map +1 -0
  151. package/lib-es/api/validateAddress.d.ts +3 -0
  152. package/lib-es/api/validateAddress.d.ts.map +1 -0
  153. package/lib-es/api/validateAddress.js +7 -0
  154. package/lib-es/api/validateAddress.js.map +1 -0
  155. package/lib-es/{logic → api}/validateIntent.d.ts +2 -2
  156. package/lib-es/api/validateIntent.d.ts.map +1 -0
  157. package/lib-es/{logic → api}/validateIntent.js +21 -19
  158. package/lib-es/api/validateIntent.js.map +1 -0
  159. package/lib-es/config.d.ts +1 -1
  160. package/lib-es/config.d.ts.map +1 -1
  161. package/lib-es/config.js +3 -1
  162. package/lib-es/config.js.map +1 -1
  163. package/lib-es/index.d.ts +2 -2
  164. package/lib-es/index.d.ts.map +1 -1
  165. package/lib-es/index.js +3 -1
  166. package/lib-es/index.js.map +1 -1
  167. package/lib-es/network/index.d.ts +4 -4
  168. package/lib-es/network/index.d.ts.map +1 -1
  169. package/lib-es/network/index.js +21 -19
  170. package/lib-es/network/index.js.map +1 -1
  171. package/lib-es/network/types.d.ts +4 -4
  172. package/lib-es/network/types.d.ts.map +1 -1
  173. package/lib-es/network/types.js +4 -2
  174. package/lib-es/network/types.js.map +1 -1
  175. package/lib-es/supportedFeatures.d.ts +1 -1
  176. package/lib-es/supportedFeatures.d.ts.map +1 -1
  177. package/lib-es/supportedFeatures.js +3 -1
  178. package/lib-es/supportedFeatures.js.map +1 -1
  179. package/lib-es/types/index.d.ts +1 -1
  180. package/lib-es/types/index.d.ts.map +1 -1
  181. package/lib-es/types/index.js +3 -1
  182. package/lib-es/types/index.js.map +1 -1
  183. package/lib-es/types/model.d.ts +6 -6
  184. package/lib-es/types/model.d.ts.map +1 -1
  185. package/lib-es/types/model.js +2 -0
  186. package/lib-es/types/model.js.map +1 -1
  187. package/lib-es/utils/common.d.ts +3 -0
  188. package/lib-es/utils/common.d.ts.map +1 -0
  189. package/lib-es/utils/common.js +10 -0
  190. package/lib-es/utils/common.js.map +1 -0
  191. package/lib-es/utils/errors.d.ts.map +1 -0
  192. package/lib-es/utils/errors.js +5 -0
  193. package/lib-es/utils/errors.js.map +1 -0
  194. package/lib-es/utils/getAccountInfo.d.ts +3 -0
  195. package/lib-es/utils/getAccountInfo.d.ts.map +1 -0
  196. package/lib-es/utils/getAccountInfo.js +8 -0
  197. package/lib-es/utils/getAccountInfo.js.map +1 -0
  198. package/{lib/logic/utils.d.ts → lib-es/utils/index.d.ts} +4 -5
  199. package/lib-es/utils/index.d.ts.map +1 -0
  200. package/lib-es/{logic/utils.js → utils/index.js} +9 -26
  201. package/lib-es/utils/index.js.map +1 -0
  202. package/{lib/logic → lib-es/utils}/validateMemo.d.ts +1 -1
  203. package/lib-es/utils/validateMemo.d.ts.map +1 -0
  204. package/lib-es/{logic → utils}/validateMemo.js +3 -1
  205. package/lib-es/utils/validateMemo.js.map +1 -0
  206. package/package.json +15 -26
  207. package/src/api/broadcast.integ.test.ts +45 -0
  208. package/src/api/broadcast.test.ts +57 -0
  209. package/src/api/broadcast.ts +18 -0
  210. package/src/api/combine.test.ts +103 -0
  211. package/src/api/combine.ts +41 -0
  212. package/src/api/craftRawTransaction.test.ts +363 -0
  213. package/src/{logic → api}/craftRawTransaction.ts +35 -33
  214. package/src/api/craftTransaction.test.ts +116 -0
  215. package/src/api/craftTransaction.ts +108 -0
  216. package/src/api/estimateFees.test.ts +55 -0
  217. package/src/api/estimateFees.ts +40 -0
  218. package/src/api/getBalance.test.ts +70 -0
  219. package/src/api/getBalance.ts +30 -0
  220. package/src/api/getBlock.integ.test.ts +76 -0
  221. package/src/api/getBlock.test.ts +785 -0
  222. package/src/{logic → api}/getBlock.ts +65 -62
  223. package/src/api/getBlockInfo.integ.test.ts +63 -0
  224. package/src/api/getBlockInfo.test.ts +109 -0
  225. package/src/api/getBlockInfo.ts +23 -0
  226. package/src/api/getSequence.test.ts +26 -0
  227. package/src/api/getSequence.ts +9 -0
  228. package/src/api/index.integ.test.ts +293 -290
  229. package/src/api/index.test.ts +236 -233
  230. package/src/api/index.ts +55 -58
  231. package/src/api/lastBlock.ts +14 -0
  232. package/src/api/listOperations.test.ts +458 -0
  233. package/src/{logic → api}/listOperations.ts +79 -76
  234. package/src/api/validateAddress.test.ts +30 -0
  235. package/src/api/validateAddress.ts +12 -0
  236. package/src/{logic → api}/validateIntent.test.ts +148 -145
  237. package/src/{logic → api}/validateIntent.ts +45 -42
  238. package/src/config.ts +11 -8
  239. package/src/index.ts +5 -2
  240. package/src/network/index.test.ts +120 -117
  241. package/src/network/index.ts +57 -54
  242. package/src/network/types.ts +192 -189
  243. package/src/supportedFeatures.ts +6 -3
  244. package/src/types/index.ts +4 -1
  245. package/src/types/model.ts +36 -33
  246. package/src/utils/common.ts +12 -0
  247. package/src/utils/errors.ts +6 -0
  248. package/src/utils/getAccountInfo.ts +10 -0
  249. package/src/utils/index.test.ts +133 -0
  250. package/src/utils/index.ts +47 -0
  251. package/src/utils/validateMemo.test.ts +48 -0
  252. package/src/{logic → utils}/validateMemo.ts +9 -6
  253. package/tsconfig.json +5 -2
  254. package/.turbo/turbo-build.log +0 -4
  255. package/.unimportedrc.json +0 -25
  256. package/LICENSE.txt +0 -21
  257. package/lib/logic/broadcast.d.ts.map +0 -1
  258. package/lib/logic/broadcast.js.map +0 -1
  259. package/lib/logic/combine.d.ts.map +0 -1
  260. package/lib/logic/combine.js.map +0 -1
  261. package/lib/logic/common.d.ts +0 -3
  262. package/lib/logic/common.d.ts.map +0 -1
  263. package/lib/logic/common.js.map +0 -1
  264. package/lib/logic/craftRawTransaction.d.ts.map +0 -1
  265. package/lib/logic/craftRawTransaction.js.map +0 -1
  266. package/lib/logic/craftTransaction.d.ts.map +0 -1
  267. package/lib/logic/craftTransaction.js.map +0 -1
  268. package/lib/logic/errors.d.ts.map +0 -1
  269. package/lib/logic/errors.js.map +0 -1
  270. package/lib/logic/estimateFees.d.ts.map +0 -1
  271. package/lib/logic/estimateFees.js.map +0 -1
  272. package/lib/logic/getAccountInfo.d.ts +0 -3
  273. package/lib/logic/getAccountInfo.d.ts.map +0 -1
  274. package/lib/logic/getAccountInfo.js.map +0 -1
  275. package/lib/logic/getBalance.d.ts +0 -3
  276. package/lib/logic/getBalance.d.ts.map +0 -1
  277. package/lib/logic/getBalance.js.map +0 -1
  278. package/lib/logic/getBlock.d.ts +0 -3
  279. package/lib/logic/getBlock.d.ts.map +0 -1
  280. package/lib/logic/getBlock.js.map +0 -1
  281. package/lib/logic/getBlockInfo.d.ts +0 -3
  282. package/lib/logic/getBlockInfo.d.ts.map +0 -1
  283. package/lib/logic/getBlockInfo.js.map +0 -1
  284. package/lib/logic/index.d.ts +0 -16
  285. package/lib/logic/index.d.ts.map +0 -1
  286. package/lib/logic/index.js +0 -34
  287. package/lib/logic/index.js.map +0 -1
  288. package/lib/logic/lastBlock.d.ts +0 -3
  289. package/lib/logic/lastBlock.d.ts.map +0 -1
  290. package/lib/logic/lastBlock.js.map +0 -1
  291. package/lib/logic/listOperations.d.ts.map +0 -1
  292. package/lib/logic/listOperations.js.map +0 -1
  293. package/lib/logic/utils.d.ts.map +0 -1
  294. package/lib/logic/utils.js.map +0 -1
  295. package/lib/logic/validateAddress.d.ts +0 -3
  296. package/lib/logic/validateAddress.d.ts.map +0 -1
  297. package/lib/logic/validateAddress.js.map +0 -1
  298. package/lib/logic/validateIntent.d.ts.map +0 -1
  299. package/lib/logic/validateIntent.js.map +0 -1
  300. package/lib/logic/validateMemo.d.ts.map +0 -1
  301. package/lib/logic/validateMemo.js.map +0 -1
  302. package/lib-es/logic/broadcast.d.ts.map +0 -1
  303. package/lib-es/logic/broadcast.js +0 -11
  304. package/lib-es/logic/broadcast.js.map +0 -1
  305. package/lib-es/logic/combine.d.ts.map +0 -1
  306. package/lib-es/logic/combine.js.map +0 -1
  307. package/lib-es/logic/common.d.ts +0 -3
  308. package/lib-es/logic/common.d.ts.map +0 -1
  309. package/lib-es/logic/common.js +0 -5
  310. package/lib-es/logic/common.js.map +0 -1
  311. package/lib-es/logic/craftRawTransaction.d.ts.map +0 -1
  312. package/lib-es/logic/craftRawTransaction.js.map +0 -1
  313. package/lib-es/logic/craftTransaction.d.ts.map +0 -1
  314. package/lib-es/logic/craftTransaction.js.map +0 -1
  315. package/lib-es/logic/errors.d.ts.map +0 -1
  316. package/lib-es/logic/errors.js +0 -3
  317. package/lib-es/logic/errors.js.map +0 -1
  318. package/lib-es/logic/estimateFees.d.ts.map +0 -1
  319. package/lib-es/logic/estimateFees.js.map +0 -1
  320. package/lib-es/logic/getAccountInfo.d.ts +0 -3
  321. package/lib-es/logic/getAccountInfo.d.ts.map +0 -1
  322. package/lib-es/logic/getAccountInfo.js +0 -6
  323. package/lib-es/logic/getAccountInfo.js.map +0 -1
  324. package/lib-es/logic/getBalance.d.ts +0 -3
  325. package/lib-es/logic/getBalance.d.ts.map +0 -1
  326. package/lib-es/logic/getBalance.js.map +0 -1
  327. package/lib-es/logic/getBlock.d.ts +0 -3
  328. package/lib-es/logic/getBlock.d.ts.map +0 -1
  329. package/lib-es/logic/getBlock.js.map +0 -1
  330. package/lib-es/logic/getBlockInfo.d.ts +0 -3
  331. package/lib-es/logic/getBlockInfo.d.ts.map +0 -1
  332. package/lib-es/logic/getBlockInfo.js.map +0 -1
  333. package/lib-es/logic/index.d.ts +0 -16
  334. package/lib-es/logic/index.d.ts.map +0 -1
  335. package/lib-es/logic/index.js +0 -15
  336. package/lib-es/logic/index.js.map +0 -1
  337. package/lib-es/logic/lastBlock.d.ts +0 -3
  338. package/lib-es/logic/lastBlock.d.ts.map +0 -1
  339. package/lib-es/logic/lastBlock.js.map +0 -1
  340. package/lib-es/logic/listOperations.d.ts.map +0 -1
  341. package/lib-es/logic/listOperations.js.map +0 -1
  342. package/lib-es/logic/utils.d.ts.map +0 -1
  343. package/lib-es/logic/utils.js.map +0 -1
  344. package/lib-es/logic/validateAddress.d.ts +0 -3
  345. package/lib-es/logic/validateAddress.d.ts.map +0 -1
  346. package/lib-es/logic/validateAddress.js +0 -5
  347. package/lib-es/logic/validateAddress.js.map +0 -1
  348. package/lib-es/logic/validateIntent.d.ts.map +0 -1
  349. package/lib-es/logic/validateIntent.js.map +0 -1
  350. package/lib-es/logic/validateMemo.d.ts.map +0 -1
  351. package/lib-es/logic/validateMemo.js.map +0 -1
  352. package/src/logic/broadcast.test.ts +0 -54
  353. package/src/logic/broadcast.ts +0 -15
  354. package/src/logic/combine.test.ts +0 -100
  355. package/src/logic/combine.ts +0 -38
  356. package/src/logic/common.ts +0 -6
  357. package/src/logic/craftRawTransaction.test.ts +0 -362
  358. package/src/logic/craftTransaction.test.ts +0 -113
  359. package/src/logic/craftTransaction.ts +0 -106
  360. package/src/logic/errors.ts +0 -3
  361. package/src/logic/estimateFees.test.ts +0 -52
  362. package/src/logic/estimateFees.ts +0 -37
  363. package/src/logic/getAccountInfo.ts +0 -7
  364. package/src/logic/getBalance.test.ts +0 -67
  365. package/src/logic/getBalance.ts +0 -27
  366. package/src/logic/getBlock.integ.test.ts +0 -75
  367. package/src/logic/getBlock.test.ts +0 -782
  368. package/src/logic/getBlockInfo.integ.test.ts +0 -62
  369. package/src/logic/getBlockInfo.test.ts +0 -106
  370. package/src/logic/getBlockInfo.ts +0 -20
  371. package/src/logic/index.ts +0 -16
  372. package/src/logic/lastBlock.ts +0 -11
  373. package/src/logic/listOperations.test.ts +0 -455
  374. package/src/logic/utils.test.ts +0 -130
  375. package/src/logic/utils.ts +0 -75
  376. package/src/logic/validateAddress.test.ts +0 -27
  377. package/src/logic/validateAddress.ts +0 -9
  378. package/src/logic/validateMemo.test.ts +0 -45
  379. /package/lib/{logic → api}/broadcast.d.ts +0 -0
  380. /package/lib/{logic → api}/combine.d.ts +0 -0
  381. /package/lib/{logic → api}/craftTransaction.d.ts +0 -0
  382. /package/lib/{logic → utils}/errors.d.ts +0 -0
  383. /package/lib-es/{logic → api}/broadcast.d.ts +0 -0
  384. /package/lib-es/{logic → api}/combine.d.ts +0 -0
  385. /package/lib-es/{logic → api}/craftTransaction.d.ts +0 -0
  386. /package/lib-es/{logic → utils}/errors.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,54 +1,100 @@
1
1
  # @ledgerhq/coin-xrp
2
2
 
3
+ ## 7.23.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#682](https://github.com/LedgerHQ/coin-modules/pull/682) [`8ea8ae8`](https://github.com/LedgerHQ/coin-modules/commit/8ea8ae80445979267c5cdbbdb5575713ea5a640f) Thanks [@YazhuEth](https://github.com/YazhuEth)! - test: exercise the all-scope wallet PR full catalog state
8
+
9
+ - Updated dependencies [[`8ea8ae8`](https://github.com/LedgerHQ/coin-modules/commit/8ea8ae80445979267c5cdbbdb5575713ea5a640f)]:
10
+ - @ledgerhq/coin-module-framework@3.5.1
11
+
12
+ ## 7.23.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [#681](https://github.com/LedgerHQ/coin-modules/pull/681) [`0877cc5`](https://github.com/LedgerHQ/coin-modules/commit/0877cc5b1f61f6fd1ace4ece5fe0f3a67546e3a3) Thanks [@YazhuEth](https://github.com/YazhuEth)! - test: exercise the reconcile/publish release flow
17
+
18
+ - Updated dependencies [[`0877cc5`](https://github.com/LedgerHQ/coin-modules/commit/0877cc5b1f61f6fd1ace4ece5fe0f3a67546e3a3)]:
19
+ - @ledgerhq/coin-module-framework@3.4.2
20
+
21
+ ## 7.23.2
22
+
23
+ ### Patch Changes
24
+
25
+ - [#680](https://github.com/LedgerHQ/coin-modules/pull/680) [`6beebbe`](https://github.com/LedgerHQ/coin-modules/commit/6beebbed9055b0b9fdc486b667975b8fa41b46ef) Thanks [@YazhuEth](https://github.com/YazhuEth)! - test: verify release trigger behaviour on merge (framework + coin-xrp, no service change)
26
+
27
+ - Updated dependencies [[`6beebbe`](https://github.com/LedgerHQ/coin-modules/commit/6beebbed9055b0b9fdc486b667975b8fa41b46ef)]:
28
+ - @ledgerhq/coin-module-framework@3.4.1
29
+
30
+ ## 7.23.1
31
+
32
+ ### Patch Changes
33
+
34
+ - [#678](https://github.com/LedgerHQ/coin-modules/pull/678) [`65c631e`](https://github.com/LedgerHQ/coin-modules/commit/65c631e1be44dd8979135ee25c9eec44746eeafb) Thanks [@YazhuEth](https://github.com/YazhuEth)! - test: dry-run release with two packages (do not merge — remove before merging)
35
+
36
+ - Updated dependencies [[`65c631e`](https://github.com/LedgerHQ/coin-modules/commit/65c631e1be44dd8979135ee25c9eec44746eeafb)]:
37
+ - @ledgerhq/coin-module-framework@3.4.0
38
+
39
+ ## 7.23.0
40
+
41
+ ### Minor Changes
42
+
43
+ - [#675](https://github.com/LedgerHQ/coin-modules/pull/675) [`7a92a15`](https://github.com/LedgerHQ/coin-modules/commit/7a92a1522669eaac43e1f9a8bfc0707fcb968c15) Thanks [@qperrot](https://github.com/qperrot)! - Re-bump @ledgerhq/coin-xrp with a minor version (7.22 was published 2 months ago).
44
+
3
45
  ## 7.22.0
4
46
 
5
47
  ### Minor Changes
6
48
 
7
- - [#15887](https://github.com/LedgerHQ/ledger-live/pull/15887) [`5fefc2e`](https://github.com/LedgerHQ/ledger-live/commit/5fefc2e6a4c6e4fdcaae0139f2f8d6f9011b33c8) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - Remove @ledgerhq/types-cryptoassets dependency from coin-framework by replacing CryptoCurrency parameters with currencyId strings in CoinConfig and getCurrencyConfiguration
49
+ - [#674](https://github.com/LedgerHQ/coin-modules/pull/674) [`61c968a`](https://github.com/LedgerHQ/coin-modules/commit/61c968aa1a2fc4dfce0a116b87f8606bb5c7d5c1) Thanks [@qperrot](https://github.com/qperrot)! - Fix: remove the recipient cache and validate the recipient like we do in every coin module
8
50
 
9
- - [#15679](https://github.com/LedgerHQ/ledger-live/pull/15679) [`c353f29`](https://github.com/LedgerHQ/ledger-live/commit/c353f29b9174c20c708662c160f55c597020ee58) Thanks [@iqbalibrahim-ledger](https://github.com/iqbalibrahim-ledger)! - chore(coin-modules): add oxfmt with shared config (Prettier parity)
51
+ ## 7.21.7
10
52
 
11
- - Add libs/coin-modules/.oxfmtrc.json aligned with root .prettierrc and desktop/mobile oxfmt
12
- - Add format, format:check, and run oxfmt before oxlint in lint:fix; add oxfmt devDependency
13
- - Remove coin-ton prettier script; turbo format/format:check tasks
14
- - Initial oxfmt pass on src
53
+ ### Patch Changes
15
54
 
16
- - [#15954](https://github.com/LedgerHQ/ledger-live/pull/15954) [`965e189`](https://github.com/LedgerHQ/ledger-live/commit/965e189c1992a1d7a639545702d2f4a1e1a0f5c9) Thanks [@jnicoulaud-ledger](https://github.com/jnicoulaud-ledger)! - chore(BACK-11043): [coin-xrp][getBlock] add `peer` information to `getBlock` transfers
55
+ - [#644](https://github.com/LedgerHQ/coin-modules/pull/644) [`158755f`](https://github.com/LedgerHQ/coin-modules/commit/158755fd7e7b64a0fe620a0b8790e3a8a49e1f0f) Thanks [@YazhuEth](https://github.com/YazhuEth)! - refactor(coin-xrp): align src/ with Coin Framework arborescence (merge logic/ into api/, move helpers to utils/, extract getSequence)
17
56
 
18
- - [#15798](https://github.com/LedgerHQ/ledger-live/pull/15798) [`fd2311d`](https://github.com/LedgerHQ/ledger-live/commit/fd2311d643f4002c1441bfa4fe79d7288df04c21) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - chore: use `coin-module-framework` from npmjs and remove the now migrated `coin-framework`
57
+ ## 7.21.6
19
58
 
20
59
  ### Patch Changes
21
60
 
22
- - Updated dependencies [[`53df748`](https://github.com/LedgerHQ/ledger-live/commit/53df74819753f084ed3df4a2ab9082d398b54920), [`008a4bd`](https://github.com/LedgerHQ/ledger-live/commit/008a4bdb87f0e65fa23de3a29818a4d02f28f4f8), [`2ece647`](https://github.com/LedgerHQ/ledger-live/commit/2ece647f386e40f261662fc6e4e6624f302ee34f)]:
23
- - @ledgerhq/errors@6.33.0
24
- - @ledgerhq/cryptoassets@13.45.0
25
- - @ledgerhq/logs@6.17.0
26
- - @ledgerhq/live-network@2.5.0
61
+ - [#633](https://github.com/LedgerHQ/coin-modules/pull/633) [`2ae156a`](https://github.com/LedgerHQ/coin-modules/commit/2ae156aa7a5b837b2c583364e4c4bf074d004559) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - chore: strengthen oxlint rules
27
62
 
28
- ## 7.22.0-next.0
63
+ ## 7.21.5
29
64
 
30
- ### Minor Changes
65
+ ### Patch Changes
31
66
 
32
- - [#15887](https://github.com/LedgerHQ/ledger-live/pull/15887) [`5fefc2e`](https://github.com/LedgerHQ/ledger-live/commit/5fefc2e6a4c6e4fdcaae0139f2f8d6f9011b33c8) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - Remove @ledgerhq/types-cryptoassets dependency from coin-framework by replacing CryptoCurrency parameters with currencyId strings in CoinConfig and getCurrencyConfiguration
67
+ - [#585](https://github.com/LedgerHQ/coin-modules/pull/585) [`6be3dc0`](https://github.com/LedgerHQ/coin-modules/commit/6be3dc02785477564942d6f66e5e421edbf0ef7a) Thanks [@jnicoulaud-ledger](https://github.com/jnicoulaud-ledger)! - chore(ADR-025): rename `AlpacaApi` -> `CoinModuleApi`
33
68
 
34
- - [#15679](https://github.com/LedgerHQ/ledger-live/pull/15679) [`c353f29`](https://github.com/LedgerHQ/ledger-live/commit/c353f29b9174c20c708662c160f55c597020ee58) Thanks [@iqbalibrahim-ledger](https://github.com/iqbalibrahim-ledger)! - chore(coin-modules): add oxfmt with shared config (Prettier parity)
69
+ - Updated dependencies [[`6be3dc0`](https://github.com/LedgerHQ/coin-modules/commit/6be3dc02785477564942d6f66e5e421edbf0ef7a)]:
70
+ - @ledgerhq/coin-module-framework@3.0.0
35
71
 
36
- - Add libs/coin-modules/.oxfmtrc.json aligned with root .prettierrc and desktop/mobile oxfmt
37
- - Add format, format:check, and run oxfmt before oxlint in lint:fix; add oxfmt devDependency
38
- - Remove coin-ton prettier script; turbo format/format:check tasks
39
- - Initial oxfmt pass on src
72
+ ## 7.21.4
73
+
74
+ ### Patch Changes
40
75
 
41
- - [#15954](https://github.com/LedgerHQ/ledger-live/pull/15954) [`965e189`](https://github.com/LedgerHQ/ledger-live/commit/965e189c1992a1d7a639545702d2f4a1e1a0f5c9) Thanks [@jnicoulaud-ledger](https://github.com/jnicoulaud-ledger)! - chore(BACK-11043): [coin-xrp][getBlock] add `peer` information to `getBlock` transfers
76
+ - [#524](https://github.com/LedgerHQ/alpaca-coin-module/pull/524) [`f9ff0a0`](https://github.com/LedgerHQ/alpaca-coin-module/commit/f9ff0a02ef8807dcfec86a94d349a07e4c455ce2) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - chore(coin-xrp): blank changeset
42
77
 
43
- - [#15798](https://github.com/LedgerHQ/ledger-live/pull/15798) [`fd2311d`](https://github.com/LedgerHQ/ledger-live/commit/fd2311d643f4002c1441bfa4fe79d7288df04c21) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - chore: use `coin-module-framework` from npmjs and remove the now migrated `coin-framework`
78
+ ## 7.21.3
44
79
 
45
80
  ### Patch Changes
46
81
 
47
- - Updated dependencies [[`53df748`](https://github.com/LedgerHQ/ledger-live/commit/53df74819753f084ed3df4a2ab9082d398b54920), [`008a4bd`](https://github.com/LedgerHQ/ledger-live/commit/008a4bdb87f0e65fa23de3a29818a4d02f28f4f8), [`2ece647`](https://github.com/LedgerHQ/ledger-live/commit/2ece647f386e40f261662fc6e4e6624f302ee34f)]:
48
- - @ledgerhq/errors@6.33.0-next.0
49
- - @ledgerhq/cryptoassets@13.45.0-next.0
50
- - @ledgerhq/logs@6.17.0-next.0
51
- - @ledgerhq/live-network@2.5.0-next.0
82
+ - [#522](https://github.com/LedgerHQ/alpaca-coin-module/pull/522) [`5c597b4`](https://github.com/LedgerHQ/alpaca-coin-module/commit/5c597b4d732779ec11673a32d69d8d5ee1c7c0d8) Thanks [@dilaouid](https://github.com/dilaouid)! - fix(ci): fix path coin modules release
83
+
84
+ ## 7.21.2
85
+
86
+ ### Patch Changes
87
+
88
+ - [#520](https://github.com/LedgerHQ/alpaca-coin-module/pull/520) [`19c19f1`](https://github.com/LedgerHQ/alpaca-coin-module/commit/19c19f101e380372e89180a45f1cffcd8ea2e5b4) Thanks [@dilaouid](https://github.com/dilaouid)! - chore(coin-xrp): empty update (release check)
89
+
90
+ ## 7.21.1
91
+
92
+ ### Patch Changes
93
+
94
+ - [#508](https://github.com/LedgerHQ/alpaca-coin-module/pull/508) [`8775694`](https://github.com/LedgerHQ/alpaca-coin-module/commit/87756943d6f0503cef9d9fa11aadd65529c58502) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - chore(coin-xrp): migrate `coin-xrp` to `alpaca-coin-module`
95
+
96
+ - Updated dependencies [[`c98b8ac`](https://github.com/LedgerHQ/alpaca-coin-module/commit/c98b8ac9c22278953cb6b34e49e1f88effe54536), [`fb40faf`](https://github.com/LedgerHQ/alpaca-coin-module/commit/fb40faf483ffc3331d060816a708a683e6a3b0ae)]:
97
+ - @ledgerhq/coin-module-framework@2.2.0
52
98
 
53
99
  ## 7.21.0
54
100
 
package/LICENSE ADDED
@@ -0,0 +1,194 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any
81
+ Contribution embodied within the Work constitutes direct or
82
+ contributory patent infringement, then any patent licenses granted to
83
+ You under this License for that Work shall terminate as of the date
84
+ such litigation is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative
92
+ Works a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in the Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+
103
+ (d) If the Work includes a "NOTICE" text file as part of its
104
+ distribution, You must include a readable copy of the
105
+ attribution notices contained within such NOTICE file, in
106
+ at least one of the following places: within a NOTICE text
107
+ file distributed as part of the Derivative Works; within
108
+ the Source form or documentation, if provided along with the
109
+ Derivative Works; or, within a display generated by the
110
+ Derivative Works, if and wherever such third-party notices
111
+ normally appear. The contents of the NOTICE file are for
112
+ informational purposes only and do not modify the License.
113
+ You may add Your own attribution notices within Derivative
114
+ Works that You distribute, alongside or in addition to the
115
+ NOTICE text from the Work, provided that such additional
116
+ attribution notices cannot be construed as modifying the
117
+ License.
118
+
119
+ You may add Your own license statement for Your modifications and
120
+ may provide additional grant of rights to use, copy, modify, merge,
121
+ publish, distribute, sublicense, and/or sell copies of the Software,
122
+ and to permit persons to whom the Software is furnished to do so,
123
+ subject to the following conditions.
124
+
125
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
126
+ any Contribution intentionally submitted for inclusion in the Work
127
+ by You to the Licensor shall be under the terms and conditions of
128
+ this License, without any additional terms or conditions.
129
+ Notwithstanding the above, nothing herein shall supersede or modify
130
+ the terms of any separate license agreement you may have executed
131
+ with Licensor regarding such Contributions.
132
+
133
+ 6. Trademarks. This License does not grant permission to use the trade
134
+ names, trademarks, service marks, or product names of the Licensor,
135
+ except as required for reasonable and customary use in describing the
136
+ origin of the Work and reproducing the content of the NOTICE file.
137
+
138
+ 7. Disclaimer of Warranty. Unless required by applicable law or
139
+ agreed to in writing, Licensor provides the Work (and each
140
+ Contributor provides its Contributions) on an "AS IS" BASIS,
141
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
142
+ implied, including, without limitation, any conditions of TITLE,
143
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
144
+ PURPOSE. You are solely responsible for determining the
145
+ appropriateness of using or redistributing the Work and assume any
146
+ risks associated with Your exercise of permissions under this License.
147
+
148
+ 8. Limitation of Liability. In no event and under no legal theory,
149
+ whether in tort (including negligence), contract, or otherwise,
150
+ unless required by applicable law (such as deliberate and grossly
151
+ negligent acts) or agreed to in writing, shall any Contributor be
152
+ liable to You for damages, including any direct, indirect, special,
153
+ incidental, or exemplary damages of any character arising as a
154
+ result of this License or out of the use or inability to use the
155
+ Work (including but not limited to damages for loss of goodwill,
156
+ work stoppage, computer failure or malfunction, or all other
157
+ commercial damages or losses), even if such Contributor has been
158
+ advised of the possibility of such damages.
159
+
160
+ 9. Accepting Warranty or Additional Liability. While redistributing
161
+ the Work or Derivative Works thereof, You may choose to offer,
162
+ and charge a fee for, acceptance of support, warranty, indemnity,
163
+ or other liability obligations and/or rights consistent with this
164
+ License. However, in accepting such obligations, You may act only
165
+ on Your own behalf and on Your sole responsibility, not on behalf
166
+ of any other Contributor, and only if You agree to indemnify,
167
+ defend, and hold each Contributor harmless for any liability
168
+ incurred by, or claims asserted against, such Contributor by reason
169
+ of your accepting any such warranty or additional liability.
170
+
171
+ END OF TERMS AND CONDITIONS
172
+
173
+ APPENDIX: How to apply the Apache License to your work.
174
+
175
+ To apply the Apache License to your work, attach the following
176
+ boilerplate notice, with the fields enclosed by brackets "[]"
177
+ replaced with your own identifying information. (Don't include
178
+ the brackets!) The text should be enclosed in the appropriate
179
+ comment syntax for the format in use. Please also include a
180
+ "NOTICE" file with your copyright notice as a separate file.
181
+
182
+ Copyright 2024 LEDGER SAS
183
+
184
+ Licensed under the Apache License, Version 2.0 (the "License");
185
+ you may not use this file except in compliance with the License.
186
+ You may obtain a copy of the License at
187
+
188
+ http://www.apache.org/licenses/LICENSE-2.0
189
+
190
+ Unless required by applicable law or agreed to in writing, software
191
+ distributed under the License is distributed on an "AS IS" BASIS,
192
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
193
+ implied. See the License for the specific language governing
194
+ permissions and limitations under the License.
package/jest.config.js CHANGED
@@ -1,3 +1,6 @@
1
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // `workerThreads: true` is required for validating object with `bigint` values
2
5
  module.exports = {
3
6
  testEnvironment: "node",
@@ -25,5 +28,5 @@ module.exports = {
25
28
  "default",
26
29
  ["jest-sonar", { outputName: "sonar-executionTests-report.xml", reportedFilePath: "absolute" }],
27
30
  ],
28
- setupFilesAfterEnv: ["@ledgerhq/disable-network-setup"],
31
+ setupFilesAfterEnv: [/* "@ledgerhq/disable-network-setup" */],
29
32
  };
@@ -1,3 +1,6 @@
1
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  /** @type {import('jest').Config} */
2
5
  module.exports = {
3
6
  testEnvironment: "node",
package/knip.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://unpkg.com/knip@5.34.1/schema.json",
3
+ "entry": [
4
+ "src/api/index.ts",
5
+ "src/index.ts",
6
+ "src/api/validateAddress.ts",
7
+ "src/supportedFeatures.ts"
8
+ ],
9
+ "project": ["src/**/*.ts"],
10
+ "ignoreDependencies": ["@ledgerhq/coin-module-framework"]
11
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../src/api/broadcast.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYlE"}
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
3
+ // SPDX-License-Identifier: Apache-2.0
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.broadcast = broadcast;
4
6
  const network_1 = require("../network");
5
7
  async function broadcast(signature) {
6
8
  const submittedPayment = await (0, network_1.submit)(signature);
7
- if (submittedPayment.engine_result !== "tesSUCCESS" &&
8
- submittedPayment.engine_result !== "terQUEUED") {
9
+ if (submittedPayment.engine_result !== 'tesSUCCESS' &&
10
+ submittedPayment.engine_result !== 'terQUEUED') {
9
11
  throw new Error(submittedPayment.engine_result_message);
10
12
  }
11
13
  const { hash } = submittedPayment.tx_json;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../../src/api/broadcast.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,sCAAsC;;AAItC,8BAYC;AAdD,wCAAmC;AAE5B,KAAK,UAAU,SAAS,CAAC,SAAiB;IAC/C,MAAM,gBAAgB,GAAG,MAAM,IAAA,gBAAM,EAAC,SAAS,CAAC,CAAA;IAEhD,IACE,gBAAgB,CAAC,aAAa,KAAK,YAAY;QAC/C,gBAAgB,CAAC,aAAa,KAAK,WAAW,EAC9C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAA;IACzC,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combine.d.ts","sourceRoot":"","sources":["../../src/api/combine.ts"],"names":[],"mappings":"AAaA,wBAAgB,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA2B1F"}
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
3
+ // SPDX-License-Identifier: Apache-2.0
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.combine = combine;
4
6
  const ripple_binary_codec_1 = require("ripple-binary-codec");
@@ -7,10 +9,10 @@ function combine(transaction, signature, publicKey) {
7
9
  // Multi sign transactions have an empty SigningPubKey
8
10
  // https://xrpl.org/docs/concepts/accounts/multi-signing#sending-multi-signed-transactions
9
11
  // https://xrpl.org/docs/tutorials/how-tos/manage-account-settings/send-a-multi-signed-transaction
10
- if (xrplTransaction.SigningPubKey === "") {
12
+ if (xrplTransaction.SigningPubKey === '') {
11
13
  // Find the signer that still needs a signature. If a publicKey is provided, match it;
12
14
  // otherwise take the first signer without a TxnSignature.
13
- const signerEntry = xrplTransaction.Signers?.find(s => s.Signer.TxnSignature === "" && (!publicKey || s.Signer.SigningPubKey === publicKey));
15
+ const signerEntry = xrplTransaction.Signers?.find((s) => s.Signer.TxnSignature === '' && (!publicKey || s.Signer.SigningPubKey === publicKey));
14
16
  if (signerEntry) {
15
17
  signerEntry.Signer.TxnSignature = signature;
16
18
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combine.js","sourceRoot":"","sources":["../../src/api/combine.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,sCAAsC;;AAYtC,0BA2BC;AArCD,6DAAoD;AAUpD,SAAgB,OAAO,CAAC,WAAmB,EAAE,SAAiB,EAAE,SAAkB;IAChF,MAAM,eAAe,GAAmB,IAAA,4BAAM,EAAC,WAAW,CAAC,CAAA;IAE3D,sDAAsD;IACtD,0FAA0F;IAC1F,kGAAkG;IAClG,IAAI,eAAe,CAAC,aAAa,KAAK,EAAE,EAAE,CAAC;QACzC,sFAAsF;QACtF,0DAA0D;QAC1D,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAC/C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,KAAK,EAAE,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,KAAK,SAAS,CAAC,CAC5F,CAAA;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,MAAM,CAAC,YAAY,GAAG,SAAS,CAAA;QAC7C,CAAC;QAED,OAAO,IAAA,4BAAM,EAAC,eAAe,CAAC,CAAA;IAChC,CAAC;IAED,eAAe,CAAC,YAAY,GAAG,SAAS,CAAA;IAExC,IAAI,SAAS,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;QAChD,eAAe,CAAC,aAAa,GAAG,SAAS,CAAA;IAC3C,CAAC;IAED,OAAO,IAAA,4BAAM,EAAC,eAAe,CAAC,CAAA;AAChC,CAAC"}
@@ -1,3 +1,3 @@
1
- import { CraftedTransaction } from "@ledgerhq/coin-module-framework/api/index";
1
+ import { CraftedTransaction } from '@ledgerhq/coin-module-framework/api/index';
2
2
  export declare function craftRawTransaction(transaction: string, sender: string, publicKey: string, sequence: bigint): Promise<CraftedTransaction>;
3
3
  //# sourceMappingURL=craftRawTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craftRawTransaction.d.ts","sourceRoot":"","sources":["../../src/api/craftRawTransaction.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAA;AA4C9E,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,CAAC,CAwC7B"}
@@ -1,23 +1,25 @@
1
1
  "use strict";
2
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
3
+ // SPDX-License-Identifier: Apache-2.0
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.craftRawTransaction = craftRawTransaction;
4
6
  const ripple_binary_codec_1 = require("ripple-binary-codec");
5
7
  const network_1 = require("../network");
8
+ const utils_1 = require("../utils");
6
9
  const estimateFees_1 = require("./estimateFees");
7
- const utils_1 = require("./utils");
8
10
  const LEDGER_OFFSET = 20;
9
11
  function craftRawTransactionMultiSign(xrplTransaction, sender, publicKey) {
10
12
  if (!xrplTransaction.Fee) {
11
- throw new Error("Fee is required for multi sign transactions");
13
+ throw new Error('Fee is required for multi sign transactions');
12
14
  }
13
15
  if (!xrplTransaction.Sequence) {
14
- throw new Error("Sequence is required for multi sign transactions");
16
+ throw new Error('Sequence is required for multi sign transactions');
15
17
  }
16
18
  const signer = {
17
19
  Signer: {
18
20
  Account: sender,
19
21
  SigningPubKey: publicKey,
20
- TxnSignature: "",
22
+ TxnSignature: '',
21
23
  },
22
24
  };
23
25
  if (!xrplTransaction.Signers || !Array.isArray(xrplTransaction.Signers)) {
@@ -26,8 +28,7 @@ function craftRawTransactionMultiSign(xrplTransaction, sender, publicKey) {
26
28
  else {
27
29
  xrplTransaction.Signers.push(signer);
28
30
  // The Signers array must be sorted based on the numeric value of the signer addresses
29
- // We could probably insert it at the right place directly but like this we make sure the rest is also sorted
30
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
31
+ // We could probably insert it at the right place directly but like this we make sure the rest is also sorted.
31
32
  xrplTransaction.Signers = (0, utils_1.sortSignersByNumericAddress)(xrplTransaction.Signers);
32
33
  }
33
34
  const serializedTransaction = (0, ripple_binary_codec_1.encode)(xrplTransaction);
@@ -40,11 +41,11 @@ async function craftRawTransaction(transaction, sender, publicKey, sequence) {
40
41
  // The sender cannot be checked because the transaction can be signed by another account
41
42
  // https://xrpl.org/docs/concepts/accounts/multi-signing#sending-multi-signed-transactions
42
43
  // https://xrpl.org/docs/tutorials/how-tos/manage-account-settings/send-a-multi-signed-transaction
43
- if (xrplTransaction.SigningPubKey === "") {
44
+ if (xrplTransaction.SigningPubKey === '') {
44
45
  return craftRawTransactionMultiSign(xrplTransaction, sender, publicKey);
45
46
  }
46
47
  if (sender !== xrplTransaction.Account) {
47
- throw new Error("Sender address does not match the transaction account");
48
+ throw new Error('Sender address does not match the transaction account');
48
49
  }
49
50
  if (!xrplTransaction.Fee) {
50
51
  const { fees } = await (0, estimateFees_1.estimateFees)();
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craftRawTransaction.js","sourceRoot":"","sources":["../../src/api/craftRawTransaction.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,sCAAsC;;AA8CtC,kDA6CC;AAxFD,6DAAoD;AAEpD,wCAA2C;AAE3C,oCAAsD;AACtD,iDAA6C;AAE7C,MAAM,aAAa,GAAG,EAAE,CAAA;AAExB,SAAS,4BAA4B,CACnC,eAA2B,EAC3B,MAAc,EACd,SAAiB;IAEjB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;IAChE,CAAC;IACD,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;IACrE,CAAC;IAED,MAAM,MAAM,GAAgB;QAC1B,MAAM,EAAE;YACN,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,SAAS;YACxB,YAAY,EAAE,EAAE;SACjB;KACF,CAAA;IAED,IAAI,CAAC,eAAe,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;QACxE,eAAe,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAA;IACpC,CAAC;SAAM,CAAC;QACN,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACpC,sFAAsF;QACtF,8GAA8G;QAC9G,eAAe,CAAC,OAAO,GAAG,IAAA,mCAA2B,EAAC,eAAe,CAAC,OAAwB,CAAC,CAAA;IACjG,CAAC;IAED,MAAM,qBAAqB,GAAG,IAAA,4BAAM,EAAC,eAAe,CAAC,CAAA;IAErD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAA;AAC/C,CAAC;AAEM,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,MAAc,EACd,SAAiB,EACjB,QAAgB;IAEhB,MAAM,eAAe,GAAe,IAAA,4BAAM,EAAC,WAAW,CAAC,CAAA;IAEvD,sDAAsD;IACtD,8DAA8D;IAC9D,wFAAwF;IACxF,0FAA0F;IAC1F,kGAAkG;IAClG,IAAI,eAAe,CAAC,aAAa,KAAK,EAAE,EAAE,CAAC;QACzC,OAAO,4BAA4B,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IACzE,CAAC;IAED,IAAI,MAAM,KAAK,eAAe,CAAC,OAAO,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC1E,CAAC;IAED,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,2BAAY,GAAE,CAAA;QACrC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IACvC,CAAC;IAED,wGAAwG;IACxG,iGAAiG;IACjG,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC;QACnC,eAAe,CAAC,QAAQ,GAAG,CAAC,CAAA;IAC9B,CAAC;SAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;QACrC,eAAe,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC7C,CAAC;IAED,IAAI,CAAC,eAAe,CAAC,kBAAkB,EAAE,CAAC;QACxC,eAAe,CAAC,kBAAkB,GAAG,CAAC,MAAM,IAAA,wBAAc,GAAE,CAAC,GAAG,aAAa,CAAA;IAC/E,CAAC;IAED,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;QACnC,eAAe,CAAC,aAAa,GAAG,SAAS,CAAA;IAC3C,CAAC;IAED,MAAM,qBAAqB,GAAG,IAAA,4BAAM,EAAC,eAAe,CAAC,CAAA;IAErD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAA;AAC/C,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craftTransaction.d.ts","sourceRoot":"","sources":["../../src/api/craftTransaction.ts"],"names":[],"mappings":"AAWA,QAAA,MAAQ,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAA;AAC7C,KAAK,IAAI,GAAG;IACV,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AACD,KAAK,eAAe,GAAG;IACrB,eAAe,EAAE,MAAM,OAAO,iBAAiB,CAAA;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AACD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;CAC3B,EACD,WAAW,EAAE;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAC1C,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;CAChC,EACD,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC;IACT,eAAe,EAAE,eAAe,CAAA;IAChC,qBAAqB,EAAE,MAAM,CAAA;CAC9B,CAAC,CAmDD"}
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
3
+ // SPDX-License-Identifier: Apache-2.0
2
4
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
6
  };
@@ -9,13 +11,12 @@ const invariant_1 = __importDefault(require("invariant"));
9
11
  const ripple_binary_codec_1 = require("ripple-binary-codec");
10
12
  const definitions_json_1 = __importDefault(require("ripple-binary-codec/dist/enums/definitions.json"));
11
13
  const network_1 = require("../network");
12
- const utils_1 = require("./utils");
14
+ const utils_1 = require("../utils");
13
15
  const LEDGER_OFFSET = 20;
14
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
16
  const { TRANSACTION_TYPES } = definitions_json_1.default;
16
17
  async function craftTransaction(account, transaction, publicKey) {
17
18
  const xrplTransaction = {
18
- TransactionType: "Payment",
19
+ TransactionType: 'Payment',
19
20
  Account: account.address,
20
21
  Amount: transaction.amount.toString(),
21
22
  Destination: transaction.recipient,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craftTransaction.js","sourceRoot":"","sources":["../../src/api/craftTransaction.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,sCAAsC;;;;;AAuCtC,4CAmEC;AAxGD,gEAAoC;AACpC,0DAAiC;AACjC,6DAA4C;AAC5C,uGAA6E;AAC7E,wCAA2C;AAC3C,oCAAkD;AAElD,MAAM,aAAa,GAAG,EAAE,CAAA;AACxB,MAAM,EAAE,iBAAiB,EAAE,GAAG,0BAAe,CAAA;AA6BtC,KAAK,UAAU,gBAAgB,CACpC,OAGC,EACD,WAMC,EACD,SAAkB;IAKlB,MAAM,eAAe,GAAoB;QACvC,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE;QACrC,WAAW,EAAE,WAAW,CAAC,SAAS;QAClC,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE;QAChC,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,OAAO,CAAC,kBAAkB;QACpC,kBAAkB,EAAE,CAAC,MAAM,IAAA,wBAAc,GAAE,CAAC,GAAG,aAAa;KAC7D,CAAA;IAED,SAAS,UAAU,CAAC,SAAoB;QACtC,MAAM,IAAI,GAAS,EAAE,CAAA;QACrB,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAA;QAChC,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,MAAM,CAAA;QACpC,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAA;QAChC,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IACvB,CAAC;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,eAAe,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAC3D,CAAC;IAED,IAAI,WAAW,CAAC,cAAc,KAAK,IAAI,IAAI,WAAW,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QACpF,IAAA,mBAAS,EACP,IAAA,mBAAW,EAAC,IAAI,sBAAS,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,EACtD,mEAAmE,kBAAU,CAAC,QAAQ,EAAE,GAAG,CAC5F,CAAA;QACD,eAAe,CAAC,cAAc,GAAG,WAAW,CAAC,cAAc,CAAA;IAC7D,CAAC;IAED,MAAM,qBAAqB,GAAG,SAAS;QACrC,CAAC,CAAC,IAAA,4BAAM,EAAC;YACL,GAAG,eAAe;YAClB,aAAa,EAAE,SAAS;SACzB,CAAC;QACJ,CAAC,CAAC,IAAA,4BAAM,EAAC;YACL,GAAG,eAAe;SACnB,CAAC,CAAA;IAEN,OAAO;QACL,eAAe;QACf,qBAAqB;KACtB,CAAA;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { NetworkInfo } from "../types";
1
+ import { NetworkInfo } from '../types';
2
2
  export declare function estimateFees(networkInfo?: NetworkInfo | null): Promise<{
3
3
  networkInfo: NetworkInfo;
4
4
  fees: bigint;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimateFees.d.ts","sourceRoot":"","sources":["../../src/api/estimateFees.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AActC,wBAAsB,YAAY,CAChC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,GAC/B,OAAO,CAAC;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBrD"}
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
3
+ // SPDX-License-Identifier: Apache-2.0
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.estimateFees = estimateFees;
4
6
  const errors_1 = require("@ledgerhq/errors");
5
7
  const network_1 = require("../network");
6
- const common_1 = require("./common");
8
+ const common_1 = require("../utils/common");
7
9
  // FIXME this could be cleaner
8
10
  const remapError = (error) => {
9
11
  const msg = error.message;
10
- if (msg.includes("Unable to resolve host") || msg.includes("Network is down")) {
12
+ if (msg.includes('Unable to resolve host') || msg.includes('Network is down')) {
11
13
  return new errors_1.NetworkDown();
12
14
  }
13
15
  return error;
@@ -18,7 +20,7 @@ async function estimateFees(networkInfo) {
18
20
  const info = await (0, network_1.getServerInfos)();
19
21
  const serverFee = (0, common_1.parseAPIValue)(info.info.validated_ledger.base_fee_xrp.toString());
20
22
  networkInfo = {
21
- family: "xrp",
23
+ family: 'xrp',
22
24
  serverFee,
23
25
  };
24
26
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimateFees.js","sourceRoot":"","sources":["../../src/api/estimateFees.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,sCAAsC;;AAkBtC,oCAoBC;AApCD,6CAA8C;AAC9C,wCAA2C;AAE3C,4CAA+C;AAE/C,8BAA8B;AAC9B,MAAM,UAAU,GAAG,CAAC,KAAY,EAAE,EAAE;IAClC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAA;IAEzB,IAAI,GAAG,CAAC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC9E,OAAO,IAAI,oBAAW,EAAE,CAAA;IAC1B,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAEM,KAAK,UAAU,YAAY,CAChC,WAAgC;IAEhC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAA,wBAAc,GAAE,CAAA;YACnC,MAAM,SAAS,GAAG,IAAA,sBAAa,EAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;YACnF,WAAW,GAAG;gBACZ,MAAM,EAAE,KAAK;gBACb,SAAS;aACV,CAAA;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;gBACvB,MAAM,UAAU,CAAC,CAAC,CAAC,CAAA;YACrB,CAAC;YACD,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAA;AACxE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Balance } from '@ledgerhq/coin-module-framework/api/types';
2
+ export declare function getBalance(address: string): Promise<Balance[]>;
3
+ //# sourceMappingURL=getBalance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBalance.d.ts","sourceRoot":"","sources":["../../src/api/getBalance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAA;AAKnE,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAqBpE"}
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // SPDX-FileCopyrightText: © 2024 LEDGER SAS
3
+ // SPDX-License-Identifier: Apache-2.0
2
4
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
6
  };
@@ -6,20 +8,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
8
  exports.getBalance = getBalance;
7
9
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
10
  const network_1 = require("../network");
9
- const common_1 = require("./common");
11
+ const common_1 = require("../utils/common");
10
12
  async function getBalance(address) {
11
13
  const accountInfo = await (0, network_1.getAccountInfo)(address);
12
14
  const serverInfo = await (0, network_1.getServerInfos)();
13
15
  const reserveMinXRP = (0, common_1.parseAPIValue)(serverInfo.info.validated_ledger.reserve_base_xrp.toString());
14
16
  const reservePerTrustline = (0, common_1.parseAPIValue)(serverInfo.info.validated_ledger.reserve_inc_xrp.toString());
15
17
  const trustlines = accountInfo.ownerCount;
16
- const locked = accountInfo.balance === "0"
18
+ const locked = accountInfo.balance === '0'
17
19
  ? new bignumber_js_1.default(0)
18
20
  : reserveMinXRP.plus(reservePerTrustline.times(trustlines));
19
21
  return [
20
22
  {
21
23
  value: BigInt(accountInfo.balance),
22
- asset: { type: "native" },
24
+ asset: { type: 'native' },
23
25
  locked: BigInt(locked.toString()),
24
26
  },
25
27
  ];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBalance.js","sourceRoot":"","sources":["../../src/api/getBalance.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,sCAAsC;;;;;AAOtC,gCAqBC;AAzBD,gEAAoC;AACpC,wCAA2D;AAC3D,4CAA+C;AAExC,KAAK,UAAU,UAAU,CAAC,OAAe;IAC9C,MAAM,WAAW,GAAG,MAAM,IAAA,wBAAc,EAAC,OAAO,CAAC,CAAA;IACjD,MAAM,UAAU,GAAG,MAAM,IAAA,wBAAc,GAAE,CAAA;IAEzC,MAAM,aAAa,GAAG,IAAA,sBAAa,EAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAA;IACjG,MAAM,mBAAmB,GAAG,IAAA,sBAAa,EACvC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,QAAQ,EAAE,CAC5D,CAAA;IACD,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,CAAA;IAEzC,MAAM,MAAM,GACV,WAAW,CAAC,OAAO,KAAK,GAAG;QACzB,CAAC,CAAC,IAAI,sBAAS,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAA;IAC/D,OAAO;QACL;YACE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;YAClC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;SAClC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Block } from '@ledgerhq/coin-module-framework/api/index';
2
+ export declare function getBlock(index: number): Promise<Block>;
3
+ //# sourceMappingURL=getBlock.d.ts.map