xrpl 3.0.0 → 4.0.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 (292) hide show
  1. package/README.md +3 -3
  2. package/build/xrpl-latest-min.js +1 -1
  3. package/build/xrpl-latest-min.js.map +1 -1
  4. package/build/xrpl-latest.js +424 -893
  5. package/build/xrpl-latest.js.map +1 -1
  6. package/dist/npm/Wallet/defaultFaucets.d.ts +1 -2
  7. package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
  8. package/dist/npm/Wallet/defaultFaucets.js +0 -5
  9. package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
  10. package/dist/npm/Wallet/fundWallet.d.ts.map +1 -1
  11. package/dist/npm/Wallet/fundWallet.js +1 -5
  12. package/dist/npm/Wallet/fundWallet.js.map +1 -1
  13. package/dist/npm/client/RequestManager.d.ts +5 -4
  14. package/dist/npm/client/RequestManager.d.ts.map +1 -1
  15. package/dist/npm/client/RequestManager.js.map +1 -1
  16. package/dist/npm/client/connection.d.ts +2 -2
  17. package/dist/npm/client/connection.d.ts.map +1 -1
  18. package/dist/npm/client/connection.js.map +1 -1
  19. package/dist/npm/client/index.d.ts +4 -3
  20. package/dist/npm/client/index.d.ts.map +1 -1
  21. package/dist/npm/client/index.js +17 -10
  22. package/dist/npm/client/index.js.map +1 -1
  23. package/dist/npm/client/partialPayment.d.ts +2 -1
  24. package/dist/npm/client/partialPayment.d.ts.map +1 -1
  25. package/dist/npm/client/partialPayment.js +10 -3
  26. package/dist/npm/client/partialPayment.js.map +1 -1
  27. package/dist/npm/models/common/index.d.ts +13 -0
  28. package/dist/npm/models/common/index.d.ts.map +1 -1
  29. package/dist/npm/models/common/index.js +4 -0
  30. package/dist/npm/models/common/index.js.map +1 -1
  31. package/dist/npm/models/ledger/AMM.d.ts +2 -2
  32. package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
  33. package/dist/npm/models/ledger/Amendments.d.ts +2 -2
  34. package/dist/npm/models/ledger/Amendments.d.ts.map +1 -1
  35. package/dist/npm/models/ledger/BaseLedgerEntry.d.ts +3 -3
  36. package/dist/npm/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
  37. package/dist/npm/models/ledger/DirectoryNode.d.ts +2 -2
  38. package/dist/npm/models/ledger/DirectoryNode.d.ts.map +1 -1
  39. package/dist/npm/models/ledger/FeeSettings.d.ts +2 -2
  40. package/dist/npm/models/ledger/FeeSettings.d.ts.map +1 -1
  41. package/dist/npm/models/ledger/Ledger.d.ts +11 -2
  42. package/dist/npm/models/ledger/Ledger.d.ts.map +1 -1
  43. package/dist/npm/models/ledger/LedgerEntry.d.ts +3 -2
  44. package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
  45. package/dist/npm/models/ledger/LedgerHashes.d.ts +2 -2
  46. package/dist/npm/models/ledger/LedgerHashes.d.ts.map +1 -1
  47. package/dist/npm/models/ledger/NegativeUNL.d.ts +2 -2
  48. package/dist/npm/models/ledger/NegativeUNL.d.ts.map +1 -1
  49. package/dist/npm/models/ledger/Oracle.d.ts +12 -0
  50. package/dist/npm/models/ledger/Oracle.d.ts.map +1 -0
  51. package/dist/npm/models/ledger/Oracle.js +3 -0
  52. package/dist/npm/models/ledger/Oracle.js.map +1 -0
  53. package/dist/npm/models/ledger/RippleState.d.ts +2 -1
  54. package/dist/npm/models/ledger/RippleState.d.ts.map +1 -1
  55. package/dist/npm/models/ledger/RippleState.js +1 -0
  56. package/dist/npm/models/ledger/RippleState.js.map +1 -1
  57. package/dist/npm/models/ledger/index.d.ts +3 -2
  58. package/dist/npm/models/ledger/index.d.ts.map +1 -1
  59. package/dist/npm/models/ledger/index.js.map +1 -1
  60. package/dist/npm/models/methods/accountChannels.d.ts +1 -1
  61. package/dist/npm/models/methods/accountChannels.d.ts.map +1 -1
  62. package/dist/npm/models/methods/accountInfo.d.ts +17 -4
  63. package/dist/npm/models/methods/accountInfo.d.ts.map +1 -1
  64. package/dist/npm/models/methods/accountTx.d.ts +11 -5
  65. package/dist/npm/models/methods/accountTx.d.ts.map +1 -1
  66. package/dist/npm/models/methods/feature.d.ts +28 -0
  67. package/dist/npm/models/methods/feature.d.ts.map +1 -0
  68. package/dist/npm/models/methods/feature.js +3 -0
  69. package/dist/npm/models/methods/feature.js.map +1 -0
  70. package/dist/npm/models/methods/getAggregatePrice.d.ts +31 -0
  71. package/dist/npm/models/methods/getAggregatePrice.d.ts.map +1 -0
  72. package/dist/npm/models/methods/getAggregatePrice.js +3 -0
  73. package/dist/npm/models/methods/getAggregatePrice.js.map +1 -0
  74. package/dist/npm/models/methods/index.d.ts +15 -11
  75. package/dist/npm/models/methods/index.d.ts.map +1 -1
  76. package/dist/npm/models/methods/ledger.d.ts +17 -5
  77. package/dist/npm/models/methods/ledger.d.ts.map +1 -1
  78. package/dist/npm/models/methods/nftsByIssuer.d.ts +19 -0
  79. package/dist/npm/models/methods/nftsByIssuer.d.ts.map +1 -0
  80. package/dist/npm/models/methods/nftsByIssuer.js +3 -0
  81. package/dist/npm/models/methods/nftsByIssuer.js.map +1 -0
  82. package/dist/npm/models/methods/submitMultisigned.d.ts +16 -5
  83. package/dist/npm/models/methods/submitMultisigned.d.ts.map +1 -1
  84. package/dist/npm/models/methods/tx.d.ts +20 -8
  85. package/dist/npm/models/methods/tx.d.ts.map +1 -1
  86. package/dist/npm/models/transactions/AMMDeposit.d.ts +3 -1
  87. package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
  88. package/dist/npm/models/transactions/AMMDeposit.js +1 -0
  89. package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
  90. package/dist/npm/models/transactions/index.d.ts +2 -0
  91. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  92. package/dist/npm/models/transactions/index.js.map +1 -1
  93. package/dist/npm/models/transactions/metadata.d.ts +3 -0
  94. package/dist/npm/models/transactions/metadata.d.ts.map +1 -1
  95. package/dist/npm/models/transactions/metadata.js.map +1 -1
  96. package/dist/npm/models/transactions/oracleDelete.d.ts +7 -0
  97. package/dist/npm/models/transactions/oracleDelete.d.ts.map +1 -0
  98. package/dist/npm/models/transactions/oracleDelete.js +10 -0
  99. package/dist/npm/models/transactions/oracleDelete.js.map +1 -0
  100. package/dist/npm/models/transactions/oracleSet.d.ts +13 -0
  101. package/dist/npm/models/transactions/oracleSet.d.ts.map +1 -0
  102. package/dist/npm/models/transactions/oracleSet.js +59 -0
  103. package/dist/npm/models/transactions/oracleSet.js.map +1 -0
  104. package/dist/npm/models/transactions/payment.d.ts +2 -2
  105. package/dist/npm/models/transactions/payment.js +1 -1
  106. package/dist/npm/models/transactions/transaction.d.ts +3 -1
  107. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  108. package/dist/npm/models/transactions/transaction.js +8 -0
  109. package/dist/npm/models/transactions/transaction.js.map +1 -1
  110. package/dist/npm/snippets/src/claimPayChannel.js +1 -1
  111. package/dist/npm/snippets/src/claimPayChannel.js.map +1 -1
  112. package/dist/npm/snippets/src/sendEscrow.js +1 -1
  113. package/dist/npm/snippets/src/sendEscrow.js.map +1 -1
  114. package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
  115. package/dist/npm/src/Wallet/defaultFaucets.d.ts +1 -2
  116. package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
  117. package/dist/npm/src/Wallet/defaultFaucets.js +0 -5
  118. package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
  119. package/dist/npm/src/Wallet/fundWallet.d.ts.map +1 -1
  120. package/dist/npm/src/Wallet/fundWallet.js +1 -5
  121. package/dist/npm/src/Wallet/fundWallet.js.map +1 -1
  122. package/dist/npm/src/client/RequestManager.d.ts +5 -4
  123. package/dist/npm/src/client/RequestManager.d.ts.map +1 -1
  124. package/dist/npm/src/client/RequestManager.js.map +1 -1
  125. package/dist/npm/src/client/connection.d.ts +2 -2
  126. package/dist/npm/src/client/connection.d.ts.map +1 -1
  127. package/dist/npm/src/client/connection.js.map +1 -1
  128. package/dist/npm/src/client/index.d.ts +4 -3
  129. package/dist/npm/src/client/index.d.ts.map +1 -1
  130. package/dist/npm/src/client/index.js +17 -10
  131. package/dist/npm/src/client/index.js.map +1 -1
  132. package/dist/npm/src/client/partialPayment.d.ts +2 -1
  133. package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
  134. package/dist/npm/src/client/partialPayment.js +10 -3
  135. package/dist/npm/src/client/partialPayment.js.map +1 -1
  136. package/dist/npm/src/models/common/index.d.ts +13 -0
  137. package/dist/npm/src/models/common/index.d.ts.map +1 -1
  138. package/dist/npm/src/models/common/index.js +4 -0
  139. package/dist/npm/src/models/common/index.js.map +1 -1
  140. package/dist/npm/src/models/ledger/AMM.d.ts +2 -2
  141. package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
  142. package/dist/npm/src/models/ledger/Amendments.d.ts +2 -2
  143. package/dist/npm/src/models/ledger/Amendments.d.ts.map +1 -1
  144. package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts +3 -3
  145. package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
  146. package/dist/npm/src/models/ledger/DirectoryNode.d.ts +2 -2
  147. package/dist/npm/src/models/ledger/DirectoryNode.d.ts.map +1 -1
  148. package/dist/npm/src/models/ledger/FeeSettings.d.ts +2 -2
  149. package/dist/npm/src/models/ledger/FeeSettings.d.ts.map +1 -1
  150. package/dist/npm/src/models/ledger/Ledger.d.ts +11 -2
  151. package/dist/npm/src/models/ledger/Ledger.d.ts.map +1 -1
  152. package/dist/npm/src/models/ledger/LedgerEntry.d.ts +3 -2
  153. package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
  154. package/dist/npm/src/models/ledger/LedgerHashes.d.ts +2 -2
  155. package/dist/npm/src/models/ledger/LedgerHashes.d.ts.map +1 -1
  156. package/dist/npm/src/models/ledger/NegativeUNL.d.ts +2 -2
  157. package/dist/npm/src/models/ledger/NegativeUNL.d.ts.map +1 -1
  158. package/dist/npm/src/models/ledger/Oracle.d.ts +12 -0
  159. package/dist/npm/src/models/ledger/Oracle.d.ts.map +1 -0
  160. package/dist/npm/src/models/ledger/Oracle.js +3 -0
  161. package/dist/npm/src/models/ledger/Oracle.js.map +1 -0
  162. package/dist/npm/src/models/ledger/RippleState.d.ts +2 -1
  163. package/dist/npm/src/models/ledger/RippleState.d.ts.map +1 -1
  164. package/dist/npm/src/models/ledger/RippleState.js +1 -0
  165. package/dist/npm/src/models/ledger/RippleState.js.map +1 -1
  166. package/dist/npm/src/models/ledger/index.d.ts +3 -2
  167. package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
  168. package/dist/npm/src/models/ledger/index.js.map +1 -1
  169. package/dist/npm/src/models/methods/accountChannels.d.ts +1 -1
  170. package/dist/npm/src/models/methods/accountChannels.d.ts.map +1 -1
  171. package/dist/npm/src/models/methods/accountInfo.d.ts +17 -4
  172. package/dist/npm/src/models/methods/accountInfo.d.ts.map +1 -1
  173. package/dist/npm/src/models/methods/accountTx.d.ts +11 -5
  174. package/dist/npm/src/models/methods/accountTx.d.ts.map +1 -1
  175. package/dist/npm/src/models/methods/feature.d.ts +28 -0
  176. package/dist/npm/src/models/methods/feature.d.ts.map +1 -0
  177. package/dist/npm/src/models/methods/feature.js +3 -0
  178. package/dist/npm/src/models/methods/feature.js.map +1 -0
  179. package/dist/npm/src/models/methods/getAggregatePrice.d.ts +31 -0
  180. package/dist/npm/src/models/methods/getAggregatePrice.d.ts.map +1 -0
  181. package/dist/npm/src/models/methods/getAggregatePrice.js +3 -0
  182. package/dist/npm/src/models/methods/getAggregatePrice.js.map +1 -0
  183. package/dist/npm/src/models/methods/index.d.ts +15 -11
  184. package/dist/npm/src/models/methods/index.d.ts.map +1 -1
  185. package/dist/npm/src/models/methods/ledger.d.ts +17 -5
  186. package/dist/npm/src/models/methods/ledger.d.ts.map +1 -1
  187. package/dist/npm/src/models/methods/nftsByIssuer.d.ts +19 -0
  188. package/dist/npm/src/models/methods/nftsByIssuer.d.ts.map +1 -0
  189. package/dist/npm/src/models/methods/nftsByIssuer.js +3 -0
  190. package/dist/npm/src/models/methods/nftsByIssuer.js.map +1 -0
  191. package/dist/npm/src/models/methods/submitMultisigned.d.ts +16 -5
  192. package/dist/npm/src/models/methods/submitMultisigned.d.ts.map +1 -1
  193. package/dist/npm/src/models/methods/tx.d.ts +20 -8
  194. package/dist/npm/src/models/methods/tx.d.ts.map +1 -1
  195. package/dist/npm/src/models/transactions/AMMDeposit.d.ts +3 -1
  196. package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
  197. package/dist/npm/src/models/transactions/AMMDeposit.js +1 -0
  198. package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
  199. package/dist/npm/src/models/transactions/index.d.ts +2 -0
  200. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  201. package/dist/npm/src/models/transactions/index.js.map +1 -1
  202. package/dist/npm/src/models/transactions/metadata.d.ts +3 -0
  203. package/dist/npm/src/models/transactions/metadata.d.ts.map +1 -1
  204. package/dist/npm/src/models/transactions/metadata.js.map +1 -1
  205. package/dist/npm/src/models/transactions/oracleDelete.d.ts +7 -0
  206. package/dist/npm/src/models/transactions/oracleDelete.d.ts.map +1 -0
  207. package/dist/npm/src/models/transactions/oracleDelete.js +10 -0
  208. package/dist/npm/src/models/transactions/oracleDelete.js.map +1 -0
  209. package/dist/npm/src/models/transactions/oracleSet.d.ts +13 -0
  210. package/dist/npm/src/models/transactions/oracleSet.d.ts.map +1 -0
  211. package/dist/npm/src/models/transactions/oracleSet.js +59 -0
  212. package/dist/npm/src/models/transactions/oracleSet.js.map +1 -0
  213. package/dist/npm/src/models/transactions/payment.d.ts +2 -2
  214. package/dist/npm/src/models/transactions/payment.js +1 -1
  215. package/dist/npm/src/models/transactions/transaction.d.ts +3 -1
  216. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  217. package/dist/npm/src/models/transactions/transaction.js +8 -0
  218. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  219. package/dist/npm/src/sugar/autofill.d.ts +1 -1
  220. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  221. package/dist/npm/src/sugar/autofill.js +2 -4
  222. package/dist/npm/src/sugar/autofill.js.map +1 -1
  223. package/dist/npm/src/sugar/getFeeXrp.d.ts +1 -1
  224. package/dist/npm/src/sugar/getFeeXrp.d.ts.map +1 -1
  225. package/dist/npm/src/sugar/getFeeXrp.js +3 -2
  226. package/dist/npm/src/sugar/getFeeXrp.js.map +1 -1
  227. package/dist/npm/src/sugar/submit.d.ts.map +1 -1
  228. package/dist/npm/src/sugar/submit.js.map +1 -1
  229. package/dist/npm/src/utils/hashes/hashLedger.d.ts +4 -3
  230. package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
  231. package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
  232. package/dist/npm/src/utils/index.d.ts +2 -1
  233. package/dist/npm/src/utils/index.d.ts.map +1 -1
  234. package/dist/npm/src/utils/index.js.map +1 -1
  235. package/dist/npm/sugar/autofill.d.ts +1 -1
  236. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  237. package/dist/npm/sugar/autofill.js +2 -4
  238. package/dist/npm/sugar/autofill.js.map +1 -1
  239. package/dist/npm/sugar/getFeeXrp.d.ts +1 -1
  240. package/dist/npm/sugar/getFeeXrp.d.ts.map +1 -1
  241. package/dist/npm/sugar/getFeeXrp.js +3 -2
  242. package/dist/npm/sugar/getFeeXrp.js.map +1 -1
  243. package/dist/npm/sugar/submit.d.ts.map +1 -1
  244. package/dist/npm/sugar/submit.js.map +1 -1
  245. package/dist/npm/utils/hashes/hashLedger.d.ts +4 -3
  246. package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
  247. package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
  248. package/dist/npm/utils/index.d.ts +2 -1
  249. package/dist/npm/utils/index.d.ts.map +1 -1
  250. package/dist/npm/utils/index.js.map +1 -1
  251. package/package.json +7 -8
  252. package/src/Wallet/defaultFaucets.ts +0 -6
  253. package/src/Wallet/fundWallet.ts +0 -1
  254. package/src/client/RequestManager.ts +17 -12
  255. package/src/client/connection.ts +7 -5
  256. package/src/client/index.ts +79 -21
  257. package/src/client/partialPayment.ts +34 -13
  258. package/src/models/common/index.ts +41 -0
  259. package/src/models/ledger/AMM.ts +2 -2
  260. package/src/models/ledger/Amendments.ts +2 -2
  261. package/src/models/ledger/BaseLedgerEntry.ts +9 -5
  262. package/src/models/ledger/DirectoryNode.ts +2 -2
  263. package/src/models/ledger/FeeSettings.ts +4 -2
  264. package/src/models/ledger/Ledger.ts +46 -9
  265. package/src/models/ledger/LedgerEntry.ts +3 -0
  266. package/src/models/ledger/LedgerHashes.ts +2 -4
  267. package/src/models/ledger/NegativeUNL.ts +2 -2
  268. package/src/models/ledger/Oracle.ts +43 -0
  269. package/src/models/ledger/RippleState.ts +2 -0
  270. package/src/models/ledger/index.ts +4 -1
  271. package/src/models/methods/accountChannels.ts +64 -1
  272. package/src/models/methods/accountInfo.ts +58 -12
  273. package/src/models/methods/accountTx.ts +49 -8
  274. package/src/models/methods/feature.ts +68 -0
  275. package/src/models/methods/getAggregatePrice.ts +119 -0
  276. package/src/models/methods/index.ts +79 -23
  277. package/src/models/methods/ledger.ts +41 -5
  278. package/src/models/methods/nftsByIssuer.ts +68 -0
  279. package/src/models/methods/submitMultisigned.ts +48 -16
  280. package/src/models/methods/tx.ts +74 -22
  281. package/src/models/transactions/AMMDeposit.ts +2 -0
  282. package/src/models/transactions/index.ts +2 -0
  283. package/src/models/transactions/metadata.ts +1 -0
  284. package/src/models/transactions/oracleDelete.ts +32 -0
  285. package/src/models/transactions/oracleSet.ts +176 -0
  286. package/src/models/transactions/payment.ts +2 -2
  287. package/src/models/transactions/transaction.ts +12 -0
  288. package/src/sugar/autofill.ts +4 -10
  289. package/src/sugar/getFeeXrp.ts +6 -3
  290. package/src/sugar/submit.ts +5 -3
  291. package/src/utils/hashes/hashLedger.ts +8 -5
  292. package/src/utils/index.ts +2 -1
