@bithomp/xrpl-api 3.7.31 → 3.7.38

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 (508) hide show
  1. package/lib/connection.js +5 -3
  2. package/lib/src/base58.d.ts +2 -0
  3. package/lib/src/base58.js +32 -0
  4. package/lib/src/client.d.ts +25 -0
  5. package/lib/src/client.js +192 -0
  6. package/lib/src/common/errors/index.d.ts +3 -0
  7. package/lib/src/common/errors/index.js +7 -0
  8. package/lib/src/common/errors/validation_error.d.ts +4 -0
  9. package/lib/src/common/errors/validation_error.js +7 -0
  10. package/lib/src/common/errors/xrpl_api_error.d.ts +9 -0
  11. package/lib/src/common/errors/xrpl_api_error.js +28 -0
  12. package/lib/src/common/index.d.ts +9 -0
  13. package/lib/src/common/index.js +57 -0
  14. package/lib/src/common/sha512Half.d.ts +2 -0
  15. package/lib/src/common/sha512Half.js +12 -0
  16. package/lib/src/common/utils.d.ts +14 -0
  17. package/lib/src/common/utils.js +147 -0
  18. package/lib/src/connection.d.ts +75 -0
  19. package/lib/src/connection.js +645 -0
  20. package/lib/src/faucet.d.ts +58 -0
  21. package/lib/src/faucet.js +129 -0
  22. package/lib/src/index.d.ts +9 -0
  23. package/lib/src/index.js +45 -0
  24. package/lib/src/ledger/account_info.d.ts +16 -0
  25. package/lib/src/ledger/account_info.js +112 -0
  26. package/lib/src/ledger/account_lines.d.ts +11 -0
  27. package/lib/src/ledger/account_lines.js +90 -0
  28. package/lib/src/ledger/account_namespace.d.ts +7 -0
  29. package/lib/src/ledger/account_namespace.js +72 -0
  30. package/lib/src/ledger/account_nfts.d.ts +21 -0
  31. package/lib/src/ledger/account_nfts.js +199 -0
  32. package/lib/src/ledger/account_objects.d.ts +44 -0
  33. package/lib/src/ledger/account_objects.js +222 -0
  34. package/lib/src/ledger/account_offers.d.ts +13 -0
  35. package/lib/src/ledger/account_offers.js +142 -0
  36. package/lib/src/ledger/account_tx.d.ts +37 -0
  37. package/lib/src/ledger/account_tx.js +376 -0
  38. package/lib/src/ledger/amm_info.d.ts +13 -0
  39. package/lib/src/ledger/amm_info.js +114 -0
  40. package/lib/src/ledger/book_offers.d.ts +15 -0
  41. package/lib/src/ledger/book_offers.js +102 -0
  42. package/lib/src/ledger/currency.d.ts +28 -0
  43. package/lib/src/ledger/currency.js +250 -0
  44. package/lib/src/ledger/fee.d.ts +13 -0
  45. package/lib/src/ledger/fee.js +99 -0
  46. package/lib/src/ledger/gateway_balances.d.ts +16 -0
  47. package/lib/src/ledger/gateway_balances.js +119 -0
  48. package/lib/src/ledger/index.d.ts +21 -0
  49. package/lib/src/ledger/index.js +37 -0
  50. package/lib/src/ledger/ledger.d.ts +16 -0
  51. package/lib/src/ledger/ledger.js +99 -0
  52. package/lib/src/ledger/ledger_entry.d.ts +16 -0
  53. package/lib/src/ledger/ledger_entry.js +118 -0
  54. package/lib/src/ledger/manifest.d.ts +8 -0
  55. package/lib/src/ledger/manifest.js +67 -0
  56. package/lib/src/ledger/nft_info.d.ts +4 -0
  57. package/lib/src/ledger/nft_info.js +67 -0
  58. package/lib/src/ledger/server_definitions.d.ts +7 -0
  59. package/lib/src/ledger/server_definitions.js +65 -0
  60. package/lib/src/ledger/server_info.d.ts +8 -0
  61. package/lib/src/ledger/server_info.js +65 -0
  62. package/lib/src/ledger/transaction.d.ts +47 -0
  63. package/lib/src/ledger/transaction.js +440 -0
  64. package/lib/src/ledger/vl-v2.d.ts +3 -0
  65. package/lib/src/ledger/vl-v2.js +124 -0
  66. package/lib/src/ledger/vl.d.ts +4 -0
  67. package/lib/src/ledger/vl.js +131 -0
  68. package/lib/src/models/account_info.d.ts +184 -0
  69. package/lib/src/models/account_info.js +139 -0
  70. package/lib/src/models/account_lines.d.ts +26 -0
  71. package/lib/src/models/account_lines.js +2 -0
  72. package/lib/src/models/account_namespace.d.ts +16 -0
  73. package/lib/src/models/account_namespace.js +2 -0
  74. package/lib/src/models/account_nfts.d.ts +20 -0
  75. package/lib/src/models/account_nfts.js +92 -0
  76. package/lib/src/models/account_object.d.ts +61 -0
  77. package/lib/src/models/account_object.js +125 -0
  78. package/lib/src/models/account_offers.d.ts +9 -0
  79. package/lib/src/models/account_offers.js +2 -0
  80. package/lib/src/models/account_uritokens.d.ts +11 -0
  81. package/lib/src/models/account_uritokens.js +2 -0
  82. package/lib/src/models/amm_info.d.ts +1 -0
  83. package/lib/src/models/amm_info.js +4 -0
  84. package/lib/src/models/base_model.d.ts +15 -0
  85. package/lib/src/models/base_model.js +2 -0
  86. package/lib/src/models/book_offers.d.ts +9 -0
  87. package/lib/src/models/book_offers.js +40 -0
  88. package/lib/src/models/gateway_balances.d.ts +19 -0
  89. package/lib/src/models/gateway_balances.js +2 -0
  90. package/lib/src/models/index.d.ts +38 -0
  91. package/lib/src/models/index.js +82 -0
  92. package/lib/src/models/ledger.d.ts +7 -0
  93. package/lib/src/models/ledger.js +20 -0
  94. package/lib/src/models/manifest.d.ts +25 -0
  95. package/lib/src/models/manifest.js +199 -0
  96. package/lib/src/models/mptoken.d.ts +7 -0
  97. package/lib/src/models/mptoken.js +59 -0
  98. package/lib/src/models/path_find.d.ts +11 -0
  99. package/lib/src/models/path_find.js +2 -0
  100. package/lib/src/models/server_definitions.d.ts +33 -0
  101. package/lib/src/models/server_definitions.js +2 -0
  102. package/lib/src/models/transaction.d.ts +52 -0
  103. package/lib/src/models/transaction.js +141 -0
  104. package/lib/src/models/transactions/CronSet.d.ts +3 -0
  105. package/lib/src/models/transactions/CronSet.js +2 -0
  106. package/lib/src/models/transactions/SetRemarks.d.ts +3 -0
  107. package/lib/src/models/transactions/SetRemarks.js +2 -0
  108. package/lib/src/models/transactions/URITokenMint.d.ts +3 -0
  109. package/lib/src/models/transactions/URITokenMint.js +2 -0
  110. package/lib/src/models/vl.d.ts +82 -0
  111. package/lib/src/models/vl.js +498 -0
  112. package/lib/src/parse/index.d.ts +6 -0
  113. package/lib/src/parse/index.js +46 -0
  114. package/lib/src/parse/ledger/account-fields.d.ts +5 -0
  115. package/lib/src/parse/ledger/account-fields.js +43 -0
  116. package/lib/src/parse/ledger/account-info.d.ts +3 -0
  117. package/lib/src/parse/ledger/account-info.js +15 -0
  118. package/lib/src/parse/ledger/account-order.d.ts +18 -0
  119. package/lib/src/parse/ledger/account-order.js +48 -0
  120. package/lib/src/parse/ledger/account-settings-flags.d.ts +2 -0
  121. package/lib/src/parse/ledger/account-settings-flags.js +77 -0
  122. package/lib/src/parse/ledger/account.d.ts +1 -0
  123. package/lib/src/parse/ledger/account.js +7 -0
  124. package/lib/src/parse/ledger/amount.d.ts +3 -0
  125. package/lib/src/parse/ledger/amount.js +25 -0
  126. package/lib/src/parse/ledger/asset.d.ts +3 -0
  127. package/lib/src/parse/ledger/asset.js +19 -0
  128. package/lib/src/parse/ledger/auth-accounts.d.ts +3 -0
  129. package/lib/src/parse/ledger/auth-accounts.js +18 -0
  130. package/lib/src/parse/ledger/credential-flags.d.ts +5 -0
  131. package/lib/src/parse/ledger/credential-flags.js +8 -0
  132. package/lib/src/parse/ledger/credential.d.ts +3 -0
  133. package/lib/src/parse/ledger/credential.js +13 -0
  134. package/lib/src/parse/ledger/currency-amount.d.ts +3 -0
  135. package/lib/src/parse/ledger/currency-amount.js +13 -0
  136. package/lib/src/parse/ledger/delegate.d.ts +2 -0
  137. package/lib/src/parse/ledger/delegate.js +11 -0
  138. package/lib/src/parse/ledger/destination.d.ts +2 -0
  139. package/lib/src/parse/ledger/destination.js +12 -0
  140. package/lib/src/parse/ledger/emit_details.d.ts +2 -0
  141. package/lib/src/parse/ledger/emit_details.js +14 -0
  142. package/lib/src/parse/ledger/flags.d.ts +4 -0
  143. package/lib/src/parse/ledger/flags.js +17 -0
  144. package/lib/src/parse/ledger/gateway-balances.d.ts +3 -0
  145. package/lib/src/parse/ledger/gateway-balances.js +31 -0
  146. package/lib/src/parse/ledger/genesis-mints.d.ts +2 -0
  147. package/lib/src/parse/ledger/genesis-mints.js +17 -0
  148. package/lib/src/parse/ledger/import.d.ts +2 -0
  149. package/lib/src/parse/ledger/import.js +40 -0
  150. package/lib/src/parse/ledger/index.d.ts +6 -0
  151. package/lib/src/parse/ledger/index.js +29 -0
  152. package/lib/src/parse/ledger/ledger.d.ts +2 -0
  153. package/lib/src/parse/ledger/ledger.js +98 -0
  154. package/lib/src/parse/ledger/memos.d.ts +4 -0
  155. package/lib/src/parse/ledger/memos.js +27 -0
  156. package/lib/src/parse/ledger/mptoken-flags.d.ts +6 -0
  157. package/lib/src/parse/ledger/mptoken-flags.js +8 -0
  158. package/lib/src/parse/ledger/mptoken-issuance-flags.d.ts +6 -0
  159. package/lib/src/parse/ledger/mptoken-issuance-flags.js +8 -0
  160. package/lib/src/parse/ledger/nftoken-flags.d.ts +5 -0
  161. package/lib/src/parse/ledger/nftoken-flags.js +8 -0
  162. package/lib/src/parse/ledger/nftoken-offer-flags.d.ts +5 -0
  163. package/lib/src/parse/ledger/nftoken-offer-flags.js +8 -0
  164. package/lib/src/parse/ledger/offer-flags.d.ts +5 -0
  165. package/lib/src/parse/ledger/offer-flags.js +8 -0
  166. package/lib/src/parse/ledger/orderbook-order.d.ts +21 -0
  167. package/lib/src/parse/ledger/orderbook-order.js +42 -0
  168. package/lib/src/parse/ledger/permissions.d.ts +2 -0
  169. package/lib/src/parse/ledger/permissions.js +9 -0
  170. package/lib/src/parse/ledger/regular-key.d.ts +2 -0
  171. package/lib/src/parse/ledger/regular-key.js +14 -0
  172. package/lib/src/parse/ledger/remark-flags.d.ts +5 -0
  173. package/lib/src/parse/ledger/remark-flags.js +8 -0
  174. package/lib/src/parse/ledger/remarks.d.ts +3 -0
  175. package/lib/src/parse/ledger/remarks.js +37 -0
  176. package/lib/src/parse/ledger/signers.d.ts +2 -0
  177. package/lib/src/parse/ledger/signers.js +12 -0
  178. package/lib/src/parse/ledger/source.d.ts +3 -0
  179. package/lib/src/parse/ledger/source.js +28 -0
  180. package/lib/src/parse/ledger/trustline-flags.d.ts +5 -0
  181. package/lib/src/parse/ledger/trustline-flags.js +8 -0
  182. package/lib/src/parse/ledger/tx-account-set-flags.d.ts +4 -0
  183. package/lib/src/parse/ledger/tx-account-set-flags.js +36 -0
  184. package/lib/src/parse/ledger/tx-amm-clawback-flags.d.ts +6 -0
  185. package/lib/src/parse/ledger/tx-amm-clawback-flags.js +8 -0
  186. package/lib/src/parse/ledger/tx-amm-deposit-flags.d.ts +6 -0
  187. package/lib/src/parse/ledger/tx-amm-deposit-flags.js +8 -0
  188. package/lib/src/parse/ledger/tx-amm-withdraw-flags.d.ts +6 -0
  189. package/lib/src/parse/ledger/tx-amm-withdraw-flags.js +8 -0
  190. package/lib/src/parse/ledger/tx-batch-flags.d.ts +6 -0
  191. package/lib/src/parse/ledger/tx-batch-flags.js +8 -0
  192. package/lib/src/parse/ledger/tx-cron-set-flags.d.ts +6 -0
  193. package/lib/src/parse/ledger/tx-cron-set-flags.js +8 -0
  194. package/lib/src/parse/ledger/tx-global-flags.d.ts +5 -0
  195. package/lib/src/parse/ledger/tx-global-flags.js +8 -0
  196. package/lib/src/parse/ledger/tx-mptoken-authorize-flags.d.ts +6 -0
  197. package/lib/src/parse/ledger/tx-mptoken-authorize-flags.js +8 -0
  198. package/lib/src/parse/ledger/tx-mptoken-issuance-create-flags.d.ts +6 -0
  199. package/lib/src/parse/ledger/tx-mptoken-issuance-create-flags.js +8 -0
  200. package/lib/src/parse/ledger/tx-mptoken-issuance-set-flags.d.ts +6 -0
  201. package/lib/src/parse/ledger/tx-mptoken-issuance-set-flags.js +8 -0
  202. package/lib/src/parse/ledger/tx-nftoken-mint-flags.d.ts +6 -0
  203. package/lib/src/parse/ledger/tx-nftoken-mint-flags.js +8 -0
  204. package/lib/src/parse/ledger/tx-nftoken-offer-create-flags.d.ts +6 -0
  205. package/lib/src/parse/ledger/tx-nftoken-offer-create-flags.js +8 -0
  206. package/lib/src/parse/ledger/tx-offer-create-flags.d.ts +6 -0
  207. package/lib/src/parse/ledger/tx-offer-create-flags.js +8 -0
  208. package/lib/src/parse/ledger/tx-payment-flags.d.ts +6 -0
  209. package/lib/src/parse/ledger/tx-payment-flags.js +8 -0
  210. package/lib/src/parse/ledger/tx-trust-set-flags.d.ts +6 -0
  211. package/lib/src/parse/ledger/tx-trust-set-flags.js +8 -0
  212. package/lib/src/parse/ledger/tx-uritoken-mint-flags.d.ts +6 -0
  213. package/lib/src/parse/ledger/tx-uritoken-mint-flags.js +8 -0
  214. package/lib/src/parse/ledger/uritoken-flags.d.ts +5 -0
  215. package/lib/src/parse/ledger/uritoken-flags.js +8 -0
  216. package/lib/src/parse/mptoken_normalize.d.ts +5 -0
  217. package/lib/src/parse/mptoken_normalize.js +215 -0
  218. package/lib/src/parse/outcome/account_setting_changes.d.ts +4 -0
  219. package/lib/src/parse/outcome/account_setting_changes.js +67 -0
  220. package/lib/src/parse/outcome/affected_objects.d.ts +7 -0
  221. package/lib/src/parse/outcome/affected_objects.js +147 -0
  222. package/lib/src/parse/outcome/amendment_changes.d.ts +8 -0
  223. package/lib/src/parse/outcome/amendment_changes.js +84 -0
  224. package/lib/src/parse/outcome/amm_changes.d.ts +52 -0
  225. package/lib/src/parse/outcome/amm_changes.js +214 -0
  226. package/lib/src/parse/outcome/balance_changes.d.ts +24 -0
  227. package/lib/src/parse/outcome/balance_changes.js +337 -0
  228. package/lib/src/parse/outcome/channel_changes.d.ts +20 -0
  229. package/lib/src/parse/outcome/channel_changes.js +70 -0
  230. package/lib/src/parse/outcome/check_changes.d.ts +17 -0
  231. package/lib/src/parse/outcome/check_changes.js +63 -0
  232. package/lib/src/parse/outcome/credential_changes.d.ts +16 -0
  233. package/lib/src/parse/outcome/credential_changes.js +59 -0
  234. package/lib/src/parse/outcome/cron_changes.d.ts +13 -0
  235. package/lib/src/parse/outcome/cron_changes.js +72 -0
  236. package/lib/src/parse/outcome/delegate_changes.d.ts +12 -0
  237. package/lib/src/parse/outcome/delegate_changes.js +59 -0
  238. package/lib/src/parse/outcome/delivered_amount.d.ts +4 -0
  239. package/lib/src/parse/outcome/delivered_amount.js +63 -0
  240. package/lib/src/parse/outcome/did_changes.d.ts +14 -0
  241. package/lib/src/parse/outcome/did_changes.js +50 -0
  242. package/lib/src/parse/outcome/emitted_txns.d.ts +9 -0
  243. package/lib/src/parse/outcome/emitted_txns.js +57 -0
  244. package/lib/src/parse/outcome/escrow_changes.d.ts +16 -0
  245. package/lib/src/parse/outcome/escrow_changes.js +75 -0
  246. package/lib/src/parse/outcome/hooks_executions.d.ts +13 -0
  247. package/lib/src/parse/outcome/hooks_executions.js +42 -0
  248. package/lib/src/parse/outcome/index.d.ts +26 -0
  249. package/lib/src/parse/outcome/index.js +55 -0
  250. package/lib/src/parse/outcome/locked_balance_changes.d.ts +20 -0
  251. package/lib/src/parse/outcome/locked_balance_changes.js +117 -0
  252. package/lib/src/parse/outcome/mptoken_changes.d.ts +1 -0
  253. package/lib/src/parse/outcome/mptoken_changes.js +113 -0
  254. package/lib/src/parse/outcome/mptoken_issuance_changes.d.ts +1 -0
  255. package/lib/src/parse/outcome/mptoken_issuance_changes.js +119 -0
  256. package/lib/src/parse/outcome/nftoken_changes.d.ts +1 -0
  257. package/lib/src/parse/outcome/nftoken_changes.js +234 -0
  258. package/lib/src/parse/outcome/nftoken_offer_changes.d.ts +2 -0
  259. package/lib/src/parse/outcome/nftoken_offer_changes.js +106 -0
  260. package/lib/src/parse/outcome/oracle_changes.d.ts +29 -0
  261. package/lib/src/parse/outcome/oracle_changes.js +150 -0
  262. package/lib/src/parse/outcome/orderbook_changes.d.ts +21 -0
  263. package/lib/src/parse/outcome/orderbook_changes.js +108 -0
  264. package/lib/src/parse/outcome/orderbook_quality.d.ts +2 -0
  265. package/lib/src/parse/outcome/orderbook_quality.js +49 -0
  266. package/lib/src/parse/outcome/remarks_changes.d.ts +14 -0
  267. package/lib/src/parse/outcome/remarks_changes.js +68 -0
  268. package/lib/src/parse/outcome/unl_report_changes.d.ts +13 -0
  269. package/lib/src/parse/outcome/unl_report_changes.js +48 -0
  270. package/lib/src/parse/outcome/uritoken_changes.d.ts +1 -0
  271. package/lib/src/parse/outcome/uritoken_changes.js +83 -0
  272. package/lib/src/parse/outcome/uritoken_sell_offer_changes.d.ts +1 -0
  273. package/lib/src/parse/outcome/uritoken_sell_offer_changes.js +105 -0
  274. package/lib/src/parse/outcome.d.ts +4 -0
  275. package/lib/src/parse/outcome.js +264 -0
  276. package/lib/src/parse/specification/account-delete.d.ts +4 -0
  277. package/lib/src/parse/specification/account-delete.js +59 -0
  278. package/lib/src/parse/specification/amendment.d.ts +3 -0
  279. package/lib/src/parse/specification/amendment.js +50 -0
  280. package/lib/src/parse/specification/amm-bid.d.ts +4 -0
  281. package/lib/src/parse/specification/amm-bid.js +66 -0
  282. package/lib/src/parse/specification/amm-clawback.d.ts +4 -0
  283. package/lib/src/parse/specification/amm-clawback.js +65 -0
  284. package/lib/src/parse/specification/amm-create.d.ts +4 -0
  285. package/lib/src/parse/specification/amm-create.js +62 -0
  286. package/lib/src/parse/specification/amm-delete.d.ts +4 -0
  287. package/lib/src/parse/specification/amm-delete.js +61 -0
  288. package/lib/src/parse/specification/amm-deposit.d.ts +4 -0
  289. package/lib/src/parse/specification/amm-deposit.js +66 -0
  290. package/lib/src/parse/specification/amm-vote.d.ts +4 -0
  291. package/lib/src/parse/specification/amm-vote.js +62 -0
  292. package/lib/src/parse/specification/amm-withdraw.d.ts +4 -0
  293. package/lib/src/parse/specification/amm-withdraw.js +66 -0
  294. package/lib/src/parse/specification/batch.d.ts +4 -0
  295. package/lib/src/parse/specification/batch.js +83 -0
  296. package/lib/src/parse/specification/check-cancel.d.ts +4 -0
  297. package/lib/src/parse/specification/check-cancel.js +58 -0
  298. package/lib/src/parse/specification/check-cash.d.ts +4 -0
  299. package/lib/src/parse/specification/check-cash.js +64 -0
  300. package/lib/src/parse/specification/check-create.d.ts +4 -0
  301. package/lib/src/parse/specification/check-create.js +67 -0
  302. package/lib/src/parse/specification/clawback.d.ts +4 -0
  303. package/lib/src/parse/specification/clawback.js +62 -0
  304. package/lib/src/parse/specification/credential-accept.d.ts +4 -0
  305. package/lib/src/parse/specification/credential-accept.js +56 -0
  306. package/lib/src/parse/specification/credential-create.d.ts +4 -0
  307. package/lib/src/parse/specification/credential-create.js +58 -0
  308. package/lib/src/parse/specification/credential-delete.d.ts +4 -0
  309. package/lib/src/parse/specification/credential-delete.js +57 -0
  310. package/lib/src/parse/specification/cron-set.d.ts +3 -0
  311. package/lib/src/parse/specification/cron-set.js +62 -0
  312. package/lib/src/parse/specification/cron.d.ts +3 -0
  313. package/lib/src/parse/specification/cron.js +47 -0
  314. package/lib/src/parse/specification/delegate-set.d.ts +4 -0
  315. package/lib/src/parse/specification/delegate-set.js +60 -0
  316. package/lib/src/parse/specification/deposit-preauth.d.ts +4 -0
  317. package/lib/src/parse/specification/deposit-preauth.js +62 -0
  318. package/lib/src/parse/specification/did-delete.d.ts +4 -0
  319. package/lib/src/parse/specification/did-delete.js +57 -0
  320. package/lib/src/parse/specification/did-set.d.ts +4 -0
  321. package/lib/src/parse/specification/did-set.js +60 -0
  322. package/lib/src/parse/specification/escrow-cancel.d.ts +4 -0
  323. package/lib/src/parse/specification/escrow-cancel.js +59 -0
  324. package/lib/src/parse/specification/escrow-create.d.ts +4 -0
  325. package/lib/src/parse/specification/escrow-create.js +64 -0
  326. package/lib/src/parse/specification/escrow-finish.d.ts +4 -0
  327. package/lib/src/parse/specification/escrow-finish.js +61 -0
  328. package/lib/src/parse/specification/fee-update.d.ts +3 -0
  329. package/lib/src/parse/specification/fee-update.js +69 -0
  330. package/lib/src/parse/specification/genesis-mint.d.ts +3 -0
  331. package/lib/src/parse/specification/genesis-mint.js +53 -0
  332. package/lib/src/parse/specification/import.d.ts +3 -0
  333. package/lib/src/parse/specification/import.js +55 -0
  334. package/lib/src/parse/specification/invoke.d.ts +3 -0
  335. package/lib/src/parse/specification/invoke.js +54 -0
  336. package/lib/src/parse/specification/mptoken-authorize.d.ts +4 -0
  337. package/lib/src/parse/specification/mptoken-authorize.js +60 -0
  338. package/lib/src/parse/specification/mptoken-issuance-create.d.ts +4 -0
  339. package/lib/src/parse/specification/mptoken-issuance-create.js +62 -0
  340. package/lib/src/parse/specification/mptoken-issuance-destroy.d.ts +4 -0
  341. package/lib/src/parse/specification/mptoken-issuance-destroy.js +56 -0
  342. package/lib/src/parse/specification/mptoken-issuance-set.d.ts +4 -0
  343. package/lib/src/parse/specification/mptoken-issuance-set.js +60 -0
  344. package/lib/src/parse/specification/nftoken-accept-offer.d.ts +4 -0
  345. package/lib/src/parse/specification/nftoken-accept-offer.js +58 -0
  346. package/lib/src/parse/specification/nftoken-burn.d.ts +4 -0
  347. package/lib/src/parse/specification/nftoken-burn.js +56 -0
  348. package/lib/src/parse/specification/nftoken-cancel-offer.d.ts +4 -0
  349. package/lib/src/parse/specification/nftoken-cancel-offer.js +56 -0
  350. package/lib/src/parse/specification/nftoken-create-offer.d.ts +4 -0
  351. package/lib/src/parse/specification/nftoken-create-offer.js +69 -0
  352. package/lib/src/parse/specification/nftoken-mint.d.ts +4 -0
  353. package/lib/src/parse/specification/nftoken-mint.js +73 -0
  354. package/lib/src/parse/specification/nftoken-modify.d.ts +4 -0
  355. package/lib/src/parse/specification/nftoken-modify.js +58 -0
  356. package/lib/src/parse/specification/offer-cancel.d.ts +4 -0
  357. package/lib/src/parse/specification/offer-cancel.js +58 -0
  358. package/lib/src/parse/specification/offer-create.d.ts +4 -0
  359. package/lib/src/parse/specification/offer-create.js +78 -0
  360. package/lib/src/parse/specification/oracle-delete.d.ts +4 -0
  361. package/lib/src/parse/specification/oracle-delete.js +56 -0
  362. package/lib/src/parse/specification/oracle-set.d.ts +4 -0
  363. package/lib/src/parse/specification/oracle-set.js +62 -0
  364. package/lib/src/parse/specification/payment-channel-claim.d.ts +4 -0
  365. package/lib/src/parse/specification/payment-channel-claim.js +67 -0
  366. package/lib/src/parse/specification/payment-channel-create.d.ts +4 -0
  367. package/lib/src/parse/specification/payment-channel-create.js +68 -0
  368. package/lib/src/parse/specification/payment-channel-fund.d.ts +4 -0
  369. package/lib/src/parse/specification/payment-channel-fund.js +65 -0
  370. package/lib/src/parse/specification/payment.d.ts +4 -0
  371. package/lib/src/parse/specification/payment.js +75 -0
  372. package/lib/src/parse/specification/permissioned-domain-set.d.ts +4 -0
  373. package/lib/src/parse/specification/permissioned-domain-set.js +56 -0
  374. package/lib/src/parse/specification/remit.d.ts +3 -0
  375. package/lib/src/parse/specification/remit.js +90 -0
  376. package/lib/src/parse/specification/set-remarks.d.ts +3 -0
  377. package/lib/src/parse/specification/set-remarks.js +56 -0
  378. package/lib/src/parse/specification/settings.d.ts +4 -0
  379. package/lib/src/parse/specification/settings.js +64 -0
  380. package/lib/src/parse/specification/ticket-create.d.ts +4 -0
  381. package/lib/src/parse/specification/ticket-create.js +58 -0
  382. package/lib/src/parse/specification/trust-set.d.ts +4 -0
  383. package/lib/src/parse/specification/trust-set.js +80 -0
  384. package/lib/src/parse/specification/unl-modify.d.ts +4 -0
  385. package/lib/src/parse/specification/unl-modify.js +52 -0
  386. package/lib/src/parse/specification/unl-report.d.ts +3 -0
  387. package/lib/src/parse/specification/unl-report.js +51 -0
  388. package/lib/src/parse/specification/unrecognized.d.ts +4 -0
  389. package/lib/src/parse/specification/unrecognized.js +24 -0
  390. package/lib/src/parse/specification/uritoken-burn.d.ts +3 -0
  391. package/lib/src/parse/specification/uritoken-burn.js +54 -0
  392. package/lib/src/parse/specification/uritoken-buy.d.ts +3 -0
  393. package/lib/src/parse/specification/uritoken-buy.js +55 -0
  394. package/lib/src/parse/specification/uritoken-cancel-sell-offer.d.ts +3 -0
  395. package/lib/src/parse/specification/uritoken-cancel-sell-offer.js +54 -0
  396. package/lib/src/parse/specification/uritoken-create-sell-offer.d.ts +3 -0
  397. package/lib/src/parse/specification/uritoken-create-sell-offer.js +57 -0
  398. package/lib/src/parse/specification/uritoken-mint.d.ts +3 -0
  399. package/lib/src/parse/specification/uritoken-mint.js +63 -0
  400. package/lib/src/parse/transaction.d.ts +168 -0
  401. package/lib/src/parse/transaction.js +228 -0
  402. package/lib/src/parse/utils.d.ts +33 -0
  403. package/lib/src/parse/utils.js +119 -0
  404. package/lib/src/types/account.d.ts +26 -0
  405. package/lib/src/types/account.js +2 -0
  406. package/lib/src/types/adjustments.d.ts +16 -0
  407. package/lib/src/types/adjustments.js +2 -0
  408. package/lib/src/types/amendments.d.ts +4 -0
  409. package/lib/src/types/amendments.js +2 -0
  410. package/lib/src/types/amm.d.ts +98 -0
  411. package/lib/src/types/amm.js +68 -0
  412. package/lib/src/types/amounts.d.ts +20 -0
  413. package/lib/src/types/amounts.js +2 -0
  414. package/lib/src/types/batch.d.ts +21 -0
  415. package/lib/src/types/batch.js +26 -0
  416. package/lib/src/types/checks.d.ts +17 -0
  417. package/lib/src/types/checks.js +2 -0
  418. package/lib/src/types/clawback.d.ts +5 -0
  419. package/lib/src/types/clawback.js +2 -0
  420. package/lib/src/types/credentials.d.ts +30 -0
  421. package/lib/src/types/credentials.js +10 -0
  422. package/lib/src/types/cron.d.ts +17 -0
  423. package/lib/src/types/cron.js +6 -0
  424. package/lib/src/types/delegate.d.ts +5 -0
  425. package/lib/src/types/delegate.js +2 -0
  426. package/lib/src/types/deposits.d.ts +11 -0
  427. package/lib/src/types/deposits.js +2 -0
  428. package/lib/src/types/did.d.ts +7 -0
  429. package/lib/src/types/did.js +2 -0
  430. package/lib/src/types/emit_details.d.ts +7 -0
  431. package/lib/src/types/emit_details.js +2 -0
  432. package/lib/src/types/escrows.d.ts +18 -0
  433. package/lib/src/types/escrows.js +2 -0
  434. package/lib/src/types/fees.d.ts +9 -0
  435. package/lib/src/types/fees.js +2 -0
  436. package/lib/src/types/gateway_balances.d.ts +11 -0
  437. package/lib/src/types/gateway_balances.js +2 -0
  438. package/lib/src/types/genesis_mint.d.ts +9 -0
  439. package/lib/src/types/genesis_mint.js +2 -0
  440. package/lib/src/types/global.d.ts +14 -0
  441. package/lib/src/types/global.js +26 -0
  442. package/lib/src/types/hooks.d.ts +14 -0
  443. package/lib/src/types/hooks.js +2 -0
  444. package/lib/src/types/import.d.ts +21 -0
  445. package/lib/src/types/import.js +2 -0
  446. package/lib/src/types/index.d.ts +31 -0
  447. package/lib/src/types/index.js +47 -0
  448. package/lib/src/types/invoke.d.ts +5 -0
  449. package/lib/src/types/invoke.js +2 -0
  450. package/lib/src/types/ledger.d.ts +46 -0
  451. package/lib/src/types/ledger.js +2 -0
  452. package/lib/src/types/ledger_data.d.ts +10 -0
  453. package/lib/src/types/ledger_data.js +2 -0
  454. package/lib/src/types/ledger_entries.d.ts +163 -0
  455. package/lib/src/types/ledger_entries.js +2 -0
  456. package/lib/src/types/memos.d.ts +12 -0
  457. package/lib/src/types/memos.js +2 -0
  458. package/lib/src/types/mptokens.d.ts +84 -0
  459. package/lib/src/types/mptokens.js +76 -0
  460. package/lib/src/types/nftokens.d.ts +62 -0
  461. package/lib/src/types/nftokens.js +44 -0
  462. package/lib/src/types/offers.d.ts +46 -0
  463. package/lib/src/types/offers.js +33 -0
  464. package/lib/src/types/oracle.d.ts +19 -0
  465. package/lib/src/types/oracle.js +2 -0
  466. package/lib/src/types/outcome.d.ts +22 -0
  467. package/lib/src/types/outcome.js +2 -0
  468. package/lib/src/types/payment_channels.d.ts +23 -0
  469. package/lib/src/types/payment_channels.js +2 -0
  470. package/lib/src/types/payments.d.ts +24 -0
  471. package/lib/src/types/payments.js +25 -0
  472. package/lib/src/types/queue_data.d.ts +15 -0
  473. package/lib/src/types/queue_data.js +2 -0
  474. package/lib/src/types/remarks.d.ts +24 -0
  475. package/lib/src/types/remarks.js +6 -0
  476. package/lib/src/types/remits.d.ts +15 -0
  477. package/lib/src/types/remits.js +2 -0
  478. package/lib/src/types/settings.d.ts +27 -0
  479. package/lib/src/types/settings.js +2 -0
  480. package/lib/src/types/signers.d.ts +22 -0
  481. package/lib/src/types/signers.js +2 -0
  482. package/lib/src/types/specification.d.ts +14 -0
  483. package/lib/src/types/specification.js +2 -0
  484. package/lib/src/types/tickets.d.ts +4 -0
  485. package/lib/src/types/tickets.js +2 -0
  486. package/lib/src/types/trustlines.d.ts +85 -0
  487. package/lib/src/types/trustlines.js +43 -0
  488. package/lib/src/types/unl_modify.d.ts +6 -0
  489. package/lib/src/types/unl_modify.js +2 -0
  490. package/lib/src/types/unl_reports.d.ts +5 -0
  491. package/lib/src/types/unl_reports.js +2 -0
  492. package/lib/src/types/unrecognized.d.ts +5 -0
  493. package/lib/src/types/unrecognized.js +2 -0
  494. package/lib/src/types/uri_tokens.d.ts +7 -0
  495. package/lib/src/types/uri_tokens.js +6 -0
  496. package/lib/src/types/uritokens.d.ts +41 -0
  497. package/lib/src/types/uritokens.js +22 -0
  498. package/lib/src/v1/transaction/payment.d.ts +14 -0
  499. package/lib/src/v1/transaction/payment.js +142 -0
  500. package/lib/src/v1/types.d.ts +9 -0
  501. package/lib/src/v1/types.js +2 -0
  502. package/lib/src/v1/utils.d.ts +7 -0
  503. package/lib/src/v1/utils.js +49 -0
  504. package/lib/src/validator.d.ts +11 -0
  505. package/lib/src/validator.js +130 -0
  506. package/lib/src/wallet.d.ts +34 -0
  507. package/lib/src/wallet.js +284 -0
  508. package/package.json +19 -19
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parserTypeFunc = void 0;
7
+ exports.parseTransactionType = parseTransactionType;
8
+ exports.parseTransaction = parseTransaction;
9
+ const common_1 = require("../common");
10
+ const account_1 = require("./ledger/account");
11
+ const outcome_1 = require("./outcome");
12
+ const unrecognized_1 = __importDefault(require("./specification/unrecognized"));
13
+ const settings_1 = __importDefault(require("./specification/settings"));
14
+ const account_delete_1 = __importDefault(require("./specification/account-delete"));
15
+ const check_cancel_1 = __importDefault(require("./specification/check-cancel"));
16
+ const check_cash_1 = __importDefault(require("./specification/check-cash"));
17
+ const check_create_1 = __importDefault(require("./specification/check-create"));
18
+ const deposit_preauth_1 = __importDefault(require("./specification/deposit-preauth"));
19
+ const escrow_cancel_1 = __importDefault(require("./specification/escrow-cancel"));
20
+ const escrow_create_1 = __importDefault(require("./specification/escrow-create"));
21
+ const escrow_finish_1 = __importDefault(require("./specification/escrow-finish"));
22
+ const offer_cancel_1 = __importDefault(require("./specification/offer-cancel"));
23
+ const offer_create_1 = __importDefault(require("./specification/offer-create"));
24
+ const payment_1 = __importDefault(require("./specification/payment"));
25
+ const payment_channel_claim_1 = __importDefault(require("./specification/payment-channel-claim"));
26
+ const payment_channel_create_1 = __importDefault(require("./specification/payment-channel-create"));
27
+ const payment_channel_fund_1 = __importDefault(require("./specification/payment-channel-fund"));
28
+ const ticket_create_1 = __importDefault(require("./specification/ticket-create"));
29
+ const trust_set_1 = __importDefault(require("./specification/trust-set"));
30
+ const nftoken_burn_1 = __importDefault(require("./specification/nftoken-burn"));
31
+ const nftoken_mint_1 = __importDefault(require("./specification/nftoken-mint"));
32
+ const nftoken_modify_1 = __importDefault(require("./specification/nftoken-modify"));
33
+ const nftoken_cancel_offer_1 = __importDefault(require("./specification/nftoken-cancel-offer"));
34
+ const nftoken_create_offer_1 = __importDefault(require("./specification/nftoken-create-offer"));
35
+ const nftoken_accept_offer_1 = __importDefault(require("./specification/nftoken-accept-offer"));
36
+ const uritoken_burn_1 = __importDefault(require("./specification/uritoken-burn"));
37
+ const uritoken_buy_1 = __importDefault(require("./specification/uritoken-buy"));
38
+ const uritoken_cancel_sell_offer_1 = __importDefault(require("./specification/uritoken-cancel-sell-offer"));
39
+ const uritoken_create_sell_offer_1 = __importDefault(require("./specification/uritoken-create-sell-offer"));
40
+ const uritoken_mint_1 = __importDefault(require("./specification/uritoken-mint"));
41
+ const import_1 = __importDefault(require("./specification/import"));
42
+ const invoke_1 = __importDefault(require("./specification/invoke"));
43
+ const unl_report_1 = __importDefault(require("./specification/unl-report"));
44
+ const remit_1 = __importDefault(require("./specification/remit"));
45
+ const clawback_1 = __importDefault(require("./specification/clawback"));
46
+ const amm_bid_1 = __importDefault(require("./specification/amm-bid"));
47
+ const amm_create_1 = __importDefault(require("./specification/amm-create"));
48
+ const amm_delete_1 = __importDefault(require("./specification/amm-delete"));
49
+ const amm_deposit_1 = __importDefault(require("./specification/amm-deposit"));
50
+ const amm_withdraw_1 = __importDefault(require("./specification/amm-withdraw"));
51
+ const amm_vote_1 = __importDefault(require("./specification/amm-vote"));
52
+ const amm_clawback_1 = __importDefault(require("./specification/amm-clawback"));
53
+ const did_set_1 = __importDefault(require("./specification/did-set"));
54
+ const did_delete_1 = __importDefault(require("./specification/did-delete"));
55
+ const oracle_set_1 = __importDefault(require("./specification/oracle-set"));
56
+ const oracle_delete_1 = __importDefault(require("./specification/oracle-delete"));
57
+ const mptoken_issuance_create_1 = __importDefault(require("./specification/mptoken-issuance-create"));
58
+ const mptoken_authorize_1 = __importDefault(require("./specification/mptoken-authorize"));
59
+ const mptoken_issuance_set_1 = __importDefault(require("./specification/mptoken-issuance-set"));
60
+ const mptoken_issuance_destroy_1 = __importDefault(require("./specification/mptoken-issuance-destroy"));
61
+ const delegate_set_1 = __importDefault(require("./specification/delegate-set"));
62
+ const set_remarks_1 = __importDefault(require("./specification/set-remarks"));
63
+ const credential_create_1 = __importDefault(require("./specification/credential-create"));
64
+ const credential_accept_1 = __importDefault(require("./specification/credential-accept"));
65
+ const credential_delete_1 = __importDefault(require("./specification/credential-delete"));
66
+ const permissioned_domain_set_1 = __importDefault(require("./specification/permissioned-domain-set"));
67
+ const genesis_mint_1 = __importDefault(require("./specification/genesis-mint"));
68
+ const batch_1 = __importDefault(require("./specification/batch"));
69
+ const cron_1 = __importDefault(require("./specification/cron"));
70
+ const cron_set_1 = __importDefault(require("./specification/cron-set"));
71
+ const amendment_1 = __importDefault(require("./specification/amendment"));
72
+ const fee_update_1 = __importDefault(require("./specification/fee-update"));
73
+ const unl_modify_1 = __importDefault(require("./specification/unl-modify"));
74
+ const transactionTypeToType = {
75
+ AccountSet: "settings",
76
+ AccountDelete: "accountDelete",
77
+ CheckCancel: "checkCancel",
78
+ CheckCash: "checkCash",
79
+ CheckCreate: "checkCreate",
80
+ DepositPreauth: "depositPreauth",
81
+ EscrowCancel: "escrowCancellation",
82
+ EscrowCreate: "escrowCreation",
83
+ EscrowFinish: "escrowExecution",
84
+ OfferCancel: "orderCancellation",
85
+ OfferCreate: "order",
86
+ Payment: "payment",
87
+ PaymentChannelClaim: "paymentChannelClaim",
88
+ PaymentChannelCreate: "paymentChannelCreate",
89
+ PaymentChannelFund: "paymentChannelFund",
90
+ SetRegularKey: "settings",
91
+ SignerListSet: "settings",
92
+ TicketCreate: "ticketCreate",
93
+ TrustSet: "trustline",
94
+ NFTokenBurn: "nftokenBurn",
95
+ NFTokenMint: "nftokenMint",
96
+ NFTokenModify: "NFTokenModify",
97
+ NFTokenCancelOffer: "nftokenCancelOffer",
98
+ NFTokenCreateOffer: "nftokenCreateOffer",
99
+ NFTokenAcceptOffer: "nftokenAcceptOffer",
100
+ URITokenMint: "uritokenMint",
101
+ URITokenBurn: "uritokenBurn",
102
+ URITokenCreateSellOffer: "uritokenCreateSellOffer",
103
+ URITokenCancelSellOffer: "uritokenCancelSellOffer",
104
+ URITokenBuy: "uritokenBuy",
105
+ Import: "import",
106
+ Invoke: "invoke",
107
+ UNLReport: "unlReport",
108
+ Remit: "remit",
109
+ Clawback: "clawback",
110
+ AMMBid: "ammBid",
111
+ AMMCreate: "ammCreate",
112
+ AMMDelete: "ammDelete",
113
+ AMMDeposit: "ammDeposit",
114
+ AMMWithdraw: "ammWithdraw",
115
+ AMMVote: "ammVote",
116
+ AMMClawback: "AMMClawback",
117
+ DIDSet: "didSet",
118
+ DIDDelete: "didDelete",
119
+ OracleSet: "oracleSet",
120
+ OracleDelete: "oracleDelete",
121
+ MPTokenIssuanceCreate: "MPTokenIssuanceCreate",
122
+ MPTokenAuthorize: "MPTokenAuthorize",
123
+ MPTokenIssuanceSet: "MPTokenIssuanceSet",
124
+ MPTokenIssuanceDestroy: "MPTokenIssuanceDestroy",
125
+ CredentialCreate: "CredentialCreate",
126
+ CredentialAccept: "CredentialAccept",
127
+ CredentialDelete: "CredentialDelete",
128
+ PermissionedDomainSet: "PermissionedDomainSet",
129
+ DelegateSet: "DelegateSet",
130
+ SetRemarks: "SetRemarks",
131
+ GenesisMint: "genesisMint",
132
+ Batch: "Batch",
133
+ Cron: "Cron",
134
+ CronSet: "CronSet",
135
+ EnableAmendment: "amendment",
136
+ SetFee: "feeUpdate",
137
+ UNLModify: "UNLModify",
138
+ };
139
+ function parseTransactionType(type) {
140
+ return transactionTypeToType[type] || type;
141
+ }
142
+ exports.parserTypeFunc = {
143
+ settings: settings_1.default,
144
+ accountDelete: account_delete_1.default,
145
+ checkCancel: check_cancel_1.default,
146
+ checkCash: check_cash_1.default,
147
+ checkCreate: check_create_1.default,
148
+ depositPreauth: deposit_preauth_1.default,
149
+ escrowCancellation: escrow_cancel_1.default,
150
+ escrowCreation: escrow_create_1.default,
151
+ escrowExecution: escrow_finish_1.default,
152
+ orderCancellation: offer_cancel_1.default,
153
+ order: offer_create_1.default,
154
+ payment: payment_1.default,
155
+ paymentChannelClaim: payment_channel_claim_1.default,
156
+ paymentChannelCreate: payment_channel_create_1.default,
157
+ paymentChannelFund: payment_channel_fund_1.default,
158
+ ticketCreate: ticket_create_1.default,
159
+ trustline: trust_set_1.default,
160
+ nftokenBurn: nftoken_burn_1.default,
161
+ nftokenMint: nftoken_mint_1.default,
162
+ NFTokenModify: nftoken_modify_1.default,
163
+ nftokenCancelOffer: nftoken_cancel_offer_1.default,
164
+ nftokenCreateOffer: nftoken_create_offer_1.default,
165
+ nftokenAcceptOffer: nftoken_accept_offer_1.default,
166
+ uritokenBurn: uritoken_burn_1.default,
167
+ uritokenBuy: uritoken_buy_1.default,
168
+ uritokenCreateSellOffer: uritoken_create_sell_offer_1.default,
169
+ uritokenCancelSellOffer: uritoken_cancel_sell_offer_1.default,
170
+ uritokenMint: uritoken_mint_1.default,
171
+ import: import_1.default,
172
+ invoke: invoke_1.default,
173
+ unlReport: unl_report_1.default,
174
+ remit: remit_1.default,
175
+ clawback: clawback_1.default,
176
+ ammBid: amm_bid_1.default,
177
+ ammCreate: amm_create_1.default,
178
+ ammDelete: amm_delete_1.default,
179
+ ammDeposit: amm_deposit_1.default,
180
+ ammWithdraw: amm_withdraw_1.default,
181
+ ammVote: amm_vote_1.default,
182
+ AMMClawback: amm_clawback_1.default,
183
+ didSet: did_set_1.default,
184
+ didDelete: did_delete_1.default,
185
+ oracleSet: oracle_set_1.default,
186
+ oracleDelete: oracle_delete_1.default,
187
+ MPTokenIssuanceCreate: mptoken_issuance_create_1.default,
188
+ MPTokenAuthorize: mptoken_authorize_1.default,
189
+ MPTokenIssuanceSet: mptoken_issuance_set_1.default,
190
+ MPTokenIssuanceDestroy: mptoken_issuance_destroy_1.default,
191
+ CredentialCreate: credential_create_1.default,
192
+ CredentialAccept: credential_accept_1.default,
193
+ CredentialDelete: credential_delete_1.default,
194
+ PermissionedDomainSet: permissioned_domain_set_1.default,
195
+ DelegateSet: delegate_set_1.default,
196
+ SetRemarks: set_remarks_1.default,
197
+ genesisMint: genesis_mint_1.default,
198
+ Batch: batch_1.default,
199
+ Cron: cron_1.default,
200
+ CronSet: cron_set_1.default,
201
+ amendment: amendment_1.default,
202
+ feeUpdate: fee_update_1.default,
203
+ UNLModify: unl_modify_1.default,
204
+ };
205
+ function parseTransaction(tx, includeRawTransaction, nativeCurrency, definitions) {
206
+ let universalTx = tx;
207
+ if (universalTx.tx_json) {
208
+ universalTx = { ...universalTx, ...universalTx.tx_json };
209
+ }
210
+ const type = parseTransactionType(universalTx.TransactionType);
211
+ const parser = exports.parserTypeFunc[type];
212
+ const specification = parser ? parser(universalTx, nativeCurrency, definitions) : (0, unrecognized_1.default)(universalTx);
213
+ if (!parser && includeRawTransaction !== false) {
214
+ includeRawTransaction = true;
215
+ }
216
+ const outcome = (0, outcome_1.parseOutcome)(universalTx, nativeCurrency, definitions);
217
+ return (0, common_1.removeUndefined)({
218
+ type,
219
+ address: (0, account_1.parseAccount)(universalTx.Account),
220
+ sequence: universalTx.Sequence,
221
+ ticketSequence: universalTx.TicketSequence,
222
+ id: universalTx.hash,
223
+ ctid: universalTx.ctid,
224
+ specification: (0, common_1.removeUndefined)(specification),
225
+ outcome: outcome ? (0, common_1.removeUndefined)(outcome) : undefined,
226
+ rawTransaction: includeRawTransaction ? JSON.stringify(tx) : undefined,
227
+ });
228
+ }
@@ -0,0 +1,33 @@
1
+ import { Node, TransactionMetadata } from "xrpl";
2
+ import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "../types";
3
+ type NormalizedNode = {
4
+ diffType: string;
5
+ entryType: string;
6
+ ledgerIndex: string;
7
+ newFields: {
8
+ [field: string]: unknown;
9
+ };
10
+ finalFields: {
11
+ [field: string]: unknown;
12
+ };
13
+ previousFields: {
14
+ [field: string]: unknown;
15
+ };
16
+ PreviousTxnID?: string;
17
+ PreviousTxnLgrSeq?: number;
18
+ };
19
+ declare function adjustQualityForXRP(quality: string, takerGetsCurrency: string | null, takerPaysCurrency: string | null): string;
20
+ declare function parseQuality(quality?: number | null): number | undefined;
21
+ declare function parseTimestamp(rippleTime?: number | null): string | undefined;
22
+ declare function isPartialPayment(tx: any): boolean;
23
+ declare function removeGenericCounterparty(amount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount, address: string): FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
24
+ declare function normalizeNode(affectedNode: Node): NormalizedNode;
25
+ declare function normalizeNodes(metadata: TransactionMetadata): NormalizedNode[];
26
+ declare function hexToString(hex: string | undefined): string | undefined;
27
+ declare function decodeHexData(data?: string): string | undefined;
28
+ declare function stringToHex(value: string | undefined): string | undefined;
29
+ declare function bytesToHex(value: Uint8Array | ArrayBufferLike): string;
30
+ declare function hexToBytes(value: string): Uint8Array;
31
+ declare function parseUint32(buf: Buffer, cur: number): string;
32
+ declare function parseUint64(buf: Buffer, cur: number): string;
33
+ export { NormalizedNode, parseQuality, parseTimestamp, adjustQualityForXRP, isPartialPayment, removeGenericCounterparty, normalizeNodes, normalizeNode, hexToString, decodeHexData, stringToHex, bytesToHex, hexToBytes, parseUint32, parseUint64, };
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parseQuality = parseQuality;
7
+ exports.parseTimestamp = parseTimestamp;
8
+ exports.adjustQualityForXRP = adjustQualityForXRP;
9
+ exports.isPartialPayment = isPartialPayment;
10
+ exports.removeGenericCounterparty = removeGenericCounterparty;
11
+ exports.normalizeNodes = normalizeNodes;
12
+ exports.normalizeNode = normalizeNode;
13
+ exports.hexToString = hexToString;
14
+ exports.decodeHexData = decodeHexData;
15
+ exports.stringToHex = stringToHex;
16
+ exports.bytesToHex = bytesToHex;
17
+ exports.hexToBytes = hexToBytes;
18
+ exports.parseUint32 = parseUint32;
19
+ exports.parseUint64 = parseUint64;
20
+ const lodash_1 = __importDefault(require("lodash"));
21
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
22
+ const xrpl_1 = require("xrpl");
23
+ const models_1 = require("../models");
24
+ const client_1 = require("../client");
25
+ function adjustQualityForXRP(quality, takerGetsCurrency, takerPaysCurrency) {
26
+ const numeratorShift = takerPaysCurrency === (0, client_1.getNativeCurrency)() ? -6 : 0;
27
+ const denominatorShift = takerGetsCurrency === (0, client_1.getNativeCurrency)() ? -6 : 0;
28
+ const shift = numeratorShift - denominatorShift;
29
+ return shift === 0 ? new bignumber_js_1.default(quality).toString() : new bignumber_js_1.default(quality).shiftedBy(shift).toString();
30
+ }
31
+ function parseQuality(quality) {
32
+ if (typeof quality !== "number") {
33
+ return undefined;
34
+ }
35
+ return new bignumber_js_1.default(quality).shiftedBy(-9).toNumber();
36
+ }
37
+ function parseTimestamp(rippleTime) {
38
+ if (typeof rippleTime !== "number") {
39
+ return undefined;
40
+ }
41
+ return (0, models_1.ledgerTimeToISO8601)(rippleTime);
42
+ }
43
+ function isPartialPayment(tx) {
44
+ return (tx.Flags & xrpl_1.PaymentFlags.tfPartialPayment) !== 0;
45
+ }
46
+ function removeGenericCounterparty(amount, address) {
47
+ if ("counterparty" in amount) {
48
+ return amount.counterparty === address ? lodash_1.default.omit(amount, "counterparty") : amount;
49
+ }
50
+ if ("issuer" in amount) {
51
+ return amount.issuer === address ? lodash_1.default.omit(amount, "issuer") : amount;
52
+ }
53
+ return amount;
54
+ }
55
+ function normalizeNode(affectedNode) {
56
+ const diffType = Object.keys(affectedNode)[0];
57
+ const node = affectedNode[diffType];
58
+ return Object.assign({}, node, {
59
+ diffType,
60
+ entryType: node.LedgerEntryType,
61
+ ledgerIndex: node.LedgerIndex,
62
+ newFields: node.NewFields || {},
63
+ finalFields: node.FinalFields || {},
64
+ previousFields: node.PreviousFields || {},
65
+ });
66
+ }
67
+ function normalizeNodes(metadata) {
68
+ if (!metadata.AffectedNodes) {
69
+ return [];
70
+ }
71
+ return metadata.AffectedNodes.map(normalizeNode);
72
+ }
73
+ function hexToString(hex) {
74
+ return hex ? Buffer.from(hex, "hex").toString("utf-8") : undefined;
75
+ }
76
+ function decodeHexData(data) {
77
+ if (!data) {
78
+ return undefined;
79
+ }
80
+ const decoded = hexToString(data);
81
+ if (decoded && decoded.includes("�")) {
82
+ return data;
83
+ }
84
+ return decoded;
85
+ }
86
+ function stringToHex(value) {
87
+ return value ? Buffer.from(value, "utf8").toString("hex").toUpperCase() : undefined;
88
+ }
89
+ function bytesToHex(value) {
90
+ return Buffer.from(value)
91
+ .toString("hex")
92
+ .toUpperCase();
93
+ }
94
+ function hexToBytes(value) {
95
+ if (value.length % 2 !== 0) {
96
+ throw new Error("Invalid hex string length");
97
+ }
98
+ if (!/^[0-9a-fA-F]*$/.test(value)) {
99
+ throw new Error("Invalid hex string");
100
+ }
101
+ if (value.length === 0) {
102
+ return new Uint8Array(0);
103
+ }
104
+ return Uint8Array.from(Buffer.from(value, "hex"));
105
+ }
106
+ function parseUint32(buf, cur) {
107
+ return ((BigInt(buf[cur]) << 24n) + (BigInt(buf[cur + 1]) << 16n) + (BigInt(buf[cur + 2]) << 8n) + BigInt(buf[cur + 3]) + "");
108
+ }
109
+ function parseUint64(buf, cur) {
110
+ return ((BigInt(buf[cur]) << 56n) +
111
+ (BigInt(buf[cur + 1]) << 48n) +
112
+ (BigInt(buf[cur + 2]) << 40n) +
113
+ (BigInt(buf[cur + 3]) << 32n) +
114
+ (BigInt(buf[cur + 4]) << 24n) +
115
+ (BigInt(buf[cur + 5]) << 16n) +
116
+ (BigInt(buf[cur + 6]) << 8n) +
117
+ BigInt(buf[cur + 7]) +
118
+ "");
119
+ }
@@ -0,0 +1,26 @@
1
+ import { FormattedBaseSpecification } from "./specification";
2
+ import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
3
+ export type FormattedAccountDeleteSpecification = {
4
+ source?: FormattedSourceAddress;
5
+ destination?: FormattedDestinationAddress;
6
+ } & FormattedBaseSpecification;
7
+ export type FormattedSourceAddress = {
8
+ address: string;
9
+ maxAmount?: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
10
+ tag?: number;
11
+ };
12
+ export type FormattedDestinationAddress = {
13
+ address: string;
14
+ tag?: number;
15
+ };
16
+ export type FormattedSignerRegularKey = {
17
+ address: string;
18
+ };
19
+ export type FormattedAccountInfoData = {
20
+ sequence: number;
21
+ xrpBalance: string;
22
+ ownerCount: number;
23
+ previousInitiatedTransactionID?: string;
24
+ previousAffectingTransactionID: string;
25
+ previousAffectingTransactionLedgerVersion: number;
26
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount } from "./amounts";
2
+ export type Adjustment = {
3
+ address: string;
4
+ amount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount;
5
+ tag?: number;
6
+ };
7
+ export type MaxAdjustment = {
8
+ address: string;
9
+ maxAmount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount;
10
+ tag?: number;
11
+ };
12
+ export type MinAdjustment = {
13
+ address: string;
14
+ minAmount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount;
15
+ tag?: number;
16
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { FormattedBaseSpecification } from "./specification";
2
+ export type FormattedAmendmentSpecification = {
3
+ amendment: string;
4
+ } & FormattedBaseSpecification;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,98 @@
1
+ import { AMMDepositFlags, AMMWithdrawFlags, AMMClawbackFlags } from "xrpl";
2
+ import { FormattedBaseSpecification } from "./specification";
3
+ import { FormattedAmount, FormattedIssuedCurrency } from "./amounts";
4
+ import { TxGlobalFlagsKeysInterface } from "./global";
5
+ export interface VoteSlotInterface {
6
+ VoteEntry: {
7
+ Account: string;
8
+ TradingFee: number;
9
+ VoteWeight: number;
10
+ };
11
+ }
12
+ export declare const AMMDepositFlagsKeys: {
13
+ lpToken: AMMDepositFlags;
14
+ singleAsset: AMMDepositFlags;
15
+ twoAsset: AMMDepositFlags;
16
+ oneAssetLPToken: AMMDepositFlags;
17
+ limitLPToken: AMMDepositFlags;
18
+ twoAssetIfEmpty: AMMDepositFlags;
19
+ };
20
+ export declare function getAMMDepositFlagsKeys(nativeCurrency?: string): Record<string, number>;
21
+ export interface AMMDepositFlagsKeysInterface extends TxGlobalFlagsKeysInterface {
22
+ lpToken?: boolean;
23
+ singleAsset?: boolean;
24
+ twoAsset?: boolean;
25
+ oneAssetLPToken?: boolean;
26
+ limitLPToken?: boolean;
27
+ }
28
+ export declare const AMMWithdrawFlagsKeys: {
29
+ lpToken: AMMWithdrawFlags;
30
+ withdrawAll: AMMWithdrawFlags;
31
+ oneAssetWithdrawAll: AMMWithdrawFlags;
32
+ singleAsset: AMMWithdrawFlags;
33
+ twoAsset: AMMWithdrawFlags;
34
+ oneAssetLPToken: AMMWithdrawFlags;
35
+ limitLPToken: AMMWithdrawFlags;
36
+ };
37
+ export declare function getAMMWithdrawFlagsKeys(nativeCurrency?: string): Record<string, number>;
38
+ export interface AMMWithdrawFlagsKeysInterface extends TxGlobalFlagsKeysInterface {
39
+ lpToken?: boolean;
40
+ withdrawAll?: boolean;
41
+ oneAssetWithdrawAll?: boolean;
42
+ singleAsset?: boolean;
43
+ twoAsset?: boolean;
44
+ oneAssetLPToken?: boolean;
45
+ limitLPToken?: boolean;
46
+ }
47
+ export declare const AMMClawbackFlagsKeys: {
48
+ clawTwoAssets: AMMClawbackFlags;
49
+ };
50
+ export declare function getAMMClawbackFlagsKeys(nativeCurrency?: string): Record<string, number>;
51
+ export interface AMMClawbackFlagsKeysInterface extends TxGlobalFlagsKeysInterface {
52
+ clawTwoAssets?: boolean;
53
+ }
54
+ export type FormattedAmmBidSpecification = {
55
+ asset?: FormattedIssuedCurrency;
56
+ asset2?: FormattedIssuedCurrency;
57
+ bidMin?: FormattedAmount;
58
+ bidMax?: FormattedAmount;
59
+ authorizedAccounts?: string[];
60
+ } & FormattedBaseSpecification;
61
+ export type FormattedAmmCreateSpecification = {
62
+ amount: FormattedAmount;
63
+ amount2: FormattedAmount;
64
+ tradingFee: Number;
65
+ } & FormattedBaseSpecification;
66
+ export type FormattedAmmDeleteSpecification = {
67
+ asset?: FormattedIssuedCurrency;
68
+ asset2?: FormattedIssuedCurrency;
69
+ } & FormattedBaseSpecification;
70
+ export type FormattedAmmDepositSpecification = {
71
+ asset?: FormattedIssuedCurrency;
72
+ asset2?: FormattedIssuedCurrency;
73
+ amount?: FormattedAmount;
74
+ amount2?: FormattedAmount;
75
+ ePrice?: FormattedAmount;
76
+ lpTokenOut?: FormattedAmount;
77
+ flags?: AMMDepositFlagsKeysInterface;
78
+ } & FormattedBaseSpecification;
79
+ export type FormattedAmmWithdrawSpecification = {
80
+ asset?: FormattedIssuedCurrency;
81
+ asset2?: FormattedIssuedCurrency;
82
+ amount?: FormattedAmount;
83
+ amount2?: FormattedAmount;
84
+ ePrice?: FormattedAmount;
85
+ lpTokenIn?: FormattedAmount;
86
+ flags?: AMMWithdrawFlagsKeysInterface;
87
+ } & FormattedBaseSpecification;
88
+ export type FormattedAmmVoteSpecification = {
89
+ asset?: FormattedIssuedCurrency;
90
+ asset2?: FormattedIssuedCurrency;
91
+ tradingFee: Number;
92
+ } & FormattedBaseSpecification;
93
+ export type FormattedAmmClawbackSpecification = {
94
+ asset?: FormattedIssuedCurrency;
95
+ asset2?: FormattedIssuedCurrency;
96
+ amount?: FormattedAmount;
97
+ holder?: string;
98
+ } & FormattedBaseSpecification;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AMMClawbackFlagsKeys = exports.AMMWithdrawFlagsKeys = exports.AMMDepositFlagsKeys = void 0;
4
+ exports.getAMMDepositFlagsKeys = getAMMDepositFlagsKeys;
5
+ exports.getAMMWithdrawFlagsKeys = getAMMWithdrawFlagsKeys;
6
+ exports.getAMMClawbackFlagsKeys = getAMMClawbackFlagsKeys;
7
+ const xrpl_1 = require("xrpl");
8
+ const global_1 = require("./global");
9
+ const common_1 = require("../common");
10
+ exports.AMMDepositFlagsKeys = {
11
+ lpToken: xrpl_1.AMMDepositFlags.tfLPToken,
12
+ singleAsset: xrpl_1.AMMDepositFlags.tfSingleAsset,
13
+ twoAsset: xrpl_1.AMMDepositFlags.tfTwoAsset,
14
+ oneAssetLPToken: xrpl_1.AMMDepositFlags.tfOneAssetLPToken,
15
+ limitLPToken: xrpl_1.AMMDepositFlags.tfLimitLPToken,
16
+ twoAssetIfEmpty: xrpl_1.AMMDepositFlags.tfTwoAssetIfEmpty,
17
+ };
18
+ const nativeCurrencyAMMDepositFlags = {};
19
+ function getAMMDepositFlagsKeys(nativeCurrency) {
20
+ if (!nativeCurrency) {
21
+ nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
22
+ }
23
+ if (!nativeCurrencyAMMDepositFlags[nativeCurrency]) {
24
+ nativeCurrencyAMMDepositFlags[nativeCurrency] = {
25
+ ...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
26
+ ...exports.AMMDepositFlagsKeys,
27
+ };
28
+ }
29
+ return nativeCurrencyAMMDepositFlags[nativeCurrency];
30
+ }
31
+ exports.AMMWithdrawFlagsKeys = {
32
+ lpToken: xrpl_1.AMMWithdrawFlags.tfLPToken,
33
+ withdrawAll: xrpl_1.AMMWithdrawFlags.tfWithdrawAll,
34
+ oneAssetWithdrawAll: xrpl_1.AMMWithdrawFlags.tfOneAssetWithdrawAll,
35
+ singleAsset: xrpl_1.AMMWithdrawFlags.tfSingleAsset,
36
+ twoAsset: xrpl_1.AMMWithdrawFlags.tfTwoAsset,
37
+ oneAssetLPToken: xrpl_1.AMMWithdrawFlags.tfOneAssetLPToken,
38
+ limitLPToken: xrpl_1.AMMWithdrawFlags.tfLimitLPToken,
39
+ };
40
+ const nativeCurrencyAMMWithdrawFlags = {};
41
+ function getAMMWithdrawFlagsKeys(nativeCurrency) {
42
+ if (!nativeCurrency) {
43
+ nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
44
+ }
45
+ if (!nativeCurrencyAMMWithdrawFlags[nativeCurrency]) {
46
+ nativeCurrencyAMMWithdrawFlags[nativeCurrency] = {
47
+ ...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
48
+ ...exports.AMMWithdrawFlagsKeys,
49
+ };
50
+ }
51
+ return nativeCurrencyAMMWithdrawFlags[nativeCurrency];
52
+ }
53
+ exports.AMMClawbackFlagsKeys = {
54
+ clawTwoAssets: xrpl_1.AMMClawbackFlags.tfClawTwoAssets,
55
+ };
56
+ const nativeCurrencyAMMClawbackFlags = {};
57
+ function getAMMClawbackFlagsKeys(nativeCurrency) {
58
+ if (!nativeCurrency) {
59
+ nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
60
+ }
61
+ if (!nativeCurrencyAMMClawbackFlags[nativeCurrency]) {
62
+ nativeCurrencyAMMClawbackFlags[nativeCurrency] = {
63
+ ...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
64
+ ...exports.AMMClawbackFlagsKeys,
65
+ };
66
+ }
67
+ return nativeCurrencyAMMClawbackFlags[nativeCurrency];
68
+ }
@@ -0,0 +1,20 @@
1
+ export interface IssuedCurrency {
2
+ currency: string;
3
+ issuer?: string;
4
+ }
5
+ export interface FormattedIssuedCurrency {
6
+ currency: string;
7
+ counterparty?: string;
8
+ }
9
+ export interface IssuedCurrencyAmount extends IssuedCurrency {
10
+ value: string;
11
+ }
12
+ export interface FormattedIssuedCurrencyAmount extends FormattedIssuedCurrency {
13
+ value: string;
14
+ }
15
+ export interface FormattedIssuedMPTAmount {
16
+ mpt_issuance_id?: string;
17
+ value: string;
18
+ }
19
+ export type Amount = IssuedCurrencyAmount | FormattedIssuedMPTAmount | string;
20
+ export type FormattedAmount = IssuedCurrency | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount | string;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ import { BatchFlags } from "xrpl/dist/npm/models/transactions/batch";
2
+ import { FormattedBaseSpecification } from "./specification";
3
+ import { FormattedTransaction } from "../parse/transaction";
4
+ import { TxGlobalFlagsKeysInterface } from "./global";
5
+ export declare const BatchFlagsKeys: {
6
+ allOrNothing: BatchFlags;
7
+ onlyOne: BatchFlags;
8
+ untilFailure: BatchFlags;
9
+ independent: BatchFlags;
10
+ };
11
+ export declare function getBatchFlagsKeys(nativeCurrency?: string): Record<string, number>;
12
+ export interface BatchFlagsKeysInterface extends TxGlobalFlagsKeysInterface {
13
+ allOrNothing?: boolean;
14
+ onlyOne?: boolean;
15
+ untilFailure?: boolean;
16
+ independent?: boolean;
17
+ }
18
+ export type FormattedBatchSpecification = {
19
+ transactions: FormattedTransaction[];
20
+ flags?: BatchFlagsKeysInterface;
21
+ } & FormattedBaseSpecification;