xrpl 2.12.0-beta.0 → 2.12.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 (263) 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 +139 -312
  4. package/build/xrpl-latest.js.map +1 -1
  5. package/dist/npm/models/common/index.d.ts +2 -1
  6. package/dist/npm/models/common/index.d.ts.map +1 -1
  7. package/dist/npm/models/ledger/AMM.d.ts +5 -3
  8. package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
  9. package/dist/npm/models/ledger/AccountRoot.d.ts +1 -0
  10. package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
  11. package/dist/npm/models/ledger/AccountRoot.js.map +1 -1
  12. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +11 -1
  13. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  14. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +10 -1
  15. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -1
  16. package/dist/npm/models/ledger/index.d.ts +2 -1
  17. package/dist/npm/models/ledger/index.d.ts.map +1 -1
  18. package/dist/npm/models/ledger/index.js.map +1 -1
  19. package/dist/npm/models/methods/accountObjects.d.ts +3 -3
  20. package/dist/npm/models/methods/accountObjects.d.ts.map +1 -1
  21. package/dist/npm/models/methods/ammInfo.d.ts +4 -3
  22. package/dist/npm/models/methods/ammInfo.d.ts.map +1 -1
  23. package/dist/npm/models/methods/ledgerEntry.d.ts +4 -4
  24. package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
  25. package/dist/npm/models/methods/serverInfo.d.ts +6 -0
  26. package/dist/npm/models/methods/serverInfo.d.ts.map +1 -1
  27. package/dist/npm/models/transactions/AMMBid.d.ts +3 -3
  28. package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -1
  29. package/dist/npm/models/transactions/AMMBid.js.map +1 -1
  30. package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
  31. package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
  32. package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -1
  33. package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -1
  34. package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -1
  35. package/dist/npm/models/transactions/XChainAccountCreateCommit.js +5 -26
  36. package/dist/npm/models/transactions/XChainAccountCreateCommit.js.map +1 -1
  37. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -1
  38. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js +11 -68
  39. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  40. package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -1
  41. package/dist/npm/models/transactions/XChainAddClaimAttestation.js +10 -59
  42. package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  43. package/dist/npm/models/transactions/XChainClaim.d.ts.map +1 -1
  44. package/dist/npm/models/transactions/XChainClaim.js +5 -30
  45. package/dist/npm/models/transactions/XChainClaim.js.map +1 -1
  46. package/dist/npm/models/transactions/XChainCommit.d.ts.map +1 -1
  47. package/dist/npm/models/transactions/XChainCommit.js +4 -24
  48. package/dist/npm/models/transactions/XChainCommit.js.map +1 -1
  49. package/dist/npm/models/transactions/XChainCreateBridge.d.ts.map +1 -1
  50. package/dist/npm/models/transactions/XChainCreateBridge.js +3 -17
  51. package/dist/npm/models/transactions/XChainCreateBridge.js.map +1 -1
  52. package/dist/npm/models/transactions/XChainCreateClaimID.d.ts.map +1 -1
  53. package/dist/npm/models/transactions/XChainCreateClaimID.js +3 -19
  54. package/dist/npm/models/transactions/XChainCreateClaimID.js.map +1 -1
  55. package/dist/npm/models/transactions/XChainModifyBridge.d.ts.map +1 -1
  56. package/dist/npm/models/transactions/XChainModifyBridge.js +3 -14
  57. package/dist/npm/models/transactions/XChainModifyBridge.js.map +1 -1
  58. package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
  59. package/dist/npm/models/transactions/accountSet.js.map +1 -1
  60. package/dist/npm/models/transactions/checkCash.d.ts.map +1 -1
  61. package/dist/npm/models/transactions/checkCash.js.map +1 -1
  62. package/dist/npm/models/transactions/checkCreate.d.ts.map +1 -1
  63. package/dist/npm/models/transactions/checkCreate.js.map +1 -1
  64. package/dist/npm/models/transactions/common.d.ts +4 -0
  65. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  66. package/dist/npm/models/transactions/common.js +33 -38
  67. package/dist/npm/models/transactions/common.js.map +1 -1
  68. package/dist/npm/models/transactions/depositPreauth.d.ts.map +1 -1
  69. package/dist/npm/models/transactions/depositPreauth.js.map +1 -1
  70. package/dist/npm/models/transactions/escrowCancel.d.ts +1 -1
  71. package/dist/npm/models/transactions/escrowCancel.d.ts.map +1 -1
  72. package/dist/npm/models/transactions/escrowCancel.js +5 -3
  73. package/dist/npm/models/transactions/escrowCancel.js.map +1 -1
  74. package/dist/npm/models/transactions/escrowCreate.d.ts.map +1 -1
  75. package/dist/npm/models/transactions/escrowCreate.js.map +1 -1
  76. package/dist/npm/models/transactions/escrowFinish.d.ts +1 -1
  77. package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
  78. package/dist/npm/models/transactions/escrowFinish.js +5 -3
  79. package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
  80. package/dist/npm/models/transactions/offerCreate.d.ts.map +1 -1
  81. package/dist/npm/models/transactions/offerCreate.js.map +1 -1
  82. package/dist/npm/models/transactions/payment.d.ts.map +1 -1
  83. package/dist/npm/models/transactions/payment.js.map +1 -1
  84. package/dist/npm/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  85. package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
  86. package/dist/npm/models/transactions/paymentChannelCreate.d.ts.map +1 -1
  87. package/dist/npm/models/transactions/paymentChannelCreate.js.map +1 -1
  88. package/dist/npm/models/transactions/signerListSet.d.ts.map +1 -1
  89. package/dist/npm/models/transactions/signerListSet.js.map +1 -1
  90. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  91. package/dist/npm/models/transactions/transaction.js.map +1 -1
  92. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  93. package/dist/npm/models/utils/flags.js.map +1 -1
  94. package/dist/npm/snippets/src/bridgeTransfer.js +12 -10
  95. package/dist/npm/snippets/src/bridgeTransfer.js.map +1 -1
  96. package/dist/npm/src/models/common/index.d.ts +2 -1
  97. package/dist/npm/src/models/common/index.d.ts.map +1 -1
  98. package/dist/npm/src/models/ledger/AMM.d.ts +5 -3
  99. package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
  100. package/dist/npm/src/models/ledger/AccountRoot.d.ts +1 -0
  101. package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
  102. package/dist/npm/src/models/ledger/AccountRoot.js.map +1 -1
  103. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +11 -1
  104. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  105. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +10 -1
  106. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -1
  107. package/dist/npm/src/models/ledger/index.d.ts +2 -1
  108. package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
  109. package/dist/npm/src/models/ledger/index.js.map +1 -1
  110. package/dist/npm/src/models/methods/accountObjects.d.ts +3 -3
  111. package/dist/npm/src/models/methods/accountObjects.d.ts.map +1 -1
  112. package/dist/npm/src/models/methods/ammInfo.d.ts +4 -3
  113. package/dist/npm/src/models/methods/ammInfo.d.ts.map +1 -1
  114. package/dist/npm/src/models/methods/ledgerEntry.d.ts +4 -4
  115. package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
  116. package/dist/npm/src/models/methods/serverInfo.d.ts +6 -0
  117. package/dist/npm/src/models/methods/serverInfo.d.ts.map +1 -1
  118. package/dist/npm/src/models/transactions/AMMBid.d.ts +3 -3
  119. package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -1
  120. package/dist/npm/src/models/transactions/AMMBid.js.map +1 -1
  121. package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
  122. package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
  123. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -1
  124. package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -1
  125. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -1
  126. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js +5 -26
  127. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js.map +1 -1
  128. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -1
  129. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js +11 -68
  130. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  131. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -1
  132. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js +10 -59
  133. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  134. package/dist/npm/src/models/transactions/XChainClaim.d.ts.map +1 -1
  135. package/dist/npm/src/models/transactions/XChainClaim.js +5 -30
  136. package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -1
  137. package/dist/npm/src/models/transactions/XChainCommit.d.ts.map +1 -1
  138. package/dist/npm/src/models/transactions/XChainCommit.js +4 -24
  139. package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -1
  140. package/dist/npm/src/models/transactions/XChainCreateBridge.d.ts.map +1 -1
  141. package/dist/npm/src/models/transactions/XChainCreateBridge.js +3 -17
  142. package/dist/npm/src/models/transactions/XChainCreateBridge.js.map +1 -1
  143. package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts.map +1 -1
  144. package/dist/npm/src/models/transactions/XChainCreateClaimID.js +3 -19
  145. package/dist/npm/src/models/transactions/XChainCreateClaimID.js.map +1 -1
  146. package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts.map +1 -1
  147. package/dist/npm/src/models/transactions/XChainModifyBridge.js +3 -14
  148. package/dist/npm/src/models/transactions/XChainModifyBridge.js.map +1 -1
  149. package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
  150. package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
  151. package/dist/npm/src/models/transactions/checkCash.d.ts.map +1 -1
  152. package/dist/npm/src/models/transactions/checkCash.js.map +1 -1
  153. package/dist/npm/src/models/transactions/checkCreate.d.ts.map +1 -1
  154. package/dist/npm/src/models/transactions/checkCreate.js.map +1 -1
  155. package/dist/npm/src/models/transactions/common.d.ts +4 -0
  156. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  157. package/dist/npm/src/models/transactions/common.js +33 -38
  158. package/dist/npm/src/models/transactions/common.js.map +1 -1
  159. package/dist/npm/src/models/transactions/depositPreauth.d.ts.map +1 -1
  160. package/dist/npm/src/models/transactions/depositPreauth.js.map +1 -1
  161. package/dist/npm/src/models/transactions/escrowCancel.d.ts +1 -1
  162. package/dist/npm/src/models/transactions/escrowCancel.d.ts.map +1 -1
  163. package/dist/npm/src/models/transactions/escrowCancel.js +5 -3
  164. package/dist/npm/src/models/transactions/escrowCancel.js.map +1 -1
  165. package/dist/npm/src/models/transactions/escrowCreate.d.ts.map +1 -1
  166. package/dist/npm/src/models/transactions/escrowCreate.js.map +1 -1
  167. package/dist/npm/src/models/transactions/escrowFinish.d.ts +1 -1
  168. package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
  169. package/dist/npm/src/models/transactions/escrowFinish.js +5 -3
  170. package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
  171. package/dist/npm/src/models/transactions/offerCreate.d.ts.map +1 -1
  172. package/dist/npm/src/models/transactions/offerCreate.js.map +1 -1
  173. package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
  174. package/dist/npm/src/models/transactions/payment.js.map +1 -1
  175. package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  176. package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
  177. package/dist/npm/src/models/transactions/paymentChannelCreate.d.ts.map +1 -1
  178. package/dist/npm/src/models/transactions/paymentChannelCreate.js.map +1 -1
  179. package/dist/npm/src/models/transactions/signerListSet.d.ts.map +1 -1
  180. package/dist/npm/src/models/transactions/signerListSet.js.map +1 -1
  181. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  182. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  183. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  184. package/dist/npm/src/models/utils/flags.js.map +1 -1
  185. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  186. package/dist/npm/src/sugar/autofill.js.map +1 -1
  187. package/dist/npm/src/utils/getXChainClaimID.d.ts +3 -0
  188. package/dist/npm/src/utils/getXChainClaimID.d.ts.map +1 -0
  189. package/dist/npm/src/utils/getXChainClaimID.js +29 -0
  190. package/dist/npm/src/utils/getXChainClaimID.js.map +1 -0
  191. package/dist/npm/src/utils/index.d.ts +2 -1
  192. package/dist/npm/src/utils/index.d.ts.map +1 -1
  193. package/dist/npm/src/utils/index.js +3 -1
  194. package/dist/npm/src/utils/index.js.map +1 -1
  195. package/dist/npm/src/utils/signPaymentChannelClaim.d.ts +1 -1
  196. package/dist/npm/src/utils/signPaymentChannelClaim.d.ts.map +1 -1
  197. package/dist/npm/src/utils/signPaymentChannelClaim.js +2 -2
  198. package/dist/npm/src/utils/signPaymentChannelClaim.js.map +1 -1
  199. package/dist/npm/src/utils/verifyPaymentChannelClaim.d.ts +1 -1
  200. package/dist/npm/src/utils/verifyPaymentChannelClaim.d.ts.map +1 -1
  201. package/dist/npm/src/utils/verifyPaymentChannelClaim.js +2 -2
  202. package/dist/npm/src/utils/verifyPaymentChannelClaim.js.map +1 -1
  203. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  204. package/dist/npm/sugar/autofill.js.map +1 -1
  205. package/dist/npm/utils/getXChainClaimID.d.ts +3 -0
  206. package/dist/npm/utils/getXChainClaimID.d.ts.map +1 -0
  207. package/dist/npm/utils/getXChainClaimID.js +29 -0
  208. package/dist/npm/utils/getXChainClaimID.js.map +1 -0
  209. package/dist/npm/utils/index.d.ts +2 -1
  210. package/dist/npm/utils/index.d.ts.map +1 -1
  211. package/dist/npm/utils/index.js +3 -1
  212. package/dist/npm/utils/index.js.map +1 -1
  213. package/dist/npm/utils/signPaymentChannelClaim.d.ts +1 -1
  214. package/dist/npm/utils/signPaymentChannelClaim.d.ts.map +1 -1
  215. package/dist/npm/utils/signPaymentChannelClaim.js +2 -2
  216. package/dist/npm/utils/signPaymentChannelClaim.js.map +1 -1
  217. package/dist/npm/utils/verifyPaymentChannelClaim.d.ts +1 -1
  218. package/dist/npm/utils/verifyPaymentChannelClaim.d.ts.map +1 -1
  219. package/dist/npm/utils/verifyPaymentChannelClaim.js +2 -2
  220. package/dist/npm/utils/verifyPaymentChannelClaim.js.map +1 -1
  221. package/package.json +6 -7
  222. package/src/models/common/index.ts +2 -1
  223. package/src/models/ledger/AMM.ts +11 -3
  224. package/src/models/ledger/AccountRoot.ts +6 -0
  225. package/src/models/ledger/XChainOwnedClaimID.ts +18 -2
  226. package/src/models/ledger/XChainOwnedCreateAccountClaimID.ts +16 -2
  227. package/src/models/ledger/index.ts +3 -0
  228. package/src/models/methods/accountObjects.ts +3 -0
  229. package/src/models/methods/ammInfo.ts +8 -3
  230. package/src/models/methods/ledgerEntry.ts +4 -4
  231. package/src/models/methods/serverInfo.ts +21 -0
  232. package/src/models/transactions/AMMBid.ts +5 -6
  233. package/src/models/transactions/AMMDeposit.ts +0 -1
  234. package/src/models/transactions/AMMWithdraw.ts +0 -1
  235. package/src/models/transactions/XChainAccountCreateCommit.ts +9 -47
  236. package/src/models/transactions/XChainAddAccountCreateAttestation.ts +34 -138
  237. package/src/models/transactions/XChainAddClaimAttestation.ts +33 -116
  238. package/src/models/transactions/XChainClaim.ts +15 -41
  239. package/src/models/transactions/XChainCommit.ts +14 -35
  240. package/src/models/transactions/XChainCreateBridge.ts +7 -29
  241. package/src/models/transactions/XChainCreateClaimID.ts +7 -32
  242. package/src/models/transactions/XChainModifyBridge.ts +7 -23
  243. package/src/models/transactions/accountSet.ts +0 -2
  244. package/src/models/transactions/checkCash.ts +0 -1
  245. package/src/models/transactions/checkCreate.ts +0 -1
  246. package/src/models/transactions/common.ts +82 -53
  247. package/src/models/transactions/depositPreauth.ts +0 -1
  248. package/src/models/transactions/escrowCancel.ts +8 -4
  249. package/src/models/transactions/escrowCreate.ts +0 -1
  250. package/src/models/transactions/escrowFinish.ts +8 -4
  251. package/src/models/transactions/offerCreate.ts +0 -1
  252. package/src/models/transactions/payment.ts +0 -1
  253. package/src/models/transactions/paymentChannelClaim.ts +0 -1
  254. package/src/models/transactions/paymentChannelCreate.ts +0 -1
  255. package/src/models/transactions/signerListSet.ts +0 -1
  256. package/src/models/transactions/transaction.ts +0 -1
  257. package/src/models/utils/flags.ts +0 -1
  258. package/src/sugar/autofill.ts +0 -2
  259. package/src/utils/getXChainClaimID.ts +64 -0
  260. package/src/utils/index.ts +2 -0
  261. package/src/utils/signPaymentChannelClaim.ts +3 -3
  262. package/src/utils/verifyPaymentChannelClaim.ts +3 -3
  263. package/dist/npm/snippets/tsconfig.tsbuildinfo +0 -1
