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,172 @@
1
+ /**
2
+ * Functional PaymentChannelCreate factory — frozen-object style.
3
+ *
4
+ * Creates a unidirectional payment channel and funds it with XRP. The
5
+ * sender becomes the "source address" of the channel and the named
6
+ * Destination becomes the recipient that can claim against it.
7
+ *
8
+ * Validation happens at construction; there is no way to construct an
9
+ * invalid tx.
10
+ *
11
+ * import { paymentChannelCreate } from 'xrplt/fp';
12
+ * const tx = paymentChannelCreate({ Account, Amount, Destination, SettleDelay, PublicKey });
13
+ * const j = tx.toJSON();
14
+ * const tx2 = tx.with({ CancelAfter: 800000000 });
15
+ *
16
+ * Affected amendments:
17
+ * - `PayChan` (base PaymentChannelCreate)
18
+ * - `fixPayChanCancelAfter` (CancelAfter must be > parentCloseTime)
19
+ * - `DisallowIncoming` (Destination with lsfDisallowIncomingPayChan flag
20
+ * rejects the tx — runtime-only)
21
+ *
22
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/paymentchannelcreate
23
+ * @see https://github.com/XRPLF/rippled/blob/develop/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp
24
+ *
25
+ * ## Divergences
26
+ * The factory enforces five preclaim checks that the class API
27
+ * (`src/transactions/payment-channel-create.ts`) and/or `xrpl.js`
28
+ * (`validatePaymentChannelCreate`) skip:
29
+ *
30
+ * 1. `Amount` must be in XRP-drops form only (a decimal/integer string)
31
+ * AND strictly positive (> 0).
32
+ * Source: rippled PaymentChannelCreate.cpp `preflight` —
33
+ * `if (!isXRP(ctx.tx[sfAmount]) || (ctx.tx[sfAmount] <= beast::kZero)) return temBAD_AMOUNT;`
34
+ * xrpl.js `validatePaymentChannelCreate` only requires the field to
35
+ * be a string and `isAmount` (in `src/validation/helpers.ts`)
36
+ * accepts IOU/MPT object forms. The class API in this repo uses
37
+ * `isAmount`, which would also accept IOU/MPT — both diverge from
38
+ * the ledger's hard XRP-only constraint.
39
+ *
40
+ * 2. `Destination` must not equal `Account` (no self-channel).
41
+ * Source: rippled PaymentChannelCreate.cpp `preflight` —
42
+ * `if (ctx.tx[sfAccount] == ctx.tx[sfDestination]) return temDST_IS_SRC;`
43
+ * xrpl.js `validatePaymentChannelCreate` does not enforce this;
44
+ * the class API in this repo does not enforce it either.
45
+ *
46
+ * 3. `PublicKey` must be a non-empty hex string whose decoded length is
47
+ * 32 bytes (Ed25519) or 33 bytes (compressed secp256k1).
48
+ * Source: rippled PaymentChannelCreate.cpp `preflight` —
49
+ * `if (!publicKeyType(ctx.tx[sfPublicKey])) return temMALFORMED;`
50
+ * xrpl.js `validatePaymentChannelCreate` only requires the field to
51
+ * be a string; the class API in this repo also only requires a
52
+ * string.
53
+ *
54
+ * 4. `SettleDelay` must be a non-negative integer that fits in a
55
+ * UInt32 (`>= 0` and `<= 0xFFFFFFFF`).
56
+ * Source: xrpl.org docs (`/docs/references/protocol/transactions/types/paymentchannelcreate`)
57
+ * — "SettleDelay | Number | UInt32". xrpl.js only checks it is a
58
+ * number; the class API in this repo also only checks it is a
59
+ * number (no range guard). The factory rejects negative values,
60
+ * non-integers, and out-of-range values.
61
+ *
62
+ * 5. `CancelAfter`, if supplied, must be a non-negative integer that
63
+ * fits in a UInt32 (i.e. seconds-since-Ripple-Epoch).
64
+ * Source: xrpl.org docs — "CancelAfter | Number | UInt32". Same
65
+ * reasoning as (4); additionally the `fixPayChanCancelAfter`
66
+ * amendment requires it to be greater than parentCloseTime, but
67
+ * that requires live ledger state and is not locally checkable.
68
+ *
69
+ * Preclaim checks that require ledger state (NOT locally checkable):
70
+ * - Destination account must exist (`tecNO_DST`).
71
+ * - Destination must not block incoming payment channels
72
+ * (`lsfDisallowIncomingPayChan` -> `tecNO_PERMISSION`).
73
+ * - Destination must not be a pseudo-account (`tecNO_PERMISSION`).
74
+ * - Source account must have sufficient balance + reserve to fund
75
+ * the channel (`tecUNFUNDED` / `tecINSUFFICIENT_RESERVE`).
76
+ * - If destination has `lsfRequireDestTag`, `DestinationTag` is required
77
+ * (`tecDST_TAG_NEEDED`).
78
+ */
79
+ import { isAccount, isHex, isString } from '../../validation/helpers.js';
80
+ import { ValidationError } from '../../errors.js';
81
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
82
+ // ─── Spec constants ──────────────────────────────────────────────────
83
+ // UInt32 max (4-byte unsigned). SettleDelay / CancelAfter / DestinationTag
84
+ // are documented as UInt32 in the XRPL protocol.
85
+ const UINT32_MAX = 0xFFFFFFFF;
86
+ // A secp256k1 compressed public key is 33 bytes; an Ed25519 public key
87
+ // is 32 bytes. Both are accepted per rippled `publicKeyType()`.
88
+ const ALLOWED_PUBLIC_KEY_HEX_LENGTHS = [64, 66];
89
+ /**
90
+ * Strictly-positive XRP drops Amount.
91
+ *
92
+ * Accepts canonical XRP drops mantissa form (decimal or scientific)
93
+ * and rejects zero, negative, and non-numeric values. Used for
94
+ * PaymentChannelCreate, where Amount must be XRP-only and > 0.
95
+ */
96
+ function isXrpAmount(value) {
97
+ if (!isString(value))
98
+ return false;
99
+ if (!/^[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u.test(value)) {
100
+ return false;
101
+ }
102
+ const n = parseFloat(value);
103
+ return n > 0;
104
+ }
105
+ /**
106
+ * Validate a UInt32 (non-negative integer, <= 0xFFFFFFFF).
107
+ */
108
+ function isUInt32(value) {
109
+ return (typeof value === 'number' &&
110
+ Number.isInteger(value) &&
111
+ value >= 0 &&
112
+ value <= UINT32_MAX);
113
+ }
114
+ // ─── Factory ─────────────────────────────────────────────────────────
115
+ export function paymentChannelCreate(props) {
116
+ // ── Account ── required, must be a valid XRPL classic or X-address.
117
+ require(props.Account, 'PaymentChannelCreate: Account is required', isAccount);
118
+ // ── Destination ── required, must be a valid account AND must not
119
+ // equal Account (rippled `temDST_IS_SRC`).
120
+ require(props.Destination, 'PaymentChannelCreate: Destination is required', isAccount);
121
+ if (props.Destination === props.Account) {
122
+ throw new ValidationError('PaymentChannelCreate: Destination must not equal Account (temDST_IS_SRC)');
123
+ }
124
+ // ── Amount ── required, must be a strictly-positive XRP drops string.
125
+ // The ledger refuses IOU/MPT forms outright (temBAD_AMOUNT); both
126
+ // xrpl.js and the class API in this repo accept any string-or-Amount
127
+ // form, so this is a divergence.
128
+ if (!isXrpAmount(props.Amount)) {
129
+ throw new ValidationError('PaymentChannelCreate: Amount must be a strictly-positive XRP drops string (temBAD_AMOUNT)');
130
+ }
131
+ // ── SettleDelay ── required, UInt32 (non-negative integer in
132
+ // [0, 0xFFFFFFFF]).
133
+ if (!isUInt32(props.SettleDelay)) {
134
+ throw new ValidationError('PaymentChannelCreate: SettleDelay must be a non-negative integer in [0, 0xFFFFFFFF] (UInt32)');
135
+ }
136
+ // ── PublicKey ── required, hex string, 32 or 33 bytes.
137
+ if (!isString(props.PublicKey) || !isHex(props.PublicKey)) {
138
+ throw new ValidationError('PaymentChannelCreate: PublicKey must be a hex string');
139
+ }
140
+ if (!ALLOWED_PUBLIC_KEY_HEX_LENGTHS.includes(props.PublicKey.length)) {
141
+ throw new ValidationError(`PaymentChannelCreate: PublicKey hex must be 64 (Ed25519, 32 bytes) or 66 (secp256k1, 33 bytes) characters; got ${props.PublicKey.length} hex chars (temMALFORMED)`);
142
+ }
143
+ // ── CancelAfter ── optional UInt32.
144
+ if (props.CancelAfter !== undefined && !isUInt32(props.CancelAfter)) {
145
+ throw new ValidationError('PaymentChannelCreate: CancelAfter must be a non-negative integer in [0, 0xFFFFFFFF] (UInt32)');
146
+ }
147
+ // ── DestinationTag ── optional UInt32.
148
+ if (props.DestinationTag !== undefined &&
149
+ !isUInt32(props.DestinationTag)) {
150
+ throw new ValidationError('PaymentChannelCreate: DestinationTag must be a non-negative integer in [0, 0xFFFFFFFF] (UInt32)');
151
+ }
152
+ return buildFrozenTx('PaymentChannelCreate', props, {
153
+ validate() {
154
+ // Validated at construction.
155
+ },
156
+ toJSON() {
157
+ const json = {};
158
+ for (const k of Object.keys(this)) {
159
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
160
+ continue;
161
+ const v = this[k];
162
+ if (v !== undefined)
163
+ json[k] = v;
164
+ }
165
+ return json;
166
+ },
167
+ with(overrides) {
168
+ return paymentChannelCreate(mergeForWith(this, overrides));
169
+ },
170
+ });
171
+ }
172
+ //# sourceMappingURL=payment-channel-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-channel-create.js","sourceRoot":"","sources":["../../../src/fp/factories/payment-channel-create.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,25 @@
1
+ export interface PaymentChannelFundProps {
2
+ /** The unique address of the transaction sender (must be the channel source). */
3
+ Account: string;
4
+ /** Unique ID of the channel to fund, as a 64-character hex (UInt256). */
5
+ Channel: string;
6
+ /** Amount of XRP, in drops, to add to the channel. Must be > 0. */
7
+ Amount: string;
8
+ /**
9
+ * New mutable expiration time for the channel, in seconds since the
10
+ * Ripple Epoch (UInt32). Optional.
11
+ */
12
+ Expiration?: number | undefined;
13
+ /** Bit-flags for this transaction. PaymentChannelFund has no defined flags. */
14
+ Flags?: number | undefined;
15
+ Fee?: string | undefined;
16
+ Sequence?: number | undefined;
17
+ }
18
+ export interface PaymentChannelFund extends Readonly<PaymentChannelFundProps> {
19
+ readonly TransactionType: 'PaymentChannelFund';
20
+ validate(): void;
21
+ toJSON(): Record<string, unknown>;
22
+ with(overrides: Partial<PaymentChannelFundProps>): PaymentChannelFund;
23
+ }
24
+ export declare function paymentChannelFund(props: PaymentChannelFundProps): PaymentChannelFund;
25
+ //# sourceMappingURL=payment-channel-fund.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-channel-fund.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/payment-channel-fund.ts"],"names":[],"mappings":"AAoHA,MAAM,WAAW,uBAAuB;IACtC,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,+EAA+E;IAC/E,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,kBACf,SAAQ,QAAQ,CAAC,uBAAuB,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,oBAAoB,CAAC;IAC/C,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,kBAAkB,CAAC;CACvE;AAID,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAC7B,kBAAkB,CAyDpB"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Functional PaymentChannelFund factory — frozen-object style.
3
+ *
4
+ * Adds XRP to an existing payment channel and optionally updates its
5
+ * mutable `Expiration`. Only the channel's source account may submit
6
+ * this transaction (enforced at runtime by the ledger; the factory
7
+ * just verifies the field-level shape).
8
+ *
9
+ * Validation happens at construction; there is no way to construct an
10
+ * invalid tx.
11
+ *
12
+ * import { paymentChannelFund } from 'xrplt/fp';
13
+ * const tx = paymentChannelFund({ Account, Channel, Amount });
14
+ * const tx2 = tx.with({ Expiration: 543171558 });
15
+ * const j = tx.toJSON();
16
+ *
17
+ * Affected amendments:
18
+ * - `PayChan` (base PaymentChannelFund)
19
+ *
20
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/paymentchannelfund
21
+ * @see https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/paychannel
22
+ *
23
+ * ## Divergences
24
+ * The factory enforces three preflight guards that the class API
25
+ * (`src/transactions/payment-channel-fund.ts`) and/or `xrpl.js`
26
+ * (`validatePaymentChannelFund`) skip:
27
+ *
28
+ * 1. `Amount` must be an XRP-drops string (decimal/scientific mantissa)
29
+ * AND strictly positive (> 0). IOU / MPT object forms are rejected.
30
+ * Source: xrpl.org docs (`/docs/references/protocol/transactions/types/paymentchannelfund`)
31
+ * — "Amount of XRP, in drops, to add to the channel. Must be a positive
32
+ * amount of XRP." plus the `temBAD_AMOUNT` row — "The amount must
33
+ * either be XRP or fungible tokens and cannot be zero or negative."
34
+ * (The IOU/MPT path only activates if the XLS-34 `PaychanAndEscrowForTokens`
35
+ * amendment becomes enabled — currently only proposed, not active.)
36
+ * xrpl.js `validatePaymentChannelFund` only checks the field is a string;
37
+ * the class API in this repo uses `isAmount` (which accepts IOU/MPT object
38
+ * forms), so both diverge from the active ledger's XRP-only constraint.
39
+ *
40
+ * 2. `Channel` must be a 64-character hex string (UInt256).
41
+ * Source: xrpl.org docs — "Channel | String - Hexadecimal | UInt256 | Yes |
42
+ * The unique ID of the channel to fund." Also `account_channels` RPC:
43
+ * "channel_id ... as a 64-character hexadecimal string".
44
+ * xrpl.js `validatePaymentChannelFund` only checks it is a string; the
45
+ * class API in this repo also only checks it is a string. Both would
46
+ * accept malformed channel IDs that the ledger cannot resolve
47
+ * (`tecNO_ENTRY` at runtime).
48
+ *
49
+ * 3. `Expiration`, if supplied, must be a non-negative integer that fits
50
+ * in a UInt32 (`>= 0` and `<= 0xFFFFFFFF`).
51
+ * Source: xrpl.org docs — "Expiration | Number | UInt32 | No | New expiration
52
+ * time to set for the channel, in seconds since the Ripple Epoch."
53
+ * xrpl.js only checks `typeof === 'number'` (no range guard); the class
54
+ * API in this repo does not validate `Expiration` at all.
55
+ *
56
+ * Preclaim / runtime checks that require ledger state (NOT locally
57
+ * checkable):
58
+ * - The `Channel` must reference an existing PayChannel ledger entry
59
+ * (`tecNO_ENTRY`).
60
+ * - The sender (`Account`) must be the source address of that channel
61
+ * (`tecNO_PERMISSION`).
62
+ * - The source account must hold enough XRP to fund `Amount` plus the
63
+ * reserve (`tecUNSUFFICIENT_RESERVE` / `tecUNFUNDED`).
64
+ * - `Expiration` must not be earlier than `now + SettleDelay` nor earlier
65
+ * than the channel's current `Expiration` (`temBAD_EXPIRATION`).
66
+ * - Destination account deletion handling per `fixPayChanRecipientOwnerDir`
67
+ * (`tecNO_DST`) — only possible for channels created before that
68
+ * amendment.
69
+ */
70
+ import { isAccount, isLedgerEntryId, isString, } from '../../validation/helpers.js';
71
+ import { ValidationError } from '../../errors.js';
72
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
73
+ // ─── Spec constants ──────────────────────────────────────────────────
74
+ // UInt32 max (4-byte unsigned). Expiration is documented as UInt32 in the
75
+ // XRPL protocol (seconds since Ripple Epoch).
76
+ const UINT32_MAX = 0xFFFFFFFF;
77
+ // ─── Helpers (local — mirrors payment-channel-create.ts) ─────────────
78
+ /**
79
+ * Strictly-positive XRP drops Amount.
80
+ *
81
+ * Accepts canonical XRP drops mantissa form (decimal or scientific) and
82
+ * rejects zero, negative, non-numeric, and non-string (IOU/MPT object)
83
+ * values. Used for PaymentChannelFund, where Amount must be XRP-only
84
+ * and > 0.
85
+ */
86
+ function isXrpAmount(value) {
87
+ if (!isString(value))
88
+ return false;
89
+ if (!/^[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/u.test(value)) {
90
+ return false;
91
+ }
92
+ const n = parseFloat(value);
93
+ return n > 0;
94
+ }
95
+ /**
96
+ * Validate a UInt32 (non-negative integer, <= 0xFFFFFFFF).
97
+ */
98
+ function isUInt32(value) {
99
+ return (typeof value === 'number' &&
100
+ Number.isInteger(value) &&
101
+ value >= 0 &&
102
+ value <= UINT32_MAX);
103
+ }
104
+ // ─── Factory ─────────────────────────────────────────────────────────
105
+ export function paymentChannelFund(props) {
106
+ // ── Account ── required, must be a valid XRPL classic or X-address.
107
+ require(props.Account, 'PaymentChannelFund: Account is required', isAccount);
108
+ // ── Channel ── required, 64-char hex (UInt256).
109
+ require(props.Channel, 'PaymentChannelFund: Channel is required', isLedgerEntryId);
110
+ // ── Amount ── required, must be a strictly-positive XRP drops string.
111
+ // The active ledger refuses IOU/MPT forms; the XLS-34
112
+ // `PaychanAndEscrowForTokens` amendment that would enable IOU/MPT
113
+ // funding is only proposed, not active. xrpl.js and the class API
114
+ // both diverge from this hard XRP-only constraint.
115
+ if (!isXrpAmount(props.Amount)) {
116
+ throw new ValidationError('PaymentChannelFund: Amount must be a strictly-positive XRP drops string (temBAD_AMOUNT)');
117
+ }
118
+ // ── Expiration ── optional UInt32.
119
+ if (props.Expiration !== undefined && !isUInt32(props.Expiration)) {
120
+ throw new ValidationError('PaymentChannelFund: Expiration must be a non-negative integer in [0, 0xFFFFFFFF] (UInt32)');
121
+ }
122
+ return buildFrozenTx('PaymentChannelFund', props, {
123
+ validate() {
124
+ // Validated at construction.
125
+ },
126
+ toJSON() {
127
+ const json = {};
128
+ for (const k of Object.keys(this)) {
129
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
130
+ continue;
131
+ const v = this[k];
132
+ if (v !== undefined)
133
+ json[k] = v;
134
+ }
135
+ return json;
136
+ },
137
+ with(overrides) {
138
+ return paymentChannelFund(mergeForWith(this, overrides));
139
+ },
140
+ });
141
+ }
142
+ //# sourceMappingURL=payment-channel-fund.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-channel-fund.js","sourceRoot":"","sources":["../../../src/fp/factories/payment-channel-fund.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,OAAO,EACL,SAAS,EACT,eAAe,EACf,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,0EAA0E;AAC1E,8CAA8C;AAC9C,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B,wEAAwE;AAExE;;;;;;;GAOG;AACH,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,CAAC,4CAA4C,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;QACvB,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,UAAU,CACpB,CAAC;AACJ,CAAC;AA8BD,wEAAwE;AAExE,MAAM,UAAU,kBAAkB,CAChC,KAA8B;IAE9B,qEAAqE;IACrE,OAAO,CACL,KAAK,CAAC,OAAO,EACb,yCAAyC,EACzC,SAAS,CACV,CAAC;IAEF,iDAAiD;IACjD,OAAO,CACL,KAAK,CAAC,OAAO,EACb,yCAAyC,EACzC,eAAe,CAChB,CAAC;IAEF,uEAAuE;IACvE,yDAAyD;IACzD,qEAAqE;IACrE,qEAAqE;IACrE,sDAAsD;IACtD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,eAAe,CACvB,yFAAyF,CAC1F,CAAC;IACJ,CAAC;IAED,oCAAoC;IACpC,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,eAAe,CACvB,2FAA2F,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAClB,oBAAoB,EACpB,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,CAEF,SAA2C;YAE3C,OAAO,kBAAkB,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAC3D,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Functional Payment factory — frozen-object style.
3
+ *
4
+ * import { payment } from 'xrplt/fp';
5
+ * const tx = payment({ Account, Destination, Amount });
6
+ * tx.validate(); // throws if construction didn't already
7
+ * const j = tx.toJSON();
8
+ * const tx2 = tx.with({ Fee: '12', Sequence: 42 });
9
+ *
10
+ * Compare with the class-based equivalent:
11
+ *
12
+ * import { Payment } from 'xrplt';
13
+ * const tx = new Payment({ Account, Destination, Amount });
14
+ * tx.validate(); // must be called explicitly
15
+ * const j = tx.toJSON();
16
+ * const tx2 = tx.with({ Fee: '12', Sequence: 42 });
17
+ *
18
+ * The functional version validates at construction. There is no way to
19
+ * build an invalid tx — `with()` re-runs the factory, so overrides are
20
+ * re-validated too.
21
+ *
22
+ * Tree-shaking: a consumer that only imports `payment` should pull in
23
+ * ONLY this file plus its direct imports (validators, types). The class
24
+ * registry and 70 other leaf files should NOT appear in the bundle.
25
+ */
26
+ import type { Amount } from '../../types/amounts.js';
27
+ import type { PathStep } from '../../types/common.js';
28
+ import type { PaymentFlagsInterface } from '../../types/flags.js';
29
+ export interface PaymentProps {
30
+ /** The unique address of the transaction sender. */
31
+ Account: string;
32
+ /** The amount of currency to deliver. */
33
+ Amount: Amount;
34
+ /** The address to receive the funds. */
35
+ Destination: string;
36
+ /** Arbitrary destination tag for the recipient. */
37
+ DestinationTag?: number | undefined;
38
+ /** Hash of a check or other condition for the payment. */
39
+ InvoiceID?: string | undefined;
40
+ /** Minimum amount to deliver (requires tfPartialPayment). */
41
+ DeliverMin?: Amount | undefined;
42
+ /** Payment paths for cross-currency transfers. */
43
+ Paths?: PathStep[][] | undefined;
44
+ /** Maximum amount to spend including fees/slippage. */
45
+ SendMax?: Amount | undefined;
46
+ /** Bit-flags for this transaction. */
47
+ Flags?: number | PaymentFlagsInterface | undefined;
48
+ Fee?: string | undefined;
49
+ Sequence?: number | undefined;
50
+ }
51
+ export interface Payment extends Readonly<PaymentProps> {
52
+ readonly TransactionType: 'Payment';
53
+ /** No-op: validation already happened at construction. */
54
+ validate(): void;
55
+ /** Serialize to a plain object matching `xrpl.js` input shape. */
56
+ toJSON(): Record<string, unknown>;
57
+ /** Derive a new Payment with overrides applied; re-validates. */
58
+ with(overrides: Partial<PaymentProps>): Payment;
59
+ }
60
+ /**
61
+ * Build a frozen Payment. Throws ValidationError on construction if
62
+ * fields are missing or malformed.
63
+ */
64
+ export declare function payment(props: PaymentProps): Payment;
65
+ //# sourceMappingURL=payment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAMlE,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,kDAAkD;IAClD,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,SAAS,CAAC;IACjC,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAAC;IAGnD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,OAAQ,SAAQ,QAAQ,CAAC,YAAY,CAAC;IACrD,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC;IACpC,0DAA0D;IAC1D,QAAQ,IAAI,IAAI,CAAC;IACjB,kEAAkE;IAClE,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,iEAAiE;IACjE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC;CACjD;AAID;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAiDpD"}
@@ -0,0 +1,48 @@
1
+ import { isAccount, isAmount } from '../../validation/helpers.js';
2
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
3
+ // ─── Factory ────────────────────────────────────────────────────────
4
+ /**
5
+ * Build a frozen Payment. Throws ValidationError on construction if
6
+ * fields are missing or malformed.
7
+ */
8
+ export function payment(props) {
9
+ // ─── Validate at construction ───
10
+ require(props.Account, 'Payment: missing or invalid Account', isAccount);
11
+ require(props.Amount, 'Payment: missing or invalid Amount', isAmount);
12
+ require(props.Destination, 'Payment: missing or invalid Destination', isAccount);
13
+ if (props.DeliverMin !== undefined) {
14
+ const f = props.Flags;
15
+ const hasPartialFlag = typeof f === 'number'
16
+ ? (f & 0x00020000) !== 0
17
+ : f?.tfPartialPayment;
18
+ if (!hasPartialFlag) {
19
+ throw new Error('Payment: DeliverMin requires tfPartialPayment flag');
20
+ }
21
+ }
22
+ // ─── Build frozen shape ───
23
+ return buildFrozenTx('Payment', props, {
24
+ validate() {
25
+ // Construction-time validation is the contract. Calling this is a
26
+ // no-op so consumers who write `tx.validate()` on a fp tx don't
27
+ // have to special-case the API surface.
28
+ },
29
+ toJSON() {
30
+ const json = {};
31
+ for (const k of Object.keys(this)) {
32
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
33
+ continue;
34
+ const v = this[k];
35
+ if (v !== undefined)
36
+ json[k] = v;
37
+ }
38
+ return json;
39
+ },
40
+ with(overrides) {
41
+ // Re-invoke the factory so overrides are re-validated. Spread the
42
+ // current tx's enumerable own properties (skipping functions) and
43
+ // apply overrides on top.
44
+ return payment(mergeForWith(this, overrides));
45
+ },
46
+ });
47
+ }
48
+ //# sourceMappingURL=payment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/fp/factories/payment.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAuCnE,uEAAuE;AAEvE;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,mCAAmC;IACnC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,qCAAqC,EAAE,SAAS,CAAC,CAAC;IACzE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,oCAAoC,EAAE,QAAQ,CAAC,CAAC;IACtE,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,yCAAyC,EAAE,SAAS,CAAC,CAAC;IAEjF,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,KAAK,CAAC,KAGH,CAAC;QACd,MAAM,cAAc,GAClB,OAAO,CAAC,KAAK,QAAQ;YACnB,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC;YACxB,CAAC,CAAE,CAAuC,EAAE,gBAAgB,CAAC;QACjE,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACb,oDAAoD,CACrD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,OAAO,aAAa,CAClB,SAAS,EACT,KAAK,EACL;QACE,QAAQ;YACN,kEAAkE;YAClE,gEAAgE;YAChE,wCAAwC;QAC1C,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,CAAgB,SAAgC;YAClD,kEAAkE;YAClE,kEAAkE;YAClE,0BAA0B;YAC1B,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAChD,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface PermissionedDomainDeleteProps {
2
+ /** The unique address of the transaction sender. Must be the domain owner. */
3
+ Account: string;
4
+ /** The ledger entry ID of the Permissioned Domain to delete. 64-char hex. */
5
+ DomainID: string;
6
+ /** Fee in XRP (drops), base-10 integer string. */
7
+ Fee?: string | undefined;
8
+ /** Account sequence number. */
9
+ Sequence?: number | undefined;
10
+ }
11
+ export interface PermissionedDomainDelete extends Readonly<PermissionedDomainDeleteProps> {
12
+ readonly TransactionType: 'PermissionedDomainDelete';
13
+ validate(): void;
14
+ toJSON(): Record<string, unknown>;
15
+ with(overrides: Partial<PermissionedDomainDeleteProps>): PermissionedDomainDelete;
16
+ }
17
+ export declare function permissionedDomainDelete(props: PermissionedDomainDeleteProps): PermissionedDomainDelete;
18
+ //# sourceMappingURL=permissioned-domain-delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissioned-domain-delete.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/permissioned-domain-delete.ts"],"names":[],"mappings":"AAyDA,MAAM,WAAW,6BAA6B;IAC5C,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,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,wBACf,SAAQ,QAAQ,CAAC,6BAA6B,CAAC;IAC/C,QAAQ,CAAC,eAAe,EAAE,0BAA0B,CAAC;IACrD,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CACF,SAAS,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAChD,wBAAwB,CAAC;CAC7B;AAID,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,6BAA6B,GACnC,wBAAwB,CA4C1B"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Functional PermissionedDomainDelete factory — frozen-object style.
3
+ *
4
+ * Deletes a `PermissionedDomain` ledger entry. Only the domain owner can
5
+ * submit this transaction (the ledger enforces this; not locally checkable
6
+ * here). Validation happens at construction; there is no way to construct
7
+ * an invalid tx.
8
+ *
9
+ * import { permissionedDomainDelete } from 'xrplt/fp';
10
+ * const tx = permissionedDomainDelete({ Account, DomainID });
11
+ * const j = tx.toJSON();
12
+ *
13
+ * PermissionedDomainDelete has no Flags field per the spec — the
14
+ * xrpl-dev-portal docs ("PermissionedDomainDelete Flags") state
15
+ * "There are no flags defined for PermissionedDomainDelete
16
+ * transactions." This factory therefore omits a `Flags` field entirely.
17
+ *
18
+ * Affected amendments:
19
+ * - `PermissionedDomains` — base PermissionedDomainDelete.
20
+ *
21
+ * @see https://xrpl.org/docs/references/protocol/transactions/types/permissioneddomaindelete
22
+ * @see XLS-0080 §4 (Transaction: `PermissionedDomainDelete`) in
23
+ * `~/.mavis/docs.local/xrpl-standards/repo/XLS-0080-permissioned-domains/README.md`
24
+ *
25
+ * ## Divergences
26
+ *
27
+ * What: `Account` is validated as a well-formed XRPL classic or X-address.
28
+ *
29
+ * Why: xrpl.js's `validatePermissionedDomainDelete`
30
+ * (`~/.mavis/docs.local/xrpl.js/repo/packages/xrpl/src/models/
31
+ * transactions/permissionedDomainDelete.ts` line 25) calls
32
+ * `validateBaseTransaction`, which checks Account via `isAccount`
33
+ * (well-formed XRPL address). The local class API's
34
+ * `validateBaseTransaction` (`src/validation/base.ts` lines 28–32)
35
+ * only checks `isString(Account)`, missing the address-format guard
36
+ * that xrpl.js performs. A malformed Account therefore passes the
37
+ * class constructor and only fails at the deferred `.validate()`
38
+ * step. The factory matches xrpl.js's strictness at construction
39
+ * time.
40
+ *
41
+ * Source citation:
42
+ * - xrpl.js `validatePermissionedDomainDelete` at
43
+ * `~/.mavis/docs.local/xrpl.js/repo/packages/xrpl/src/models/
44
+ * transactions/permissionedDomainDelete.ts` (line 22–28 — calls
45
+ * `validateBaseTransaction(tx)` + `validateRequiredField(tx,
46
+ * 'DomainID', isString)`).
47
+ * - Local `validateBaseTransaction` at `src/validation/base.ts`
48
+ * (lines 28–32 — only does `isString(tx['Account'])`).
49
+ * - Local helper `isAccount` at `src/validation/helpers.ts`
50
+ * (lines 55–60 — regex check for classic or X-address format).
51
+ */
52
+ import { isAccount, isDomainID } from '../../validation/helpers.js';
53
+ import { ValidationError } from '../../errors.js';
54
+ import { buildFrozenTx, mergeForWith, require } from '../shape.js';
55
+ // ─── Factory ─────────────────────────────────────────────────────────
56
+ export function permissionedDomainDelete(props) {
57
+ // ── Account ── required, must be a valid XRPL classic/X-address.
58
+ // Strict address-format check (matches xrpl.js's `isAccount`) rather
59
+ // than the class API's looser `isString(Account)` check.
60
+ require(props.Account, 'PermissionedDomainDelete: Account is required', isAccount);
61
+ // ── DomainID ── required, 64-char hex (Hash256).
62
+ // Per XLS-0080 §4.1, DomainID is `Hash256`. The `isDomainID` helper
63
+ // enforces `isString + length === 64 + isHex` — same checks as the
64
+ // class, restated locally because the factory has no base class.
65
+ if (!isDomainID(props.DomainID)) {
66
+ throw new ValidationError('PermissionedDomainDelete: DomainID must be a 64-character hex string');
67
+ }
68
+ return buildFrozenTx('PermissionedDomainDelete', props, {
69
+ validate() {
70
+ // Validated at construction.
71
+ },
72
+ toJSON() {
73
+ const json = {};
74
+ for (const k of Object.keys(this)) {
75
+ if (k === 'validate' || k === 'toJSON' || k === 'with')
76
+ continue;
77
+ const v = this[k];
78
+ if (v !== undefined)
79
+ json[k] = v;
80
+ }
81
+ return json;
82
+ },
83
+ with(overrides) {
84
+ return permissionedDomainDelete(mergeForWith(this, overrides));
85
+ },
86
+ });
87
+ }
88
+ //# sourceMappingURL=permissioned-domain-delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissioned-domain-delete.js","sourceRoot":"","sources":["../../../src/fp/factories/permissioned-domain-delete.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAyBnE,wEAAwE;AAExE,MAAM,UAAU,wBAAwB,CACtC,KAAoC;IAEpC,kEAAkE;IAClE,qEAAqE;IACrE,yDAAyD;IACzD,OAAO,CACL,KAAK,CAAC,OAAO,EACb,+CAA+C,EAC/C,SAAS,CACV,CAAC;IAEF,kDAAkD;IAClD,oEAAoE;IACpE,mEAAmE;IACnE,iEAAiE;IACjE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,eAAe,CACvB,sEAAsE,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAClB,0BAA0B,EAC1B,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,CAEF,SAAiD;YAEjD,OAAO,wBAAwB,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QACjE,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}