xrpl 3.1.0 → 4.0.0-mpt-beta

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 (341) hide show
  1. package/README.md +3 -3
  2. package/build/xrpl-latest-min.js +1 -1
  3. package/build/xrpl-latest-min.js.map +1 -1
  4. package/build/xrpl-latest.js +394 -710
  5. package/build/xrpl-latest.js.map +1 -1
  6. package/dist/npm/Wallet/defaultFaucets.d.ts +1 -2
  7. package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
  8. package/dist/npm/Wallet/defaultFaucets.js +0 -5
  9. package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
  10. package/dist/npm/Wallet/fundWallet.d.ts.map +1 -1
  11. package/dist/npm/Wallet/fundWallet.js +1 -5
  12. package/dist/npm/Wallet/fundWallet.js.map +1 -1
  13. package/dist/npm/client/RequestManager.d.ts +5 -4
  14. package/dist/npm/client/RequestManager.d.ts.map +1 -1
  15. package/dist/npm/client/RequestManager.js.map +1 -1
  16. package/dist/npm/client/connection.d.ts +2 -2
  17. package/dist/npm/client/connection.d.ts.map +1 -1
  18. package/dist/npm/client/connection.js.map +1 -1
  19. package/dist/npm/client/index.d.ts +4 -3
  20. package/dist/npm/client/index.d.ts.map +1 -1
  21. package/dist/npm/client/index.js +16 -4
  22. package/dist/npm/client/index.js.map +1 -1
  23. package/dist/npm/client/partialPayment.d.ts +2 -1
  24. package/dist/npm/client/partialPayment.d.ts.map +1 -1
  25. package/dist/npm/client/partialPayment.js +19 -3
  26. package/dist/npm/client/partialPayment.js.map +1 -1
  27. package/dist/npm/models/common/index.d.ts +9 -0
  28. package/dist/npm/models/common/index.d.ts.map +1 -1
  29. package/dist/npm/models/common/index.js +4 -0
  30. package/dist/npm/models/common/index.js.map +1 -1
  31. package/dist/npm/models/index.d.ts +1 -1
  32. package/dist/npm/models/index.d.ts.map +1 -1
  33. package/dist/npm/models/index.js +2 -1
  34. package/dist/npm/models/index.js.map +1 -1
  35. package/dist/npm/models/ledger/AMM.d.ts +2 -2
  36. package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
  37. package/dist/npm/models/ledger/Amendments.d.ts +2 -2
  38. package/dist/npm/models/ledger/Amendments.d.ts.map +1 -1
  39. package/dist/npm/models/ledger/BaseLedgerEntry.d.ts +3 -3
  40. package/dist/npm/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
  41. package/dist/npm/models/ledger/DirectoryNode.d.ts +2 -2
  42. package/dist/npm/models/ledger/DirectoryNode.d.ts.map +1 -1
  43. package/dist/npm/models/ledger/FeeSettings.d.ts +2 -2
  44. package/dist/npm/models/ledger/FeeSettings.d.ts.map +1 -1
  45. package/dist/npm/models/ledger/Ledger.d.ts +11 -2
  46. package/dist/npm/models/ledger/Ledger.d.ts.map +1 -1
  47. package/dist/npm/models/ledger/LedgerEntry.d.ts +1 -1
  48. package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
  49. package/dist/npm/models/ledger/LedgerHashes.d.ts +2 -2
  50. package/dist/npm/models/ledger/LedgerHashes.d.ts.map +1 -1
  51. package/dist/npm/models/ledger/MPToken.d.ts +11 -0
  52. package/dist/npm/models/ledger/MPToken.d.ts.map +1 -0
  53. package/dist/npm/models/ledger/MPToken.js +3 -0
  54. package/dist/npm/models/ledger/MPToken.js.map +1 -0
  55. package/dist/npm/models/ledger/MPTokenIssuance.d.ts +14 -0
  56. package/dist/npm/models/ledger/MPTokenIssuance.d.ts.map +1 -0
  57. package/dist/npm/models/ledger/MPTokenIssuance.js +3 -0
  58. package/dist/npm/models/ledger/MPTokenIssuance.js.map +1 -0
  59. package/dist/npm/models/ledger/NegativeUNL.d.ts +2 -2
  60. package/dist/npm/models/ledger/NegativeUNL.d.ts.map +1 -1
  61. package/dist/npm/models/ledger/index.d.ts +4 -2
  62. package/dist/npm/models/ledger/index.d.ts.map +1 -1
  63. package/dist/npm/models/ledger/index.js.map +1 -1
  64. package/dist/npm/models/methods/accountInfo.d.ts +17 -4
  65. package/dist/npm/models/methods/accountInfo.d.ts.map +1 -1
  66. package/dist/npm/models/methods/accountTx.d.ts +11 -5
  67. package/dist/npm/models/methods/accountTx.d.ts.map +1 -1
  68. package/dist/npm/models/methods/feature.d.ts +28 -0
  69. package/dist/npm/models/methods/feature.d.ts.map +1 -0
  70. package/dist/npm/models/methods/feature.js +3 -0
  71. package/dist/npm/models/methods/feature.js.map +1 -0
  72. package/dist/npm/models/methods/index.d.ts +14 -11
  73. package/dist/npm/models/methods/index.d.ts.map +1 -1
  74. package/dist/npm/models/methods/ledger.d.ts +17 -5
  75. package/dist/npm/models/methods/ledger.d.ts.map +1 -1
  76. package/dist/npm/models/methods/ledgerEntry.d.ts +5 -0
  77. package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
  78. package/dist/npm/models/methods/nftsByIssuer.d.ts +19 -0
  79. package/dist/npm/models/methods/nftsByIssuer.d.ts.map +1 -0
  80. package/dist/npm/models/methods/nftsByIssuer.js +3 -0
  81. package/dist/npm/models/methods/nftsByIssuer.js.map +1 -0
  82. package/dist/npm/models/methods/submitMultisigned.d.ts +16 -5
  83. package/dist/npm/models/methods/submitMultisigned.d.ts.map +1 -1
  84. package/dist/npm/models/methods/tx.d.ts +20 -8
  85. package/dist/npm/models/methods/tx.d.ts.map +1 -1
  86. package/dist/npm/models/transactions/MPTokenAuthorize.d.ts +15 -0
  87. package/dist/npm/models/transactions/MPTokenAuthorize.d.ts.map +1 -0
  88. package/dist/npm/models/transactions/MPTokenAuthorize.js +15 -0
  89. package/dist/npm/models/transactions/MPTokenAuthorize.js.map +1 -0
  90. package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts +31 -0
  91. package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -0
  92. package/dist/npm/models/transactions/MPTokenIssuanceCreate.js +26 -0
  93. package/dist/npm/models/transactions/MPTokenIssuanceCreate.js.map +1 -0
  94. package/dist/npm/models/transactions/MPTokenIssuanceDestroy.d.ts +7 -0
  95. package/dist/npm/models/transactions/MPTokenIssuanceDestroy.d.ts.map +1 -0
  96. package/dist/npm/models/transactions/MPTokenIssuanceDestroy.js +10 -0
  97. package/dist/npm/models/transactions/MPTokenIssuanceDestroy.js.map +1 -0
  98. package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts +17 -0
  99. package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -0
  100. package/dist/npm/models/transactions/MPTokenIssuanceSet.js +22 -0
  101. package/dist/npm/models/transactions/MPTokenIssuanceSet.js.map +1 -0
  102. package/dist/npm/models/transactions/clawback.d.ts +3 -2
  103. package/dist/npm/models/transactions/clawback.d.ts.map +1 -1
  104. package/dist/npm/models/transactions/clawback.js +11 -1
  105. package/dist/npm/models/transactions/clawback.js.map +1 -1
  106. package/dist/npm/models/transactions/common.d.ts +2 -1
  107. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  108. package/dist/npm/models/transactions/common.js +12 -2
  109. package/dist/npm/models/transactions/common.js.map +1 -1
  110. package/dist/npm/models/transactions/index.d.ts +5 -1
  111. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  112. package/dist/npm/models/transactions/index.js +9 -1
  113. package/dist/npm/models/transactions/index.js.map +1 -1
  114. package/dist/npm/models/transactions/metadata.d.ts +5 -4
  115. package/dist/npm/models/transactions/metadata.d.ts.map +1 -1
  116. package/dist/npm/models/transactions/metadata.js.map +1 -1
  117. package/dist/npm/models/transactions/payment.d.ts +4 -4
  118. package/dist/npm/models/transactions/payment.d.ts.map +1 -1
  119. package/dist/npm/models/transactions/transaction.d.ts +5 -1
  120. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  121. package/dist/npm/models/transactions/transaction.js +16 -0
  122. package/dist/npm/models/transactions/transaction.js.map +1 -1
  123. package/dist/npm/models/utils/flags.d.ts +1 -0
  124. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  125. package/dist/npm/models/utils/flags.js +23 -1
  126. package/dist/npm/models/utils/flags.js.map +1 -1
  127. package/dist/npm/snippets/src/claimPayChannel.js +1 -1
  128. package/dist/npm/snippets/src/claimPayChannel.js.map +1 -1
  129. package/dist/npm/snippets/src/sendEscrow.js +1 -1
  130. package/dist/npm/snippets/src/sendEscrow.js.map +1 -1
  131. package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
  132. package/dist/npm/src/Wallet/defaultFaucets.d.ts +1 -2
  133. package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
  134. package/dist/npm/src/Wallet/defaultFaucets.js +0 -5
  135. package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
  136. package/dist/npm/src/Wallet/fundWallet.d.ts.map +1 -1
  137. package/dist/npm/src/Wallet/fundWallet.js +1 -5
  138. package/dist/npm/src/Wallet/fundWallet.js.map +1 -1
  139. package/dist/npm/src/client/RequestManager.d.ts +5 -4
  140. package/dist/npm/src/client/RequestManager.d.ts.map +1 -1
  141. package/dist/npm/src/client/RequestManager.js.map +1 -1
  142. package/dist/npm/src/client/connection.d.ts +2 -2
  143. package/dist/npm/src/client/connection.d.ts.map +1 -1
  144. package/dist/npm/src/client/connection.js.map +1 -1
  145. package/dist/npm/src/client/index.d.ts +4 -3
  146. package/dist/npm/src/client/index.d.ts.map +1 -1
  147. package/dist/npm/src/client/index.js +16 -4
  148. package/dist/npm/src/client/index.js.map +1 -1
  149. package/dist/npm/src/client/partialPayment.d.ts +2 -1
  150. package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
  151. package/dist/npm/src/client/partialPayment.js +19 -3
  152. package/dist/npm/src/client/partialPayment.js.map +1 -1
  153. package/dist/npm/src/models/common/index.d.ts +9 -0
  154. package/dist/npm/src/models/common/index.d.ts.map +1 -1
  155. package/dist/npm/src/models/common/index.js +4 -0
  156. package/dist/npm/src/models/common/index.js.map +1 -1
  157. package/dist/npm/src/models/index.d.ts +1 -1
  158. package/dist/npm/src/models/index.d.ts.map +1 -1
  159. package/dist/npm/src/models/index.js +2 -1
  160. package/dist/npm/src/models/index.js.map +1 -1
  161. package/dist/npm/src/models/ledger/AMM.d.ts +2 -2
  162. package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
  163. package/dist/npm/src/models/ledger/Amendments.d.ts +2 -2
  164. package/dist/npm/src/models/ledger/Amendments.d.ts.map +1 -1
  165. package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts +3 -3
  166. package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
  167. package/dist/npm/src/models/ledger/DirectoryNode.d.ts +2 -2
  168. package/dist/npm/src/models/ledger/DirectoryNode.d.ts.map +1 -1
  169. package/dist/npm/src/models/ledger/FeeSettings.d.ts +2 -2
  170. package/dist/npm/src/models/ledger/FeeSettings.d.ts.map +1 -1
  171. package/dist/npm/src/models/ledger/Ledger.d.ts +11 -2
  172. package/dist/npm/src/models/ledger/Ledger.d.ts.map +1 -1
  173. package/dist/npm/src/models/ledger/LedgerEntry.d.ts +1 -1
  174. package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
  175. package/dist/npm/src/models/ledger/LedgerHashes.d.ts +2 -2
  176. package/dist/npm/src/models/ledger/LedgerHashes.d.ts.map +1 -1
  177. package/dist/npm/src/models/ledger/MPToken.d.ts +11 -0
  178. package/dist/npm/src/models/ledger/MPToken.d.ts.map +1 -0
  179. package/dist/npm/src/models/ledger/MPToken.js +3 -0
  180. package/dist/npm/src/models/ledger/MPToken.js.map +1 -0
  181. package/dist/npm/src/models/ledger/MPTokenIssuance.d.ts +14 -0
  182. package/dist/npm/src/models/ledger/MPTokenIssuance.d.ts.map +1 -0
  183. package/dist/npm/src/models/ledger/MPTokenIssuance.js +3 -0
  184. package/dist/npm/src/models/ledger/MPTokenIssuance.js.map +1 -0
  185. package/dist/npm/src/models/ledger/NegativeUNL.d.ts +2 -2
  186. package/dist/npm/src/models/ledger/NegativeUNL.d.ts.map +1 -1
  187. package/dist/npm/src/models/ledger/index.d.ts +4 -2
  188. package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
  189. package/dist/npm/src/models/ledger/index.js.map +1 -1
  190. package/dist/npm/src/models/methods/accountInfo.d.ts +17 -4
  191. package/dist/npm/src/models/methods/accountInfo.d.ts.map +1 -1
  192. package/dist/npm/src/models/methods/accountTx.d.ts +11 -5
  193. package/dist/npm/src/models/methods/accountTx.d.ts.map +1 -1
  194. package/dist/npm/src/models/methods/feature.d.ts +28 -0
  195. package/dist/npm/src/models/methods/feature.d.ts.map +1 -0
  196. package/dist/npm/src/models/methods/feature.js +3 -0
  197. package/dist/npm/src/models/methods/feature.js.map +1 -0
  198. package/dist/npm/src/models/methods/index.d.ts +14 -11
  199. package/dist/npm/src/models/methods/index.d.ts.map +1 -1
  200. package/dist/npm/src/models/methods/ledger.d.ts +17 -5
  201. package/dist/npm/src/models/methods/ledger.d.ts.map +1 -1
  202. package/dist/npm/src/models/methods/ledgerEntry.d.ts +5 -0
  203. package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
  204. package/dist/npm/src/models/methods/nftsByIssuer.d.ts +19 -0
  205. package/dist/npm/src/models/methods/nftsByIssuer.d.ts.map +1 -0
  206. package/dist/npm/src/models/methods/nftsByIssuer.js +3 -0
  207. package/dist/npm/src/models/methods/nftsByIssuer.js.map +1 -0
  208. package/dist/npm/src/models/methods/submitMultisigned.d.ts +16 -5
  209. package/dist/npm/src/models/methods/submitMultisigned.d.ts.map +1 -1
  210. package/dist/npm/src/models/methods/tx.d.ts +20 -8
  211. package/dist/npm/src/models/methods/tx.d.ts.map +1 -1
  212. package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts +15 -0
  213. package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts.map +1 -0
  214. package/dist/npm/src/models/transactions/MPTokenAuthorize.js +15 -0
  215. package/dist/npm/src/models/transactions/MPTokenAuthorize.js.map +1 -0
  216. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts +31 -0
  217. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -0
  218. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.js +26 -0
  219. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.js.map +1 -0
  220. package/dist/npm/src/models/transactions/MPTokenIssuanceDestroy.d.ts +7 -0
  221. package/dist/npm/src/models/transactions/MPTokenIssuanceDestroy.d.ts.map +1 -0
  222. package/dist/npm/src/models/transactions/MPTokenIssuanceDestroy.js +10 -0
  223. package/dist/npm/src/models/transactions/MPTokenIssuanceDestroy.js.map +1 -0
  224. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts +17 -0
  225. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -0
  226. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.js +22 -0
  227. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.js.map +1 -0
  228. package/dist/npm/src/models/transactions/clawback.d.ts +3 -2
  229. package/dist/npm/src/models/transactions/clawback.d.ts.map +1 -1
  230. package/dist/npm/src/models/transactions/clawback.js +11 -1
  231. package/dist/npm/src/models/transactions/clawback.js.map +1 -1
  232. package/dist/npm/src/models/transactions/common.d.ts +2 -1
  233. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  234. package/dist/npm/src/models/transactions/common.js +12 -2
  235. package/dist/npm/src/models/transactions/common.js.map +1 -1
  236. package/dist/npm/src/models/transactions/index.d.ts +5 -1
  237. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  238. package/dist/npm/src/models/transactions/index.js +9 -1
  239. package/dist/npm/src/models/transactions/index.js.map +1 -1
  240. package/dist/npm/src/models/transactions/metadata.d.ts +5 -4
  241. package/dist/npm/src/models/transactions/metadata.d.ts.map +1 -1
  242. package/dist/npm/src/models/transactions/metadata.js.map +1 -1
  243. package/dist/npm/src/models/transactions/payment.d.ts +4 -4
  244. package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
  245. package/dist/npm/src/models/transactions/transaction.d.ts +5 -1
  246. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  247. package/dist/npm/src/models/transactions/transaction.js +16 -0
  248. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  249. package/dist/npm/src/models/utils/flags.d.ts +1 -0
  250. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  251. package/dist/npm/src/models/utils/flags.js +23 -1
  252. package/dist/npm/src/models/utils/flags.js.map +1 -1
  253. package/dist/npm/src/sugar/autofill.d.ts +1 -1
  254. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  255. package/dist/npm/src/sugar/autofill.js +2 -4
  256. package/dist/npm/src/sugar/autofill.js.map +1 -1
  257. package/dist/npm/src/sugar/getFeeXrp.d.ts +1 -1
  258. package/dist/npm/src/sugar/getFeeXrp.d.ts.map +1 -1
  259. package/dist/npm/src/sugar/getFeeXrp.js +3 -2
  260. package/dist/npm/src/sugar/getFeeXrp.js.map +1 -1
  261. package/dist/npm/src/sugar/submit.d.ts.map +1 -1
  262. package/dist/npm/src/sugar/submit.js.map +1 -1
  263. package/dist/npm/src/utils/hashes/hashLedger.d.ts +4 -3
  264. package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
  265. package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
  266. package/dist/npm/src/utils/index.d.ts +4 -2
  267. package/dist/npm/src/utils/index.d.ts.map +1 -1
  268. package/dist/npm/src/utils/index.js +3 -1
  269. package/dist/npm/src/utils/index.js.map +1 -1
  270. package/dist/npm/src/utils/mptConversion.d.ts +2 -0
  271. package/dist/npm/src/utils/mptConversion.d.ts.map +1 -0
  272. package/dist/npm/src/utils/mptConversion.js +31 -0
  273. package/dist/npm/src/utils/mptConversion.js.map +1 -0
  274. package/dist/npm/sugar/autofill.d.ts +1 -1
  275. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  276. package/dist/npm/sugar/autofill.js +2 -4
  277. package/dist/npm/sugar/autofill.js.map +1 -1
  278. package/dist/npm/sugar/getFeeXrp.d.ts +1 -1
  279. package/dist/npm/sugar/getFeeXrp.d.ts.map +1 -1
  280. package/dist/npm/sugar/getFeeXrp.js +3 -2
  281. package/dist/npm/sugar/getFeeXrp.js.map +1 -1
  282. package/dist/npm/sugar/submit.d.ts.map +1 -1
  283. package/dist/npm/sugar/submit.js.map +1 -1
  284. package/dist/npm/utils/hashes/hashLedger.d.ts +4 -3
  285. package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
  286. package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
  287. package/dist/npm/utils/index.d.ts +4 -2
  288. package/dist/npm/utils/index.d.ts.map +1 -1
  289. package/dist/npm/utils/index.js +3 -1
  290. package/dist/npm/utils/index.js.map +1 -1
  291. package/dist/npm/utils/mptConversion.d.ts +2 -0
  292. package/dist/npm/utils/mptConversion.d.ts.map +1 -0
  293. package/dist/npm/utils/mptConversion.js +31 -0
  294. package/dist/npm/utils/mptConversion.js.map +1 -0
  295. package/package.json +6 -7
  296. package/src/Wallet/defaultFaucets.ts +0 -6
  297. package/src/Wallet/fundWallet.ts +0 -1
  298. package/src/client/RequestManager.ts +17 -12
  299. package/src/client/connection.ts +7 -5
  300. package/src/client/index.ts +63 -16
  301. package/src/client/partialPayment.ts +55 -17
  302. package/src/models/common/index.ts +13 -0
  303. package/src/models/index.ts +1 -0
  304. package/src/models/ledger/AMM.ts +2 -2
  305. package/src/models/ledger/Amendments.ts +2 -2
  306. package/src/models/ledger/BaseLedgerEntry.ts +9 -5
  307. package/src/models/ledger/DirectoryNode.ts +2 -2
  308. package/src/models/ledger/FeeSettings.ts +4 -2
  309. package/src/models/ledger/Ledger.ts +46 -9
  310. package/src/models/ledger/LedgerEntry.ts +2 -0
  311. package/src/models/ledger/LedgerHashes.ts +2 -4
  312. package/src/models/ledger/MPToken.ts +12 -0
  313. package/src/models/ledger/MPTokenIssuance.ts +14 -0
  314. package/src/models/ledger/NegativeUNL.ts +2 -2
  315. package/src/models/ledger/index.ts +6 -1
  316. package/src/models/methods/accountInfo.ts +58 -12
  317. package/src/models/methods/accountTx.ts +49 -8
  318. package/src/models/methods/feature.ts +68 -0
  319. package/src/models/methods/index.ts +67 -23
  320. package/src/models/methods/ledger.ts +41 -5
  321. package/src/models/methods/ledgerEntry.ts +16 -0
  322. package/src/models/methods/nftsByIssuer.ts +68 -0
  323. package/src/models/methods/submitMultisigned.ts +48 -16
  324. package/src/models/methods/tx.ts +74 -22
  325. package/src/models/transactions/MPTokenAuthorize.ts +67 -0
  326. package/src/models/transactions/MPTokenIssuanceCreate.ts +132 -0
  327. package/src/models/transactions/MPTokenIssuanceDestroy.ts +34 -0
  328. package/src/models/transactions/MPTokenIssuanceSet.ts +76 -0
  329. package/src/models/transactions/clawback.ts +29 -6
  330. package/src/models/transactions/common.ts +22 -1
  331. package/src/models/transactions/index.ts +17 -1
  332. package/src/models/transactions/metadata.ts +9 -3
  333. package/src/models/transactions/payment.ts +4 -4
  334. package/src/models/transactions/transaction.ts +33 -0
  335. package/src/models/utils/flags.ts +33 -1
  336. package/src/sugar/autofill.ts +4 -10
  337. package/src/sugar/getFeeXrp.ts +6 -3
  338. package/src/sugar/submit.ts +5 -3
  339. package/src/utils/hashes/hashLedger.ts +8 -5
  340. package/src/utils/index.ts +4 -1
  341. package/src/utils/mptConversion.ts +61 -0