@@ -1,3 +1,5 @@
1
+ import { Amount } from 'ripple-binary-codec/dist/types'
2
+
1
3
  import { XChainBridge } from '../common'
2
4
 
3
5
  import BaseLedgerEntry from './BaseLedgerEntry'
@@ -35,14 +37,28 @@ export default interface XChainOwnedClaimID extends BaseLedgerEntry {
35
37
  */
36
38
  OtherChainSource: string
37
39
 
38
- // TODO: type this better
39
40
  /**
40
41
  * Attestations collected from the witness servers. This includes the parameters
41
42
  * needed to recreate the message that was signed, including the amount, which
42
43
  * chain (locking or issuing), optional destination, and reward account for that
43
44
  * signature.
44
45
  */
45
- XChainClaimAttestations: object[]
46
+ XChainClaimAttestations: Array<{
47
+ // TODO: add docs
48
+ XChainClaimProofSig: {
49
+ Amount: Amount
50
+
51
+ AttestationRewardAccount: string
52
+
53
+ AttestationSignerAccount: string
54
+
55
+ Destination?: string
56
+
57
+ PublicKey: string
58
+
59
+ WasLockingChainSend: 0 | 1
60
+ }
61
+ }>
46
62
 
47
63
  /**
48
64
  * The total amount to pay the witness servers for their signatures. It must be at
@@ -27,7 +27,6 @@ export default interface XChainOwnedCreateAccountClaimID
27
27
  */
28
28
  XChainAccountCreateCount: number
29
29
 
30
- // TODO: type this better
31
30
  /**
32
31
  * Attestations collected from the witness servers. This includes the parameters
33
32
  * needed to recreate the message that was signed, including the amount, destination,
@@ -35,7 +34,22 @@ export default interface XChainOwnedCreateAccountClaimID
35
34
  * exception of the reward account, all signatures must sign the message created with
36
35
  * common parameters.
37
36
  */
38
- XChainCreateAccountAttestations: object[]
37
+ XChainCreateAccountAttestations: Array<{
38
+ // TODO: add docs
39
+ XChainCreateAccountProofSig: {
40
+ Amount: string
41
+
42
+ AttestationRewardAccount: string
43
+
44
+ AttestationSignerAccount: string
45
+
46
+ Destination: string
47
+
48
+ PublicKey: string
49
+
50
+ WasLockingChainSend: 0 | 1
51
+ }
52
+ }>
39
53
 
40
54
  /**
41
55
  * A bit-map of boolean flags. No flags are defined for,
@@ -3,6 +3,7 @@ import AccountRoot, {
3
3
  AccountRootFlagsInterface,
4
4
  } from './AccountRoot'
5
5
  import Amendments, { Majority, AMENDMENTS_ID } from './Amendments'
6
+ import AMM, { VoteSlot } from './AMM'
6
7
  import Bridge from './Bridge'
7
8
  import Check from './Check'
8
9
  import DepositPreauth from './DepositPreauth'
@@ -33,6 +34,7 @@ export {
33
34
  AccountRootFlagsInterface,
34
35
  AMENDMENTS_ID,
35
36
  Amendments,
37
+ AMM,
36
38
  Bridge,
37
39
  Check,
38
40
  DepositPreauth,
@@ -61,4 +63,5 @@ export {
61
63
  Ticket,
62
64
  XChainOwnedClaimID,
63
65
  XChainOwnedCreateAccountClaimID,
66
+ VoteSlot,
64
67
  }
@@ -1,4 +1,5 @@
1
1
  import {
2
+ AMM,
2
3
  Bridge,
3
4
  Check,
4
5
  DepositPreauth,
@@ -15,6 +16,7 @@ import {
15
16
  import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
16
17
 
17
18
  export type AccountObjectType =
19
+ | 'amm'
18
20
  | 'bridge'
19
21
  | 'check'
20
22
  | 'deposit_preauth'
@@ -70,6 +72,7 @@ export interface AccountObjectsRequest
70
72
  * PayChannel, a SignerList, a Ticket, or a RippleState.
71
73
  */
72
74
  export type AccountObject =
75
+ | AMM
73
76
  | Bridge
74
77
  | Check
75
78
  | DepositPreauth
@@ -11,15 +11,20 @@ import { BaseRequest, BaseResponse } from './baseMethod'
11
11
  export interface AMMInfoRequest extends BaseRequest {
12
12
  command: 'amm_info'
13
13
 
14
+ /**
15
+ * The address of the AMM Account to look up.
16
+ */
17
+ amm_account?: string
18
+
14
19
  /**
15
20
  * One of the assets of the AMM pool to look up.
16
21
  */
17
- asset: Currency
22
+ asset?: Currency
18
23
 
19
24
  /**
20
25
  * The other asset of the AMM pool.
21
26
  */
22
- asset2: Currency
27
+ asset2?: Currency
23
28
  }
24
29
 
25
30
  /**
@@ -93,7 +98,7 @@ export interface AMMInfoResponse extends BaseResponse {
93
98
  * The amount, in LP Tokens, that the auction slot holder paid to win the auction slot.
94
99
  * This affects the price to outbid the current slot holder.
95
100
  */
96
- price: Amount
101
+ price: IssuedCurrencyAmount
97
102
 
98
103
  /**
99
104
  * The current 72-minute time interval this auction slot is in, from 0 to 19.
@@ -158,23 +158,23 @@ export interface LedgerEntryRequest extends BaseRequest, LookupByLedgerRequest {
158
158
 
159
159
  bridge?: XChainBridge
160
160
 
161
- xchain_claim_id?:
161
+ xchain_owned_claim_id?:
162
162
  | {
163
163
  locking_chain_door: string
164
164
  locking_chain_issue: Currency
165
165
  issuing_chain_door: string
166
166
  issuing_chain_issue: Currency
167
- xchain_claim_id: string | number
167
+ xchain_owned_claim_id: string | number
168
168
  }
169
169
  | string
170
170
 
171
- xchain_create_account_claim_id?:
171
+ xchain_owned_create_account_claim_id?:
172
172
  | {
173
173
  locking_chain_door: string
174
174
  locking_chain_issue: Currency
175
175
  issuing_chain_door: string
176
176
  issuing_chain_issue: Currency
177
- xchain_create_account_claim_id: string | number
177
+ xchain_owned_create_account_claim_id: string | number
178
178
  }
179
179
  | string
180
180
  }
@@ -33,6 +33,22 @@ export interface JobType {
33
33
  in_progress?: number
34
34
  }
35
35
 
36
+ export type protocol =
37
+ | 'http'
38
+ | 'https'
39
+ | 'grpc'
40
+ | 'peer'
41
+ | 'ws'
42
+ | 'ws2'
43
+ | 'wss'
44
+ | 'wss2'
45
+
46
+ export interface ServerPort {
47
+ port: string
48
+ /** The values in protocol are sorted in alphabetical order */
49
+ protocol: protocol[]
50
+ }
51
+
36
52
  // The states for validating and proposing do not exist in the field state_accounting
