xrpl 4.3.0-smartescrow.3 → 4.4.0-smartescrow.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 (476) hide show
  1. package/README.md +2 -2
  2. package/build/xrpl-latest-min.js +3 -0
  3. package/build/xrpl-latest-min.js.map +1 -0
  4. package/build/xrpl-latest.js +1457 -1505
  5. package/build/xrpl-latest.js.map +1 -1
  6. package/dist/npm/Wallet/batchSigner.d.ts +8 -0
  7. package/dist/npm/Wallet/batchSigner.d.ts.map +1 -0
  8. package/dist/npm/Wallet/batchSigner.js +111 -0
  9. package/dist/npm/Wallet/batchSigner.js.map +1 -0
  10. package/dist/npm/Wallet/defaultFaucets.d.ts +3 -2
  11. package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
  12. package/dist/npm/Wallet/defaultFaucets.js +16 -15
  13. package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
  14. package/dist/npm/Wallet/fundWallet.d.ts.map +1 -1
  15. package/dist/npm/Wallet/fundWallet.js +8 -16
  16. package/dist/npm/Wallet/fundWallet.js.map +1 -1
  17. package/dist/npm/Wallet/index.d.ts.map +1 -1
  18. package/dist/npm/Wallet/index.js +10 -4
  19. package/dist/npm/Wallet/index.js.map +1 -1
  20. package/dist/npm/Wallet/signer.d.ts.map +1 -1
  21. package/dist/npm/Wallet/signer.js +4 -20
  22. package/dist/npm/Wallet/signer.js.map +1 -1
  23. package/dist/npm/Wallet/utils.d.ts +9 -0
  24. package/dist/npm/Wallet/utils.d.ts.map +1 -0
  25. package/dist/npm/Wallet/utils.js +28 -0
  26. package/dist/npm/Wallet/utils.js.map +1 -0
  27. package/dist/npm/client/RequestManager.d.ts.map +1 -1
  28. package/dist/npm/client/RequestManager.js +3 -3
  29. package/dist/npm/client/RequestManager.js.map +1 -1
  30. package/dist/npm/client/connection.d.ts.map +1 -1
  31. package/dist/npm/client/connection.js.map +1 -1
  32. package/dist/npm/client/index.d.ts +3 -3
  33. package/dist/npm/client/index.d.ts.map +1 -1
  34. package/dist/npm/client/index.js +14 -14
  35. package/dist/npm/client/index.js.map +1 -1
  36. package/dist/npm/client/partialPayment.d.ts.map +1 -1
  37. package/dist/npm/client/partialPayment.js +2 -2
  38. package/dist/npm/client/partialPayment.js.map +1 -1
  39. package/dist/npm/models/common/index.d.ts +1 -0
  40. package/dist/npm/models/common/index.d.ts.map +1 -1
  41. package/dist/npm/models/ledger/AccountRoot.d.ts +1 -1
  42. package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
  43. package/dist/npm/models/ledger/Credential.d.ts +2 -2
  44. package/dist/npm/models/ledger/Credential.d.ts.map +1 -1
  45. package/dist/npm/models/ledger/LedgerEntry.d.ts +3 -2
  46. package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
  47. package/dist/npm/models/ledger/Vault.d.ts +21 -0
  48. package/dist/npm/models/ledger/Vault.d.ts.map +1 -0
  49. package/dist/npm/models/ledger/Vault.js +3 -0
  50. package/dist/npm/models/ledger/Vault.js.map +1 -0
  51. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +1 -2
  52. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  53. package/dist/npm/models/ledger/index.d.ts +2 -1
  54. package/dist/npm/models/ledger/index.d.ts.map +1 -1
  55. package/dist/npm/models/ledger/index.js.map +1 -1
  56. package/dist/npm/models/methods/baseMethod.d.ts +1 -0
  57. package/dist/npm/models/methods/baseMethod.d.ts.map +1 -1
  58. package/dist/npm/models/methods/index.d.ts +5 -4
  59. package/dist/npm/models/methods/index.d.ts.map +1 -1
  60. package/dist/npm/models/methods/vaultInfo.d.ts +46 -0
  61. package/dist/npm/models/methods/vaultInfo.d.ts.map +1 -0
  62. package/dist/npm/models/methods/vaultInfo.js +3 -0
  63. package/dist/npm/models/methods/vaultInfo.js.map +1 -0
  64. package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -1
  65. package/dist/npm/models/transactions/AMMBid.js +7 -5
  66. package/dist/npm/models/transactions/AMMBid.js.map +1 -1
  67. package/dist/npm/models/transactions/AMMClawback.d.ts +2 -2
  68. package/dist/npm/models/transactions/AMMClawback.d.ts.map +1 -1
  69. package/dist/npm/models/transactions/AMMClawback.js +5 -6
  70. package/dist/npm/models/transactions/AMMClawback.js.map +1 -1
  71. package/dist/npm/models/transactions/AMMDelete.d.ts.map +1 -1
  72. package/dist/npm/models/transactions/AMMDelete.js +2 -2
  73. package/dist/npm/models/transactions/AMMDelete.js.map +1 -1
  74. package/dist/npm/models/transactions/AMMDeposit.d.ts +2 -2
  75. package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
  76. package/dist/npm/models/transactions/AMMDeposit.js +3 -3
  77. package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
  78. package/dist/npm/models/transactions/AMMVote.d.ts.map +1 -1
  79. package/dist/npm/models/transactions/AMMVote.js +2 -2
  80. package/dist/npm/models/transactions/AMMVote.js.map +1 -1
  81. package/dist/npm/models/transactions/AMMWithdraw.d.ts +2 -2
  82. package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -1
  83. package/dist/npm/models/transactions/AMMWithdraw.js +3 -3
  84. package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -1
  85. package/dist/npm/models/transactions/MPTokenAuthorize.d.ts +2 -2
  86. package/dist/npm/models/transactions/MPTokenAuthorize.d.ts.map +1 -1
  87. package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts +2 -2
  88. package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -1
  89. package/dist/npm/models/transactions/MPTokenIssuanceCreate.js +3 -3
  90. package/dist/npm/models/transactions/MPTokenIssuanceCreate.js.map +1 -1
  91. package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts +2 -2
  92. package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -1
  93. package/dist/npm/models/transactions/MPTokenIssuanceSet.js +4 -4
  94. package/dist/npm/models/transactions/MPTokenIssuanceSet.js.map +1 -1
  95. package/dist/npm/models/transactions/NFTokenCancelOffer.d.ts.map +1 -1
  96. package/dist/npm/models/transactions/NFTokenCancelOffer.js +1 -1
  97. package/dist/npm/models/transactions/NFTokenCancelOffer.js.map +1 -1
  98. package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts +2 -2
  99. package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
  100. package/dist/npm/models/transactions/NFTokenCreateOffer.js +6 -2
  101. package/dist/npm/models/transactions/NFTokenCreateOffer.js.map +1 -1
  102. package/dist/npm/models/transactions/NFTokenMint.d.ts +2 -2
  103. package/dist/npm/models/transactions/NFTokenMint.d.ts.map +1 -1
  104. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  105. package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  106. package/dist/npm/models/transactions/XChainClaim.js.map +1 -1
  107. package/dist/npm/models/transactions/XChainCommit.js.map +1 -1
  108. package/dist/npm/models/transactions/XChainModifyBridge.d.ts +2 -2
  109. package/dist/npm/models/transactions/XChainModifyBridge.d.ts.map +1 -1
  110. package/dist/npm/models/transactions/accountDelete.d.ts.map +1 -1
  111. package/dist/npm/models/transactions/accountDelete.js.map +1 -1
  112. package/dist/npm/models/transactions/accountSet.d.ts +2 -2
  113. package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
  114. package/dist/npm/models/transactions/accountSet.js.map +1 -1
  115. package/dist/npm/models/transactions/batch.d.ts +39 -0
  116. package/dist/npm/models/transactions/batch.d.ts.map +1 -0
  117. package/dist/npm/models/transactions/batch.js +64 -0
  118. package/dist/npm/models/transactions/batch.js.map +1 -0
  119. package/dist/npm/models/transactions/checkCreate.d.ts.map +1 -1
  120. package/dist/npm/models/transactions/checkCreate.js +1 -2
  121. package/dist/npm/models/transactions/checkCreate.js.map +1 -1
  122. package/dist/npm/models/transactions/clawback.d.ts +2 -2
  123. package/dist/npm/models/transactions/clawback.d.ts.map +1 -1
  124. package/dist/npm/models/transactions/clawback.js +4 -6
  125. package/dist/npm/models/transactions/clawback.js.map +1 -1
  126. package/dist/npm/models/transactions/common.d.ts +30 -9
  127. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  128. package/dist/npm/models/transactions/common.js +74 -36
  129. package/dist/npm/models/transactions/common.js.map +1 -1
  130. package/dist/npm/models/transactions/delegateSet.d.ts.map +1 -1
  131. package/dist/npm/models/transactions/delegateSet.js +1 -0
  132. package/dist/npm/models/transactions/delegateSet.js.map +1 -1
  133. package/dist/npm/models/transactions/depositPreauth.d.ts.map +1 -1
  134. package/dist/npm/models/transactions/depositPreauth.js.map +1 -1
  135. package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
  136. package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
  137. package/dist/npm/models/transactions/index.d.ts +9 -2
  138. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  139. package/dist/npm/models/transactions/index.js +4 -1
  140. package/dist/npm/models/transactions/index.js.map +1 -1
  141. package/dist/npm/models/transactions/metadata.d.ts +1 -0
  142. package/dist/npm/models/transactions/metadata.d.ts.map +1 -1
  143. package/dist/npm/models/transactions/offerCreate.d.ts +2 -2
  144. package/dist/npm/models/transactions/offerCreate.d.ts.map +1 -1
  145. package/dist/npm/models/transactions/oracleSet.d.ts.map +1 -1
  146. package/dist/npm/models/transactions/oracleSet.js +22 -21
  147. package/dist/npm/models/transactions/oracleSet.js.map +1 -1
  148. package/dist/npm/models/transactions/payment.d.ts +3 -2
  149. package/dist/npm/models/transactions/payment.d.ts.map +1 -1
  150. package/dist/npm/models/transactions/payment.js +9 -4
  151. package/dist/npm/models/transactions/payment.js.map +1 -1
  152. package/dist/npm/models/transactions/paymentChannelClaim.d.ts +2 -2
  153. package/dist/npm/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  154. package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
  155. package/dist/npm/models/transactions/permissionedDomainSet.d.ts.map +1 -1
  156. package/dist/npm/models/transactions/permissionedDomainSet.js +1 -1
  157. package/dist/npm/models/transactions/permissionedDomainSet.js.map +1 -1
  158. package/dist/npm/models/transactions/signerListSet.d.ts.map +1 -1
  159. package/dist/npm/models/transactions/signerListSet.js +10 -16
  160. package/dist/npm/models/transactions/signerListSet.js.map +1 -1
  161. package/dist/npm/models/transactions/transaction.d.ts +8 -1
  162. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  163. package/dist/npm/models/transactions/transaction.js +35 -35
  164. package/dist/npm/models/transactions/transaction.js.map +1 -1
  165. package/dist/npm/models/transactions/trustSet.d.ts +2 -2
  166. package/dist/npm/models/transactions/trustSet.d.ts.map +1 -1
  167. package/dist/npm/models/transactions/vaultClawback.d.ts +10 -0
  168. package/dist/npm/models/transactions/vaultClawback.d.ts.map +1 -0
  169. package/dist/npm/models/transactions/vaultClawback.js +12 -0
  170. package/dist/npm/models/transactions/vaultClawback.js.map +1 -0
  171. package/dist/npm/models/transactions/vaultCreate.d.ts +24 -0
  172. package/dist/npm/models/transactions/vaultCreate.d.ts.map +1 -0
  173. package/dist/npm/models/transactions/vaultCreate.js +51 -0
  174. package/dist/npm/models/transactions/vaultCreate.js.map +1 -0
  175. package/dist/npm/models/transactions/vaultDelete.d.ts +7 -0
  176. package/dist/npm/models/transactions/vaultDelete.d.ts.map +1 -0
  177. package/dist/npm/models/transactions/vaultDelete.js +10 -0
  178. package/dist/npm/models/transactions/vaultDelete.js.map +1 -0
  179. package/dist/npm/models/transactions/vaultDeposit.d.ts +9 -0
  180. package/dist/npm/models/transactions/vaultDeposit.d.ts.map +1 -0
  181. package/dist/npm/models/transactions/vaultDeposit.js +11 -0
  182. package/dist/npm/models/transactions/vaultDeposit.js.map +1 -0
  183. package/dist/npm/models/transactions/vaultSet.d.ts +10 -0
  184. package/dist/npm/models/transactions/vaultSet.d.ts.map +1 -0
  185. package/dist/npm/models/transactions/vaultSet.js +25 -0
  186. package/dist/npm/models/transactions/vaultSet.js.map +1 -0
  187. package/dist/npm/models/transactions/vaultWithdraw.d.ts +10 -0
  188. package/dist/npm/models/transactions/vaultWithdraw.d.ts.map +1 -0
  189. package/dist/npm/models/transactions/vaultWithdraw.js +12 -0
  190. package/dist/npm/models/transactions/vaultWithdraw.js.map +1 -0
  191. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  192. package/dist/npm/models/utils/flags.js +26 -9
  193. package/dist/npm/models/utils/flags.js.map +1 -1
  194. package/dist/npm/models/utils/index.d.ts +2 -0
  195. package/dist/npm/models/utils/index.d.ts.map +1 -1
  196. package/dist/npm/models/utils/index.js +11 -1
  197. package/dist/npm/models/utils/index.js.map +1 -1
  198. package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
  199. package/dist/npm/src/Wallet/batchSigner.d.ts +8 -0
  200. package/dist/npm/src/Wallet/batchSigner.d.ts.map +1 -0
  201. package/dist/npm/src/Wallet/batchSigner.js +111 -0
  202. package/dist/npm/src/Wallet/batchSigner.js.map +1 -0
  203. package/dist/npm/src/Wallet/defaultFaucets.d.ts +3 -2
  204. package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
  205. package/dist/npm/src/Wallet/defaultFaucets.js +16 -15
  206. package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
  207. package/dist/npm/src/Wallet/fundWallet.d.ts.map +1 -1
  208. package/dist/npm/src/Wallet/fundWallet.js +8 -16
  209. package/dist/npm/src/Wallet/fundWallet.js.map +1 -1
  210. package/dist/npm/src/Wallet/index.d.ts.map +1 -1
  211. package/dist/npm/src/Wallet/index.js +10 -4
  212. package/dist/npm/src/Wallet/index.js.map +1 -1
  213. package/dist/npm/src/Wallet/signer.d.ts.map +1 -1
  214. package/dist/npm/src/Wallet/signer.js +4 -20
  215. package/dist/npm/src/Wallet/signer.js.map +1 -1
  216. package/dist/npm/src/Wallet/utils.d.ts +9 -0
  217. package/dist/npm/src/Wallet/utils.d.ts.map +1 -0
  218. package/dist/npm/src/Wallet/utils.js +28 -0
  219. package/dist/npm/src/Wallet/utils.js.map +1 -0
  220. package/dist/npm/src/client/RequestManager.d.ts.map +1 -1
  221. package/dist/npm/src/client/RequestManager.js +3 -3
  222. package/dist/npm/src/client/RequestManager.js.map +1 -1
  223. package/dist/npm/src/client/connection.d.ts.map +1 -1
  224. package/dist/npm/src/client/connection.js.map +1 -1
  225. package/dist/npm/src/client/index.d.ts +3 -3
  226. package/dist/npm/src/client/index.d.ts.map +1 -1
  227. package/dist/npm/src/client/index.js +14 -14
  228. package/dist/npm/src/client/index.js.map +1 -1
  229. package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
  230. package/dist/npm/src/client/partialPayment.js +2 -2
  231. package/dist/npm/src/client/partialPayment.js.map +1 -1
  232. package/dist/npm/src/models/common/index.d.ts +1 -0
  233. package/dist/npm/src/models/common/index.d.ts.map +1 -1
  234. package/dist/npm/src/models/ledger/AccountRoot.d.ts +1 -1
  235. package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
  236. package/dist/npm/src/models/ledger/Credential.d.ts +2 -2
  237. package/dist/npm/src/models/ledger/Credential.d.ts.map +1 -1
  238. package/dist/npm/src/models/ledger/LedgerEntry.d.ts +3 -2
  239. package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
  240. package/dist/npm/src/models/ledger/Vault.d.ts +21 -0
  241. package/dist/npm/src/models/ledger/Vault.d.ts.map +1 -0
  242. package/dist/npm/src/models/ledger/Vault.js +3 -0
  243. package/dist/npm/src/models/ledger/Vault.js.map +1 -0
  244. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +1 -2
  245. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  246. package/dist/npm/src/models/ledger/index.d.ts +2 -1
  247. package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
  248. package/dist/npm/src/models/ledger/index.js.map +1 -1
  249. package/dist/npm/src/models/methods/baseMethod.d.ts +1 -0
  250. package/dist/npm/src/models/methods/baseMethod.d.ts.map +1 -1
  251. package/dist/npm/src/models/methods/index.d.ts +5 -4
  252. package/dist/npm/src/models/methods/index.d.ts.map +1 -1
  253. package/dist/npm/src/models/methods/vaultInfo.d.ts +46 -0
  254. package/dist/npm/src/models/methods/vaultInfo.d.ts.map +1 -0
  255. package/dist/npm/src/models/methods/vaultInfo.js +3 -0
  256. package/dist/npm/src/models/methods/vaultInfo.js.map +1 -0
  257. package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -1
  258. package/dist/npm/src/models/transactions/AMMBid.js +7 -5
  259. package/dist/npm/src/models/transactions/AMMBid.js.map +1 -1
  260. package/dist/npm/src/models/transactions/AMMClawback.d.ts +2 -2
  261. package/dist/npm/src/models/transactions/AMMClawback.d.ts.map +1 -1
  262. package/dist/npm/src/models/transactions/AMMClawback.js +5 -6
  263. package/dist/npm/src/models/transactions/AMMClawback.js.map +1 -1
  264. package/dist/npm/src/models/transactions/AMMDelete.d.ts.map +1 -1
  265. package/dist/npm/src/models/transactions/AMMDelete.js +2 -2
  266. package/dist/npm/src/models/transactions/AMMDelete.js.map +1 -1
  267. package/dist/npm/src/models/transactions/AMMDeposit.d.ts +2 -2
  268. package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
  269. package/dist/npm/src/models/transactions/AMMDeposit.js +3 -3
  270. package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
  271. package/dist/npm/src/models/transactions/AMMVote.d.ts.map +1 -1
  272. package/dist/npm/src/models/transactions/AMMVote.js +2 -2
  273. package/dist/npm/src/models/transactions/AMMVote.js.map +1 -1
  274. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts +2 -2
  275. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -1
  276. package/dist/npm/src/models/transactions/AMMWithdraw.js +3 -3
  277. package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -1
  278. package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts +2 -2
  279. package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts.map +1 -1
  280. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts +2 -2
  281. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -1
  282. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.js +3 -3
  283. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.js.map +1 -1
  284. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts +2 -2
  285. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -1
  286. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.js +4 -4
  287. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.js.map +1 -1
  288. package/dist/npm/src/models/transactions/NFTokenCancelOffer.d.ts.map +1 -1
  289. package/dist/npm/src/models/transactions/NFTokenCancelOffer.js +1 -1
  290. package/dist/npm/src/models/transactions/NFTokenCancelOffer.js.map +1 -1
  291. package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts +2 -2
  292. package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
  293. package/dist/npm/src/models/transactions/NFTokenCreateOffer.js +6 -2
  294. package/dist/npm/src/models/transactions/NFTokenCreateOffer.js.map +1 -1
  295. package/dist/npm/src/models/transactions/NFTokenMint.d.ts +2 -2
  296. package/dist/npm/src/models/transactions/NFTokenMint.d.ts.map +1 -1
  297. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  298. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  299. package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -1
  300. package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -1
  301. package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts +2 -2
  302. package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts.map +1 -1
  303. package/dist/npm/src/models/transactions/accountDelete.d.ts.map +1 -1
  304. package/dist/npm/src/models/transactions/accountDelete.js.map +1 -1
  305. package/dist/npm/src/models/transactions/accountSet.d.ts +2 -2
  306. package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
  307. package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
  308. package/dist/npm/src/models/transactions/batch.d.ts +39 -0
  309. package/dist/npm/src/models/transactions/batch.d.ts.map +1 -0
  310. package/dist/npm/src/models/transactions/batch.js +64 -0
  311. package/dist/npm/src/models/transactions/batch.js.map +1 -0
  312. package/dist/npm/src/models/transactions/checkCreate.d.ts.map +1 -1
  313. package/dist/npm/src/models/transactions/checkCreate.js +1 -2
  314. package/dist/npm/src/models/transactions/checkCreate.js.map +1 -1
  315. package/dist/npm/src/models/transactions/clawback.d.ts +2 -2
  316. package/dist/npm/src/models/transactions/clawback.d.ts.map +1 -1
  317. package/dist/npm/src/models/transactions/clawback.js +4 -6
  318. package/dist/npm/src/models/transactions/clawback.js.map +1 -1
  319. package/dist/npm/src/models/transactions/common.d.ts +30 -9
  320. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  321. package/dist/npm/src/models/transactions/common.js +74 -36
  322. package/dist/npm/src/models/transactions/common.js.map +1 -1
  323. package/dist/npm/src/models/transactions/delegateSet.d.ts.map +1 -1
  324. package/dist/npm/src/models/transactions/delegateSet.js +1 -0
  325. package/dist/npm/src/models/transactions/delegateSet.js.map +1 -1
  326. package/dist/npm/src/models/transactions/depositPreauth.d.ts.map +1 -1
  327. package/dist/npm/src/models/transactions/depositPreauth.js.map +1 -1
  328. package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
  329. package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
  330. package/dist/npm/src/models/transactions/index.d.ts +9 -2
  331. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  332. package/dist/npm/src/models/transactions/index.js +4 -1
  333. package/dist/npm/src/models/transactions/index.js.map +1 -1
  334. package/dist/npm/src/models/transactions/metadata.d.ts +1 -0
  335. package/dist/npm/src/models/transactions/metadata.d.ts.map +1 -1
  336. package/dist/npm/src/models/transactions/offerCreate.d.ts +2 -2
  337. package/dist/npm/src/models/transactions/offerCreate.d.ts.map +1 -1
  338. package/dist/npm/src/models/transactions/oracleSet.d.ts.map +1 -1
  339. package/dist/npm/src/models/transactions/oracleSet.js +22 -21
  340. package/dist/npm/src/models/transactions/oracleSet.js.map +1 -1
  341. package/dist/npm/src/models/transactions/payment.d.ts +3 -2
  342. package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
  343. package/dist/npm/src/models/transactions/payment.js +9 -4
  344. package/dist/npm/src/models/transactions/payment.js.map +1 -1
  345. package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts +2 -2
  346. package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  347. package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
  348. package/dist/npm/src/models/transactions/permissionedDomainSet.d.ts.map +1 -1
  349. package/dist/npm/src/models/transactions/permissionedDomainSet.js +1 -1
  350. package/dist/npm/src/models/transactions/permissionedDomainSet.js.map +1 -1
  351. package/dist/npm/src/models/transactions/signerListSet.d.ts.map +1 -1
  352. package/dist/npm/src/models/transactions/signerListSet.js +10 -16
  353. package/dist/npm/src/models/transactions/signerListSet.js.map +1 -1
  354. package/dist/npm/src/models/transactions/transaction.d.ts +8 -1
  355. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  356. package/dist/npm/src/models/transactions/transaction.js +35 -35
  357. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  358. package/dist/npm/src/models/transactions/trustSet.d.ts +2 -2
  359. package/dist/npm/src/models/transactions/trustSet.d.ts.map +1 -1
  360. package/dist/npm/src/models/transactions/vaultClawback.d.ts +10 -0
  361. package/dist/npm/src/models/transactions/vaultClawback.d.ts.map +1 -0
  362. package/dist/npm/src/models/transactions/vaultClawback.js +12 -0
  363. package/dist/npm/src/models/transactions/vaultClawback.js.map +1 -0
  364. package/dist/npm/src/models/transactions/vaultCreate.d.ts +24 -0
  365. package/dist/npm/src/models/transactions/vaultCreate.d.ts.map +1 -0
  366. package/dist/npm/src/models/transactions/vaultCreate.js +51 -0
  367. package/dist/npm/src/models/transactions/vaultCreate.js.map +1 -0
  368. package/dist/npm/src/models/transactions/vaultDelete.d.ts +7 -0
  369. package/dist/npm/src/models/transactions/vaultDelete.d.ts.map +1 -0
  370. package/dist/npm/src/models/transactions/vaultDelete.js +10 -0
  371. package/dist/npm/src/models/transactions/vaultDelete.js.map +1 -0
  372. package/dist/npm/src/models/transactions/vaultDeposit.d.ts +9 -0
  373. package/dist/npm/src/models/transactions/vaultDeposit.d.ts.map +1 -0
  374. package/dist/npm/src/models/transactions/vaultDeposit.js +11 -0
  375. package/dist/npm/src/models/transactions/vaultDeposit.js.map +1 -0
  376. package/dist/npm/src/models/transactions/vaultSet.d.ts +10 -0
  377. package/dist/npm/src/models/transactions/vaultSet.d.ts.map +1 -0
  378. package/dist/npm/src/models/transactions/vaultSet.js +25 -0
  379. package/dist/npm/src/models/transactions/vaultSet.js.map +1 -0
  380. package/dist/npm/src/models/transactions/vaultWithdraw.d.ts +10 -0
  381. package/dist/npm/src/models/transactions/vaultWithdraw.d.ts.map +1 -0
  382. package/dist/npm/src/models/transactions/vaultWithdraw.js +12 -0
  383. package/dist/npm/src/models/transactions/vaultWithdraw.js.map +1 -0
  384. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  385. package/dist/npm/src/models/utils/flags.js +26 -9
  386. package/dist/npm/src/models/utils/flags.js.map +1 -1
  387. package/dist/npm/src/models/utils/index.d.ts +2 -0
  388. package/dist/npm/src/models/utils/index.d.ts.map +1 -1
  389. package/dist/npm/src/models/utils/index.js +11 -1
  390. package/dist/npm/src/models/utils/index.js.map +1 -1
  391. package/dist/npm/src/sugar/autofill.d.ts +4 -2
  392. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  393. package/dist/npm/src/sugar/autofill.js +109 -16
  394. package/dist/npm/src/sugar/autofill.js.map +1 -1
  395. package/dist/npm/src/sugar/submit.d.ts.map +1 -1
  396. package/dist/npm/src/sugar/submit.js.map +1 -1
  397. package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
  398. package/dist/npm/src/utils/hashes/hashLedger.js +4 -1
  399. package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
  400. package/dist/npm/sugar/autofill.d.ts +4 -2
  401. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  402. package/dist/npm/sugar/autofill.js +109 -16
  403. package/dist/npm/sugar/autofill.js.map +1 -1
  404. package/dist/npm/sugar/submit.d.ts.map +1 -1
  405. package/dist/npm/sugar/submit.js.map +1 -1
  406. package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
  407. package/dist/npm/utils/hashes/hashLedger.js +4 -1
  408. package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
  409. package/package.json +7 -6
  410. package/src/Wallet/batchSigner.ts +198 -0
  411. package/src/Wallet/defaultFaucets.ts +20 -18
  412. package/src/Wallet/fundWallet.ts +17 -28
  413. package/src/Wallet/index.ts +9 -3
  414. package/src/Wallet/signer.ts +4 -39
  415. package/src/Wallet/utils.ts +58 -0
  416. package/src/client/RequestManager.ts +4 -1
  417. package/src/client/connection.ts +0 -1
  418. package/src/client/index.ts +50 -66
  419. package/src/client/partialPayment.ts +2 -4
  420. package/src/models/common/index.ts +2 -0
  421. package/src/models/ledger/AccountRoot.ts +1 -1
  422. package/src/models/ledger/Credential.ts +2 -2
  423. package/src/models/ledger/LedgerEntry.ts +3 -0
  424. package/src/models/ledger/Vault.ts +83 -0
  425. package/src/models/ledger/XChainOwnedClaimID.ts +1 -3
  426. package/src/models/ledger/index.ts +3 -1
  427. package/src/models/methods/baseMethod.ts +1 -0
  428. package/src/models/methods/index.ts +10 -0
  429. package/src/models/methods/vaultInfo.ts +193 -0
  430. package/src/models/transactions/AMMBid.ts +12 -21
  431. package/src/models/transactions/AMMClawback.ts +10 -13
  432. package/src/models/transactions/AMMDelete.ts +7 -3
  433. package/src/models/transactions/AMMDeposit.ts +6 -6
  434. package/src/models/transactions/AMMVote.ts +7 -3
  435. package/src/models/transactions/AMMWithdraw.ts +6 -6
  436. package/src/models/transactions/MPTokenAuthorize.ts +2 -2
  437. package/src/models/transactions/MPTokenIssuanceCreate.ts +6 -3
  438. package/src/models/transactions/MPTokenIssuanceSet.ts +3 -3
  439. package/src/models/transactions/NFTokenCancelOffer.ts +2 -2
  440. package/src/models/transactions/NFTokenCreateOffer.ts +10 -6
  441. package/src/models/transactions/NFTokenMint.ts +2 -2
  442. package/src/models/transactions/XChainAddAccountCreateAttestation.ts +2 -2
  443. package/src/models/transactions/XChainAddClaimAttestation.ts +2 -2
  444. package/src/models/transactions/XChainClaim.ts +1 -1
  445. package/src/models/transactions/XChainCommit.ts +1 -1
  446. package/src/models/transactions/XChainModifyBridge.ts +2 -2
  447. package/src/models/transactions/accountDelete.ts +1 -2
  448. package/src/models/transactions/accountSet.ts +2 -1
  449. package/src/models/transactions/batch.ts +151 -0
  450. package/src/models/transactions/checkCreate.ts +2 -6
  451. package/src/models/transactions/clawback.ts +9 -10
  452. package/src/models/transactions/common.ts +194 -69
  453. package/src/models/transactions/delegateSet.ts +1 -0
  454. package/src/models/transactions/depositPreauth.ts +2 -4
  455. package/src/models/transactions/escrowFinish.ts +1 -2
  456. package/src/models/transactions/index.ts +14 -3
  457. package/src/models/transactions/metadata.ts +2 -0
  458. package/src/models/transactions/offerCreate.ts +2 -2
  459. package/src/models/transactions/oracleSet.ts +88 -91
  460. package/src/models/transactions/payment.ts +21 -13
  461. package/src/models/transactions/paymentChannelClaim.ts +4 -4
  462. package/src/models/transactions/permissionedDomainSet.ts +3 -7
  463. package/src/models/transactions/signerListSet.ts +21 -21
  464. package/src/models/transactions/transaction.ts +61 -43
  465. package/src/models/transactions/trustSet.ts +2 -2
  466. package/src/models/transactions/vaultClawback.ts +55 -0
  467. package/src/models/transactions/vaultCreate.ts +142 -0
  468. package/src/models/transactions/vaultDelete.ts +32 -0
  469. package/src/models/transactions/vaultDeposit.ts +41 -0
  470. package/src/models/transactions/vaultSet.ts +71 -0
  471. package/src/models/transactions/vaultWithdraw.ts +50 -0
  472. package/src/models/utils/flags.ts +30 -10
  473. package/src/models/utils/index.ts +24 -0
  474. package/src/sugar/autofill.ts +165 -35
  475. package/src/sugar/submit.ts +1 -2
  476. package/src/utils/hashes/hashLedger.ts +5 -2
