xrpl 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/build/xrpl-latest-min.js +1 -1
  2. package/build/xrpl-latest-min.js.map +1 -1
  3. package/build/xrpl-latest.js +728 -28
  4. package/build/xrpl-latest.js.map +1 -1
  5. package/dist/npm/Wallet/walletFromSecretNumbers.d.ts +7 -0
  6. package/dist/npm/Wallet/walletFromSecretNumbers.d.ts.map +1 -0
  7. package/dist/npm/Wallet/walletFromSecretNumbers.js +27 -0
  8. package/dist/npm/Wallet/walletFromSecretNumbers.js.map +1 -0
  9. package/dist/npm/client/index.d.ts +2 -1
  10. package/dist/npm/client/index.d.ts.map +1 -1
  11. package/dist/npm/client/index.js.map +1 -1
  12. package/dist/npm/index.d.ts +1 -0
  13. package/dist/npm/index.d.ts.map +1 -1
  14. package/dist/npm/index.js +3 -1
  15. package/dist/npm/index.js.map +1 -1
  16. package/dist/npm/models/common/index.d.ts +5 -0
  17. package/dist/npm/models/common/index.d.ts.map +1 -1
  18. package/dist/npm/models/ledger/AMM.d.ts +27 -0
  19. package/dist/npm/models/ledger/AMM.d.ts.map +1 -0
  20. package/dist/npm/models/ledger/AMM.js +3 -0
  21. package/dist/npm/models/ledger/AMM.js.map +1 -0
  22. package/dist/npm/models/ledger/AccountRoot.d.ts +2 -0
  23. package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
  24. package/dist/npm/models/ledger/AccountRoot.js +1 -0
  25. package/dist/npm/models/ledger/AccountRoot.js.map +1 -1
  26. package/dist/npm/models/ledger/LedgerEntry.d.ts +2 -1
  27. package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
  28. package/dist/npm/models/methods/ammInfo.d.ts +39 -0
  29. package/dist/npm/models/methods/ammInfo.d.ts.map +1 -0
  30. package/dist/npm/models/methods/ammInfo.js +3 -0
  31. package/dist/npm/models/methods/ammInfo.js.map +1 -0
  32. package/dist/npm/models/methods/index.d.ts +4 -3
  33. package/dist/npm/models/methods/index.d.ts.map +1 -1
  34. package/dist/npm/models/methods/ledgerEntry.d.ts +10 -0
  35. package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
  36. package/dist/npm/models/transactions/AMMBid.d.ts +12 -0
  37. package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -0
  38. package/dist/npm/models/transactions/AMMBid.js +56 -0
  39. package/dist/npm/models/transactions/AMMBid.js.map +1 -0
  40. package/dist/npm/models/transactions/AMMCreate.d.ts +11 -0
  41. package/dist/npm/models/transactions/AMMCreate.d.ts.map +1 -0
  42. package/dist/npm/models/transactions/AMMCreate.js +32 -0
  43. package/dist/npm/models/transactions/AMMCreate.js.map +1 -0
  44. package/dist/npm/models/transactions/AMMDelete.d.ts +9 -0
  45. package/dist/npm/models/transactions/AMMDelete.d.ts.map +1 -0
  46. package/dist/npm/models/transactions/AMMDelete.js +22 -0
  47. package/dist/npm/models/transactions/AMMDelete.js.map +1 -0
  48. package/dist/npm/models/transactions/AMMDeposit.d.ts +27 -0
  49. package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -0
  50. package/dist/npm/models/transactions/AMMDeposit.js +51 -0
  51. package/dist/npm/models/transactions/AMMDeposit.js.map +1 -0
  52. package/dist/npm/models/transactions/AMMVote.d.ts +10 -0
  53. package/dist/npm/models/transactions/AMMVote.d.ts.map +1 -0
  54. package/dist/npm/models/transactions/AMMVote.js +32 -0
  55. package/dist/npm/models/transactions/AMMVote.js.map +1 -0
  56. package/dist/npm/models/transactions/AMMWithdraw.d.ts +31 -0
  57. package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -0
  58. package/dist/npm/models/transactions/AMMWithdraw.js +50 -0
  59. package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -0
  60. package/dist/npm/models/transactions/common.d.ts +2 -1
  61. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  62. package/dist/npm/models/transactions/common.js +12 -1
  63. package/dist/npm/models/transactions/common.js.map +1 -1
  64. package/dist/npm/models/transactions/index.d.ts +6 -0
  65. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  66. package/dist/npm/models/transactions/index.js +5 -1
  67. package/dist/npm/models/transactions/index.js.map +1 -1
  68. package/dist/npm/models/transactions/transaction.d.ts +7 -1
  69. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  70. package/dist/npm/models/transactions/transaction.js +24 -0
  71. package/dist/npm/models/transactions/transaction.js.map +1 -1
  72. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  73. package/dist/npm/models/utils/flags.js +14 -21
  74. package/dist/npm/models/utils/flags.js.map +1 -1
  75. package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
  76. package/dist/npm/src/Wallet/walletFromSecretNumbers.d.ts +7 -0
  77. package/dist/npm/src/Wallet/walletFromSecretNumbers.d.ts.map +1 -0
  78. package/dist/npm/src/Wallet/walletFromSecretNumbers.js +27 -0
  79. package/dist/npm/src/Wallet/walletFromSecretNumbers.js.map +1 -0
  80. package/dist/npm/src/client/index.d.ts +2 -1
  81. package/dist/npm/src/client/index.d.ts.map +1 -1
  82. package/dist/npm/src/client/index.js.map +1 -1
  83. package/dist/npm/src/index.d.ts +1 -0
  84. package/dist/npm/src/index.d.ts.map +1 -1
  85. package/dist/npm/src/index.js +3 -1
  86. package/dist/npm/src/index.js.map +1 -1
  87. package/dist/npm/src/models/common/index.d.ts +5 -0
  88. package/dist/npm/src/models/common/index.d.ts.map +1 -1
  89. package/dist/npm/src/models/ledger/AMM.d.ts +27 -0
  90. package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -0
  91. package/dist/npm/src/models/ledger/AMM.js +3 -0
  92. package/dist/npm/src/models/ledger/AMM.js.map +1 -0
  93. package/dist/npm/src/models/ledger/AccountRoot.d.ts +2 -0
  94. package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
  95. package/dist/npm/src/models/ledger/AccountRoot.js +1 -0
  96. package/dist/npm/src/models/ledger/AccountRoot.js.map +1 -1
  97. package/dist/npm/src/models/ledger/LedgerEntry.d.ts +2 -1
  98. package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
  99. package/dist/npm/src/models/methods/ammInfo.d.ts +39 -0
  100. package/dist/npm/src/models/methods/ammInfo.d.ts.map +1 -0
  101. package/dist/npm/src/models/methods/ammInfo.js +3 -0
  102. package/dist/npm/src/models/methods/ammInfo.js.map +1 -0
  103. package/dist/npm/src/models/methods/index.d.ts +4 -3
  104. package/dist/npm/src/models/methods/index.d.ts.map +1 -1
  105. package/dist/npm/src/models/methods/ledgerEntry.d.ts +10 -0
  106. package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
  107. package/dist/npm/src/models/transactions/AMMBid.d.ts +12 -0
  108. package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -0
  109. package/dist/npm/src/models/transactions/AMMBid.js +56 -0
  110. package/dist/npm/src/models/transactions/AMMBid.js.map +1 -0
  111. package/dist/npm/src/models/transactions/AMMCreate.d.ts +11 -0
  112. package/dist/npm/src/models/transactions/AMMCreate.d.ts.map +1 -0
  113. package/dist/npm/src/models/transactions/AMMCreate.js +32 -0
  114. package/dist/npm/src/models/transactions/AMMCreate.js.map +1 -0
  115. package/dist/npm/src/models/transactions/AMMDelete.d.ts +9 -0
  116. package/dist/npm/src/models/transactions/AMMDelete.d.ts.map +1 -0
  117. package/dist/npm/src/models/transactions/AMMDelete.js +22 -0
  118. package/dist/npm/src/models/transactions/AMMDelete.js.map +1 -0
  119. package/dist/npm/src/models/transactions/AMMDeposit.d.ts +27 -0
  120. package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -0
  121. package/dist/npm/src/models/transactions/AMMDeposit.js +51 -0
  122. package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -0
  123. package/dist/npm/src/models/transactions/AMMVote.d.ts +10 -0
  124. package/dist/npm/src/models/transactions/AMMVote.d.ts.map +1 -0
  125. package/dist/npm/src/models/transactions/AMMVote.js +32 -0
  126. package/dist/npm/src/models/transactions/AMMVote.js.map +1 -0
  127. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts +31 -0
  128. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -0
  129. package/dist/npm/src/models/transactions/AMMWithdraw.js +50 -0
  130. package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -0
  131. package/dist/npm/src/models/transactions/common.d.ts +2 -1
  132. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  133. package/dist/npm/src/models/transactions/common.js +12 -1
  134. package/dist/npm/src/models/transactions/common.js.map +1 -1
  135. package/dist/npm/src/models/transactions/index.d.ts +6 -0
  136. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  137. package/dist/npm/src/models/transactions/index.js +5 -1
  138. package/dist/npm/src/models/transactions/index.js.map +1 -1
  139. package/dist/npm/src/models/transactions/transaction.d.ts +7 -1
  140. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  141. package/dist/npm/src/models/transactions/transaction.js +24 -0
  142. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  143. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  144. package/dist/npm/src/models/utils/flags.js +14 -21
  145. package/dist/npm/src/models/utils/flags.js.map +1 -1
  146. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  147. package/dist/npm/src/sugar/autofill.js +4 -3
  148. package/dist/npm/src/sugar/autofill.js.map +1 -1
  149. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  150. package/dist/npm/sugar/autofill.js +4 -3
  151. package/dist/npm/sugar/autofill.js.map +1 -1
  152. package/package.json +8 -6
  153. package/src/ECDSA.ts +6 -0
  154. package/src/Wallet/defaultFaucets.ts +82 -0
  155. package/src/Wallet/fundWallet.ts +344 -0
  156. package/src/Wallet/index.ts +504 -0
  157. package/src/Wallet/rfc1751.ts +190 -0
  158. package/src/Wallet/rfc1751Words.json +243 -0
  159. package/src/Wallet/signer.ts +173 -0
  160. package/src/Wallet/walletFromSecretNumbers.ts +37 -0
  161. package/src/client/BroadcastClient.ts +84 -0
  162. package/src/client/ConnectionManager.ts +40 -0
  163. package/src/client/ExponentialBackoff.ts +71 -0
  164. package/src/client/RequestManager.ts +194 -0
  165. package/src/client/WSWrapper.ts +106 -0
  166. package/src/client/connection.ts +593 -0
  167. package/src/client/index.ts +712 -0
  168. package/src/client/partialPayment.ts +153 -0
  169. package/src/errors.ts +161 -0
  170. package/src/index.ts +20 -0
  171. package/src/models/common/index.ts +149 -0
  172. package/src/models/index.ts +16 -0
  173. package/src/models/ledger/AMM.ts +78 -0
  174. package/src/models/ledger/AccountRoot.ts +217 -0
  175. package/src/models/ledger/Amendments.ts +45 -0
  176. package/src/models/ledger/BaseLedgerEntry.ts +3 -0
  177. package/src/models/ledger/Check.ts +70 -0
  178. package/src/models/ledger/DepositPreauth.ts +35 -0
  179. package/src/models/ledger/DirectoryNode.ts +46 -0
  180. package/src/models/ledger/Escrow.ts +74 -0
  181. package/src/models/ledger/FeeSettings.ts +52 -0
  182. package/src/models/ledger/Ledger.ts +65 -0
  183. package/src/models/ledger/LedgerEntry.ts +34 -0
  184. package/src/models/ledger/LedgerHashes.ts +24 -0
  185. package/src/models/ledger/NFTokenOffer.ts +16 -0
  186. package/src/models/ledger/NFTokenPage.ts +20 -0
  187. package/src/models/ledger/NegativeUNL.ts +34 -0
  188. package/src/models/ledger/Offer.ts +52 -0
  189. package/src/models/ledger/PayChannel.ts +107 -0
  190. package/src/models/ledger/RippleState.ts +88 -0
  191. package/src/models/ledger/SignerList.ts +56 -0
  192. package/src/models/ledger/Ticket.ts +36 -0
  193. package/src/models/ledger/index.ts +58 -0
  194. package/src/models/methods/accountChannels.ts +93 -0
  195. package/src/models/methods/accountCurrencies.ts +45 -0
  196. package/src/models/methods/accountInfo.ts +182 -0
  197. package/src/models/methods/accountLines.ts +137 -0
  198. package/src/models/methods/accountNFTs.ts +72 -0
  199. package/src/models/methods/accountObjects.ts +120 -0
  200. package/src/models/methods/accountOffers.ts +100 -0
  201. package/src/models/methods/accountTx.ts +109 -0
  202. package/src/models/methods/ammInfo.ts +145 -0
  203. package/src/models/methods/baseMethod.ts +58 -0
  204. package/src/models/methods/bookOffers.ts +96 -0
  205. package/src/models/methods/channelVerify.ts +41 -0
  206. package/src/models/methods/depositAuthorized.ts +56 -0
  207. package/src/models/methods/fee.ts +91 -0
  208. package/src/models/methods/gatewayBalances.ts +85 -0
  209. package/src/models/methods/index.ts +391 -0
  210. package/src/models/methods/ledger.ts +125 -0
  211. package/src/models/methods/ledgerClosed.ts +32 -0
  212. package/src/models/methods/ledgerCurrent.ts +31 -0
  213. package/src/models/methods/ledgerData.ts +78 -0
  214. package/src/models/methods/ledgerEntry.ts +177 -0
  215. package/src/models/methods/manifest.ts +54 -0
  216. package/src/models/methods/nftBuyOffers.ts +37 -0
  217. package/src/models/methods/nftHistory.ts +113 -0
  218. package/src/models/methods/nftInfo.ts +25 -0
  219. package/src/models/methods/nftSellOffers.ts +37 -0
  220. package/src/models/methods/norippleCheck.ts +82 -0
  221. package/src/models/methods/pathFind.ts +116 -0
  222. package/src/models/methods/ping.ts +21 -0
  223. package/src/models/methods/random.ts +23 -0
  224. package/src/models/methods/ripplePathFind.ts +81 -0
  225. package/src/models/methods/serverInfo.ts +257 -0
  226. package/src/models/methods/serverState.ts +77 -0
  227. package/src/models/methods/submit.ts +94 -0
  228. package/src/models/methods/submitMultisigned.ts +51 -0
  229. package/src/models/methods/subscribe.ts +435 -0
  230. package/src/models/methods/transactionEntry.ts +47 -0
  231. package/src/models/methods/tx.ts +69 -0
  232. package/src/models/methods/unsubscribe.ts +49 -0
  233. package/src/models/transactions/AMMBid.ts +140 -0
  234. package/src/models/transactions/AMMCreate.ts +80 -0
  235. package/src/models/transactions/AMMDelete.ts +55 -0
  236. package/src/models/transactions/AMMDeposit.ts +130 -0
  237. package/src/models/transactions/AMMVote.ts +71 -0
  238. package/src/models/transactions/AMMWithdraw.ts +126 -0
  239. package/src/models/transactions/NFTokenAcceptOffer.ts +104 -0
  240. package/src/models/transactions/NFTokenBurn.ts +48 -0
  241. package/src/models/transactions/NFTokenCancelOffer.ts +45 -0
  242. package/src/models/transactions/NFTokenCreateOffer.ts +145 -0
  243. package/src/models/transactions/NFTokenMint.ts +123 -0
  244. package/src/models/transactions/UNLModify.ts +20 -0
  245. package/src/models/transactions/accountDelete.ts +50 -0
  246. package/src/models/transactions/accountSet.ts +228 -0
  247. package/src/models/transactions/checkCancel.ts +34 -0
  248. package/src/models/transactions/checkCash.ts +73 -0
  249. package/src/models/transactions/checkCreate.ts +90 -0
  250. package/src/models/transactions/clawback.ts +49 -0
  251. package/src/models/transactions/common.ts +295 -0
  252. package/src/models/transactions/depositPreauth.ts +68 -0
  253. package/src/models/transactions/enableAmendment.ts +26 -0
  254. package/src/models/transactions/escrowCancel.ts +45 -0
  255. package/src/models/transactions/escrowCreate.ts +100 -0
  256. package/src/models/transactions/escrowFinish.ts +63 -0
  257. package/src/models/transactions/index.ts +66 -0
  258. package/src/models/transactions/metadata.ts +69 -0
  259. package/src/models/transactions/offerCancel.ts +37 -0
  260. package/src/models/transactions/offerCreate.ts +144 -0
  261. package/src/models/transactions/payment.ts +278 -0
  262. package/src/models/transactions/paymentChannelClaim.ts +165 -0
  263. package/src/models/transactions/paymentChannelCreate.ts +116 -0
  264. package/src/models/transactions/paymentChannelFund.ts +65 -0
  265. package/src/models/transactions/setFee.ts +48 -0
  266. package/src/models/transactions/setRegularKey.ts +33 -0
  267. package/src/models/transactions/signerListSet.ts +89 -0
  268. package/src/models/transactions/ticketCreate.ts +50 -0
  269. package/src/models/transactions/transaction.ts +303 -0
  270. package/src/models/transactions/trustSet.ts +146 -0
  271. package/src/models/utils/flags.ts +98 -0
  272. package/src/models/utils/index.ts +37 -0
  273. package/src/sugar/autofill.ts +373 -0
  274. package/src/sugar/balances.ts +123 -0
  275. package/src/sugar/getFeeXrp.ts +45 -0
  276. package/src/sugar/getLedgerIndex.ts +15 -0
  277. package/src/sugar/getOrderbook.ts +152 -0
  278. package/src/sugar/index.ts +11 -0
  279. package/src/sugar/submit.ts +305 -0
  280. package/src/sugar/utils.ts +29 -0
  281. package/src/utils/derive.ts +23 -0
  282. package/src/utils/getBalanceChanges.ts +186 -0
  283. package/src/utils/getNFTokenID.ts +97 -0
  284. package/src/utils/hashes/HashPrefix.ts +40 -0
  285. package/src/utils/hashes/README.md +65 -0
  286. package/src/utils/hashes/SHAMap/InnerNode.ts +124 -0
  287. package/src/utils/hashes/SHAMap/LeafNode.ts +69 -0
  288. package/src/utils/hashes/SHAMap/index.ts +41 -0
  289. package/src/utils/hashes/SHAMap/node.ts +14 -0
  290. package/src/utils/hashes/hashLedger.ts +236 -0
  291. package/src/utils/hashes/index.ts +187 -0
  292. package/src/utils/hashes/ledgerSpaces.ts +34 -0
  293. package/src/utils/hashes/sha512Half.ts +19 -0
  294. package/src/utils/index.ts +223 -0
  295. package/src/utils/parseNFTokenID.ts +84 -0
  296. package/src/utils/quality.ts +169 -0
  297. package/src/utils/signPaymentChannelClaim.ts +27 -0
  298. package/src/utils/stringConversion.ts +27 -0
  299. package/src/utils/timeConversion.ts +53 -0
  300. package/src/utils/verifyPaymentChannelClaim.ts +30 -0
  301. package/src/utils/xrpConversion.ts +104 -0