37
53
  // See https://github.com/XRPLF/rippled/blob/develop/src/ripple/app/misc/NetworkOPs.cpp#L4545
38
54
  // https://github.com/XRPLF/rippled/blob/develop/src/ripple/app/misc/NetworkOPs.h#L66
@@ -181,6 +197,11 @@ export interface ServerInfoResponse extends BaseResponse {
181
197
  network_ledger?: 'waiting'
182
198
  /** How many other rippled servers this one is currently connected to. */
183
199
  peers: number
200
+ /**
201
+ * What Websocket/RPC ports rippled is listening on. This allows crawlers to build a richer topology without needing to
202
+ * port-scan nodes. For non-admin users (including peers), info about admin ports is excluded.
203
+ */
204
+ ports: ServerPort[]
184
205
  /**
185
206
  * Public key used to verify this server for peer-to-peer communications.
186
207
  * This node key pair is automatically generated by the server the first
@@ -1,6 +1,5 @@
1
- /* eslint-disable complexity -- required for validateAMMBid */
2
1
  import { ValidationError } from '../../errors'
3
- import { Amount, AuthAccount, Currency } from '../common'
2
+ import { AuthAccount, Currency, IssuedCurrencyAmount } from '../common'
4
3
 
5
4
  import {
6
5
  BaseTransaction,
@@ -33,18 +32,18 @@ export interface AMMBid extends BaseTransaction {
33
32
  Asset2: Currency
34
33
 
35
34
  /**
36
- * Pay at least this amount for the slot.
35
+ * Pay at least this LPToken amount for the slot.
37
36
  * Setting this value higher makes it harder for others to outbid you.
38
37
  * If omitted, pay the minimum necessary to win the bid.
39
38
  */
40
- BidMin?: Amount
39
+ BidMin?: IssuedCurrencyAmount
41
40
 
42
41
  /**
43
- * Pay at most this amount for the slot.
42
+ * Pay at most this LPToken amount for the slot.
44
43
  * If the cost to win the bid is higher than this amount, the transaction fails.
45
44
  * If omitted, pay as much as necessary to win the bid.
46
45
  */
47
- BidMax?: Amount
46
+ BidMax?: IssuedCurrencyAmount
48
47
 
49
48
  /**
50
49
  * A list of up to 4 additional accounts that you allow to trade at the discounted fee.
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- required for validateAMMDeposit */
2
1
  import { ValidationError } from '../../errors'
3
2
  import { Amount, Currency, IssuedCurrencyAmount } from '../common'
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable complexity -- required for validateAMMWithdraw */
2
1
  import { ValidationError } from '../../errors'
3
2
  import { Amount, Currency, IssuedCurrencyAmount } from '../common'
4
3
 
@@ -1,4 +1,5 @@
1
- import { ValidationError } from '../../errors'
1
+ import { isString } from 'lodash'
2
+
2
3
  import { Amount, XChainBridge } from '../common'
3
4
 
4
5
  import {
@@ -6,6 +7,7 @@ import {
6
7
  isAmount,
7
8
  isXChainBridge,
8
9
  validateBaseTransaction,
10
+ validateRequiredField,
9
11
  } from './common'
10
12
 
11
13
  /**
@@ -47,61 +49,21 @@ export interface XChainAccountCreateCommit extends BaseTransaction {
47
49
  }
48
50
 
49
51
  /**
50
- * Verify the form and type of a XChainAccountCreateCommit at runtime.
52
+ * Verify the form and type of an XChainAccountCreateCommit at runtime.
51
53
  *
52
- * @param tx - A XChainAccountCreateCommit Transaction.
54
+ * @param tx - An XChainAccountCreateCommit Transaction.
53
55
  * @throws When the XChainAccountCreateCommit is malformed.
54
56
  */
55
- // eslint-disable-next-line max-lines-per-function -- okay for this function, there's a lot of things to check
56
57
  export function validateXChainAccountCreateCommit(
57
58
  tx: Record<string, unknown>,
58
59
  ): void {
59
60
  validateBaseTransaction(tx)
60
61
 
61
- if (tx.XChainBridge == null) {
62
- throw new ValidationError(
63
- 'XChainAccountCreateCommit: missing field XChainBridge',
64
- )
65
- }
66
-
67
- if (!isXChainBridge(tx.XChainBridge)) {
68
- throw new ValidationError(
69
- 'XChainAccountCreateCommit: invalid field XChainBridge',
70
- )
71
- }
72
-
73
- if (tx.SignatureReward == null) {
74
- throw new ValidationError(
75
- 'XChainAccountCreateCommit: missing field SignatureReward',
76
- )
77
- }
78
-
79
- if (
80
- typeof tx.SignatureReward !== 'number' &&
81
- typeof tx.SignatureReward !== 'string'
82
- ) {
83
- throw new ValidationError(
84
- 'XChainAccountCreateCommit: invalid field SignatureReward',
85
- )
86
- }
87
-
88
- if (tx.Destination == null) {
89
- throw new ValidationError(
90
- 'XChainAccountCreateCommit: missing field Destination',
91
- )
92
- }
62
+ validateRequiredField(tx, 'XChainBridge', isXChainBridge)
93
63
 
94
- if (typeof tx.Destination !== 'string') {
95
- throw new ValidationError(
96
- 'XChainAccountCreateCommit: invalid field Destination',
97
- )
98
- }
64
+ validateRequiredField(tx, 'SignatureReward', isAmount)
99
65
 
100
- if (tx.Amount == null) {
101
- throw new ValidationError('XChainAccountCreateCommit: missing field Amount')
102
- }
66
+ validateRequiredField(tx, 'Destination', isString)
103
67
 
104
- if (!isAmount(tx.Amount)) {
105
- throw new ValidationError('XChainAccountCreateCommit: invalid field Amount')
106
- }
68
+ validateRequiredField(tx, 'Amount', isAmount)
107
69
  }
@@ -1,11 +1,13 @@
1
- import { ValidationError } from '../../errors'
2
1
  import { Amount, XChainBridge } from '../common'
3
2
 
4
3
  import {
5
4
  BaseTransaction,
6
5
  isAmount,
6
+ isNumber,
7
+ isString,
7
8
  isXChainBridge,
8
9
  validateBaseTransaction,
10
+ validateRequiredField,
9
11
  } from './common'
10
12
 
11
13
  /**
@@ -77,149 +79,43 @@ export interface XChainAddAccountCreateAttestation extends BaseTransaction {
77
79
  }
78
80
 
79
81
  /**
80
- * Verify the form and type of a XChainAddAccountCreateAttestation at runtime.
82
+ * Verify the form and type of an XChainAddAccountCreateAttestation at runtime.
81
83
  *
82
- * @param tx - A XChainAddAccountCreateAttestation Transaction.
84
+ * @param tx - An XChainAddAccountCreateAttestation Transaction.
83
85
  * @throws When the XChainAddAccountCreateAttestation is malformed.
84
86
  */
85
- // eslint-disable-next-line max-lines-per-function, max-statements, complexity -- okay for this function, lots of things to check
86
87
  export function validateXChainAddAccountCreateAttestation(
87
88
  tx: Record<string, unknown>,
88
89
  ): void {
89
90
  validateBaseTransaction(tx)
90
91
 
91
- if (tx.Amount == null) {
92
- throw new ValidationError(
93
- 'XChainAddAccountCreateAttestation: missing field Amount',
94
- )
95
- }
96
-
97
- if (!isAmount(tx.Amount)) {
98
- throw new ValidationError(
99
- 'XChainAddAccountCreateAttestation: invalid field Amount',
100
- )
101
- }
102
-
103
- if (tx.AttestationRewardAccount == null) {
104
- throw new ValidationError(
105
- 'XChainAddAccountCreateAttestation: missing field AttestationRewardAccount',
106
- )
107
- }
108
-
109
- if (typeof tx.AttestationRewardAccount !== 'string') {
110
- throw new ValidationError(
111
- 'XChainAddAccountCreateAttestation: invalid field AttestationRewardAccount',
112
- )
113
- }
114
-
115
- if (tx.AttestationSignerAccount == null) {
116
- throw new ValidationError(
117
- 'XChainAddAccountCreateAttestation: missing field AttestationSignerAccount',
118
- )
119
- }
120
-
121
- if (typeof tx.AttestationSignerAccount !== 'string') {
122
- throw new ValidationError(
123
- 'XChainAddAccountCreateAttestation: invalid field AttestationSignerAccount',
124
- )
125
- }
126
-
127
- if (tx.Destination == null) {
128
- throw new ValidationError(
129
- 'XChainAddAccountCreateAttestation: missing field Destination',
130
- )
131
- }
132
-
133
- if (typeof tx.Destination !== 'string') {
134
- throw new ValidationError(
135
- 'XChainAddAccountCreateAttestation: invalid field Destination',
136
- )
137
- }
138
-
139
- if (tx.OtherChainSource == null) {
140
- throw new ValidationError(
141
- 'XChainAddAccountCreateAttestation: missing field OtherChainSource',
142
- )
143
- }
144
-
145
- if (typeof tx.OtherChainSource !== 'string') {
146
- throw new ValidationError(
147
- 'XChainAddAccountCreateAttestation: invalid field OtherChainSource',
148
- )
149
- }
150
-
151
- if (tx.PublicKey == null) {
152
- throw new ValidationError(
153
- 'XChainAddAccountCreateAttestation: missing field PublicKey',
154
- )
155
- }
156
-
157
- if (typeof tx.PublicKey !== 'string') {
158
- throw new ValidationError(
159
- 'XChainAddAccountCreateAttestation: invalid field PublicKey',
160
- )
161
- }
162
-
163
- if (tx.Signature == null) {
164
- throw new ValidationError(
165
- 'XChainAddAccountCreateAttestation: missing field Signature',
166
- )
167
- }
168
-
169
- if (typeof tx.Signature !== 'string') {
170
- throw new ValidationError(
171
- 'XChainAddAccountCreateAttestation: invalid field Signature',
172
- )
173
- }
174
-
175
- if (tx.SignatureReward == null) {
176
- throw new ValidationError(
177
- 'XChainAddAccountCreateAttestation: missing field SignatureReward',
178
- )
179
- }
180
-
181
- if (!isAmount(tx.SignatureReward)) {
182
- throw new ValidationError(
183
- 'XChainAddAccountCreateAttestation: invalid field SignatureReward',
184
- )
185
- }
186
-
187
- if (tx.WasLockingChainSend == null) {
188
- throw new ValidationError(
189
- 'XChainAddAccountCreateAttestation: missing field WasLockingChainSend',
190
- )
191
- }
192
-
193
- if (tx.WasLockingChainSend !== 0 && tx.WasLockingChainSend !== 1) {
194
- throw new ValidationError(
195
- 'XChainAddAccountCreateAttestation: invalid field WasLockingChainSend',
196
- )
197
- }
198
-
199
- if (tx.XChainAccountCreateCount == null) {
200
- throw new ValidationError(
201
- 'XChainAddAccountCreateAttestation: missing field XChainAccountCreateCount',
202
- )
203
- }
204
-
205
- if (
206
- typeof tx.XChainAccountCreateCount !== 'string' &&
207
- typeof tx.XChainAccountCreateCount !== 'number'
208
- ) {
209
- throw new ValidationError(
210
- 'XChainAddAccountCreateAttestation: invalid field XChainAccountCreateCount',
211
- )
212
- }
213
-
214
- if (tx.XChainBridge == null) {
215
- throw new ValidationError(
216
- 'XChainAddAccountCreateAttestation: missing field XChainBridge',
217
- )
218
- }
219
-
220
- if (!isXChainBridge(tx.XChainBridge)) {
221
- throw new ValidationError(
222
- 'XChainAddAccountCreateAttestation: invalid field XChainBridge',
223
- )
224
- }
92
+ validateRequiredField(tx, 'Amount', isAmount)
93
+
94
+ validateRequiredField(tx, 'AttestationRewardAccount', isString)
95
+
96
+ validateRequiredField(tx, 'AttestationSignerAccount', isString)
97
+
98
+ validateRequiredField(tx, 'Destination', isString)
99
+
100
+ validateRequiredField(tx, 'OtherChainSource', isString)
101
+
102
+ validateRequiredField(tx, 'PublicKey', isString)
103
+
104
+ validateRequiredField(tx, 'Signature', isString)
105
+
106
+ validateRequiredField(tx, 'SignatureReward', isAmount)
107
+
108
+ validateRequiredField(
109
+ tx,
110
+ 'WasLockingChainSend',
111
+ (inp) => inp === 0 || inp === 1,
112
+ )
113
+
114
+ validateRequiredField(
115
+ tx,
116
+ 'XChainAccountCreateCount',
117
+ (inp) => isNumber(inp) || isString(inp),
118
+ )
119
+
120
+ validateRequiredField(tx, 'XChainBridge', isXChainBridge)
225
121
  }