@@ -1,13 +1,15 @@
1
1
  import { ValidationError } from '../../errors'
2
- import { IssuedCurrencyAmount, MPTAmount } from '../common'
2
+ import { ClawbackAmount } from '../common'
3
3
 
4
4
  import {
5
5
  BaseTransaction,
6
6
  validateBaseTransaction,
7
- isIssuedCurrency,
7
+ isIssuedCurrencyAmount,
8
8
  isMPTAmount,
9
9
  isAccount,
10
10
  validateOptionalField,
11
+ isClawbackAmount,
12
+ validateRequiredField,
11
13
  } from './common'
12
14
 
13
15
  /**
@@ -26,7 +28,7 @@ export interface Clawback extends BaseTransaction {
26
28
  * names MUST be lower-case. If the amount is IOU, the `issuer` field MUST be the holder's address,
27
29
  * whom to be clawed back.
28
30
  */
29
- Amount: IssuedCurrencyAmount | MPTAmount
31
+ Amount: ClawbackAmount
30
32
  /**
31
33
  * Indicates the AccountID that the issuer wants to clawback. This field is only valid for clawing back
32
34
  * MPTs.
@@ -42,17 +44,14 @@ export interface Clawback extends BaseTransaction {
42
44
  */
43
45
  export function validateClawback(tx: Record<string, unknown>): void {
44
46
  validateBaseTransaction(tx)
47
+ validateRequiredField(tx, 'Amount', isClawbackAmount)
45
48
  validateOptionalField(tx, 'Holder', isAccount)
46
49
 
47
- if (tx.Amount == null) {
48
- throw new ValidationError('Clawback: missing field Amount')
49
- }
50
-
51
- if (!isIssuedCurrency(tx.Amount) && !isMPTAmount(tx.Amount)) {
50
+ if (!isIssuedCurrencyAmount(tx.Amount) && !isMPTAmount(tx.Amount)) {
52
51
  throw new ValidationError('Clawback: invalid Amount')
53
52
  }
54
53
 
55
- if (isIssuedCurrency(tx.Amount) && tx.Account === tx.Amount.issuer) {
54
+ if (isIssuedCurrencyAmount(tx.Amount) && tx.Account === tx.Amount.issuer) {
56
55
  throw new ValidationError('Clawback: invalid holder Account')
57
56
  }
58
57
 
@@ -60,7 +59,7 @@ export function validateClawback(tx: Record<string, unknown>): void {
60
59
  throw new ValidationError('Clawback: invalid holder Account')
61
60
  }
62
61
 
63
- if (isIssuedCurrency(tx.Amount) && tx.Holder) {
62
+ if (isIssuedCurrencyAmount(tx.Amount) && tx.Holder) {
64
63
  throw new ValidationError('Clawback: cannot have Holder for currency')
65
64
  }
66
65
 
@@ -7,31 +7,42 @@ import { ValidationError } from '../../errors'
7
7
  import {
8
8
  Amount,
9
9
  AuthorizeCredential,
10
+ ClawbackAmount,
10
11
  Currency,
12
+ IssuedCurrency,
11
13
  IssuedCurrencyAmount,
12
14
  MPTAmount,
13
15
  Memo,
14
16
  Signer,
15
17
  XChainBridge,
16
18
  } from '../common'
17
- import { onlyHasFields } from '../utils'
19
+ import { isHex, onlyHasFields } from '../utils'
18
20
 
19
21
  const MEMO_SIZE = 3
20
22
  export const MAX_AUTHORIZED_CREDENTIALS = 8
21
23
  const MAX_CREDENTIAL_BYTE_LENGTH = 64
22
24
  const MAX_CREDENTIAL_TYPE_LENGTH = MAX_CREDENTIAL_BYTE_LENGTH * 2
23
25
 
24
- function isMemo(obj: { Memo?: unknown }): boolean {
25
- if (obj.Memo == null) {
26
+ // Used for Vault transactions
27
+ export const VAULT_DATA_MAX_BYTE_LENGTH = 256
28
+
29
+ function isMemo(obj: unknown): obj is Memo {
30
+ if (!isRecord(obj)) {
31
+ return false
32
+ }
33
+
34
+ const memo = obj.Memo
35
+ if (!isRecord(memo)) {
26
36
  return false
27
37
  }
28
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Only used by JS
29
- const memo = obj.Memo as Record<string, unknown>
30
38
  const size = Object.keys(memo).length
31
- const validData = memo.MemoData == null || typeof memo.MemoData === 'string'
39
+ const validData =
40
+ memo.MemoData == null || (isString(memo.MemoData) && isHex(memo.MemoData))
32
41
  const validFormat =
33
- memo.MemoFormat == null || typeof memo.MemoFormat === 'string'
34
- const validType = memo.MemoType == null || typeof memo.MemoType === 'string'
42
+ memo.MemoFormat == null ||
43
+ (isString(memo.MemoFormat) && isHex(memo.MemoFormat))
44
+ const validType =
45
+ memo.MemoType == null || (isString(memo.MemoType) && isHex(memo.MemoType))
35
46
 
36
47
  return (
37
48
  size >= 1 &&
@@ -45,20 +56,21 @@ function isMemo(obj: { Memo?: unknown }): boolean {
45
56
 
46
57
  const SIGNER_SIZE = 3
47
58
 
48
- function isSigner(obj: unknown): boolean {
49
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Only used by JS
50
- const signerWrapper = obj as Record<string, unknown>
59
+ function isSigner(obj: unknown): obj is Signer {
60
+ if (!isRecord(obj)) {
61
+ return false
62
+ }
51
63
 
52
- if (signerWrapper.Signer == null) {
64
+ const signer = obj.Signer
65
+ if (!isRecord(signer)) {
53
66
  return false
54
67
  }
55
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Only used by JS and Signer is previously unknown
56
- const signer = signerWrapper.Signer as Record<string, unknown>
68
+
57
69
  return (
58
70
  Object.keys(signer).length === SIGNER_SIZE &&
59
- typeof signer.Account === 'string' &&
60
- typeof signer.TxnSignature === 'string' &&
61
- typeof signer.SigningPubKey === 'string'
71
+ isString(signer.Account) &&
72
+ isString(signer.TxnSignature) &&
73
+ isString(signer.SigningPubKey)
62
74
  )
63
75
  }
64
76
 
@@ -69,8 +81,14 @@ const XCHAIN_BRIDGE_SIZE = 4
69
81
  const MPTOKEN_SIZE = 2
70
82
  const AUTHORIZE_CREDENTIAL_SIZE = 1
71
83
 
72
- function isRecord(value: unknown): value is Record<string, unknown> {
73
- return value !== null && typeof value === 'object'
84
+ /**
85
+ * Verify the form and type of a Record/Object at runtime.
86
+ *
87
+ * @param value - The object to check the form and type of.
88
+ * @returns Whether the Record/Object is properly formed.
89
+ */
90
+ export function isRecord(value: unknown): value is Record<string, unknown> {
91
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
74
92
  }
75
93
 
76
94
  /**
@@ -93,18 +111,50 @@ export function isNumber(num: unknown): num is number {
93
111
  return typeof num === 'number'
94
112
  }
95
113
 
114
+ /**
115
+ * Checks whether the given value is a valid XRPL number string.
116
+ * Accepts integer, decimal, or scientific notation strings.
117
+ *
118
+ * Examples of valid input:
119
+ * - "123"
120
+ * - "-987.654"
121
+ * - "+3.14e10"
122
+ * - "-7.2e-9"
123
+ *
124
+ * @param value - The value to check.
125
+ * @returns True if value is a string that matches the XRPL number format, false otherwise.
126
+ */
127
+ export function isXRPLNumber(value: unknown): value is XRPLNumber {
128
+ // Matches optional sign, digits, optional decimal, optional exponent (scientific)
129
+ // Allows leading zeros, but not empty string, lone sign, or missing digits
130
+ return (
131
+ typeof value === 'string' &&
132
+ /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/u.test(value.trim())
133
+ )
134
+ }
135
+
136
+ /**
137
+ * Verify the form and type of a Currency at runtime.
138
+ *
139
+ * @param input - The input to check the form and type of.
140
+ * @returns Whether the Currency is properly formed.
141
+ */
142
+ export function isCurrency(input: unknown): input is Currency {
143
+ return isString(input) || isIssuedCurrency(input)
144
+ }
145
+
96
146
  /**
97
147
  * Verify the form and type of an IssuedCurrency at runtime.
98
148
  *
99
149
  * @param input - The input to check the form and type of.
100
150
  * @returns Whether the IssuedCurrency is properly formed.
101
151
  */
102
- export function isCurrency(input: unknown): input is Currency {
152
+ export function isIssuedCurrency(input: unknown): input is IssuedCurrency {
103
153
  return (
104
154
  isRecord(input) &&
105
155
  ((Object.keys(input).length === ISSUE_SIZE &&
106
- typeof input.issuer === 'string' &&
107
- typeof input.currency === 'string') ||
156
+ isString(input.issuer) &&
157
+ isString(input.currency)) ||
108
158
  (Object.keys(input).length === XRP_CURRENCY_SIZE &&
109
159
  input.currency === 'XRP'))
110
160
  )
@@ -116,15 +166,15 @@ export function isCurrency(input: unknown): input is Currency {
116
166
  * @param input - The input to check the form and type of.
117
167
  * @returns Whether the IssuedCurrencyAmount is properly formed.
118
168
  */
119
- export function isIssuedCurrency(
169
+ export function isIssuedCurrencyAmount(
120
170
  input: unknown,
121
171
  ): input is IssuedCurrencyAmount {
122
172
  return (
123
173
  isRecord(input) &&
124
174
  Object.keys(input).length === ISSUED_CURRENCY_SIZE &&
125
- typeof input.value === 'string' &&
126
- typeof input.issuer === 'string' &&
127
- typeof input.currency === 'string'
175
+ isString(input.value) &&
176
+ isString(input.issuer) &&
177
+ isString(input.currency)
128
178
  )
129
179
  }
130
180
 
@@ -161,11 +211,33 @@ export function isMPTAmount(input: unknown): input is MPTAmount {
161
211
  )
162
212
  }
163
213
 
214
+ /**
215
+ * Type guard to verify if the input is a valid ClawbackAmount.
216
+ *
217
+ * A ClawbackAmount can be either an {@link IssuedCurrencyAmount} or an {@link MPTAmount}.
218
+ * This function checks if the input matches either type.
219
+ *
220
+ * @param input - The value to check for ClawbackAmount structure.
221
+ * @returns True if the input is an IssuedCurrencyAmount or MPTAmount, otherwise false.
222
+ */
223
+ export function isClawbackAmount(input: unknown): input is ClawbackAmount {
224
+ return isIssuedCurrencyAmount(input) || isMPTAmount(input)
225
+ }
226
+
164
227
  /**
165
228
  * Must be a valid account address
166
229
  */
167
230
  export type Account = string
168
231
 
232
+ /**
233
+ * XRPL Number type represented as a string.
234
+ *
235
+ * This string can be an integer (e.g., "123"), a decimal (e.g., "123.45"),
236
+ * or in scientific notation (e.g., "1.23e5", "-4.56e-7").
237
+ * Used for fields that accept arbitrary-precision numbers in XRPL transactions and ledger objects.
238
+ */
239
+ export type XRPLNumber = string
240
+
169
241
  /**
170
242
  * Verify a string is in fact a valid account address.
171
243
  *
@@ -188,7 +260,7 @@ export function isAccount(account: unknown): account is Account {
188
260
  export function isAmount(amount: unknown): amount is Amount {
189
261
  return (
190
262
  typeof amount === 'string' ||
191
- isIssuedCurrency(amount) ||
263
+ isIssuedCurrencyAmount(amount) ||
192
264
  isMPTAmount(amount)
193
265
  )
194
266
  }
@@ -204,36 +276,60 @@ export function isXChainBridge(input: unknown): input is XChainBridge {
204
276
  isRecord(input) &&
205
277
  Object.keys(input).length === XCHAIN_BRIDGE_SIZE &&
206
278
  typeof input.LockingChainDoor === 'string' &&
207
- isCurrency(input.LockingChainIssue) &&
279
+ isIssuedCurrency(input.LockingChainIssue) &&
208
280
  typeof input.IssuingChainDoor === 'string' &&
209
- isCurrency(input.IssuingChainIssue)
281
+ isIssuedCurrency(input.IssuingChainIssue)
210
282
  )
211
283
  }
212
284
 
285
+ /**
286
+ * Verify the form and type of an Array at runtime.
287
+ *
288
+ * @param input - The object to check the form and type of.
289
+ * @returns Whether the Array is properly formed.
290
+ */
291
+ export function isArray<T = unknown>(input: unknown): input is T[] {
292
+ return input != null && Array.isArray(input)
293
+ }
294
+
213
295
  /* eslint-disable @typescript-eslint/restrict-template-expressions -- tx.TransactionType is checked before any calls */
214
296
 
215
297
  /**
216
298
  * Verify the form and type of a required type for a transaction at runtime.
217
299
  *
218
- * @param tx - The transaction input to check the form and type of.
219
- * @param paramName - The name of the transaction parameter.
300
+ * @param tx - The object input to check the form and type of.
301
+ * @param param - The object parameter.
220
302
  * @param checkValidity - The function to use to check the type.
221
- * @throws
303
+ * @param errorOpts - Extra values to make the error message easier to understand.
304
+ * @param errorOpts.txType - The transaction type throwing the error.
305
+ * @param errorOpts.paramName - The name of the parameter in the transaction with the error.
306
+ * @throws ValidationError if the parameter is missing or invalid.
222
307
  */
223
- export function validateRequiredField(
224
- tx: Record<string, unknown>,
225
- paramName: string,
226
- checkValidity: (inp: unknown) => boolean,
227
- ): void {
228
- if (tx[paramName] == null) {
308
+ // eslint-disable-next-line max-params -- helper function
309
+ export function validateRequiredField<
310
+ T extends Record<string, unknown>,
311
+ K extends keyof T,
312
+ V,
313
+ >(
314
+ tx: T,
315
+ param: K,
316
+ checkValidity: (inp: unknown) => inp is V,
317
+ errorOpts: {
318
+ txType?: string
319
+ paramName?: string
320
+ } = {},
321
+ ): asserts tx is T & { [P in K]: V } {
322
+ const paramNameStr = errorOpts.paramName ?? param
323
+ const txType = errorOpts.txType ?? tx.TransactionType
324
+ if (tx[param] == null) {
229
325
  throw new ValidationError(
230
- `${tx.TransactionType}: missing field ${paramName}`,
326
+ `${txType}: missing field ${String(paramNameStr)}`,
231
327
  )
232
328
  }
233
329
 
234
- if (!checkValidity(tx[paramName])) {
330
+ if (!checkValidity(tx[param])) {
235
331
  throw new ValidationError(
236
- `${tx.TransactionType}: invalid field ${paramName}`,
332
+ `${txType}: invalid field ${String(paramNameStr)}`,
237
333
  )
238
334
  }
239
335
  }
@@ -242,31 +338,50 @@ export function validateRequiredField(
242
338
  * Verify the form and type of an optional type for a transaction at runtime.
243
339
  *
244
340
  * @param tx - The transaction input to check the form and type of.
245
- * @param paramName - The name of the transaction parameter.
341
+ * @param param - The object parameter.
246
342
  * @param checkValidity - The function to use to check the type.
247
- * @throws
343
+ * @param errorOpts - Extra values to make the error message easier to understand.
344
+ * @param errorOpts.txType - The transaction type throwing the error.
345
+ * @param errorOpts.paramName - The name of the parameter in the transaction with the error.
346
+ * @throws ValidationError if the parameter is invalid.
248
347
  */
249
- export function validateOptionalField(
250
- tx: Record<string, unknown>,
251
- paramName: string,
252
- checkValidity: (inp: unknown) => boolean,
253
- ): void {
254
- if (tx[paramName] !== undefined && !checkValidity(tx[paramName])) {
348
+ // eslint-disable-next-line max-params -- helper function
349
+ export function validateOptionalField<
350
+ T extends Record<string, unknown>,
351
+ K extends keyof T,
352
+ V,
353
+ >(
354
+ tx: T,
355
+ param: K,
356
+ checkValidity: (inp: unknown) => inp is V,
357
+ errorOpts: {
358
+ txType?: string
359
+ paramName?: string
360
+ } = {},
361
+ ): asserts tx is T & { [P in K]: V | undefined } {
362
+ const paramNameStr = errorOpts.paramName ?? param
363
+ const txType = errorOpts.txType ?? tx.TransactionType
364
+ if (tx[param] !== undefined && !checkValidity(tx[param])) {
255
365
  throw new ValidationError(
256
- `${tx.TransactionType}: invalid field ${paramName}`,
366
+ `${txType}: invalid field ${String(paramNameStr)}`,
257
367
  )
258
368
  }
259
369
  }
260
370
 
261
371
  /* eslint-enable @typescript-eslint/restrict-template-expressions -- checked before */
262
372
 
263
- // eslint-disable-next-line @typescript-eslint/no-empty-interface -- no global flags right now, so this is fine
264
- export interface GlobalFlags {}
373
+ export enum GlobalFlags {
374
+ tfInnerBatchTxn = 0x40000000,
375
+ }
376
+
377
+ export interface GlobalFlagsInterface {
378
+ tfInnerBatchTxn?: boolean
379
+ }
265
380
 
266
381
  /**
267
382
  * Every transaction has the same set of common fields.
268
383
  */
269
- export interface BaseTransaction {
384
+ export interface BaseTransaction extends Record<string, unknown> {
270
385
  /** The unique address of the transaction sender. */
271
386
  Account: Account
272
387
  /**
@@ -294,7 +409,7 @@ export interface BaseTransaction {
294
409
  */
295
410
  AccountTxnID?: string
296
411
  /** Set of bit-flags for this transaction. */
297
- Flags?: number | GlobalFlags
412
+ Flags?: number | GlobalFlagsInterface
298
413
  /**
299
414
  * Highest ledger index this transaction can appear in. Specifying this field
300
415
  * places a strict upper limit on how long the transaction can wait to be
@@ -351,8 +466,16 @@ export interface BaseTransaction {
351
466
  * @param common - An interface w/ common transaction fields.
352
467
  * @throws When the common param is malformed.
353
468
  */
354
- // eslint-disable-next-line max-statements -- lines required for validation
355
- export function validateBaseTransaction(common: Record<string, unknown>): void {
469
+ // eslint-disable-next-line max-statements, max-lines-per-function -- lines required for validation
470
+ export function validateBaseTransaction(
471
+ common: unknown,
472
+ ): asserts common is BaseTransaction {
473
+ if (!isRecord(common)) {
474
+ throw new ValidationError(
475
+ 'BaseTransaction: invalid, expected a valid object',
476
+ )
477
+ }
478
+
356
479
  if (common.TransactionType === undefined) {
357
480
  throw new ValidationError('BaseTransaction: missing field TransactionType')
358
481
  }
@@ -362,7 +485,9 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
362
485
  }
363
486
 
364
487
  if (!TRANSACTION_TYPES.includes(common.TransactionType)) {
365
- throw new ValidationError('BaseTransaction: Unknown TransactionType')
488
+ throw new ValidationError(
489
+ `BaseTransaction: Unknown TransactionType ${common.TransactionType}`,
490
+ )
366
491
  }
367
492
 
368
493
  validateRequiredField(common, 'Account', isString)
@@ -375,18 +500,16 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
375
500
 
376
501
  validateOptionalField(common, 'LastLedgerSequence', isNumber)
377
502
 
378
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Only used by JS
379
- const memos = common.Memos as Array<{ Memo?: unknown }> | undefined
380
- if (memos !== undefined && !memos.every(isMemo)) {
503
+ const memos = common.Memos
504
+ if (memos != null && (!isArray(memos) || !memos.every(isMemo))) {
381
505
  throw new ValidationError('BaseTransaction: invalid Memos')
382
506
  }
383
507
 
384
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Only used by JS
385
- const signers = common.Signers as Array<Record<string, unknown>> | undefined
508
+ const signers = common.Signers
386
509
 
387
510
  if (
388
- signers !== undefined &&
389
- (signers.length === 0 || !signers.every(isSigner))
511
+ signers != null &&
512
+ (!isArray(signers) || signers.length === 0 || !signers.every(isSigner))
390
513
  ) {
391
514
  throw new ValidationError('BaseTransaction: invalid Signers')
392
515
  }
@@ -433,7 +556,9 @@ export function parseAmountValue(amount: unknown): number {
433
556
  * @param tx A CredentialType Transaction.
434
557
  * @throws when the CredentialType is malformed.
435
558
  */
436
- export function validateCredentialType(tx: Record<string, unknown>): void {
559
+ export function validateCredentialType<
560
+ T extends BaseTransaction & Record<string, unknown>,
561
+ >(tx: T): void {
437
562
  if (typeof tx.TransactionType !== 'string') {
438
563
  throw new ValidationError('Invalid TransactionType')
439
564
  }
@@ -475,7 +600,7 @@ export function validateCredentialType(tx: Record<string, unknown>): void {
475
600
  * PermissionedDomainSet transaction uses 10, other transactions use 8.
476
601
  * @throws Validation Error if the formatting is incorrect
477
602
  */
478
- // eslint-disable-next-line max-lines-per-function, max-params -- separating logic further will add unnecessary complexity
603
+ // eslint-disable-next-line max-params, max-lines-per-function -- separating logic further will add unnecessary complexity
479
604
  export function validateCredentialsList(
480
605
  credentials: unknown,
481
606
  transactionType: string,
@@ -485,7 +610,7 @@ export function validateCredentialsList(
485
610
  if (credentials == null) {
486
611
  return
487
612
  }
488
- if (!Array.isArray(credentials)) {
613
+ if (!isArray(credentials)) {
489
614
  throw new ValidationError(
490
615
  `${transactionType}: Credentials must be an array`,
491
616
  )
@@ -512,7 +637,8 @@ export function validateCredentialsList(
512
637
  )
513
638
  }
514
639
  })
515
- if (containsDuplicates(credentials)) {
640
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- checked above
641
+ if (containsDuplicates(credentials as string[] | AuthorizeCredential[])) {
516
642
  throw new ValidationError(
517
643
  `${transactionType}: Credentials cannot contain duplicate elements`,
518
644
  )
@@ -548,7 +674,6 @@ export function containsDuplicates(
548
674
  if (isAuthorizeCredentialArray(objectList)) {
549
675
  for (const item of objectList) {
550
676
  const key = `${item.Credential.Issuer}-${item.Credential.CredentialType}`
551
- // eslint-disable-next-line max-depth -- necessary to check for type-guards
552
677
  if (seen.has(key)) {
553
678
  return true
554
679
  }
@@ -15,6 +15,7 @@ const NON_DELEGATABLE_TRANSACTIONS = new Set([
15
15
  'SignerListSet',
16
16
  'DelegateSet',
17
17
  'AccountDelete',
18
+ 'Batch',
18
19
  // Pseudo transactions below:
19
20
  'EnableAmendment',
20
21
  'SetFee',
@@ -70,16 +70,14 @@ export function validateDepositPreauth(tx: Record<string, unknown>): void {
70
70
  } else if (tx.AuthorizeCredentials !== undefined) {
71
71
  validateCredentialsList(
72
72
  tx.AuthorizeCredentials,
73
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- confirmed in base transaction check
74
- tx.TransactionType as string,
73
+ tx.TransactionType,
75
74
  false,
76
75
  MAX_AUTHORIZED_CREDENTIALS,
77
76
  )
78
77
  } else if (tx.UnauthorizeCredentials !== undefined) {
79
78
  validateCredentialsList(
80
79
  tx.UnauthorizeCredentials,
81
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- confirmed in base transaction check
82
- tx.TransactionType as string,
80
+ tx.TransactionType,
83
81
  false,
84
82
  MAX_AUTHORIZED_CREDENTIALS,
85
83
  )
@@ -55,8 +55,7 @@ export function validateEscrowFinish(tx: Record<string, unknown>): void {
55
55
 
56
56
  validateCredentialsList(
57
57
  tx.CredentialIDs,
58
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- known from base check
59
- tx.TransactionType as string,
58
+ tx.TransactionType,
60
59
  true,
61
60
  MAX_AUTHORIZED_CREDENTIALS,
62
61
  )
@@ -33,6 +33,7 @@ export {
33
33
  AMMWithdrawFlagsInterface,
34
34
  AMMWithdraw,
35
35
  } from './AMMWithdraw'
36
+ export { Batch } from './batch'
36
37
  export { CheckCancel } from './checkCancel'
37
38
  export { CheckCash } from './checkCash'
38
39
  export { CheckCreate } from './checkCreate'
@@ -94,12 +95,25 @@ export {
94
95
  } from './paymentChannelClaim'
95
96
  export { PaymentChannelCreate } from './paymentChannelCreate'
96
97
  export { PaymentChannelFund } from './paymentChannelFund'
98
+ export { PermissionedDomainSet } from './permissionedDomainSet'
99
+ export { PermissionedDomainDelete } from './permissionedDomainDelete'
97
100
  export { SetFee, SetFeePreAmendment, SetFeePostAmendment } from './setFee'
98
101
  export { SetRegularKey } from './setRegularKey'
99
102
  export { SignerListSet } from './signerListSet'
100
103
  export { TicketCreate } from './ticketCreate'
101
104
  export { TrustSetFlagsInterface, TrustSetFlags, TrustSet } from './trustSet'
102
105
  export { UNLModify } from './UNLModify'
106
+ export { VaultClawback } from './vaultClawback'
107
+ export {
108
+ VaultCreate,
109
+ VaultCreateFlags,
110
+ VaultCreateFlagsInterface,
111
+ VaultWithdrawalPolicy,
112
+ } from './vaultCreate'
113
+ export { VaultDelete } from './vaultDelete'
114
+ export { VaultDeposit } from './vaultDeposit'
115
+ export { VaultSet } from './vaultSet'
116
+ export { VaultWithdraw } from './vaultWithdraw'
103
117
  export { XChainAddAccountCreateAttestation } from './XChainAddAccountCreateAttestation'
104
118
  export { XChainAddClaimAttestation } from './XChainAddClaimAttestation'
105
119
  export { XChainClaim } from './XChainClaim'
@@ -112,6 +126,3 @@ export {
112
126
  XChainModifyBridgeFlags,
113
127
  XChainModifyBridgeFlagsInterface,
114
128
  } from './XChainModifyBridge'
115
-
116
- export { PermissionedDomainSet } from './permissionedDomainSet'
117
- export { PermissionedDomainDelete } from './permissionedDomainDelete'
@@ -88,6 +88,8 @@ export interface TransactionMetadataBase {
88
88
  delivered_amount?: Amount | MPTAmount | 'unavailable'
89
89
  TransactionIndex: number
90
90
  TransactionResult: string
91
+
92
+ ParentBatchID?: string
91
93
  }
92
94
 
93
95
  export type TransactionMetadata<T extends BaseTransaction = Transaction> =
@@ -3,7 +3,7 @@ import { Amount } from '../common'
3
3
 
4
4
  import {
5
5
  BaseTransaction,
6
- GlobalFlags,
6
+ GlobalFlagsInterface,
7
7
  validateBaseTransaction,
8
8
  isAmount,
9
9
  } from './common'
@@ -78,7 +78,7 @@ export enum OfferCreateFlags {
78
78
  * // }
79
79
  * ```
80
80
  */
81
- export interface OfferCreateFlagsInterface extends GlobalFlags {
81
+ export interface OfferCreateFlagsInterface extends GlobalFlagsInterface {
82
82
  tfPassive?: boolean
83
83
  tfImmediateOrCancel?: boolean
84
84
  tfFillOrKill?: boolean