xrpl 2.11.0 → 2.12.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 (318) hide show
  1. package/build/xrpl-latest-min.js +1 -1
  2. package/build/xrpl-latest-min.js.map +1 -1
  3. package/build/xrpl-latest.js +453 -51
  4. package/build/xrpl-latest.js.map +1 -1
  5. package/dist/npm/models/common/index.d.ts +8 -1
  6. package/dist/npm/models/common/index.d.ts.map +1 -1
  7. package/dist/npm/models/ledger/AMM.d.ts +5 -3
  8. package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
  9. package/dist/npm/models/ledger/AccountRoot.d.ts +1 -0
  10. package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
  11. package/dist/npm/models/ledger/AccountRoot.js.map +1 -1
  12. package/dist/npm/models/ledger/Bridge.d.ts +17 -0
  13. package/dist/npm/models/ledger/Bridge.d.ts.map +1 -0
  14. package/dist/npm/models/ledger/Bridge.js +3 -0
  15. package/dist/npm/models/ledger/Bridge.js.map +1 -0
  16. package/dist/npm/models/ledger/LedgerEntry.d.ts +4 -1
  17. package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
  18. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +26 -0
  19. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -0
  20. package/dist/npm/models/ledger/XChainOwnedClaimID.js +3 -0
  21. package/dist/npm/models/ledger/XChainOwnedClaimID.js.map +1 -0
  22. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +23 -0
  23. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -0
  24. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.js +3 -0
  25. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.js.map +1 -0
  26. package/dist/npm/models/ledger/index.d.ts +5 -1
  27. package/dist/npm/models/ledger/index.d.ts.map +1 -1
  28. package/dist/npm/models/ledger/index.js.map +1 -1
  29. package/dist/npm/models/methods/accountObjects.d.ts +3 -3
  30. package/dist/npm/models/methods/accountObjects.d.ts.map +1 -1
  31. package/dist/npm/models/methods/ammInfo.d.ts +4 -3
  32. package/dist/npm/models/methods/ammInfo.d.ts.map +1 -1
  33. package/dist/npm/models/methods/ledgerEntry.d.ts +17 -0
  34. package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
  35. package/dist/npm/models/methods/serverInfo.d.ts +6 -0
  36. package/dist/npm/models/methods/serverInfo.d.ts.map +1 -1
  37. package/dist/npm/models/transactions/AMMBid.d.ts +3 -3
  38. package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -1
  39. package/dist/npm/models/transactions/AMMBid.js.map +1 -1
  40. package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
  41. package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
  42. package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -1
  43. package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -1
  44. package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts +11 -0
  45. package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -0
  46. package/dist/npm/models/transactions/XChainAccountCreateCommit.js +14 -0
  47. package/dist/npm/models/transactions/XChainAccountCreateCommit.js.map +1 -0
  48. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts +18 -0
  49. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -0
  50. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js +20 -0
  51. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -0
  52. package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts +17 -0
  53. package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -0
  54. package/dist/npm/models/transactions/XChainAddClaimAttestation.js +19 -0
  55. package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -0
  56. package/dist/npm/models/transactions/XChainClaim.d.ts +12 -0
  57. package/dist/npm/models/transactions/XChainClaim.d.ts.map +1 -0
  58. package/dist/npm/models/transactions/XChainClaim.js +14 -0
  59. package/dist/npm/models/transactions/XChainClaim.js.map +1 -0
  60. package/dist/npm/models/transactions/XChainCommit.d.ts +11 -0
  61. package/dist/npm/models/transactions/XChainCommit.d.ts.map +1 -0
  62. package/dist/npm/models/transactions/XChainCommit.js +13 -0
  63. package/dist/npm/models/transactions/XChainCommit.js.map +1 -0
  64. package/dist/npm/models/transactions/XChainCreateBridge.d.ts +10 -0
  65. package/dist/npm/models/transactions/XChainCreateBridge.d.ts.map +1 -0
  66. package/dist/npm/models/transactions/XChainCreateBridge.js +12 -0
  67. package/dist/npm/models/transactions/XChainCreateBridge.js.map +1 -0
  68. package/dist/npm/models/transactions/XChainCreateClaimID.d.ts +10 -0
  69. package/dist/npm/models/transactions/XChainCreateClaimID.d.ts.map +1 -0
  70. package/dist/npm/models/transactions/XChainCreateClaimID.js +12 -0
  71. package/dist/npm/models/transactions/XChainCreateClaimID.js.map +1 -0
  72. package/dist/npm/models/transactions/XChainModifyBridge.d.ts +17 -0
  73. package/dist/npm/models/transactions/XChainModifyBridge.d.ts.map +1 -0
  74. package/dist/npm/models/transactions/XChainModifyBridge.js +16 -0
  75. package/dist/npm/models/transactions/XChainModifyBridge.js.map +1 -0
  76. package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
  77. package/dist/npm/models/transactions/accountSet.js.map +1 -1
  78. package/dist/npm/models/transactions/checkCash.d.ts.map +1 -1
  79. package/dist/npm/models/transactions/checkCash.js.map +1 -1
  80. package/dist/npm/models/transactions/checkCreate.d.ts.map +1 -1
  81. package/dist/npm/models/transactions/checkCreate.js.map +1 -1
  82. package/dist/npm/models/transactions/common.d.ts +6 -1
  83. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  84. package/dist/npm/models/transactions/common.js +43 -38
  85. package/dist/npm/models/transactions/common.js.map +1 -1
  86. package/dist/npm/models/transactions/depositPreauth.d.ts.map +1 -1
  87. package/dist/npm/models/transactions/depositPreauth.js.map +1 -1
  88. package/dist/npm/models/transactions/escrowCancel.d.ts +1 -1
  89. package/dist/npm/models/transactions/escrowCancel.d.ts.map +1 -1
  90. package/dist/npm/models/transactions/escrowCancel.js +5 -3
  91. package/dist/npm/models/transactions/escrowCancel.js.map +1 -1
  92. package/dist/npm/models/transactions/escrowCreate.d.ts.map +1 -1
  93. package/dist/npm/models/transactions/escrowCreate.js.map +1 -1
  94. package/dist/npm/models/transactions/escrowFinish.d.ts +1 -1
  95. package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
  96. package/dist/npm/models/transactions/escrowFinish.js +5 -3
  97. package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
  98. package/dist/npm/models/transactions/index.d.ts +9 -1
  99. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  100. package/dist/npm/models/transactions/index.js +3 -1
  101. package/dist/npm/models/transactions/index.js.map +1 -1
  102. package/dist/npm/models/transactions/offerCreate.d.ts.map +1 -1
  103. package/dist/npm/models/transactions/offerCreate.js.map +1 -1
  104. package/dist/npm/models/transactions/payment.d.ts.map +1 -1
  105. package/dist/npm/models/transactions/payment.js.map +1 -1
  106. package/dist/npm/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  107. package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
  108. package/dist/npm/models/transactions/paymentChannelCreate.d.ts.map +1 -1
  109. package/dist/npm/models/transactions/paymentChannelCreate.js.map +1 -1
  110. package/dist/npm/models/transactions/signerListSet.d.ts.map +1 -1
  111. package/dist/npm/models/transactions/signerListSet.js.map +1 -1
  112. package/dist/npm/models/transactions/transaction.d.ts +9 -1
  113. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  114. package/dist/npm/models/transactions/transaction.js +32 -0
  115. package/dist/npm/models/transactions/transaction.js.map +1 -1
  116. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  117. package/dist/npm/models/utils/flags.js +4 -0
  118. package/dist/npm/models/utils/flags.js.map +1 -1
  119. package/dist/npm/snippets/src/bridgeTransfer.d.ts +2 -0
  120. package/dist/npm/snippets/src/bridgeTransfer.d.ts.map +1 -0
  121. package/dist/npm/snippets/src/bridgeTransfer.js +126 -0
  122. package/dist/npm/snippets/src/bridgeTransfer.js.map +1 -0
  123. package/dist/npm/src/models/common/index.d.ts +8 -1
  124. package/dist/npm/src/models/common/index.d.ts.map +1 -1
  125. package/dist/npm/src/models/ledger/AMM.d.ts +5 -3
  126. package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
  127. package/dist/npm/src/models/ledger/AccountRoot.d.ts +1 -0
  128. package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
  129. package/dist/npm/src/models/ledger/AccountRoot.js.map +1 -1
  130. package/dist/npm/src/models/ledger/Bridge.d.ts +17 -0
  131. package/dist/npm/src/models/ledger/Bridge.d.ts.map +1 -0
  132. package/dist/npm/src/models/ledger/Bridge.js +3 -0
  133. package/dist/npm/src/models/ledger/Bridge.js.map +1 -0
  134. package/dist/npm/src/models/ledger/LedgerEntry.d.ts +4 -1
  135. package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
  136. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +26 -0
  137. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -0
  138. package/dist/npm/src/models/ledger/XChainOwnedClaimID.js +3 -0
  139. package/dist/npm/src/models/ledger/XChainOwnedClaimID.js.map +1 -0
  140. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +23 -0
  141. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -0
  142. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.js +3 -0
  143. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.js.map +1 -0
  144. package/dist/npm/src/models/ledger/index.d.ts +5 -1
  145. package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
  146. package/dist/npm/src/models/ledger/index.js.map +1 -1
  147. package/dist/npm/src/models/methods/accountObjects.d.ts +3 -3
  148. package/dist/npm/src/models/methods/accountObjects.d.ts.map +1 -1
  149. package/dist/npm/src/models/methods/ammInfo.d.ts +4 -3
  150. package/dist/npm/src/models/methods/ammInfo.d.ts.map +1 -1
  151. package/dist/npm/src/models/methods/ledgerEntry.d.ts +17 -0
  152. package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
  153. package/dist/npm/src/models/methods/serverInfo.d.ts +6 -0
  154. package/dist/npm/src/models/methods/serverInfo.d.ts.map +1 -1
  155. package/dist/npm/src/models/transactions/AMMBid.d.ts +3 -3
  156. package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -1
  157. package/dist/npm/src/models/transactions/AMMBid.js.map +1 -1
  158. package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
  159. package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
  160. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -1
  161. package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -1
  162. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts +11 -0
  163. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -0
  164. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js +14 -0
  165. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js.map +1 -0
  166. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts +18 -0
  167. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -0
  168. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js +20 -0
  169. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -0
  170. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts +17 -0
  171. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -0
  172. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js +19 -0
  173. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -0
  174. package/dist/npm/src/models/transactions/XChainClaim.d.ts +12 -0
  175. package/dist/npm/src/models/transactions/XChainClaim.d.ts.map +1 -0
  176. package/dist/npm/src/models/transactions/XChainClaim.js +14 -0
  177. package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -0
  178. package/dist/npm/src/models/transactions/XChainCommit.d.ts +11 -0
  179. package/dist/npm/src/models/transactions/XChainCommit.d.ts.map +1 -0
  180. package/dist/npm/src/models/transactions/XChainCommit.js +13 -0
  181. package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -0
  182. package/dist/npm/src/models/transactions/XChainCreateBridge.d.ts +10 -0
  183. package/dist/npm/src/models/transactions/XChainCreateBridge.d.ts.map +1 -0
  184. package/dist/npm/src/models/transactions/XChainCreateBridge.js +12 -0
  185. package/dist/npm/src/models/transactions/XChainCreateBridge.js.map +1 -0
  186. package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts +10 -0
  187. package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts.map +1 -0
  188. package/dist/npm/src/models/transactions/XChainCreateClaimID.js +12 -0
  189. package/dist/npm/src/models/transactions/XChainCreateClaimID.js.map +1 -0
  190. package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts +17 -0
  191. package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts.map +1 -0
  192. package/dist/npm/src/models/transactions/XChainModifyBridge.js +16 -0
  193. package/dist/npm/src/models/transactions/XChainModifyBridge.js.map +1 -0
  194. package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
  195. package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
  196. package/dist/npm/src/models/transactions/checkCash.d.ts.map +1 -1
  197. package/dist/npm/src/models/transactions/checkCash.js.map +1 -1
  198. package/dist/npm/src/models/transactions/checkCreate.d.ts.map +1 -1
  199. package/dist/npm/src/models/transactions/checkCreate.js.map +1 -1
  200. package/dist/npm/src/models/transactions/common.d.ts +6 -1
  201. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  202. package/dist/npm/src/models/transactions/common.js +43 -38
  203. package/dist/npm/src/models/transactions/common.js.map +1 -1
  204. package/dist/npm/src/models/transactions/depositPreauth.d.ts.map +1 -1
  205. package/dist/npm/src/models/transactions/depositPreauth.js.map +1 -1
  206. package/dist/npm/src/models/transactions/escrowCancel.d.ts +1 -1
  207. package/dist/npm/src/models/transactions/escrowCancel.d.ts.map +1 -1
  208. package/dist/npm/src/models/transactions/escrowCancel.js +5 -3
  209. package/dist/npm/src/models/transactions/escrowCancel.js.map +1 -1
  210. package/dist/npm/src/models/transactions/escrowCreate.d.ts.map +1 -1
  211. package/dist/npm/src/models/transactions/escrowCreate.js.map +1 -1
  212. package/dist/npm/src/models/transactions/escrowFinish.d.ts +1 -1
  213. package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
  214. package/dist/npm/src/models/transactions/escrowFinish.js +5 -3
  215. package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
  216. package/dist/npm/src/models/transactions/index.d.ts +9 -1
  217. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  218. package/dist/npm/src/models/transactions/index.js +3 -1
  219. package/dist/npm/src/models/transactions/index.js.map +1 -1
  220. package/dist/npm/src/models/transactions/offerCreate.d.ts.map +1 -1
  221. package/dist/npm/src/models/transactions/offerCreate.js.map +1 -1
  222. package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
  223. package/dist/npm/src/models/transactions/payment.js.map +1 -1
  224. package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  225. package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
  226. package/dist/npm/src/models/transactions/paymentChannelCreate.d.ts.map +1 -1
  227. package/dist/npm/src/models/transactions/paymentChannelCreate.js.map +1 -1
  228. package/dist/npm/src/models/transactions/signerListSet.d.ts.map +1 -1
  229. package/dist/npm/src/models/transactions/signerListSet.js.map +1 -1
  230. package/dist/npm/src/models/transactions/transaction.d.ts +9 -1
  231. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  232. package/dist/npm/src/models/transactions/transaction.js +32 -0
  233. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  234. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  235. package/dist/npm/src/models/utils/flags.js +4 -0
  236. package/dist/npm/src/models/utils/flags.js.map +1 -1
  237. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  238. package/dist/npm/src/sugar/autofill.js.map +1 -1
  239. package/dist/npm/src/utils/getXChainClaimID.d.ts +3 -0
  240. package/dist/npm/src/utils/getXChainClaimID.d.ts.map +1 -0
  241. package/dist/npm/src/utils/getXChainClaimID.js +29 -0
  242. package/dist/npm/src/utils/getXChainClaimID.js.map +1 -0
  243. package/dist/npm/src/utils/index.d.ts +2 -1
  244. package/dist/npm/src/utils/index.d.ts.map +1 -1
  245. package/dist/npm/src/utils/index.js +3 -1
  246. package/dist/npm/src/utils/index.js.map +1 -1
  247. package/dist/npm/src/utils/signPaymentChannelClaim.d.ts +1 -1
  248. package/dist/npm/src/utils/signPaymentChannelClaim.d.ts.map +1 -1
  249. package/dist/npm/src/utils/signPaymentChannelClaim.js +2 -2
  250. package/dist/npm/src/utils/signPaymentChannelClaim.js.map +1 -1
  251. package/dist/npm/src/utils/verifyPaymentChannelClaim.d.ts +1 -1
  252. package/dist/npm/src/utils/verifyPaymentChannelClaim.d.ts.map +1 -1
  253. package/dist/npm/src/utils/verifyPaymentChannelClaim.js +2 -2
  254. package/dist/npm/src/utils/verifyPaymentChannelClaim.js.map +1 -1
  255. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  256. package/dist/npm/sugar/autofill.js.map +1 -1
  257. package/dist/npm/utils/getXChainClaimID.d.ts +3 -0
  258. package/dist/npm/utils/getXChainClaimID.d.ts.map +1 -0
  259. package/dist/npm/utils/getXChainClaimID.js +29 -0
  260. package/dist/npm/utils/getXChainClaimID.js.map +1 -0
  261. package/dist/npm/utils/index.d.ts +2 -1
  262. package/dist/npm/utils/index.d.ts.map +1 -1
  263. package/dist/npm/utils/index.js +3 -1
  264. package/dist/npm/utils/index.js.map +1 -1
  265. package/dist/npm/utils/signPaymentChannelClaim.d.ts +1 -1
  266. package/dist/npm/utils/signPaymentChannelClaim.d.ts.map +1 -1
  267. package/dist/npm/utils/signPaymentChannelClaim.js +2 -2
  268. package/dist/npm/utils/signPaymentChannelClaim.js.map +1 -1
  269. package/dist/npm/utils/verifyPaymentChannelClaim.d.ts +1 -1
  270. package/dist/npm/utils/verifyPaymentChannelClaim.d.ts.map +1 -1
  271. package/dist/npm/utils/verifyPaymentChannelClaim.js +2 -2
  272. package/dist/npm/utils/verifyPaymentChannelClaim.js.map +1 -1
  273. package/package.json +6 -7
  274. package/src/models/common/index.ts +9 -1
  275. package/src/models/ledger/AMM.ts +11 -3
  276. package/src/models/ledger/AccountRoot.ts +6 -0
  277. package/src/models/ledger/Bridge.ts +84 -0
  278. package/src/models/ledger/LedgerEntry.ts +6 -0
  279. package/src/models/ledger/XChainOwnedClaimID.ts +89 -0
  280. package/src/models/ledger/XChainOwnedCreateAccountClaimID.ts +74 -0
  281. package/src/models/ledger/index.ts +9 -0
  282. package/src/models/methods/accountObjects.ts +12 -0
  283. package/src/models/methods/ammInfo.ts +8 -3
  284. package/src/models/methods/ledgerEntry.ts +25 -0
  285. package/src/models/methods/serverInfo.ts +21 -0
  286. package/src/models/transactions/AMMBid.ts +5 -6
  287. package/src/models/transactions/AMMDeposit.ts +0 -1
  288. package/src/models/transactions/AMMWithdraw.ts +0 -1
  289. package/src/models/transactions/XChainAccountCreateCommit.ts +69 -0
  290. package/src/models/transactions/XChainAddAccountCreateAttestation.ts +121 -0
  291. package/src/models/transactions/XChainAddClaimAttestation.ts +115 -0
  292. package/src/models/transactions/XChainClaim.ts +77 -0
  293. package/src/models/transactions/XChainCommit.ts +74 -0
  294. package/src/models/transactions/XChainCreateBridge.ts +56 -0
  295. package/src/models/transactions/XChainCreateClaimID.ts +53 -0
  296. package/src/models/transactions/XChainModifyBridge.ts +77 -0
  297. package/src/models/transactions/accountSet.ts +0 -2
  298. package/src/models/transactions/checkCash.ts +0 -1
  299. package/src/models/transactions/checkCreate.ts +0 -1
  300. package/src/models/transactions/common.ts +108 -54
  301. package/src/models/transactions/depositPreauth.ts +0 -1
  302. package/src/models/transactions/escrowCancel.ts +8 -4
  303. package/src/models/transactions/escrowCreate.ts +0 -1
  304. package/src/models/transactions/escrowFinish.ts +8 -4
  305. package/src/models/transactions/index.ts +13 -1
  306. package/src/models/transactions/offerCreate.ts +0 -1
  307. package/src/models/transactions/payment.ts +0 -1
  308. package/src/models/transactions/paymentChannelClaim.ts +0 -1
  309. package/src/models/transactions/paymentChannelCreate.ts +0 -1
  310. package/src/models/transactions/signerListSet.ts +0 -1
  311. package/src/models/transactions/transaction.ts +67 -1
  312. package/src/models/utils/flags.ts +4 -0
  313. package/src/sugar/autofill.ts +0 -2
  314. package/src/utils/getXChainClaimID.ts +64 -0
  315. package/src/utils/index.ts +2 -0
  316. package/src/utils/signPaymentChannelClaim.ts +3 -3
  317. package/src/utils/verifyPaymentChannelClaim.ts +3 -3
  318. package/dist/npm/snippets/tsconfig.tsbuildinfo +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xrpl",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "license": "ISC",
