xrpjson 0.1.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 (367) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +183 -0
  3. package/dist/errors.d.ts +20 -0
  4. package/dist/errors.d.ts.map +1 -0
  5. package/dist/errors.js +27 -0
  6. package/dist/errors.js.map +1 -0
  7. package/dist/fp/factories/account-delete.d.ts +33 -0
  8. package/dist/fp/factories/account-delete.d.ts.map +1 -0
  9. package/dist/fp/factories/account-delete.js +138 -0
  10. package/dist/fp/factories/account-delete.js.map +1 -0
  11. package/dist/fp/factories/account-set.d.ts +31 -0
  12. package/dist/fp/factories/account-set.d.ts.map +1 -0
  13. package/dist/fp/factories/account-set.js +44 -0
  14. package/dist/fp/factories/account-set.js.map +1 -0
  15. package/dist/fp/factories/amm-bid.d.ts +134 -0
  16. package/dist/fp/factories/amm-bid.d.ts.map +1 -0
  17. package/dist/fp/factories/amm-bid.js +82 -0
  18. package/dist/fp/factories/amm-bid.js.map +1 -0
  19. package/dist/fp/factories/amm-clawback.d.ts +166 -0
  20. package/dist/fp/factories/amm-clawback.d.ts.map +1 -0
  21. package/dist/fp/factories/amm-clawback.js +143 -0
  22. package/dist/fp/factories/amm-clawback.js.map +1 -0
  23. package/dist/fp/factories/amm-create.d.ts +91 -0
  24. package/dist/fp/factories/amm-create.d.ts.map +1 -0
  25. package/dist/fp/factories/amm-create.js +140 -0
  26. package/dist/fp/factories/amm-create.js.map +1 -0
  27. package/dist/fp/factories/amm-delete.d.ts +84 -0
  28. package/dist/fp/factories/amm-delete.d.ts.map +1 -0
  29. package/dist/fp/factories/amm-delete.js +36 -0
  30. package/dist/fp/factories/amm-delete.js.map +1 -0
  31. package/dist/fp/factories/amm-deposit.d.ts +109 -0
  32. package/dist/fp/factories/amm-deposit.d.ts.map +1 -0
  33. package/dist/fp/factories/amm-deposit.js +68 -0
  34. package/dist/fp/factories/amm-deposit.js.map +1 -0
  35. package/dist/fp/factories/amm-vote.d.ts +87 -0
  36. package/dist/fp/factories/amm-vote.d.ts.map +1 -0
  37. package/dist/fp/factories/amm-vote.js +53 -0
  38. package/dist/fp/factories/amm-vote.js.map +1 -0
  39. package/dist/fp/factories/amm-withdraw.d.ts +131 -0
  40. package/dist/fp/factories/amm-withdraw.d.ts.map +1 -0
  41. package/dist/fp/factories/amm-withdraw.js +147 -0
  42. package/dist/fp/factories/amm-withdraw.js.map +1 -0
  43. package/dist/fp/factories/batch.d.ts +133 -0
  44. package/dist/fp/factories/batch.d.ts.map +1 -0
  45. package/dist/fp/factories/batch.js +264 -0
  46. package/dist/fp/factories/batch.js.map +1 -0
  47. package/dist/fp/factories/check-cancel.d.ts +22 -0
  48. package/dist/fp/factories/check-cancel.d.ts.map +1 -0
  49. package/dist/fp/factories/check-cancel.js +119 -0
  50. package/dist/fp/factories/check-cancel.js.map +1 -0
  51. package/dist/fp/factories/check-cash.d.ts +84 -0
  52. package/dist/fp/factories/check-cash.d.ts.map +1 -0
  53. package/dist/fp/factories/check-cash.js +95 -0
  54. package/dist/fp/factories/check-cash.js.map +1 -0
  55. package/dist/fp/factories/check-create.d.ts +82 -0
  56. package/dist/fp/factories/check-create.d.ts.map +1 -0
  57. package/dist/fp/factories/check-create.js +101 -0
  58. package/dist/fp/factories/check-create.js.map +1 -0
  59. package/dist/fp/factories/clawback.d.ts +160 -0
  60. package/dist/fp/factories/clawback.d.ts.map +1 -0
  61. package/dist/fp/factories/clawback.js +111 -0
  62. package/dist/fp/factories/clawback.js.map +1 -0
  63. package/dist/fp/factories/confidential-mpt-clawback.d.ts +24 -0
  64. package/dist/fp/factories/confidential-mpt-clawback.d.ts.map +1 -0
  65. package/dist/fp/factories/confidential-mpt-clawback.js +200 -0
  66. package/dist/fp/factories/confidential-mpt-clawback.js.map +1 -0
  67. package/dist/fp/factories/confidential-mpt-convert-back.d.ts +32 -0
  68. package/dist/fp/factories/confidential-mpt-convert-back.d.ts.map +1 -0
  69. package/dist/fp/factories/confidential-mpt-convert-back.js +203 -0
  70. package/dist/fp/factories/confidential-mpt-convert-back.js.map +1 -0
  71. package/dist/fp/factories/confidential-mpt-convert.d.ts +32 -0
  72. package/dist/fp/factories/confidential-mpt-convert.d.ts.map +1 -0
  73. package/dist/fp/factories/confidential-mpt-convert.js +209 -0
  74. package/dist/fp/factories/confidential-mpt-convert.js.map +1 -0
  75. package/dist/fp/factories/confidential-mpt-merge-inbox.d.ts +18 -0
  76. package/dist/fp/factories/confidential-mpt-merge-inbox.d.ts.map +1 -0
  77. package/dist/fp/factories/confidential-mpt-merge-inbox.js +130 -0
  78. package/dist/fp/factories/confidential-mpt-merge-inbox.js.map +1 -0
  79. package/dist/fp/factories/confidential-mpt-send.d.ts +38 -0
  80. package/dist/fp/factories/confidential-mpt-send.d.ts.map +1 -0
  81. package/dist/fp/factories/confidential-mpt-send.js +254 -0
  82. package/dist/fp/factories/confidential-mpt-send.js.map +1 -0
  83. package/dist/fp/factories/credential-accept.d.ts +23 -0
  84. package/dist/fp/factories/credential-accept.d.ts.map +1 -0
  85. package/dist/fp/factories/credential-accept.js +135 -0
  86. package/dist/fp/factories/credential-accept.js.map +1 -0
  87. package/dist/fp/factories/credential-create.d.ts +24 -0
  88. package/dist/fp/factories/credential-create.d.ts.map +1 -0
  89. package/dist/fp/factories/credential-create.js +204 -0
  90. package/dist/fp/factories/credential-create.js.map +1 -0
  91. package/dist/fp/factories/credential-delete.d.ts +33 -0
  92. package/dist/fp/factories/credential-delete.d.ts.map +1 -0
  93. package/dist/fp/factories/credential-delete.js +167 -0
  94. package/dist/fp/factories/credential-delete.js.map +1 -0
  95. package/dist/fp/factories/delegate-set.d.ts +52 -0
  96. package/dist/fp/factories/delegate-set.d.ts.map +1 -0
  97. package/dist/fp/factories/delegate-set.js +190 -0
  98. package/dist/fp/factories/delegate-set.js.map +1 -0
  99. package/dist/fp/factories/deposit-preauth.d.ts +183 -0
  100. package/dist/fp/factories/deposit-preauth.d.ts.map +1 -0
  101. package/dist/fp/factories/deposit-preauth.js +159 -0
  102. package/dist/fp/factories/deposit-preauth.js.map +1 -0
  103. package/dist/fp/factories/did-delete.d.ts +22 -0
  104. package/dist/fp/factories/did-delete.d.ts.map +1 -0
  105. package/dist/fp/factories/did-delete.js +126 -0
  106. package/dist/fp/factories/did-delete.js.map +1 -0
  107. package/dist/fp/factories/did-set.d.ts +68 -0
  108. package/dist/fp/factories/did-set.d.ts.map +1 -0
  109. package/dist/fp/factories/did-set.js +178 -0
  110. package/dist/fp/factories/did-set.js.map +1 -0
  111. package/dist/fp/factories/escrow-cancel.d.ts +28 -0
  112. package/dist/fp/factories/escrow-cancel.d.ts.map +1 -0
  113. package/dist/fp/factories/escrow-cancel.js +127 -0
  114. package/dist/fp/factories/escrow-cancel.js.map +1 -0
  115. package/dist/fp/factories/escrow-create.d.ts +103 -0
  116. package/dist/fp/factories/escrow-create.d.ts.map +1 -0
  117. package/dist/fp/factories/escrow-create.js +133 -0
  118. package/dist/fp/factories/escrow-create.js.map +1 -0
  119. package/dist/fp/factories/escrow-finish.d.ts +39 -0
  120. package/dist/fp/factories/escrow-finish.d.ts.map +1 -0
  121. package/dist/fp/factories/escrow-finish.js +173 -0
  122. package/dist/fp/factories/escrow-finish.js.map +1 -0
  123. package/dist/fp/factories/ledger-state-fix.d.ts +31 -0
  124. package/dist/fp/factories/ledger-state-fix.d.ts.map +1 -0
  125. package/dist/fp/factories/ledger-state-fix.js +163 -0
  126. package/dist/fp/factories/ledger-state-fix.js.map +1 -0
  127. package/dist/fp/factories/loan-broker-cover-clawback.d.ts +106 -0
  128. package/dist/fp/factories/loan-broker-cover-clawback.d.ts.map +1 -0
  129. package/dist/fp/factories/loan-broker-cover-clawback.js +122 -0
  130. package/dist/fp/factories/loan-broker-cover-clawback.js.map +1 -0
  131. package/dist/fp/factories/loan-broker-cover-deposit.d.ts +65 -0
  132. package/dist/fp/factories/loan-broker-cover-deposit.d.ts.map +1 -0
  133. package/dist/fp/factories/loan-broker-cover-deposit.js +81 -0
  134. package/dist/fp/factories/loan-broker-cover-deposit.js.map +1 -0
  135. package/dist/fp/factories/loan-broker-cover-withdraw.d.ts +96 -0
  136. package/dist/fp/factories/loan-broker-cover-withdraw.d.ts.map +1 -0
  137. package/dist/fp/factories/loan-broker-cover-withdraw.js +116 -0
  138. package/dist/fp/factories/loan-broker-cover-withdraw.js.map +1 -0
  139. package/dist/fp/factories/loan-broker-delete.d.ts +20 -0
  140. package/dist/fp/factories/loan-broker-delete.d.ts.map +1 -0
  141. package/dist/fp/factories/loan-broker-delete.js +94 -0
  142. package/dist/fp/factories/loan-broker-delete.js.map +1 -0
  143. package/dist/fp/factories/loan-broker-set.d.ts +108 -0
  144. package/dist/fp/factories/loan-broker-set.d.ts.map +1 -0
  145. package/dist/fp/factories/loan-broker-set.js +133 -0
  146. package/dist/fp/factories/loan-broker-set.js.map +1 -0
  147. package/dist/fp/factories/loan-delete.d.ts +18 -0
  148. package/dist/fp/factories/loan-delete.d.ts.map +1 -0
  149. package/dist/fp/factories/loan-delete.js +95 -0
  150. package/dist/fp/factories/loan-delete.js.map +1 -0
  151. package/dist/fp/factories/loan-manage.d.ts +72 -0
  152. package/dist/fp/factories/loan-manage.d.ts.map +1 -0
  153. package/dist/fp/factories/loan-manage.js +79 -0
  154. package/dist/fp/factories/loan-manage.js.map +1 -0
  155. package/dist/fp/factories/loan-pay.d.ts +70 -0
  156. package/dist/fp/factories/loan-pay.d.ts.map +1 -0
  157. package/dist/fp/factories/loan-pay.js +115 -0
  158. package/dist/fp/factories/loan-pay.js.map +1 -0
  159. package/dist/fp/factories/loan-set.d.ts +67 -0
  160. package/dist/fp/factories/loan-set.d.ts.map +1 -0
  161. package/dist/fp/factories/loan-set.js +102 -0
  162. package/dist/fp/factories/loan-set.js.map +1 -0
  163. package/dist/fp/factories/mptoken-authorize.d.ts +83 -0
  164. package/dist/fp/factories/mptoken-authorize.d.ts.map +1 -0
  165. package/dist/fp/factories/mptoken-authorize.js +63 -0
  166. package/dist/fp/factories/mptoken-authorize.js.map +1 -0
  167. package/dist/fp/factories/mptoken-issuance-create.d.ts +71 -0
  168. package/dist/fp/factories/mptoken-issuance-create.d.ts.map +1 -0
  169. package/dist/fp/factories/mptoken-issuance-create.js +135 -0
  170. package/dist/fp/factories/mptoken-issuance-create.js.map +1 -0
  171. package/dist/fp/factories/mptoken-issuance-destroy.d.ts +32 -0
  172. package/dist/fp/factories/mptoken-issuance-destroy.d.ts.map +1 -0
  173. package/dist/fp/factories/mptoken-issuance-destroy.js +105 -0
  174. package/dist/fp/factories/mptoken-issuance-destroy.js.map +1 -0
  175. package/dist/fp/factories/mptoken-issuance-set.d.ts +196 -0
  176. package/dist/fp/factories/mptoken-issuance-set.d.ts.map +1 -0
  177. package/dist/fp/factories/mptoken-issuance-set.js +333 -0
  178. package/dist/fp/factories/mptoken-issuance-set.js.map +1 -0
  179. package/dist/fp/factories/nftoken-accept-offer.d.ts +108 -0
  180. package/dist/fp/factories/nftoken-accept-offer.d.ts.map +1 -0
  181. package/dist/fp/factories/nftoken-accept-offer.js +105 -0
  182. package/dist/fp/factories/nftoken-accept-offer.js.map +1 -0
  183. package/dist/fp/factories/nftoken-burn.d.ts +27 -0
  184. package/dist/fp/factories/nftoken-burn.d.ts.map +1 -0
  185. package/dist/fp/factories/nftoken-burn.js +125 -0
  186. package/dist/fp/factories/nftoken-burn.js.map +1 -0
  187. package/dist/fp/factories/nftoken-cancel-offer.d.ts +19 -0
  188. package/dist/fp/factories/nftoken-cancel-offer.d.ts.map +1 -0
  189. package/dist/fp/factories/nftoken-cancel-offer.js +143 -0
  190. package/dist/fp/factories/nftoken-cancel-offer.js.map +1 -0
  191. package/dist/fp/factories/nftoken-create-offer.d.ts +159 -0
  192. package/dist/fp/factories/nftoken-create-offer.d.ts.map +1 -0
  193. package/dist/fp/factories/nftoken-create-offer.js +212 -0
  194. package/dist/fp/factories/nftoken-create-offer.js.map +1 -0
  195. package/dist/fp/factories/nftoken-mint.d.ts +155 -0
  196. package/dist/fp/factories/nftoken-mint.d.ts.map +1 -0
  197. package/dist/fp/factories/nftoken-mint.js +165 -0
  198. package/dist/fp/factories/nftoken-mint.js.map +1 -0
  199. package/dist/fp/factories/nftoken-modify.d.ts +28 -0
  200. package/dist/fp/factories/nftoken-modify.d.ts.map +1 -0
  201. package/dist/fp/factories/nftoken-modify.js +209 -0
  202. package/dist/fp/factories/nftoken-modify.js.map +1 -0
  203. package/dist/fp/factories/offer-cancel.d.ts +21 -0
  204. package/dist/fp/factories/offer-cancel.d.ts.map +1 -0
  205. package/dist/fp/factories/offer-cancel.js +99 -0
  206. package/dist/fp/factories/offer-cancel.js.map +1 -0
  207. package/dist/fp/factories/offer-create.d.ts +125 -0
  208. package/dist/fp/factories/offer-create.d.ts.map +1 -0
  209. package/dist/fp/factories/offer-create.js +230 -0
  210. package/dist/fp/factories/offer-create.js.map +1 -0
  211. package/dist/fp/factories/oracle-delete.d.ts +21 -0
  212. package/dist/fp/factories/oracle-delete.d.ts.map +1 -0
  213. package/dist/fp/factories/oracle-delete.js +101 -0
  214. package/dist/fp/factories/oracle-delete.js.map +1 -0
  215. package/dist/fp/factories/oracle-set.d.ts +40 -0
  216. package/dist/fp/factories/oracle-set.d.ts.map +1 -0
  217. package/dist/fp/factories/oracle-set.js +257 -0
  218. package/dist/fp/factories/oracle-set.js.map +1 -0
  219. package/dist/fp/factories/payment-channel-claim.d.ts +153 -0
  220. package/dist/fp/factories/payment-channel-claim.d.ts.map +1 -0
  221. package/dist/fp/factories/payment-channel-claim.js +118 -0
  222. package/dist/fp/factories/payment-channel-claim.js.map +1 -0
  223. package/dist/fp/factories/payment-channel-create.d.ts +30 -0
  224. package/dist/fp/factories/payment-channel-create.d.ts.map +1 -0
  225. package/dist/fp/factories/payment-channel-create.js +172 -0
  226. package/dist/fp/factories/payment-channel-create.js.map +1 -0
  227. package/dist/fp/factories/payment-channel-fund.d.ts +25 -0
  228. package/dist/fp/factories/payment-channel-fund.d.ts.map +1 -0
  229. package/dist/fp/factories/payment-channel-fund.js +142 -0
  230. package/dist/fp/factories/payment-channel-fund.js.map +1 -0
  231. package/dist/fp/factories/payment.d.ts +65 -0
  232. package/dist/fp/factories/payment.d.ts.map +1 -0
  233. package/dist/fp/factories/payment.js +48 -0
  234. package/dist/fp/factories/payment.js.map +1 -0
  235. package/dist/fp/factories/permissioned-domain-delete.d.ts +18 -0
  236. package/dist/fp/factories/permissioned-domain-delete.d.ts.map +1 -0
  237. package/dist/fp/factories/permissioned-domain-delete.js +88 -0
  238. package/dist/fp/factories/permissioned-domain-delete.js.map +1 -0
  239. package/dist/fp/factories/permissioned-domain-set.d.ts +118 -0
  240. package/dist/fp/factories/permissioned-domain-set.d.ts.map +1 -0
  241. package/dist/fp/factories/permissioned-domain-set.js +100 -0
  242. package/dist/fp/factories/permissioned-domain-set.js.map +1 -0
  243. package/dist/fp/factories/set-regular-key.d.ts +30 -0
  244. package/dist/fp/factories/set-regular-key.d.ts.map +1 -0
  245. package/dist/fp/factories/set-regular-key.js +81 -0
  246. package/dist/fp/factories/set-regular-key.js.map +1 -0
  247. package/dist/fp/factories/signer-list-set.d.ts +61 -0
  248. package/dist/fp/factories/signer-list-set.d.ts.map +1 -0
  249. package/dist/fp/factories/signer-list-set.js +250 -0
  250. package/dist/fp/factories/signer-list-set.js.map +1 -0
  251. package/dist/fp/factories/sponsorship-set.d.ts +148 -0
  252. package/dist/fp/factories/sponsorship-set.d.ts.map +1 -0
  253. package/dist/fp/factories/sponsorship-set.js +201 -0
  254. package/dist/fp/factories/sponsorship-set.js.map +1 -0
  255. package/dist/fp/factories/sponsorship-transfer.d.ts +173 -0
  256. package/dist/fp/factories/sponsorship-transfer.d.ts.map +1 -0
  257. package/dist/fp/factories/sponsorship-transfer.js +195 -0
  258. package/dist/fp/factories/sponsorship-transfer.js.map +1 -0
  259. package/dist/fp/factories/ticket-create.d.ts +20 -0
  260. package/dist/fp/factories/ticket-create.d.ts.map +1 -0
  261. package/dist/fp/factories/ticket-create.js +120 -0
  262. package/dist/fp/factories/ticket-create.js.map +1 -0
  263. package/dist/fp/factories/trust-set.d.ts +100 -0
  264. package/dist/fp/factories/trust-set.d.ts.map +1 -0
  265. package/dist/fp/factories/trust-set.js +111 -0
  266. package/dist/fp/factories/trust-set.js.map +1 -0
  267. package/dist/fp/factories/vault-clawback.d.ts +83 -0
  268. package/dist/fp/factories/vault-clawback.d.ts.map +1 -0
  269. package/dist/fp/factories/vault-clawback.js +91 -0
  270. package/dist/fp/factories/vault-clawback.js.map +1 -0
  271. package/dist/fp/factories/vault-create.d.ts +51 -0
  272. package/dist/fp/factories/vault-create.d.ts.map +1 -0
  273. package/dist/fp/factories/vault-create.js +141 -0
  274. package/dist/fp/factories/vault-create.js.map +1 -0
  275. package/dist/fp/factories/vault-delete.d.ts +20 -0
  276. package/dist/fp/factories/vault-delete.d.ts.map +1 -0
  277. package/dist/fp/factories/vault-delete.js +103 -0
  278. package/dist/fp/factories/vault-delete.js.map +1 -0
  279. package/dist/fp/factories/vault-deposit.d.ts +56 -0
  280. package/dist/fp/factories/vault-deposit.d.ts.map +1 -0
  281. package/dist/fp/factories/vault-deposit.js +85 -0
  282. package/dist/fp/factories/vault-deposit.js.map +1 -0
  283. package/dist/fp/factories/vault-set.d.ts +32 -0
  284. package/dist/fp/factories/vault-set.d.ts.map +1 -0
  285. package/dist/fp/factories/vault-set.js +135 -0
  286. package/dist/fp/factories/vault-set.js.map +1 -0
  287. package/dist/fp/factories/vault-withdraw.d.ts +82 -0
  288. package/dist/fp/factories/vault-withdraw.d.ts.map +1 -0
  289. package/dist/fp/factories/vault-withdraw.js +122 -0
  290. package/dist/fp/factories/vault-withdraw.js.map +1 -0
  291. package/dist/fp/factories/xchain-account-create-commit.d.ts +180 -0
  292. package/dist/fp/factories/xchain-account-create-commit.d.ts.map +1 -0
  293. package/dist/fp/factories/xchain-account-create-commit.js +99 -0
  294. package/dist/fp/factories/xchain-account-create-commit.js.map +1 -0
  295. package/dist/fp/factories/xchain-add-account-create-attestation.d.ts +213 -0
  296. package/dist/fp/factories/xchain-add-account-create-attestation.d.ts.map +1 -0
  297. package/dist/fp/factories/xchain-add-account-create-attestation.js +95 -0
  298. package/dist/fp/factories/xchain-add-account-create-attestation.js.map +1 -0
  299. package/dist/fp/factories/xchain-add-claim-attestation.d.ts +206 -0
  300. package/dist/fp/factories/xchain-add-claim-attestation.d.ts.map +1 -0
  301. package/dist/fp/factories/xchain-add-claim-attestation.js +97 -0
  302. package/dist/fp/factories/xchain-add-claim-attestation.js.map +1 -0
  303. package/dist/fp/factories/xchain-claim.d.ts +187 -0
  304. package/dist/fp/factories/xchain-claim.d.ts.map +1 -0
  305. package/dist/fp/factories/xchain-claim.js +140 -0
  306. package/dist/fp/factories/xchain-claim.js.map +1 -0
  307. package/dist/fp/factories/xchain-commit.d.ts +168 -0
  308. package/dist/fp/factories/xchain-commit.d.ts.map +1 -0
  309. package/dist/fp/factories/xchain-commit.js +137 -0
  310. package/dist/fp/factories/xchain-commit.js.map +1 -0
  311. package/dist/fp/factories/xchain-create-bridge.d.ts +206 -0
  312. package/dist/fp/factories/xchain-create-bridge.d.ts.map +1 -0
  313. package/dist/fp/factories/xchain-create-bridge.js +100 -0
  314. package/dist/fp/factories/xchain-create-bridge.js.map +1 -0
  315. package/dist/fp/factories/xchain-create-claim-id.d.ts +199 -0
  316. package/dist/fp/factories/xchain-create-claim-id.d.ts.map +1 -0
  317. package/dist/fp/factories/xchain-create-claim-id.js +78 -0
  318. package/dist/fp/factories/xchain-create-claim-id.js.map +1 -0
  319. package/dist/fp/factories/xchain-modify-bridge.d.ts +198 -0
  320. package/dist/fp/factories/xchain-modify-bridge.d.ts.map +1 -0
  321. package/dist/fp/factories/xchain-modify-bridge.js +102 -0
  322. package/dist/fp/factories/xchain-modify-bridge.js.map +1 -0
  323. package/dist/fp/index.d.ts +124 -0
  324. package/dist/fp/index.d.ts.map +1 -0
  325. package/dist/fp/index.js +152 -0
  326. package/dist/fp/index.js.map +1 -0
  327. package/dist/fp/shape.d.ts +34 -0
  328. package/dist/fp/shape.d.ts.map +1 -0
  329. package/dist/fp/shape.js +80 -0
  330. package/dist/fp/shape.js.map +1 -0
  331. package/dist/types/amounts.d.ts +49 -0
  332. package/dist/types/amounts.d.ts.map +1 -0
  333. package/dist/types/amounts.js +8 -0
  334. package/dist/types/amounts.js.map +1 -0
  335. package/dist/types/base.d.ts +103 -0
  336. package/dist/types/base.d.ts.map +1 -0
  337. package/dist/types/base.js +2 -0
  338. package/dist/types/base.js.map +1 -0
  339. package/dist/types/common.d.ts +163 -0
  340. package/dist/types/common.d.ts.map +1 -0
  341. package/dist/types/common.js +5 -0
  342. package/dist/types/common.js.map +1 -0
  343. package/dist/types/flags.d.ts +317 -0
  344. package/dist/types/flags.d.ts.map +1 -0
  345. package/dist/types/flags.js +253 -0
  346. package/dist/types/flags.js.map +1 -0
  347. package/dist/types/index.d.ts +10 -0
  348. package/dist/types/index.d.ts.map +1 -0
  349. package/dist/types/index.js +2 -0
  350. package/dist/types/index.js.map +1 -0
  351. package/dist/types/transaction-types.d.ts +7 -0
  352. package/dist/types/transaction-types.d.ts.map +1 -0
  353. package/dist/types/transaction-types.js +2 -0
  354. package/dist/types/transaction-types.js.map +1 -0
  355. package/dist/validation/base.d.ts +8 -0
  356. package/dist/validation/base.d.ts.map +1 -0
  357. package/dist/validation/base.js +79 -0
  358. package/dist/validation/base.js.map +1 -0
  359. package/dist/validation/helpers.d.ts +42 -0
  360. package/dist/validation/helpers.d.ts.map +1 -0
  361. package/dist/validation/helpers.js +154 -0
  362. package/dist/validation/helpers.js.map +1 -0
  363. package/dist/validation/index.d.ts +3 -0
  364. package/dist/validation/index.d.ts.map +1 -0
  365. package/dist/validation/index.js +3 -0
  366. package/dist/validation/index.js.map +1 -0
  367. package/package.json +67 -0
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Functional Clawback factory — frozen-object style.
3
+ *
4
+ * Reclaim issued tokens or MPTs from a holder's account. The submitter
5
+ * (`Account`) must be the issuer of the asset being clawed back. The
6
+ * `Amount` shape determines which ledger code path executes:
7
+ *
8
+ * - `IssuedCurrencyAmount` (`{ currency, issuer, value }`) — claws back
9
+ * trust-line tokens. The `issuer` sub-field here names the **holder**
10
+ * (XLS-39 §3.3.1, "the sub-field `issuer` within `Amount` represents
11
+ * the token holder's address instead of the issuer's"). `Holder` MUST
12
+ * be omitted.
13
+ * - `MPTAmount` (`{ mpt_issuance_id, value }`) — claws back MPTs.
14
+ * `Holder` MUST be present and must be a valid XRPL account distinct
15
+ * from `Account`.
16
+ *
17
+ * XRP can never be clawed back — XLS-39 explicitly forbids it ("This
18
+ * proposal deals only with issued assets. The proposed clawback support
19
+ * cannot be used to claw back XRP.").
20
+ *
21
+ * Validation happens at construction; there is no way to construct an
22
+ * invalid tx.
23
+ *
24
+ * import { clawback } from 'xrplt/fp';
25
+ * // IOU clawback — the holder is encoded inside Amount.issuer:
26
+ * const iouTx = clawback({
27
+ * Account: 'rIssuer…',
28
+ * Amount: { currency: 'USD', issuer: 'rHolder…', value: '100' },
29
+ * });
30
+ * // MPT clawback — the holder is encoded in Holder:
31
+ * const mptTx = clawback({
32
+ * Account: 'rIssuer…',
33
+ * Amount: { mpt_issuance_id: '00000001', value: '100' },
34
+ * Holder: 'rHolder…',
35
+ * });
36
+ * const j = iouTx.toJSON();
37
+ * const tx2 = iouTx.with({ 'Amount.value': '50' }); // type-safe via with()
38
+ *
39
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/clawback
40
+ * @see https://github.com/XRPLF/xrpl.js/blob/main/packages/xrpl/src/models/transactions/clawback.ts
41
+ * @see XLS-39 §3.3.1 (https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0039-clawback)
42
+ *
43
+ * ## Divergences
44
+ *
45
+ * Compared with `src/transactions/clawback.ts`, this factory adds
46
+ * preclaim guards the class API skips. Each is cited to the canonical
47
+ * source.
48
+ *
49
+ * - **`Amount` is typed as `ClawbackAmount` (IOU or MPT only), not the
50
+ * wider `Amount`.** The class declares `Amount: Amount` (which
51
+ * includes the XRP drops `string` variant) and only filters strings
52
+ * out via `typeof this.Amount === 'string'`. Typing the parameter
53
+ * as `ClawbackAmount` makes the no-XRP rule a compile-time guarantee;
54
+ * the runtime guard below also rejects malformed amounts.
55
+ * - Source: xrpl-dev-portal clawback.md, `Amount` row, JSON Type
56
+ * "Currency Amount" with `issuer` sub-field semantics, and the
57
+ * document body: "When clawing back trust line tokens, you must
58
+ * omit the `Holder` field. When clawing back MPTs, you must provide
59
+ * the `Holder` field."
60
+ * - Source: XLS-39 §1: "This proposal deals only with issued assets.
61
+ * The proposed clawback support cannot be used to claw back XRP."
62
+ *
63
+ * - **`Account` must be a valid XRPL classic or X-address.** The class
64
+ * inherits only `validateBaseTransaction`'s `isString(Account)` check
65
+ * and never enforces address format.
66
+ * - Source: xrpl-dev-portal clawback.md, `Account` row, Internal
67
+ * Type = `AccountID`.
68
+ *
69
+ * - **`Account` and `Amount.issuer` must be distinct (IOU form).**
70
+ * The class delegates to `isAmount` only; it never compares Account
71
+ * to Amount.issuer. The ledger rejects this with `temBAD_AMOUNT`
72
+ * ("the specified holder is the issuer" — docs use "holder" to mean
73
+ * the counterparty, here `Amount.issuer`).
74
+ * - Source: xrpl-dev-portal clawback.md "Error Cases" table,
75
+ * `temBAD_AMOUNT` row.
76
+ * - Source: xrpl.js `validateClawback` lines 54–56, message
77
+ * `'Clawback: invalid holder Account'`.
78
+ * - Source: XLS-39 §3.3.1 "Amount": "It is an error if the
79
+ * counterparty listed in `Amount` is the same as the `Account`
80
+ * issuing this transaction; the transaction should fail execution
81
+ * with `temBAD_AMOUNT`."
82
+ *
83
+ * - **`Account` and `Holder` must be distinct (MPT form).** Same
84
+ * rationale as above.
85
+ * - Source: xrpl.js `validateClawback` lines 58–60, message
86
+ * `'Clawback: invalid holder Account'`.
87
+ * - Source: xrpl-dev-portal clawback.md, `Holder` row: "The holder
88
+ * must have a non-zero balance of the MPT issuance indicated in
89
+ * the `Amount` field" (you cannot claw back from yourself).
90
+ *
91
+ * - **Holder must be omitted for IOU clawback and required for MPT
92
+ * clawback.** The class never enforces this asymmetry.
93
+ * - Source: xrpl.js `validateClawback` lines 62–68, messages
94
+ * `'Clawback: cannot have Holder for currency'` and
95
+ * `'Clawback: missing Holder'`.
96
+ * - Source: xrpl-dev-portal clawback.md body: "When clawing back
97
+ * trust line tokens, you must omit the `Holder` field. When
98
+ * clawing back MPTs, you must provide the `Holder` field."
99
+ *
100
+ * - **`Holder` must be a valid XRPL address** (MPT form). The class
101
+ * delegates to `isAccount` which is fine — kept identical.
102
+ * - Source: xrpl.js `validateClawback` line 48
103
+ * (`validateOptionalField(tx, 'Holder', isAccount)`).
104
+ *
105
+ * - **IssuedCurrencyAmount sub-fields are validated** (3-char ASCII or
106
+ * 40-char hex `currency`; `issuer` must be a valid XRPL account;
107
+ * `value` must be a positive non-zero base-10 integer string).
108
+ * The class only checks shape via `isAmount`, which does not enforce
109
+ * those sub-fields.
110
+ * - Source: xrpl-dev-portal basic-data-types#specifying-currency-amounts.
111
+ * - Source: xrpl-dev-portal clawback.md, `Amount` row, Description:
112
+ * "The quantity in the `value` sub-field must not be zero."
113
+ * - Source: XLS-39 §3.3.1 "Amount": "It returns `temBAD_AMOUNT` is
114
+ * the amount is zero."
115
+ *
116
+ * - **MPTAmount sub-fields are validated** (`mpt_issuance_id` is a
117
+ * 24–48 char hex string; `value` is a positive non-zero base-10
118
+ * integer string). The class only checks shape via `isAmount`.
119
+ * - Source: xrpl-dev-portal clawback.md "Error Cases" table,
120
+ * `temBAD_AMOUNT` row.
121
+ * - Source: XLS-0033 Multi-Purpose Tokens
122
+ * (`mpt_issuance_id` is a 192-bit uint hex-encoded).
123
+ *
124
+ * - **`Flags` is pass-through** (no per-tx flag defined by XLS-39).
125
+ * The class never inspects Flags either. Per XLS-39 §3.3.1, "The
126
+ * universal transaction flags that are applicable to all
127
+ * transactions (e.g., `tfFullyCanonicalSig`) are valid. This
128
+ * proposal introduces no new transaction-specific flags." We
129
+ * therefore do not validate Flags beyond type acceptance.
130
+ * - Source: XLS-39 §3.3.1 "Flags" row.
131
+ */
132
+ import type { ClawbackAmount } from '../../types/amounts.js';
133
+ import type { GlobalFlagsInterface } from '../../types/flags.js';
134
+ export interface ClawbackProps {
135
+ /** The issuer submitting the clawback. Must equal the asset's issuer. */
136
+ Account: string;
137
+ /**
138
+ * The amount to claw back. For IOU clawbacks, the `issuer` sub-field
139
+ * names the **holder**. For MPT clawbacks, the holder is named in
140
+ * the separate `Holder` field.
141
+ */
142
+ Amount: ClawbackAmount;
143
+ /**
144
+ * Required for MPT clawbacks; MUST be omitted for IOU clawbacks.
145
+ * Must be distinct from `Account`.
146
+ */
147
+ Holder?: string | undefined;
148
+ /** No per-tx flags defined; pass-through (universal flags only). */
149
+ Flags?: number | GlobalFlagsInterface | undefined;
150
+ Fee?: string | undefined;
151
+ Sequence?: number | undefined;
152
+ }
153
+ export interface Clawback extends Readonly<ClawbackProps> {
154
+ readonly TransactionType: 'Clawback';
155
+ validate(): void;
156
+ toJSON(): Record<string, unknown>;
157
+ with(overrides: Partial<ClawbackProps>): Clawback;
158
+ }
159
+ export declare function clawback(props: ClawbackProps): Clawback;
160
+ //# sourceMappingURL=clawback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clawback.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/clawback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAyBjE,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;IAClD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,QAAS,SAAQ,QAAQ,CAAC,aAAa,CAAC;IACvD,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC;IACrC,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC;CACnD;AAcD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,CAoIvD"}
@@ -0,0 +1,111 @@
1
+ import { isAccount, isHex, isIssuedCurrencyAmount, isMPTAmount, isString, } from '../../validation/helpers.js';
2
+ import { ValidationError } from '../../errors.js';
3
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
4
+ // ─── Spec constants ──────────────────────────────────────────────────
5
+ // Currency codes are either 3 ASCII characters or 40 hex characters.
6
+ const CURRENCY_ASCII_LENGTH = 3;
7
+ const CURRENCY_HEX_LENGTH = 40;
8
+ // MPT issuance IDs are 192-bit, hex-encoded (≤ 48 chars).
9
+ // We accept 24..48 to leave slack for future widenings / leading-zero
10
+ // encoders. Empty strings are rejected.
11
+ const MPT_ISSUANCE_ID_MIN = 24;
12
+ const MPT_ISSUANCE_ID_MAX = 48;
13
+ // ─── Helpers ─────────────────────────────────────────────────────────
14
+ /**
15
+ * XRPLNumber: a non-negative base-10 integer string. Matches the policy
16
+ * used across other factories (vaultClawback, ammClawback, vaultCreate).
17
+ */
18
+ function isXrplNumber(value) {
19
+ return isString(value) && /^[0-9]+$/u.test(value);
20
+ }
21
+ // ─── Factory ─────────────────────────────────────────────────────────
22
+ export function clawback(props) {
23
+ // ── Account ── required, valid XRPL classic / X-address.
24
+ require(props.Account, 'Clawback: Account is required', isAccount);
25
+ // ── Amount ── required, must be a ClawbackAmount (NOT XRP drops).
26
+ if (props.Amount === undefined) {
27
+ throw new ValidationError('Clawback: Amount is required');
28
+ }
29
+ if (!isIssuedCurrencyAmount(props.Amount) && !isMPTAmount(props.Amount)) {
30
+ throw new ValidationError('Clawback: Amount must be an IssuedCurrency or MPT, not XRP drops');
31
+ }
32
+ // ── IOU clawback path ───────────────────────────────────────────────
33
+ // xrpl-dev-portal clawback.md body: "When clawing back trust line
34
+ // tokens, you must omit the `Holder` field."
35
+ if (isIssuedCurrencyAmount(props.Amount)) {
36
+ if (props.Holder !== undefined) {
37
+ throw new ValidationError('Clawback: Holder must not be provided when clawing back a currency (IOU); the holder is named in Amount.issuer');
38
+ }
39
+ // currency: 3 ASCII or 40 hex characters.
40
+ const ccy = props.Amount.currency;
41
+ if (ccy.length !== CURRENCY_ASCII_LENGTH &&
42
+ ccy.length !== CURRENCY_HEX_LENGTH) {
43
+ throw new ValidationError(`Clawback: Amount.currency must be ${CURRENCY_ASCII_LENGTH} ASCII characters or ${CURRENCY_HEX_LENGTH} hex characters (actual: ${ccy.length})`);
44
+ }
45
+ if (ccy.length === CURRENCY_HEX_LENGTH && !isHex(ccy)) {
46
+ throw new ValidationError('Clawback: Amount.currency (40-char form) must be hex');
47
+ }
48
+ // issuer: must be a valid XRPL classic / X-address.
49
+ // XLS-39 §3.3.1: "the sub-field `issuer` within `Amount` represents
50
+ // the token holder's address instead of the issuer's."
51
+ if (!isAccount(props.Amount.issuer)) {
52
+ throw new ValidationError('Clawback: Amount.issuer must be a valid XRPL account address');
53
+ }
54
+ // Account != Amount.issuer (you cannot claw back from yourself).
55
+ if (props.Account === props.Amount.issuer) {
56
+ throw new ValidationError('Clawback: Account and Amount.issuer must be distinct (cannot claw back from yourself)');
57
+ }
58
+ // value: positive non-zero base-10 integer string.
59
+ if (!isXrplNumber(props.Amount.value)) {
60
+ throw new ValidationError('Clawback: Amount.value must be a non-negative base-10 integer string');
61
+ }
62
+ if (props.Amount.value === '0') {
63
+ throw new ValidationError('Clawback: Amount.value must not be zero (temBAD_AMOUNT)');
64
+ }
65
+ // ── MPT clawback path ─────────────────────────────────────────────
66
+ // xrpl-dev-portal clawback.md body: "When clawing back MPTs, you
67
+ // must provide the `Holder` field."
68
+ }
69
+ else {
70
+ // Holder is required for MPT clawback.
71
+ require(props.Holder, 'Clawback: Holder is required when clawing back an MPT', isAccount);
72
+ // mpt_issuance_id: 24..48 char hex string.
73
+ const mptid = props.Amount.mpt_issuance_id;
74
+ if (mptid.length < MPT_ISSUANCE_ID_MIN ||
75
+ mptid.length > MPT_ISSUANCE_ID_MAX ||
76
+ !isHex(mptid)) {
77
+ throw new ValidationError(`Clawback: Amount.mpt_issuance_id must be a ${MPT_ISSUANCE_ID_MIN}-${MPT_ISSUANCE_ID_MAX} character hex string`);
78
+ }
79
+ // value: positive non-zero base-10 integer string.
80
+ if (!isXrplNumber(props.Amount.value)) {
81
+ throw new ValidationError('Clawback: Amount.value must be a non-negative base-10 integer string');
82
+ }
83
+ if (props.Amount.value === '0') {
84
+ throw new ValidationError('Clawback: Amount.value must not be zero (temBAD_AMOUNT)');
85
+ }
86
+ // Account != Holder (you cannot claw back from yourself).
87
+ if (props.Account === props.Holder) {
88
+ throw new ValidationError('Clawback: Account and Holder must be distinct (cannot claw back from yourself)');
89
+ }
90
+ }
91
+ return buildFrozenTx('Clawback', props, {
92
+ validate() {
93
+ // Validated at construction.
94
+ },
95
+ toJSON() {
96
+ const json = {};
97
+ for (const k of Object.keys(this)) {
98
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
99
+ continue;
100
+ const v = this[k];
101
+ if (v !== undefined)
102
+ json[k] = v;
103
+ }
104
+ return json;
105
+ },
106
+ with(overrides) {
107
+ return clawback(mergeForWith(this, overrides));
108
+ },
109
+ });
110
+ }
111
+ //# sourceMappingURL=clawback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clawback.js","sourceRoot":"","sources":["../../../src/fp/factories/clawback.ts"],"names":[],"mappings":"AAqIA,OAAO,EACL,SAAS,EACT,KAAK,EACL,sBAAsB,EACtB,WAAW,EACX,QAAQ,GACT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEnE,wEAAwE;AAExE,qEAAqE;AACrE,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,0DAA0D;AAC1D,sEAAsE;AACtE,wCAAwC;AACxC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AA+B/B,wEAAwE;AAExE;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,wEAAwE;AAExE,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,0DAA0D;IAC1D,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,+BAA+B,EAAE,SAAS,CAAC,CAAC;IAEnE,mEAAmE;IACnE,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,eAAe,CAAC,8BAA8B,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,eAAe,CACvB,kEAAkE,CACnE,CAAC;IACJ,CAAC;IAED,uEAAu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,SAAS;gBACjE,MAAM,CAAC,GAAI,IAA2C,CAAC,CAAC,CAAC,CAAC;gBAC1D,IAAI,CAAC,KAAK,SAAS;oBAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAAiB,SAAiC;YACpD,OAAO,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QACjD,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ export interface ConfidentialMptClawbackProps {
2
+ /** Issuer AccountID — must be the issuer of `MPTokenIssuanceID`. */
3
+ Account: string;
4
+ /** AccountID — the holder being clawed back from. */
5
+ Holder: string;
6
+ /** UInt192 — MPT issuance identifier (48-char hex). */
7
+ MPTokenIssuanceID: string;
8
+ /** UInt64 — plaintext total to claw back. */
9
+ MPTAmount: string;
10
+ /** 64-byte Clawback sigma proof (128-char hex). */
11
+ ZKProof: string;
12
+ /** Fee in XRP (drops), base-10 integer string. */
13
+ Fee?: string | undefined;
14
+ /** Account sequence number. */
15
+ Sequence?: number | undefined;
16
+ }
17
+ export interface ConfidentialMptClawback extends Readonly<ConfidentialMptClawbackProps> {
18
+ readonly TransactionType: 'ConfidentialMPTClawback';
19
+ validate(): void;
20
+ toJSON(): Record<string, unknown>;
21
+ with(overrides: Partial<ConfidentialMptClawbackProps>): ConfidentialMptClawback;
22
+ }
23
+ export declare function confidentialMptClawback(props: ConfidentialMptClawbackProps): ConfidentialMptClawback;
24
+ //# sourceMappingURL=confidential-mpt-clawback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confidential-mpt-clawback.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/confidential-mpt-clawback.ts"],"names":[],"mappings":"AAoJA,MAAM,WAAW,4BAA4B;IAC3C,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,uBACf,SAAQ,QAAQ,CAAC,4BAA4B,CAAC;IAC9C,QAAQ,CAAC,eAAe,EAAE,yBAAyB,CAAC;IACpD,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CACF,SAAS,EAAE,OAAO,CAAC,4BAA4B,CAAC,GAC/C,uBAAuB,CAAC;CAC5B;AAID,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,4BAA4B,GAClC,uBAAuB,CA0FzB"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Functional ConfidentialMptClawback factory — frozen-object style.
3
+ *
4
+ * Issuer-only operation that burns the holder's entire confidential MPT
5
+ * balance (inbox + spending) and decrements both `OutstandingAmount` and
6
+ * `ConfidentialOutstandingAmount`. Unlike a normal `Clawback`, the issuer
7
+ * does not possess the holder's private ElGamal key, so it must supply a
8
+ * `MPTAmount` (the plaintext total) and a 64-byte compact Clawback sigma
9
+ * `ZKProof` proving that the on-ledger `IssuerEncryptedBalance` ciphertext
10
+ * encrypts that plaintext.
11
+ *
12
+ * Validation happens at construction; there is no way to construct an
13
+ * invalid tx. Compare to the class-based equivalent, which exposes a
14
+ * separate `.validate()` method you must remember to call.
15
+ *
16
+ * import { confidentialMptClawback } from 'xrplt/fp';
17
+ * const tx = confidentialMptClawback({ Account, Holder, MPTokenIssuanceID, MPTAmount, ZKProof });
18
+ * const j = tx.toJSON();
19
+ * const tx2 = tx.with({ Fee: '100' });
20
+ *
21
+ * Requires the `ConfidentialTransfer` amendment.
22
+ *
23
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/confidentialmptclawback
24
+ * @see XLS-0096 §12 — Transaction: `ConfidentialMPTClawback`
25
+ * (https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0096-confidential-mpt)
26
+ * @see xrpl.js — packages/xrpl/src/models/transactions/ConfidentialMPTClawback.ts
27
+ *
28
+ * ## Divergences
29
+ *
30
+ * Compared with `src/transactions/confidential-mpt-clawback.ts`, this
31
+ * factory adds guards the class skips — and is explicit about the
32
+ * canonical guards it cannot enforce in a zero-dependency package.
33
+ *
34
+ * - **`Account` is validated as a well-formed XRPL classic or X-address**
35
+ * at construction time, with `isAccount` (`src/validation/helpers.ts`
36
+ * lines 55–60). The class API delegates Account validation to its
37
+ * `TokenTransaction` → `Transaction` parent chain via `super.validate()`;
38
+ * failures therefore surface as a separate `.validate()` step rather
39
+ * than at `new`. We re-implement the guard inline so a malformed Account
40
+ * is caught at construction.
41
+ * - Source: xrpl.js `validateBaseTransaction` (called transitively by
42
+ * `validateConfidentialMPTClawback`).
43
+ * - Source: xrpl-dev-portal `confidentialmptclawback.md` JSON-Type
44
+ * column for `Account` (`ACCOUNTID`).
45
+ *
46
+ * - **`Holder` is validated as a well-formed XRPL classic or X-address**
47
+ * at construction time. The class also checks this (`isAccount`), but
48
+ * only inside `.validate()` rather than at `new`.
49
+ * - Source: XLS-0096 §12.2 Fields table, Internal Type = `ACCOUNTID`
50
+ * for `Holder`.
51
+ * - Source: xrpl-dev-portal `confidentialmptclawback.md` Fields table
52
+ * row for `Holder` (`ACCOUNTID`).
53
+ *
54
+ * - **`MPTAmount` is bounded to the canonical UInt64 range and rejected
55
+ * for non-numeric / non-integer / out-of-range / "MAX+1" form.** The class
56
+ * only checks `MPTAmount !== '0'`, allowing `'9223372036854775808'`
57
+ * (one past max uint64) to pass through and rely on the ledger to reject
58
+ * it. xrpl.js's `validateConfidentialMPTAmount` (called via
59
+ * `validateConfidentialMPTClawback` with `allowZero = false`) enforces
60
+ * both `INTEGER_SANITY_CHECK` (`/^[0-9]+$/u`) and
61
+ * `MPTAmount <= MAX_MPT_AMOUNT (= 9223372036854775807)`.
62
+ * - Source: xrpl.js `validateConfidentialMPTAmount`
63
+ * (`packages/xrpl/src/models/transactions/common.ts` lines 596–608).
64
+ * - Source: xrpl.js `MAX_MPT_AMOUNT` (same file, line 48).
65
+ * - Source: xrpl.js test `ConfidentialMPTClawback.test.ts` cases
66
+ * "throws w/ zero MPTAmount", "throws w/ out-of-range MPTAmount",
67
+ * "throws w/ non-numeric MPTAmount".
68
+ * - Source: XLS-0096 §12.4.1 item 5: `MPTAmount` is zero or exceeds
69
+ * the maximum limits → `temBAD_AMOUNT`.
70
+ *
71
+ * - **`Account` must NOT equal `Holder` (KNOWN LIMITATION — NOT
72
+ * IMPLEMENTED)**. XLS-0096 §12.4.1.3 mandates this as `temMALFORMED`:
73
+ *
74
+ * > "The `Account` is attempting to claw back from itself
75
+ * > (`Account` == `Holder`). (`temMALFORMED`)"
76
+ *
77
+ * xrpl.js's `validateConfidentialMPTClawback` (lines 59–63) enforces
78
+ * this via a direct string comparison.
79
+ *
80
+ * The class API also skips this guard (it relies on `super.validate()`
81
+ * which does not perform the self-clawback check), so this is not a
82
+ * coverage regression relative to the class. Adding the guard is
83
+ * trivially possible in this factory (a single string comparison), so
84
+ * we **do** add it here — making the factory strictly more correct
85
+ * than the class API.
86
+ * - Source: XLS-0096 §12.4.1.3 Failure Conditions (Data Verification),
87
+ * item 3: `temMALFORMED` when `Account` == `Holder`.
88
+ * - Source: xrpl-dev-portal `confidentialmptclawback.md` Error Cases
89
+ * table, `temMALFORMED` row, "The `Account` and the `Holder` are
90
+ * the same".
91
+ * - Source: xrpl.js `ConfidentialMPTClawback.ts` lines 59–63.
92
+ *
93
+ * - **`Account` must be the issuer of `MPTokenIssuanceID` (KNOWN
94
+ * LIMITATION — NOT IMPLEMENTED)**. XLS-0096 §12.4.1.2 mandates this as
95
+ * `temMALFORMED`:
96
+ *
97
+ * > "The `Account` is not the issuer of the `MPTokenIssuanceID`.
98
+ * > (`temMALFORMED`)"
99
+ *
100
+ * xrpl.js's `validateConfidentialMPTClawback` (lines 53–57) enforces
101
+ * this via its `isMPTIssuer(account, mptIssuanceID)` helper, which
102
+ * calls `decodeAccountID` (base58 + double-SHA-256 checksum decoding of
103
+ * the classic address) and compares the resulting 20-byte AccountID
104
+ * against `mptIssuanceID.slice(8)` (the 40-hex-char issuer portion
105
+ * after the 8-hex-char sequence prefix).
106
+ *
107
+ * This factory cannot add this guard because the package is
108
+ * **zero-dependency** — base58 + checksum decoding would require
109
+ * either inlining a ~50-line codec or pulling in
110
+ * `ripple-address-codec`, neither of which fits the scope of a
111
+ * single-tx factory. The class API also skips this guard (it relies on
112
+ * `super.validate()` which does not perform the issuer check), so this
113
+ * is not a coverage regression relative to the class — but it remains
114
+ * a documented gap that consumers must validate at the integration
115
+ * layer (e.g. via the ledger submission result).
116
+ * - Source: XLS-0096 §12.4.1.2 Failure Conditions (Data Verification),
117
+ * item 2: `temMALFORMED` when `Account` is not the issuer.
118
+ * - Source: xrpl-dev-portal `confidentialmptclawback.md` Error Cases
119
+ * table, `temMALFORMED` row.
120
+ * - Source: xrpl.js `ConfidentialMPTClawback.ts` lines 53–57
121
+ * (`isMPTIssuer` guard) and `common.ts` lines 632–646
122
+ * (`isMPTIssuer` implementation, including the base58 + AccountID
123
+ * decoding dependency).
124
+ */
125
+ import { isAccount, isHex, isString } from '../../validation/helpers.js';
126
+ import { ValidationError } from '../../errors.js';
127
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
128
+ // ─── Spec constants ──────────────────────────────────────────────────
129
+ // `MPTokenIssuanceID` is a `UINT192`, hex-encoded to exactly 48 chars
130
+ // (192 / 8 = 24 bytes = 48 hex chars). XLS-0096 §12.2; xrpl-dev-portal
131
+ // `confidentialmptclawback.md` Fields table.
132
+ const MPT_ISSUANCE_ID_HEX_LENGTH = 48;
133
+ // ZKProof is a 64-byte blob, hex-encoded to 128 chars
134
+ // (XLS-0096 §12.2: `BLOB`; xrpl.js `CONFIDENTIAL_CLAWBACK_PROOF_BYTES = 64`).
135
+ const ZK_PROOF_HEX_LENGTH = 128;
136
+ // `MPTAmount` is a `UINT64` per XLS-0096 §12.2. The maximum is 2^63 − 1
137
+ // (signed integer range), matching xrpl.js's `MAX_MPT_AMOUNT`. Integer
138
+ // form is required (no decimals, no leading sign) per xrpl.js
139
+ // `INTEGER_SANITY_CHECK = /^[0-9]+$/u`.
140
+ const MAX_MPT_AMOUNT = BigInt('9223372036854775807');
141
+ const INTEGER_SANITY_CHECK = /^[0-9]+$/u;
142
+ // ─── Factory ─────────────────────────────────────────────────────────
143
+ export function confidentialMptClawback(props) {
144
+ // ── Account ── required, must be a valid XRPL classic/X-address.
145
+ require(props.Account, 'ConfidentialMPTClawback: Account is required', isAccount);
146
+ // ── Holder ── required, must be a valid XRPL classic/X-address.
147
+ require(props.Holder, 'ConfidentialMPTClawback: Holder is required', isAccount);
148
+ // ── MPTokenIssuanceID ── required, exactly 48-char hex (UINT192).
149
+ if (!isString(props.MPTokenIssuanceID) ||
150
+ !isHex(props.MPTokenIssuanceID) ||
151
+ props.MPTokenIssuanceID.length !== MPT_ISSUANCE_ID_HEX_LENGTH) {
152
+ throw new ValidationError(`ConfidentialMPTClawback: MPTokenIssuanceID must be a ${MPT_ISSUANCE_ID_HEX_LENGTH}-character hex string (UInt192)`);
153
+ }
154
+ // ── MPTAmount ── required, non-empty integer string, in [1, 2^63-1].
155
+ if (!isString(props.MPTAmount)) {
156
+ throw new ValidationError('ConfidentialMPTClawback: MPTAmount is required');
157
+ }
158
+ if (!INTEGER_SANITY_CHECK.test(props.MPTAmount)) {
159
+ throw new ValidationError('ConfidentialMPTClawback: MPTAmount must be a non-negative base-10 integer string');
160
+ }
161
+ const amount = BigInt(props.MPTAmount);
162
+ if (amount === BigInt(0)) {
163
+ throw new ValidationError('ConfidentialMPTClawback: MPTAmount must be non-zero');
164
+ }
165
+ if (amount > MAX_MPT_AMOUNT) {
166
+ throw new ValidationError(`ConfidentialMPTClawback: MPTAmount out of range (max ${MAX_MPT_AMOUNT.toString()})`);
167
+ }
168
+ // ── ZKProof ── required, exactly 128-char hex (64 bytes).
169
+ if (!isString(props.ZKProof) || !isHex(props.ZKProof) || props.ZKProof.length !== ZK_PROOF_HEX_LENGTH) {
170
+ throw new ValidationError(`ConfidentialMPTClawback: ZKProof must be a ${ZK_PROOF_HEX_LENGTH}-character hex string (64 bytes)`);
171
+ }
172
+ // ── Account != Holder ── issuer cannot claw back from itself
173
+ // (XLS-0096 §12.4.1.3). The class API skips this guard.
174
+ if (props.Account === props.Holder) {
175
+ throw new ValidationError('ConfidentialMPTClawback: Holder and Account must be different');
176
+ }
177
+ // NOTE: `Account` must be the issuer of `MPTokenIssuanceID`
178
+ // (XLS-0096 §12.4.1.2 / xrpl.js `isMPTIssuer` guard). Not enforced
179
+ // here — see `## Divergences` header for why.
180
+ return buildFrozenTx('ConfidentialMPTClawback', props, {
181
+ validate() {
182
+ // Validated at construction.
183
+ },
184
+ toJSON() {
185
+ const json = {};
186
+ for (const k of Object.keys(this)) {
187
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
188
+ continue;
189
+ const v = this[k];
190
+ if (v !== undefined)
191
+ json[k] = v;
192
+ }
193
+ return json;
194
+ },
195
+ with(overrides) {
196
+ return confidentialMptClawback(mergeForWith(this, overrides));
197
+ },
198
+ });
199
+ }
200
+ //# sourceMappingURL=confidential-mpt-clawback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confidential-mpt-clawback.js","sourceRoot":"","sources":["../../../src/fp/factories/confidential-mpt-clawback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;gBAC1D,IAAI,CAAC,KAAK,SAAS;oBAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAEF,SAAgD;YAEhD,OAAO,uBAAuB,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAChE,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ export interface ConfidentialMptConvertBackProps {
2
+ /** The account performing the conversion. Must be a valid XRPL classic/X-address. */
3
+ Account: string;
4
+ /** UInt192 — MPT issuance identifier (48-char hex). */
5
+ MPTokenIssuanceID: string;
6
+ /** UInt64 — plaintext amount to credit to the public balance (base-10 integer string, in [1, 2⁶³−1]). */
7
+ MPTAmount: string;
8
+ /** 66-byte ElGamal ciphertext to subtract from the holder's spending balance (132 hex chars). */
9
+ HolderEncryptedAmount: string;
10
+ /** 66-byte ElGamal ciphertext to subtract from the issuer's mirror balance (132 hex chars). */
11
+ IssuerEncryptedAmount: string;
12
+ /** UInt256 — 32-byte scalar blinding factor (64 hex chars). */
13
+ BlindingFactor: string;
14
+ /** 33-byte Pedersen commitment to the holder's spending balance (66 hex chars). */
15
+ BalanceCommitment: string;
16
+ /** 816-byte proof bundle (compact sigma + single Bulletproof range proof, 1632 hex chars). */
17
+ ZKProof: string;
18
+ /** 66-byte ElGamal ciphertext for the auditor (132 hex chars). Required iff issuance has AuditorEncryptionKey. */
19
+ AuditorEncryptedAmount?: string | undefined;
20
+ /** Fee in XRP (drops), base-10 integer string. */
21
+ Fee?: string | undefined;
22
+ /** Account sequence number. */
23
+ Sequence?: number | undefined;
24
+ }
25
+ export interface ConfidentialMptConvertBack extends Readonly<ConfidentialMptConvertBackProps> {
26
+ readonly TransactionType: 'ConfidentialMPTConvertBack';
27
+ validate(): void;
28
+ toJSON(): Record<string, unknown>;
29
+ with(overrides: Partial<ConfidentialMptConvertBackProps>): ConfidentialMptConvertBack;
30
+ }
31
+ export declare function confidentialMptConvertBack(props: ConfidentialMptConvertBackProps): ConfidentialMptConvertBack;
32
+ //# sourceMappingURL=confidential-mpt-convert-back.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confidential-mpt-convert-back.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/confidential-mpt-convert-back.ts"],"names":[],"mappings":"AAqJA,MAAM,WAAW,+BAA+B;IAC9C,qFAAqF;IACrF,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yGAAyG;IACzG,SAAS,EAAE,MAAM,CAAC;IAClB,iGAAiG;IACjG,qBAAqB,EAAE,MAAM,CAAC;IAC9B,+FAA+F;IAC/F,qBAAqB,EAAE,MAAM,CAAC;IAC9B,+DAA+D;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,mFAAmF;IACnF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,8FAA8F;IAC9F,OAAO,EAAE,MAAM,CAAC;IAChB,kHAAkH;IAClH,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,0BACf,SAAQ,QAAQ,CAAC,+BAA+B,CAAC;IACjD,QAAQ,CAAC,eAAe,EAAE,4BAA4B,CAAC;IACvD,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CACF,SAAS,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAClD,0BAA0B,CAAC;CAC/B;AAkBD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,GACrC,0BAA0B,CA6G5B"}