@@ -0,0 +1,391 @@
1
+ /* eslint-disable max-lines -- There is a lot to export */
2
+ import {
3
+ AccountChannelsRequest,
4
+ AccountChannelsResponse,
5
+ Channel,
6
+ } from './accountChannels'
7
+ import {
8
+ AccountCurrenciesRequest,
9
+ AccountCurrenciesResponse,
10
+ } from './accountCurrencies'
11
+ import {
12
+ AccountInfoAccountFlags,
13
+ AccountInfoRequest,
14
+ AccountInfoResponse,
15
+ AccountQueueData,
16
+ AccountQueueTransaction,
17
+ } from './accountInfo'
18
+ import {
19
+ AccountLinesRequest,
20
+ AccountLinesResponse,
21
+ AccountLinesTrustline,
22
+ } from './accountLines'
23
+ import {
24
+ AccountNFToken,
25
+ AccountNFTsRequest,
26
+ AccountNFTsResponse,
27
+ } from './accountNFTs'
28
+ import {
29
+ AccountObject,
30
+ AccountObjectsRequest,
31
+ AccountObjectsResponse,
32
+ AccountObjectType,
33
+ } from './accountObjects'
34
+ import {
35
+ AccountOffer,
36
+ AccountOffersRequest,
37
+ AccountOffersResponse,
38
+ } from './accountOffers'
39
+ import {
40
+ AccountTxRequest,
41
+ AccountTxResponse,
42
+ AccountTxTransaction,
43
+ } from './accountTx'
44
+ import { AMMInfoRequest, AMMInfoResponse } from './ammInfo'
45
+ import {
46
+ BaseRequest,
47
+ BaseResponse,
48
+ ErrorResponse,
49
+ ResponseWarning,
50
+ } from './baseMethod'
51
+ import {
52
+ BookOffersRequest,
53
+ BookOffer,
54
+ BookOffersResponse,
55
+ BookOfferCurrency,
56
+ } from './bookOffers'
57
+ import { ChannelVerifyRequest, ChannelVerifyResponse } from './channelVerify'
58
+ import {
59
+ DepositAuthorizedRequest,
60
+ DepositAuthorizedResponse,
61
+ } from './depositAuthorized'
62
+ import { FeeRequest, FeeResponse } from './fee'
63
+ import {
64
+ GatewayBalance,
65
+ GatewayBalancesRequest,
66
+ GatewayBalancesResponse,
67
+ } from './gatewayBalances'
68
+ import {
69
+ LedgerBinary,
70
+ LedgerModifiedOfferCreateTransaction,
71
+ LedgerQueueData,
72
+ LedgerRequest,
73
+ LedgerResponse,
74
+ } from './ledger'
75
+ import { LedgerClosedRequest, LedgerClosedResponse } from './ledgerClosed'
76
+ import { LedgerCurrentRequest, LedgerCurrentResponse } from './ledgerCurrent'
77
+ import {
78
+ LedgerDataBinaryLedgerEntry,
79
+ LedgerDataLabeledLedgerEntry,
80
+ LedgerDataLedgerState,
81
+ LedgerDataRequest,
82
+ LedgerDataResponse,
83
+ } from './ledgerData'
84
+ import { LedgerEntryRequest, LedgerEntryResponse } from './ledgerEntry'
85
+ import { ManifestRequest, ManifestResponse } from './manifest'
86
+ import { NFTBuyOffersRequest, NFTBuyOffersResponse } from './nftBuyOffers'
87
+ import {
88
+ NFTHistoryRequest,
89
+ NFTHistoryResponse,
90
+ NFTHistoryTransaction,
91
+ } from './nftHistory'
92
+ import { NFTInfoRequest, NFTInfoResponse } from './nftInfo'
93
+ import { NFTSellOffersRequest, NFTSellOffersResponse } from './nftSellOffers'
94
+ import { NoRippleCheckRequest, NoRippleCheckResponse } from './norippleCheck'
95
+ import {
96
+ PathFindRequest,
97
+ PathFindCloseRequest,
98
+ PathFindCreateRequest,
99
+ PathFindStatusRequest,
100
+ PathFindResponse,
101
+ PathFindPathOption,
102
+ } from './pathFind'
103
+ import { PingRequest, PingResponse } from './ping'
104
+ import { RandomRequest, RandomResponse } from './random'
105
+ import {
106
+ RipplePathFindPathOption,
107
+ RipplePathFindRequest,
108
+ RipplePathFindResponse,
109
+ SourceCurrencyAmount,
110
+ } from './ripplePathFind'
111
+ import {
112
+ JobType,
113
+ ServerInfoRequest,
114
+ ServerInfoResponse,
115
+ ServerState,
116
+ StateAccounting,
117
+ StateAccountingFinal,
118
+ } from './serverInfo'
119
+ import { ServerStateRequest, ServerStateResponse } from './serverState'
120
+ import { SubmitRequest, SubmitResponse } from './submit'
121
+ import {
122
+ SubmitMultisignedRequest,
123
+ SubmitMultisignedResponse,
124
+ } from './submitMultisigned'
125
+ import {
126
+ BooksSnapshot,
127
+ ConsensusStream,
128
+ LedgerStream,
129
+ LedgerStreamResponse,
130
+ OrderBookStream,
131
+ PathFindStream,
132
+ PeerStatusStream,
133
+ Stream,
134
+ SubscribeBook,
135
+ SubscribeRequest,
136
+ SubscribeResponse,
137
+ TransactionStream,
138
+ ValidationStream,
139
+ } from './subscribe'
140
+ import {
141
+ TransactionEntryRequest,
142
+ TransactionEntryResponse,
143
+ } from './transactionEntry'
144
+ import { TxRequest, TxResponse } from './tx'
145
+ import {
146
+ UnsubscribeBook,
147
+ UnsubscribeRequest,
148
+ UnsubscribeResponse,
149
+ } from './unsubscribe'
150
+ /**
151
+ * @category Requests
152
+ */
153
+ type Request =
154
+ // account methods
155
+ | AccountChannelsRequest
156
+ | AccountCurrenciesRequest
157
+ | AccountInfoRequest
158
+ | AccountLinesRequest
159
+ | AccountNFTsRequest
160
+ | AccountObjectsRequest
161
+ | AccountOffersRequest
162
+ | AccountTxRequest
163
+ | GatewayBalancesRequest
164
+ | NoRippleCheckRequest
165
+ // ledger methods
166
+ | LedgerRequest
167
+ | LedgerClosedRequest
168
+ | LedgerCurrentRequest
169
+ | LedgerDataRequest
170
+ | LedgerEntryRequest
171
+ // transaction methods
172
+ | SubmitRequest
173
+ | SubmitMultisignedRequest
174
+ | TransactionEntryRequest
175
+ | TxRequest
176
+ // path and order book methods
177
+ | BookOffersRequest
178
+ | DepositAuthorizedRequest
179
+ | PathFindRequest
180
+ | RipplePathFindRequest
181
+ // payment channel methods
182
+ | ChannelVerifyRequest
183
+ // subscription methods
184
+ | SubscribeRequest
185
+ | UnsubscribeRequest
186
+ // server info methods
187
+ | FeeRequest
188
+ | ManifestRequest
189
+ | ServerInfoRequest
190
+ | ServerStateRequest
191
+ // utility methods
192
+ | PingRequest
193
+ | RandomRequest
194
+ // NFT methods
195
+ | NFTBuyOffersRequest
196
+ | NFTSellOffersRequest
197
+ // clio only methods
198
+ | NFTInfoRequest
199
+ | NFTHistoryRequest
200
+ // AMM methods
201
+ | AMMInfoRequest
202
+
203
+ /**
204
+ * @category Responses
205
+ */
206
+ type Response =
207
+ // account methods
208
+ | AccountChannelsResponse
209
+ | AccountCurrenciesResponse
210
+ | AccountInfoResponse
211
+ | AccountLinesResponse
212
+ | AccountNFTsResponse
213
+ | AccountObjectsResponse
214
+ | AccountOffersResponse
215
+ | AccountTxResponse
216
+ | GatewayBalancesResponse
217
+ | NoRippleCheckResponse
218
+ // ledger methods
219
+ | LedgerResponse
220
+ | LedgerClosedResponse
221
+ | LedgerCurrentResponse
222
+ | LedgerDataResponse
223
+ | LedgerEntryResponse
224
+ // transaction methods
225
+ | SubmitResponse
226
+ | SubmitMultisignedResponse
227
+ | TransactionEntryResponse
228
+ | TxResponse
229
+ // path and order book methods
230
+ | BookOffersResponse
231
+ | DepositAuthorizedResponse
232
+ | PathFindResponse
233
+ | RipplePathFindResponse
234
+ // payment channel methods
235
+ | ChannelVerifyResponse
236
+ // subscription methods
237
+ | SubscribeResponse
238
+ | UnsubscribeResponse
239
+ // server info methods
240
+ | FeeResponse
241
+ | ManifestResponse
242
+ | ServerInfoResponse
243
+ | ServerStateResponse
244
+ // utility methods
245
+ | PingResponse
246
+ | RandomResponse
247
+ // NFT methods
248
+ | NFTBuyOffersResponse
249
+ | NFTSellOffersResponse
250
+ // clio only methods
251
+ | NFTInfoResponse
252
+ | NFTHistoryResponse
253
+ // AMM methods
254
+ | AMMInfoResponse
255
+
256
+ export {
257
+ // Allow users to define their own requests and responses. This is useful for releasing experimental versions
258
+ BaseRequest,
259
+ BaseResponse,
260
+ Request,
261
+ Response,
262
+ ResponseWarning,
263
+ // account methods with types
264
+ Channel,
265
+ AccountChannelsRequest,
266
+ AccountChannelsResponse,
267
+ AccountCurrenciesRequest,
268
+ AccountCurrenciesResponse,
269
+ AccountInfoAccountFlags,
270
+ AccountInfoRequest,
271
+ AccountInfoResponse,
272
+ AccountQueueData,
273
+ AccountQueueTransaction,
274
+ AccountLinesRequest,
275
+ AccountLinesResponse,
276
+ AccountLinesTrustline,
277
+ AccountNFToken,
278
+ AccountNFTsRequest,
279
+ AccountNFTsResponse,
280
+ AccountObject,
281
+ AccountObjectType,
282
+ AccountObjectsRequest,
283
+ AccountObjectsResponse,
284
+ AccountOffer,
285
+ AccountOffersRequest,
286
+ AccountOffersResponse,
287
+ AccountTxRequest,
288
+ AccountTxResponse,
289
+ AccountTxTransaction,
290
+ GatewayBalance,
291
+ GatewayBalancesRequest,
292
+ GatewayBalancesResponse,
293
+ NoRippleCheckRequest,
294
+ NoRippleCheckResponse,
295
+ // ledger methods
296
+ LedgerRequest,
297
+ LedgerResponse,
298
+ LedgerQueueData,
299
+ LedgerBinary,
300
+ LedgerModifiedOfferCreateTransaction,
301
+ LedgerClosedRequest,
302
+ LedgerClosedResponse,
303
+ LedgerCurrentRequest,
304
+ LedgerCurrentResponse,
305
+ LedgerDataRequest,
306
+ LedgerDataLabeledLedgerEntry,
307
+ LedgerDataBinaryLedgerEntry,
308
+ LedgerDataResponse,
309
+ LedgerDataLedgerState,
310
+ LedgerEntryRequest,
311
+ LedgerEntryResponse,
312
+ // transaction methods with types
313
+ SubmitRequest,
314
+ SubmitResponse,
315
+ SubmitMultisignedRequest,
316
+ SubmitMultisignedResponse,
317
+ TransactionEntryRequest,
318
+ TransactionEntryResponse,
319
+ TxRequest,
320
+ TxResponse,
321
+ // path and order book methods with types
322
+ BookOffersRequest,
323
+ BookOffer,
324
+ BookOfferCurrency,
325
+ BookOffersResponse,
326
+ DepositAuthorizedRequest,
327
+ DepositAuthorizedResponse,
328
+ PathFindRequest,
329
+ PathFindCreateRequest,
330
+ PathFindCloseRequest,
331
+ PathFindPathOption,
332
+ PathFindStatusRequest,
333
+ PathFindResponse,
334
+ RipplePathFindPathOption,
335
+ RipplePathFindRequest,
336
+ RipplePathFindResponse,
337
+ SourceCurrencyAmount,
338
+ // payment channel methods
339
+ ChannelVerifyRequest,
340
+ ChannelVerifyResponse,
341
+ // Subscribe methods/streams with types
342
+ SubscribeRequest,
343
+ SubscribeResponse,
344
+ SubscribeBook,
345
+ Stream,
346
+ BooksSnapshot,
347
+ LedgerStream,
348
+ LedgerStreamResponse,
349
+ ValidationStream,
350
+ TransactionStream,
351
+ PathFindStream,
352
+ PeerStatusStream,
353
+ OrderBookStream,
354
+ ConsensusStream,
355
+ UnsubscribeRequest,
356
+ UnsubscribeResponse,
357
+ UnsubscribeBook,
358
+ // server info methods with types
359
+ FeeRequest,
360
+ FeeResponse,
361
+ ManifestRequest,
362
+ ManifestResponse,
363
+ ServerInfoRequest,
364
+ ServerInfoResponse,
365
+ ServerStateRequest,
366
+ ServerStateResponse,
367
+ JobType,
368
+ ServerState,
369
+ StateAccountingFinal,
370
+ StateAccounting,
371
+ // utility methods
372
+ PingRequest,
373
+ PingResponse,
374
+ RandomRequest,
375
+ RandomResponse,
376
+ ErrorResponse,
377
+ // NFT methods
378
+ NFTBuyOffersRequest,
379
+ NFTBuyOffersResponse,
380
+ NFTSellOffersRequest,
381
+ NFTSellOffersResponse,
382
+ // clio only methods
383
+ NFTInfoRequest,
384
+ NFTInfoResponse,
385
+ NFTHistoryRequest,
386
+ NFTHistoryResponse,
387
+ NFTHistoryTransaction,
388
+ // AMM methods
389
+ AMMInfoRequest,
390
+ AMMInfoResponse,
391
+ }
@@ -0,0 +1,125 @@
1
+ import { Ledger } from '../ledger'
2
+ import { Transaction, TransactionAndMetadata } from '../transactions'
3
+ import { TransactionMetadata } from '../transactions/metadata'
4
+
5
+ import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
6
+
7
+ /**
8
+ * Retrieve information about the public ledger. Expects a response in the form
9
+ * of a {@link LedgerResponse}.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const ledger: LedgerRequest = {
14
+ * "id": 14,
15
+ * "command": "ledger",
16
+ * "ledger_index": "validated",
17
+ * "full": false,
18
+ * "accounts": false,
19
+ * "transactions": false,
20
+ * "expand": false,
21
+ * "owner_funds": false
22
+ * }
23
+ * ```
24
+ *
25
+ * @category Requests
26
+ */
27
+ export interface LedgerRequest extends BaseRequest, LookupByLedgerRequest {
28
+ command: 'ledger'
29
+ /**
30
+ * Admin required If true, return full information on the entire ledger.
31
+ * Ignored if you did not specify a ledger version. Defaults to false.
32
+ */
33
+ full?: boolean
34
+ /**
35
+ * Admin required. If true, return information on accounts in the ledger.
36
+ * Ignored if you did not specify a ledger version. Defaults to false.
37
+ */
38
+ accounts?: boolean
39
+ /**
40
+ * If true, return information on transactions in the specified ledger
41
+ * version. Defaults to false. Ignored if you did not specify a ledger
42
+ * version.
43
+ */
44
+ transactions?: boolean
45
+ /**
46
+ * Provide full JSON-formatted information for transaction/account
47
+ * information instead of only hashes. Defaults to false. Ignored unless you
48
+ * request transactions, accounts, or both.
49
+ */
50
+ expand?: boolean
51
+ /**
52
+ * If true, include owner_funds field in the metadata of OfferCreate
53
+ * transactions in the response. Defaults to false. Ignored unless
54
+ * transactions are included and expand is true.
55
+ */
56
+ owner_funds?: boolean
57
+ /**
58
+ * If true, and transactions and expand are both also true, return
59
+ * transaction information in binary format (hexadecimal string) instead of
60
+ * JSON format.
61
+ */
62
+ binary?: boolean
63
+ /**
64
+ * If true, and the command is requesting the current ledger, includes an
65
+ * array of queued transactions in the results.
66
+ */
67
+ queue?: boolean
68
+ }
69
+
70
+ /**
71
+ * Special case transaction definition when the request contains `owner_funds: true`.
72
+ */
73
+ export interface LedgerModifiedOfferCreateTransaction {
74
+ transaction: Transaction
75
+ metadata: TransactionMetadata & { owner_funds: string }
76
+ }
77
+
78
+ export interface LedgerQueueData {
79
+ account: string
80
+ tx:
81
+ | TransactionAndMetadata
82
+ | LedgerModifiedOfferCreateTransaction
83
+ | { tx_blob: string }
84
+ retries_remaining: number
85
+ preflight_result: string
86
+ last_result?: string
87
+ auth_change?: boolean
88
+ fee?: string
89
+ fee_level?: string
90
+ max_spend_drops?: string
91
+ }
92
+
93
+ export interface LedgerBinary
94
+ extends Omit<Omit<Ledger, 'transactions'>, 'accountState'> {
95
+ accountState?: string[]
96
+ transactions?: string[]
97
+ }
98
+
99
+ /**
100
+ * Response expected from a {@link LedgerRequest}.
101
+ *
102
+ * @category Responses
103
+ */
104
+ export interface LedgerResponse extends BaseResponse {
105
+ result: {
106
+ /** The complete header data of this {@link Ledger}. */
107
+ ledger: Ledger | LedgerBinary
108
+ /** Unique identifying hash of the entire ledger. */
109
+ ledger_hash: string
110
+ /** The Ledger Index of this ledger. */
111
+ ledger_index: number
112
+ /**
113
+ * If true, this is a validated ledger version. If omitted or set to false,
114
+ * this ledger's data is not final.
115
+ */
116
+ queue_data?: Array<LedgerQueueData | string>
117
+ /**
118
+ * Array of objects describing queued transactions, in the same order as
119
+ * the queue. If the request specified expand as true, members contain full
120
+ * representations of the transactions, in either JSON or binary depending
121
+ * on whether the request specified binary as true.
122
+ */
123
+ validated?: boolean
124
+ }
125
+ }
@@ -0,0 +1,32 @@
1
+ import { BaseRequest, BaseResponse } from './baseMethod'
2
+
3
+ /**
4
+ * The ledger_closed method returns the unique identifiers of the most recently
5
+ * closed ledger. Expects a response in the form of a {@link
6
+ * LedgerClosedResponse}.
7
+ *
8
+ * @example
9
+ * *
10
+ * ```ts
11
+ * const ledgerClosed: LedgerClosedRequest = {
12
+ * "command": "ledger_closed"
13
+ * }
14
+ * ```
15
+ *
16
+ * @category Requests
17
+ */
18
+ export interface LedgerClosedRequest extends BaseRequest {
19
+ command: 'ledger_closed'
20
+ }
21
+
22
+ /**
23
+ * The response expected from a {@link LedgerClosedRequest}.
24
+ *
25
+ * @category Responses
26
+ */
27
+ export interface LedgerClosedResponse extends BaseResponse {
28
+ result: {
29
+ ledger_hash: string
30
+ ledger_index: number
31
+ }
32
+ }
@@ -0,0 +1,31 @@
1
+ import { BaseRequest, BaseResponse } from './baseMethod'
2
+
3
+ /**
4
+ * The ledger_current method returns the unique identifiers of the current
5
+ * in-progress ledger. Expects a response in the form of a {@link
6
+ * LedgerCurrentResponse}.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const ledgerCurrent: LedgerCurrentRequest = {
11
+ * "command": "ledger_current"
12
+ * }
13
+ * ```
14
+ *
15
+ * @category Requests
16
+ */
17
+ export interface LedgerCurrentRequest extends BaseRequest {
18
+ command: 'ledger_current'
19
+ }
20
+
21
+ /**
22
+ * Response expected from a {@link LedgerCurrentRequest}.
23
+ *
24
+ * @category Responses
25
+ */
26
+ export interface LedgerCurrentResponse extends BaseResponse {
27
+ result: {
28
+ /** The ledger index of this ledger version. */
29
+ ledger_current_index: number
30
+ }
31
+ }
@@ -0,0 +1,78 @@
1
+ import { LedgerEntry } from '../ledger'
2
+
3
+ import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
4
+
5
+ /**
6
+ * The `ledger_data` method retrieves contents of the specified ledger. You can
7
+ * iterate through several calls to retrieve the entire contents of a single
8
+ * ledger version.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const ledgerData: LedgerDataRequest = {
13
+ * "id": 2,
14
+ * "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
15
+ * "command": "ledger_data",
16
+ * "limit": 5,
17
+ * "binary": true
18
+ * }
19
+ * ```
20
+ *
21
+ * @category Requests
22
+ */
23
+ export interface LedgerDataRequest extends BaseRequest, LookupByLedgerRequest {
24
+ command: 'ledger_data'
25
+ /**
26
+ * If set to true, return ledger objects as hashed hex strings instead of
27
+ * JSON.
28
+ */
29
+ binary?: boolean
30
+ /**
31
+ * Limit the number of ledger objects to retrieve. The server is not required
32
+ * to honor this value.
33
+ */
34
+ limit?: number
35
+ /**
36
+ * Value from a previous paginated response. Resume retrieving data where
37
+ * that response left off.
38
+ */
39
+ marker?: unknown
40
+ }
41
+
42
+ export type LedgerDataLabeledLedgerEntry = {
43
+ ledgerEntryType: string
44
+ } & LedgerEntry
45
+
46
+ export interface LedgerDataBinaryLedgerEntry {
47
+ data: string
48
+ }
49
+
50
+ export type LedgerDataLedgerState = { index: string } & (
51
+ | LedgerDataBinaryLedgerEntry
52
+ | LedgerDataLabeledLedgerEntry
53
+ )
54
+
55
+ /**
56
+ * The response expected from a {@link LedgerDataRequest}.
57
+ *
58
+ * @category Responses
59
+ */
60
+ export interface LedgerDataResponse extends BaseResponse {
61
+ result: {
62
+ /** The ledger index of this ledger version. */
63
+ ledger_index: number
64
+ /** Unique identifying hash of this ledger version. */
65
+ ledger_hash: string
66
+ /**
67
+ * Array of JSON objects containing data from the ledger's state tree,
68
+ * as defined below.
69
+ */
70
+ state: LedgerDataLedgerState[]
71
+ /**
72
+ * Server-defined value indicating the response is paginated. Pass this to
73
+ * the next call to resume where this call left off.
74
+ */
75
+ marker?: unknown
76
+ validated?: boolean
77
+ }
78
+ }