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,217 @@
1
+ import BaseLedgerEntry from './BaseLedgerEntry'
2
+
3
+ /**
4
+ * The AccountRoot object type describes a single account, its settings, and
5
+ * XRP balance.
6
+ *
7
+ * @category Ledger Entries
8
+ */
9
+ export default interface AccountRoot extends BaseLedgerEntry {
10
+ LedgerEntryType: 'AccountRoot'
11
+ /** The identifying (classic) address of this account. */
12
+ Account: string
13
+ /** The account's current XRP balance in drops, represented as a string. */
14
+ Balance: string
15
+ /** A bit-map of boolean flags enabled for this account. */
16
+ Flags: number
17
+ /**
18
+ * The number of objects this account owns in the ledger, which contributes
19
+ * to its owner reserve.
20
+ */
21
+ OwnerCount: number
22
+ /**
23
+ * The identifying hash of the transaction that most recently modified this
24
+ * object.
25
+ */
26
+ PreviousTxnID: string
27
+ /**
28
+ * The index of the ledger that contains the transaction that most recently
29
+ * modified this object.
30
+ */
31
+ PreviousTxnLgrSeq: number
32
+ /** The sequence number of the next valid transaction for this account. */
33
+ Sequence: number
34
+ /**
35
+ * The identifying hash of the transaction most recently sent by this
36
+ * account. This field must be enabled to use the AccountTxnID transaction
37
+ * field. To enable it, send an AccountSet transaction with the.
38
+ * `asfAccountTxnID` flag enabled.
39
+ */
40
+ AccountTxnID?: string
41
+ /**
42
+ * A domain associated with this account. In JSON, this is the hexadecimal
43
+ * for the ASCII representation of the domain.
44
+ */
45
+ Domain?: string
46
+ /** The md5 hash of an email address. */
47
+ EmailHash?: string
48
+ /**
49
+ * A public key that may be used to send encrypted messages to this account
50
+ * in JSON, uses hexadecimal.
51
+ */
52
+ MessageKey?: string
53
+ /**
54
+ * The address of a key pair that can be used to sign transactions for this
55
+ * account instead of the master key. Use a SetRegularKey transaction to
56
+ * change this value.
57
+ */
58
+ RegularKey?: string
59
+ /**
60
+ * How many Tickets this account owns in the ledger. This is updated
61
+ * automatically to ensure that the account stays within the hard limit of 250.
62
+ * Tickets at a time.
63
+ */
64
+ TicketCount?: number
65
+ /**
66
+ * How many significant digits to use for exchange rates of Offers involving
67
+ * currencies issued by this address. Valid values are 3 to 15, inclusive.
68
+ */
69
+ TickSize?: number
70
+ /**
71
+ * A transfer fee to charge other users for sending currency issued by this
72
+ * account to each other.
73
+ */
74
+ TransferRate?: number
75
+ /** An arbitrary 256-bit value that users can set. */
76
+ WalletLocator?: string
77
+ /** Total NFTokens this account's issued that have been burned. This number is always equal or less than MintedNFTokens. */
78
+ BurnedNFTokens?: number
79
+ /** The sequence that the account first minted an NFToken */
80
+ FirstNFTSequence: number
81
+ /** Total NFTokens have been minted by and on behalf of this account. */
82
+ MintedNFTokens?: number
83
+ /** Another account that can mint NFTokens on behalf of this account. */
84
+ NFTokenMinter?: string
85
+ }
86
+
87
+ /**
88
+ * A boolean map of AccountRootFlags for simplified code checking AccountRoot settings.
89
+ * For submitting settings flags to the ledger, use AccountRootFlags instead.
90
+ */
91
+ export interface AccountRootFlagsInterface {
92
+ /**
93
+ * The account has used its free SetRegularKey transaction.
94
+ */
95
+ lsfPasswordSpent?: boolean
96
+ /**
97
+ * Requires incoming payments to specify a Destination Tag.
98
+ */
99
+ lsfRequireDestTag?: boolean
100
+ /**
101
+ * This account must individually approve other users for those users to hold this account's issued currencies.
102
+ */
103
+ lsfRequireAuth?: boolean
104
+ /**
105
+ * Client applications should not send XRP to this account. Not enforced by rippled.
106
+ */
107
+ lsfDisallowXRP?: boolean
108
+ /**
109
+ * Disallows use of the master key to sign transactions for this account.
110
+ */
111
+ lsfDisableMaster?: boolean
112
+ /**
113
+ * This address cannot freeze trust lines connected to it. Once enabled, cannot be disabled.
114
+ */
115
+ lsfNoFreeze?: boolean
116
+ /**
117
+ * All assets issued by this address are frozen.
118
+ */
119
+ lsfGlobalFreeze?: boolean
120
+ /**
121
+ * Enable rippling on this address's trust lines by default. Required for issuing addresses; discouraged for others.
122
+ */
123
+ lsfDefaultRipple?: boolean
124
+ /**
125
+ * This account can only receive funds from transactions it sends, and from preauthorized accounts.
126
+ * (It has DepositAuth enabled.)
127
+ */
128
+ lsfDepositAuth?: boolean
129
+ /**
130
+ * This account is an Automated Market Maker (AMM) instance.
131
+ */
132
+ lsfAMM?: boolean
133
+ /**
134
+ * Disallow incoming NFTOffers from other accounts.
135
+ */
136
+ lsfDisallowIncomingNFTokenOffer?: boolean
137
+ /**
138
+ * Disallow incoming Checks from other accounts.
139
+ */
140
+ lsfDisallowIncomingCheck?: boolean
141
+ /**
142
+ * Disallow incoming PayChannels from other accounts.
143
+ */
144
+ lsfDisallowIncomingPayChan?: boolean
145
+ /**
146
+ * Disallow incoming Trustlines from other accounts.
147
+ */
148
+ lsfDisallowIncomingTrustline?: boolean
149
+ /**
150
+ * This address can claw back issued IOUs. Once enabled, cannot be disabled.
151
+ */
152
+ lsfAllowTrustLineClawback?: boolean
153
+ }
154
+
155
+ export enum AccountRootFlags {
156
+ /**
157
+ * The account has used its free SetRegularKey transaction.
158
+ */
159
+ lsfPasswordSpent = 0x00010000,
160
+ /**
161
+ * Requires incoming payments to specify a Destination Tag.
162
+ */
163
+ lsfRequireDestTag = 0x00020000,
164
+ /**
165
+ * This account must individually approve other users for those users to hold this account's issued currencies.
166
+ */
167
+ lsfRequireAuth = 0x00040000,
168
+ /**
169
+ * Client applications should not send XRP to this account. Not enforced by rippled.
170
+ */
171
+ lsfDisallowXRP = 0x00080000,
172
+ /**
173
+ * Disallows use of the master key to sign transactions for this account.
174
+ */
175
+ lsfDisableMaster = 0x00100000,
176
+ /**
177
+ * This address cannot freeze trust lines connected to it. Once enabled, cannot be disabled.
178
+ */
179
+ lsfNoFreeze = 0x00200000,
180
+ /**
181
+ * All assets issued by this address are frozen.
182
+ */
183
+ lsfGlobalFreeze = 0x00400000,
184
+ /**
185
+ * Enable rippling on this address's trust lines by default. Required for issuing addresses; discouraged for others.
186
+ */
187
+ lsfDefaultRipple = 0x00800000,
188
+ /**
189
+ * This account can only receive funds from transactions it sends, and from preauthorized accounts.
190
+ * (It has DepositAuth enabled.)
191
+ */
192
+ lsfDepositAuth = 0x01000000,
193
+ /**
194
+ * This account is an Automated Market Maker (AMM) instance.
195
+ */
196
+ lsfAMM = 0x02000000,
197
+ /**
198
+ * Disallow incoming NFTOffers from other accounts.
199
+ */
200
+ lsfDisallowIncomingNFTokenOffer = 0x04000000,
201
+ /**
202
+ * Disallow incoming Checks from other accounts.
203
+ */
204
+ lsfDisallowIncomingCheck = 0x08000000,
205
+ /**
206
+ * Disallow incoming PayChannels from other accounts.
207
+ */
208
+ lsfDisallowIncomingPayChan = 0x10000000,
209
+ /**
210
+ * Disallow incoming Trustlines from other accounts.
211
+ */
212
+ lsfDisallowIncomingTrustline = 0x20000000,
213
+ /**
214
+ * This address can claw back issued IOUs. Once enabled, cannot be disabled.
215
+ */
216
+ lsfAllowTrustLineClawback = 0x80000000,
217
+ }
@@ -0,0 +1,45 @@
1
+ import BaseLedgerEntry from './BaseLedgerEntry'
2
+
3
+ /**
4
+ * The unique id for the Amendments object https://xrpl.org/amendments-object.html#amendments-id-format
5
+ */
6
+ export const AMENDMENTS_ID =
7
+ '7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4'
8
+
9
+ export interface Majority {
10
+ Majority: {
11
+ /** The Amendment ID of the pending amendment. */
12
+ Amendment: string
13
+ /**
14
+ * The `close_time` field of the ledger version where this amendment most
15
+ * recently gained a majority.
16
+ */
17
+ CloseTime: number
18
+ }
19
+ }
20
+
21
+ /**
22
+ * The Amendments object type contains a list of Amendments that are currently
23
+ * active.
24
+ *
25
+ * @category Ledger Entries
26
+ */
27
+ export default interface Amendments extends BaseLedgerEntry {
28
+ LedgerEntryType: 'Amendments'
29
+ /**
30
+ * Array of 256-bit amendment IDs for all currently-enabled amendments. If
31
+ * omitted, there are no enabled amendments.
32
+ */
33
+ Amendments?: string[]
34
+ /**
35
+ * Array of objects describing the status of amendments that have majority
36
+ * support but are not yet enabled. If omitted, there are no pending
37
+ * amendments with majority support.
38
+ */
39
+ Majorities?: Majority[]
40
+ /**
41
+ * A bit-map of boolean flags. No flags are defined for the Amendments object
42
+ * type, so this value is always 0.
43
+ */
44
+ Flags: 0
45
+ }
@@ -0,0 +1,3 @@
1
+ export default interface BaseLedgerEntry {
2
+ index: string
3
+ }
@@ -0,0 +1,70 @@
1
+ import { Amount } from '../common'
2
+
3
+ import BaseLedgerEntry from './BaseLedgerEntry'
4
+
5
+ /**
6
+ * A Check object describes a check, similar to a paper personal check, which
7
+ * can be cashed by its destination to get money from its sender.
8
+ *
9
+ * @category Ledger Entries
10
+ */
11
+ export default interface Check extends BaseLedgerEntry {
12
+ LedgerEntryType: 'Check'
13
+ /** The sender of the Check. Cashing the Check debits this address's balance. */
14
+ Account: string
15
+ /**
16
+ * The intended recipient of the Check. Only this address can cash the Check,
17
+ * using a CheckCash transaction.
18
+ */
19
+ Destination: string
20
+ /**
21
+ * A bit-map of boolean flags. No flags are defined for Checks, so this value
22
+ * is always 0.
23
+ */
24
+ Flags: 0
25
+ /**
26
+ * A hint indicating which page of the sender's owner directory links to this
27
+ * object, in case the directory consists of multiple pages.
28
+ */
29
+ OwnerNode: string
30
+ /**
31
+ * The identifying hash of the transaction that most recently modified this
32
+ * object.
33
+ */
34
+ PreviousTxnID: string
35
+ /**
36
+ * The index of the ledger that contains the transaction that most recently
37
+ * modified this object.
38
+ */
39
+ PreviousTxnLgrSeq: number
40
+ /**
41
+ * The maximum amount of currency this Check can debit the sender. If the
42
+ * Check is successfully cashed, the destination is credited in the same
43
+ * currency for up to this amount.
44
+ */
45
+ SendMax: Amount
46
+ /** The sequence number of the CheckCreate transaction that created this check. */
47
+ Sequence: number
48
+ /**
49
+ * A hint indicating which page of the destination's owner directory links to
50
+ * this object, in case the directory consists of multiple pages.
51
+ */
52
+ DestinationNode?: string
53
+ /**
54
+ * An arbitrary tag to further specify the destination for this Check, such
55
+ * as a hosted recipient at the destination address.
56
+ */
57
+ DestinationTag?: number
58
+ /** Indicates the time after which this Check is considered expired. */
59
+ Expiration?: number
60
+ /**
61
+ * Arbitrary 256-bit hash provided by the sender as a specific reason or
62
+ * identifier for this Check.
63
+ */
64
+ InvoiceID?: string
65
+ /**
66
+ * An arbitrary tag to further specify the source for this Check, such as a
67
+ * hosted recipient at the sender's address.
68
+ */
69
+ SourceTag?: number
70
+ }
@@ -0,0 +1,35 @@
1
+ import BaseLedgerEntry from './BaseLedgerEntry'
2
+
3
+ /**
4
+ * A DepositPreauth object tracks a preauthorization from one account to
5
+ * another. DepositPreauth transactions create these objects.
6
+ *
7
+ * @category Ledger Entries
8
+ */
9
+ export default interface DepositPreauth extends BaseLedgerEntry {
10
+ LedgerEntryType: 'DepositPreauth'
11
+ /** The account that granted the preauthorization. */
12
+ Account: string
13
+ /** The account that received the preauthorization. */
14
+ Authorize: string
15
+ /**
16
+ * A bit-map of boolean flags. No flags are defined for DepositPreauth
17
+ * objects, so this value is always 0.
18
+ */
19
+ Flags: 0
20
+ /**
21
+ * A hint indicating which page of the sender's owner directory links to this
22
+ * object, in case the directory consists of multiple pages.
23
+ */
24
+ OwnerNode: string
25
+ /**
26
+ * The identifying hash of the transaction that most recently modified this
27
+ * object.
28
+ */
29
+ PreviousTxnID: string
30
+ /**
31
+ * The index of the ledger that contains the transaction that most recently
32
+ * modified this object.
33
+ */
34
+ PreviousTxnLgrSeq: number
35
+ }
@@ -0,0 +1,46 @@
1
+ import BaseLedgerEntry from './BaseLedgerEntry'
2
+
3
+ /**
4
+ * The DirectoryNode object type provides a list of links to other objects in
5
+ * the ledger's state tree.
6
+ *
7
+ * @category Ledger Entries
8
+ */
9
+ export default interface DirectoryNode extends BaseLedgerEntry {
10
+ LedgerEntryType: 'DirectoryNode'
11
+ /**
12
+ * A bit-map of boolean flags enabled for this directory. Currently, the
13
+ * protocol defines no flags for DirectoryNode objects.
14
+ */
15
+ Flags: number
16
+ /** The ID of root object for this directory. */
17
+ RootIndex: string
18
+ /** The contents of this Directory: an array of IDs of other objects. */
19
+ Indexes: string[]
20
+ /**
21
+ * If this Directory consists of multiple pages, this ID links to the next
22
+ * object in the chain, wrapping around at the end.
23
+ */
24
+ IndexNext?: number
25
+ /**
26
+ * If this Directory consists of multiple pages, this ID links to the
27
+ * previous object in the chain, wrapping around at the beginning.
28
+ */
29
+ IndexPrevious?: number
30
+ /** The address of the account that owns the objects in this directory. */
31
+ Owner?: string
32
+ /**
33
+ * The currency code of the TakerPays amount from the offers in this
34
+ * directory.
35
+ */
36
+ TakerPaysCurrency?: string
37
+ /** The issuer of the TakerPays amount from the offers in this directory. */
38
+ TakerPaysIssuer?: string
39
+ /**
40
+ * The currency code of the TakerGets amount from the offers in this
41
+ * directory.
42
+ */
43
+ TakerGetsCurrency?: string
44
+ /** The issuer of the TakerGets amount from the offers in this directory. */
45
+ TakerGetsIssuer?: string
46
+ }
@@ -0,0 +1,74 @@
1
+ import BaseLedgerEntry from './BaseLedgerEntry'
2
+
3
+ /**
4
+ * The Escrow object type represents a held payment of XRP waiting to be
5
+ * executed or canceled.
6
+ *
7
+ * @category Ledger Entries
8
+ */
9
+ export default interface Escrow extends BaseLedgerEntry {
10
+ LedgerEntryType: 'Escrow'
11
+ /**
12
+ * The address of the owner (sender) of this held payment. This is the
13
+ * account that provided the XRP, and gets it back if the held payment is
14
+ * canceled.
15
+ */
16
+ Account: string
17
+ /**
18
+ * The destination address where the XRP is paid if the held payment is
19
+ * successful.
20
+ */
21
+ Destination: string
22
+ /** The amount of XRP, in drops, to be delivered by the held payment. */
23
+ Amount: string
24
+ /**
25
+ * A PREIMAGE-SHA-256 crypto-condition, as hexadecimal. If present, the
26
+ * EscrowFinish transaction must contain a fulfillment that satisfies this
27
+ * condition.
28
+ */
29
+ Condition?: string
30
+ /**
31
+ * The time after which this Escrow is considered expired.
32
+ */
33
+ CancelAfter?: number
34
+ /**
35
+ * The time, in seconds, since the Ripple Epoch, after which this held payment
36
+ * can be finished. Any EscrowFinish transaction before this time fails.
37
+ */
38
+ FinishAfter?: number
39
+ /**
40
+ * A bit-map of boolean flags. No flags are defined for the Escrow type, so
41
+ * this value is always 0.
42
+ */
43
+ Flags: number
44
+ /**
45
+ * An arbitrary tag to further specify the source for this held payment, such
46
+ * as a hosted recipient at the owner's address.
47
+ */
48
+ SourceTag?: number
49
+ /**
50
+ * An arbitrary tag to further specify the destination for this held payment,
51
+ * such as a hosted recipient at the destination address.
52
+ */
53
+ DestinationTag?: number
54
+ /**
55
+ * A hint indicating which page of the owner directory links to this object,
56
+ * in case the directory consists of multiple pages.
57
+ */
58
+ OwnerNode: string
59
+ /**
60
+ * A hint indicating which page of the destination's owner directory links to
61
+ * this object, in case the directory consists of multiple pages.
62
+ */
63
+ DestinationNode?: string
64
+ /**
65
+ * The identifying hash of the transaction that most recently modified this
66
+ * object.
67
+ */
68
+ PreviousTxnID: string
69
+ /**
70
+ * The index of the ledger that contains the transaction that most recently
71
+ * modified this object.
72
+ */
73
+ PreviousTxnLgrSeq: number
74
+ }
@@ -0,0 +1,52 @@
1
+ import BaseLedgerEntry from './BaseLedgerEntry'
2
+
3
+ /**
4
+ * The unique id for the FeeSettings object https://xrpl.org/feesettings.html#feesettings-id-format
5
+ */
6
+ export const FEE_SETTINGS_ID =
7
+ '4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A651'
8
+
9
+ export interface FeeSettingsPreAmendmentFields {
10
+ /** The transaction cost of the "reference transaction" in drops of XRP as hexadecimal. */
11
+ BaseFee: string
12
+ /** The BaseFee translated into "fee units". */
13
+ ReferenceFeeUnits: number
14
+ /** The base reserve for an account in the XRP Ledger, as drops of XRP. */
15
+ ReserveBase: number
16
+ /** The incremental owner reserve for owning objects, as drops of XRP. */
17
+ ReserveIncrement: number
18
+ }
19
+
20
+ export interface FeeSettingsPostAmendmentFields {
21
+ /** The transaction cost of the "reference transaction" in drops of XRP as hexadecimal. */
22
+ BaseFeeDrops: string
23
+ /** The base reserve for an account in the XRP Ledger, as drops of XRP. */
24
+ ReserveBaseDrops: string
25
+ /** The incremental owner reserve for owning objects, as drops of XRP. */
26
+ ReserveIncrementDrops: string
27
+ }
28
+
29
+ export interface FeeSettingsBase extends BaseLedgerEntry {
30
+ LedgerEntryType: 'FeeSettings'
31
+ /**
32
+ * A bit-map of boolean flags for this object. No flags are defined for this type.
33
+ */
34
+ Flags: 0
35
+ }
36
+
37
+ /**
38
+ * The FeeSettings object type contains the current base transaction cost and
39
+ * reserve amounts as determined by fee voting.
40
+ *
41
+ * The fields will be based on the status of the `XRPFees` amendment.
42
+ * - Before: {@link FeeSettingsPreAmendmentFields}
43
+ * - After: {@link FeeSettingsPostAmendmentFields}
44
+ *
45
+ * @interface
46
+ *
47
+ * @category Ledger Entries
48
+ */
49
+ type FeeSettings = FeeSettingsBase &
50
+ (FeeSettingsPreAmendmentFields | FeeSettingsPostAmendmentFields)
51
+
52
+ export default FeeSettings
@@ -0,0 +1,65 @@
1
+ import { Transaction, TransactionMetadata } from '../transactions'
2
+
3
+ import LedgerEntry from './LedgerEntry'
4
+
5
+ /**
6
+ * A ledger is a block of transactions and shared state data. It has a unique
7
+ * header that describes its contents using cryptographic hashes.
8
+ *
9
+ * @category Ledger Entries
10
+ */
11
+ export default interface Ledger {
12
+ /** The SHA-512Half of this ledger's state tree information. */
13
+ account_hash: string
14
+ /** All the state information in this ledger. */
15
+ accountState?: LedgerEntry[]
16
+ /** A bit-map of flags relating to the closing of this ledger. */
17
+ close_flags: number
18
+ /**
19
+ * The approximate time this ledger version closed, as the number of seconds
20
+ * since the Ripple Epoch of 2000-01-01 00:00:00. This value is rounded based
21
+ * on the close_time_resolution.
22
+ */
23
+ close_time: number
24
+ /**
25
+ * The approximate time this ledger was closed, in human-readable format.
26
+ * Always uses the UTC time zone.
27
+ */
28
+ close_time_human: string
29
+ /**
30
+ * An integer in the range [2,120] indicating the maximum number of seconds
31
+ * by which the close_time could be rounded.
32
+ */
33
+ close_time_resolution: number
34
+ /** Whether or not this ledger has been closed. */
35
+ closed: boolean
36
+ /**
37
+ * The SHA-512Half of this ledger version. This serves as a unique identifier
38
+ * for this ledger and all its contents.
39
+ */
40
+ ledger_hash: string
41
+ /**
42
+ * The ledger index of the ledger. Some API methods display this as a quoted
43
+ * integer; some display it as a native JSON number.
44
+ */
45
+ ledger_index: string
46
+ /** The approximate time at which the previous ledger was closed. */
47
+ parent_close_time: number
48
+ /**
49
+ * Unique identifying hash of the ledger that came immediately before this
50
+ * one.
51
+ */
52
+ parent_hash: string
53
+ /** Total number of XRP drops in the network, as a quoted integer. */
54
+ total_coins: string
55
+ /** Hash of the transaction information included in this ledger, as hex. */
56
+ transaction_hash: string
57
+ /**
58
+ * Transactions applied in this ledger version. By default, members are the
59
+ * transactions' identifying Hash strings. If the request specified expand as
60
+ * true, members are full representations of the transactions instead, in
61
+ * either JSON or binary depending on whether the request specified binary
62
+ * as true.
63
+ */
64
+ transactions?: Array<Transaction & { metaData?: TransactionMetadata }>
65
+ }
@@ -0,0 +1,34 @@
1
+ import AccountRoot from './AccountRoot'
2
+ import Amendments from './Amendments'
3
+ import AMM from './AMM'
4
+ import Check from './Check'
5
+ import DepositPreauth from './DepositPreauth'
6
+ import DirectoryNode from './DirectoryNode'
7
+ import Escrow from './Escrow'
8
+ import FeeSettings from './FeeSettings'
9
+ import LedgerHashes from './LedgerHashes'
10
+ import NegativeUNL from './NegativeUNL'
11
+ import Offer from './Offer'
12
+ import PayChannel from './PayChannel'
13
+ import RippleState from './RippleState'
14
+ import SignerList from './SignerList'
15
+ import Ticket from './Ticket'
16
+
17
+ type LedgerEntry =
18
+ | AccountRoot
19
+ | Amendments
20
+ | AMM
21
+ | Check
22
+ | DepositPreauth
23
+ | DirectoryNode
24
+ | Escrow
25
+ | FeeSettings
26
+ | LedgerHashes
27
+ | NegativeUNL
28
+ | Offer
29
+ | PayChannel
30
+ | RippleState
31
+ | SignerList
32
+ | Ticket
33
+
34
+ export default LedgerEntry
@@ -0,0 +1,24 @@
1
+ import BaseLedgerEntry from './BaseLedgerEntry'
2
+
3
+ /**
4
+ * The LedgerHashes objects exist to make it possible to look up a previous
5
+ * ledger's hash with only the current ledger version and at most one lookup of
6
+ * a previous ledger version.
7
+ *
8
+ * @category Ledger Entries
9
+ */
10
+ export default interface LedgerHashes extends BaseLedgerEntry {
11
+ LedgerEntryType: 'LedgerHashes'
12
+ /** The Ledger Index of the last entry in this object's Hashes array. */
13
+ LastLedgerSequence?: number
14
+ /**
15
+ * An array of up to 256 ledger hashes. The contents depend on which sub-type
16
+ * of LedgerHashes object this is.
17
+ */
18
+ Hashes: string[]
19
+ /**
20
+ * A bit-map of boolean flags for this object. No flags are defined for this
21
+ * type.
22
+ */
23
+ Flags: number
24
+ }
@@ -0,0 +1,16 @@
1
+ import { Amount } from '../common'
2
+
3
+ import BaseLedgerEntry from './BaseLedgerEntry'
4
+
5
+ export interface NFTokenOffer extends BaseLedgerEntry {
6
+ LedgerEntryType: 'NFTokenOffer'
7
+ Amount: Amount
8
+ Destination?: string
9
+ Expiration: number
10
+ Flags: number
11
+ NFTokenOfferNode?: string
12
+ Owner: string
13
+ OwnerNode?: string
14
+ PreviousTxnID: string
15
+ PreviousTxnLgrSeq: number
16
+ }