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,119 @@
1
+ /**
2
+ * Functional CheckCancel factory — frozen-object style.
3
+ *
4
+ * Cancels an unredeemed Check, removing it from the ledger without
5
+ * sending any money. The source or the destination of the Check can
6
+ * cancel it at any time; once expired, any address can cancel it.
7
+ * Validation happens at construction; there is no way to construct
8
+ * an invalid tx.
9
+ *
10
+ * import { checkCancel } from 'xrplt/fp';
11
+ * const tx = checkCancel({ Account, CheckID });
12
+ * const j = tx.toJSON();
13
+ *
14
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/checkcancel
15
+ * @see https://github.com/XRPLF/xrpl.js/blob/main/packages/xrpl/src/models/transactions/CheckCancel.ts
16
+ *
17
+ * Affected amendments:
18
+ * - `Checks` — base CheckCancel.
19
+ * - `fixCleanup3_3_0` — moves the all-zeros CheckID rejection from
20
+ * `tecNO_ENTRY` (a post-ledger lookup failure)
21
+ * to `temMALFORMED` (a preclaim rejection).
22
+ * The factory enforces this preclaim form.
23
+ *
24
+ * ## Divergences
25
+ *
26
+ * Compared with `src/transactions/check-cancel.ts`, this factory adds
27
+ * two preclaim guards the class skips (or that xrpl.js / xrpl.org
28
+ * mandate but the class omits):
29
+ *
30
+ * - **`CheckID` must be a 64-character hexadecimal string (UInt256).**
31
+ * xrpl.org `checkcancel.md` line 34 explicitly states
32
+ * "`CheckID` | String | UInt256 … as a 64-character hexadecimal
33
+ * string." A UInt256 in hex is exactly 64 characters. xrpl.js's
34
+ * `validateCheckCancel` (lines 31–33) only checks
35
+ * `typeof tx.CheckID !== 'string'`, accepting any non-string value
36
+ * and any string of any length. The class inherits the same laxness
37
+ * (`isString(this.CheckID)`). The factory enforces 64-char hex.
38
+ * - Source: xrpl.org `checkcancel.md` line 34 (`UInt256`,
39
+ * "64-character hexadecimal string").
40
+ * - Source: xrpl.js `CheckCancel.ts` lines 31–33 (lax `typeof`
41
+ * check; no length or hex validation).
42
+ * - Cross-ref: rippled parses `CheckID` as `uint256` in
43
+ * `CheckCancel.cpp`; uint256 is 32 bytes = 64 hex chars.
44
+ *
45
+ * - **All-zeros `CheckID` is rejected (`fixCleanup3_3_0` amendment).**
46
+ * xrpl.org `checkcancel.md` Error Cases line 38 states: "If the
47
+ * `CheckID` is an all-zero value, the transaction fails with the
48
+ * result `temMALFORMED`. Previously, the transaction would fail
49
+ * with the result `tecNO_ENTRY`." This is a preclaim (malformed)
50
+ * failure, not a post-ledger lookup failure — the factory catches
51
+ * it at construction. The class does not guard against this case at
52
+ * all (any 64-char hex passes `isString`).
53
+ * - Source: xrpl.org `checkcancel.md` line 38 (`temMALFORMED` for
54
+ * all-zero CheckID; `fixCleanup3_3_0`).
55
+ * - Source: rippled `CheckCancel.cpp` `preflight` (gates the
56
+ * zero-check on the `fixCleanup3_3_0` amendment; preclaim
57
+ * rejection).
58
+ * - Cross-ref: same HASH256 zero-rejection pattern is used by
59
+ * `check-cash.ts`, `nftoken-burn.ts`, `nftoken-modify.ts` for
60
+ * their respective IDs.
61
+ *
62
+ * - **`Flags` accepted for parity with the base transaction shape.**
63
+ * CheckCancel itself defines no transaction-specific flags; only
64
+ * `tfFullyCanonicalSig` (global) is normally meaningful. The class
65
+ * does not declare a `Flags` field at all. We accept a numeric
66
+ * bitmask for parity with `check-cash.ts` and `nftoken-burn.ts`.
67
+ * This is a permissive addition, not a tightening — callers who
68
+ * pass a non-zero Flags get the value stored verbatim.
69
+ */
70
+ import { isAccount, isHex, isString } from '../../validation/helpers.js';
71
+ import { ValidationError } from '../../errors.js';
72
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
73
+ // ─── Spec constants ──────────────────────────────────────────────────
74
+ // UInt256 hex length: 32 bytes = 64 hex chars.
75
+ // (xrpl.org checkcancel.md line 34: "as a 64-character hexadecimal
76
+ // string".)
77
+ const CHECK_ID_HEX_LENGTH = 64;
78
+ // All-zeros HASH256 is reserved / malformed per `fixCleanup3_3_0`.
79
+ // (xrpl.org checkcancel.md line 38: temMALFORMED for the zero
80
+ // CheckID.)
81
+ const CHECK_ID_ZERO = '0000000000000000000000000000000000000000000000000000000000000000';
82
+ // ─── Factory ─────────────────────────────────────────────────────────
83
+ export function checkCancel(props) {
84
+ // ── Account ── required, must be a valid XRPL classic or X-address.
85
+ require(props.Account, 'CheckCancel: Account is required', isAccount);
86
+ // ── CheckID ── required, 64-char hex (UInt256) AND non-zero.
87
+ if (!isString(props.CheckID)) {
88
+ throw new ValidationError('CheckCancel: CheckID is required and must be a string');
89
+ }
90
+ if (!isHex(props.CheckID)) {
91
+ throw new ValidationError('CheckCancel: CheckID must be a hex-encoded string');
92
+ }
93
+ if (props.CheckID.length !== CHECK_ID_HEX_LENGTH) {
94
+ throw new ValidationError(`CheckCancel: CheckID must be exactly ${CHECK_ID_HEX_LENGTH} hex characters (UInt256)`);
95
+ }
96
+ if (props.CheckID === CHECK_ID_ZERO) {
97
+ throw new ValidationError('CheckCancel: CheckID must not be the all-zeros HASH256 value (xrpl.org fixCleanup3_3_0: temMALFORMED)');
98
+ }
99
+ return buildFrozenTx('CheckCancel', props, {
100
+ validate() {
101
+ // Validated at construction.
102
+ },
103
+ toJSON() {
104
+ const json = {};
105
+ for (const k of Object.keys(this)) {
106
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
107
+ continue;
108
+ const v = this[k];
109
+ if (v !== undefined)
110
+ json[k] = v;
111
+ }
112
+ return json;
113
+ },
114
+ with(overrides) {
115
+ return checkCancel(mergeForWith(this, overrides));
116
+ },
117
+ });
118
+ }
119
+ //# sourceMappingURL=check-cancel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-cancel.js","sourceRoot":"","sources":["../../../src/fp/factories/check-cancel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEnE,wEAAwE;AAExE,+CAA+C;AAC/C,mEAAmE;A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AAC,GAAG,CAAC,CAAC;YACnC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAAoB,SAAoC;YAC1D,OAAO,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QACpD,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Functional CheckCash factory — frozen-object style.
3
+ *
4
+ * Cashes an existing Check that was created by `checkCreate`. Validation
5
+ * happens at construction; there is no way to construct an invalid tx.
6
+ *
7
+ * import { checkCash } from 'xrplt/fp';
8
+ * const tx = checkCash({ Account, CheckID, Amount: '100000000' });
9
+ * const j = tx.toJSON();
10
+ * const tx2 = tx.with({ Amount: '200000000' });
11
+ *
12
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/checkcash
13
+ *
14
+ * ## Divergences
15
+ *
16
+ * Compared with `src/transactions/check-cash.ts`, this factory enforces
17
+ * five preclaim guards that the class API omits. The class only checks
18
+ * that `CheckID` is a string, that `Amount`/`DeliverMin` are not both
19
+ * present, and that at least one is present — it does no shape, range,
20
+ * semantic-equivalence, or zero-check on those fields.
21
+ *
22
+ * 1. **`CheckID` must be a 64-character hex string (UInt256).**
23
+ * Source: xrpl.org `checkcash.md` field table — `CheckID | String |
24
+ * UInt256`. xrpl.js `validateCheckCash` accepts any string for
25
+ * `CheckID` (`packages/xrpl/src/models/transactions/checkCash.ts:69`
26
+ * `typeof tx.CheckID !== 'string'`). The class only calls
27
+ * `isString(this.CheckID)`.
28
+ *
29
+ * 2. **`CheckID` must not be the all-zeros HASH256.**
30
+ * Source: xrpl.org `checkcash.md` Error Cases — "If the `CheckID`
31
+ * is an all-zero value, the transaction fails with the result
32
+ * `temMALFORMED`. Previously, the transaction would fail with the
33
+ * result `tecNO_ENTRY`." (Amended by `fixCleanup3_3_0`.) The class
34
+ * does not reject the zero CheckID; xrpl.js only checks it is a
35
+ * string. The runtime check has moved from `tecNO_ENTRY` to
36
+ * `temMALFORMED` (preclaim) — a guard the factory must enforce.
37
+ *
38
+ * 3. **`Amount` must be a valid `Amount` shape (XRP drops string,
39
+ * `IssuedCurrencyAmount`, or `MPTAmount`).**
40
+ * Source: xrpl.js `validateCheckCash` (lines 56–58) calls
41
+ * `isAmount(tx.Amount)`; xrpl.org `checkcash.md` field table —
42
+ * `Amount | Currency Amount | Amount`. The class only enforces
43
+ * presence ("must have either Amount or DeliverMin") and never
44
+ * checks the shape of `Amount` when present — a malformed `Amount`
45
+ * would slip through `src/transactions/check-cash.ts:42–48`.
46
+ *
47
+ * 4. **`Amount` must be strictly positive (non-zero, non-negative).**
48
+ * Source: xrpl.org `tem-codes.md` — `temBAD_AMOUNT` — "An amount
49
+ * specified by the transaction … was invalid, possibly because it
50
+ * was a negative number." xrpl.js does NOT check the sign of
51
+ * `Amount` or `DeliverMin`; the class inherits that gap.
52
+ *
53
+ * 5. **`DeliverMin` must be a valid `Amount` shape AND strictly
54
+ * positive.** Same sources as items 3 and 4.
55
+ */
56
+ import type { Amount, MPTAmount } from '../../types/amounts.js';
57
+ export interface CheckCashProps {
58
+ /** The unique address of the transaction sender (the Check cashier). */
59
+ Account: string;
60
+ /** The ID of the Check ledger object to cash (UInt256, 64-char hex). */
61
+ CheckID: string;
62
+ /**
63
+ * Redeem the Check for exactly this amount, if possible. Must be a valid
64
+ * `Amount` and strictly positive. Required XOR `DeliverMin`.
65
+ */
66
+ Amount?: Amount | MPTAmount | undefined;
67
+ /**
68
+ * Redeem the Check for at least this amount and as much as possible.
69
+ * Must be a valid `Amount` and strictly positive. Required XOR `Amount`.
70
+ */
71
+ DeliverMin?: Amount | MPTAmount | undefined;
72
+ /** Bit-flags for this transaction. CheckCash has no defined flags. */
73
+ Flags?: number | undefined;
74
+ Fee?: string | undefined;
75
+ Sequence?: number | undefined;
76
+ }
77
+ export interface CheckCash extends Readonly<CheckCashProps> {
78
+ readonly TransactionType: 'CheckCash';
79
+ validate(): void;
80
+ toJSON(): Record<string, unknown>;
81
+ with(overrides: Partial<CheckCashProps>): CheckCash;
82
+ }
83
+ export declare function checkCash(props: CheckCashProps): CheckCash;
84
+ //# sourceMappingURL=check-cash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-cash.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/check-cash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAkBhE,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IACxC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAC5C,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,SAAU,SAAQ,QAAQ,CAAC,cAAc,CAAC;IACzD,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC;IACtC,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CACrD;AA4BD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAmF1D"}
@@ -0,0 +1,95 @@
1
+ import { isAccount, isAmount, isHex, isString } from '../../validation/helpers.js';
2
+ import { ValidationError } from '../../errors.js';
3
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
4
+ // ─── Spec constants ──────────────────────────────────────────────────
5
+ // UInt256 hex length: 32 bytes = 64 hex chars.
6
+ // (xrpl.org `checkcash.md` field table: CheckID | String | UInt256.)
7
+ const CHECK_ID_HEX_LENGTH = 64;
8
+ // All-zeros HASH256 is reserved / malformed per `fixCleanup3_3_0`.
9
+ // (xrpl.org `checkcash.md` Error Cases: temMALFORMED for the zero CheckID.)
10
+ const CHECK_ID_ZERO = '0000000000000000000000000000000000000000000000000000000000000000';
11
+ // ─── Helpers ─────────────────────────────────────────────────────────
12
+ /**
13
+ * Per xrpl.org `tem-codes.md` `temBAD_AMOUNT`: Amount or DeliverMin that
14
+ * is zero or negative is rejected. Validates the sign of an Amount in
15
+ * all three accepted forms (XRP drops string, `IssuedCurrencyAmount`,
16
+ * `MPTAmount`).
17
+ */
18
+ function isPositiveAmount(amount) {
19
+ if (typeof amount === 'string') {
20
+ if (!/^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u.test(amount)) {
21
+ return false;
22
+ }
23
+ return parseFloat(amount) > 0;
24
+ }
25
+ if (typeof amount !== 'object' || amount === null)
26
+ return false;
27
+ const value = amount.value;
28
+ if (typeof value !== 'string')
29
+ return false;
30
+ if (!/^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u.test(value)) {
31
+ return false;
32
+ }
33
+ return parseFloat(value) > 0;
34
+ }
35
+ // ─── Factory ─────────────────────────────────────────────────────────
36
+ export function checkCash(props) {
37
+ // ── Account ── required, must be a valid XRPL classic/X-address.
38
+ require(props.Account, 'CheckCash: missing or invalid Account', isAccount);
39
+ // ── CheckID ── required, 64-char hex (UInt256) AND non-zero.
40
+ if (!isString(props.CheckID) ||
41
+ !isHex(props.CheckID) ||
42
+ props.CheckID.length !== CHECK_ID_HEX_LENGTH) {
43
+ throw new ValidationError(`CheckCash: CheckID must be a ${CHECK_ID_HEX_LENGTH}-character hex string (UInt256)`);
44
+ }
45
+ if (props.CheckID === CHECK_ID_ZERO) {
46
+ throw new ValidationError('CheckCash: CheckID must not be the all-zeros HASH256 value (xrpl.org fixCleanup3_3_0: temMALFORMED)');
47
+ }
48
+ // ── Amount / DeliverMin ── exactly one of the two is required.
49
+ const hasAmount = props.Amount !== undefined;
50
+ const hasDeliverMin = props.DeliverMin !== undefined;
51
+ if (hasAmount && hasDeliverMin) {
52
+ throw new ValidationError('CheckCash: cannot have both Amount and DeliverMin');
53
+ }
54
+ if (!hasAmount && !hasDeliverMin) {
55
+ throw new ValidationError('CheckCash: must have either Amount or DeliverMin');
56
+ }
57
+ // ── Amount ── shape check + positivity.
58
+ if (hasAmount) {
59
+ if (!isAmount(props.Amount)) {
60
+ throw new ValidationError('CheckCash: Amount must be a valid Amount (XRP drops / IssuedCurrencyAmount / MPTAmount)');
61
+ }
62
+ if (!isPositiveAmount(props.Amount)) {
63
+ throw new ValidationError('CheckCash: Amount must be strictly positive (non-zero, non-negative)');
64
+ }
65
+ }
66
+ // ── DeliverMin ── shape check + positivity (mirrors Amount).
67
+ if (hasDeliverMin) {
68
+ if (!isAmount(props.DeliverMin)) {
69
+ throw new ValidationError('CheckCash: DeliverMin must be a valid Amount (XRP drops / IssuedCurrencyAmount / MPTAmount)');
70
+ }
71
+ if (!isPositiveAmount(props.DeliverMin)) {
72
+ throw new ValidationError('CheckCash: DeliverMin must be strictly positive (non-zero, non-negative)');
73
+ }
74
+ }
75
+ return buildFrozenTx('CheckCash', props, {
76
+ validate() {
77
+ // Validated at construction.
78
+ },
79
+ toJSON() {
80
+ const json = {};
81
+ for (const k of Object.keys(this)) {
82
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
83
+ continue;
84
+ const v = this[k];
85
+ if (v !== undefined)
86
+ json[k] = v;
87
+ }
88
+ return json;
89
+ },
90
+ with(overrides) {
91
+ return checkCash(mergeForWith(this, overrides));
92
+ },
93
+ });
94
+ }
95
+ //# sourceMappingURL=check-cash.js.map
@@ -0,0 +1 @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ACD,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,eAAe,CACvB,0EAA0E,CAC3E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAClB,WAAW,EACX,KAAK,EACL;QACE,QAAQ;YACN,6BAA6B;QAC/B,CAAC;QACD,MAAM;YACJ,MAAM,IAAI,GAA4B,EAAE,CAAC;YACzC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClC,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,MAAM;oBAAE,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,CAAkB,SAAkC;YACtD,OAAO,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAClD,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Functional CheckCreate factory — frozen-object style.
3
+ *
4
+ * Creates an on-ledger Check that can be cashed by `Destination` for up to
5
+ * `SendMax` of the source currency. Validation happens at construction;
6
+ * there is no way to construct an invalid tx.
7
+ *
8
+ * import { checkCreate } from 'xrplt/fp';
9
+ * const tx = checkCreate({ Account, Destination, SendMax });
10
+ * const j = tx.toJSON();
11
+ * const tx2 = tx.with({ Expiration: 570113521 });
12
+ *
13
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/checkcreate
14
+ *
15
+ * ## Divergences
16
+ * The factory enforces five preclaim guards that the class API
17
+ * (`src/transactions/check-create.ts`) skips. The class only checks
18
+ * type — it does not check ranges, semantic equivalence, or self-send.
19
+ *
20
+ * 1. `Destination` must not equal `Account` (self-send is rejected).
21
+ * Source: xrpl.org `checkcreate.md` Error Cases — `temREDUNDANT`
22
+ * "The Destination is the sender of the transaction". The class
23
+ * only checks `isAccount(this.Destination)` and accepts the
24
+ * sender's own address. (Cross-referenced: `temDST_IS_SRC` in
25
+ * `tem-codes.md` — "The transaction improperly specified a
26
+ * destination address as the Account sending the transaction".)
27
+ *
28
+ * 2. `SendMax` must be strictly positive in all three Amount forms
29
+ * (XRP drops string, `IssuedCurrencyAmount.value`,
30
+ * `MPTAmount.value`).
31
+ * Source: xrpl.org `tem-codes.md` — `temBAD_AMOUNT` — "An amount
32
+ * specified by the transaction (for example the destination Amount
33
+ * or SendMax values of a Payment) was invalid, possibly because it
34
+ * was a negative number." xrpl.js `validateCheckCreate` accepts any
35
+ * string Amount or any `IssuedCurrencyAmount` and never checks the
36
+ * sign of the `value` sub-field; the class inherits that gap.
37
+ *
38
+ * 3. `DestinationTag` must be a non-negative UInt32
39
+ * (0 ≤ value ≤ 0xFFFFFFFF), not just any number.
40
+ * Source: xrpl.org `checkcreate.md` field table — `DestinationTag |
41
+ * Number | UInt32`. xrpl.js `validateOptionalField(tx,
42
+ * 'DestinationTag', isNumber)` accepts negatives and non-integers;
43
+ * the class uses `isNumber` too.
44
+ *
45
+ * 4. `Expiration` must be a non-negative UInt32
46
+ * (0 ≤ value ≤ 0xFFFFFFFF), not just any number.
47
+ * Source: xrpl.org `checkcreate.md` field table — `Expiration |
48
+ * Number | UInt32`. xrpl.js `typeof tx.Expiration !== 'number'`
49
+ * accepts any number; the class uses `isNumber`.
50
+ *
51
+ * 5. `InvoiceID` must be a 64-character hex string (UInt256 = 32 bytes).
52
+ * Source: xrpl.org `checkcreate.md` field table — `InvoiceID |
53
+ * String | UInt256`. xrpl.js `typeof tx.InvoiceID !== 'string'`
54
+ * accepts any string; the class uses `isString`.
55
+ */
56
+ import type { Amount, MPTAmount } from '../../types/amounts.js';
57
+ export interface CheckCreateProps {
58
+ /** The unique address of the transaction sender (the Check writer). */
59
+ Account: string;
60
+ /** The account that may cash the Check. */
61
+ Destination: string;
62
+ /** Maximum source-currency amount the Check may debit the sender. */
63
+ SendMax: Amount | MPTAmount;
64
+ /** Arbitrary destination tag for the recipient (UInt32). */
65
+ DestinationTag?: number | undefined;
66
+ /** Expiration time in seconds since the Ripple Epoch (UInt32). */
67
+ Expiration?: number | undefined;
68
+ /** Arbitrary 256-bit hash identifying the purpose of this Check. */
69
+ InvoiceID?: string | undefined;
70
+ /** Bit-flags for this transaction. CheckCreate has no defined flags. */
71
+ Flags?: number | undefined;
72
+ Fee?: string | undefined;
73
+ Sequence?: number | undefined;
74
+ }
75
+ export interface CheckCreate extends Readonly<CheckCreateProps> {
76
+ readonly TransactionType: 'CheckCreate';
77
+ validate(): void;
78
+ toJSON(): Record<string, unknown>;
79
+ with(overrides: Partial<CheckCreateProps>): CheckCreate;
80
+ }
81
+ export declare function checkCreate(props: CheckCreateProps): CheckCreate;
82
+ //# sourceMappingURL=check-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-create.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/check-create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAehE,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,WAAY,SAAQ,QAAQ,CAAC,gBAAgB,CAAC;IAC7D,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC;IACxC,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC;CACzD;AA8BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CA2FhE"}
@@ -0,0 +1,101 @@
1
+ import { isAccount, isAmount, isHex, isNumber, isString } from '../../validation/helpers.js';
2
+ import { ValidationError } from '../../errors.js';
3
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
4
+ // ─── Spec constants ──────────────────────────────────────────────────
5
+ // UInt32 bounds (per xrpl.org `checkcreate.md` field table).
6
+ const UINT32_MIN = 0;
7
+ const UINT32_MAX = 0xffffffff;
8
+ // UInt256 hex length: 32 bytes = 64 hex chars.
9
+ const INVOICE_ID_LENGTH = 64;
10
+ // ─── Helpers ─────────────────────────────────────────────────────────
11
+ /**
12
+ * Per xrpl.org `tem-codes.md` `temBAD_AMOUNT`: SendMax that is zero or
13
+ * negative is rejected. Validates the sign of an Amount in all three
14
+ * accepted forms:
15
+ * - XRP drops — a decimal or scientific-mantissa string.
16
+ * - IssuedCurrency — object with a `value` sub-string.
17
+ * - MPT — object with a `value` sub-string.
18
+ */
19
+ function isPositiveAmount(amount) {
20
+ if (typeof amount === 'string') {
21
+ if (!/^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u.test(amount)) {
22
+ return false;
23
+ }
24
+ return parseFloat(amount) > 0;
25
+ }
26
+ if (typeof amount !== 'object' || amount === null)
27
+ return false;
28
+ const value = amount.value;
29
+ if (typeof value !== 'string')
30
+ return false;
31
+ if (!/^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u.test(value)) {
32
+ return false;
33
+ }
34
+ return parseFloat(value) > 0;
35
+ }
36
+ // ─── Factory ─────────────────────────────────────────────────────────
37
+ export function checkCreate(props) {
38
+ // ── Account ── required, must be a valid XRPL classic/X-address.
39
+ require(props.Account, 'CheckCreate: missing or invalid Account', isAccount);
40
+ // ── Destination ── required, must be a valid XRPL classic/X-address
41
+ // AND must not equal the sender (xrpl.org `temREDUNDANT`).
42
+ if (!isAccount(props.Destination)) {
43
+ throw new ValidationError('CheckCreate: missing or invalid Destination');
44
+ }
45
+ if (props.Destination === props.Account) {
46
+ throw new ValidationError('CheckCreate: Destination must not equal Account (sender cannot write a Check to themselves)');
47
+ }
48
+ // ── SendMax ── required, must be a valid Amount AND strictly positive.
49
+ if (!isAmount(props.SendMax)) {
50
+ throw new ValidationError('CheckCreate: missing or invalid SendMax');
51
+ }
52
+ if (!isPositiveAmount(props.SendMax)) {
53
+ throw new ValidationError('CheckCreate: SendMax must be strictly positive (non-zero, non-negative)');
54
+ }
55
+ // ── DestinationTag ── optional UInt32 (xrpl.org field table).
56
+ if (props.DestinationTag !== undefined) {
57
+ if (!isNumber(props.DestinationTag) ||
58
+ !Number.isInteger(props.DestinationTag) ||
59
+ props.DestinationTag < UINT32_MIN ||
60
+ props.DestinationTag > UINT32_MAX) {
61
+ throw new ValidationError(`CheckCreate: DestinationTag must be a UInt32 in [${UINT32_MIN}, ${UINT32_MAX}]`);
62
+ }
63
+ }
64
+ // ── Expiration ── optional UInt32 (xrpl.org field table).
65
+ if (props.Expiration !== undefined) {
66
+ if (!isNumber(props.Expiration) ||
67
+ !Number.isInteger(props.Expiration) ||
68
+ props.Expiration < UINT32_MIN ||
69
+ props.Expiration > UINT32_MAX) {
70
+ throw new ValidationError(`CheckCreate: Expiration must be a UInt32 in [${UINT32_MIN}, ${UINT32_MAX}] (seconds since the Ripple Epoch)`);
71
+ }
72
+ }
73
+ // ── InvoiceID ── optional 64-char hex (UInt256, xrpl.org field table).
74
+ if (props.InvoiceID !== undefined) {
75
+ if (!isString(props.InvoiceID) ||
76
+ !isHex(props.InvoiceID) ||
77
+ props.InvoiceID.length !== INVOICE_ID_LENGTH) {
78
+ throw new ValidationError(`CheckCreate: InvoiceID must be a ${INVOICE_ID_LENGTH}-character hex string (UInt256)`);
79
+ }
80
+ }
81
+ return buildFrozenTx('CheckCreate', props, {
82
+ validate() {
83
+ // Validated at construction.
84
+ },
85
+ toJSON() {
86
+ const json = {};
87
+ for (const k of Object.keys(this)) {
88
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
89
+ continue;
90
+ const v = this[k];
91
+ if (v !== undefined)
92
+ json[k] = v;
93
+ }
94
+ return json;
95
+ },
96
+ with(overrides) {
97
+ return checkCreate(mergeForWith(this, overrides));
98
+ },
99
+ });
100
+ }
101
+ //# sourceMappingURL=check-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-create.js","sourceRoot":"","sources":["../../../src/fp/factories/check-create.ts"],"names":[],"mappings":"AAwDA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEnE,wEAAwE;AAExE,6DAA6D;AAC7D,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,+CAA+C;AAC/C,MAAM,iBAAiB,GAAG,EAAE,CAAC;AA8B7B,wEAAwE;AAExE;;;;;;;GAOG;AACH,SAAS,gBAAgB,CAAC,MAA0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