@@ -1,3 +1,9 @@
1
+ import {
2
+ APIVersion,
3
+ DEFAULT_API_VERSION,
4
+ RIPPLED_API_V1,
5
+ RIPPLED_API_V2,
6
+ } from '../common'
1
7
  import { Transaction, TransactionMetadata } from '../transactions'
2
8
  import { BaseTransaction } from '../transactions/common'
3
9
 
@@ -41,6 +47,47 @@ export interface TxRequest extends BaseRequest {
41
47
  max_ledger?: number
42
48
  }
43
49
 
50
+ /**
51
+ * Common properties of transaction responses.
52
+ *
53
+ * @category Responses
54
+ */
55
+ interface BaseTxResult<
56
+ Version extends APIVersion = typeof DEFAULT_API_VERSION,
57
+ T extends BaseTransaction = Transaction,
58
+ > {
59
+ /** The SHA-512 hash of the transaction. */
60
+ hash: string
61
+ /**
62
+ * The Concise Transaction Identifier of the transaction (16-byte hex string)
63
+ */
64
+ ctid?: string
65
+ /** The ledger index of the ledger that includes this transaction. */
66
+ ledger_index?: number
67
+ /** Unique hashed string Transaction metadata blob, which describes the results of the transaction.
68
+ * Can be undefined if a transaction has not been validated yet. This field is omitted if binary
69
+ * binary format is not requested. */
70
+ meta_blob?: Version extends typeof RIPPLED_API_V2
71
+ ? TransactionMetadata<T> | string
72
+ : never
73
+ /** Transaction metadata, which describes the results of the transaction.
74
+ * Can be undefined if a transaction has not been validated yet. */
75
+ meta?: TransactionMetadata<T> | string
76
+ /**
77
+ * If true, this data comes from a validated ledger version; if omitted or.
78
+ * Set to false, this data is not final.
79
+ */
80
+ validated?: boolean
81
+ /**
82
+ * The time the transaction was closed, in seconds since the Ripple Epoch.
83
+ */
84
+ close_time_iso?: string
85
+ /**
86
+ * This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
87
+ */
88
+ date?: number
89
+ }
90
+
44
91
  /**
45
92
  * Response expected from a {@link TxRequest}.
46
93
  *
@@ -48,28 +95,7 @@ export interface TxRequest extends BaseRequest {
48
95
  */