5
5
  "description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
6
6
  "files": [
@@ -28,9 +28,9 @@
28
28
  "bip39": "^3.0.4",
29
29
  "https-proxy-agent": "^5.0.0",
30
30
  "lodash": "^4.17.4",
31
- "ripple-address-codec": "^4.3.0",
32
- "ripple-binary-codec": "^1.9.0",
33
- "ripple-keypairs": "^1.3.0",
31
+ "ripple-address-codec": "^4.3.1",
32
+ "ripple-binary-codec": "^1.10.0",
33
+ "ripple-keypairs": "^1.3.1",
34
34
  "ws": "^8.2.2",
35
35
  "xrpl-secret-numbers": "^0.3.3"
36
36
  },
@@ -47,7 +47,7 @@
47
47
  "karma-webpack": "^5.0.0",
48
48
  "node-polyfill-webpack-plugin": "^2.0.1",
49
49
  "react": "^18.2.0",
50
- "typedoc": "^0.24.6"
50
+ "typedoc": "^0.25.0"
51
51
  },
52
52
  "resolutions": {
53
53
  "elliptic": "^6.5.4"
@@ -82,6 +82,5 @@
82
82
  "readmeFilename": "README.md",
83
83
  "engines": {
84
84
  "node": ">=10.13.0"
85
- },
86
- "gitHead": "37fbc03584f4671317576a97ad2cdb3f6c1e1bed"
85
+ }
87
86
  }
