riplle-lib 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (599) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +149 -0
  3. package/a4lpwwp5.cjs +1 -0
  4. package/build/ripple-latest-min.js +2 -0
  5. package/build/ripple-latest.js +5181 -0
  6. package/dist/npm/api.d.ts +272 -0
  7. package/dist/npm/api.d.ts.map +1 -0
  8. package/dist/npm/api.js +276 -0
  9. package/dist/npm/api.js.map +1 -0
  10. package/dist/npm/broadcast.d.ts +10 -0
  11. package/dist/npm/broadcast.d.ts.map +1 -0
  12. package/dist/npm/broadcast.js +67 -0
  13. package/dist/npm/broadcast.js.map +1 -0
  14. package/dist/npm/common/backoff.d.ts +14 -0
  15. package/dist/npm/common/backoff.d.ts.map +1 -0
  16. package/dist/npm/common/backoff.js +26 -0
  17. package/dist/npm/common/backoff.js.map +1 -0
  18. package/dist/npm/common/browser-hacks.d.ts +4 -0
  19. package/dist/npm/common/browser-hacks.d.ts.map +1 -0
  20. package/dist/npm/common/browser-hacks.js +21 -0
  21. package/dist/npm/common/browser-hacks.js.map +1 -0
  22. package/dist/npm/common/connection.d.ts +50 -0
  23. package/dist/npm/common/connection.d.ts.map +1 -0
  24. package/dist/npm/common/connection.js +467 -0
  25. package/dist/npm/common/connection.js.map +1 -0
  26. package/dist/npm/common/constants.d.ts +62 -0
  27. package/dist/npm/common/constants.d.ts.map +1 -0
  28. package/dist/npm/common/constants.js +54 -0
  29. package/dist/npm/common/constants.js.map +1 -0
  30. package/dist/npm/common/errors.d.ts +41 -0
  31. package/dist/npm/common/errors.d.ts.map +1 -0
  32. package/dist/npm/common/errors.js +101 -0
  33. package/dist/npm/common/errors.js.map +1 -0
  34. package/dist/npm/common/hashes/hash-prefix.d.ts +12 -0
  35. package/dist/npm/common/hashes/hash-prefix.d.ts.map +1 -0
  36. package/dist/npm/common/hashes/hash-prefix.js +15 -0
  37. package/dist/npm/common/hashes/hash-prefix.js.map +1 -0
  38. package/dist/npm/common/hashes/index.d.ts +13 -0
  39. package/dist/npm/common/hashes/index.d.ts.map +1 -0
  40. package/dist/npm/common/hashes/index.js +129 -0
  41. package/dist/npm/common/hashes/index.js.map +1 -0
  42. package/dist/npm/common/hashes/ledgerspaces.d.ts +21 -0
  43. package/dist/npm/common/hashes/ledgerspaces.d.ts.map +1 -0
  44. package/dist/npm/common/hashes/ledgerspaces.js +22 -0
  45. package/dist/npm/common/hashes/ledgerspaces.js.map +1 -0
  46. package/dist/npm/common/hashes/sha512Half.d.ts +3 -0
  47. package/dist/npm/common/hashes/sha512Half.d.ts.map +1 -0
  48. package/dist/npm/common/hashes/sha512Half.js +12 -0
  49. package/dist/npm/common/hashes/sha512Half.js.map +1 -0
  50. package/dist/npm/common/hashes/shamap.d.ts +38 -0
  51. package/dist/npm/common/hashes/shamap.d.ts.map +1 -0
  52. package/dist/npm/common/hashes/shamap.js +121 -0
  53. package/dist/npm/common/hashes/shamap.js.map +1 -0
  54. package/dist/npm/common/index.d.ts +10 -0
  55. package/dist/npm/common/index.d.ts.map +1 -0
  56. package/dist/npm/common/index.js +57 -0
  57. package/dist/npm/common/index.js.map +1 -0
  58. package/dist/npm/common/rangeset.d.ts +13 -0
  59. package/dist/npm/common/rangeset.d.ts.map +1 -0
  60. package/dist/npm/common/rangeset.js +72 -0
  61. package/dist/npm/common/rangeset.js.map +1 -0
  62. package/dist/npm/common/schema-validator.d.ts +5 -0
  63. package/dist/npm/common/schema-validator.d.ts.map +1 -0
  64. package/dist/npm/common/schema-validator.js +190 -0
  65. package/dist/npm/common/schema-validator.js.map +1 -0
  66. package/dist/npm/common/schemas/input/api-options.json +69 -0
  67. package/dist/npm/common/schemas/input/combine.json +19 -0
  68. package/dist/npm/common/schemas/input/compute-ledger-hash.json +13 -0
  69. package/dist/npm/common/schemas/input/generate-address.json +37 -0
  70. package/dist/npm/common/schemas/input/generate-x-address.json +37 -0
  71. package/dist/npm/common/schemas/input/get-account-info.json +24 -0
  72. package/dist/npm/common/schemas/input/get-account-objects.json +56 -0
  73. package/dist/npm/common/schemas/input/get-balance-sheet.json +30 -0
  74. package/dist/npm/common/schemas/input/get-balances.json +37 -0
  75. package/dist/npm/common/schemas/input/get-fee.json +13 -0
  76. package/dist/npm/common/schemas/input/get-ledger.json +35 -0
  77. package/dist/npm/common/schemas/input/get-orderbook.json +33 -0
  78. package/dist/npm/common/schemas/input/get-orders.json +29 -0
  79. package/dist/npm/common/schemas/input/get-paths.json +69 -0
  80. package/dist/npm/common/schemas/input/get-payment-channel.json +14 -0
  81. package/dist/npm/common/schemas/input/get-settings.json +24 -0
  82. package/dist/npm/common/schemas/input/get-transaction.json +28 -0
  83. package/dist/npm/common/schemas/input/get-transactions.json +71 -0
  84. package/dist/npm/common/schemas/input/get-trustlines.json +37 -0
  85. package/dist/npm/common/schemas/input/prepare-check-cancel.json +18 -0
  86. package/dist/npm/common/schemas/input/prepare-check-cash.json +18 -0
  87. package/dist/npm/common/schemas/input/prepare-check-create.json +18 -0
  88. package/dist/npm/common/schemas/input/prepare-escrow-cancellation.json +18 -0
  89. package/dist/npm/common/schemas/input/prepare-escrow-creation.json +18 -0
  90. package/dist/npm/common/schemas/input/prepare-escrow-execution.json +18 -0
  91. package/dist/npm/common/schemas/input/prepare-order-cancellation.json +18 -0
  92. package/dist/npm/common/schemas/input/prepare-order.json +18 -0
  93. package/dist/npm/common/schemas/input/prepare-payment-channel-claim.json +18 -0
  94. package/dist/npm/common/schemas/input/prepare-payment-channel-create.json +18 -0
  95. package/dist/npm/common/schemas/input/prepare-payment-channel-fund.json +18 -0
  96. package/dist/npm/common/schemas/input/prepare-payment.json +18 -0
  97. package/dist/npm/common/schemas/input/prepare-settings.json +18 -0
  98. package/dist/npm/common/schemas/input/prepare-ticket-create.json +18 -0
  99. package/dist/npm/common/schemas/input/prepare-trustline.json +18 -0
  100. package/dist/npm/common/schemas/input/sign-payment-channel-claim.json +21 -0
  101. package/dist/npm/common/schemas/input/sign.json +55 -0
  102. package/dist/npm/common/schemas/input/submit.json +17 -0
  103. package/dist/npm/common/schemas/input/verify-payment-channel-claim.json +25 -0
  104. package/dist/npm/common/schemas/objects/address.json +12 -0
  105. package/dist/npm/common/schemas/objects/adjustment.json +12 -0
  106. package/dist/npm/common/schemas/objects/amount.json +10 -0
  107. package/dist/npm/common/schemas/objects/amountbase.json +44 -0
  108. package/dist/npm/common/schemas/objects/balance.json +45 -0
  109. package/dist/npm/common/schemas/objects/blob.json +8 -0
  110. package/dist/npm/common/schemas/objects/classic-address.json +9 -0
  111. package/dist/npm/common/schemas/objects/currency.json +8 -0
  112. package/dist/npm/common/schemas/objects/destination-address-tag.json +15 -0
  113. package/dist/npm/common/schemas/objects/destination-adjustment.json +9 -0
  114. package/dist/npm/common/schemas/objects/destination-exact-adjustment.json +18 -0
  115. package/dist/npm/common/schemas/objects/hash128.json +7 -0
  116. package/dist/npm/common/schemas/objects/hash256.json +7 -0
  117. package/dist/npm/common/schemas/objects/instructions.json +59 -0
  118. package/dist/npm/common/schemas/objects/issue.json +9 -0
  119. package/dist/npm/common/schemas/objects/lax-amount.json +14 -0
  120. package/dist/npm/common/schemas/objects/lax-lax-amount.json +14 -0
  121. package/dist/npm/common/schemas/objects/ledger-version.json +15 -0
  122. package/dist/npm/common/schemas/objects/max-adjustment.json +18 -0
  123. package/dist/npm/common/schemas/objects/memo.json +25 -0
  124. package/dist/npm/common/schemas/objects/memos.json +10 -0
  125. package/dist/npm/common/schemas/objects/min-adjustment.json +18 -0
  126. package/dist/npm/common/schemas/objects/orderbook.json +11 -0
  127. package/dist/npm/common/schemas/objects/private-key.json +7 -0
  128. package/dist/npm/common/schemas/objects/public-key.json +7 -0
  129. package/dist/npm/common/schemas/objects/quality.json +8 -0
  130. package/dist/npm/common/schemas/objects/sequence.json +8 -0
  131. package/dist/npm/common/schemas/objects/settings-plus-memos.json +120 -0
  132. package/dist/npm/common/schemas/objects/signature.json +7 -0
  133. package/dist/npm/common/schemas/objects/signed-value.json +8 -0
  134. package/dist/npm/common/schemas/objects/source-adjustment.json +9 -0
  135. package/dist/npm/common/schemas/objects/source-exact-adjustment.json +18 -0
  136. package/dist/npm/common/schemas/objects/tag.json +7 -0
  137. package/dist/npm/common/schemas/objects/ticket-sequence.json +8 -0
  138. package/dist/npm/common/schemas/objects/transaction-hash.json +8 -0
  139. package/dist/npm/common/schemas/objects/transaction-type.json +25 -0
  140. package/dist/npm/common/schemas/objects/tx-json.json +12 -0
  141. package/dist/npm/common/schemas/objects/uint32.json +8 -0
  142. package/dist/npm/common/schemas/objects/value.json +8 -0
  143. package/dist/npm/common/schemas/objects/x-address.json +9 -0
  144. package/dist/npm/common/schemas/output/generate-address.json +26 -0
  145. package/dist/npm/common/schemas/output/generate-x-address.json +18 -0
  146. package/dist/npm/common/schemas/output/get-account-info.json +40 -0
  147. package/dist/npm/common/schemas/output/get-account-objects.json +48 -0
  148. package/dist/npm/common/schemas/output/get-balance-sheet.json +33 -0
  149. package/dist/npm/common/schemas/output/get-balances.json +6 -0
  150. package/dist/npm/common/schemas/output/get-ledger.json +90 -0
  151. package/dist/npm/common/schemas/output/get-orderbook.json +17 -0
  152. package/dist/npm/common/schemas/output/get-orders.json +36 -0
  153. package/dist/npm/common/schemas/output/get-paths.json +24 -0
  154. package/dist/npm/common/schemas/output/get-payment-channel.json +67 -0
  155. package/dist/npm/common/schemas/output/get-server-info.json +117 -0
  156. package/dist/npm/common/schemas/output/get-settings.json +8 -0
  157. package/dist/npm/common/schemas/output/get-transaction.json +237 -0
  158. package/dist/npm/common/schemas/output/get-transactions.json +8 -0
  159. package/dist/npm/common/schemas/output/get-trustlines.json +49 -0
  160. package/dist/npm/common/schemas/output/ledger-event.json +46 -0
  161. package/dist/npm/common/schemas/output/order-change.json +40 -0
  162. package/dist/npm/common/schemas/output/orderbook-orders.json +58 -0
  163. package/dist/npm/common/schemas/output/outcome.json +57 -0
  164. package/dist/npm/common/schemas/output/prepare.json +47 -0
  165. package/dist/npm/common/schemas/output/sign-payment-channel-claim.json +7 -0
  166. package/dist/npm/common/schemas/output/sign.json +18 -0
  167. package/dist/npm/common/schemas/output/submit.json +37 -0
  168. package/dist/npm/common/schemas/output/verify-payment-channel-claim.json +6 -0
  169. package/dist/npm/common/schemas/specifications/account-delete.json +30 -0
  170. package/dist/npm/common/schemas/specifications/check-cancel.json +15 -0
  171. package/dist/npm/common/schemas/specifications/check-cash.json +27 -0
  172. package/dist/npm/common/schemas/specifications/check-create.json +32 -0
  173. package/dist/npm/common/schemas/specifications/deposit-preauth.json +22 -0
  174. package/dist/npm/common/schemas/specifications/escrow-cancellation.json +19 -0
  175. package/dist/npm/common/schemas/specifications/escrow-creation.json +42 -0
  176. package/dist/npm/common/schemas/specifications/escrow-execution.json +29 -0
  177. package/dist/npm/common/schemas/specifications/get-payment.json +39 -0
  178. package/dist/npm/common/schemas/specifications/order-cancellation.json +15 -0
  179. package/dist/npm/common/schemas/specifications/order.json +49 -0
  180. package/dist/npm/common/schemas/specifications/payment-channel-claim.json +39 -0
  181. package/dist/npm/common/schemas/specifications/payment-channel-create.json +40 -0
  182. package/dist/npm/common/schemas/specifications/payment-channel-fund.json +24 -0
  183. package/dist/npm/common/schemas/specifications/payment.json +39 -0
  184. package/dist/npm/common/schemas/specifications/settings.json +20 -0
  185. package/dist/npm/common/schemas/specifications/trustline.json +43 -0
  186. package/dist/npm/common/serverinfo.d.ts +34 -0
  187. package/dist/npm/common/serverinfo.d.ts.map +1 -0
  188. package/dist/npm/common/serverinfo.js +63 -0
  189. package/dist/npm/common/serverinfo.js.map +1 -0
  190. package/dist/npm/common/txflags.d.ts +51 -0
  191. package/dist/npm/common/txflags.d.ts.map +1 -0
  192. package/dist/npm/common/txflags.js +55 -0
  193. package/dist/npm/common/txflags.js.map +1 -0
  194. package/dist/npm/common/types/commands/account_info.d.ts +18 -0
  195. package/dist/npm/common/types/commands/account_info.d.ts.map +1 -0
  196. package/dist/npm/common/types/commands/account_info.js +3 -0
  197. package/dist/npm/common/types/commands/account_info.js.map +1 -0
  198. package/dist/npm/common/types/commands/account_lines.d.ts +18 -0
  199. package/dist/npm/common/types/commands/account_lines.d.ts.map +1 -0
  200. package/dist/npm/common/types/commands/account_lines.js +3 -0
  201. package/dist/npm/common/types/commands/account_lines.js.map +1 -0
  202. package/dist/npm/common/types/commands/account_objects.d.ts +27 -0
  203. package/dist/npm/common/types/commands/account_objects.d.ts.map +1 -0
  204. package/dist/npm/common/types/commands/account_objects.js +3 -0
  205. package/dist/npm/common/types/commands/account_objects.js.map +1 -0
  206. package/dist/npm/common/types/commands/account_offers.d.ts +25 -0
  207. package/dist/npm/common/types/commands/account_offers.d.ts.map +1 -0
  208. package/dist/npm/common/types/commands/account_offers.js +3 -0
  209. package/dist/npm/common/types/commands/account_offers.js.map +1 -0
  210. package/dist/npm/common/types/commands/book_offers.d.ts +24 -0
  211. package/dist/npm/common/types/commands/book_offers.d.ts.map +1 -0
  212. package/dist/npm/common/types/commands/book_offers.js +3 -0
  213. package/dist/npm/common/types/commands/book_offers.js.map +1 -0
  214. package/dist/npm/common/types/commands/gateway_balances.d.ts +24 -0
  215. package/dist/npm/common/types/commands/gateway_balances.d.ts.map +1 -0
  216. package/dist/npm/common/types/commands/gateway_balances.js +3 -0
  217. package/dist/npm/common/types/commands/gateway_balances.js.map +1 -0
  218. package/dist/npm/common/types/commands/index.d.ts +11 -0
  219. package/dist/npm/common/types/commands/index.d.ts.map +1 -0
  220. package/dist/npm/common/types/commands/index.js +23 -0
  221. package/dist/npm/common/types/commands/index.js.map +1 -0
  222. package/dist/npm/common/types/commands/ledger.d.ts +19 -0
  223. package/dist/npm/common/types/commands/ledger.d.ts.map +1 -0
  224. package/dist/npm/common/types/commands/ledger.js +3 -0
  225. package/dist/npm/common/types/commands/ledger.js.map +1 -0
  226. package/dist/npm/common/types/commands/ledger_data.d.ts +11 -0
  227. package/dist/npm/common/types/commands/ledger_data.d.ts.map +1 -0
  228. package/dist/npm/common/types/commands/ledger_data.js +3 -0
  229. package/dist/npm/common/types/commands/ledger_data.js.map +1 -0
  230. package/dist/npm/common/types/commands/ledger_entry.d.ts +30 -0
  231. package/dist/npm/common/types/commands/ledger_entry.d.ts.map +1 -0
  232. package/dist/npm/common/types/commands/ledger_entry.js +3 -0
  233. package/dist/npm/common/types/commands/ledger_entry.js.map +1 -0
  234. package/dist/npm/common/types/commands/server_info.d.ts +50 -0
  235. package/dist/npm/common/types/commands/server_info.d.ts.map +1 -0
  236. package/dist/npm/common/types/commands/server_info.js +3 -0
  237. package/dist/npm/common/types/commands/server_info.js.map +1 -0
  238. package/dist/npm/common/types/objects/adjustments.d.ts +17 -0
  239. package/dist/npm/common/types/objects/adjustments.d.ts.map +1 -0
  240. package/dist/npm/common/types/objects/adjustments.js +3 -0
  241. package/dist/npm/common/types/objects/adjustments.js.map +1 -0
  242. package/dist/npm/common/types/objects/amounts.d.ts +14 -0
  243. package/dist/npm/common/types/objects/amounts.d.ts.map +1 -0
  244. package/dist/npm/common/types/objects/amounts.js +3 -0
  245. package/dist/npm/common/types/objects/amounts.js.map +1 -0
  246. package/dist/npm/common/types/objects/index.d.ts +13 -0
  247. package/dist/npm/common/types/objects/index.d.ts.map +1 -0
  248. package/dist/npm/common/types/objects/index.js +25 -0
  249. package/dist/npm/common/types/objects/index.js.map +1 -0
  250. package/dist/npm/common/types/objects/ledger.d.ts +30 -0
  251. package/dist/npm/common/types/objects/ledger.d.ts.map +1 -0
  252. package/dist/npm/common/types/objects/ledger.js +3 -0
  253. package/dist/npm/common/types/objects/ledger.js.map +1 -0
  254. package/dist/npm/common/types/objects/ledger_data.d.ts +11 -0
  255. package/dist/npm/common/types/objects/ledger_data.d.ts.map +1 -0
  256. package/dist/npm/common/types/objects/ledger_data.js +3 -0
  257. package/dist/npm/common/types/objects/ledger_data.js.map +1 -0
  258. package/dist/npm/common/types/objects/ledger_entries.d.ts +159 -0
  259. package/dist/npm/common/types/objects/ledger_entries.d.ts.map +1 -0
  260. package/dist/npm/common/types/objects/ledger_entries.js +3 -0
  261. package/dist/npm/common/types/objects/ledger_entries.js.map +1 -0
  262. package/dist/npm/common/types/objects/memos.d.ts +6 -0
  263. package/dist/npm/common/types/objects/memos.d.ts.map +1 -0
  264. package/dist/npm/common/types/objects/memos.js +3 -0
  265. package/dist/npm/common/types/objects/memos.js.map +1 -0
  266. package/dist/npm/common/types/objects/orders.d.ts +14 -0
  267. package/dist/npm/common/types/objects/orders.d.ts.map +1 -0
  268. package/dist/npm/common/types/objects/orders.js +3 -0
  269. package/dist/npm/common/types/objects/orders.js.map +1 -0
  270. package/dist/npm/common/types/objects/queue_data.d.ts +16 -0
  271. package/dist/npm/common/types/objects/queue_data.d.ts.map +1 -0
  272. package/dist/npm/common/types/objects/queue_data.js +3 -0
  273. package/dist/npm/common/types/objects/queue_data.js.map +1 -0
  274. package/dist/npm/common/types/objects/settings.d.ts +31 -0
  275. package/dist/npm/common/types/objects/settings.d.ts.map +1 -0
  276. package/dist/npm/common/types/objects/settings.js +3 -0
  277. package/dist/npm/common/types/objects/settings.js.map +1 -0
  278. package/dist/npm/common/types/objects/signers.d.ts +7 -0
  279. package/dist/npm/common/types/objects/signers.d.ts.map +1 -0
  280. package/dist/npm/common/types/objects/signers.js +3 -0
  281. package/dist/npm/common/types/objects/signers.js.map +1 -0
  282. package/dist/npm/common/types/objects/transactions.d.ts +22 -0
  283. package/dist/npm/common/types/objects/transactions.d.ts.map +1 -0
  284. package/dist/npm/common/types/objects/transactions.js +3 -0
  285. package/dist/npm/common/types/objects/transactions.js.map +1 -0
  286. package/dist/npm/common/types/objects/trustlines.d.ts +40 -0
  287. package/dist/npm/common/types/objects/trustlines.d.ts.map +1 -0
  288. package/dist/npm/common/types/objects/trustlines.js +3 -0
  289. package/dist/npm/common/types/objects/trustlines.js.map +1 -0
  290. package/dist/npm/common/utils.d.ts +12 -0
  291. package/dist/npm/common/utils.d.ts.map +1 -0
  292. package/dist/npm/common/utils.js +157 -0
  293. package/dist/npm/common/utils.js.map +1 -0
  294. package/dist/npm/common/validate.d.ts +38 -0
  295. package/dist/npm/common/validate.d.ts.map +1 -0
  296. package/dist/npm/common/validate.js +79 -0
  297. package/dist/npm/common/validate.js.map +1 -0
  298. package/dist/npm/common/wswrapper.d.ts +15 -0
  299. package/dist/npm/common/wswrapper.d.ts.map +1 -0
  300. package/dist/npm/common/wswrapper.js +38 -0
  301. package/dist/npm/common/wswrapper.js.map +1 -0
  302. package/dist/npm/index.d.ts +6 -0
  303. package/dist/npm/index.d.ts.map +1 -0
  304. package/dist/npm/index.js +19 -0
  305. package/dist/npm/index.js.map +1 -0
  306. package/dist/npm/ledger/accountinfo.d.ts +14 -0
  307. package/dist/npm/ledger/accountinfo.d.ts.map +1 -0
  308. package/dist/npm/ledger/accountinfo.js +36 -0
  309. package/dist/npm/ledger/accountinfo.js.map +1 -0
  310. package/dist/npm/ledger/accountobjects.d.ts +4 -0
  311. package/dist/npm/ledger/accountobjects.d.ts.map +1 -0
  312. package/dist/npm/ledger/accountobjects.js +27 -0
  313. package/dist/npm/ledger/accountobjects.js.map +1 -0
  314. package/dist/npm/ledger/balance-sheet.d.ts +17 -0
  315. package/dist/npm/ledger/balance-sheet.d.ts.map +1 -0
  316. package/dist/npm/ledger/balance-sheet.js +52 -0
  317. package/dist/npm/ledger/balance-sheet.js.map +1 -0
  318. package/dist/npm/ledger/balances.d.ts +11 -0
  319. package/dist/npm/ledger/balances.d.ts.map +1 -0
  320. package/dist/npm/ledger/balances.js +61 -0
  321. package/dist/npm/ledger/balances.js.map +1 -0
  322. package/dist/npm/ledger/ledger.d.ts +12 -0
  323. package/dist/npm/ledger/ledger.d.ts.map +1 -0
  324. package/dist/npm/ledger/ledger.js +28 -0
  325. package/dist/npm/ledger/ledger.js.map +1 -0
  326. package/dist/npm/ledger/orderbook.d.ts +22 -0
  327. package/dist/npm/ledger/orderbook.d.ts.map +1 -0
  328. package/dist/npm/ledger/orderbook.js +100 -0
  329. package/dist/npm/ledger/orderbook.js.map +1 -0
  330. package/dist/npm/ledger/orders.d.ts +8 -0
  331. package/dist/npm/ledger/orders.d.ts.map +1 -0
  332. package/dist/npm/ledger/orders.js +56 -0
  333. package/dist/npm/ledger/orders.js.map +1 -0
  334. package/dist/npm/ledger/parse/account-delete.d.ts +8 -0
  335. package/dist/npm/ledger/parse/account-delete.d.ts.map +1 -0
  336. package/dist/npm/ledger/parse/account-delete.js +36 -0
  337. package/dist/npm/ledger/parse/account-delete.js.map +1 -0
  338. package/dist/npm/ledger/parse/account-order.d.ts +11 -0
  339. package/dist/npm/ledger/parse/account-order.d.ts.map +1 -0
  340. package/dist/npm/ledger/parse/account-order.js +40 -0
  341. package/dist/npm/ledger/parse/account-order.js.map +1 -0
  342. package/dist/npm/ledger/parse/account-trustline.d.ts +4 -0
  343. package/dist/npm/ledger/parse/account-trustline.d.ts.map +1 -0
  344. package/dist/npm/ledger/parse/account-trustline.js +28 -0
  345. package/dist/npm/ledger/parse/account-trustline.js.map +1 -0
  346. package/dist/npm/ledger/parse/amendment.d.ts +5 -0
  347. package/dist/npm/ledger/parse/amendment.d.ts.map +1 -0
  348. package/dist/npm/ledger/parse/amendment.js +9 -0
  349. package/dist/npm/ledger/parse/amendment.js.map +1 -0
  350. package/dist/npm/ledger/parse/amount.d.ts +4 -0
  351. package/dist/npm/ledger/parse/amount.d.ts.map +1 -0
  352. package/dist/npm/ledger/parse/amount.js +37 -0
  353. package/dist/npm/ledger/parse/amount.js.map +1 -0
  354. package/dist/npm/ledger/parse/cancellation.d.ts +3 -0
  355. package/dist/npm/ledger/parse/cancellation.d.ts.map +1 -0
  356. package/dist/npm/ledger/parse/cancellation.js +32 -0
  357. package/dist/npm/ledger/parse/cancellation.js.map +1 -0
  358. package/dist/npm/ledger/parse/check-cancel.d.ts +6 -0
  359. package/dist/npm/ledger/parse/check-cancel.d.ts.map +1 -0
  360. package/dist/npm/ledger/parse/check-cancel.js +33 -0
  361. package/dist/npm/ledger/parse/check-cancel.js.map +1 -0
  362. package/dist/npm/ledger/parse/check-cash.d.ts +9 -0
  363. package/dist/npm/ledger/parse/check-cash.d.ts.map +1 -0
  364. package/dist/npm/ledger/parse/check-cash.js +39 -0
  365. package/dist/npm/ledger/parse/check-cash.js.map +1 -0
  366. package/dist/npm/ledger/parse/check-create.d.ts +11 -0
  367. package/dist/npm/ledger/parse/check-create.d.ts.map +1 -0
  368. package/dist/npm/ledger/parse/check-create.js +42 -0
  369. package/dist/npm/ledger/parse/check-create.js.map +1 -0
  370. package/dist/npm/ledger/parse/deposit-preauth.d.ts +7 -0
  371. package/dist/npm/ledger/parse/deposit-preauth.d.ts.map +1 -0
  372. package/dist/npm/ledger/parse/deposit-preauth.js +34 -0
  373. package/dist/npm/ledger/parse/deposit-preauth.js.map +1 -0
  374. package/dist/npm/ledger/parse/escrow-cancellation.d.ts +3 -0
  375. package/dist/npm/ledger/parse/escrow-cancellation.d.ts.map +1 -0
  376. package/dist/npm/ledger/parse/escrow-cancellation.js +34 -0
  377. package/dist/npm/ledger/parse/escrow-cancellation.js.map +1 -0
  378. package/dist/npm/ledger/parse/escrow-creation.d.ts +3 -0
  379. package/dist/npm/ledger/parse/escrow-creation.d.ts.map +1 -0
  380. package/dist/npm/ledger/parse/escrow-creation.js +43 -0
  381. package/dist/npm/ledger/parse/escrow-creation.js.map +1 -0
  382. package/dist/npm/ledger/parse/escrow-execution.d.ts +3 -0
  383. package/dist/npm/ledger/parse/escrow-execution.d.ts.map +1 -0
  384. package/dist/npm/ledger/parse/escrow-execution.js +36 -0
  385. package/dist/npm/ledger/parse/escrow-execution.js.map +1 -0
  386. package/dist/npm/ledger/parse/fee-update.d.ts +9 -0
  387. package/dist/npm/ledger/parse/fee-update.d.ts.map +1 -0
  388. package/dist/npm/ledger/parse/fee-update.js +20 -0
  389. package/dist/npm/ledger/parse/fee-update.js.map +1 -0
  390. package/dist/npm/ledger/parse/fields.d.ts +3 -0
  391. package/dist/npm/ledger/parse/fields.d.ts.map +1 -0
  392. package/dist/npm/ledger/parse/fields.js +47 -0
  393. package/dist/npm/ledger/parse/fields.js.map +1 -0
  394. package/dist/npm/ledger/parse/flags.d.ts +16 -0
  395. package/dist/npm/ledger/parse/flags.d.ts.map +1 -0
  396. package/dist/npm/ledger/parse/flags.js +20 -0
  397. package/dist/npm/ledger/parse/flags.js.map +1 -0
  398. package/dist/npm/ledger/parse/ledger.d.ts +19 -0
  399. package/dist/npm/ledger/parse/ledger.d.ts.map +1 -0
  400. package/dist/npm/ledger/parse/ledger.js +76 -0
  401. package/dist/npm/ledger/parse/ledger.js.map +1 -0
  402. package/dist/npm/ledger/parse/order.d.ts +4 -0
  403. package/dist/npm/ledger/parse/order.d.ts.map +1 -0
  404. package/dist/npm/ledger/parse/order.js +50 -0
  405. package/dist/npm/ledger/parse/order.js.map +1 -0
  406. package/dist/npm/ledger/parse/orderbook-order.d.ts +17 -0
  407. package/dist/npm/ledger/parse/orderbook-order.d.ts.map +1 -0
  408. package/dist/npm/ledger/parse/orderbook-order.js +63 -0
  409. package/dist/npm/ledger/parse/orderbook-order.js.map +1 -0
  410. package/dist/npm/ledger/parse/pathfind.d.ts +4 -0
  411. package/dist/npm/ledger/parse/pathfind.d.ts.map +1 -0
  412. package/dist/npm/ledger/parse/pathfind.js +63 -0
  413. package/dist/npm/ledger/parse/pathfind.js.map +1 -0
  414. package/dist/npm/ledger/parse/payment-channel-claim.d.ts +3 -0
  415. package/dist/npm/ledger/parse/payment-channel-claim.d.ts.map +1 -0
  416. package/dist/npm/ledger/parse/payment-channel-claim.js +44 -0
  417. package/dist/npm/ledger/parse/payment-channel-claim.js.map +1 -0
  418. package/dist/npm/ledger/parse/payment-channel-create.d.ts +3 -0
  419. package/dist/npm/ledger/parse/payment-channel-create.d.ts.map +1 -0
  420. package/dist/npm/ledger/parse/payment-channel-create.js +43 -0
  421. package/dist/npm/ledger/parse/payment-channel-create.js.map +1 -0
  422. package/dist/npm/ledger/parse/payment-channel-fund.d.ts +3 -0
  423. package/dist/npm/ledger/parse/payment-channel-fund.d.ts.map +1 -0
  424. package/dist/npm/ledger/parse/payment-channel-fund.js +39 -0
  425. package/dist/npm/ledger/parse/payment-channel-fund.js.map +1 -0
  426. package/dist/npm/ledger/parse/payment-channel.d.ts +17 -0
  427. package/dist/npm/ledger/parse/payment-channel.d.ts.map +1 -0
  428. package/dist/npm/ledger/parse/payment-channel.js +24 -0
  429. package/dist/npm/ledger/parse/payment-channel.js.map +1 -0
  430. package/dist/npm/ledger/parse/payment.d.ts +3 -0
  431. package/dist/npm/ledger/parse/payment.d.ts.map +1 -0
  432. package/dist/npm/ledger/parse/payment.js +64 -0
  433. package/dist/npm/ledger/parse/payment.js.map +1 -0
  434. package/dist/npm/ledger/parse/settings.d.ts +3 -0
  435. package/dist/npm/ledger/parse/settings.d.ts.map +1 -0
  436. package/dist/npm/ledger/parse/settings.js +75 -0
  437. package/dist/npm/ledger/parse/settings.js.map +1 -0
  438. package/dist/npm/ledger/parse/ticket-create.d.ts +3 -0
  439. package/dist/npm/ledger/parse/ticket-create.d.ts.map +1 -0
  440. package/dist/npm/ledger/parse/ticket-create.js +33 -0
  441. package/dist/npm/ledger/parse/ticket-create.js.map +1 -0
  442. package/dist/npm/ledger/parse/transaction.d.ts +3 -0
  443. package/dist/npm/ledger/parse/transaction.d.ts.map +1 -0
  444. package/dist/npm/ledger/parse/transaction.js +98 -0
  445. package/dist/npm/ledger/parse/transaction.js.map +1 -0
  446. package/dist/npm/ledger/parse/trustline.d.ts +3 -0
  447. package/dist/npm/ledger/parse/trustline.d.ts.map +1 -0
  448. package/dist/npm/ledger/parse/trustline.js +50 -0
  449. package/dist/npm/ledger/parse/trustline.js.map +1 -0
  450. package/dist/npm/ledger/parse/utils.d.ts +10 -0
  451. package/dist/npm/ledger/parse/utils.d.ts.map +1 -0
  452. package/dist/npm/ledger/parse/utils.js +136 -0
  453. package/dist/npm/ledger/parse/utils.js.map +1 -0
  454. package/dist/npm/ledger/pathfind-types.d.ts +60 -0
  455. package/dist/npm/ledger/pathfind-types.d.ts.map +1 -0
  456. package/dist/npm/ledger/pathfind-types.js +3 -0
  457. package/dist/npm/ledger/pathfind-types.js.map +1 -0
  458. package/dist/npm/ledger/pathfind.d.ts +5 -0
  459. package/dist/npm/ledger/pathfind.d.ts.map +1 -0
  460. package/dist/npm/ledger/pathfind.js +141 -0
  461. package/dist/npm/ledger/pathfind.js.map +1 -0
  462. package/dist/npm/ledger/payment-channel.d.ts +5 -0
  463. package/dist/npm/ledger/payment-channel.d.ts.map +1 -0
  464. package/dist/npm/ledger/payment-channel.js +34 -0
  465. package/dist/npm/ledger/payment-channel.js.map +1 -0
  466. package/dist/npm/ledger/settings.d.ts +11 -0
  467. package/dist/npm/ledger/settings.d.ts.map +1 -0
  468. package/dist/npm/ledger/settings.js +53 -0
  469. package/dist/npm/ledger/settings.js.map +1 -0
  470. package/dist/npm/ledger/transaction.d.ts +10 -0
  471. package/dist/npm/ledger/transaction.d.ts.map +1 -0
  472. package/dist/npm/ledger/transaction.js +126 -0
  473. package/dist/npm/ledger/transaction.js.map +1 -0
  474. package/dist/npm/ledger/transactions.d.ts +20 -0
  475. package/dist/npm/ledger/transactions.d.ts.map +1 -0
  476. package/dist/npm/ledger/transactions.js +156 -0
  477. package/dist/npm/ledger/transactions.js.map +1 -0
  478. package/dist/npm/ledger/trustlines.d.ts +11 -0
  479. package/dist/npm/ledger/trustlines.d.ts.map +1 -0
  480. package/dist/npm/ledger/trustlines.js +58 -0
  481. package/dist/npm/ledger/trustlines.js.map +1 -0
  482. package/dist/npm/ledger/utils.d.ts +33 -0
  483. package/dist/npm/ledger/utils.d.ts.map +1 -0
  484. package/dist/npm/ledger/utils.js +107 -0
  485. package/dist/npm/ledger/utils.js.map +1 -0
  486. package/dist/npm/offline/derive.d.ts +8 -0
  487. package/dist/npm/offline/derive.d.ts.map +1 -0
  488. package/dist/npm/offline/derive.js +13 -0
  489. package/dist/npm/offline/derive.js.map +1 -0
  490. package/dist/npm/offline/generate-address.d.ts +15 -0
  491. package/dist/npm/offline/generate-address.d.ts.map +1 -0
  492. package/dist/npm/offline/generate-address.js +37 -0
  493. package/dist/npm/offline/generate-address.js.map +1 -0
  494. package/dist/npm/offline/ledgerhash.d.ts +6 -0
  495. package/dist/npm/offline/ledgerhash.d.ts.map +1 -0
  496. package/dist/npm/offline/ledgerhash.js +104 -0
  497. package/dist/npm/offline/ledgerhash.js.map +1 -0
  498. package/dist/npm/offline/sign-payment-channel-claim.d.ts +3 -0
  499. package/dist/npm/offline/sign-payment-channel-claim.d.ts.map +1 -0
  500. package/dist/npm/offline/sign-payment-channel-claim.js +38 -0
  501. package/dist/npm/offline/sign-payment-channel-claim.js.map +1 -0
  502. package/dist/npm/offline/utils.d.ts +10 -0
  503. package/dist/npm/offline/utils.d.ts.map +1 -0
  504. package/dist/npm/offline/utils.js +43 -0
  505. package/dist/npm/offline/utils.js.map +1 -0
  506. package/dist/npm/offline/verify-payment-channel-claim.d.ts +3 -0
  507. package/dist/npm/offline/verify-payment-channel-claim.d.ts.map +1 -0
  508. package/dist/npm/offline/verify-payment-channel-claim.js +18 -0
  509. package/dist/npm/offline/verify-payment-channel-claim.js.map +1 -0
  510. package/dist/npm/server/server.d.ts +8 -0
  511. package/dist/npm/server/server.d.ts.map +1 -0
  512. package/dist/npm/server/server.js +66 -0
  513. package/dist/npm/server/server.js.map +1 -0
  514. package/dist/npm/transaction/check-cancel.d.ts +8 -0
  515. package/dist/npm/transaction/check-cancel.d.ts.map +1 -0
  516. package/dist/npm/transaction/check-cancel.js +24 -0
  517. package/dist/npm/transaction/check-cancel.js.map +1 -0
  518. package/dist/npm/transaction/check-cash.d.ts +11 -0
  519. package/dist/npm/transaction/check-cash.d.ts.map +1 -0
  520. package/dist/npm/transaction/check-cash.js +55 -0
  521. package/dist/npm/transaction/check-cash.js.map +1 -0
  522. package/dist/npm/transaction/check-create.d.ts +13 -0
  523. package/dist/npm/transaction/check-create.d.ts.map +1 -0
  524. package/dist/npm/transaction/check-create.js +54 -0
  525. package/dist/npm/transaction/check-create.js.map +1 -0
  526. package/dist/npm/transaction/combine.d.ts +3 -0
  527. package/dist/npm/transaction/combine.d.ts.map +1 -0
  528. package/dist/npm/transaction/combine.js +62 -0
  529. package/dist/npm/transaction/combine.js.map +1 -0
  530. package/dist/npm/transaction/escrow-cancellation.d.ts +11 -0
  531. package/dist/npm/transaction/escrow-cancellation.d.ts.map +1 -0
  532. package/dist/npm/transaction/escrow-cancellation.js +46 -0
  533. package/dist/npm/transaction/escrow-cancellation.js.map +1 -0
  534. package/dist/npm/transaction/escrow-creation.d.ts +16 -0
  535. package/dist/npm/transaction/escrow-creation.d.ts.map +1 -0
  536. package/dist/npm/transaction/escrow-creation.js +69 -0
  537. package/dist/npm/transaction/escrow-creation.js.map +1 -0
  538. package/dist/npm/transaction/escrow-execution.d.ts +13 -0
  539. package/dist/npm/transaction/escrow-execution.d.ts.map +1 -0
  540. package/dist/npm/transaction/escrow-execution.js +58 -0
  541. package/dist/npm/transaction/escrow-execution.js.map +1 -0
  542. package/dist/npm/transaction/order.d.ts +6 -0
  543. package/dist/npm/transaction/order.d.ts.map +1 -0
  544. package/dist/npm/transaction/order.js +69 -0
  545. package/dist/npm/transaction/order.js.map +1 -0
  546. package/dist/npm/transaction/ordercancellation.d.ts +5 -0
  547. package/dist/npm/transaction/ordercancellation.d.ts.map +1 -0
  548. package/dist/npm/transaction/ordercancellation.js +50 -0
  549. package/dist/npm/transaction/ordercancellation.js.map +1 -0
  550. package/dist/npm/transaction/payment-channel-claim.d.ts +14 -0
  551. package/dist/npm/transaction/payment-channel-claim.d.ts.map +1 -0
  552. package/dist/npm/transaction/payment-channel-claim.js +76 -0
  553. package/dist/npm/transaction/payment-channel-claim.js.map +1 -0
  554. package/dist/npm/transaction/payment-channel-create.d.ts +14 -0
  555. package/dist/npm/transaction/payment-channel-create.d.ts.map +1 -0
  556. package/dist/npm/transaction/payment-channel-create.js +59 -0
  557. package/dist/npm/transaction/payment-channel-create.js.map +1 -0
  558. package/dist/npm/transaction/payment-channel-fund.d.ts +10 -0
  559. package/dist/npm/transaction/payment-channel-fund.d.ts.map +1 -0
  560. package/dist/npm/transaction/payment-channel-fund.js +51 -0
  561. package/dist/npm/transaction/payment-channel-fund.js.map +1 -0
  562. package/dist/npm/transaction/payment.d.ts +16 -0
  563. package/dist/npm/transaction/payment.d.ts.map +1 -0
  564. package/dist/npm/transaction/payment.js +163 -0
  565. package/dist/npm/transaction/payment.js.map +1 -0
  566. package/dist/npm/transaction/settings.d.ts +6 -0
  567. package/dist/npm/transaction/settings.d.ts.map +1 -0
  568. package/dist/npm/transaction/settings.js +130 -0
  569. package/dist/npm/transaction/settings.js.map +1 -0
  570. package/dist/npm/transaction/sign.d.ts +8 -0
  571. package/dist/npm/transaction/sign.d.ts.map +1 -0
  572. package/dist/npm/transaction/sign.js +173 -0
  573. package/dist/npm/transaction/sign.js.map +1 -0
  574. package/dist/npm/transaction/submit.d.ts +8 -0
  575. package/dist/npm/transaction/submit.d.ts.map +1 -0
  576. package/dist/npm/transaction/submit.js +59 -0
  577. package/dist/npm/transaction/submit.js.map +1 -0
  578. package/dist/npm/transaction/ticket.d.ts +9 -0
  579. package/dist/npm/transaction/ticket.d.ts.map +1 -0
  580. package/dist/npm/transaction/ticket.js +46 -0
  581. package/dist/npm/transaction/ticket.js.map +1 -0
  582. package/dist/npm/transaction/trustline.d.ts +6 -0
  583. package/dist/npm/transaction/trustline.d.ts.map +1 -0
  584. package/dist/npm/transaction/trustline.js +82 -0
  585. package/dist/npm/transaction/trustline.js.map +1 -0
  586. package/dist/npm/transaction/types.d.ts +138 -0
  587. package/dist/npm/transaction/types.d.ts.map +1 -0
  588. package/dist/npm/transaction/types.js +3 -0
  589. package/dist/npm/transaction/types.js.map +1 -0
  590. package/dist/npm/transaction/utils.d.ts +22 -0
  591. package/dist/npm/transaction/utils.d.ts.map +1 -0
  592. package/dist/npm/transaction/utils.js +285 -0
  593. package/dist/npm/transaction/utils.js.map +1 -0
  594. package/dist/npm/tsconfig.tsbuildinfo +4230 -0
  595. package/dist/npm/wallet/wallet-generation.d.ts +15 -0
  596. package/dist/npm/wallet/wallet-generation.d.ts.map +1 -0
  597. package/dist/npm/wallet/wallet-generation.js +150 -0
  598. package/dist/npm/wallet/wallet-generation.js.map +1 -0
  599. package/package.json +84 -0
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const assert = __importStar(require("assert"));
26
+ const utils_1 = require("./utils");
27
+ const common_1 = require("../../common");
28
+ const amount_1 = __importDefault(require("./amount"));
29
+ function parsePaymentChannelFund(tx) {
30
+ assert.ok(tx.TransactionType === 'PaymentChannelFund');
31
+ return common_1.removeUndefined({
32
+ memos: utils_1.parseMemos(tx),
33
+ channel: tx.Channel,
34
+ amount: amount_1.default(tx.Amount).value,
35
+ expiration: tx.Expiration && utils_1.parseTimestamp(tx.Expiration)
36
+ });
37
+ }
38
+ exports.default = parsePaymentChannelFund;
39
+ //# sourceMappingURL=payment-channel-fund.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-channel-fund.js","sourceRoot":"","sources":["../../../../src/ledger/parse/payment-channel-fund.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,mCAAiD;AACjD,yCAA4C;AAC5C,sDAAkC;AAElC,SAAS,uBAAuB,CAAC,EAAO;IACtC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,oBAAoB,CAAC,CAAA;IAEtD,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,kBAAU,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,MAAM,EAAE,gBAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK;QACpC,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,sBAAc,CAAC,EAAE,CAAC,UAAU,CAAC;KAC3D,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,uBAAuB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { PayChannelLedgerEntry } from '../../common/types/objects';
2
+ export declare type FormattedPaymentChannel = {
3
+ account: string;
4
+ amount: string;
5
+ balance: string;
6
+ publicKey: string;
7
+ destination: string;
8
+ settleDelay: number;
9
+ expiration?: string;
10
+ cancelAfter?: string;
11
+ sourceTag?: number;
12
+ destinationTag?: number;
13
+ previousAffectingTransactionID: string;
14
+ previousAffectingTransactionLedgerVersion: number;
15
+ };
16
+ export declare function parsePaymentChannel(data: PayChannelLedgerEntry): FormattedPaymentChannel;
17
+ //# sourceMappingURL=payment-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-channel.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/payment-channel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAA;AAEhE,oBAAY,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,8BAA8B,EAAE,MAAM,CAAA;IACtC,yCAAyC,EAAE,MAAM,CAAA;CAClD,CAAA;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,qBAAqB,GAC1B,uBAAuB,CAgBzB"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parsePaymentChannel = void 0;
4
+ const utils_1 = require("./utils");
5
+ const common_1 = require("../../common");
6
+ function parsePaymentChannel(data) {
7
+ return common_1.removeUndefined({
8
+ memos: utils_1.parseMemos(data),
9
+ account: data.Account,
10
+ amount: common_1.dropsToXrp(data.Amount),
11
+ balance: common_1.dropsToXrp(data.Balance),
12
+ destination: data.Destination,
13
+ publicKey: data.PublicKey,
14
+ settleDelay: data.SettleDelay,
15
+ expiration: utils_1.parseTimestamp(data.Expiration),
16
+ cancelAfter: utils_1.parseTimestamp(data.CancelAfter),
17
+ sourceTag: data.SourceTag,
18
+ destinationTag: data.DestinationTag,
19
+ previousAffectingTransactionID: data.PreviousTxnID,
20
+ previousAffectingTransactionLedgerVersion: data.PreviousTxnLgrSeq
21
+ });
22
+ }
23
+ exports.parsePaymentChannel = parsePaymentChannel;
24
+ //# sourceMappingURL=payment-channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-channel.js","sourceRoot":"","sources":["../../../../src/ledger/parse/payment-channel.ts"],"names":[],"mappings":";;;AAAA,mCAAkD;AAClD,yCAAwD;AAkBxD,SAAgB,mBAAmB,CACjC,IAA2B;IAE3B,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,kBAAU,CAAC,IAAI,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,mBAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAC/B,OAAO,EAAE,mBAAU,CAAC,IAAI,CAAC,OAAO,CAAC;QACjC,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,sBAAc,CAAC,IAAI,CAAC,UAAU,CAAC;QAC3C,WAAW,EAAE,sBAAc,CAAC,IAAI,CAAC,WAAW,CAAC;QAC7C,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,8BAA8B,EAAE,IAAI,CAAC,aAAa;QAClD,yCAAyC,EAAE,IAAI,CAAC,iBAAiB;KAClE,CAAC,CAAA;AACJ,CAAC;AAlBD,kDAkBC"}
@@ -0,0 +1,3 @@
1
+ declare function parsePayment(tx: any): object;
2
+ export default parsePayment;
3
+ //# sourceMappingURL=payment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/payment.ts"],"names":[],"mappings":"AAqBA,iBAAS,YAAY,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CA+BrC;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const _ = __importStar(require("lodash"));
26
+ const assert = __importStar(require("assert"));
27
+ const utils = __importStar(require("./utils"));
28
+ const common_1 = require("../../common");
29
+ const amount_1 = __importDefault(require("./amount"));
30
+ function isNoDirectRipple(tx) {
31
+ return (tx.Flags & common_1.txFlags.Payment.NoRippleDirect) !== 0;
32
+ }
33
+ function isQualityLimited(tx) {
34
+ return (tx.Flags & common_1.txFlags.Payment.LimitQuality) !== 0;
35
+ }
36
+ function removeGenericCounterparty(amount, address) {
37
+ return amount.counterparty === address
38
+ ? _.omit(amount, 'counterparty')
39
+ : amount;
40
+ }
41
+ function parsePayment(tx) {
42
+ assert.ok(tx.TransactionType === 'Payment');
43
+ const source = {
44
+ address: tx.Account,
45
+ maxAmount: removeGenericCounterparty(amount_1.default(tx.SendMax || tx.Amount), tx.Account),
46
+ tag: tx.SourceTag
47
+ };
48
+ const destination = {
49
+ address: tx.Destination,
50
+ tag: tx.DestinationTag
51
+ };
52
+ return common_1.removeUndefined({
53
+ source: common_1.removeUndefined(source),
54
+ destination: common_1.removeUndefined(destination),
55
+ memos: utils.parseMemos(tx),
56
+ invoiceID: tx.InvoiceID,
57
+ paths: tx.Paths ? JSON.stringify(tx.Paths) : undefined,
58
+ allowPartialPayment: utils.isPartialPayment(tx) || undefined,
59
+ noDirectRipple: isNoDirectRipple(tx) || undefined,
60
+ limitQuality: isQualityLimited(tx) || undefined
61
+ });
62
+ }
63
+ exports.default = parsePayment;
64
+ //# sourceMappingURL=payment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../../src/ledger/parse/payment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAChC,+CAAgC;AAChC,yCAAqD;AACrD,sDAAkC;AAElC,SAAS,gBAAgB,CAAC,EAAE;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,GAAG,gBAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;AAC1D,CAAC;AAED,SAAS,gBAAgB,CAAC,EAAE;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,GAAG,gBAAO,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;AACxD,CAAC;AAED,SAAS,yBAAyB,CAAC,MAAM,EAAE,OAAO;IAChD,OAAO,MAAM,CAAC,YAAY,KAAK,OAAO;QACpC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC;QAChC,CAAC,CAAC,MAAM,CAAA;AACZ,CAAC;AAGD,SAAS,YAAY,CAAC,EAAO;IAC3B,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,SAAS,CAAC,CAAA;IAE3C,MAAM,MAAM,GAAG;QACb,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,SAAS,EAAE,yBAAyB,CAClC,gBAAW,CAAC,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,MAAM,CAAC,EACpC,EAAE,CAAC,OAAO,CACX;QACD,GAAG,EAAE,EAAE,CAAC,SAAS;KAClB,CAAA;IAED,MAAM,WAAW,GAGb;QACF,OAAO,EAAE,EAAE,CAAC,WAAW;QACvB,GAAG,EAAE,EAAE,CAAC,cAAc;KAEvB,CAAA;IAED,OAAO,wBAAe,CAAC;QACrB,MAAM,EAAE,wBAAe,CAAC,MAAM,CAAC;QAC/B,WAAW,EAAE,wBAAe,CAAC,WAAW,CAAC;QACzC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QACtD,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,SAAS;QAC5D,cAAc,EAAE,gBAAgB,CAAC,EAAE,CAAC,IAAI,SAAS;QACjD,YAAY,EAAE,gBAAgB,CAAC,EAAE,CAAC,IAAI,SAAS;KAChD,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare function parseSettings(tx: any): any;
2
+ export default parseSettings;
3
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/settings.ts"],"names":[],"mappings":"AAmDA,iBAAS,aAAa,CAAC,EAAE,EAAE,GAAG,OAS7B;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const _ = __importStar(require("lodash"));
26
+ const assert = __importStar(require("assert"));
27
+ const common_1 = require("../../common");
28
+ const AccountFlags = common_1.constants.AccountFlags;
29
+ const fields_1 = __importDefault(require("./fields"));
30
+ function getAccountRootModifiedNode(tx) {
31
+ const modifiedNodes = tx.meta.AffectedNodes.filter(node => { var _a; return ((_a = node.ModifiedNode) === null || _a === void 0 ? void 0 : _a.LedgerEntryType) === 'AccountRoot'; });
32
+ assert.ok(modifiedNodes.length === 1);
33
+ return modifiedNodes[0].ModifiedNode;
34
+ }
35
+ function parseFlags(tx) {
36
+ const settings = {};
37
+ if (tx.TransactionType !== 'AccountSet') {
38
+ return settings;
39
+ }
40
+ const node = getAccountRootModifiedNode(tx);
41
+ const oldFlags = _.get(node.PreviousFields, 'Flags');
42
+ const newFlags = _.get(node.FinalFields, 'Flags');
43
+ if (oldFlags != null && newFlags != null) {
44
+ const changedFlags = oldFlags ^ newFlags;
45
+ const setFlags = newFlags & changedFlags;
46
+ const clearedFlags = oldFlags & changedFlags;
47
+ Object.entries(AccountFlags).forEach(entry => {
48
+ const [flagName, flagValue] = entry;
49
+ if (setFlags & flagValue) {
50
+ settings[flagName] = true;
51
+ }
52
+ else if (clearedFlags & flagValue) {
53
+ settings[flagName] = false;
54
+ }
55
+ });
56
+ }
57
+ const oldField = _.get(node.PreviousFields, 'AccountTxnID');
58
+ const newField = _.get(node.FinalFields, 'AccountTxnID');
59
+ if (newField && !oldField) {
60
+ settings.enableTransactionIDTracking = true;
61
+ }
62
+ else if (oldField && !newField) {
63
+ settings.enableTransactionIDTracking = false;
64
+ }
65
+ return settings;
66
+ }
67
+ function parseSettings(tx) {
68
+ const txType = tx.TransactionType;
69
+ assert.ok(txType === 'AccountSet' ||
70
+ txType === 'SetRegularKey' ||
71
+ txType === 'SignerListSet');
72
+ return Object.assign({}, parseFlags(tx), fields_1.default(tx));
73
+ }
74
+ exports.default = parseSettings;
75
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/ledger/parse/settings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAChC,yCAAsC;AACtC,MAAM,YAAY,GAAG,kBAAS,CAAC,YAAY,CAAA;AAC3C,sDAAkC;AAElC,SAAS,0BAA0B,CAAC,EAAO;IACzC,MAAM,aAAa,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,OAAA,IAAI,CAAC,YAAY,0CAAE,eAAe,MAAK,aAAa,CAAA,EAAA,CAAC,CAAC;IACjH,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAA;IACrC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAA;AACtC,CAAC;AAED,SAAS,UAAU,CAAC,EAAO;IACzB,MAAM,QAAQ,GAAQ,EAAE,CAAA;IACxB,IAAI,EAAE,CAAC,eAAe,KAAK,YAAY,EAAE;QACvC,OAAO,QAAQ,CAAA;KAChB;IAED,MAAM,IAAI,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAA;IAC3C,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;IAEjD,IAAI,QAAQ,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,EAAE;QACxC,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;QACxC,MAAM,QAAQ,GAAG,QAAQ,GAAG,YAAY,CAAA;QACxC,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,CAAA;QAC5C,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC3C,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC;YACpC,IAAI,QAAQ,GAAG,SAAS,EAAE;gBACxB,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA;aAC1B;iBAAM,IAAI,YAAY,GAAG,SAAS,EAAE;gBACnC,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAA;aAC3B;QACH,CAAC,CAAC,CAAA;KACH;IAMD,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;IAC3D,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;IACxD,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE;QACzB,QAAQ,CAAC,2BAA2B,GAAG,IAAI,CAAA;KAC5C;SAAM,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE;QAChC,QAAQ,CAAC,2BAA2B,GAAG,KAAK,CAAA;KAC7C;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,EAAO;IAC5B,MAAM,MAAM,GAAG,EAAE,CAAC,eAAe,CAAA;IACjC,MAAM,CAAC,EAAE,CACP,MAAM,KAAK,YAAY;QACrB,MAAM,KAAK,eAAe;QAC1B,MAAM,KAAK,eAAe,CAC7B,CAAA;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,gBAAW,CAAC,EAAE,CAAC,CAAC,CAAA;AAC3D,CAAC;AAED,kBAAe,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare function parseTicketCreate(tx: any): object;
2
+ export default parseTicketCreate;
3
+ //# sourceMappingURL=ticket-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticket-create.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/ticket-create.ts"],"names":[],"mappings":"AAIA,iBAAS,iBAAiB,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAM1C;AAED,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const assert = __importStar(require("assert"));
23
+ const common_1 = require("../../common");
24
+ const utils_1 = require("./utils");
25
+ function parseTicketCreate(tx) {
26
+ assert.ok(tx.TransactionType === 'TicketCreate');
27
+ return common_1.removeUndefined({
28
+ memos: utils_1.parseMemos(tx),
29
+ ticketCount: tx.TicketCount
30
+ });
31
+ }
32
+ exports.default = parseTicketCreate;
33
+ //# sourceMappingURL=ticket-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticket-create.js","sourceRoot":"","sources":["../../../../src/ledger/parse/ticket-create.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,yCAA4C;AAC5C,mCAAkC;AAElC,SAAS,iBAAiB,CAAC,EAAO;IAChC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,cAAc,CAAC,CAAA;IAChD,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,kBAAU,CAAC,EAAE,CAAC;QACrB,WAAW,EAAE,EAAE,CAAC,WAAW;KAC5B,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,iBAAiB,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare function parseTransaction(tx: any, includeRawTransaction: boolean): any;
2
+ export default parseTransaction;
3
+ //# sourceMappingURL=transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/transaction.ts"],"names":[],"mappings":"AAsDA,iBAAS,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,OAAO,GAAG,GAAG,CA+CtE;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,98 @@
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
+ const utils_1 = require("./utils");
7
+ const common_1 = require("../../common");
8
+ const settings_1 = __importDefault(require("./settings"));
9
+ const account_delete_1 = __importDefault(require("./account-delete"));
10
+ const check_cancel_1 = __importDefault(require("./check-cancel"));
11
+ const check_cash_1 = __importDefault(require("./check-cash"));
12
+ const check_create_1 = __importDefault(require("./check-create"));
13
+ const deposit_preauth_1 = __importDefault(require("./deposit-preauth"));
14
+ const escrow_cancellation_1 = __importDefault(require("./escrow-cancellation"));
15
+ const escrow_creation_1 = __importDefault(require("./escrow-creation"));
16
+ const escrow_execution_1 = __importDefault(require("./escrow-execution"));
17
+ const cancellation_1 = __importDefault(require("./cancellation"));
18
+ const order_1 = __importDefault(require("./order"));
19
+ const payment_1 = __importDefault(require("./payment"));
20
+ const payment_channel_claim_1 = __importDefault(require("./payment-channel-claim"));
21
+ const payment_channel_create_1 = __importDefault(require("./payment-channel-create"));
22
+ const payment_channel_fund_1 = __importDefault(require("./payment-channel-fund"));
23
+ const ticket_create_1 = __importDefault(require("./ticket-create"));
24
+ const trustline_1 = __importDefault(require("./trustline"));
25
+ const amendment_1 = __importDefault(require("./amendment"));
26
+ const fee_update_1 = __importDefault(require("./fee-update"));
27
+ function parseTransactionType(type) {
28
+ const mapping = {
29
+ AccountSet: 'settings',
30
+ AccountDelete: 'accountDelete',
31
+ CheckCancel: 'checkCancel',
32
+ CheckCash: 'checkCash',
33
+ CheckCreate: 'checkCreate',
34
+ DepositPreauth: 'depositPreauth',
35
+ EscrowCancel: 'escrowCancellation',
36
+ EscrowCreate: 'escrowCreation',
37
+ EscrowFinish: 'escrowExecution',
38
+ OfferCancel: 'orderCancellation',
39
+ OfferCreate: 'order',
40
+ Payment: 'payment',
41
+ PaymentChannelClaim: 'paymentChannelClaim',
42
+ PaymentChannelCreate: 'paymentChannelCreate',
43
+ PaymentChannelFund: 'paymentChannelFund',
44
+ SetRegularKey: 'settings',
45
+ SignerListSet: 'settings',
46
+ TicketCreate: 'ticketCreate',
47
+ TrustSet: 'trustline',
48
+ EnableAmendment: 'amendment',
49
+ SetFee: 'feeUpdate'
50
+ };
51
+ return mapping[type] || null;
52
+ }
53
+ function parseTransaction(tx, includeRawTransaction) {
54
+ const type = parseTransactionType(tx.TransactionType);
55
+ const mapping = {
56
+ settings: settings_1.default,
57
+ accountDelete: account_delete_1.default,
58
+ checkCancel: check_cancel_1.default,
59
+ checkCash: check_cash_1.default,
60
+ checkCreate: check_create_1.default,
61
+ depositPreauth: deposit_preauth_1.default,
62
+ escrowCancellation: escrow_cancellation_1.default,
63
+ escrowCreation: escrow_creation_1.default,
64
+ escrowExecution: escrow_execution_1.default,
65
+ orderCancellation: cancellation_1.default,
66
+ order: order_1.default,
67
+ payment: payment_1.default,
68
+ paymentChannelClaim: payment_channel_claim_1.default,
69
+ paymentChannelCreate: payment_channel_create_1.default,
70
+ paymentChannelFund: payment_channel_fund_1.default,
71
+ ticketCreate: ticket_create_1.default,
72
+ trustline: trustline_1.default,
73
+ amendment: amendment_1.default,
74
+ feeUpdate: fee_update_1.default
75
+ };
76
+ const parser = mapping[type];
77
+ const specification = parser
78
+ ? parser(tx)
79
+ : {
80
+ UNAVAILABLE: 'Unrecognized transaction type.',
81
+ SEE_RAW_TRANSACTION: 'Since this type is unrecognized, `rawTransaction` is included in this response.'
82
+ };
83
+ if (!parser) {
84
+ includeRawTransaction = true;
85
+ }
86
+ const outcome = utils_1.parseOutcome(tx);
87
+ return common_1.removeUndefined({
88
+ type: type,
89
+ address: tx.Account,
90
+ sequence: tx.Sequence,
91
+ id: tx.hash,
92
+ specification: common_1.removeUndefined(specification),
93
+ outcome: outcome ? common_1.removeUndefined(outcome) : undefined,
94
+ rawTransaction: includeRawTransaction ? JSON.stringify(tx) : undefined
95
+ });
96
+ }
97
+ exports.default = parseTransaction;
98
+ //# sourceMappingURL=transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../../src/ledger/parse/transaction.ts"],"names":[],"mappings":";;;;;AAAA,mCAAoC;AACpC,yCAA4C;AAE5C,0DAAsC;AACtC,sEAAiD;AACjD,kEAA6C;AAC7C,8DAAyC;AACzC,kEAA6C;AAC7C,wEAAmD;AACnD,gFAA2D;AAC3D,wEAAmD;AACnD,0EAAqD;AACrD,kEAAmD;AACnD,oDAAgC;AAChC,wDAAoC;AACpC,oFAA8D;AAC9D,sFAAgE;AAChE,kFAA4D;AAC5D,oEAA+C;AAC/C,4DAAwC;AAExC,4DAAwC;AACxC,8DAAyC;AAEzC,SAAS,oBAAoB,CAAC,IAAI;IAEhC,MAAM,OAAO,GAAG;QACd,UAAU,EAAE,UAAU;QACtB,aAAa,EAAE,eAAe;QAC9B,WAAW,EAAE,aAAa;QAC1B,SAAS,EAAE,WAAW;QACtB,WAAW,EAAE,aAAa;QAC1B,cAAc,EAAE,gBAAgB;QAChC,YAAY,EAAE,oBAAoB;QAClC,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,iBAAiB;QAC/B,WAAW,EAAE,mBAAmB;QAChC,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,SAAS;QAClB,mBAAmB,EAAE,qBAAqB;QAC1C,oBAAoB,EAAE,sBAAsB;QAC5C,kBAAkB,EAAE,oBAAoB;QACxC,aAAa,EAAE,UAAU;QACzB,aAAa,EAAE,UAAU;QACzB,YAAY,EAAE,cAAc;QAC5B,QAAQ,EAAE,WAAW;QAErB,eAAe,EAAE,WAAW;QAC5B,MAAM,EAAE,WAAW;KACpB,CAAA;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAA;AAC9B,CAAC;AAGD,SAAS,gBAAgB,CAAC,EAAO,EAAE,qBAA8B;IAC/D,MAAM,IAAI,GAAG,oBAAoB,CAAC,EAAE,CAAC,eAAe,CAAC,CAAA;IACrD,MAAM,OAAO,GAAG;QACd,QAAQ,EAAE,kBAAa;QACvB,aAAa,EAAE,wBAAkB;QACjC,WAAW,EAAE,sBAAgB;QAC7B,SAAS,EAAE,oBAAc;QACzB,WAAW,EAAE,sBAAgB;QAC7B,cAAc,EAAE,yBAAmB;QACnC,kBAAkB,EAAE,6BAAuB;QAC3C,cAAc,EAAE,yBAAmB;QACnC,eAAe,EAAE,0BAAoB;QACrC,iBAAiB,EAAE,sBAAsB;QACzC,KAAK,EAAE,eAAU;QACjB,OAAO,EAAE,iBAAY;QACrB,mBAAmB,EAAE,+BAAwB;QAC7C,oBAAoB,EAAE,gCAAyB;QAC/C,kBAAkB,EAAE,8BAAuB;QAC3C,YAAY,EAAE,uBAAiB;QAC/B,SAAS,EAAE,mBAAc;QAEzB,SAAS,EAAE,mBAAc;QACzB,SAAS,EAAE,oBAAc;KAC1B,CAAA;IACD,MAAM,MAAM,GAAa,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtC,MAAM,aAAa,GAAG,MAAM;QAC1B,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACZ,CAAC,CAAC;YACE,WAAW,EAAE,gCAAgC;YAC7C,mBAAmB,EACjB,iFAAiF;SACpF,CAAA;IACL,IAAI,CAAC,MAAM,EAAE;QACX,qBAAqB,GAAG,IAAI,CAAA;KAC7B;IAED,MAAM,OAAO,GAAG,oBAAY,CAAC,EAAE,CAAC,CAAA;IAChC,OAAO,wBAAe,CAAC;QACrB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,EAAE,EAAE,EAAE,CAAC,IAAI;QACX,aAAa,EAAE,wBAAe,CAAC,aAAa,CAAC;QAC7C,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;QACvD,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;KACvE,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare function parseTrustline(tx: any): object;
2
+ export default parseTrustline;
3
+ //# sourceMappingURL=trustline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustline.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/trustline.ts"],"names":[],"mappings":"AAeA,iBAAS,cAAc,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAkBvC;AAED,eAAe,cAAc,CAAA"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const assert = __importStar(require("assert"));
23
+ const utils_1 = require("./utils");
24
+ const common_1 = require("../../common");
25
+ const flags = common_1.txFlags.TrustSet;
26
+ function parseFlag(flagsValue, trueValue, falseValue) {
27
+ if (flagsValue & trueValue) {
28
+ return true;
29
+ }
30
+ if (flagsValue & falseValue) {
31
+ return false;
32
+ }
33
+ return undefined;
34
+ }
35
+ function parseTrustline(tx) {
36
+ assert.ok(tx.TransactionType === 'TrustSet');
37
+ return common_1.removeUndefined({
38
+ limit: tx.LimitAmount.value,
39
+ currency: tx.LimitAmount.currency,
40
+ counterparty: tx.LimitAmount.issuer,
41
+ memos: utils_1.parseMemos(tx),
42
+ qualityIn: utils_1.parseQuality(tx.QualityIn),
43
+ qualityOut: utils_1.parseQuality(tx.QualityOut),
44
+ ripplingDisabled: parseFlag(tx.Flags, flags.SetNoRipple, flags.ClearNoRipple),
45
+ frozen: parseFlag(tx.Flags, flags.SetFreeze, flags.ClearFreeze),
46
+ authorized: parseFlag(tx.Flags, flags.SetAuth, 0)
47
+ });
48
+ }
49
+ exports.default = parseTrustline;
50
+ //# sourceMappingURL=trustline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustline.js","sourceRoot":"","sources":["../../../../src/ledger/parse/trustline.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,mCAAgD;AAChD,yCAAqD;AACrD,MAAM,KAAK,GAAG,gBAAO,CAAC,QAAQ,CAAA;AAE9B,SAAS,SAAS,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU;IAClD,IAAI,UAAU,GAAG,SAAS,EAAE;QAC1B,OAAO,IAAI,CAAA;KACZ;IACD,IAAI,UAAU,GAAG,UAAU,EAAE;QAC3B,OAAO,KAAK,CAAA;KACb;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,cAAc,CAAC,EAAO;IAC7B,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,UAAU,CAAC,CAAA;IAE5C,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK;QAC3B,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ;QACjC,YAAY,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM;QACnC,KAAK,EAAE,kBAAU,CAAC,EAAE,CAAC;QACrB,SAAS,EAAE,oBAAY,CAAC,EAAE,CAAC,SAAS,CAAC;QACrC,UAAU,EAAE,oBAAY,CAAC,EAAE,CAAC,UAAU,CAAC;QACvC,gBAAgB,EAAE,SAAS,CACzB,EAAE,CAAC,KAAK,EACR,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,aAAa,CACpB;QACD,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC;QAC/D,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;KAClD,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { Memo } from '../../common/types/objects';
2
+ declare function adjustQualityForXRP(quality: string, takerGetsCurrency: string, takerPaysCurrency: string): string;
3
+ declare function parseQuality(quality?: number | null): number | undefined;
4
+ declare function parseTimestamp(rippleTime?: number | null): string | undefined;
5
+ declare function isPartialPayment(tx: any): boolean;
6
+ declare function parseOutcome(tx: any): any | undefined;
7
+ declare function hexToString(hex: string): string | undefined;
8
+ declare function parseMemos(tx: any): Array<Memo> | undefined;
9
+ export { parseQuality, parseOutcome, parseMemos, hexToString, parseTimestamp, adjustQualityForXRP, isPartialPayment };
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAS,IAAI,EAAC,MAAM,4BAA4B,CAAA;AAyBvD,iBAAS,mBAAmB,CAC1B,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,UAU1B;AAED,iBAAS,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAKjE;AAED,iBAAS,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAKtE;AAsBD,iBAAS,gBAAgB,CAAC,EAAE,EAAE,GAAG,WAEhC;AA0CD,iBAAS,YAAY,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAuB9C;AAED,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpD;AAED,iBAAS,UAAU,CAAC,EAAE,EAAE,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAWpD;AAED,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EACjB,CAAA"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.isPartialPayment = exports.adjustQualityForXRP = exports.parseTimestamp = exports.hexToString = exports.parseMemos = exports.parseOutcome = exports.parseQuality = void 0;
26
+ const ripple_lib_transactionparser_1 = __importDefault(require("ripple-lib-transactionparser"));
27
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
28
+ const common = __importStar(require("../../common"));
29
+ const amount_1 = __importDefault(require("./amount"));
30
+ function adjustQualityForXRP(quality, takerGetsCurrency, takerPaysCurrency) {
31
+ const numeratorShift = takerPaysCurrency === 'XRP' ? -6 : 0;
32
+ const denominatorShift = takerGetsCurrency === 'XRP' ? -6 : 0;
33
+ const shift = numeratorShift - denominatorShift;
34
+ return shift === 0
35
+ ? quality
36
+ : new bignumber_js_1.default(quality).shiftedBy(shift).toString();
37
+ }
38
+ exports.adjustQualityForXRP = adjustQualityForXRP;
39
+ function parseQuality(quality) {
40
+ if (typeof quality !== 'number') {
41
+ return undefined;
42
+ }
43
+ return new bignumber_js_1.default(quality).shiftedBy(-9).toNumber();
44
+ }
45
+ exports.parseQuality = parseQuality;
46
+ function parseTimestamp(rippleTime) {
47
+ if (typeof rippleTime !== 'number') {
48
+ return undefined;
49
+ }
50
+ return common.rippleTimeToISO8601(rippleTime);
51
+ }
52
+ exports.parseTimestamp = parseTimestamp;
53
+ function removeEmptyCounterparty(amount) {
54
+ if (amount.counterparty === '') {
55
+ delete amount.counterparty;
56
+ }
57
+ }
58
+ function removeEmptyCounterpartyInBalanceChanges(balanceChanges) {
59
+ Object.entries(balanceChanges).forEach(([_, changes]) => {
60
+ changes.forEach(removeEmptyCounterparty);
61
+ });
62
+ }
63
+ function removeEmptyCounterpartyInOrderbookChanges(orderbookChanges) {
64
+ Object.entries(orderbookChanges).forEach(([_, changes]) => {
65
+ changes.forEach((change) => {
66
+ Object.entries(change).forEach(removeEmptyCounterparty);
67
+ });
68
+ });
69
+ }
70
+ function isPartialPayment(tx) {
71
+ return (tx.Flags & common.txFlags.Payment.PartialPayment) !== 0;
72
+ }
73
+ exports.isPartialPayment = isPartialPayment;
74
+ function parseDeliveredAmount(tx) {
75
+ if (tx.TransactionType !== 'Payment' ||
76
+ tx.meta.TransactionResult !== 'tesSUCCESS') {
77
+ return undefined;
78
+ }
79
+ if (tx.meta.delivered_amount && tx.meta.delivered_amount === 'unavailable') {
80
+ return undefined;
81
+ }
82
+ if (tx.meta.delivered_amount) {
83
+ return amount_1.default(tx.meta.delivered_amount);
84
+ }
85
+ if (tx.meta.DeliveredAmount) {
86
+ return amount_1.default(tx.meta.DeliveredAmount);
87
+ }
88
+ if (tx.Amount && !isPartialPayment(tx)) {
89
+ return amount_1.default(tx.Amount);
90
+ }
91
+ if (tx.Amount && tx.ledger_index > 4594094) {
92
+ return amount_1.default(tx.Amount);
93
+ }
94
+ return undefined;
95
+ }
96
+ function parseOutcome(tx) {
97
+ const metadata = tx.meta || tx.metaData;
98
+ if (!metadata) {
99
+ return undefined;
100
+ }
101
+ const balanceChanges = ripple_lib_transactionparser_1.default.parseBalanceChanges(metadata);
102
+ const orderbookChanges = ripple_lib_transactionparser_1.default.parseOrderbookChanges(metadata);
103
+ const channelChanges = ripple_lib_transactionparser_1.default.parseChannelChanges(metadata);
104
+ removeEmptyCounterpartyInBalanceChanges(balanceChanges);
105
+ removeEmptyCounterpartyInOrderbookChanges(orderbookChanges);
106
+ return common.removeUndefined({
107
+ result: tx.meta.TransactionResult,
108
+ timestamp: parseTimestamp(tx.date),
109
+ fee: common.dropsToXrp(tx.Fee),
110
+ balanceChanges: balanceChanges,
111
+ orderbookChanges: orderbookChanges,
112
+ channelChanges: channelChanges,
113
+ ledgerVersion: tx.ledger_index,
114
+ indexInLedger: tx.meta.TransactionIndex,
115
+ deliveredAmount: parseDeliveredAmount(tx)
116
+ });
117
+ }
118
+ exports.parseOutcome = parseOutcome;
119
+ function hexToString(hex) {
120
+ return hex ? Buffer.from(hex, 'hex').toString('utf-8') : undefined;
121
+ }
122
+ exports.hexToString = hexToString;
123
+ function parseMemos(tx) {
124
+ if (!Array.isArray(tx.Memos) || tx.Memos.length === 0) {
125
+ return undefined;
126
+ }
127
+ return tx.Memos.map((m) => {
128
+ return common.removeUndefined({
129
+ type: m.Memo.parsed_memo_type || hexToString(m.Memo.MemoType),
130
+ format: m.Memo.parsed_memo_format || hexToString(m.Memo.MemoFormat),
131
+ data: m.Memo.parsed_memo_data || hexToString(m.Memo.MemoData)
132
+ });
133
+ });
134
+ }
135
+ exports.parseMemos = parseMemos;
136
+ //# sourceMappingURL=utils.js.map