@@ -1,17 +1,80 @@
1
1
  import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
2
2
 
3
+ /**
4
+ * Represents a payment channel in the XRP Ledger.
5
+ */
3
6
  export interface Channel {
7
+ /** The owner of the channel, as an Address. */
4
8
  account: string
9
+
10
+ /** The total amount of XRP, in drops allocated to this channel. */
5
11
  amount: string
12
+
13
+ /**
14
+ * The total amount of XRP, in drops, paid out from this channel,
15
+ * as of the ledger version used. (You can calculate the amount of
16
+ * XRP left in the channel by subtracting balance from amount.)
17
+ */
6
18
  balance: string
19
+
20
+ /**
21
+ * A unique ID for this channel, as a 64-character hexadecimal string.
22
+ * This is also the ID of the channel object in the ledger's state data.
23
+ */
7
24
  channel_id: string
25
+
26
+ /**
27
+ * The destination account of the channel, as an Address.
28
+ * Only this account can receive the XRP in the channel while it is open.
29
+ */
8
30
  destination_account: string
31
+
32
+ /**
33
+ * The number of seconds the payment channel must stay open after the owner
34
+ * of the channel requests to close it.
35
+ */
9
36
  settle_delay: number
37
+
38
+ /**
39
+ * The public key for the payment channel in the XRP Ledger's base58 format.
40
+ * Signed claims against this channel must be redeemed with the matching key pair.
41
+ */
10
42
  public_key?: string
43
+
44
+ /**
45
+ * The public key for the payment channel in hexadecimal format, if one was
46
+ * specified at channel creation. Signed claims against this channel must be
47
+ * redeemed with the matching key pair.
48
+ */
11
49
  public_key_hex?: string
50
+
51
+ /**
52
+ * Time, in seconds since the Ripple Epoch, when this channel is set to expire.
53
+ * This expiration date is mutable. If this is before the close time of the most
54
+ * recent validated ledger, the channel is expired.
55
+ */
12
56
  expiration?: number
57
+
58
+ /**
59
+ * Time, in seconds since the Ripple Epoch, of this channel's immutable expiration,
60
+ * if one was specified at channel creation. If this is before the close time of the
61
+ * most recent validated ledger, the channel is expired.
62
+ */
13
63
  cancel_after?: number
14
- source_tab?: number
64
+
65
+ /**
66
+ * A 32-bit unsigned integer to use as a source tag for payments through this payment channel,
67
+ * if one was specified at channel creation. This indicates the payment channel's originator or
68
+ * other purpose at the source account. Conventionally, if you bounce payments from this channel,
69
+ * you should specify this value in the DestinationTag of the return payment.
70
+ */
71
+ source_tag?: number
72
+
73
+ /**
74
+ * A 32-bit unsigned integer to use as a destination tag for payments through this channel,
75
+ * if one was specified at channel creation. This indicates the payment channel's beneficiary
76
+ * or other purpose at the destination account.
77
+ */
15
78
  destination_tag?: number
16
79
  }