49
96
  export interface TxResponse<T extends BaseTransaction = Transaction>
50
97
  extends BaseResponse {
51
- result: {
52
- /** The SHA-512 hash of the transaction. */
53
- hash: string
54
- /**
55
- * The Concise Transaction Identifier of the transaction (16-byte hex string)
56
- */
57
- ctid?: string
58
- /** The ledger index of the ledger that includes this transaction. */
59
- ledger_index?: number
60
- /** Transaction metadata, which describes the results of the transaction.
61
- * Can be undefined if a transaction has not been validated yet. */
62
- meta?: TransactionMetadata<T> | string
63
- /**
64
- * If true, this data comes from a validated ledger version; if omitted or.
65
- * Set to false, this data is not final.
66
- */
67
- validated?: boolean
68
- /**
69
- * This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
70
- */
71
- date?: number
72
- } & T
98
+ result: BaseTxResult<typeof RIPPLED_API_V2, T> & { tx_json: T }
73
99
  /**
74
100
  * If true, the server was able to search all of the specified ledger
75
101
  * versions, and the transaction was in none of them. If false, the server did
@@ -78,3 +104,29 @@ export interface TxResponse<T extends BaseTransaction = Transaction>
78
104
  */
79
105
  searched_all?: boolean
80
106
  }