@@ -2,6 +2,7 @@ export type LedgerIndex = number | ('validated' | 'closed' | 'current')
2
2
 
3
3
  export interface XRP {
4
4
  currency: 'XRP'
5
+ issuer?: never
5
6
  }
6
7
 
7
8
  export interface IssuedCurrency {
@@ -144,6 +145,13 @@ export interface NFToken {
144
145
 
145
146
  export interface AuthAccount {
146
147
  AuthAccount: {
147
- account: string
148
+ Account: string
148
149
  }
149
150
  }
151
+
152
+ export interface XChainBridge {
153
+ LockingChainDoor: string
154
+ LockingChainIssue: Currency
155
+ IssuingChainDoor: string
156
+ IssuingChainIssue: Currency
157
+ }
@@ -1,4 +1,4 @@
1
- import { AuthAccount, Currency } from '../common'
1
+ import { AuthAccount, Currency, IssuedCurrencyAmount } from '../common'
2
2
 
3
3
  import BaseLedgerEntry from './BaseLedgerEntry'
4
4
 
@@ -20,7 +20,7 @@ export default interface AMM extends BaseLedgerEntry {
20
20
  /**
21
21
  * The address of the special account that holds this AMM's assets.
22
22
  */
23
- AMMAccount: string
23
+ Account: string
24
24
  /**
25
25
  * The definition for one of the two assets this AMM holds.
26
26
  */
@@ -53,7 +53,7 @@ export default interface AMM extends BaseLedgerEntry {
53
53
  /**
54
54
  * The amount the auction owner paid to win this slot, in LP Tokens.
55
55
  */
56
- Price: Currency
56
+ Price: IssuedCurrencyAmount
57
57
  }
58
58
  /**
59
59
  * The total outstanding balance of liquidity provider tokens from this AMM instance.
@@ -75,4 +75,12 @@ export default interface AMM extends BaseLedgerEntry {
75
75
  * type, so this value is always 0.
76
76
  */
77
77
  Flags: 0
78
+ /**
79
+ * This field is missing on AMM but is present on all other account_object returned objects.
80
+ */
81
+ PreviousTxnID: never
82
+ /**
83
+ * This field is missing on AMM but is present on all other account_object returned objects.
84
+ */
85
+ PreviousTxnLgrSeq: never
78
86
  }
@@ -38,6 +38,12 @@ export default interface AccountRoot extends BaseLedgerEntry {
38
38
  * `asfAccountTxnID` flag enabled.
39
39
  */
40
40
  AccountTxnID?: string
41
+ /**
42
+ * The ledger entry ID of the corresponding AMM ledger entry.
43
+ * Set during account creation; cannot be modified.
44
+ * If present, indicates that this is a special AMM AccountRoot; always omitted on non-AMM accounts.
45
+ */
46
+ AMMID?: string
41
47
  /**
42
48
  * A domain associated with this account. In JSON, this is the hexadecimal
43
49
  * for the ASCII representation of the domain.
@@ -0,0 +1,84 @@
1
+ import { Amount, XChainBridge } from '../common'
2
+
3
+ import BaseLedgerEntry from './BaseLedgerEntry'
4
+
5
+ /**
6
+ * A Bridge objects represents a cross-chain bridge and includes information about
7
+ * the door accounts, assets, signature rewards, and the minimum account create
8
+ * amount.
9
+ *
10
+ * @category Ledger Entries
11
+ */
12
+ export default interface Bridge extends BaseLedgerEntry {
13
+ LedgerEntryType: 'Bridge'
14
+
15
+ /** The door account that owns the bridge. */
16
+ Account: string
17
+
18
+ /**
19
+ * The total amount, in XRP, to be rewarded for providing a signature for
20
+ * cross-chain transfer or for signing for the cross-chain reward. This amount
21
+ * will be split among the signers.
22
+ */
23
+ SignatureReward: Amount
24
+
25
+ /**
26
+ * The minimum amount, in XRP, required for an {@link XChainAccountCreateCommit}
27
+ * transaction. If this isn't present, the {@link XChainAccountCreateCommit}
28
+ * transaction will fail. This field can only be present on XRP-XRP bridges.
29
+ */
30
+ MinAccountCreateAmount?: string
31
+
32
+ /**
33
+ * The door accounts and assets of the bridge this object correlates to.
34
+ */
35
+ XChainBridge: XChainBridge
36
+
37
+ /**
38
+ * The value of the next XChainClaimID to be created.
39
+ */
40
+ XChainClaimID: string
41
+
42
+ /**
43
+ * A counter used to order the execution of account create transactions. It is
44
+ * incremented every time a successful {@link XChainAccountCreateCommit}
45
+ * transaction is run for the source chain.
46
+ */
47
+ XChainAccountCreateCount: string
48
+
49
+ /**
50
+ * A counter used to order the execution of account create transactions. It is
51
+ * incremented every time a {@link XChainAccountCreateCommit} transaction is
52
+ * "claimed" on the destination chain. When the "claim" transaction is run on
53
+ * the destination chain, the XChainAccountClaimCount must match the value that
54
+ * the XChainAccountCreateCount had at the time the XChainAccountClaimCount was
55
+ * run on the source chain. This orders the claims so that they run in the same
56
+ * order that the XChainAccountCreateCommit transactions ran on the source chain,
57
+ * to prevent transaction replay.
58
+ */
59
+ XChainAccountClaimCount: string
60
+
61
+ /**
62
+ * A bit-map of boolean flags. No flags are defined for Bridges, so this value
63
+ * is always 0.
64
+ */
65
+ Flags: 0
66
+
67
+ /**
68
+ * A hint indicating which page of the sender's owner directory links to this
69
+ * object, in case the directory consists of multiple pages.
70
+ */
71
+ OwnerNode: string
72
+
73
+ /**
74
+ * The identifying hash of the transaction that most recently modified this
75
+ * object.
76
+ */
77
+ PreviousTxnID: string
78
+
79
+ /**
80
+ * The index of the ledger that contains the transaction that most recently
81
+ * modified this object.
82
+ */
83
+ PreviousTxnLgrSeq: number
84
+ }
@@ -1,6 +1,7 @@
1
1
  import AccountRoot from './AccountRoot'
2
2
  import Amendments from './Amendments'
3
3
  import AMM from './AMM'
4
+ import Bridge from './Bridge'
4
5
  import Check from './Check'
5
6
  import DepositPreauth from './DepositPreauth'
6
7
  import DirectoryNode from './DirectoryNode'
@@ -13,11 +14,14 @@ import PayChannel from './PayChannel'
13
14
  import RippleState from './RippleState'
14
15
  import SignerList from './SignerList'
15
16
  import Ticket from './Ticket'
17
+ import XChainOwnedClaimID from './XChainOwnedClaimID'
18
+ import XChainOwnedCreateAccountClaimID from './XChainOwnedCreateAccountClaimID'
16
19
 
17
20
  type LedgerEntry =
18
21
  | AccountRoot
19
22
  | Amendments
20
23
  | AMM
24
+ | Bridge
21
25
  | Check
22
26
  | DepositPreauth
23
27
  | DirectoryNode
@@ -30,5 +34,7 @@ type LedgerEntry =
30
34
  | RippleState
31
35
  | SignerList
32
36
  | Ticket
37
+ | XChainOwnedClaimID
38
+ | XChainOwnedCreateAccountClaimID
33
39
 
34
40
  export default LedgerEntry
@@ -0,0 +1,89 @@
1
+ import { Amount } from 'ripple-binary-codec/dist/types'
2
+
3
+ import { XChainBridge } from '../common'
4
+
5
+ import BaseLedgerEntry from './BaseLedgerEntry'
6
+
7
+ /**
8
+ * An XChainOwnedClaimID object represents one cross-chain transfer of value
9
+ * and includes information of the account on the source chain that locks or
10
+ * burns the funds on the source chain.
11
+ *
12
+ * @category Ledger Entries
13
+ */
14
+ export default interface XChainOwnedClaimID extends BaseLedgerEntry {
15
+ LedgerEntryType: 'XChainOwnedClaimID'
16
+
17
+ /** The account that checked out this unique claim ID value. */
18
+ Account: string
19
+
20
+ /**
21
+ * The door accounts and assets of the bridge this object correlates to.
22
+ */
23
+ XChainBridge: XChainBridge
24
+
25
+ /**
26
+ * The unique sequence number for a cross-chain transfer.
27
+ */
28
+ XChainClaimID: string
29
+
30
+ /**
31
+ * The account that must send the corresponding {@link XChainCommit} on the
32
+ * source chain. The destination may be specified in the {@link XChainCommit}
33
+ * transaction, which means that if the OtherChainSource isn't specified,
34
+ * another account can try to specify a different destination and steal the
35
+ * funds. This also allows tracking only a single set of signatures, since we
36
+ * know which account will send the {@link XChainCommit} transaction.
37
+ */
38
+ OtherChainSource: string
39
+
40
+ /**
41
+ * Attestations collected from the witness servers. This includes the parameters
42
+ * needed to recreate the message that was signed, including the amount, which
43
+ * chain (locking or issuing), optional destination, and reward account for that
44
+ * signature.
45
+ */
46
+ XChainClaimAttestations: Array<{
47
+ // TODO: add docs
48
+ XChainClaimProofSig: {
49
+ Amount: Amount
50
+
51
+ AttestationRewardAccount: string
52
+
53
+ AttestationSignerAccount: string
54
+
55
+ Destination?: string
56
+
57
+ PublicKey: string
58
+
59
+ WasLockingChainSend: 0 | 1
60
+ }
61
+ }>
62
+
63
+ /**
64
+ * The total amount to pay the witness servers for their signatures. It must be at
65
+ * least the value of the SignatureReward in the {@link Bridge} ledger object.
66
+ */
67
+ SignatureReward: string
68
+
69
+ /**
70
+ * A bit-map of boolean flags. No flags are defined for XChainOwnedClaimIDs,
71
+ * so this value is always 0.
72
+ */
73
+ Flags: 0
74
+ /**
75
+ * A hint indicating which page of the sender's owner directory links to this
76
+ * object, in case the directory consists of multiple pages.
77
+ */
78
+ OwnerNode: string
79
+ /**
80
+ * The identifying hash of the transaction that most recently modified this
81
+ * object.
82
+ */
83
+ PreviousTxnID: string
84
+ /**
85
+ * The index of the ledger that contains the transaction that most recently
86
+ * modified this object.
87
+ */
88
+ PreviousTxnLgrSeq: number
89
+ }
@@ -0,0 +1,74 @@
1
+ import { XChainBridge } from '../common'
2
+
3
+ import BaseLedgerEntry from './BaseLedgerEntry'
4
+
5
+ /**
6
+ * The XChainOwnedCreateAccountClaimID ledger object is used to collect attestations
7
+ * for creating an account via a cross-chain transfer.
8
+ *
9
+ * @category Ledger Entries
10
+ */
11
+ export default interface XChainOwnedCreateAccountClaimID
12
+ extends BaseLedgerEntry {
13
+ LedgerEntryType: 'XChainOwnedCreateAccountClaimID'
14
+
15
+ /** The account that owns this object. */
16
+ Account: string
17
+
18
+ /**
19
+ * The door accounts and assets of the bridge this object correlates to.
20
+ */
21
+ XChainBridge: XChainBridge
22
+
23
+ /**
24
+ * An integer that determines the order that accounts created through
25
+ * cross-chain transfers must be performed. Smaller numbers must execute
26
+ * before larger numbers.
27
+ */
28
+ XChainAccountCreateCount: number
29
+
30
+ /**
31
+ * Attestations collected from the witness servers. This includes the parameters
32
+ * needed to recreate the message that was signed, including the amount, destination,
33
+ * signature reward amount, and reward account for that signature. With the
34
+ * exception of the reward account, all signatures must sign the message created with
35
+ * common parameters.
36
+ */
37
+ XChainCreateAccountAttestations: Array<{
38
+ // TODO: add docs
39
+ XChainCreateAccountProofSig: {
40
+ Amount: string
41
+
42
+ AttestationRewardAccount: string
43
+
44
+ AttestationSignerAccount: string
45
+
46
+ Destination: string
47
+
48
+ PublicKey: string
49
+
50
+ WasLockingChainSend: 0 | 1
51
+ }
52
+ }>
53
+
54
+ /**
55
+ * A bit-map of boolean flags. No flags are defined for,
56
+ * XChainOwnedCreateAccountClaimIDs, so this value is always 0.
57
+ */
58
+ Flags: 0
59
+ /**
60
+ * A hint indicating which page of the sender's owner directory links to this
61
+ * object, in case the directory consists of multiple pages.
62
+ */
63
+ OwnerNode: string
64
+ /**
65
+ * The identifying hash of the transaction that most recently modified this
66
+ * object.
67
+ */
68
+ PreviousTxnID: string
69
+ /**
70
+ * The index of the ledger that contains the transaction that most recently
71
+ * modified this object.
72
+ */
73
+ PreviousTxnLgrSeq: number
74
+ }
@@ -3,6 +3,8 @@ import AccountRoot, {
3
3
  AccountRootFlagsInterface,
4
4
  } from './AccountRoot'
5
5
  import Amendments, { Majority, AMENDMENTS_ID } from './Amendments'
6
+ import AMM, { VoteSlot } from './AMM'
7
+ import Bridge from './Bridge'
6
8
  import Check from './Check'
7
9
  import DepositPreauth from './DepositPreauth'
8
10
  import DirectoryNode from './DirectoryNode'
@@ -23,6 +25,8 @@ import PayChannel from './PayChannel'
23
25
  import RippleState, { RippleStateFlags } from './RippleState'
24
26
  import SignerList, { SignerListFlags } from './SignerList'
25
27
  import Ticket from './Ticket'
28
+ import XChainOwnedClaimID from './XChainOwnedClaimID'
29
+ import XChainOwnedCreateAccountClaimID from './XChainOwnedCreateAccountClaimID'
26
30
 
27
31
  export {
28
32
  AccountRoot,
@@ -30,6 +34,8 @@ export {
30
34
  AccountRootFlagsInterface,
31
35
  AMENDMENTS_ID,
32
36
  Amendments,
37
+ AMM,
38
+ Bridge,
33
39
  Check,
34
40
  DepositPreauth,
35
41
  DirectoryNode,
@@ -55,4 +61,7 @@ export {
55
61
  SignerList,
56
62
  SignerListFlags,
57
63
  Ticket,
64
+ XChainOwnedClaimID,
65
+ XChainOwnedCreateAccountClaimID,
66
+ VoteSlot,
58
67
  }
@@ -1,4 +1,6 @@
1
1
  import {
2
+ AMM,
3
+ Bridge,
2
4
  Check,
3
5
  DepositPreauth,
4
6
  Escrow,
@@ -7,11 +9,15 @@ import {
7
9
  RippleState,
8
10
  SignerList,
9
11
  Ticket,
12
+ XChainOwnedClaimID,
13
+ XChainOwnedCreateAccountClaimID,
10
14
  } from '../ledger'
11
15
 
12
16
  import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
13
17
 
14
18
  export type AccountObjectType =
19
+ | 'amm'
20
+ | 'bridge'
15
21
  | 'check'
16
22
  | 'deposit_preauth'
17
23
  | 'escrow'
@@ -21,6 +27,8 @@ export type AccountObjectType =
21
27
  | 'signer_list'
22
28
  | 'state'
23
29
  | 'ticket'
30
+ | 'xchain_owned_create_account_claim_id'
31
+ | 'xchain_owned_claim_id'
24
32
 
25
33
  /**
26
34
  * The account_objects command returns the raw ledger format for all objects
@@ -64,6 +72,8 @@ export interface AccountObjectsRequest
64
72
  * PayChannel, a SignerList, a Ticket, or a RippleState.
65
73
  */
66
74
  export type AccountObject =
75
+ | AMM
76
+ | Bridge
67
77
  | Check
68
78
  | DepositPreauth
69
79
  | Escrow
@@ -72,6 +82,8 @@ export type AccountObject =
72
82
  | SignerList
73
83
  | RippleState
74
84
  | Ticket
85
+ | XChainOwnedClaimID
86
+ | XChainOwnedCreateAccountClaimID
75
87
 
76
88
  /**
77
89
  * Response expected from an {@link AccountObjectsRequest}.
@@ -11,15 +11,20 @@ import { BaseRequest, BaseResponse } from './baseMethod'
11
11
  export interface AMMInfoRequest extends BaseRequest {
12
12
  command: 'amm_info'
13
13
 
14
+ /**
15
+ * The address of the AMM Account to look up.
16
+ */
17
+ amm_account?: string
18
+
14
19
  /**
15
20
  * One of the assets of the AMM pool to look up.
16
21
  */
17
- asset: Currency
22
+ asset?: Currency
18
23
 
19
24
  /**
20
25
  * The other asset of the AMM pool.
21
26
  */
22
- asset2: Currency
27
+ asset2?: Currency
23
28
  }
24
29
 
25
30
  /**
@@ -93,7 +98,7 @@ export interface AMMInfoResponse extends BaseResponse {
93
98
  * The amount, in LP Tokens, that the auction slot holder paid to win the auction slot.
94
99
  * This affects the price to outbid the current slot holder.
95
100
  */
96
- price: Amount
101
+ price: IssuedCurrencyAmount
97
102
 
98
103
  /**
99
104
  * The current 72-minute time interval this auction slot is in, from 0 to 19.
@@ -1,3 +1,4 @@
1
+ import { Currency, XChainBridge } from '../common'
1
2
  import { LedgerEntry } from '../ledger'
2
3
 
3
4
  import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
@@ -152,6 +153,30 @@ export interface LedgerEntryRequest extends BaseRequest, LookupByLedgerRequest {
152
153
  * Must be the object ID of the NFToken page, as hexadecimal
153
154
  */
154
155
  nft_page?: string
156
+
157
+ bridge_account?: string
158
+
159
+ bridge?: XChainBridge
160
+
161
+ xchain_owned_claim_id?:
162
+ | {
163
+ locking_chain_door: string
164
+ locking_chain_issue: Currency
165
+ issuing_chain_door: string
166
+ issuing_chain_issue: Currency
167
+ xchain_owned_claim_id: string | number
168
+ }
169
+ | string
170
+
171
+ xchain_owned_create_account_claim_id?:
172
+ | {
173
+ locking_chain_door: string
174
+ locking_chain_issue: Currency
175
+ issuing_chain_door: string
176
+ issuing_chain_issue: Currency
177
+ xchain_owned_create_account_claim_id: string | number
178
+ }
179
+ | string
155
180
  }
156
181
 
157
182
  /**
@@ -33,6 +33,22 @@ export interface JobType {
33
33
  in_progress?: number
34
34
  }
35
35
 
36
+ export type protocol =
37
+ | 'http'
38
+ | 'https'
39
+ | 'grpc'
40
+ | 'peer'
41
+ | 'ws'
42
+ | 'ws2'
43
+ | 'wss'
44
+ | 'wss2'
45
+
46
+ export interface ServerPort {
47
+ port: string
48
+ /** The values in protocol are sorted in alphabetical order */
49
+ protocol: protocol[]
50
+ }
51
+
36
52
  // The states for validating and proposing do not exist in the field state_accounting
37
53
  // See https://github.com/XRPLF/rippled/blob/develop/src/ripple/app/misc/NetworkOPs.cpp#L4545
38
54
  // https://github.com/XRPLF/rippled/blob/develop/src/ripple/app/misc/NetworkOPs.h#L66
@@ -181,6 +197,11 @@ export interface ServerInfoResponse extends BaseResponse {
181
197
  network_ledger?: 'waiting'
182
198
  /** How many other rippled servers this one is currently connected to. */
183
199
  peers: number
200
+ /**
201
+ * What Websocket/RPC ports rippled is listening on. This allows crawlers to build a richer topology without needing to
202
+ * port-scan nodes. For non-admin users (including peers), info about admin ports is excluded.
203
+ */
204
+ ports: ServerPort[]
184
205
  /**
185
206
  * Public key used to verify this server for peer-to-peer communications.
186
207
  * This node key pair is automatically generated by the server the first
@@ -1,6 +1,5 @@
1
- /* eslint-disable complexity -- required for validateAMMBid */
2
1
  import { ValidationError } from '../../errors'
3
- import { Amount, AuthAccount, Currency } from '../common'
2
+ import { AuthAccount, Currency, IssuedCurrencyAmount } from '../common'
4
3
 
5
4
  import {
6
5
  BaseTransaction,
@@ -33,18 +32,18 @@ export interface AMMBid extends BaseTransaction {
33
32
  Asset2: Currency
34
33
 
35
34
  /**
36
- * Pay at least this amount for the slot.
35
+ * Pay at least this LPToken amount for the slot.
37
36
  * Setting this value higher makes it harder for others to outbid you.
38
37
  * If omitted, pay the minimum necessary to win the bid.
39
38
  */
40
- BidMin?: Amount
39
+ BidMin?: IssuedCurrencyAmount
41
40
 
42
41
  /**
43
- * Pay at most this amount for the slot.
42
+ * Pay at most this LPToken amount for the slot.
44
43
  * If the cost to win the bid is higher than this amount, the transaction fails.
45
44
  * If omitted, pay as much as necessary to win the bid.
46
45
  */
47
- BidMax?: Amount
46
+ BidMax?: IssuedCurrencyAmount
48
47
 
49
48
  /**
50
49
  * A list of up to 4 additional accounts that you allow to trade at the discounted fee.
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- required for validateAMMDeposit */
2
1
  import { ValidationError } from '../../errors'
3
2
  import { Amount, Currency, IssuedCurrencyAmount } from '../common'
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- required for validateAMMWithdraw */
2
1
  import { ValidationError } from '../../errors'
3
2
  import { Amount, Currency, IssuedCurrencyAmount } from '../common'
4
3
 
@@ -0,0 +1,69 @@
1
+ import { isString } from 'lodash'
2
+
3
+ import { Amount, XChainBridge } from '../common'
4
+
5
+ import {
6
+ BaseTransaction,
7
+ isAmount,
8
+ isXChainBridge,
9
+ validateBaseTransaction,
10
+ validateRequiredField,
11
+ } from './common'
12
+
13
+ /**
14
+ * The XChainAccountCreateCommit transaction creates a new account on one of the
15
+ * chains a bridge connects, which serves as the bridge entrance for that chain.
16
+ *
17
+ * Warning: This transaction should only be executed if the witness attestations
18
+ * will be reliably delivered to the destination chain. If the signatures aren't
19
+ * delivered, then account creation will be blocked until attestations are received.
20
+ * This can be used maliciously; to disable this transaction on XRP-XRP bridges,
21
+ * the bridge's MinAccountCreateAmount shouldn't be present.
22
+ *
23
+ * @category Transaction Models
24
+ */
25
+ export interface XChainAccountCreateCommit extends BaseTransaction {
26
+ TransactionType: 'XChainAccountCreateCommit'
27
+
28
+ /**
29
+ * The bridge to create accounts for.
30
+ */
31
+ XChainBridge: XChainBridge
32
+
33
+ /**
34
+ * The amount, in XRP, to be used to reward the witness servers for providing
35
+ * signatures. This must match the amount on the {@link Bridge} ledger object.
36
+ */
37
+ SignatureReward: Amount
38
+
39
+ /**
40
+ * The destination account on the destination chain.
41
+ */
42
+ Destination: string
43
+
44
+ /**
45
+ * The amount, in XRP, to use for account creation. This must be greater than or
46
+ * equal to the MinAccountCreateAmount specified in the {@link Bridge} ledger object.
47
+ */
48
+ Amount: Amount
49
+ }
50
+
51
+ /**
52
+ * Verify the form and type of an XChainAccountCreateCommit at runtime.
53
+ *
54
+ * @param tx - An XChainAccountCreateCommit Transaction.
55
+ * @throws When the XChainAccountCreateCommit is malformed.
56
+ */
57
+ export function validateXChainAccountCreateCommit(
58
+ tx: Record<string, unknown>,
59
+ ): void {
60
+ validateBaseTransaction(tx)
61
+
62
+ validateRequiredField(tx, 'XChainBridge', isXChainBridge)
63
+
64
+ validateRequiredField(tx, 'SignatureReward', isAmount)
65
+
66
+ validateRequiredField(tx, 'Destination', isString)
67
+
68
+ validateRequiredField(tx, 'Amount', isAmount)
69
+ }