xrpl 2.9.1 → 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 (325) 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 +2680 -481
  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 +5 -1
  23. package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
  24. package/dist/npm/models/ledger/AccountRoot.js +2 -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/accountInfo.d.ts +1 -0
  29. package/dist/npm/models/methods/accountInfo.d.ts.map +1 -1
  30. package/dist/npm/models/methods/ammInfo.d.ts +39 -0
  31. package/dist/npm/models/methods/ammInfo.d.ts.map +1 -0
  32. package/dist/npm/models/methods/ammInfo.js +3 -0
  33. package/dist/npm/models/methods/ammInfo.js.map +1 -0
  34. package/dist/npm/models/methods/index.d.ts +4 -3
  35. package/dist/npm/models/methods/index.d.ts.map +1 -1
  36. package/dist/npm/models/methods/ledgerEntry.d.ts +10 -0
  37. package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
  38. package/dist/npm/models/transactions/AMMBid.d.ts +12 -0
  39. package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -0
  40. package/dist/npm/models/transactions/AMMBid.js +56 -0
  41. package/dist/npm/models/transactions/AMMBid.js.map +1 -0
  42. package/dist/npm/models/transactions/AMMCreate.d.ts +11 -0
  43. package/dist/npm/models/transactions/AMMCreate.d.ts.map +1 -0
  44. package/dist/npm/models/transactions/AMMCreate.js +32 -0
  45. package/dist/npm/models/transactions/AMMCreate.js.map +1 -0
  46. package/dist/npm/models/transactions/AMMDelete.d.ts +9 -0
  47. package/dist/npm/models/transactions/AMMDelete.d.ts.map +1 -0
  48. package/dist/npm/models/transactions/AMMDelete.js +22 -0
  49. package/dist/npm/models/transactions/AMMDelete.js.map +1 -0
  50. package/dist/npm/models/transactions/AMMDeposit.d.ts +27 -0
  51. package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -0
  52. package/dist/npm/models/transactions/AMMDeposit.js +51 -0
  53. package/dist/npm/models/transactions/AMMDeposit.js.map +1 -0
  54. package/dist/npm/models/transactions/AMMVote.d.ts +10 -0
  55. package/dist/npm/models/transactions/AMMVote.d.ts.map +1 -0
  56. package/dist/npm/models/transactions/AMMVote.js +32 -0
  57. package/dist/npm/models/transactions/AMMVote.js.map +1 -0
  58. package/dist/npm/models/transactions/AMMWithdraw.d.ts +31 -0
  59. package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -0
  60. package/dist/npm/models/transactions/AMMWithdraw.js +50 -0
  61. package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -0
  62. package/dist/npm/models/transactions/accountSet.d.ts +2 -1
  63. package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
  64. package/dist/npm/models/transactions/accountSet.js +1 -0
  65. package/dist/npm/models/transactions/accountSet.js.map +1 -1
  66. package/dist/npm/models/transactions/clawback.d.ts +9 -0
  67. package/dist/npm/models/transactions/clawback.d.ts.map +1 -0
  68. package/dist/npm/models/transactions/clawback.js +19 -0
  69. package/dist/npm/models/transactions/clawback.js.map +1 -0
  70. package/dist/npm/models/transactions/common.d.ts +2 -1
  71. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  72. package/dist/npm/models/transactions/common.js +12 -1
  73. package/dist/npm/models/transactions/common.js.map +1 -1
  74. package/dist/npm/models/transactions/index.d.ts +7 -0
  75. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  76. package/dist/npm/models/transactions/index.js +5 -1
  77. package/dist/npm/models/transactions/index.js.map +1 -1
  78. package/dist/npm/models/transactions/transaction.d.ts +8 -1
  79. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  80. package/dist/npm/models/transactions/transaction.js +28 -0
  81. package/dist/npm/models/transactions/transaction.js.map +1 -1
  82. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  83. package/dist/npm/models/utils/flags.js +17 -23
  84. package/dist/npm/models/utils/flags.js.map +1 -1
  85. package/dist/npm/models/utils/index.js +1 -1
  86. package/dist/npm/models/utils/index.js.map +1 -1
  87. package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
  88. package/dist/npm/src/Wallet/walletFromSecretNumbers.d.ts +7 -0
  89. package/dist/npm/src/Wallet/walletFromSecretNumbers.d.ts.map +1 -0
  90. package/dist/npm/src/Wallet/walletFromSecretNumbers.js +27 -0
  91. package/dist/npm/src/Wallet/walletFromSecretNumbers.js.map +1 -0
  92. package/dist/npm/src/client/index.d.ts +2 -1
  93. package/dist/npm/src/client/index.d.ts.map +1 -1
  94. package/dist/npm/src/client/index.js.map +1 -1
  95. package/dist/npm/src/index.d.ts +1 -0
  96. package/dist/npm/src/index.d.ts.map +1 -1
  97. package/dist/npm/src/index.js +3 -1
  98. package/dist/npm/src/index.js.map +1 -1
  99. package/dist/npm/src/models/common/index.d.ts +5 -0
  100. package/dist/npm/src/models/common/index.d.ts.map +1 -1
  101. package/dist/npm/src/models/ledger/AMM.d.ts +27 -0
  102. package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -0
  103. package/dist/npm/src/models/ledger/AMM.js +3 -0
  104. package/dist/npm/src/models/ledger/AMM.js.map +1 -0
  105. package/dist/npm/src/models/ledger/AccountRoot.d.ts +5 -1
  106. package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
  107. package/dist/npm/src/models/ledger/AccountRoot.js +2 -0
  108. package/dist/npm/src/models/ledger/AccountRoot.js.map +1 -1
  109. package/dist/npm/src/models/ledger/LedgerEntry.d.ts +2 -1
  110. package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
  111. package/dist/npm/src/models/methods/accountInfo.d.ts +1 -0
  112. package/dist/npm/src/models/methods/accountInfo.d.ts.map +1 -1
  113. package/dist/npm/src/models/methods/ammInfo.d.ts +39 -0
  114. package/dist/npm/src/models/methods/ammInfo.d.ts.map +1 -0
  115. package/dist/npm/src/models/methods/ammInfo.js +3 -0
  116. package/dist/npm/src/models/methods/ammInfo.js.map +1 -0
  117. package/dist/npm/src/models/methods/index.d.ts +4 -3
  118. package/dist/npm/src/models/methods/index.d.ts.map +1 -1
  119. package/dist/npm/src/models/methods/ledgerEntry.d.ts +10 -0
  120. package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
  121. package/dist/npm/src/models/transactions/AMMBid.d.ts +12 -0
  122. package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -0
  123. package/dist/npm/src/models/transactions/AMMBid.js +56 -0
  124. package/dist/npm/src/models/transactions/AMMBid.js.map +1 -0
  125. package/dist/npm/src/models/transactions/AMMCreate.d.ts +11 -0
  126. package/dist/npm/src/models/transactions/AMMCreate.d.ts.map +1 -0
  127. package/dist/npm/src/models/transactions/AMMCreate.js +32 -0
  128. package/dist/npm/src/models/transactions/AMMCreate.js.map +1 -0
  129. package/dist/npm/src/models/transactions/AMMDelete.d.ts +9 -0
  130. package/dist/npm/src/models/transactions/AMMDelete.d.ts.map +1 -0
  131. package/dist/npm/src/models/transactions/AMMDelete.js +22 -0
  132. package/dist/npm/src/models/transactions/AMMDelete.js.map +1 -0
  133. package/dist/npm/src/models/transactions/AMMDeposit.d.ts +27 -0
  134. package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -0
  135. package/dist/npm/src/models/transactions/AMMDeposit.js +51 -0
  136. package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -0
  137. package/dist/npm/src/models/transactions/AMMVote.d.ts +10 -0
  138. package/dist/npm/src/models/transactions/AMMVote.d.ts.map +1 -0
  139. package/dist/npm/src/models/transactions/AMMVote.js +32 -0
  140. package/dist/npm/src/models/transactions/AMMVote.js.map +1 -0
  141. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts +31 -0
  142. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -0
  143. package/dist/npm/src/models/transactions/AMMWithdraw.js +50 -0
  144. package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -0
  145. package/dist/npm/src/models/transactions/accountSet.d.ts +2 -1
  146. package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
  147. package/dist/npm/src/models/transactions/accountSet.js +1 -0
  148. package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
  149. package/dist/npm/src/models/transactions/clawback.d.ts +9 -0
  150. package/dist/npm/src/models/transactions/clawback.d.ts.map +1 -0
  151. package/dist/npm/src/models/transactions/clawback.js +19 -0
  152. package/dist/npm/src/models/transactions/clawback.js.map +1 -0
  153. package/dist/npm/src/models/transactions/common.d.ts +2 -1
  154. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  155. package/dist/npm/src/models/transactions/common.js +12 -1
  156. package/dist/npm/src/models/transactions/common.js.map +1 -1
  157. package/dist/npm/src/models/transactions/index.d.ts +7 -0
  158. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  159. package/dist/npm/src/models/transactions/index.js +5 -1
  160. package/dist/npm/src/models/transactions/index.js.map +1 -1
  161. package/dist/npm/src/models/transactions/transaction.d.ts +8 -1
  162. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  163. package/dist/npm/src/models/transactions/transaction.js +28 -0
  164. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  165. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  166. package/dist/npm/src/models/utils/flags.js +17 -23
  167. package/dist/npm/src/models/utils/flags.js.map +1 -1
  168. package/dist/npm/src/models/utils/index.js +1 -1
  169. package/dist/npm/src/models/utils/index.js.map +1 -1
  170. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  171. package/dist/npm/src/sugar/autofill.js +4 -3
  172. package/dist/npm/src/sugar/autofill.js.map +1 -1
  173. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  174. package/dist/npm/sugar/autofill.js +4 -3
  175. package/dist/npm/sugar/autofill.js.map +1 -1
  176. package/package.json +8 -6
  177. package/src/ECDSA.ts +6 -0
  178. package/src/Wallet/defaultFaucets.ts +82 -0
  179. package/src/Wallet/fundWallet.ts +344 -0
  180. package/src/Wallet/index.ts +504 -0
  181. package/src/Wallet/rfc1751.ts +190 -0
  182. package/src/Wallet/rfc1751Words.json +243 -0
  183. package/src/Wallet/signer.ts +173 -0
  184. package/src/Wallet/walletFromSecretNumbers.ts +37 -0
  185. package/src/client/BroadcastClient.ts +84 -0
  186. package/src/client/ConnectionManager.ts +40 -0
  187. package/src/client/ExponentialBackoff.ts +71 -0
  188. package/src/client/RequestManager.ts +194 -0
  189. package/src/client/WSWrapper.ts +106 -0
  190. package/src/client/connection.ts +593 -0
  191. package/src/client/index.ts +712 -0
  192. package/src/client/partialPayment.ts +153 -0
  193. package/src/errors.ts +161 -0
  194. package/src/index.ts +20 -0
  195. package/src/models/common/index.ts +149 -0
  196. package/src/models/index.ts +16 -0
  197. package/src/models/ledger/AMM.ts +78 -0
  198. package/src/models/ledger/AccountRoot.ts +217 -0
  199. package/src/models/ledger/Amendments.ts +45 -0
  200. package/src/models/ledger/BaseLedgerEntry.ts +3 -0
  201. package/src/models/ledger/Check.ts +70 -0
  202. package/src/models/ledger/DepositPreauth.ts +35 -0
  203. package/src/models/ledger/DirectoryNode.ts +46 -0
  204. package/src/models/ledger/Escrow.ts +74 -0
  205. package/src/models/ledger/FeeSettings.ts +52 -0
  206. package/src/models/ledger/Ledger.ts +65 -0
  207. package/src/models/ledger/LedgerEntry.ts +34 -0
  208. package/src/models/ledger/LedgerHashes.ts +24 -0
  209. package/src/models/ledger/NFTokenOffer.ts +16 -0
  210. package/src/models/ledger/NFTokenPage.ts +20 -0
  211. package/src/models/ledger/NegativeUNL.ts +34 -0
  212. package/src/models/ledger/Offer.ts +52 -0
  213. package/src/models/ledger/PayChannel.ts +107 -0
  214. package/src/models/ledger/RippleState.ts +88 -0
  215. package/src/models/ledger/SignerList.ts +56 -0
  216. package/src/models/ledger/Ticket.ts +36 -0
  217. package/src/models/ledger/index.ts +58 -0
  218. package/src/models/methods/accountChannels.ts +93 -0
  219. package/src/models/methods/accountCurrencies.ts +45 -0
  220. package/src/models/methods/accountInfo.ts +182 -0
  221. package/src/models/methods/accountLines.ts +137 -0
  222. package/src/models/methods/accountNFTs.ts +72 -0
  223. package/src/models/methods/accountObjects.ts +120 -0
  224. package/src/models/methods/accountOffers.ts +100 -0
  225. package/src/models/methods/accountTx.ts +109 -0
  226. package/src/models/methods/ammInfo.ts +145 -0
  227. package/src/models/methods/baseMethod.ts +58 -0
  228. package/src/models/methods/bookOffers.ts +96 -0
  229. package/src/models/methods/channelVerify.ts +41 -0
  230. package/src/models/methods/depositAuthorized.ts +56 -0
  231. package/src/models/methods/fee.ts +91 -0
  232. package/src/models/methods/gatewayBalances.ts +85 -0
  233. package/src/models/methods/index.ts +391 -0
  234. package/src/models/methods/ledger.ts +125 -0
  235. package/src/models/methods/ledgerClosed.ts +32 -0
  236. package/src/models/methods/ledgerCurrent.ts +31 -0
  237. package/src/models/methods/ledgerData.ts +78 -0
  238. package/src/models/methods/ledgerEntry.ts +177 -0
  239. package/src/models/methods/manifest.ts +54 -0
  240. package/src/models/methods/nftBuyOffers.ts +37 -0
  241. package/src/models/methods/nftHistory.ts +113 -0
  242. package/src/models/methods/nftInfo.ts +25 -0
  243. package/src/models/methods/nftSellOffers.ts +37 -0
  244. package/src/models/methods/norippleCheck.ts +82 -0
  245. package/src/models/methods/pathFind.ts +116 -0
  246. package/src/models/methods/ping.ts +21 -0
  247. package/src/models/methods/random.ts +23 -0
  248. package/src/models/methods/ripplePathFind.ts +81 -0
  249. package/src/models/methods/serverInfo.ts +257 -0
  250. package/src/models/methods/serverState.ts +77 -0
  251. package/src/models/methods/submit.ts +94 -0
  252. package/src/models/methods/submitMultisigned.ts +51 -0
  253. package/src/models/methods/subscribe.ts +435 -0
  254. package/src/models/methods/transactionEntry.ts +47 -0
  255. package/src/models/methods/tx.ts +69 -0
  256. package/src/models/methods/unsubscribe.ts +49 -0
  257. package/src/models/transactions/AMMBid.ts +140 -0
  258. package/src/models/transactions/AMMCreate.ts +80 -0
  259. package/src/models/transactions/AMMDelete.ts +55 -0
  260. package/src/models/transactions/AMMDeposit.ts +130 -0
  261. package/src/models/transactions/AMMVote.ts +71 -0
  262. package/src/models/transactions/AMMWithdraw.ts +126 -0
  263. package/src/models/transactions/NFTokenAcceptOffer.ts +104 -0
  264. package/src/models/transactions/NFTokenBurn.ts +48 -0
  265. package/src/models/transactions/NFTokenCancelOffer.ts +45 -0
  266. package/src/models/transactions/NFTokenCreateOffer.ts +145 -0
  267. package/src/models/transactions/NFTokenMint.ts +123 -0
  268. package/src/models/transactions/UNLModify.ts +20 -0
  269. package/src/models/transactions/accountDelete.ts +50 -0
  270. package/src/models/transactions/accountSet.ts +228 -0
  271. package/src/models/transactions/checkCancel.ts +34 -0
  272. package/src/models/transactions/checkCash.ts +73 -0
  273. package/src/models/transactions/checkCreate.ts +90 -0
  274. package/src/models/transactions/clawback.ts +49 -0
  275. package/src/models/transactions/common.ts +295 -0
  276. package/src/models/transactions/depositPreauth.ts +68 -0
  277. package/src/models/transactions/enableAmendment.ts +26 -0
  278. package/src/models/transactions/escrowCancel.ts +45 -0
  279. package/src/models/transactions/escrowCreate.ts +100 -0
  280. package/src/models/transactions/escrowFinish.ts +63 -0
  281. package/src/models/transactions/index.ts +66 -0
  282. package/src/models/transactions/metadata.ts +69 -0
  283. package/src/models/transactions/offerCancel.ts +37 -0
  284. package/src/models/transactions/offerCreate.ts +144 -0
  285. package/src/models/transactions/payment.ts +278 -0
  286. package/src/models/transactions/paymentChannelClaim.ts +165 -0
  287. package/src/models/transactions/paymentChannelCreate.ts +116 -0
  288. package/src/models/transactions/paymentChannelFund.ts +65 -0
  289. package/src/models/transactions/setFee.ts +48 -0
  290. package/src/models/transactions/setRegularKey.ts +33 -0
  291. package/src/models/transactions/signerListSet.ts +89 -0
  292. package/src/models/transactions/ticketCreate.ts +50 -0
  293. package/src/models/transactions/transaction.ts +303 -0
  294. package/src/models/transactions/trustSet.ts +146 -0
  295. package/src/models/utils/flags.ts +98 -0
  296. package/src/models/utils/index.ts +37 -0
  297. package/src/sugar/autofill.ts +373 -0
  298. package/src/sugar/balances.ts +123 -0
  299. package/src/sugar/getFeeXrp.ts +45 -0
  300. package/src/sugar/getLedgerIndex.ts +15 -0
  301. package/src/sugar/getOrderbook.ts +152 -0
  302. package/src/sugar/index.ts +11 -0
  303. package/src/sugar/submit.ts +305 -0
  304. package/src/sugar/utils.ts +29 -0
  305. package/src/utils/derive.ts +23 -0
  306. package/src/utils/getBalanceChanges.ts +186 -0
  307. package/src/utils/getNFTokenID.ts +97 -0
  308. package/src/utils/hashes/HashPrefix.ts +40 -0
  309. package/src/utils/hashes/README.md +65 -0
  310. package/src/utils/hashes/SHAMap/InnerNode.ts +124 -0
  311. package/src/utils/hashes/SHAMap/LeafNode.ts +69 -0
  312. package/src/utils/hashes/SHAMap/index.ts +41 -0
  313. package/src/utils/hashes/SHAMap/node.ts +14 -0
  314. package/src/utils/hashes/hashLedger.ts +236 -0
  315. package/src/utils/hashes/index.ts +187 -0
  316. package/src/utils/hashes/ledgerSpaces.ts +34 -0
  317. package/src/utils/hashes/sha512Half.ts +19 -0
  318. package/src/utils/index.ts +223 -0
  319. package/src/utils/parseNFTokenID.ts +84 -0
  320. package/src/utils/quality.ts +169 -0
  321. package/src/utils/signPaymentChannelClaim.ts +27 -0
  322. package/src/utils/stringConversion.ts +27 -0
  323. package/src/utils/timeConversion.ts +53 -0
  324. package/src/utils/verifyPaymentChannelClaim.ts +30 -0
  325. package/src/utils/xrpConversion.ts +104 -0