107
+
108
+ /**
109
+ * Response expected from a {@link TxRequest} using API version 1.
110
+ *
111
+ * @category ResponsesV1
112
+ */
113
+ export interface TxV1Response<T extends BaseTransaction = Transaction>
114
+ extends BaseResponse {
115
+ result: BaseTxResult<typeof RIPPLED_API_V1, T> & T
116
+ /**
117
+ * If true, the server was able to search all of the specified ledger
118
+ * versions, and the transaction was in none of them. If false, the server did
119
+ * not have all of the specified ledger versions available, so it is not sure.
120
+ * If one of them might contain the transaction.
121
+ */
122
+ searched_all?: boolean
123
+ }
124
+
125
+ /**
126
+ * Type to map between the API version and the response type.
127
+ *
128
+ * @category Responses
129
+ */
130
+ export type TxVersionResponseMap<
131
+ Version extends APIVersion = typeof DEFAULT_API_VERSION,
132
+ > = Version extends typeof RIPPLED_API_V1 ? TxV1Response : TxResponse
@@ -0,0 +1,67 @@
1
+ import {
2
+ BaseTransaction,
3
+ isString,
4
+ validateBaseTransaction,
5
+ validateRequiredField,
6
+ Account,
7
+ validateOptionalField,
8
+ isAccount,
9
+ GlobalFlags,
10
+ } from './common'
11
+
12
+ /**
13
+ * Transaction Flags for an MPTokenAuthorize Transaction.
14
+ *
15
+ * @category Transaction Flags
16
+ */
17
+ export enum MPTokenAuthorizeFlags {
18
+ /**
19
+ * If set and transaction is submitted by a holder, it indicates that the holder no
20
+ * longer wants to hold the MPToken, which will be deleted as a result. If the the holder's
21
+ * MPToken has non-zero balance while trying to set this flag, the transaction will fail. On
22
+ * the other hand, if set and transaction is submitted by an issuer, it would mean that the
23
+ * issuer wants to unauthorize the holder (only applicable for allow-listing),
24
+ * which would unset the lsfMPTAuthorized flag on the MPToken.
25
+ */
26
+ tfMPTUnauthorize = 0x00000001,
27
+ }
28
+
29
+ /**
30
+ * Map of flags to boolean values representing {@link MPTokenAuthorize} transaction
31
+ * flags.
32
+ *
33
+ * @category Transaction Flags
34
+ */
35
+ export interface MPTokenAuthorizeFlagsInterface extends GlobalFlags {
36
+ tfMPTUnauthorize?: boolean
37
+ }
38
+
39
+ /**
40
+ * The MPTokenAuthorize transaction is used to globally lock/unlock a MPTokenIssuance,
41
+ * or lock/unlock an individual's MPToken.
42
+ */
43
+ export interface MPTokenAuthorize extends BaseTransaction {
44
+ TransactionType: 'MPTokenAuthorize'
45
+ /**
46
+ * Identifies the MPTokenIssuance
47
+ */
48
+ MPTokenIssuanceID: string
49
+ /**
50
+ * An optional XRPL Address of an individual token holder balance to lock/unlock.
51
+ * If omitted, this transaction will apply to all any accounts holding MPTs.
52
+ */
53
+ MPTokenHolder?: Account
54
+ Flags?: number | MPTokenAuthorizeFlagsInterface
55
+ }
56
+
57
+ /**
58
+ * Verify the form and type of an MPTokenAuthorize at runtime.
59
+ *
60
+ * @param tx - An MPTokenAuthorize Transaction.
61
+ * @throws When the MPTokenAuthorize is Malformed.
62
+ */
63
+ export function validateMPTokenAuthorize(tx: Record<string, unknown>): void {
64
+ validateBaseTransaction(tx)
65
+ validateRequiredField(tx, 'MPTokenIssuanceID', isString)
66
+ validateOptionalField(tx, 'MPTokenHolder', isAccount)
67
+ }
@@ -0,0 +1,132 @@
1
+ import { ValidationError } from '../../errors'
2
+ import { isHex } from '../utils'
3
+
4
+ import { BaseTransaction, GlobalFlags, validateBaseTransaction } from './common'
5
+ import type { TransactionMetadataBase } from './metadata'
6
+
7
+ /**
8
+ * Transaction Flags for an MPTokenIssuanceCreate Transaction.
9
+ *
10
+ * @category Transaction Flags
11
+ */
12
+ export enum MPTokenIssuanceCreateFlags {
13
+ /**
14
+ * If set, indicates that the MPT can be locked both individually and globally.
15
+ * If not set, the MPT cannot be locked in any way.
16
+ */
17
+ tfMPTCanLock = 0x00000002,
18
+ /**
19
+ * If set, indicates that individual holders must be authorized.
20
+ * This enables issuers to limit who can hold their assets.
21
+ */
22
+ tfMPTRequireAuth = 0x00000004,
23
+ /**
24
+ * If set, indicates that individual holders can place their balances into an escrow.
25
+ */
26
+ tfMPTCanEscrow = 0x00000008,
27
+ /**
28
+ * If set, indicates that individual holders can trade their balances
29
+ * using the XRP Ledger DEX or AMM.
30
+ */
31
+ tfMPTCanTrade = 0x00000010,
32
+ /**
33
+ * If set, indicates that tokens may be transferred to other accounts
34
+ * that are not the issuer.
35
+ */
36
+ tfMPTCanTransfer = 0x00000020,
37
+ /**
38
+ * If set, indicates that the issuer may use the Clawback transaction
39
+ * to clawback value from individual holders.
40
+ */
41
+ tfMPTCanClawback = 0x00000040,
42
+ }
43
+
44
+ /**
45
+ * Map of flags to boolean values representing {@link MPTokenIssuanceCreate} transaction
46
+ * flags.
47
+ *
48
+ * @category Transaction Flags
49
+ */
50
+ export interface MPTokenIssuanceCreateFlagsInterface extends GlobalFlags {
51
+ tfMPTCanLock?: boolean
52
+ tfMPTRequireAuth?: boolean
53
+ tfMPTCanEscrow?: boolean
54
+ tfMPTCanTrade?: boolean
55
+ tfMPTCanTransfer?: boolean
56
+ tfMPTCanClawback?: boolean
57
+ }
58
+
59
+ /**
60
+ * The MPTokenIssuanceCreate transaction creates a MPTokenIssuance object
61
+ * and adds it to the relevant directory node of the creator account.
62
+ * This transaction is the only opportunity an issuer has to specify any token fields
63
+ * that are defined as immutable (e.g., MPT Flags). If the transaction is successful,
64
+ * the newly created token will be owned by the account (the creator account) which
65
+ * executed the transaction.
66
+ */
67
+ export interface MPTokenIssuanceCreate extends BaseTransaction {
68
+ TransactionType: 'MPTokenIssuanceCreate'
69
+ /**
70
+ * An asset scale is the difference, in orders of magnitude, between a standard unit and
71
+ * a corresponding fractional unit. More formally, the asset scale is a non-negative integer
72
+ * (0, 1, 2, …) such that one standard unit equals 10^(-scale) of a corresponding
73
+ * fractional unit. If the fractional unit equals the standard unit, then the asset scale is 0.
74
+ * Note that this value is optional, and will default to 0 if not supplied.
75
+ */
76
+ AssetScale?: number
77
+ /**
78
+ * Specifies the hex-encoded maximum asset amount of this token that should ever be issued.
79
+ * It is a non-negative integer that can store a range of up to 63 bits. If not set, the max
80
+ * amount will default to the largest unsigned 63-bit integer (0x7FFFFFFFFFFFFFFF)
81
+ *
82
+ * Helper function `mptUint64ToHex` can be used to help converting from base 10 or 16 string
83
+ * to a valid value.
84
+ *
85
+ * Example:
86
+ * ```
87
+ * MaximumAmount: '3e8' // 0x3E8 in hex or 1000 in decimal
88
+ * MaximumAmount: mptUint64ToHex('1000') // 1000 in decimal using helper function
89
+ * ```
90
+ */
91
+ MaximumAmount?: string
92
+ /**
93
+ * Specifies the fee to charged by the issuer for secondary sales of the Token,
94
+ * if such sales are allowed. Valid values for this field are between 0 and 50,000 inclusive,
95
+ * allowing transfer rates of between 0.000% and 50.000% in increments of 0.001.
96
+ * The field must NOT be present if the `tfMPTCanTransfer` flag is not set.
97
+ */
98
+ TransferFee?: number
99
+ /**
100
+ * Arbitrary metadata about this issuance, in hex format.
101
+ */
102
+ MPTokenMetadata?: string | null
103
+ Flags?: number | MPTokenIssuanceCreateFlagsInterface
104
+ }
105
+
106
+ export interface MPTokenIssuanceCreateMetadata extends TransactionMetadataBase {
107
+ mpt_issuance_id?: string
108
+ }
109
+
110
+ /**
111
+ * Verify the form and type of an MPTokenIssuanceCreate at runtime.
112
+ *
113
+ * @param tx - An MPTokenIssuanceCreate Transaction.
114
+ * @throws When the MPTokenIssuanceCreate is Malformed.
115
+ */
116
+ export function validateMPTokenIssuanceCreate(
117
+ tx: Record<string, unknown>,
118
+ ): void {
119
+ validateBaseTransaction(tx)
120
+
121
+ if (typeof tx.MPTokenMetadata === 'string' && tx.MPTokenMetadata === '') {
122
+ throw new ValidationError(
123
+ 'MPTokenIssuanceCreate: MPTokenMetadata must not be empty string',
124
+ )
125
+ }
126
+
127
+ if (typeof tx.MPTokenMetadata === 'string' && !isHex(tx.MPTokenMetadata)) {
128
+ throw new ValidationError(
129
+ 'MPTokenIssuanceCreate: MPTokenMetadata must be in hex format',
130
+ )
131
+ }
132
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ BaseTransaction,
3
+ isString,
4
+ validateBaseTransaction,
5
+ validateRequiredField,
6
+ } from './common'
7
+
8
+ /**
9
+ * The MPTokenIssuanceDestroy transaction is used to remove an MPTokenIssuance object
10
+ * from the directory node in which it is being held, effectively removing the token
11
+ * from the ledger. If this operation succeeds, the corresponding
12
+ * MPTokenIssuance is removed and the owner’s reserve requirement is reduced by one.
13
+ * This operation must fail if there are any holders who have non-zero balances.
14
+ */
15
+ export interface MPTokenIssuanceDestroy extends BaseTransaction {
16
+ TransactionType: 'MPTokenIssuanceDestroy'
17
+ /**
18
+ * Identifies the MPTokenIssuance object to be removed by the transaction.
19
+ */
20
+ MPTokenIssuanceID: string
21
+ }
22
+
23
+ /**
24
+ * Verify the form and type of an MPTokenIssuanceDestroy at runtime.
25
+ *
26
+ * @param tx - An MPTokenIssuanceDestroy Transaction.
27
+ * @throws When the MPTokenIssuanceDestroy is Malformed.
28
+ */
29
+ export function validateMPTokenIssuanceDestroy(
30
+ tx: Record<string, unknown>,
31
+ ): void {
32
+ validateBaseTransaction(tx)
33
+ validateRequiredField(tx, 'MPTokenIssuanceID', isString)
34
+ }
@@ -0,0 +1,76 @@
1
+ import {
2
+ BaseTransaction,
3
+ isString,
4
+ validateBaseTransaction,
5
+ validateRequiredField,
6
+ Account,
7
+ validateOptionalField,
8
+ isAccount,
9
+ GlobalFlags,
10
+ } from './common'
11
+ import { ValidationError } from '../../errors'
12
+
13
+ /**
14
+ * Transaction Flags for an MPTokenIssuanceSet Transaction.
15
+ *
16
+ * @category Transaction Flags
17
+ */
18
+ export enum MPTokenIssuanceSetFlags {
19
+ /**
20
+ * If set, indicates that issuer locks the MPT
21
+ */
22
+ tfMPTLock = 0x00000001,
23
+ /**
24
+ * If set, indicates that issuer unlocks the MPT
25
+ */
26
+ tfMPTUnlock = 0x00000002,
27
+ }
28
+
29
+ /**
30
+ * Map of flags to boolean values representing {@link MPTokenIssuanceSet} transaction
31
+ * flags.
32
+ *
33
+ * @category Transaction Flags
34
+ */
35
+ export interface MPTokenIssuanceSetFlagsInterface extends GlobalFlags {
36
+ tfMPTLock?: boolean
37
+ tfMPTUnlock?: boolean
38
+ }
39
+
40
+ /**
41
+ * The MPTokenIssuanceSet transaction is used to globally lock/unlock a MPTokenIssuance,
42
+ * or lock/unlock an individual's MPToken.
43
+ */
44
+ export interface MPTokenIssuanceSet extends BaseTransaction {
45
+ TransactionType: 'MPTokenIssuanceSet'
46
+ /**
47
+ * Identifies the MPTokenIssuance
48
+ */
49
+ MPTokenIssuanceID: string
50
+ /**
51
+ * An optional XRPL Address of an individual token holder balance to lock/unlock.
52
+ * If omitted, this transaction will apply to all any accounts holding MPTs.
53
+ */
54
+ MPTokenHolder?: Account
55
+ Flags?: number | MPTokenIssuanceSetFlagsInterface
56
+ }
57
+
58
+ /**
59
+ * Verify the form and type of an MPTokenIssuanceSet at runtime.
60
+ *
61
+ * @param tx - An MPTokenIssuanceSet Transaction.
62
+ * @throws When the MPTokenIssuanceSet is Malformed.
63
+ */
64
+ export function validateMPTokenIssuanceSet(tx: Record<string, unknown>): void {
65
+ validateBaseTransaction(tx)
66
+ validateRequiredField(tx, 'MPTokenIssuanceID', isString)
67
+ validateOptionalField(tx, 'MPTokenHolder', isAccount)
68
+
69
+ const flags = tx.Flags as number
70
+ if (
71
+ BigInt(flags) & BigInt(MPTokenIssuanceSetFlags.tfMPTLock) &&
72
+ BigInt(flags) & BigInt(MPTokenIssuanceSetFlags.tfMPTUnlock)
73
+ ) {
74
+ throw new ValidationError('MPTokenIssuanceSet: flag conflict')
75
+ }
76
+ }
@@ -1,10 +1,13 @@
1
1
  import { ValidationError } from '../../errors'
