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
@@ -1,10 +1,14 @@
1
- /* eslint-disable max-lines-per-function -- Necessary for validateBaseTransaction */
2
- /* eslint-disable complexity -- Necessary for validateBaseTransaction */
3
- /* eslint-disable max-statements -- Necessary for validateBaseTransaction */
4
1
  import { TRANSACTION_TYPES } from 'ripple-binary-codec'
5
2
 
6
3
  import { ValidationError } from '../../errors'
7
- import { Amount, Currency, IssuedCurrencyAmount, Memo, Signer } from '../common'
4
+ import {
5
+ Amount,
6
+ Currency,
7
+ IssuedCurrencyAmount,
8
+ Memo,
9
+ Signer,
10
+ XChainBridge,
11
+ } from '../common'
8
12
  import { onlyHasFields } from '../utils'
9
13
 
10
14
  const MEMO_SIZE = 3
@@ -53,11 +57,32 @@ function isSigner(obj: unknown): boolean {
53
57
  const XRP_CURRENCY_SIZE = 1
54
58
  const ISSUE_SIZE = 2
55
59
  const ISSUED_CURRENCY_SIZE = 3
60
+ const XCHAIN_BRIDGE_SIZE = 4
56
61
 
57
62
  function isRecord(value: unknown): value is Record<string, unknown> {
58
63
  return value !== null && typeof value === 'object'
59
64
  }
60
65
 
66
+ /**
67
+ * Verify the form and type of a string at runtime.
68
+ *
69
+ * @param str - The object to check the form and type of.
70
+ * @returns Whether the string is properly formed.
71
+ */
72
+ export function isString(str: unknown): str is string {
73
+ return typeof str === 'string'
74
+ }
75
+
76
+ /**
77
+ * Verify the form and type of a number at runtime.
78
+ *
79
+ * @param num - The object to check the form and type of.
80
+ * @returns Whether the number is properly formed.
81
+ */
82
+ export function isNumber(num: unknown): num is number {
83
+ return typeof num === 'number'
84
+ }
85
+
61
86
  /**
62
87
  * Verify the form and type of an IssuedCurrency at runtime.
63
88
  *
@@ -103,6 +128,73 @@ export function isAmount(amount: unknown): amount is Amount {
103
128
  return typeof amount === 'string' || isIssuedCurrency(amount)
104
129
  }
105
130
 
131
+ /**
132
+ * Verify the form and type of an XChainBridge at runtime.
133
+ *
134
+ * @param input - The input to check the form and type of.
135
+ * @returns Whether the XChainBridge is properly formed.
136
+ */
137
+ export function isXChainBridge(input: unknown): input is XChainBridge {
138
+ return (
139
+ isRecord(input) &&
140
+ Object.keys(input).length === XCHAIN_BRIDGE_SIZE &&
141
+ typeof input.LockingChainDoor === 'string' &&
142
+ isCurrency(input.LockingChainIssue) &&
143
+ typeof input.IssuingChainDoor === 'string' &&
144
+ isCurrency(input.IssuingChainIssue)
145
+ )
146
+ }
147
+
148
+ /* eslint-disable @typescript-eslint/restrict-template-expressions -- tx.TransactionType is checked before any calls */
149
+
150
+ /**
151
+ * Verify the form and type of a required type for a transaction at runtime.
152
+ *
153
+ * @param tx - The transaction input to check the form and type of.
154
+ * @param paramName - The name of the transaction parameter.
155
+ * @param checkValidity - The function to use to check the type.
156
+ * @throws
157
+ */
158
+ export function validateRequiredField(
159
+ tx: Record<string, unknown>,
160
+ paramName: string,
161
+ checkValidity: (inp: unknown) => boolean,
162
+ ): void {
163
+ if (tx[paramName] == null) {
164
+ throw new ValidationError(
165
+ `${tx.TransactionType}: missing field ${paramName}`,
166
+ )
167
+ }
168
+
169
+ if (!checkValidity(tx[paramName])) {
170
+ throw new ValidationError(
171
+ `${tx.TransactionType}: invalid field ${paramName}`,
172
+ )
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Verify the form and type of an optional type for a transaction at runtime.
178
+ *
179
+ * @param tx - The transaction input to check the form and type of.
180
+ * @param paramName - The name of the transaction parameter.
181
+ * @param checkValidity - The function to use to check the type.
182
+ * @throws
183
+ */
184
+ export function validateOptionalField(
185
+ tx: Record<string, unknown>,
186
+ paramName: string,
187
+ checkValidity: (inp: unknown) => boolean,
188
+ ): void {
189
+ if (tx[paramName] !== undefined && !checkValidity(tx[paramName])) {
190
+ throw new ValidationError(
191
+ `${tx.TransactionType}: invalid field ${paramName}`,
192
+ )
193
+ }
194
+ }
195
+
196
+ /* eslint-enable @typescript-eslint/restrict-template-expressions -- checked before */
197
+
106
198
  // eslint-disable-next-line @typescript-eslint/no-empty-interface -- no global flags right now, so this is fine
107
199
  export interface GlobalFlags {}
108
200
 
@@ -191,14 +283,6 @@ export interface BaseTransaction {
191
283
  * @throws When the common param is malformed.
192
284
  */
193
285
  export function validateBaseTransaction(common: Record<string, unknown>): void {
194
- if (common.Account === undefined) {
195
- throw new ValidationError('BaseTransaction: missing field Account')
196
- }
197
-
198
- if (typeof common.Account !== 'string') {
199
- throw new ValidationError('BaseTransaction: Account not string')
200
- }
201
-
202
286
  if (common.TransactionType === undefined) {
203
287
  throw new ValidationError('BaseTransaction: missing field TransactionType')
204
288
  }
@@ -211,27 +295,15 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
211
295
  throw new ValidationError('BaseTransaction: Unknown TransactionType')
212
296
  }
213
297
 
214
- if (common.Fee !== undefined && typeof common.Fee !== 'string') {
215
- throw new ValidationError('BaseTransaction: invalid Fee')
216
- }
298
+ validateRequiredField(common, 'Account', isString)
217
299
 
218
- if (common.Sequence !== undefined && typeof common.Sequence !== 'number') {
219
- throw new ValidationError('BaseTransaction: invalid Sequence')
220
- }
300
+ validateOptionalField(common, 'Fee', isString)
221
301
 
222
- if (
223
- common.AccountTxnID !== undefined &&
224
- typeof common.AccountTxnID !== 'string'
225
- ) {
226
- throw new ValidationError('BaseTransaction: invalid AccountTxnID')
227
- }
302
+ validateOptionalField(common, 'Sequence', isNumber)
228
303
 
229
- if (
230
- common.LastLedgerSequence !== undefined &&
231
- typeof common.LastLedgerSequence !== 'number'
232
- ) {
233
- throw new ValidationError('BaseTransaction: invalid LastLedgerSequence')
234
- }
304
+ validateOptionalField(common, 'AccountTxnID', isString)
305
+
306
+ validateOptionalField(common, 'LastLedgerSequence', isNumber)
235
307
 
236
308
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Only used by JS
237
309
  const memos = common.Memos as Array<{ Memo?: unknown }> | undefined
@@ -249,33 +321,15 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
249
321
  throw new ValidationError('BaseTransaction: invalid Signers')
250
322
  }
251
323
 
252
- if (common.SourceTag !== undefined && typeof common.SourceTag !== 'number') {
253
- throw new ValidationError('BaseTransaction: invalid SourceTag')
254
- }
324
+ validateOptionalField(common, 'SourceTag', isNumber)
255
325
 
256
- if (
257
- common.SigningPubKey !== undefined &&
258
- typeof common.SigningPubKey !== 'string'
259
- ) {
260
- throw new ValidationError('BaseTransaction: invalid SigningPubKey')
261
- }
326
+ validateOptionalField(common, 'SigningPubKey', isString)
262
327
 
263
- if (
264
- common.TicketSequence !== undefined &&
265
- typeof common.TicketSequence !== 'number'
266
- ) {
267
- throw new ValidationError('BaseTransaction: invalid TicketSequence')
268
- }
328
+ validateOptionalField(common, 'TicketSequence', isNumber)
269
329
 
270
- if (
271
- common.TxnSignature !== undefined &&
272
- typeof common.TxnSignature !== 'string'
273
- ) {
274
- throw new ValidationError('BaseTransaction: invalid TxnSignature')
275
- }
276
- if (common.NetworkID !== undefined && typeof common.NetworkID !== 'number') {
277
- throw new ValidationError('BaseTransaction: invalid NetworkID')
278
- }
330
+ validateOptionalField(common, 'TxnSignature', isString)
331
+
332
+ validateOptionalField(common, 'NetworkID', isNumber)
279
333
  }
280
334
 
281
335
  /**
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- Necessary for validateDepositPreauth */
2
1
  import { ValidationError } from '../../errors'
3
2
 
4
3
  import { BaseTransaction, validateBaseTransaction } from './common'
@@ -15,7 +15,7 @@ export interface EscrowCancel extends BaseTransaction {
15
15
  * Transaction sequence (or Ticket number) of EscrowCreate transaction that.
16
16
  * created the escrow to cancel.
17
17
  */
18
- OfferSequence: number
18
+ OfferSequence: number | string
19
19
  }
20
20
 
21
21
  /**
@@ -27,7 +27,7 @@ export interface EscrowCancel extends BaseTransaction {
27
27
  export function validateEscrowCancel(tx: Record<string, unknown>): void {
28
28
  validateBaseTransaction(tx)
29
29
 
30
- if (tx.Owner === undefined) {
30
+ if (tx.Owner == null) {
31
31
  throw new ValidationError('EscrowCancel: missing Owner')
32
32
  }
33
33
 
@@ -35,11 +35,15 @@ export function validateEscrowCancel(tx: Record<string, unknown>): void {
35
35
  throw new ValidationError('EscrowCancel: Owner must be a string')
36
36
  }
37
37
 
38
- if (tx.OfferSequence === undefined) {
38
+ if (tx.OfferSequence == null) {
39
39
  throw new ValidationError('EscrowCancel: missing OfferSequence')
40
40
  }
41
41
 
42
- if (typeof tx.OfferSequence !== 'number') {
42
+ if (
43
+ (typeof tx.OfferSequence !== 'number' &&
44
+ typeof tx.OfferSequence !== 'string') ||
45
+ Number.isNaN(Number(tx.OfferSequence))
46
+ ) {
43
47
  throw new ValidationError('EscrowCancel: OfferSequence must be a number')
44
48
  }
45
49
  }
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- Necessary for validateEscrowCreate */
2
1
  import { ValidationError } from '../../errors'
3
2
 
4
3
  import { BaseTransaction, validateBaseTransaction } from './common'
@@ -15,7 +15,7 @@ export interface EscrowFinish extends BaseTransaction {
15
15
  * Transaction sequence of EscrowCreate transaction that created the held.
16
16
  * payment to finish.
17
17
  */
18
- OfferSequence: number
18
+ OfferSequence: number | string
19
19
  /**
20
20
  * Hex value matching the previously-supplied PREIMAGE-SHA-256.
21
21
  * crypto-condition of the held payment.
@@ -37,7 +37,7 @@ export interface EscrowFinish extends BaseTransaction {
37
37
  export function validateEscrowFinish(tx: Record<string, unknown>): void {
38
38
  validateBaseTransaction(tx)
39
39
 
40
- if (tx.Owner === undefined) {
40
+ if (tx.Owner == null) {
41
41
  throw new ValidationError('EscrowFinish: missing field Owner')
42
42
  }
43
43
 
@@ -45,11 +45,15 @@ export function validateEscrowFinish(tx: Record<string, unknown>): void {
45
45
  throw new ValidationError('EscrowFinish: Owner must be a string')
46
46
  }
47
47
 
48
- if (tx.OfferSequence === undefined) {
48
+ if (tx.OfferSequence == null) {
49
49
  throw new ValidationError('EscrowFinish: missing field OfferSequence')
50
50
  }
51
51
 
52
- if (typeof tx.OfferSequence !== 'number') {
52
+ if (
53
+ (typeof tx.OfferSequence !== 'number' &&
54
+ typeof tx.OfferSequence !== 'string') ||
55
+ Number.isNaN(Number(tx.OfferSequence))
56
+ ) {
53
57
  throw new ValidationError('EscrowFinish: OfferSequence must be a number')
54
58
  }
55
59
 
@@ -25,6 +25,7 @@ export {
25
25
  export { CheckCancel } from './checkCancel'
26
26
  export { CheckCash } from './checkCash'
27
27
  export { CheckCreate } from './checkCreate'
28
+ export { Clawback } from './clawback'
28
29
  export { DepositPreauth } from './depositPreauth'
29
30
  export { EscrowCancel } from './escrowCancel'
30
31
  export { EscrowCreate } from './escrowCreate'
@@ -63,4 +64,15 @@ export { SignerListSet } from './signerListSet'
63
64
  export { TicketCreate } from './ticketCreate'
64
65
  export { TrustSetFlagsInterface, TrustSetFlags, TrustSet } from './trustSet'
65
66
  export { UNLModify } from './UNLModify'
66
- export { Clawback } from './clawback'
67
+ export { XChainAddAccountCreateAttestation } from './XChainAddAccountCreateAttestation'
68
+ export { XChainAddClaimAttestation } from './XChainAddClaimAttestation'
69
+ export { XChainClaim } from './XChainClaim'
70
+ export { XChainCommit } from './XChainCommit'
71
+ export { XChainCreateBridge } from './XChainCreateBridge'
72
+ export { XChainCreateClaimID } from './XChainCreateClaimID'
73
+ export { XChainAccountCreateCommit } from './XChainAccountCreateCommit'
74
+ export {
75
+ XChainModifyBridge,
76
+ XChainModifyBridgeFlags,
77
+ XChainModifyBridgeFlagsInterface,
78
+ } from './XChainModifyBridge'
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- Necessary for validateOfferCreate */
2
1
  import { ValidationError } from '../../errors'
3
2
  import { Amount } from '../common'
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- Necessary for validatePayment */
2
1
  import { ValidationError } from '../../errors'
3
2
  import { Amount, Path } from '../common'
4
3
  import { isFlagEnabled } from '../utils'
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- Necessary for validatePaymentChannelClaim */
2
1
  import { ValidationError } from '../../errors'
3
2
 
4
3
  import { BaseTransaction, GlobalFlags, validateBaseTransaction } from './common'
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- Necessary for validatePaymentChannelCreate */
2
1
  import { ValidationError } from '../../errors'
3
2
 
4
3
  import { BaseTransaction, validateBaseTransaction } from './common'
@@ -36,7 +36,6 @@ const HEX_WALLET_LOCATOR_REGEX = /^[0-9A-Fa-f]{64}$/u
36
36
  * @param tx - An SignerListSet Transaction.
37
37
  * @throws When the SignerListSet is Malformed.
38
38
  */
39
- // eslint-disable-next-line complexity -- validation can be complex
40
39
  export function validateSignerListSet(tx: Record<string, unknown>): void {
41
40
  validateBaseTransaction(tx)
42
41
 
@@ -1,4 +1,4 @@
1
- /* eslint-disable complexity -- verifies 19 tx types hence a lot of checks needed */
1
+ /* eslint-disable max-lines -- need to work with a lot of transactions in a switch statement */
2
2
  /* eslint-disable max-lines-per-function -- need to work with a lot of Tx verifications */
3
3
 
4
4
  import { ValidationError } from '../../errors'
@@ -57,6 +57,32 @@ import { SetRegularKey, validateSetRegularKey } from './setRegularKey'
57
57
  import { SignerListSet, validateSignerListSet } from './signerListSet'
58
58
  import { TicketCreate, validateTicketCreate } from './ticketCreate'
59
59
  import { TrustSet, validateTrustSet } from './trustSet'
60
+ import {
61
+ XChainAccountCreateCommit,
62
+ validateXChainAccountCreateCommit,
63
+ } from './XChainAccountCreateCommit'
64
+ import {
65
+ XChainAddAccountCreateAttestation,
66
+ validateXChainAddAccountCreateAttestation,
67
+ } from './XChainAddAccountCreateAttestation'
68
+ import {
69
+ XChainAddClaimAttestation,
70
+ validateXChainAddClaimAttestation,
71
+ } from './XChainAddClaimAttestation'
72
+ import { XChainClaim, validateXChainClaim } from './XChainClaim'
73
+ import { XChainCommit, validateXChainCommit } from './XChainCommit'
74
+ import {
75
+ XChainCreateBridge,
76
+ validateXChainCreateBridge,
77
+ } from './XChainCreateBridge'
78
+ import {
79
+ XChainCreateClaimID,
80
+ validateXChainCreateClaimID,
81
+ } from './XChainCreateClaimID'
82
+ import {
83
+ XChainModifyBridge,
84
+ validateXChainModifyBridge,
85
+ } from './XChainModifyBridge'
60
86
 
61
87
  /**
62
88
  * @category Transaction Models
@@ -93,6 +119,14 @@ export type Transaction =
93
119
  | SignerListSet
94
120
  | TicketCreate
95
121
  | TrustSet
122
+ | XChainAddAccountCreateAttestation
123
+ | XChainAddClaimAttestation
124
+ | XChainClaim
125
+ | XChainCommit
126
+ | XChainCreateBridge
127
+ | XChainCreateClaimID
128
+ | XChainAccountCreateCommit
129
+ | XChainModifyBridge
96
130
 
97
131
  /**
98
132
  * @category Transaction Models
@@ -295,6 +329,38 @@ export function validate(transaction: Record<string, unknown>): void {
295
329
  validateTrustSet(tx)
296
330
  break
297
331
 
332
+ case 'XChainAddAccountCreateAttestation':
333
+ validateXChainAddAccountCreateAttestation(tx)
334
+ break
335
+
336
+ case 'XChainAddClaimAttestation':
337
+ validateXChainAddClaimAttestation(tx)
338
+ break
339
+
340
+ case 'XChainClaim':
341
+ validateXChainClaim(tx)
342
+ break
343
+
344
+ case 'XChainCommit':
345
+ validateXChainCommit(tx)
346
+ break
347
+
348
+ case 'XChainCreateBridge':
349
+ validateXChainCreateBridge(tx)
350
+ break
351
+
352
+ case 'XChainCreateClaimID':
353
+ validateXChainCreateClaimID(tx)
354
+ break
355
+
356
+ case 'XChainAccountCreateCommit':
357
+ validateXChainAccountCreateCommit(tx)
358
+ break
359
+
360
+ case 'XChainModifyBridge':
361
+ validateXChainModifyBridge(tx)
362
+ break
363
+
298
364
  default:
299
365
  throw new ValidationError(
300
366
  `Invalid field TransactionType: ${tx.TransactionType}`,
@@ -15,6 +15,7 @@ import { PaymentFlags } from '../transactions/payment'
15
15
  import { PaymentChannelClaimFlags } from '../transactions/paymentChannelClaim'
16
16
  import type { Transaction } from '../transactions/transaction'
17
17
  import { TrustSetFlags } from '../transactions/trustSet'
18
+ import { XChainModifyBridgeFlags } from '../transactions/XChainModifyBridge'
18
19
 
19
20
  import { isFlagEnabled } from '.'
20
21
 
@@ -78,6 +79,9 @@ export function setTransactionFlagsToNumber(tx: Transaction): void {
78
79
  case 'TrustSet':
79
80
  tx.Flags = convertFlagsToNumber(tx.Flags, TrustSetFlags)
80
81
  return
82
+ case 'XChainModifyBridge':
83
+ tx.Flags = convertFlagsToNumber(tx.Flags, XChainModifyBridgeFlags)
84
+ return
81
85
  default:
82
86
  tx.Flags = 0
83
87
  }
@@ -176,8 +176,6 @@ function txNeedsNetworkID(client: Client): boolean {
176
176
  client.networkID !== undefined &&
177
177
  client.networkID > RESTRICTED_NETWORKS
178
178
  ) {
179
- // TODO: remove the buildVersion logic when 1.11.0 is out and widely used.
180
- // Issue: https://github.com/XRPLF/xrpl.js/issues/2339
181
179
  if (
182
180
  (client.buildVersion &&
183
181
  isNotLaterRippledVersion(
@@ -0,0 +1,64 @@
1
+ import { decode } from 'ripple-binary-codec'
2
+
3
+ import {
4
+ CreatedNode,
5
+ isCreatedNode,
6
+ TransactionMetadata,
7
+ } from '../models/transactions/metadata'
8
+
9
+ /**
10
+ * Ensures that the metadata is in a deserialized format to parse.
11
+ *
12
+ * @param meta - the metadata from a `tx` method call. Can be in json format or binary format.
13
+ * @returns the metadata in a deserialized format.
14
+ */
15
+ function ensureDecodedMeta(
16
+ meta: TransactionMetadata | string,
17
+ ): TransactionMetadata {
18
+ if (typeof meta === 'string') {
19
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Meta is either metadata or serialized metadata.
20
+ return decode(meta) as unknown as TransactionMetadata
21
+ }
22
+ return meta
23
+ }
24
+
25
+ /**
26
+ * Gets the XChainClaimID value from the metadata of an `XChainCreateClaimID` transaction.
27
+ *
28
+ * @param meta - Metadata from the response to submitting and waiting for an XChainCreateClaimID transaction
29
+ * or from a `tx` method call.
30
+ * @returns The XChainClaimID for the minted NFT.
31
+ * @throws if meta is not TransactionMetadata.
32
+ */
33
+ export default function getXChainClaimID(
34
+ meta: TransactionMetadata | string | undefined,
35
+ ): string | undefined {
36
+ if (typeof meta !== 'string' && meta?.AffectedNodes === undefined) {
37
+ throw new TypeError(`Unable to parse the parameter given to getXChainClaimID.
38
+ 'meta' must be the metadata from an XChainCreateClaimID transaction. Received ${JSON.stringify(
39
+ meta,
40
+ )} instead.`)
41
+ }
42
+
43
+ const decodedMeta = ensureDecodedMeta(meta)
44
+
45
+ if (!decodedMeta.TransactionResult) {
46
+ throw new TypeError(
47
+ 'Cannot get XChainClaimID from un-validated transaction',
48
+ )
49
+ }
50
+
51
+ if (decodedMeta.TransactionResult !== 'tesSUCCESS') {
52
+ return undefined
53
+ }
54
+
55
+ const createdNode = decodedMeta.AffectedNodes.find(
56
+ (node) =>
57
+ isCreatedNode(node) &&
58
+ node.CreatedNode.LedgerEntryType === 'XChainOwnedClaimID',
59
+ )
60
+
61
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- necessary here
62
+ return (createdNode as CreatedNode).CreatedNode.NewFields
63
+ .XChainClaimID as string
64
+ }
@@ -25,6 +25,7 @@ import { Transaction } from '../models/transactions/transaction'
25
25
  import { deriveKeypair, deriveAddress, deriveXAddress } from './derive'
26
26
  import getBalanceChanges from './getBalanceChanges'
27
27
  import getNFTokenID from './getNFTokenID'
28
+ import getXChainClaimID from './getXChainClaimID'
28
29
  import {
29
30
  hashSignedTx,
30
31
  hashTx,
@@ -220,4 +221,5 @@ export {
220
221
  encodeForSigningClaim,
221
222
  getNFTokenID,
222
223
  parseNFTokenID,
224
+ getXChainClaimID,
223
225
  }
@@ -7,19 +7,19 @@ import { xrpToDrops } from './xrpConversion'
7
7
  * Sign a payment channel claim.
8
8
  *
9
9
  * @param channel - Channel identifier specified by the paymentChannelClaim.
10
- * @param amount - Amount specified by the paymentChannelClaim.
10
+ * @param xrpAmount - XRP Amount specified by the paymentChannelClaim.
11
11
  * @param privateKey - Private Key to sign paymentChannelClaim with.
12
12
  * @returns True if the channel is valid.
13
13
  * @category Utilities
14
14
  */
15
15
  function signPaymentChannelClaim(
16
16
  channel: string,
17
- amount: string,
17
+ xrpAmount: string,
18
18
  privateKey: string,
19
19
  ): string {
20
20
  const signingData = encodeForSigningClaim({
21
21
  channel,
22
- amount: xrpToDrops(amount),
22
+ amount: xrpToDrops(xrpAmount),
23
23
  })
24
24
  return sign(signingData, privateKey)
25
25
  }
@@ -7,7 +7,7 @@ import { xrpToDrops } from './xrpConversion'
7
7
  * Verify the signature of a payment channel claim.
8
8
  *
9
9
  * @param channel - Channel identifier specified by the paymentChannelClaim.
10
- * @param amount - Amount specified by the paymentChannelClaim.
10
+ * @param xrpAmount - XRP Amount specified by the paymentChannelClaim.
11
11
  * @param signature - Signature produced from signing paymentChannelClaim.
12
12
  * @param publicKey - Public key that signed the paymentChannelClaim.
13
13
  * @returns True if the channel is valid.
@@ -16,13 +16,13 @@ import { xrpToDrops } from './xrpConversion'
16
16
  // eslint-disable-next-line max-params -- Needs 4 params
17
17
  function verifyPaymentChannelClaim(
18
18
  channel: string,
19
- amount: string,
19
+ xrpAmount: string,
20
20
  signature: string,
21
21
  publicKey: string,
22
22
  ): boolean {
23
23
  const signingData = encodeForSigningClaim({
24
24
  channel,
25
- amount: xrpToDrops(amount),
25
+ amount: xrpToDrops(xrpAmount),
26
26
  })
27
27
  return verify(signingData, signature, publicKey)
28
28
  }