17
80
 
@@ -1,3 +1,4 @@
1
+ import { APIVersion, DEFAULT_API_VERSION, RIPPLED_API_V1 } from '../common'
1
2
  import { AccountRoot, SignerList } from '../ledger'
2
3
 
3
4
  import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
@@ -133,23 +134,13 @@ export interface AccountInfoAccountFlags {
133
134
  allowTrustLineClawback: boolean
134
135
  }
135
136
 
136
- /**
137
- * Response expected from an {@link AccountInfoRequest}.
138
- *
139
- * @category Responses
140
- */
141
- export interface AccountInfoResponse extends BaseResponse {
137
+ interface BaseAccountInfoResponse extends BaseResponse {
142
138
  result: {
143
139
  /**
144
140
  * The AccountRoot ledger object with this account's information, as stored
145
141
  * in the ledger.
146
- * If requested, also includes Array of SignerList ledger objects
147
- * associated with this account for Multi-Signing. Since an account can own
148
- * at most one SignerList, this array must have exactly one member if it is
149
- * present.
150
142
  */
151
- account_data: AccountRoot & { signer_lists?: SignerList[] }
152
-
143
+ account_data: AccountRoot
153
144
  /**
154
145
  * A map of account flags parsed out. This will only be available for rippled nodes 1.11.0 and higher.
155
146
  */
@@ -180,3 +171,58 @@ export interface AccountInfoResponse extends BaseResponse {
180
171
  validated?: boolean
181
172
  }
182
173
  }
174
+
175
+ /**
176
+ * Response expected from a {@link AccountInfoRequest}.
177
+ *
178
+ * @category Responses
179
+ */
180
+ export interface AccountInfoResponse extends BaseAccountInfoResponse {
181
+ result: BaseAccountInfoResponse['result'] & {
182
+ /**
183
+ * If requested, array of SignerList ledger objects associated with this account for Multi-Signing.
184
+ * Since an account can own at most one SignerList, this array must have exactly one
185
+ * member if it is present.
186
+ */
187
+ signer_lists?: SignerList[]
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Response expected from a {@link AccountInfoRequest} using API version 1.
193
+ *
194
+ * @category ResponsesV1
195
+ */
196
+ export interface AccountInfoV1Response extends BaseAccountInfoResponse {
197
+ result: BaseAccountInfoResponse['result'] & {
198
+ /**
199
+ * The AccountRoot ledger object with this account's information, as stored
200
+ * in the ledger.
201
+ * If requested, also includes Array of SignerList ledger objects
202
+ * associated with this account for Multi-Signing. Since an account can own
203
+ * at most one SignerList, this array must have exactly one member if it is
204
+ * present.
205
+ */
206
+ account_data: BaseAccountInfoResponse['result']['account_data'] & {
207
+ /**
208
+ * Array of SignerList ledger objects associated with this account for Multi-Signing.
209
+ * Since an account can own at most one SignerList, this array must have exactly one
210
+ * member if it is present.
211
+ * Quirk: In API version 1, this field is nested under account_data. For this method,
212
+ * Clio implements the API version 2 behavior where is field is not nested under account_data.
213
+ */
214
+ signer_lists?: SignerList[]
215
+ }
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Type to map between the API version and the response type.
221
+ *
222
+ * @category Responses
223
+ */
224
+ export type AccountInfoVersionResponseMap<
225
+ Version extends APIVersion = typeof DEFAULT_API_VERSION,
226
+ > = Version extends typeof RIPPLED_API_V1
227
+ ? AccountInfoV1Response
228
+ : AccountInfoResponse
@@ -1,4 +1,10 @@
1
- import { ResponseOnlyTxInfo } from '../common'
1
+ import {
2
+ APIVersion,
3
+ DEFAULT_API_VERSION,
4
+ RIPPLED_API_V1,
5
+ RIPPLED_API_V2,
6
+ ResponseOnlyTxInfo,
7
+ } from '../common'
2
8
  import { Transaction, TransactionMetadata } from '../transactions'
3
9
 
4
10
  import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
@@ -49,7 +55,9 @@ export interface AccountTxRequest extends BaseRequest, LookupByLedgerRequest {
49
55
  marker?: unknown
50
56
  }
51
57
 
52
- export interface AccountTxTransaction {
58
+ export interface AccountTxTransaction<
59
+ Version extends APIVersion = typeof DEFAULT_API_VERSION,
60
+ > {
53
61
  /** The ledger index of the ledger version that included this transaction. */
54
62
  ledger_index: number
55
63
  /**
@@ -58,7 +66,15 @@ export interface AccountTxTransaction {
58
66
  */
59
67
  meta: string | TransactionMetadata
60
68
  /** JSON object defining the transaction. */
61
- tx?: Transaction & ResponseOnlyTxInfo
69
+ tx_json?: Version extends typeof RIPPLED_API_V2
70
+ ? Transaction & ResponseOnlyTxInfo
71
+ : never
72
+ /** JSON object defining the transaction in rippled API v1. */
73
+ tx?: Version extends typeof RIPPLED_API_V1
74
+ ? Transaction & ResponseOnlyTxInfo
75
+ : never
76
+ /** The hash of the transaction. */
77
+ hash?: Version extends typeof RIPPLED_API_V2 ? string : never
62
78
  /** Unique hashed String representing the transaction. */
63
79
  tx_blob?: string
64
80
  /**
@@ -69,11 +85,11 @@ export interface AccountTxTransaction {
69
85
  }
70
86
 
71
87
  /**
72
- * Expected response from an {@link AccountTxRequest}.
73
- *
74
- * @category Responses
88
+ * Base interface for account transaction responses.
75
89
  */
76
- export interface AccountTxResponse extends BaseResponse {
90
+ interface AccountTxResponseBase<
91
+ Version extends APIVersion = typeof DEFAULT_API_VERSION,
92
+ > extends BaseResponse {
77
93
  result: {
78
94
  /** Unique Address identifying the related account. */
79
95
  account: string
@@ -98,7 +114,7 @@ export interface AccountTxResponse extends BaseResponse {
98
114
  * Array of transactions matching the request's criteria, as explained
99
115
  * below.
100
116
  */
101
- transactions: AccountTxTransaction[]
117
+ transactions: Array<AccountTxTransaction<Version>>
102
118
  /**
103
119
  * If included and set to true, the information in this response comes from
104
120
  * a validated ledger version. Otherwise, the information is subject to
@@ -107,3 +123,28 @@ export interface AccountTxResponse extends BaseResponse {
107
123
  validated?: boolean
108
124
  }
109
125
  }
126
+
127
+ /**
128
+ * Expected response from an {@link AccountTxRequest}.
129
+ *
130
+ * @category Responses
131
+ */
132
+ export type AccountTxResponse = AccountTxResponseBase
133
+
134
+ /**
135
+ * Expected response from an {@link AccountTxRequest} with `api_version` set to 1.
136
+ *
137
+ * @category ResponsesV1
138
+ */
139
+ export type AccountTxV1Response = AccountTxResponseBase<typeof RIPPLED_API_V1>
140
+
141
+ /**
142
+ * Type to map between the API version and the response type.
143
+ *
144
+ * @category Responses
145
+ */
146
+ export type AccountTxVersionResponseMap<
147
+ Version extends APIVersion = typeof DEFAULT_API_VERSION,
148
+ > = Version extends typeof RIPPLED_API_V1
149
+ ? AccountTxV1Response
150
+ : AccountTxResponse
@@ -0,0 +1,68 @@
1
+ import { BaseRequest, BaseResponse } from './baseMethod'
2
+
3
+ export interface FeatureAllRequest extends BaseRequest {
4
+ command: 'feature'
5
+
6
+ feature?: never
7
+ }
8
+
9
+ export interface FeatureOneRequest extends BaseRequest {
10
+ command: 'feature'
11
+
12
+ feature: string
13
+ }
14
+
15
+ /**
16
+ * The `feature` command returns information about amendments this server knows about, including whether they are enabled.
17
+ * Returns an {@link FeatureResponse}.
18
+ *
19
+ * @category Requests
20
+ */
21
+ export type FeatureRequest = FeatureAllRequest | FeatureOneRequest
22
+
23
+ export interface FeatureAllResponse extends BaseResponse {
24
+ result: {
25
+ features: Record<
26
+ string,
27
+ {
28
+ /*
29
+ * Whether this amendment is currently enabled in the latest ledger.
30
+ */
31
+ enabled: boolean
32
+
33
+ /*
34
+ * The human-readable name for this amendment, if known.
35
+ */
36
+ name: string
37
+
38
+ supported: boolean
39
+ }
40
+ >
41
+ }
42
+ }
43
+
44
+ export interface FeatureOneResponse extends BaseResponse {
45
+ result: Record<
46
+ string,
47
+ {
48
+ /*
49
+ * Whether this amendment is currently enabled in the latest ledger.
50
+ */
51
+ enabled: boolean
52
+
53
+ /*
54
+ * The human-readable name for this amendment, if known.
55
+ */
56
+ name: string
57
+
58
+ supported: boolean
59
+ }
60
+ >
61
+ }
62
+
63
+ /**
64
+ * Response expected from an {@link FeatureRequest}.
65
+ *
66
+ * @category Responses
67
+ */
68
+ export type FeatureResponse = FeatureAllResponse | FeatureOneResponse
@@ -0,0 +1,119 @@
1
+ import { BaseRequest, BaseResponse } from './baseMethod'
2
+
3
+ /**
4
+ * The `get_aggregate_price` method retrieves the aggregate price of specified Oracle objects,
5
+ * returning three price statistics: mean, median, and trimmed mean.
6
+ * Returns an {@link GetAggregatePriceResponse}.
7
+ *
8
+ * @category Requests
9
+ */
10
+ export interface GetAggregatePriceRequest extends BaseRequest {
11
+ command: 'get_aggregate_price'
12
+
13
+ /**
14
+ * The currency code of the asset to be priced.
15
+ */
16
+ base_asset: string
17
+
18
+ /**
19
+ * The currency code of the asset to quote the price of the base asset.
20
+ */
21
+ quote_asset: string
22
+
23
+ /**
24
+ * The oracle identifier.
25
+ */
26
+ oracles: Array<{
27
+ /**
28
+ * The XRPL account that controls the Oracle object.
29
+ */
30
+ account: string
31
+
32
+ /**
33
+ * A unique identifier of the price oracle for the Account
34
+ */
35
+ oracle_document_id: string | number
36
+ }>
37
+
38
+ /**
39
+ * The percentage of outliers to trim. Valid trim range is 1-25. If included, the API returns statistics for the trimmed mean.
40
+ */
41
+ trim?: number
42
+
43
+ /**
44
+ * Defines a time range in seconds for filtering out older price data. Default value is 0, which doesn't filter any data.
45
+ */
46
+ trim_threshold?: number
47
+ }
48
+
49
+ /**
50
+ * Response expected from an {@link GetAggregatePriceRequest}.
51
+ *
52
+ * @category Responses
53
+ */
54
+ export interface GetAggregatePriceResponse extends BaseResponse {
55
+ result: {
56
+ /**
57
+ * The statistics from the collected oracle prices.
58
+ */
59
+ entire_set: {
60
+ /**
61
+ * The simple mean.
62
+ */
63
+ mean: string
64
+
65
+ /**
66
+ * The size of the data set to calculate the mean.
67
+ */
68
+ size: number
69
+
70
+ /**
71
+ * The standard deviation.
72
+ */
73
+ standard_deviation: string
74
+ }
75
+
76
+ /**
77
+ * The trimmed statistics from the collected oracle prices. Only appears if the trim field was specified in the request.
78
+ */
79
+ trimmed_set?: {
80
+ /**
81
+ * The simple mean of the trimmed data.
82
+ */
83
+ mean: string
84
+
85
+ /**
86
+ * The size of the data to calculate the trimmed mean.
87
+ */
88
+ size: number
89
+
90
+ /**
91
+ * The standard deviation of the trimmed data.
92
+ */
93
+ standard_deviation: string
94
+ }
95
+
96
+ /**
97
+ * The median of the collected oracle prices.
98
+ */
99
+ median: string
100
+
101
+ /**
102
+ * The most recent timestamp out of all LastUpdateTime values.
103
+ */
104
+ time: number
105
+
106
+ /**
107
+ * The ledger index of the ledger version that was used to generate this
108
+ * response.
109
+ */
110
+ ledger_current_index: number
111
+
112
+ /**
113
+ * If included and set to true, the information in this response comes from
114
+ * a validated ledger version. Otherwise, the information is subject to
115
+ * change.
116
+ */
117
+ validated: boolean
118
+ }
119
+ }