2
- import { IssuedCurrencyAmount } from '../common'
2
+ import { IssuedCurrencyAmount, MPTAmount } from '../common'
3
3
 
4
4
  import {
5
5
  BaseTransaction,
6
6
  validateBaseTransaction,
7
7
  isIssuedCurrency,
8
+ isMPTAmount,
9
+ isAccount,
10
+ validateOptionalField,
8
11
  } from './common'
9
12
 
10
13
  /**
@@ -15,15 +18,20 @@ export interface Clawback extends BaseTransaction {
15
18
  TransactionType: 'Clawback'
16
19
  /**
17
20
  * Indicates the AccountID that submitted this transaction. The account MUST
18
- * be the issuer of the currency.
21
+ * be the issuer of the currency or MPT.
19
22
  */
20
23
  Account: string
21
24
  /**
22
- * The amount of currency to deliver, and it must be non-XRP. The nested field
23
- * names MUST be lower-case. The `issuer` field MUST be the holder's address,
25
+ * The amount of currency or MPT to clawback, and it must be non-XRP. The nested field
26
+ * names MUST be lower-case. If the amount is IOU, the `issuer` field MUST be the holder's address,
24
27
  * whom to be clawed back.
25
28
  */
26
- Amount: IssuedCurrencyAmount
29
+ Amount: IssuedCurrencyAmount | MPTAmount
30
+ /**
31
+ * Indicates the AccountID that the issuer wants to clawback. This field is only valid for clawing back
32
+ * MPTs.
33
+ */
34
+ MPTokenHolder?: string
27
35
  }