@@ -0,0 +1,435 @@
1
+ import type {
2
+ Amount,
3
+ Currency,
4
+ Path,
5
+ StreamType,
6
+ ResponseOnlyTxInfo,
7
+ } from '../common'
8
+ import { Offer } from '../ledger'
9
+ import { OfferCreate, Transaction } from '../transactions'
10
+ import { TransactionMetadata } from '../transactions/metadata'
11
+
12
+ import type { BaseRequest, BaseResponse } from './baseMethod'
13
+
14
+ export interface SubscribeBook {
15
+ /**
16
+ * Specification of which currency the account taking the Offer would
17
+ * receive, as a currency object with no amount.
18
+ */
19
+ taker_gets: Currency
20
+ /**
21
+ * Specification of which currency the account taking the Offer would pay, as
22
+ * a currency object with no amount.
23
+ */
24
+ taker_pays: Currency
25
+ /**
26
+ * Unique account address to use as a perspective for viewing offers, in the.
27
+ * XRP Ledger's base58 format.
28
+ */
29
+ taker: string
30
+ /**
31
+ * If true, return the current state of the order book once when you
32
+ * subscribe before sending updates. The default is false.
33
+ */
34
+ snapshot?: boolean
35
+ /** If true, return both sides of the order book. The default is false. */
36
+ both?: boolean
37
+ }
38
+
39
+ /**
40
+ * The subscribe method requests periodic notifications from the server when
41
+ * certain events happen. Expects a response in the form of a.
42
+ * {@link SubscribeResponse}.
43
+ *
44
+ * @category Requests
45
+ */
46
+ export interface SubscribeRequest extends BaseRequest {
47
+ command: 'subscribe'
48
+ /** Array of string names of generic streams to subscribe to. */
49
+ streams?: StreamType[]
50
+ /**
51
+ * Array with the unique addresses of accounts to monitor for validated
52
+ * transactions. The addresses must be in the XRP Ledger's base58 format.
53
+ * The server sends a notification for any transaction that affects at least
54
+ * one of these accounts.
55
+ */
56
+ accounts?: string[]
57
+ /** Like accounts, but include transactions that are not yet finalized. */
58
+ accounts_proposed?: string[]
59
+ /**
60
+ * Array of objects defining order books to monitor for updates, as detailed
61
+ * Below.
62
+ */
63
+ books?: SubscribeBook[]
64
+ /**
65
+ * URL where the server sends a JSON-RPC callbacks for each event.
66
+ * Admin-only.
67
+ */
68
+ url?: string
69
+ /** Username to provide for basic authentication at the callback URL. */
70
+ url_username?: string
71
+ /** Password to provide for basic authentication at the callback URL. */
72
+ url_password?: string
73
+ }
74
+
75
+ export type BooksSnapshot = Offer[]
76
+
77
+ /**
78
+ * Response expected from a {@link SubscribeRequest}.
79
+ *
80
+ * @category Responses
81
+ */
82
+ export interface SubscribeResponse extends BaseResponse {
83
+ result: Record<string, never> | LedgerStreamResponse | BooksSnapshot
84
+ }
85
+
86
+ interface BaseStream {
87
+ type: string
88
+ }
89
+
90
+ /**
91
+ * The `ledger` stream only sends `ledgerClosed` messages when the consensus
92
+ * process declares a new validated ledger. The message identifies the ledger
93
+ * And provides some information about its contents.
94
+ *
95
+ * @category Streams
96
+ */
97
+ export interface LedgerStream extends BaseStream {
98
+ type: 'ledgerClosed'
99
+ /**
100
+ * The reference transaction cost as of this ledger version, in drops of XRP.
101
+ * If this ledger version includes a SetFee pseudo-transaction the new.
102
+ * Transaction cost applies starting with the following ledger version.
103
+ */
104
+ fee_base: number
105
+ /** The reference transaction cost in "fee units". This is not returned after the SetFees amendment is enabled. */
106
+ fee_ref?: number
107
+ /** The identifying hash of the ledger version that was closed. */
108
+ ledger_hash: string
109
+ /** The ledger index of the ledger that was closed. */
110
+ ledger_index: number
111
+ /** The time this ledger was closed, in seconds since the Ripple Epoch. */
112
+ ledger_time: number
113
+ /**
114
+ * The minimum reserve, in drops of XRP, that is required for an account. If
115
+ * this ledger version includes a SetFee pseudo-transaction the new base reserve
116
+ * applies starting with the following ledger version.
117
+ */
118
+ reserve_base: number
119
+ /**
120
+ * The owner reserve for each object an account owns in the ledger, in drops
121
+ * of XRP. If the ledger includes a SetFee pseudo-transaction the new owner
122
+ * reserve applies after this ledger.
123
+ */
124
+ reserve_inc: number
125
+ /** Number of new transactions included in this ledger version. */
126
+ txn_count: number
127
+ /**
128
+ * Range of ledgers that the server has available. This may be a disjoint
129
+ * sequence such as 24900901-24900984,24901116-24901158. This field is not
130
+ * returned if the server is not connected to the network, or if it is
131
+ * connected but has not yet obtained a ledger from the network.
132
+ */
133
+ validated_ledgers?: string
134
+ }
135
+
136
+ /**
137
+ * This response mirrors the LedgerStream, except it does NOT include the 'type' nor 'txn_count' fields.
138
+ */
139
+ export interface LedgerStreamResponse {
140
+ /**
141
+ * The reference transaction cost as of this ledger version, in drops of XRP.
142
+ * If this ledger version includes a SetFee pseudo-transaction the new.
143
+ * Transaction cost applies starting with the following ledger version.
144
+ */
145
+ fee_base: number
146
+ /** The reference transaction cost in "fee units". This is not returned after the SetFees amendment is enabled. */
147
+ fee_ref?: number
148
+ /** The identifying hash of the ledger version that was closed. */
149
+ ledger_hash: string
150
+ /** The ledger index of the ledger that was closed. */
151
+ ledger_index: number
152
+ /** The time this ledger was closed, in seconds since the Ripple Epoch. */
153
+ ledger_time: number
154
+ /**
155
+ * The minimum reserve, in drops of XRP, that is required for an account. If
156
+ * this ledger version includes a SetFee pseudo-transaction the new base reserve
157
+ * applies starting with the following ledger version.
158
+ */
159
+ reserve_base: number
160
+ /**
161
+ * The owner reserve for each object an account owns in the ledger, in drops
162
+ * of XRP. If the ledger includes a SetFee pseudo-transaction the new owner
163
+ * reserve applies after this ledger.
164
+ */
165
+ reserve_inc: number
166
+ /**
167
+ * Range of ledgers that the server has available. This may be a disjoint
168
+ * sequence such as 24900901-24900984,24901116-24901158. This field is not
169
+ * returned if the server is not connected to the network, or if it is
170
+ * connected but has not yet obtained a ledger from the network.
171
+ */
172
+ validated_ledgers?: string
173
+ }
174
+
175
+ /**
176
+ * The validations stream sends messages whenever it receives validation
177
+ * messages, also called validation votes, regardless of whether or not the
178
+ * validation message is from a trusted validator.
179
+ *
180
+ * @category Streams
181
+ */
182
+ export interface ValidationStream extends BaseStream {
183
+ type: 'validationReceived'
184
+ /**
185
+ * The value validationReceived indicates this is from the validations
186
+ * Stream.
187
+ */
188
+ amendments?: string[]
189
+ /** The amendments this server wants to be added to the protocol. */
190
+ base_fee?: number
191
+ /**
192
+ * An arbitrary value chosen by the server at startup.
193
+ *
194
+ * If the same validation key pair signs validations with different cookies
195
+ * concurrently, that usually indicates that multiple servers are incorrectly
196
+ * configured to use the same validation key pair.
197
+ */
198
+ cookie?: string
199
+ /**
200
+ * The contents of the validation message in its canonical binary form
201
+ */
202
+ data?: string
203
+ /**
204
+ * The unscaled transaction cost (reference_fee value) this server wants to
205
+ * set by Fee voting.
206
+ */
207
+ flags: number
208
+ /**
209
+ * Bit-mask of flags added to this validation message. The flag 0x80000000
210
+ * indicates that the validation signature is fully-canonical. The flag
211
+ * 0x00000001 indicates that this is a full validation; otherwise it's a
212
+ * partial validation. Partial validations are not meant to vote for any
213
+ * particular ledger. A partial validation indicates that the validator is
214
+ * still online but not keeping up with consensus.
215
+ */
216
+ full: boolean
217
+ /**
218
+ * If true, this is a full validation. Otherwise, this is a partial
219
+ * validation. Partial validations are not meant to vote for any particular
220
+ * ledger. A partial validation indicates that the validator is still online
221
+ * but not keeping up with consensus.
222
+ */
223
+ ledger_hash: string
224
+ /** The ledger index of the proposed ledger. */
225
+ ledger_index: string
226
+ /**
227
+ * The local load-scaled transaction cost this validator is currently
228
+ * enforcing, in fee units.
229
+ */
230
+ load_fee?: number
231
+ /**
232
+ * The validator's master public key, if the validator is using a validator
233
+ * token, in the XRP Ledger's base58 format.
234
+ */
235
+ master_key?: string
236
+ /**
237
+ * The minimum reserve requirement (`account_reserve` value) this validator
238
+ * wants to set by fee voting.
239
+ */
240
+ reserve_base?: number
241
+ /**
242
+ * The increment in the reserve requirement (owner_reserve value) this
243
+ * validator wants to set by fee voting.
244
+ */
245
+ reserve_inc?: number
246
+ /** The signature that the validator used to sign its vote for this ledger. */
247
+ signature: string
248
+ /** When this validation vote was signed, in seconds since the Ripple Epoch. */
249
+ signing_time: number
250
+ /**
251
+ * The public key from the key-pair that the validator used to sign the
252
+ * message, in the XRP Ledger's base58 format. This identifies the validator
253
+ * sending the message and can also be used to verify the signature. If the
254
+ * validator is using a token, this is an ephemeral public key.
255
+ */
256
+ validation_public_key: string
257
+ }
258
+
259
+ /**
260
+ * Many subscriptions result in messages about transactions.
261
+ *
262
+ * @category Streams
263
+ */
264
+ export interface TransactionStream extends BaseStream {
265
+ status: string
266
+ type: 'transaction'
267
+ /** String Transaction result code. */
268
+ engine_result: string
269
+ /** Numeric transaction response code, if applicable. */
270
+ engine_result_code: number
271
+ /** Human-readable explanation for the transaction response. */
272
+ engine_result_message: string
273
+ /**
274
+ * The ledger index of the current in-progress ledger version for which this
275
+ * transaction is currently proposed.
276
+ */
277
+ ledger_current_index?: number
278
+ /** The identifying hash of the ledger version that includes this transaction. */
279
+ ledger_hash?: string
280
+ /** The ledger index of the ledger version that includes this transaction. */
281
+ ledger_index?: number
282
+ /**
283
+ * The transaction metadata, which shows the exact outcome of the transaction
284
+ * in detail.
285
+ */
286
+ meta?: TransactionMetadata
287
+ /** The definition of the transaction in JSON format. */
288
+ transaction: Transaction & ResponseOnlyTxInfo
289
+ /**
290
+ * If true, this transaction is included in a validated ledger and its
291
+ * outcome is final. Responses from the transaction stream should always be
292
+ * validated.
293
+ */
294
+ validated?: boolean
295
+ warnings?: Array<{ id: number; message: string }>
296
+ }
297
+
298
+ /**
299
+ * The admin-only `peer_status` stream reports a large amount of information on
300
+ * the activities of other rippled servers to which this server is connected, in
301
+ * particular their status in the consensus process.
302
+ *
303
+ * @category Streams
304
+ */
305
+ export interface PeerStatusStream extends BaseStream {
306
+ type: 'peerStatusChange'
307
+ /**
308
+ * The type of event that prompted this message. See Peer Status Events for
309
+ * possible values.
310
+ */
311
+ action: 'CLOSING_LEDGER' | 'ACCEPTED_LEDGER' | 'SWITCHED_LEDGER' | 'LOST_SYNC'
312
+ /** The time this event occurred, in seconds since the Ripple Epoch. */
313
+ date: number
314
+ /** The identifying Hash of a ledger version to which this message pertains. */
315
+ ledger_hash?: string
316
+ /** The Ledger Index of a ledger version to which this message pertains. */
317
+ ledger_index?: number
318
+ /** The largest Ledger Index the peer has currently available. */
319
+ ledger_index_max?: number
320
+ /** The smallest Ledger Index the peer has currently available. */
321
+ ledger_index_min?: number
322
+ }
323
+
324
+ /**
325
+ * The format of an order book stream message is the same as that of
326
+ * transaction stream messages, except that OfferCreate transactions also
327
+ * contain the following field.
328
+ */
329
+ interface ModifiedOfferCreateTransaction extends OfferCreate {
330
+ /**
331
+ * Numeric amount of the TakerGets currency that the Account sending this
332
+ * OfferCreate transaction has after executing this transaction. This does not
333
+ * check whether the currency amount is frozen.
334
+ */
335
+ owner_funds: string
336
+ }
337
+
338
+ /**
339
+ * When you subscribe to one or more order books with the `books` field, you
340
+ * get back any transactions that affect those order books. Has the same format
341
+ * as a {@link TransactionStream} but the transaction can have a `owner_funds`
342
+ * field.
343
+ *
344
+ * @category Streams
345
+ */
346
+ export interface OrderBookStream extends BaseStream {
347
+ status: string
348
+ type: 'transaction'
349
+ engine_result: string
350
+ engine_result_code: number
351
+ engine_result_message: string
352
+ ledger_current_index?: number
353
+ ledger_hash?: string
354
+ ledger_index?: number
355
+ meta: TransactionMetadata
356
+ transaction: (Transaction | ModifiedOfferCreateTransaction) & {
357
+ /**
358
+ * This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
359
+ */
360
+ date?: number
361
+ /**
362
+ * Every signed transaction has a unique "hash" that identifies it.
363
+ * The transaction hash can be used to look up its final status, which may serve as a "proof of payment"
364
+ */
365
+ hash?: string
366
+ }
367
+ validated: boolean
368
+ }
369
+
370
+ /**
371
+ * The consensus stream sends consensusPhase messages when the consensus
372
+ * process changes phase. The message contains the new phase of consensus the
373
+ * server is in.
374
+ *
375
+ * @category Streams
376
+ */
377
+ export interface ConsensusStream extends BaseStream {
378
+ type: 'consensusPhase'
379
+ /**
380
+ * The new consensus phase the server is in. Possible values are open,
381
+ * establish, and accepted.
382
+ */
383
+ consensus: 'open' | 'establish' | 'accepted'
384
+ }
385
+
386
+ /**
387
+ * The path_find method searches for a path along which a transaction can
388
+ * possibly be made, and periodically sends updates when the path changes over
389
+ * time.
390
+ *
391
+ * @category Streams
392
+ */
393
+ export interface PathFindStream extends BaseStream {
394
+ type: 'path_find'
395
+ /** Unique address that would send a transaction. */
396
+ source_account: string
397
+ /** Unique address of the account that would receive a transaction. */
398
+ destination_account: string
399
+ /** Currency Amount that the destination would receive in a transaction. */
400
+ destination_amount: Amount
401
+ /**
402
+ * If false, this is the result of an incomplete search. A later reply may
403
+ * have a better path. If true, then this is the best path found. (It is still
404
+ * theoretically possible that a better path could exist, but rippled won't
405
+ * find it.) Until you close the pathfinding request, rippled continues to
406
+ * send updates each time a new ledger closes.
407
+ */
408
+ full_reply: boolean
409
+ /** The ID provided in the WebSocket request is included again at this level. */
410
+ id: number | string
411
+ /** Currency Amount that would be spent in the transaction. */
412
+ send_max?: Amount
413
+ /**
414
+ * Array of objects with suggested paths to take. If empty, then no paths
415
+ * were found connecting the source and destination accounts.
416
+ */
417
+ alternatives:
418
+ | []
419
+ | {
420
+ paths_computed: Path[]
421
+ source_amount: Amount
422
+ }
423
+ }
424
+
425
+ /**
426
+ * @category Streams
427
+ */
428
+ export type Stream =
429
+ | LedgerStream
430
+ | ValidationStream
431
+ | TransactionStream
432
+ | PathFindStream
433
+ | PeerStatusStream
434
+ | OrderBookStream
435
+ | ConsensusStream
@@ -0,0 +1,47 @@
1
+ import { ResponseOnlyTxInfo } from '../common'
2
+ import { Transaction, TransactionMetadata } from '../transactions'
3
+
4
+ import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
5
+
6
+ /**
7
+ * The `transaction_entry` method retrieves information on a single transaction
8
+ * from a specific ledger version. Expects a response in the form of a
9
+ * {@link TransactionEntryResponse}.
10
+ *
11
+ * @category Requests
12
+ */
13
+ export interface TransactionEntryRequest
14
+ extends BaseRequest,
15
+ LookupByLedgerRequest {
16
+ command: 'transaction_entry'
17
+
18
+ /** Unique hash of the transaction you are looking up. */
19
+ tx_hash: string
20
+ }
21
+
22
+ /**
23
+ * Response expected from a {@link TransactionEntryRequest}.
24
+ *
25
+ * @category Responses
26
+ */
27
+ export interface TransactionEntryResponse extends BaseResponse {
28
+ result: {
29
+ /**
30
+ * The identifying hash of the ledger version the transaction was found in;
31
+ * this is the same as the one from the request.
32
+ */
33
+ ledger_hash: string
34
+ /**
35
+ * The ledger index of the ledger version the transaction was found in;
36
+ * this is the same as the one from the request.
37
+ */
38
+ ledger_index: number
39
+ /**
40
+ * The transaction metadata, which shows the exact results of the
41
+ * transaction in detail.
42
+ */
43
+ metadata: TransactionMetadata
44
+ /** JSON representation of the Transaction object. */
45
+ tx_json: Transaction & ResponseOnlyTxInfo
46
+ }
47
+ }
@@ -0,0 +1,69 @@
1
+ import { Transaction, TransactionMetadata } from '../transactions'
2
+ import { BaseTransaction } from '../transactions/common'
3
+
4
+ import { BaseRequest, BaseResponse } from './baseMethod'
5
+
6
+ /**
7
+ * The tx method retrieves information on a single transaction, by its
8
+ * identifying hash. Expects a response in the form of a {@link TxResponse}.
9
+ *
10
+ * @category Requests
11
+ */
12
+ export interface TxRequest extends BaseRequest {
13
+ command: 'tx'
14
+ transaction: string
15
+ /**
16
+ * If true, return transaction data and metadata as binary serialized to
17
+ * hexadecimal strings. If false, return transaction data and metadata as.
18
+ * JSON. The default is false.
19
+ */
20
+ binary?: boolean
21
+ /**
22
+ * Use this with max_ledger to specify a range of up to 1000 ledger indexes,
23
+ * starting with this ledger (inclusive). If the server cannot find the
24
+ * transaction, it confirms whether it was able to search all the ledgers in
25
+ * this range.
26
+ */
27
+ min_ledger?: number
28
+ /**
29
+ * Use this with min_ledger to specify a range of up to 1000 ledger indexes,
30
+ * ending with this ledger (inclusive). If the server cannot find the
31
+ * transaction, it confirms whether it was able to search all the ledgers in
32
+ * the requested range.
33
+ */
34
+ max_ledger?: number
35
+ }
36
+
37
+ /**
38
+ * Response expected from a {@link TxRequest}.
39
+ *
40
+ * @category Responses
41
+ */
42
+ export interface TxResponse<T extends BaseTransaction = Transaction>
43
+ extends BaseResponse {
44
+ result: {
45
+ /** The SHA-512 hash of the transaction. */
46
+ hash: string
47
+ /** The ledger index of the ledger that includes this transaction. */
48
+ ledger_index?: number
49
+ /** Transaction metadata, which describes the results of the transaction.
50
+ * Can be undefined if a transaction has not been validated yet. */
51
+ meta?: TransactionMetadata | string
52
+ /**
53
+ * If true, this data comes from a validated ledger version; if omitted or.
54
+ * Set to false, this data is not final.
55
+ */
56
+ validated?: boolean
57
+ /**
58
+ * This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
59
+ */
60
+ date?: number
61
+ } & T
62
+ /**
63
+ * If true, the server was able to search all of the specified ledger
64
+ * versions, and the transaction was in none of them. If false, the server did
65
+ * not have all of the specified ledger versions available, so it is not sure.
66
+ * If one of them might contain the transaction.
67
+ */
68
+ searched_all?: boolean
69
+ }
@@ -0,0 +1,49 @@
1
+ import { Currency, StreamType } from '../common'
2
+
3
+ import type { BaseRequest, BaseResponse } from './baseMethod'
4
+
5
+ export interface UnsubscribeBook {
6
+ taker_gets: Currency
7
+ taker_pays: Currency
8
+ both?: boolean
9
+ }
10
+
11
+ /**
12
+ * The unsubscribe command tells the server to stop sending messages for a
13
+ * particular subscription or set of subscriptions. Expects a response in the
14
+ * form of an {@link UnsubscribeResponse}.
15
+ *
16
+ * @category Requests
17
+ */
18
+ export interface UnsubscribeRequest extends BaseRequest {
19
+ command: 'unsubscribe'
20
+ /**
21
+ * Array of string names of generic streams to unsubscribe from, including.
22
+ * Ledger, server, transactions, and transactions_proposed.
23
+ */
24
+ streams?: StreamType[]
25
+ /**
26
+ * Array of unique account addresses to stop receiving updates for, in the.
27
+ * XRP Ledger's base58 format.
28
+ */
29
+ accounts?: string[]
30
+ /**
31
+ * Like accounts, but for accounts_proposed subscriptions that included
32
+ * not-yet-validated transactions.
33
+ */
34
+ accounts_proposed?: string[]
35
+ /**
36
+ * Array of objects defining order books to unsubscribe from, as explained
37
+ * below.
38
+ */
39
+ books?: UnsubscribeBook[]
40
+ }
41
+
42
+ /**
43
+ * Response expected from a {@link UnsubscribeRequest}.
44
+ *
45
+ * @category Responses
46
+ */
47
+ export interface UnsubscribeResponse extends BaseResponse {
48
+ result: Record<string, never>
49
+ }