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,121 @@
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.SHAMap = exports.Leaf = exports.InnerNode = exports.Node = exports.NodeType = void 0;
7
+ const hash_prefix_1 = __importDefault(require("./hash-prefix"));
8
+ const sha512Half_1 = __importDefault(require("./sha512Half"));
9
+ const HEX_ZERO = '0000000000000000000000000000000000000000000000000000000000000000';
10
+ var NodeType;
11
+ (function (NodeType) {
12
+ NodeType[NodeType["INNER"] = 1] = "INNER";
13
+ NodeType[NodeType["TRANSACTION_NO_METADATA"] = 2] = "TRANSACTION_NO_METADATA";
14
+ NodeType[NodeType["TRANSACTION_METADATA"] = 3] = "TRANSACTION_METADATA";
15
+ NodeType[NodeType["ACCOUNT_STATE"] = 4] = "ACCOUNT_STATE";
16
+ })(NodeType = exports.NodeType || (exports.NodeType = {}));
17
+ class Node {
18
+ constructor() { }
19
+ addItem(_tag, _node) {
20
+ throw new Error('Called unimplemented virtual method SHAMapTreeNode#addItem.');
21
+ }
22
+ get hash() {
23
+ throw new Error('Called unimplemented virtual method SHAMapTreeNode#hash.');
24
+ }
25
+ }
26
+ exports.Node = Node;
27
+ class InnerNode extends Node {
28
+ constructor(depth = 0) {
29
+ super();
30
+ this.leaves = {};
31
+ this.type = NodeType.INNER;
32
+ this.depth = depth;
33
+ this.empty = true;
34
+ }
35
+ addItem(tag, node) {
36
+ const existingNode = this.getNode(parseInt(tag[this.depth], 16));
37
+ if (existingNode) {
38
+ if (existingNode instanceof InnerNode) {
39
+ existingNode.addItem(tag, node);
40
+ }
41
+ else if (existingNode instanceof Leaf) {
42
+ if (existingNode.tag === tag) {
43
+ throw new Error('Tried to add a node to a SHAMap that was already in there.');
44
+ }
45
+ else {
46
+ const newInnerNode = new InnerNode(this.depth + 1);
47
+ newInnerNode.addItem(existingNode.tag, existingNode);
48
+ newInnerNode.addItem(tag, node);
49
+ this.setNode(parseInt(tag[this.depth], 16), newInnerNode);
50
+ }
51
+ }
52
+ }
53
+ else {
54
+ this.setNode(parseInt(tag[this.depth], 16), node);
55
+ }
56
+ }
57
+ setNode(slot, node) {
58
+ if (slot < 0 || slot > 15) {
59
+ throw new Error('Invalid slot: slot must be between 0-15.');
60
+ }
61
+ this.leaves[slot] = node;
62
+ this.empty = false;
63
+ }
64
+ getNode(slot) {
65
+ if (slot < 0 || slot > 15) {
66
+ throw new Error('Invalid slot: slot must be between 0-15.');
67
+ }
68
+ return this.leaves[slot];
69
+ }
70
+ get hash() {
71
+ if (this.empty)
72
+ return HEX_ZERO;
73
+ let hex = '';
74
+ for (let i = 0; i < 16; i++) {
75
+ hex += this.leaves[i] ? this.leaves[i].hash : HEX_ZERO;
76
+ }
77
+ const prefix = hash_prefix_1.default.INNER_NODE.toString(16);
78
+ return sha512Half_1.default(prefix + hex);
79
+ }
80
+ }
81
+ exports.InnerNode = InnerNode;
82
+ class Leaf extends Node {
83
+ constructor(tag, data, type) {
84
+ super();
85
+ this.tag = tag;
86
+ this.type = type;
87
+ this.data = data;
88
+ }
89
+ get hash() {
90
+ switch (this.type) {
91
+ case NodeType.ACCOUNT_STATE: {
92
+ const leafPrefix = hash_prefix_1.default.LEAF_NODE.toString(16);
93
+ return sha512Half_1.default(leafPrefix + this.data + this.tag);
94
+ }
95
+ case NodeType.TRANSACTION_NO_METADATA: {
96
+ const txIDPrefix = hash_prefix_1.default.TRANSACTION_ID.toString(16);
97
+ return sha512Half_1.default(txIDPrefix + this.data);
98
+ }
99
+ case NodeType.TRANSACTION_METADATA: {
100
+ const txNodePrefix = hash_prefix_1.default.TRANSACTION_NODE.toString(16);
101
+ return sha512Half_1.default(txNodePrefix + this.data + this.tag);
102
+ }
103
+ default:
104
+ throw new Error('Tried to hash a SHAMap node of unknown type.');
105
+ }
106
+ }
107
+ }
108
+ exports.Leaf = Leaf;
109
+ class SHAMap {
110
+ constructor() {
111
+ this.root = new InnerNode(0);
112
+ }
113
+ addItem(tag, data, type) {
114
+ this.root.addItem(tag, new Leaf(tag, data, type));
115
+ }
116
+ get hash() {
117
+ return this.root.hash;
118
+ }
119
+ }
120
+ exports.SHAMap = SHAMap;
121
+ //# sourceMappingURL=shamap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shamap.js","sourceRoot":"","sources":["../../../../src/common/hashes/shamap.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAsC;AACtC,8DAAqC;AACrC,MAAM,QAAQ,GACZ,kEAAkE,CAAA;AAEpE,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yCAAS,CAAA;IACT,6EAA2B,CAAA;IAC3B,uEAAwB,CAAA;IACxB,yDAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB;AAED,MAAsB,IAAI;IAMxB,gBAAsB,CAAC;IAEhB,OAAO,CAAC,IAAY,EAAE,KAAW;QACtC,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAA;IACH,CAAC;IACD,IAAW,IAAI;QACb,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;IAC7E,CAAC;CACF;AAhBD,oBAgBC;AAED,MAAa,SAAU,SAAQ,IAAI;IAWjC,YAAmB,QAAgB,CAAC;QAClC,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAA;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;IAQM,OAAO,CAAC,GAAW,EAAE,IAAU;QACpC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAA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Ac,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;gBACzD,OAAO,oBAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;aAC1C;YACD,KAAK,QAAQ,CAAC,oBAAoB,CAAC,CAAC;gBAClC,MAAM,YAAY,GAAG,qBAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;gBAC7D,OAAO,oBAAU,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;aACvD;YACD;gBACE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;SAClE;IACH,CAAC;CACF;AArCD,oBAqCC;AAED,MAAa,MAAM;IAOjB;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,CAAA;IAC9B,CAAC;IAEM,OAAO,CAAC,GAAW,EAAE,IAAY,EAAE,IAAc;QACtD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;IACnD,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;IACvB,CAAC;CACF;AAlBD,wBAkBC"}
@@ -0,0 +1,10 @@
1
+ import * as constants from './constants';
2
+ import * as errors from './errors';
3
+ import * as validate from './validate';
4
+ import * as serverInfo from './serverinfo';
5
+ export declare function ensureClassicAddress(account: string): string;
6
+ export { constants, errors, validate, serverInfo };
7
+ export { dropsToXrp, xrpToDrops, toRippledAmount, removeUndefined, convertKeysFromSnakeCaseToCamelCase, iso8601ToRippleTime, rippleTimeToISO8601 } from './utils';
8
+ export { Connection } from './connection';
9
+ export { txFlags } from './txflags';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAG1C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkB5D;AAED,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAC,CAAA;AAChD,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,mCAAmC,EACnC,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA"}
@@ -0,0 +1,57 @@
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
+ exports.serverInfo = exports.validate = exports.errors = exports.constants = exports.ensureClassicAddress = void 0;
23
+ const constants = __importStar(require("./constants"));
24
+ exports.constants = constants;
25
+ const errors = __importStar(require("./errors"));
26
+ exports.errors = errors;
27
+ const validate = __importStar(require("./validate"));
28
+ exports.validate = validate;
29
+ const serverInfo = __importStar(require("./serverinfo"));
30
+ exports.serverInfo = serverInfo;
31
+ const ripple_address_codec_1 = require("ripple-address-codec");
32
+ function ensureClassicAddress(account) {
33
+ if (ripple_address_codec_1.isValidXAddress(account)) {
34
+ const { classicAddress, tag } = ripple_address_codec_1.xAddressToClassicAddress(account);
35
+ if (tag !== false) {
36
+ throw new Error('This command does not support the use of a tag. Use an address without a tag.');
37
+ }
38
+ return classicAddress;
39
+ }
40
+ else {
41
+ return account;
42
+ }
43
+ }
44
+ exports.ensureClassicAddress = ensureClassicAddress;
45
+ var utils_1 = require("./utils");
46
+ Object.defineProperty(exports, "dropsToXrp", { enumerable: true, get: function () { return utils_1.dropsToXrp; } });
47
+ Object.defineProperty(exports, "xrpToDrops", { enumerable: true, get: function () { return utils_1.xrpToDrops; } });
48
+ Object.defineProperty(exports, "toRippledAmount", { enumerable: true, get: function () { return utils_1.toRippledAmount; } });
49
+ Object.defineProperty(exports, "removeUndefined", { enumerable: true, get: function () { return utils_1.removeUndefined; } });
50
+ Object.defineProperty(exports, "convertKeysFromSnakeCaseToCamelCase", { enumerable: true, get: function () { return utils_1.convertKeysFromSnakeCaseToCamelCase; } });
51
+ Object.defineProperty(exports, "iso8601ToRippleTime", { enumerable: true, get: function () { return utils_1.iso8601ToRippleTime; } });
52
+ Object.defineProperty(exports, "rippleTimeToISO8601", { enumerable: true, get: function () { return utils_1.rippleTimeToISO8601; } });
53
+ var connection_1 = require("./connection");
54
+ Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_1.Connection; } });
55
+ var txflags_1 = require("./txflags");
56
+ Object.defineProperty(exports, "txFlags", { enumerable: true, get: function () { return txflags_1.txFlags; } });
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AA0BhC,8BAAS;AAzBjB,iDAAkC;AAyBf,wBAAM;AAxBzB,qDAAsC;AAwBX,4BAAQ;AAvBnC,yDAA0C;AAuBL,gCAAU;AAtB/C,+DAA8E;AAE9E,SAAgB,oBAAoB,CAAC,OAAe;IAClD,IAAI,sCAAe,CAAC,OAAO,CAAC,EAAE;QAC5B,MAAM,EAAC,cAAc,EAAE,GAAG,EAAC,GAAG,+CAAwB,CAAC,OAAO,CAAC,CAAA;QAK/D,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAA;SACF;QAGD,OAAO,cAAc,CAAA;KACtB;SAAM;QACL,OAAO,OAAO,CAAA;KACf;AACH,CAAC;AAlBD,oDAkBC;AAGD,iCAQgB;AAPd,mGAAA,UAAU,OAAA;AACV,mGAAA,UAAU,OAAA;AACV,wGAAA,eAAe,OAAA;AACf,wGAAA,eAAe,OAAA;AACf,4HAAA,mCAAmC,OAAA;AACnC,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AAErB,2CAAuC;AAA/B,wGAAA,UAAU,OAAA;AAClB,qCAAiC;AAAzB,kGAAA,OAAO,OAAA"}
@@ -0,0 +1,13 @@
1
+ declare class RangeSet {
2
+ ranges: Array<[number, number]>;
3
+ constructor();
4
+ reset(): void;
5
+ serialize(): string;
6
+ addRange(start: number, end: number): void;
7
+ addValue(value: number): void;
8
+ parseAndAddRanges(rangesString: string): void;
9
+ containsRange(start: number, end: number): boolean;
10
+ containsValue(value: number): boolean;
11
+ }
12
+ export default RangeSet;
13
+ //# sourceMappingURL=rangeset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rangeset.d.ts","sourceRoot":"","sources":["../../../src/common/rangeset.ts"],"names":[],"mappings":"AAmBA,cAAM,QAAQ;IACZ,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;;IAM/B,KAAK;IAIL,SAAS;IAMT,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKnC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,iBAAiB,CAAC,YAAY,EAAE,MAAM;IAQtC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAIxC,aAAa,CAAC,KAAK,EAAE,MAAM;CAG5B;AAED,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,72 @@
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 _ = __importStar(require("lodash"));
23
+ const assert = __importStar(require("assert"));
24
+ function mergeIntervals(intervals) {
25
+ const stack = [[-Infinity, -Infinity]];
26
+ _.sortBy(intervals, (x) => x[0]).forEach((interval) => {
27
+ const lastInterval = stack.pop();
28
+ if (interval[0] <= lastInterval[1] + 1) {
29
+ stack.push([lastInterval[0], Math.max(interval[1], lastInterval[1])]);
30
+ }
31
+ else {
32
+ stack.push(lastInterval);
33
+ stack.push(interval);
34
+ }
35
+ });
36
+ return stack.slice(1);
37
+ }
38
+ class RangeSet {
39
+ constructor() {
40
+ this.reset();
41
+ }
42
+ reset() {
43
+ this.ranges = [];
44
+ }
45
+ serialize() {
46
+ return this.ranges
47
+ .map((range) => range[0].toString() + '-' + range[1].toString())
48
+ .join(',');
49
+ }
50
+ addRange(start, end) {
51
+ assert.ok(start <= end, `invalid range ${start} <= ${end}`);
52
+ this.ranges = mergeIntervals(this.ranges.concat([[start, end]]));
53
+ }
54
+ addValue(value) {
55
+ this.addRange(value, value);
56
+ }
57
+ parseAndAddRanges(rangesString) {
58
+ const rangeStrings = rangesString.split(',');
59
+ rangeStrings.forEach((rangeString) => {
60
+ const range = rangeString.split('-').map(Number);
61
+ this.addRange(range[0], range.length === 1 ? range[0] : range[1]);
62
+ });
63
+ }
64
+ containsRange(start, end) {
65
+ return this.ranges.some((range) => range[0] <= start && range[1] >= end);
66
+ }
67
+ containsValue(value) {
68
+ return this.containsRange(value, value);
69
+ }
70
+ }
71
+ exports.default = RangeSet;
72
+ //# sourceMappingURL=rangeset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rangeset.js","sourceRoot":"","sources":["../../../src/common/rangeset.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAIhC,SAAS,cAAc,CAAC,SAAqB;IAC3C,MAAM,KAAK,GAAe,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAClD,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QACpD,MAAM,YAAY,GAAa,KAAK,CAAC,GAAG,EAAG,CAAA;QAC3C,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;YACtC,KAAK,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,C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nC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAChD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QACnE,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,aAAa,CAAC,KAAa,EAAE,GAAW;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAA;IAC1E,CAAC;IAED,aAAa,CAAC,KAAa;QACzB,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;CACF;AAED,kBAAe,QAAQ,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { isValidSecret } from './utils';
2
+ declare function schemaValidate(schemaName: string, object: any): void;
3
+ declare function isValidAddress(address: string): boolean;
4
+ export { schemaValidate, isValidSecret, isValidAddress };
5
+ //# sourceMappingURL=schema-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-validator.d.ts","sourceRoot":"","sources":["../../../src/common/schema-validator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAA;AAkKrC,iBAAS,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAU7D;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,cAAc,EAAC,CAAA"}
@@ -0,0 +1,190 @@
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
+ exports.isValidAddress = exports.isValidSecret = exports.schemaValidate = void 0;
23
+ const _ = __importStar(require("lodash"));
24
+ const assert = __importStar(require("assert"));
25
+ const { Validator } = require('jsonschema');
26
+ const errors_1 = require("./errors");
27
+ const ripple_address_codec_1 = require("ripple-address-codec");
28
+ const utils_1 = require("./utils");
29
+ Object.defineProperty(exports, "isValidSecret", { enumerable: true, get: function () { return utils_1.isValidSecret; } });
30
+ function loadSchemas() {
31
+ const schemas = [
32
+ require('./schemas/objects/tx-json.json'),
33
+ require('./schemas/objects/transaction-type.json'),
34
+ require('./schemas/objects/hash128.json'),
35
+ require('./schemas/objects/hash256.json'),
36
+ require('./schemas/objects/sequence.json'),
37
+ require('./schemas/objects/ticket-sequence.json'),
38
+ require('./schemas/objects/signature.json'),
39
+ require('./schemas/objects/issue.json'),
40
+ require('./schemas/objects/ledger-version.json'),
41
+ require('./schemas/objects/max-adjustment.json'),
42
+ require('./schemas/objects/memo.json'),
43
+ require('./schemas/objects/memos.json'),
44
+ require('./schemas/objects/public-key.json'),
45
+ require('./schemas/objects/private-key.json'),
46
+ require('./schemas/objects/uint32.json'),
47
+ require('./schemas/objects/value.json'),
48
+ require('./schemas/objects/source-adjustment.json'),
49
+ require('./schemas/objects/destination-adjustment.json'),
50
+ require('./schemas/objects/tag.json'),
51
+ require('./schemas/objects/lax-amount.json'),
52
+ require('./schemas/objects/lax-lax-amount.json'),
53
+ require('./schemas/objects/min-adjustment.json'),
54
+ require('./schemas/objects/source-exact-adjustment.json'),
55
+ require('./schemas/objects/destination-exact-adjustment.json'),
56
+ require('./schemas/objects/destination-address-tag.json'),
57
+ require('./schemas/objects/transaction-hash.json'),
58
+ require('./schemas/objects/address.json'),
59
+ require('./schemas/objects/x-address.json'),
60
+ require('./schemas/objects/classic-address.json'),
61
+ require('./schemas/objects/adjustment.json'),
62
+ require('./schemas/objects/quality.json'),
63
+ require('./schemas/objects/amount.json'),
64
+ require('./schemas/objects/amountbase.json'),
65
+ require('./schemas/objects/balance.json'),
66
+ require('./schemas/objects/blob.json'),
67
+ require('./schemas/objects/currency.json'),
68
+ require('./schemas/objects/signed-value.json'),
69
+ require('./schemas/objects/orderbook.json'),
70
+ require('./schemas/objects/instructions.json'),
71
+ require('./schemas/objects/settings-plus-memos.json'),
72
+ require('./schemas/specifications/settings.json'),
73
+ require('./schemas/specifications/payment.json'),
74
+ require('./schemas/specifications/get-payment.json'),
75
+ require('./schemas/specifications/escrow-cancellation.json'),
76
+ require('./schemas/specifications/order-cancellation.json'),
77
+ require('./schemas/specifications/order.json'),
78
+ require('./schemas/specifications/escrow-execution.json'),
79
+ require('./schemas/specifications/escrow-creation.json'),
80
+ require('./schemas/specifications/payment-channel-create.json'),
81
+ require('./schemas/specifications/payment-channel-fund.json'),
82
+ require('./schemas/specifications/payment-channel-claim.json'),
83
+ require('./schemas/specifications/check-create.json'),
84
+ require('./schemas/specifications/check-cash.json'),
85
+ require('./schemas/specifications/check-cancel.json'),
86
+ require('./schemas/specifications/trustline.json'),
87
+ require('./schemas/specifications/deposit-preauth.json'),
88
+ require('./schemas/specifications/account-delete.json'),
89
+ require('./schemas/output/sign.json'),
90
+ require('./schemas/output/submit.json'),
91
+ require('./schemas/output/get-account-info.json'),
92
+ require('./schemas/output/get-account-objects.json'),
93
+ require('./schemas/output/get-balances.json'),
94
+ require('./schemas/output/get-balance-sheet.json'),
95
+ require('./schemas/output/get-ledger.json'),
96
+ require('./schemas/output/get-orderbook.json'),
97
+ require('./schemas/output/get-orders.json'),
98
+ require('./schemas/output/order-change.json'),
99
+ require('./schemas/output/get-payment-channel.json'),
100
+ require('./schemas/output/prepare.json'),
101
+ require('./schemas/output/ledger-event.json'),
102
+ require('./schemas/output/get-paths.json'),
103
+ require('./schemas/output/get-server-info.json'),
104
+ require('./schemas/output/get-settings.json'),
105
+ require('./schemas/output/orderbook-orders.json'),
106
+ require('./schemas/output/outcome.json'),
107
+ require('./schemas/output/get-transaction.json'),
108
+ require('./schemas/output/get-transactions.json'),
109
+ require('./schemas/output/get-trustlines.json'),
110
+ require('./schemas/output/sign-payment-channel-claim.json'),
111
+ require('./schemas/output/verify-payment-channel-claim.json'),
112
+ require('./schemas/input/get-balances.json'),
113
+ require('./schemas/input/get-balance-sheet.json'),
114
+ require('./schemas/input/get-ledger.json'),
115
+ require('./schemas/input/get-orders.json'),
116
+ require('./schemas/input/get-orderbook.json'),
117
+ require('./schemas/input/get-paths.json'),
118
+ require('./schemas/input/get-payment-channel.json'),
119
+ require('./schemas/input/api-options.json'),
120
+ require('./schemas/input/get-settings.json'),
121
+ require('./schemas/input/get-account-info.json'),
122
+ require('./schemas/input/get-account-objects.json'),
123
+ require('./schemas/input/get-transaction.json'),
124
+ require('./schemas/input/get-transactions.json'),
125
+ require('./schemas/input/get-trustlines.json'),
126
+ require('./schemas/input/prepare-payment.json'),
127
+ require('./schemas/input/prepare-order.json'),
128
+ require('./schemas/input/prepare-trustline.json'),
129
+ require('./schemas/input/prepare-order-cancellation.json'),
130
+ require('./schemas/input/prepare-settings.json'),
131
+ require('./schemas/input/prepare-escrow-creation.json'),
132
+ require('./schemas/input/prepare-escrow-cancellation.json'),
133
+ require('./schemas/input/prepare-escrow-execution.json'),
134
+ require('./schemas/input/prepare-payment-channel-create.json'),
135
+ require('./schemas/input/prepare-payment-channel-fund.json'),
136
+ require('./schemas/input/prepare-payment-channel-claim.json'),
137
+ require('./schemas/input/prepare-check-create.json'),
138
+ require('./schemas/input/prepare-check-cash.json'),
139
+ require('./schemas/input/prepare-check-cancel.json'),
140
+ require('./schemas/input/prepare-ticket-create.json'),
141
+ require('./schemas/input/compute-ledger-hash.json'),
142
+ require('./schemas/input/sign.json'),
143
+ require('./schemas/input/submit.json'),
144
+ require('./schemas/input/generate-address.json'),
145
+ require('./schemas/input/sign-payment-channel-claim.json'),
146
+ require('./schemas/input/verify-payment-channel-claim.json'),
147
+ require('./schemas/input/combine.json')
148
+ ];
149
+ const titles = schemas.map((schema) => schema.title);
150
+ const duplicates = Object.keys(_.pickBy(_.countBy(titles), (count) => count > 1));
151
+ assert.ok(duplicates.length === 0, 'Duplicate schemas for: ' + duplicates);
152
+ const validator = new Validator();
153
+ validator.customFormats.xAddress = function (instance) {
154
+ if (instance == null) {
155
+ return true;
156
+ }
157
+ return ripple_address_codec_1.isValidXAddress(instance);
158
+ };
159
+ validator.customFormats.classicAddress = function (instance) {
160
+ if (instance == null) {
161
+ return true;
162
+ }
163
+ return isValidAddress(instance);
164
+ };
165
+ validator.customFormats.secret = function (instance) {
166
+ if (instance == null) {
167
+ return true;
168
+ }
169
+ return utils_1.isValidSecret(instance);
170
+ };
171
+ schemas.forEach((schema) => validator.addSchema(schema, '/' + schema.title));
172
+ return validator;
173
+ }
174
+ const schemaValidator = loadSchemas();
175
+ function schemaValidate(schemaName, object) {
176
+ const schema = schemaValidator.getSchema('/' + schemaName);
177
+ if (schema == null) {
178
+ throw new errors_1.ValidationError('no schema for ' + schemaName);
179
+ }
180
+ const result = schemaValidator.validate(object, schema);
181
+ if (!result.valid) {
182
+ throw new errors_1.ValidationError(result.errors.join());
183
+ }
184
+ }
185
+ exports.schemaValidate = schemaValidate;
186
+ function isValidAddress(address) {
187
+ return ripple_address_codec_1.isValidXAddress(address) || ripple_address_codec_1.isValidClassicAddress(address);
188
+ }
189
+ exports.isValidAddress = isValidAddress;
190
+ //# sourceMappingURL=schema-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-validator.js","sourceRoot":"","sources":["../../../src/common/schema-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAChC,MAAM,EAAC,SAAS,EAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACzC,qCAAwC;AACxC,+DAA2E;AAC3E,mCAAqC;AAkLb,8FAlLhB,qBAAa,OAkLgB;AAhLrC,SAAS,WAAW;IAElB,MAAM,OAAO,GAAG;QACd,OAAO,CAAC,gCAAgC,CAAC;QACzC,OAAO,CAAC,yCAAyC,CAAC;QAClD,OAAO,CAAC,gCAAgC,CAAC;QACzC,OAAO,CAAC,gCAAgC,CAAC;QACzC,OAAO,CAAC,iCAAiC,CAAC;QAC1C,OAAO,CAAC,wCAAwC,CAAC;QACjD,OAAO,CAAC,kCAAkC,CAAC;QAC3C,OAAO,CAAC,8BAA8B,CAAC;QACvC,OAAO,CAAC,uCAAuC,CAAC;QAChD,OAAO,CAAC,uCAAuC,CAAC;QAChD,OAAO,CAAC,6BAA6B,CAAC;QACtC,OAAO,CAAC,8BAA8B,CAAC;QACvC,OAAO,CAAC,mCAAmC,CAAC;QAC5C,OAAO,CAAC,oCAAoC,CAAC;QAC7C,OAAO,CAAC,+BAA+B,CAAC;QACxC,OAAO,CAAC,8BAA8B,CAAC;QACvC,OAAO,CAAC,0CAA0C,CAAC;QACnD,OAAO,CAAC,+CAA+C,CAAC;QACxD,OAAO,CAAC,4BAA4B,CAAC;QACrC,OAAO,CAAC,mCAAmC,CAAC;QAC5C,OAAO,CAAC,uCAAuC,CAAC;QAChD,OAAO,CAAC,uCAAuC,CAAC;QAChD,OAAO,CAA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
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "api-options",
4
+ "type": "object",
5
+ "properties": {
6
+ "trace": {
7
+ "type": "boolean",
8
+ "description": "If true, log rippled requests and responses to stdout."
9
+ },
10
+ "feeCushion": {
11
+ "type": "number",
12
+ "minimum": 1,
13
+ "description": "Factor to multiply estimated fee by to provide a cushion in case the required fee rises during submission of a transaction. Defaults to `1.2`."
14
+ },
15
+ "maxFeeXRP": {
16
+ "type": "string",
17
+ "description": "Maximum fee to use with transactions, in XRP. Must be a string-encoded number. Defaults to `'2'`."
18
+ },
19
+ "server": {
20
+ "type": "string",
21
+ "description": "URI for rippled websocket port to connect to. Must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.",
22
+ "format": "uri",
23
+ "pattern": "^(wss?|wss?\\+unix)://"
24
+ },
25
+ "proxy": {
26
+ "format": "uri",
27
+ "description": "URI for HTTP/HTTPS proxy to use to connect to the rippled server."
28
+ },
29
+ "timeout": {
30
+ "type": "integer",
31
+ "description": "Request timeout in milliseconds before considering a request to have failed. See also: connectionTimeout.",
32
+ "minimum": 1
33
+ },
34
+ "connectionTimeout": {
35
+ "type": "integer",
36
+ "description": "Connection timeout, in milliseconds, before considering connect() to have failed.",
37
+ "minimum": 1
38
+ },
39
+ "proxyAuthorization": {
40
+ "type": "string",
41
+ "description": "Username and password for HTTP basic authentication to the proxy in the format **username:password**."
42
+ },
43
+ "authorization": {
44
+ "type": "string",
45
+ "description": "Username and password for HTTP basic authentication to the rippled server in the format **username:password**."
46
+ },
47
+ "trustedCertificates": {
48
+ "type": "array",
49
+ "description": "Array of PEM-formatted SSL certificates to trust when connecting to a proxy. This is useful if you want to use a self-signed certificate on the proxy server. Note: Each element must contain a single certificate; concatenated certificates are not valid.",
50
+ "items": {
51
+ "type": "string",
52
+ "description": "A PEM-formatted SSL certificate to trust when connecting to a proxy."
53
+ }
54
+ },
55
+ "key": {
56
+ "type": "string",
57
+ "description": "A string containing the private key of the client in PEM format. (Can be an array of keys)."
58
+ },
59
+ "passphrase": {
60
+ "type": "string",
61
+ "description": "The passphrase for the private key of the client."
62
+ },
63
+ "certificate": {
64
+ "type": "string",
65
+ "description": "A string containing the certificate key of the client in PEM format. (Can be an array of certificates)."
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "combineParameters",
4
+ "type": "object",
5
+ "properties": {
6
+ "signedTransactions": {
7
+ "type": "array",
8
+ "description": "An array of signed transactions (from the output of [sign](#sign)) to combine.",
9
+ "items": {
10
+ "type": "string",
11
+ "pattern": "^[A-F0-9]+$",
12
+ "description": "A single-signed transaction represented as an uppercase hexadecimal string (from the output of [sign](#sign))"
13
+ },
14
+ "minLength": 1
15
+ }
16
+ },
17
+ "additionalProperties": false,
18
+ "required": ["signedTransactions"]
19
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "computeLedgerHashParameters",
4
+ "type": "object",
5
+ "properties": {
6
+ "ledger": {
7
+ "$ref": "getLedger",
8
+ "description": "The ledger header to hash."
9
+ }
10
+ },
11
+ "additionalProperties": false,
12
+ "required": ["ledger"]
13
+ }