28
36
 
29
37
  /**
@@ -34,16 +42,31 @@ export interface Clawback extends BaseTransaction {
34
42
  */
35
43
  export function validateClawback(tx: Record<string, unknown>): void {
36
44
  validateBaseTransaction(tx)
45
+ validateOptionalField(tx, 'MPTokenHolder', isAccount)
37
46
 
38
47
  if (tx.Amount == null) {
39
48
  throw new ValidationError('Clawback: missing field Amount')
40
49
  }
41
50
 
42
- if (!isIssuedCurrency(tx.Amount)) {
51
+ if (!isIssuedCurrency(tx.Amount) && !isMPTAmount(tx.Amount)) {
43
52
  throw new ValidationError('Clawback: invalid Amount')
44
53
  }
45
54
 
46
55
  if (isIssuedCurrency(tx.Amount) && tx.Account === tx.Amount.issuer) {
47
56
  throw new ValidationError('Clawback: invalid holder Account')
48
57
  }
58
+
59
+ if (isMPTAmount(tx.Amount) && tx.Account === tx.MPTokenHolder) {
60
+ throw new ValidationError('Clawback: invalid holder Account')
61
+ }
62
+
63
+ if (isIssuedCurrency(tx.Amount) && tx.MPTokenHolder) {
64
+ throw new ValidationError(
65
+ 'Clawback: cannot have MPTokenHolder for currency',
66
+ )
67
+ }
68
+
69
+ if (isMPTAmount(tx.Amount) && !tx.MPTokenHolder) {
70
+ throw new ValidationError('Clawback: missing MPTokenHolder')
71
+ }
49
72
  }
@@ -9,6 +9,7 @@ import {
9
9
  Memo,
10
10
  Signer,
11
11
  XChainBridge,
12
+ MPTAmount,
12
13
  } from '../common'
13
14
  import { onlyHasFields } from '../utils'
14
15
 
@@ -59,6 +60,7 @@ const XRP_CURRENCY_SIZE = 1
59
60
  const ISSUE_SIZE = 2
60
61
  const ISSUED_CURRENCY_SIZE = 3
61
62
  const XCHAIN_BRIDGE_SIZE = 4
63
+ const MPTOKEN_SIZE = 2
62
64
 
63
65
  function isRecord(value: unknown): value is Record<string, unknown> {
64
66
  return value !== null && typeof value === 'object'
@@ -119,6 +121,21 @@ export function isIssuedCurrency(
119
121
  )
120
122
  }
121
123
 
124
+ /**
125
+ * Verify the form and type of an MPT at runtime.
126
+ *
127
+ * @param input - The input to check the form and type of.
128
+ * @returns Whether the MPTAmount is properly formed.
129
+ */
130
+ export function isMPTAmount(input: unknown): input is MPTAmount {
131
+ return (
132
+ isRecord(input) &&
133
+ Object.keys(input).length === MPTOKEN_SIZE &&
134
+ typeof input.value === 'string' &&
135
+ typeof input.mpt_issuance_id === 'string'
136
+ )
137
+ }
138
+
122
139
  /**
123
140
  * Must be a valid account address
124
141
  */
@@ -144,7 +161,11 @@ export function isAccount(account: unknown): account is Account {
144
161
  * @returns Whether the Amount is properly formed.
145
162
  */
146
163
  export function isAmount(amount: unknown): amount is Amount {
147
- return typeof amount === 'string' || isIssuedCurrency(amount)
164
+ return (
165
+ typeof amount === 'string' ||
166
+ isIssuedCurrency(amount) ||
167
+ isMPTAmount(amount)
168
+ )
148
169
  }
149
170
 
150
171
  /**
@@ -1,4 +1,4 @@
1
- export { BaseTransaction } from './common'
1
+ export { BaseTransaction, isMPTAmount } from './common'
2
2
  export {
3
3
  validate,
4
4
  PseudoTransaction,
@@ -39,6 +39,22 @@ export { EscrowCancel } from './escrowCancel'
39
39
  export { EscrowCreate } from './escrowCreate'
40
40
  export { EscrowFinish } from './escrowFinish'
41
41
  export { EnableAmendment, EnableAmendmentFlags } from './enableAmendment'
42
+ export {
43
+ MPTokenAuthorize,
44
+ MPTokenAuthorizeFlags,
45
+ MPTokenAuthorizeFlagsInterface,
46
+ } from './MPTokenAuthorize'
47
+ export {
48
+ MPTokenIssuanceCreate,
49
+ MPTokenIssuanceCreateFlags,
50
+ MPTokenIssuanceCreateFlagsInterface,
51
+ } from './MPTokenIssuanceCreate'
52
+ export { MPTokenIssuanceDestroy } from './MPTokenIssuanceDestroy'
53
+ export {
54
+ MPTokenIssuanceSet,
55
+ MPTokenIssuanceSetFlags,
56
+ MPTokenIssuanceSetFlagsInterface,
57
+ } from './MPTokenIssuanceSet'
42
58
  export { NFTokenAcceptOffer } from './NFTokenAcceptOffer'
43
59
  export { NFTokenBurn } from './NFTokenBurn'
44
60
  export { NFTokenCancelOffer } from './NFTokenCancelOffer'
@@ -1,4 +1,4 @@
1
- import { Amount } from '../common'
1
+ import { Amount, MPTAmount } from '../common'
2
2
 
3
3
  import { BaseTransaction } from './common'
4
4
  import {
@@ -14,6 +14,10 @@ import {
14
14
  NFTokenCreateOfferMetadata,
15
15
  } from './NFTokenCreateOffer'
16
16
  import { NFTokenMint, NFTokenMintMetadata } from './NFTokenMint'
17
+ import {
18
+ MPTokenIssuanceCreate,
19
+ MPTokenIssuanceCreateMetadata,
20
+ } from './MPTokenIssuanceCreate'
17
21
  import { Payment, PaymentMetadata } from './payment'
18
22
  import type { Transaction } from './transaction'
19
23
 
@@ -79,9 +83,9 @@ export function isDeletedNode(node: Node): node is DeletedNode {
79
83
 
80
84
  export interface TransactionMetadataBase {
81
85
  AffectedNodes: Node[]
82
- DeliveredAmount?: Amount
86
+ DeliveredAmount?: Amount | MPTAmount
83
87
  // "unavailable" possible for transactions before 2014-01-20
84
- delivered_amount?: Amount | 'unavailable'
88
+ delivered_amount?: Amount | MPTAmount | 'unavailable'
85
89
  TransactionIndex: number
86
90
  TransactionResult: string
87
91
  }
@@ -97,4 +101,6 @@ export type TransactionMetadata<T extends BaseTransaction = Transaction> =
97
101
  ? NFTokenAcceptOfferMetadata
98
102
  : T extends NFTokenCancelOffer
99
103
  ? NFTokenCancelOfferMetadata
104
+ : T extends MPTokenIssuanceCreate
105
+ ? MPTokenIssuanceCreateMetadata
100
106
  : TransactionMetadataBase
@@ -1,5 +1,5 @@
1
1
  import { ValidationError } from '../../errors'
2
- import { Amount, Path } from '../common'
2
+ import { Amount, Path, MPTAmount } from '../common'
3
3
  import { isFlagEnabled } from '../utils'
4
4
 
5
5
  import {
@@ -116,7 +116,7 @@ export interface Payment extends BaseTransaction {
116
116
  * names MUST be lower-case. If the tfPartialPayment flag is set, deliver up
117
117
  * to this amount instead.
118
118
  */
119
- Amount: Amount
119
+ Amount: Amount | MPTAmount
120
120
  /** The unique address of the account receiving the payment. */
121
121
  Destination: Account
122
122
  /**
@@ -153,8 +153,8 @@ export interface Payment extends BaseTransaction {
153
153
  }
154
154
 
155
155
  export interface PaymentMetadata extends TransactionMetadataBase {
156
- DeliveredAmount?: Amount
157
- delivered_amount?: Amount | 'unavailable'
156
+ DeliveredAmount?: Amount | MPTAmount
157
+ delivered_amount?: Amount | MPTAmount | 'unavailable'
158
158
  }
159
159
 
160
160
  /**
@@ -90,6 +90,19 @@ import {
90
90
  XChainModifyBridge,
91
91
  validateXChainModifyBridge,
92
92
  } from './XChainModifyBridge'
93
+ import { MPTokenAuthorize, validateMPTokenAuthorize } from './MPTokenAuthorize'
94
+ import {
95
+ MPTokenIssuanceCreate,
96
+ validateMPTokenIssuanceCreate,
97
+ } from './MPTokenIssuanceCreate'
98
+ import {
99
+ MPTokenIssuanceDestroy,
100
+ validateMPTokenIssuanceDestroy,
101
+ } from './MPTokenIssuanceDestroy'
102
+ import {
103
+ MPTokenIssuanceSet,
104
+ validateMPTokenIssuanceSet,
105
+ } from './MPTokenIssuanceSet'
93
106
 
94
107
  /**
95
108
  * Transactions that can be submitted by clients
@@ -115,6 +128,10 @@ export type SubmittableTransaction =
115
128
  | EscrowCancel
116
129
  | EscrowCreate
117
130
  | EscrowFinish
131
+ | MPTokenAuthorize
132
+ | MPTokenIssuanceCreate
133
+ | MPTokenIssuanceDestroy
134
+ | MPTokenIssuanceSet
118
135
  | NFTokenAcceptOffer
119
136
  | NFTokenBurn
120
137
  | NFTokenCancelOffer
@@ -306,6 +323,22 @@ export function validate(transaction: Record<string, unknown>): void {
306
323
  validateEscrowFinish(tx)
307
324
  break
308
325
 
326
+ case 'MPTokenAuthorize':
327
+ validateMPTokenAuthorize(tx)
328
+ break
329
+
330
+ case 'MPTokenIssuanceCreate':
331
+ validateMPTokenIssuanceCreate(tx)
332
+ break
333
+
334
+ case 'MPTokenIssuanceDestroy':
335
+ validateMPTokenIssuanceDestroy(tx)
336
+ break
337
+
338
+ case 'MPTokenIssuanceSet':
339
+ validateMPTokenIssuanceSet(tx)
340
+ break
341
+
309
342
  case 'NFTokenAcceptOffer':
310
343
  validateNFTokenAcceptOffer(tx)
311
344
  break