xrpl 2.12.0 → 3.0.0-beta.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 (632) hide show
  1. package/README.md +114 -5
  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 +18365 -75189
  5. package/build/xrpl-latest.js.map +1 -1
  6. package/dist/npm/Wallet/authorizeChannel.d.ts +3 -0
  7. package/dist/npm/Wallet/authorizeChannel.d.ts.map +1 -0
  8. package/dist/npm/Wallet/authorizeChannel.js +14 -0
  9. package/dist/npm/Wallet/authorizeChannel.js.map +1 -0
  10. package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
  11. package/dist/npm/Wallet/defaultFaucets.js +1 -4
  12. package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
  13. package/dist/npm/Wallet/fundWallet.d.ts +17 -3
  14. package/dist/npm/Wallet/fundWallet.d.ts.map +1 -1
  15. package/dist/npm/Wallet/fundWallet.js +53 -78
  16. package/dist/npm/Wallet/fundWallet.js.map +1 -1
  17. package/dist/npm/Wallet/index.d.ts.map +1 -1
  18. package/dist/npm/Wallet/index.js +24 -23
  19. package/dist/npm/Wallet/index.js.map +1 -1
  20. package/dist/npm/Wallet/signer.d.ts +2 -4
  21. package/dist/npm/Wallet/signer.d.ts.map +1 -1
  22. package/dist/npm/Wallet/signer.js +17 -13
  23. package/dist/npm/Wallet/signer.js.map +1 -1
  24. package/dist/npm/Wallet/walletFromSecretNumbers.js +2 -2
  25. package/dist/npm/Wallet/walletFromSecretNumbers.js.map +1 -1
  26. package/dist/npm/client/RequestManager.d.ts +3 -2
  27. package/dist/npm/client/RequestManager.d.ts.map +1 -1
  28. package/dist/npm/client/RequestManager.js +25 -1
  29. package/dist/npm/client/RequestManager.js.map +1 -1
  30. package/dist/npm/client/connection.d.ts +8 -11
  31. package/dist/npm/client/connection.d.ts.map +1 -1
  32. package/dist/npm/client/connection.js +8 -54
  33. package/dist/npm/client/connection.js.map +1 -1
  34. package/dist/npm/client/index.d.ts +56 -78
  35. package/dist/npm/client/index.d.ts.map +1 -1
  36. package/dist/npm/client/index.js +155 -42
  37. package/dist/npm/client/index.js.map +1 -1
  38. package/dist/npm/client/partialPayment.d.ts +4 -2
  39. package/dist/npm/client/partialPayment.d.ts.map +1 -1
  40. package/dist/npm/client/partialPayment.js.map +1 -1
  41. package/dist/npm/errors.d.ts.map +1 -1
  42. package/dist/npm/errors.js +1 -2
  43. package/dist/npm/errors.js.map +1 -1
  44. package/dist/npm/index.d.ts +1 -1
  45. package/dist/npm/index.d.ts.map +1 -1
  46. package/dist/npm/index.js +1 -3
  47. package/dist/npm/index.js.map +1 -1
  48. package/dist/npm/models/ledger/AMM.d.ts +2 -4
  49. package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
  50. package/dist/npm/models/ledger/AccountRoot.d.ts +2 -4
  51. package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
  52. package/dist/npm/models/ledger/AccountRoot.js +1 -1
  53. package/dist/npm/models/ledger/AccountRoot.js.map +1 -1
  54. package/dist/npm/models/ledger/Amendments.d.ts +2 -2
  55. package/dist/npm/models/ledger/Amendments.d.ts.map +1 -1
  56. package/dist/npm/models/ledger/BaseLedgerEntry.d.ts +9 -1
  57. package/dist/npm/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
  58. package/dist/npm/models/ledger/Bridge.d.ts +2 -4
  59. package/dist/npm/models/ledger/Bridge.d.ts.map +1 -1
  60. package/dist/npm/models/ledger/Check.d.ts +2 -2
  61. package/dist/npm/models/ledger/Check.d.ts.map +1 -1
  62. package/dist/npm/models/ledger/DepositPreauth.d.ts +2 -4
  63. package/dist/npm/models/ledger/DepositPreauth.d.ts.map +1 -1
  64. package/dist/npm/models/ledger/DirectoryNode.d.ts +2 -2
  65. package/dist/npm/models/ledger/DirectoryNode.d.ts.map +1 -1
  66. package/dist/npm/models/ledger/Escrow.d.ts +2 -4
  67. package/dist/npm/models/ledger/Escrow.d.ts.map +1 -1
  68. package/dist/npm/models/ledger/FeeSettings.d.ts +2 -2
  69. package/dist/npm/models/ledger/FeeSettings.d.ts.map +1 -1
  70. package/dist/npm/models/ledger/Ledger.d.ts +3 -3
  71. package/dist/npm/models/ledger/Ledger.d.ts.map +1 -1
  72. package/dist/npm/models/ledger/LedgerEntry.d.ts +2 -1
  73. package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
  74. package/dist/npm/models/ledger/LedgerHashes.d.ts +2 -2
  75. package/dist/npm/models/ledger/LedgerHashes.d.ts.map +1 -1
  76. package/dist/npm/models/ledger/NFTokenOffer.d.ts +2 -4
  77. package/dist/npm/models/ledger/NFTokenOffer.d.ts.map +1 -1
  78. package/dist/npm/models/ledger/NFTokenPage.d.ts +2 -4
  79. package/dist/npm/models/ledger/NFTokenPage.d.ts.map +1 -1
  80. package/dist/npm/models/ledger/NegativeUNL.d.ts +2 -2
  81. package/dist/npm/models/ledger/NegativeUNL.d.ts.map +1 -1
  82. package/dist/npm/models/ledger/Offer.d.ts +2 -4
  83. package/dist/npm/models/ledger/Offer.d.ts.map +1 -1
  84. package/dist/npm/models/ledger/Offer.js +1 -1
  85. package/dist/npm/models/ledger/Offer.js.map +1 -1
  86. package/dist/npm/models/ledger/PayChannel.d.ts +2 -4
  87. package/dist/npm/models/ledger/PayChannel.d.ts.map +1 -1
  88. package/dist/npm/models/ledger/RippleState.d.ts +2 -4
  89. package/dist/npm/models/ledger/RippleState.d.ts.map +1 -1
  90. package/dist/npm/models/ledger/RippleState.js +1 -1
  91. package/dist/npm/models/ledger/RippleState.js.map +1 -1
  92. package/dist/npm/models/ledger/SignerList.d.ts +2 -4
  93. package/dist/npm/models/ledger/SignerList.d.ts.map +1 -1
  94. package/dist/npm/models/ledger/SignerList.js +1 -1
  95. package/dist/npm/models/ledger/SignerList.js.map +1 -1
  96. package/dist/npm/models/ledger/Ticket.d.ts +2 -4
  97. package/dist/npm/models/ledger/Ticket.d.ts.map +1 -1
  98. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +2 -4
  99. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  100. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +2 -4
  101. package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -1
  102. package/dist/npm/models/ledger/index.d.ts +2 -2
  103. package/dist/npm/models/ledger/index.d.ts.map +1 -1
  104. package/dist/npm/models/ledger/index.js.map +1 -1
  105. package/dist/npm/models/methods/accountObjects.d.ts +4 -3
  106. package/dist/npm/models/methods/accountObjects.d.ts.map +1 -1
  107. package/dist/npm/models/methods/index.d.ts +12 -1
  108. package/dist/npm/models/methods/index.d.ts.map +1 -1
  109. package/dist/npm/models/methods/ledger.d.ts +37 -7
  110. package/dist/npm/models/methods/ledger.d.ts.map +1 -1
  111. package/dist/npm/models/methods/ledgerData.d.ts +2 -1
  112. package/dist/npm/models/methods/ledgerData.d.ts.map +1 -1
  113. package/dist/npm/models/methods/ledgerEntry.d.ts +2 -2
  114. package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
  115. package/dist/npm/models/methods/subscribe.d.ts +3 -0
  116. package/dist/npm/models/methods/subscribe.d.ts.map +1 -1
  117. package/dist/npm/models/methods/tx.d.ts +3 -2
  118. package/dist/npm/models/methods/tx.d.ts.map +1 -1
  119. package/dist/npm/models/transactions/AMMDeposit.js +1 -1
  120. package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
  121. package/dist/npm/models/transactions/AMMWithdraw.js +1 -1
  122. package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -1
  123. package/dist/npm/models/transactions/NFTokenAcceptOffer.d.ts +4 -0
  124. package/dist/npm/models/transactions/NFTokenAcceptOffer.d.ts.map +1 -1
  125. package/dist/npm/models/transactions/NFTokenAcceptOffer.js.map +1 -1
  126. package/dist/npm/models/transactions/NFTokenBurn.d.ts +3 -3
  127. package/dist/npm/models/transactions/NFTokenBurn.d.ts.map +1 -1
  128. package/dist/npm/models/transactions/NFTokenBurn.js +2 -4
  129. package/dist/npm/models/transactions/NFTokenBurn.js.map +1 -1
  130. package/dist/npm/models/transactions/NFTokenCancelOffer.d.ts +4 -0
  131. package/dist/npm/models/transactions/NFTokenCancelOffer.d.ts.map +1 -1
  132. package/dist/npm/models/transactions/NFTokenCancelOffer.js.map +1 -1
  133. package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts +7 -3
  134. package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
  135. package/dist/npm/models/transactions/NFTokenCreateOffer.js +3 -1
  136. package/dist/npm/models/transactions/NFTokenCreateOffer.js.map +1 -1
  137. package/dist/npm/models/transactions/NFTokenMint.d.ts +6 -2
  138. package/dist/npm/models/transactions/NFTokenMint.d.ts.map +1 -1
  139. package/dist/npm/models/transactions/NFTokenMint.js +2 -1
  140. package/dist/npm/models/transactions/NFTokenMint.js.map +1 -1
  141. package/dist/npm/models/transactions/UNLModify.d.ts +2 -1
  142. package/dist/npm/models/transactions/UNLModify.d.ts.map +1 -1
  143. package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts +2 -2
  144. package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -1
  145. package/dist/npm/models/transactions/XChainAccountCreateCommit.js +1 -2
  146. package/dist/npm/models/transactions/XChainAccountCreateCommit.js.map +1 -1
  147. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts +5 -5
  148. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -1
  149. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js +4 -4
  150. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  151. package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts +5 -5
  152. package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -1
  153. package/dist/npm/models/transactions/XChainAddClaimAttestation.js +4 -4
  154. package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  155. package/dist/npm/models/transactions/XChainClaim.d.ts +2 -2
  156. package/dist/npm/models/transactions/XChainClaim.d.ts.map +1 -1
  157. package/dist/npm/models/transactions/XChainClaim.js +1 -1
  158. package/dist/npm/models/transactions/XChainClaim.js.map +1 -1
  159. package/dist/npm/models/transactions/XChainCommit.d.ts +2 -2
  160. package/dist/npm/models/transactions/XChainCommit.d.ts.map +1 -1
  161. package/dist/npm/models/transactions/XChainCommit.js +1 -1
  162. package/dist/npm/models/transactions/XChainCommit.js.map +1 -1
  163. package/dist/npm/models/transactions/XChainCreateClaimID.d.ts +2 -2
  164. package/dist/npm/models/transactions/XChainCreateClaimID.d.ts.map +1 -1
  165. package/dist/npm/models/transactions/XChainCreateClaimID.js +1 -1
  166. package/dist/npm/models/transactions/XChainCreateClaimID.js.map +1 -1
  167. package/dist/npm/models/transactions/XChainModifyBridge.js +1 -1
  168. package/dist/npm/models/transactions/XChainModifyBridge.js.map +1 -1
  169. package/dist/npm/models/transactions/accountDelete.d.ts +2 -2
  170. package/dist/npm/models/transactions/accountDelete.d.ts.map +1 -1
  171. package/dist/npm/models/transactions/accountDelete.js +2 -11
  172. package/dist/npm/models/transactions/accountDelete.js.map +1 -1
  173. package/dist/npm/models/transactions/accountSet.d.ts +2 -2
  174. package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
  175. package/dist/npm/models/transactions/accountSet.js +3 -7
  176. package/dist/npm/models/transactions/accountSet.js.map +1 -1
  177. package/dist/npm/models/transactions/checkCreate.d.ts +2 -2
  178. package/dist/npm/models/transactions/checkCreate.d.ts.map +1 -1
  179. package/dist/npm/models/transactions/checkCreate.js +2 -10
  180. package/dist/npm/models/transactions/checkCreate.js.map +1 -1
  181. package/dist/npm/models/transactions/common.d.ts +3 -1
  182. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  183. package/dist/npm/models/transactions/common.js +7 -1
  184. package/dist/npm/models/transactions/common.js.map +1 -1
  185. package/dist/npm/models/transactions/enableAmendment.js +1 -1
  186. package/dist/npm/models/transactions/enableAmendment.js.map +1 -1
  187. package/dist/npm/models/transactions/escrowCancel.d.ts +2 -2
  188. package/dist/npm/models/transactions/escrowCancel.d.ts.map +1 -1
  189. package/dist/npm/models/transactions/escrowCancel.js +1 -6
  190. package/dist/npm/models/transactions/escrowCancel.js.map +1 -1
  191. package/dist/npm/models/transactions/escrowCreate.d.ts +2 -2
  192. package/dist/npm/models/transactions/escrowCreate.d.ts.map +1 -1
  193. package/dist/npm/models/transactions/escrowCreate.js +2 -10
  194. package/dist/npm/models/transactions/escrowCreate.js.map +1 -1
  195. package/dist/npm/models/transactions/escrowFinish.d.ts +2 -2
  196. package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
  197. package/dist/npm/models/transactions/escrowFinish.js +1 -6
  198. package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
  199. package/dist/npm/models/transactions/index.d.ts +1 -1
  200. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  201. package/dist/npm/models/transactions/index.js.map +1 -1
  202. package/dist/npm/models/transactions/metadata.d.ts +9 -1
  203. package/dist/npm/models/transactions/metadata.d.ts.map +1 -1
  204. package/dist/npm/models/transactions/metadata.js.map +1 -1
  205. package/dist/npm/models/transactions/offerCreate.js +1 -1
  206. package/dist/npm/models/transactions/offerCreate.js.map +1 -1
  207. package/dist/npm/models/transactions/payment.d.ts +7 -2
  208. package/dist/npm/models/transactions/payment.d.ts.map +1 -1
  209. package/dist/npm/models/transactions/payment.js +3 -10
  210. package/dist/npm/models/transactions/payment.js.map +1 -1
  211. package/dist/npm/models/transactions/paymentChannelClaim.js +1 -1
  212. package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
  213. package/dist/npm/models/transactions/paymentChannelCreate.d.ts +2 -2
  214. package/dist/npm/models/transactions/paymentChannelCreate.d.ts.map +1 -1
  215. package/dist/npm/models/transactions/paymentChannelCreate.js +2 -10
  216. package/dist/npm/models/transactions/paymentChannelCreate.js.map +1 -1
  217. package/dist/npm/models/transactions/transaction.d.ts +8 -3
  218. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  219. package/dist/npm/models/transactions/transaction.js.map +1 -1
  220. package/dist/npm/models/transactions/trustSet.js +1 -1
  221. package/dist/npm/models/transactions/trustSet.js.map +1 -1
  222. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  223. package/dist/npm/models/utils/flags.js +17 -28
  224. package/dist/npm/models/utils/flags.js.map +1 -1
  225. package/dist/npm/snippets/src/bridgeTransfer.js +4 -3
  226. package/dist/npm/snippets/src/bridgeTransfer.js.map +1 -1
  227. package/dist/npm/snippets/src/getTransaction.js +1 -1
  228. package/dist/npm/snippets/src/getTransaction.js.map +1 -1
  229. package/dist/npm/snippets/src/paths.js +2 -3
  230. package/dist/npm/snippets/src/paths.js.map +1 -1
  231. package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -0
  232. package/dist/npm/src/Wallet/authorizeChannel.d.ts +3 -0
  233. package/dist/npm/src/Wallet/authorizeChannel.d.ts.map +1 -0
  234. package/dist/npm/src/Wallet/authorizeChannel.js +14 -0
  235. package/dist/npm/src/Wallet/authorizeChannel.js.map +1 -0
  236. package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
  237. package/dist/npm/src/Wallet/defaultFaucets.js +1 -4
  238. package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
  239. package/dist/npm/src/Wallet/fundWallet.d.ts +17 -3
  240. package/dist/npm/src/Wallet/fundWallet.d.ts.map +1 -1
  241. package/dist/npm/src/Wallet/fundWallet.js +53 -78
  242. package/dist/npm/src/Wallet/fundWallet.js.map +1 -1
  243. package/dist/npm/src/Wallet/index.d.ts.map +1 -1
  244. package/dist/npm/src/Wallet/index.js +24 -23
  245. package/dist/npm/src/Wallet/index.js.map +1 -1
  246. package/dist/npm/src/Wallet/signer.d.ts +2 -4
  247. package/dist/npm/src/Wallet/signer.d.ts.map +1 -1
  248. package/dist/npm/src/Wallet/signer.js +17 -13
  249. package/dist/npm/src/Wallet/signer.js.map +1 -1
  250. package/dist/npm/src/Wallet/walletFromSecretNumbers.js +2 -2
  251. package/dist/npm/src/Wallet/walletFromSecretNumbers.js.map +1 -1
  252. package/dist/npm/src/client/RequestManager.d.ts +3 -2
  253. package/dist/npm/src/client/RequestManager.d.ts.map +1 -1
  254. package/dist/npm/src/client/RequestManager.js +25 -1
  255. package/dist/npm/src/client/RequestManager.js.map +1 -1
  256. package/dist/npm/src/client/connection.d.ts +8 -11
  257. package/dist/npm/src/client/connection.d.ts.map +1 -1
  258. package/dist/npm/src/client/connection.js +8 -54
  259. package/dist/npm/src/client/connection.js.map +1 -1
  260. package/dist/npm/src/client/index.d.ts +56 -78
  261. package/dist/npm/src/client/index.d.ts.map +1 -1
  262. package/dist/npm/src/client/index.js +155 -42
  263. package/dist/npm/src/client/index.js.map +1 -1
  264. package/dist/npm/src/client/partialPayment.d.ts +4 -2
  265. package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
  266. package/dist/npm/src/client/partialPayment.js.map +1 -1
  267. package/dist/npm/src/errors.d.ts.map +1 -1
  268. package/dist/npm/src/errors.js +1 -2
  269. package/dist/npm/src/errors.js.map +1 -1
  270. package/dist/npm/src/index.d.ts +1 -1
  271. package/dist/npm/src/index.d.ts.map +1 -1
  272. package/dist/npm/src/index.js +1 -3
  273. package/dist/npm/src/index.js.map +1 -1
  274. package/dist/npm/src/models/ledger/AMM.d.ts +2 -4
  275. package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
  276. package/dist/npm/src/models/ledger/AccountRoot.d.ts +2 -4
  277. package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
  278. package/dist/npm/src/models/ledger/AccountRoot.js +1 -1
  279. package/dist/npm/src/models/ledger/AccountRoot.js.map +1 -1
  280. package/dist/npm/src/models/ledger/Amendments.d.ts +2 -2
  281. package/dist/npm/src/models/ledger/Amendments.d.ts.map +1 -1
  282. package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts +9 -1
  283. package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
  284. package/dist/npm/src/models/ledger/Bridge.d.ts +2 -4
  285. package/dist/npm/src/models/ledger/Bridge.d.ts.map +1 -1
  286. package/dist/npm/src/models/ledger/Check.d.ts +2 -2
  287. package/dist/npm/src/models/ledger/Check.d.ts.map +1 -1
  288. package/dist/npm/src/models/ledger/DepositPreauth.d.ts +2 -4
  289. package/dist/npm/src/models/ledger/DepositPreauth.d.ts.map +1 -1
  290. package/dist/npm/src/models/ledger/DirectoryNode.d.ts +2 -2
  291. package/dist/npm/src/models/ledger/DirectoryNode.d.ts.map +1 -1
  292. package/dist/npm/src/models/ledger/Escrow.d.ts +2 -4
  293. package/dist/npm/src/models/ledger/Escrow.d.ts.map +1 -1
  294. package/dist/npm/src/models/ledger/FeeSettings.d.ts +2 -2
  295. package/dist/npm/src/models/ledger/FeeSettings.d.ts.map +1 -1
  296. package/dist/npm/src/models/ledger/Ledger.d.ts +3 -3
  297. package/dist/npm/src/models/ledger/Ledger.d.ts.map +1 -1
  298. package/dist/npm/src/models/ledger/LedgerEntry.d.ts +2 -1
  299. package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
  300. package/dist/npm/src/models/ledger/LedgerHashes.d.ts +2 -2
  301. package/dist/npm/src/models/ledger/LedgerHashes.d.ts.map +1 -1
  302. package/dist/npm/src/models/ledger/NFTokenOffer.d.ts +2 -4
  303. package/dist/npm/src/models/ledger/NFTokenOffer.d.ts.map +1 -1
  304. package/dist/npm/src/models/ledger/NFTokenPage.d.ts +2 -4
  305. package/dist/npm/src/models/ledger/NFTokenPage.d.ts.map +1 -1
  306. package/dist/npm/src/models/ledger/NegativeUNL.d.ts +2 -2
  307. package/dist/npm/src/models/ledger/NegativeUNL.d.ts.map +1 -1
  308. package/dist/npm/src/models/ledger/Offer.d.ts +2 -4
  309. package/dist/npm/src/models/ledger/Offer.d.ts.map +1 -1
  310. package/dist/npm/src/models/ledger/Offer.js +1 -1
  311. package/dist/npm/src/models/ledger/Offer.js.map +1 -1
  312. package/dist/npm/src/models/ledger/PayChannel.d.ts +2 -4
  313. package/dist/npm/src/models/ledger/PayChannel.d.ts.map +1 -1
  314. package/dist/npm/src/models/ledger/RippleState.d.ts +2 -4
  315. package/dist/npm/src/models/ledger/RippleState.d.ts.map +1 -1
  316. package/dist/npm/src/models/ledger/RippleState.js +1 -1
  317. package/dist/npm/src/models/ledger/RippleState.js.map +1 -1
  318. package/dist/npm/src/models/ledger/SignerList.d.ts +2 -4
  319. package/dist/npm/src/models/ledger/SignerList.d.ts.map +1 -1
  320. package/dist/npm/src/models/ledger/SignerList.js +1 -1
  321. package/dist/npm/src/models/ledger/SignerList.js.map +1 -1
  322. package/dist/npm/src/models/ledger/Ticket.d.ts +2 -4
  323. package/dist/npm/src/models/ledger/Ticket.d.ts.map +1 -1
  324. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +2 -4
  325. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  326. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +2 -4
  327. package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -1
  328. package/dist/npm/src/models/ledger/index.d.ts +2 -2
  329. package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
  330. package/dist/npm/src/models/ledger/index.js.map +1 -1
  331. package/dist/npm/src/models/methods/accountObjects.d.ts +4 -3
  332. package/dist/npm/src/models/methods/accountObjects.d.ts.map +1 -1
  333. package/dist/npm/src/models/methods/index.d.ts +12 -1
  334. package/dist/npm/src/models/methods/index.d.ts.map +1 -1
  335. package/dist/npm/src/models/methods/ledger.d.ts +37 -7
  336. package/dist/npm/src/models/methods/ledger.d.ts.map +1 -1
  337. package/dist/npm/src/models/methods/ledgerData.d.ts +2 -1
  338. package/dist/npm/src/models/methods/ledgerData.d.ts.map +1 -1
  339. package/dist/npm/src/models/methods/ledgerEntry.d.ts +2 -2
  340. package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
  341. package/dist/npm/src/models/methods/subscribe.d.ts +3 -0
  342. package/dist/npm/src/models/methods/subscribe.d.ts.map +1 -1
  343. package/dist/npm/src/models/methods/tx.d.ts +3 -2
  344. package/dist/npm/src/models/methods/tx.d.ts.map +1 -1
  345. package/dist/npm/src/models/transactions/AMMDeposit.js +1 -1
  346. package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
  347. package/dist/npm/src/models/transactions/AMMWithdraw.js +1 -1
  348. package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -1
  349. package/dist/npm/src/models/transactions/NFTokenAcceptOffer.d.ts +4 -0
  350. package/dist/npm/src/models/transactions/NFTokenAcceptOffer.d.ts.map +1 -1
  351. package/dist/npm/src/models/transactions/NFTokenAcceptOffer.js.map +1 -1
  352. package/dist/npm/src/models/transactions/NFTokenBurn.d.ts +3 -3
  353. package/dist/npm/src/models/transactions/NFTokenBurn.d.ts.map +1 -1
  354. package/dist/npm/src/models/transactions/NFTokenBurn.js +2 -4
  355. package/dist/npm/src/models/transactions/NFTokenBurn.js.map +1 -1
  356. package/dist/npm/src/models/transactions/NFTokenCancelOffer.d.ts +4 -0
  357. package/dist/npm/src/models/transactions/NFTokenCancelOffer.d.ts.map +1 -1
  358. package/dist/npm/src/models/transactions/NFTokenCancelOffer.js.map +1 -1
  359. package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts +7 -3
  360. package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
  361. package/dist/npm/src/models/transactions/NFTokenCreateOffer.js +3 -1
  362. package/dist/npm/src/models/transactions/NFTokenCreateOffer.js.map +1 -1
  363. package/dist/npm/src/models/transactions/NFTokenMint.d.ts +6 -2
  364. package/dist/npm/src/models/transactions/NFTokenMint.d.ts.map +1 -1
  365. package/dist/npm/src/models/transactions/NFTokenMint.js +2 -1
  366. package/dist/npm/src/models/transactions/NFTokenMint.js.map +1 -1
  367. package/dist/npm/src/models/transactions/UNLModify.d.ts +2 -1
  368. package/dist/npm/src/models/transactions/UNLModify.d.ts.map +1 -1
  369. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts +2 -2
  370. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -1
  371. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js +1 -2
  372. package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js.map +1 -1
  373. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts +5 -5
  374. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -1
  375. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js +4 -4
  376. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  377. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts +5 -5
  378. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -1
  379. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js +4 -4
  380. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  381. package/dist/npm/src/models/transactions/XChainClaim.d.ts +2 -2
  382. package/dist/npm/src/models/transactions/XChainClaim.d.ts.map +1 -1
  383. package/dist/npm/src/models/transactions/XChainClaim.js +1 -1
  384. package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -1
  385. package/dist/npm/src/models/transactions/XChainCommit.d.ts +2 -2
  386. package/dist/npm/src/models/transactions/XChainCommit.d.ts.map +1 -1
  387. package/dist/npm/src/models/transactions/XChainCommit.js +1 -1
  388. package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -1
  389. package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts +2 -2
  390. package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts.map +1 -1
  391. package/dist/npm/src/models/transactions/XChainCreateClaimID.js +1 -1
  392. package/dist/npm/src/models/transactions/XChainCreateClaimID.js.map +1 -1
  393. package/dist/npm/src/models/transactions/XChainModifyBridge.js +1 -1
  394. package/dist/npm/src/models/transactions/XChainModifyBridge.js.map +1 -1
  395. package/dist/npm/src/models/transactions/accountDelete.d.ts +2 -2
  396. package/dist/npm/src/models/transactions/accountDelete.d.ts.map +1 -1
  397. package/dist/npm/src/models/transactions/accountDelete.js +2 -11
  398. package/dist/npm/src/models/transactions/accountDelete.js.map +1 -1
  399. package/dist/npm/src/models/transactions/accountSet.d.ts +2 -2
  400. package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
  401. package/dist/npm/src/models/transactions/accountSet.js +3 -7
  402. package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
  403. package/dist/npm/src/models/transactions/checkCreate.d.ts +2 -2
  404. package/dist/npm/src/models/transactions/checkCreate.d.ts.map +1 -1
  405. package/dist/npm/src/models/transactions/checkCreate.js +2 -10
  406. package/dist/npm/src/models/transactions/checkCreate.js.map +1 -1
  407. package/dist/npm/src/models/transactions/common.d.ts +3 -1
  408. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  409. package/dist/npm/src/models/transactions/common.js +7 -1
  410. package/dist/npm/src/models/transactions/common.js.map +1 -1
  411. package/dist/npm/src/models/transactions/enableAmendment.js +1 -1
  412. package/dist/npm/src/models/transactions/enableAmendment.js.map +1 -1
  413. package/dist/npm/src/models/transactions/escrowCancel.d.ts +2 -2
  414. package/dist/npm/src/models/transactions/escrowCancel.d.ts.map +1 -1
  415. package/dist/npm/src/models/transactions/escrowCancel.js +1 -6
  416. package/dist/npm/src/models/transactions/escrowCancel.js.map +1 -1
  417. package/dist/npm/src/models/transactions/escrowCreate.d.ts +2 -2
  418. package/dist/npm/src/models/transactions/escrowCreate.d.ts.map +1 -1
  419. package/dist/npm/src/models/transactions/escrowCreate.js +2 -10
  420. package/dist/npm/src/models/transactions/escrowCreate.js.map +1 -1
  421. package/dist/npm/src/models/transactions/escrowFinish.d.ts +2 -2
  422. package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
  423. package/dist/npm/src/models/transactions/escrowFinish.js +1 -6
  424. package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
  425. package/dist/npm/src/models/transactions/index.d.ts +1 -1
  426. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  427. package/dist/npm/src/models/transactions/index.js.map +1 -1
  428. package/dist/npm/src/models/transactions/metadata.d.ts +9 -1
  429. package/dist/npm/src/models/transactions/metadata.d.ts.map +1 -1
  430. package/dist/npm/src/models/transactions/metadata.js.map +1 -1
  431. package/dist/npm/src/models/transactions/offerCreate.js +1 -1
  432. package/dist/npm/src/models/transactions/offerCreate.js.map +1 -1
  433. package/dist/npm/src/models/transactions/payment.d.ts +7 -2
  434. package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
  435. package/dist/npm/src/models/transactions/payment.js +3 -10
  436. package/dist/npm/src/models/transactions/payment.js.map +1 -1
  437. package/dist/npm/src/models/transactions/paymentChannelClaim.js +1 -1
  438. package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
  439. package/dist/npm/src/models/transactions/paymentChannelCreate.d.ts +2 -2
  440. package/dist/npm/src/models/transactions/paymentChannelCreate.d.ts.map +1 -1
  441. package/dist/npm/src/models/transactions/paymentChannelCreate.js +2 -10
  442. package/dist/npm/src/models/transactions/paymentChannelCreate.js.map +1 -1
  443. package/dist/npm/src/models/transactions/transaction.d.ts +8 -3
  444. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  445. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  446. package/dist/npm/src/models/transactions/trustSet.js +1 -1
  447. package/dist/npm/src/models/transactions/trustSet.js.map +1 -1
  448. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  449. package/dist/npm/src/models/utils/flags.js +17 -28
  450. package/dist/npm/src/models/utils/flags.js.map +1 -1
  451. package/dist/npm/src/sugar/autofill.d.ts +6 -2
  452. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  453. package/dist/npm/src/sugar/autofill.js +9 -28
  454. package/dist/npm/src/sugar/autofill.js.map +1 -1
  455. package/dist/npm/src/sugar/balances.d.ts +2 -17
  456. package/dist/npm/src/sugar/balances.d.ts.map +1 -1
  457. package/dist/npm/src/sugar/balances.js +2 -60
  458. package/dist/npm/src/sugar/balances.js.map +1 -1
  459. package/dist/npm/src/sugar/getOrderbook.d.ts +19 -5
  460. package/dist/npm/src/sugar/getOrderbook.d.ts.map +1 -1
  461. package/dist/npm/src/sugar/getOrderbook.js +72 -53
  462. package/dist/npm/src/sugar/getOrderbook.js.map +1 -1
  463. package/dist/npm/src/sugar/index.d.ts +0 -4
  464. package/dist/npm/src/sugar/index.d.ts.map +1 -1
  465. package/dist/npm/src/sugar/index.js +0 -13
  466. package/dist/npm/src/sugar/index.js.map +1 -1
  467. package/dist/npm/src/sugar/submit.d.ts +6 -9
  468. package/dist/npm/src/sugar/submit.d.ts.map +1 -1
  469. package/dist/npm/src/sugar/submit.js +5 -22
  470. package/dist/npm/src/sugar/submit.js.map +1 -1
  471. package/dist/npm/src/utils/collections.d.ts +7 -0
  472. package/dist/npm/src/utils/collections.d.ts.map +1 -0
  473. package/dist/npm/src/utils/collections.js +22 -0
  474. package/dist/npm/src/utils/collections.js.map +1 -0
  475. package/dist/npm/src/utils/getBalanceChanges.d.ts.map +1 -1
  476. package/dist/npm/src/utils/getBalanceChanges.js +3 -4
  477. package/dist/npm/src/utils/getBalanceChanges.js.map +1 -1
  478. package/dist/npm/src/utils/getNFTokenID.d.ts.map +1 -1
  479. package/dist/npm/src/utils/getNFTokenID.js +8 -8
  480. package/dist/npm/src/utils/getNFTokenID.js.map +1 -1
  481. package/dist/npm/src/utils/hashes/SHAMap/node.js +1 -1
  482. package/dist/npm/src/utils/hashes/SHAMap/node.js.map +1 -1
  483. package/dist/npm/src/utils/hashes/hashLedger.d.ts +2 -1
  484. package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
  485. package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
  486. package/dist/npm/src/utils/hashes/sha512Half.d.ts.map +1 -1
  487. package/dist/npm/src/utils/hashes/sha512Half.js +4 -7
  488. package/dist/npm/src/utils/hashes/sha512Half.js.map +1 -1
  489. package/dist/npm/sugar/autofill.d.ts +6 -2
  490. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  491. package/dist/npm/sugar/autofill.js +9 -28
  492. package/dist/npm/sugar/autofill.js.map +1 -1
  493. package/dist/npm/sugar/balances.d.ts +2 -17
  494. package/dist/npm/sugar/balances.d.ts.map +1 -1
  495. package/dist/npm/sugar/balances.js +2 -60
  496. package/dist/npm/sugar/balances.js.map +1 -1
  497. package/dist/npm/sugar/getOrderbook.d.ts +19 -5
  498. package/dist/npm/sugar/getOrderbook.d.ts.map +1 -1
  499. package/dist/npm/sugar/getOrderbook.js +72 -53
  500. package/dist/npm/sugar/getOrderbook.js.map +1 -1
  501. package/dist/npm/sugar/index.d.ts +0 -4
  502. package/dist/npm/sugar/index.d.ts.map +1 -1
  503. package/dist/npm/sugar/index.js +0 -13
  504. package/dist/npm/sugar/index.js.map +1 -1
  505. package/dist/npm/sugar/submit.d.ts +6 -9
  506. package/dist/npm/sugar/submit.d.ts.map +1 -1
  507. package/dist/npm/sugar/submit.js +5 -22
  508. package/dist/npm/sugar/submit.js.map +1 -1
  509. package/dist/npm/utils/collections.d.ts +7 -0
  510. package/dist/npm/utils/collections.d.ts.map +1 -0
  511. package/dist/npm/utils/collections.js +22 -0
  512. package/dist/npm/utils/collections.js.map +1 -0
  513. package/dist/npm/utils/getBalanceChanges.d.ts.map +1 -1
  514. package/dist/npm/utils/getBalanceChanges.js +3 -4
  515. package/dist/npm/utils/getBalanceChanges.js.map +1 -1
  516. package/dist/npm/utils/getNFTokenID.d.ts.map +1 -1
  517. package/dist/npm/utils/getNFTokenID.js +8 -8
  518. package/dist/npm/utils/getNFTokenID.js.map +1 -1
  519. package/dist/npm/utils/hashes/SHAMap/node.js +1 -1
  520. package/dist/npm/utils/hashes/SHAMap/node.js.map +1 -1
  521. package/dist/npm/utils/hashes/hashLedger.d.ts +2 -1
  522. package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
  523. package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
  524. package/dist/npm/utils/hashes/sha512Half.d.ts.map +1 -1
  525. package/dist/npm/utils/hashes/sha512Half.js +4 -7
  526. package/dist/npm/utils/hashes/sha512Half.js.map +1 -1
  527. package/package.json +32 -25
  528. package/src/Wallet/authorizeChannel.ts +26 -0
  529. package/src/Wallet/defaultFaucets.ts +0 -4
  530. package/src/Wallet/fundWallet.ts +151 -212
  531. package/src/Wallet/index.ts +28 -25
  532. package/src/Wallet/signer.ts +32 -43
  533. package/src/Wallet/walletFromSecretNumbers.ts +1 -1
  534. package/src/client/RequestManager.ts +40 -14
  535. package/src/client/connection.ts +20 -89
  536. package/src/client/index.ts +704 -269
  537. package/src/client/partialPayment.ts +20 -10
  538. package/src/errors.ts +1 -3
  539. package/src/index.ts +1 -3
  540. package/src/models/ledger/AMM.ts +2 -10
  541. package/src/models/ledger/AccountRoot.ts +2 -12
  542. package/src/models/ledger/Amendments.ts +4 -2
  543. package/src/models/ledger/BaseLedgerEntry.ts +25 -1
  544. package/src/models/ledger/Bridge.ts +2 -14
  545. package/src/models/ledger/Check.ts +2 -2
  546. package/src/models/ledger/DepositPreauth.ts +4 -12
  547. package/src/models/ledger/DirectoryNode.ts +4 -2
  548. package/src/models/ledger/Escrow.ts +2 -12
  549. package/src/models/ledger/FeeSettings.ts +2 -2
  550. package/src/models/ledger/Ledger.ts +10 -4
  551. package/src/models/ledger/LedgerEntry.ts +22 -1
  552. package/src/models/ledger/LedgerHashes.ts +4 -2
  553. package/src/models/ledger/NFTokenOffer.ts +2 -4
  554. package/src/models/ledger/NFTokenPage.ts +2 -4
  555. package/src/models/ledger/NegativeUNL.ts +4 -2
  556. package/src/models/ledger/Offer.ts +2 -12
  557. package/src/models/ledger/PayChannel.ts +2 -12
  558. package/src/models/ledger/RippleState.ts +2 -12
  559. package/src/models/ledger/SignerList.ts +2 -12
  560. package/src/models/ledger/Ticket.ts +2 -12
  561. package/src/models/ledger/XChainOwnedClaimID.ts +4 -12
  562. package/src/models/ledger/XChainOwnedCreateAccountClaimID.ts +3 -12
  563. package/src/models/ledger/index.ts +2 -1
  564. package/src/models/methods/accountObjects.ts +10 -44
  565. package/src/models/methods/index.ts +175 -0
  566. package/src/models/methods/ledger.ts +154 -20
  567. package/src/models/methods/ledgerData.ts +5 -1
  568. package/src/models/methods/ledgerEntry.ts +2 -2
  569. package/src/models/methods/subscribe.ts +36 -0
  570. package/src/models/methods/tx.ts +6 -3
  571. package/src/models/transactions/NFTokenAcceptOffer.ts +6 -0
  572. package/src/models/transactions/NFTokenBurn.ts +13 -9
  573. package/src/models/transactions/NFTokenCancelOffer.ts +6 -0
  574. package/src/models/transactions/NFTokenCreateOffer.ts +14 -2
  575. package/src/models/transactions/NFTokenMint.ts +17 -2
  576. package/src/models/transactions/UNLModify.ts +3 -1
  577. package/src/models/transactions/XChainAccountCreateCommit.ts +4 -4
  578. package/src/models/transactions/XChainAddAccountCreateAttestation.ts +10 -8
  579. package/src/models/transactions/XChainAddClaimAttestation.ts +10 -8
  580. package/src/models/transactions/XChainClaim.ts +4 -2
  581. package/src/models/transactions/XChainCommit.ts +4 -2
  582. package/src/models/transactions/XChainCreateClaimID.ts +4 -3
  583. package/src/models/transactions/accountDelete.ts +12 -18
  584. package/src/models/transactions/accountSet.ts +10 -11
  585. package/src/models/transactions/checkCreate.ts +8 -15
  586. package/src/models/transactions/common.ts +20 -1
  587. package/src/models/transactions/escrowCancel.ts +9 -9
  588. package/src/models/transactions/escrowCreate.ts +12 -16
  589. package/src/models/transactions/escrowFinish.ts +9 -9
  590. package/src/models/transactions/index.ts +6 -1
  591. package/src/models/transactions/metadata.ts +31 -1
  592. package/src/models/transactions/payment.ts +14 -14
  593. package/src/models/transactions/paymentChannelCreate.ts +12 -21
  594. package/src/models/transactions/transaction.ts +11 -4
  595. package/src/models/utils/flags.ts +18 -28
  596. package/src/sugar/autofill.ts +84 -88
  597. package/src/sugar/balances.ts +8 -116
  598. package/src/sugar/getOrderbook.ts +138 -61
  599. package/src/sugar/index.ts +0 -8
  600. package/src/sugar/submit.ts +114 -132
  601. package/src/utils/collections.ts +53 -0
  602. package/src/utils/getBalanceChanges.ts +2 -3
  603. package/src/utils/getNFTokenID.ts +18 -16
  604. package/src/utils/hashes/hashLedger.ts +4 -1
  605. package/src/utils/hashes/sha512Half.ts +4 -7
  606. package/dist/npm/client/BroadcastClient.d.ts +0 -7
  607. package/dist/npm/client/BroadcastClient.d.ts.map +0 -1
  608. package/dist/npm/client/BroadcastClient.js +0 -49
  609. package/dist/npm/client/BroadcastClient.js.map +0 -1
  610. package/dist/npm/client/WSWrapper.d.ts +0 -25
  611. package/dist/npm/client/WSWrapper.d.ts.map +0 -1
  612. package/dist/npm/client/WSWrapper.js +0 -44
  613. package/dist/npm/client/WSWrapper.js.map +0 -1
  614. package/dist/npm/src/client/BroadcastClient.d.ts +0 -7
  615. package/dist/npm/src/client/BroadcastClient.d.ts.map +0 -1
  616. package/dist/npm/src/client/BroadcastClient.js +0 -49
  617. package/dist/npm/src/client/BroadcastClient.js.map +0 -1
  618. package/dist/npm/src/client/WSWrapper.d.ts +0 -25
  619. package/dist/npm/src/client/WSWrapper.d.ts.map +0 -1
  620. package/dist/npm/src/client/WSWrapper.js +0 -44
  621. package/dist/npm/src/client/WSWrapper.js.map +0 -1
  622. package/dist/npm/src/sugar/getLedgerIndex.d.ts +0 -3
  623. package/dist/npm/src/sugar/getLedgerIndex.d.ts.map +0 -1
  624. package/dist/npm/src/sugar/getLedgerIndex.js +0 -22
  625. package/dist/npm/src/sugar/getLedgerIndex.js.map +0 -1
  626. package/dist/npm/sugar/getLedgerIndex.d.ts +0 -3
  627. package/dist/npm/sugar/getLedgerIndex.d.ts.map +0 -1
  628. package/dist/npm/sugar/getLedgerIndex.js +0 -22
  629. package/dist/npm/sugar/getLedgerIndex.js.map +0 -1
  630. package/src/client/BroadcastClient.ts +0 -84
  631. package/src/client/WSWrapper.ts +0 -106
  632. package/src/sugar/getLedgerIndex.ts +0 -15
@@ -1,123 +1,15 @@
1
- import flatMap from 'lodash/flatMap'
1
+ import { AccountLinesTrustline, Balance } from '../models'
2
2
 
3
- import type { Balance, Client } from '..'
4
- import {
5
- AccountLinesRequest,
6
- AccountLinesTrustline,
7
- LedgerIndex,
8
- AccountInfoRequest,
9
- } from '../models'
10
- import { dropsToXrp } from '../utils'
11
-
12
- function formatBalances(trustlines: AccountLinesTrustline[]): Balance[] {
3
+ /**
4
+ * Formats an array of trustlines into an array of balances.
5
+ *
6
+ * @param trustlines - The array of trustlines to format.
7
+ * @returns An array of balances, each containing the value, currency, and issuer.
8
+ */
9
+ export function formatBalances(trustlines: AccountLinesTrustline[]): Balance[] {
13
10
  return trustlines.map((trustline) => ({
14
11
  value: trustline.balance,
15
12
  currency: trustline.currency,
16
13
  issuer: trustline.account,
17
14
  }))
18
15
  }
19
-
20
- /**
21
- * Get the XRP balance for an account.
22
- *
23
- * @example
24
- * ```ts
25
- * const client = new Client(wss://s.altnet.rippletest.net:51233)
26
- * const balance = await client.getXrpBalance('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn')
27
- * console.log(balance)
28
- * /// '200'
29
- * ```
30
- *
31
- * @param this - Client.
32
- * @param address - Address of the account to retrieve XRP balance.
33
- * @param options - Options to include for getting the XRP balance.
34
- * @param options.ledger_index - Retrieve the account balances at a given
35
- * ledger_index.
36
- * @param options.ledger_hash - Retrieve the account balances at the ledger with
37
- * a given ledger_hash.
38
- * @returns The XRP balance of the account (as a string).
39
- */
40
- async function getXrpBalance(
41
- this: Client,
42
- address: string,
43
- options: {
44
- ledger_hash?: string
45
- ledger_index?: LedgerIndex
46
- } = {},
47
- ): Promise<string> {
48
- const xrpRequest: AccountInfoRequest = {
49
- command: 'account_info',
50
- account: address,
51
- ledger_index: options.ledger_index ?? 'validated',
52
- ledger_hash: options.ledger_hash,
53
- }
54
- const response = await this.request(xrpRequest)
55
- return dropsToXrp(response.result.account_data.Balance)
56
- }
57
-
58
- /**
59
- * Get XRP/non-XRP balances for an account.
60
- *
61
- * @param this - Client.
62
- * @param address - Address of the account to retrieve balances for.
63
- * @param options - Allows the client to specify a ledger_hash, ledger_index,
64
- * filter by peer, and/or limit number of balances.
65
- * @param options.ledger_index - Retrieve the account balances at a given
66
- * ledger_index.
67
- * @param options.ledger_hash - Retrieve the account balances at the ledger with
68
- * a given ledger_hash.
69
- * @param options.peer - Filter balances by peer.
70
- * @param options.limit - Limit number of balances to return.
71
- * @returns An array of XRP/non-XRP balances for the given account.
72
- */
73
- // eslint-disable-next-line max-lines-per-function -- Longer definition is required for end users to see the definition.
74
- async function getBalances(
75
- this: Client,
76
- address: string,
77
- options: {
78
- ledger_hash?: string
79
- ledger_index?: LedgerIndex
80
- peer?: string
81
- limit?: number
82
- } = {},
83
- ): Promise<
84
- Array<{ value: string; currency: string; issuer?: string | undefined }>
85
- > {
86
- const balances: Balance[] = []
87
-
88
- // get XRP balance
89
- let xrpPromise: Promise<string> = Promise.resolve('')
90
- if (!options.peer) {
91
- xrpPromise = this.getXrpBalance(address, {
92
- ledger_hash: options.ledger_hash,
93
- ledger_index: options.ledger_index,
94
- })
95
- }
96
-
97
- // get non-XRP balances
98
- const linesRequest: AccountLinesRequest = {
99
- command: 'account_lines',
100
- account: address,
101
- ledger_index: options.ledger_index ?? 'validated',
102
- ledger_hash: options.ledger_hash,
103
- peer: options.peer,
104
- limit: options.limit,
105
- }
106
- const linesPromise = this.requestAll(linesRequest)
107
-
108
- // combine results
109
- await Promise.all([xrpPromise, linesPromise]).then(
110
- ([xrpBalance, linesResponses]) => {
111
- const accountLinesBalance = flatMap(linesResponses, (response) =>
112
- formatBalances(response.result.lines),
113
- )
114
- if (xrpBalance !== '') {
115
- balances.push({ currency: 'XRP', value: xrpBalance })
116
- }
117
- balances.push(...accountLinesBalance)
118
- },
119
- )
120
- return balances.slice(0, options.limit)
121
- }
122
-
123
- export { getXrpBalance, getBalances }
@@ -1,6 +1,4 @@
1
- /* eslint-disable max-lines-per-function -- Needs to process orderbooks. */
2
1
  import BigNumber from 'bignumber.js'
3
- import flatMap from 'lodash/flatMap'
4
2
 
5
3
  import type { Client } from '../client'
6
4
  import { ValidationError } from '../errors'
@@ -31,43 +29,40 @@ const getOrderbookOptionsSet = new Set([
31
29
  ])
32
30
 
33
31
  /**
34
- * Fetch orderbook (buy/sell orders) between two currency pairs. This checks both sides of the orderbook
35
- * by making two `order_book` requests (with the second reversing takerPays and takerGets). Returned offers are
36
- * not normalized in this function, so either currency could be takerGets or takerPays.
32
+ * Represents the options for retrieving the order book.
33
+ */
34
+ export interface GetOrderBookOptions {
35
+ /**
36
+ * The limit on the number of offers to return.
37
+ */
38
+ limit?: number
39
+ /**
40
+ * The ledger index of the ledger to use.
41
+ */
42
+ ledger_index?: LedgerIndex
43
+ /**
44
+ * The ledger hash of the ledger to use.
45
+ */
46
+ ledger_hash?: string | null
47
+ /**
48
+ * The account that takes the offers.
49
+ */
50
+ taker?: string | null
51
+ }
52
+
53
+ /**
54
+ * Validates the options for retrieving the order book.
37
55
  *
38
- * @param this - Client.
39
- * @param currency1 - Specification of one currency involved. (With a currency code and optionally an issuer)
40
- * @param currency2 - Specification of a second currency involved. (With a currency code and optionally an issuer)
41
- * @param options - Options allowing the client to specify ledger_index,
42
- * ledger_hash, filter by taker, and/or limit number of orders.
43
- * @param options.ledger_index - Retrieve the orderbook at a given ledger_index.
44
- * @param options.ledger_hash - Retrieve the orderbook at the ledger with a
45
- * given ledger_hash.
46
- * @param options.taker - Filter orders by taker.
47
- * @param options.limit - The limit passed into each book_offers request.
48
- * Can return more than this due to two calls being made. Defaults to 20.
49
- * @returns An object containing buy and sell objects.
56
+ * @param options - The options to validate.
57
+ * @throws {ValidationError} If any validation errors occur.
50
58
  */
51
- // eslint-disable-next-line max-params, complexity -- Once bound to Client, getOrderbook only has 3 parameters.
52
- async function getOrderbook(
53
- this: Client,
54
- currency1: BookOfferCurrency,
55
- currency2: BookOfferCurrency,
56
- options: {
57
- limit?: number
58
- ledger_index?: LedgerIndex
59
- ledger_hash?: string | null
60
- taker?: string | null
61
- } = {},
62
- ): Promise<{
63
- buy: BookOffer[]
64
- sell: BookOffer[]
65
- }> {
66
- Object.keys(options).forEach((key) => {
59
+ // eslint-disable-next-line complexity -- Necessary for validation.
60
+ export function validateOrderbookOptions(options: GetOrderBookOptions): void {
61
+ for (const key of Object.keys(options)) {
67
62
  if (!getOrderbookOptionsSet.has(key)) {
68
63
  throw new ValidationError(`Unexpected option: ${key}`, options)
69
64
  }
70
- })
65
+ }
71
66
 
72
67
  if (options.limit && typeof options.limit !== 'number') {
73
68
  throw new ValidationError('limit must be a number', options.limit)
@@ -101,7 +96,30 @@ async function getOrderbook(
101
96
  if (options.taker !== undefined && typeof options.taker !== 'string') {
102
97
  throw new ValidationError('taker must be a string', options.taker)
103
98
  }
99
+ }
104
100
 
101
+ /**
102
+ * Creates a request object for retrieving book offers.
103
+ *
104
+ * @param currency1 - The first currency in the pair.
105
+ * @param currency2 - The second currency in the pair.
106
+ * @param options - Additional options for the request.
107
+ * @param [options.limit] - The maximum number of offers to retrieve.
108
+ * @param [options.ledger_index] - The ledger index to use for retrieval.
109
+ * @param [options.ledger_hash] - The ledger hash to use for retrieval.
110
+ * @param [options.taker] - The taker address for retrieval.
111
+ * @returns The created request object.
112
+ */
113
+ export function createBookOffersRequest(
114
+ currency1: BookOfferCurrency,
115
+ currency2: BookOfferCurrency,
116
+ options: {
117
+ limit?: number
118
+ ledger_index?: LedgerIndex
119
+ ledger_hash?: string | null
120
+ taker?: string | null
121
+ },
122
+ ): BookOffersRequest {
105
123
  const request: BookOffersRequest = {
106
124
  command: 'book_offers',
107
125
  taker_pays: currency1,
@@ -111,25 +129,78 @@ async function getOrderbook(
111
129
  limit: options.limit ?? DEFAULT_LIMIT,
112
130
  taker: options.taker ? options.taker : undefined,
113
131
  }
114
- // 2. Make Request
115
- const directOfferResults = await this.requestAll(request)
116
- request.taker_gets = currency1
117
- request.taker_pays = currency2
118
- const reverseOfferResults = await this.requestAll(request)
119
- // 3. Return Formatted Response
120
- const directOffers = flatMap(
121
- directOfferResults,
122
- (directOfferResult) => directOfferResult.result.offers,
123
- )
124
- const reverseOffers = flatMap(
125
- reverseOfferResults,
126
- (reverseOfferResult) => reverseOfferResult.result.offers,
127
- )
128
-
129
- const orders = [...directOffers, ...reverseOffers]
130
- // separate out the buy and sell orders
132
+
133
+ return request
134
+ }
135
+
136
+ type BookOfferResult = BookOffer[]
137
+
138
+ /**
139
+ * Retrieves all book offer results using the given request.
140
+ *
141
+ * @param client - The Ripple client.
142
+ * @param request - The request object.
143
+ * @returns The array of book offer results.
144
+ */
145
+ export async function requestAllOffers(
146
+ client: Client,
147
+ request: BookOffersRequest,
148
+ ): Promise<BookOfferResult[]> {
149
+ const results = await client.requestAll(request)
150
+ return results.map((result) => result.result.offers)
151
+ }
152
+
153
+ /**
154
+ * Creates a reverse request object by swapping the taker pays and taker gets amounts.
155
+ *
156
+ * @param request - The original request object.
157
+ * @returns The reverse request object.
158
+ */
159
+ export function reverseRequest(request: BookOffersRequest): BookOffersRequest {
160
+ return {
161
+ ...request,
162
+ taker_pays: request.taker_gets,
163
+ taker_gets: request.taker_pays,
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Extracts the offers from the book offer results.
169
+ *
170
+ * @param offerResults - The array of book offer results.
171
+ * @returns The extracted offers.
172
+ */
173
+ export function extractOffers(offerResults: BookOfferResult[]): BookOffer[] {
174
+ return offerResults.flatMap((offerResult) => offerResult)
175
+ }
176
+
177
+ /**
178
+ * Combines the direct and reverse offers into a single array.
179
+ *
180
+ * @param directOffers - The direct offers.
181
+ * @param reverseOffers - The reverse offers.
182
+ * @returns The combined array of offers.
183
+ */
184
+ export function combineOrders(
185
+ directOffers: BookOffer[],
186
+ reverseOffers: BookOffer[],
187
+ ): BookOffer[] {
188
+ return [...directOffers, ...reverseOffers]
189
+ }
190
+
191
+ /**
192
+ * Separates the buy and sell orders from the given array of orders.
193
+ *
194
+ * @param orders - The array of orders.
195
+ * @returns The separated buy and sell orders.
196
+ */
197
+ export function separateBuySellOrders(orders: BookOffer[]): {
198
+ buy: BookOffer[]
199
+ sell: BookOffer[]
200
+ } {
131
201
  const buy: BookOffer[] = []
132
202
  const sell: BookOffer[] = []
203
+
133
204
  orders.forEach((order) => {
134
205
  // eslint-disable-next-line no-bitwise -- necessary for flags check
135
206
  if ((order.Flags & OfferFlags.lsfSell) === 0) {
@@ -138,15 +209,21 @@ async function getOrderbook(
138
209
  sell.push(order)
139
210
  }
140
211
  })
141
- /*
142
- * Sort the orders
143
- * for both buys and sells, lowest quality is closest to mid-market
144
- * we sort the orders so that earlier orders are closer to mid-market
145
- */
146
- return {
147
- buy: sortOffers(buy).slice(0, options.limit),
148
- sell: sortOffers(sell).slice(0, options.limit),
149
- }
212
+
213
+ return { buy, sell }
150
214
  }
151
215
 
152
- export default getOrderbook
216
+ /**
217
+ * Sorts and limits the given array of offers.
218
+ *
219
+ * @param offers - The array of offers to sort and limit.
220
+ * @param [limit] - The maximum number of offers to include.
221
+ * @returns The sorted and limited array of offers.
222
+ */
223
+ export function sortAndLimitOffers(
224
+ offers: BookOffer[],
225
+ limit?: number,
226
+ ): BookOffer[] {
227
+ const sortedOffers = sortOffers(offers)
228
+ return sortedOffers.slice(0, limit)
229
+ }
@@ -1,11 +1,3 @@
1
- export { default as autofill } from './autofill'
2
-
3
- export { getBalances, getXrpBalance } from './balances'
4
-
5
- export { default as getLedgerIndex } from './getLedgerIndex'
6
-
7
- export { default as getOrderbook } from './getOrderbook'
8
-
9
1
  export * from './submit'
10
2
 
11
3
  export * from './utils'
@@ -6,7 +6,6 @@ import { Signer } from '../models/common'
6
6
  import { TxRequest, TxResponse } from '../models/methods'
7
7
  import { Transaction } from '../models/transactions'
8
8
  import { BaseTransaction } from '../models/transactions/common'
9
- import { hashes } from '../utils'
10
9
 
11
10
  /** Approximate time for a ledger to close, in milliseconds */
12
11
  const LEDGER_CLOSE_TIME = 1000
@@ -17,130 +16,31 @@ async function sleep(ms: number): Promise<void> {
17
16
  })
18
17
  }
19
18
 
20
- /**
21
- * Submits a signed/unsigned transaction.
22
- * Steps performed on a transaction:
23
- * 1. Autofill.
24
- * 2. Sign & Encode.
25
- * 3. Submit.
26
- *
27
- * @param this - A Client.
28
- * @param transaction - A transaction to autofill, sign & encode, and submit.
29
- * @param opts - (Optional) Options used to sign and submit a transaction.
30
- * @param opts.autofill - If true, autofill a transaction.
31
- * @param opts.failHard - If true, and the transaction fails locally, do not retry or relay the transaction to other servers.
32
- * @param opts.wallet - A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.
33
- * @returns A promise that contains SubmitResponse.
34
- * @throws RippledError if submit request fails.
35
- */
36
- async function submit(
37
- this: Client,
38
- transaction: Transaction | string,
39
- opts?: {
40
- // If true, autofill a transaction.
41
- autofill?: boolean
42
- // If true, and the transaction fails locally, do not retry or relay the transaction to other servers.
43
- failHard?: boolean
44
- // A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.
45
- wallet?: Wallet
46
- },
47
- ): Promise<SubmitResponse> {
48
- const signedTx = await getSignedTx(this, transaction, opts)
49
- return submitRequest(this, signedTx, opts?.failHard)
50
- }
19
+ // Helper functions
51
20
 
52
21
  /**
53
- * Asynchronously submits a transaction and verifies that it has been included in a
54
- * validated ledger (or has errored/will not be included for some reason).
55
- * See [Reliable Transaction Submission](https://xrpl.org/reliable-transaction-submission.html).
56
- *
57
- * @example
58
- *
59
- * ```ts
60
- * const { Client, Wallet } = require('xrpl')
61
- * const client = new Client('wss://s.altnet.rippletest.net:51233')
62
- *
63
- * async function submitTransaction() {
64
- * const senderWallet = client.fundWallet()
65
- * const recipientWallet = client.fundWallet()
66
- *
67
- * const transaction = {
68
- * TransactionType: 'Payment',
69
- * Account: senderWallet.address,
70
- * Destination: recipientWallet.address,
71
- * Amount: '10'
72
- * }
73
- *
74
- * try {
75
- * await client.submit(signedTransaction, { wallet: senderWallet })
76
- * console.log(result)
77
- * } catch (error) {
78
- * console.error(`Failed to submit transaction: ${error}`)
79
- * }
80
- * }
81
- *
82
- * submitTransaction()
83
- * ```
22
+ * Submits a request to the client with a signed transaction.
84
23
  *
85
- * In this example we submit a payment transaction between two newly created testnet accounts.
24
+ * @param client - The client to submit the request to.
25
+ * @param signedTransaction - The signed transaction to submit. It can be either a Transaction object or a
26
+ * string (encode from ripple-binary-codec) representation of the transaction.
27
+ * @param [failHard=false] - Optional. Determines whether the submission should fail hard (true) or not (false). Default is false.
28
+ * @returns A promise that resolves with the response from the client.
29
+ * @throws {ValidationError} If the signed transaction is not valid (not signed).
86
30
  *
87
- * Under the hood, `submit` will call `client.autofill` by default, and because we've passed in a `Wallet` it
88
- * Will also sign the transaction for us before submitting the signed transaction binary blob to the ledger.
31
+ * @example
32
+ * import { Client } from "xrpl"
33
+ * const client = new Client("wss://s.altnet.rippletest.net:51233");
34
+ * await client.connect();
35
+ * const signedTransaction = createSignedTransaction();
36
+ * // Example 1: Submitting a Transaction object
37
+ * const response1 = await submitRequest(client, signedTransaction);
89
38
  *
90
- * This is similar to `submitAndWait` which does all of the above, but also waits to see if the transaction has been validated.
91
- * @param this - A Client.
92
- * @param transaction - A transaction to autofill, sign & encode, and submit.
93
- * @param opts - (Optional) Options used to sign and submit a transaction.
94
- * @param opts.autofill - If true, autofill a transaction.
95
- * @param opts.failHard - If true, and the transaction fails locally, do not retry or relay the transaction to other servers.
96
- * @param opts.wallet - A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.
97
- * @throws Connection errors: If the `Client` object is unable to establish a connection to the specified WebSocket endpoint,
98
- * an error will be thrown.
99
- * @throws Transaction errors: If the submitted transaction is invalid or cannot be included in a validated ledger for any
100
- * reason, the promise returned by `submitAndWait()` will be rejected with an error. This could include issues with insufficient
101
- * balance, invalid transaction fields, or other issues specific to the transaction being submitted.
102
- * @throws Ledger errors: If the ledger being used to submit the transaction is undergoing maintenance or otherwise unavailable,
103
- * an error will be thrown.
104
- * @throws Timeout errors: If the transaction takes longer than the specified timeout period to be included in a validated
105
- * ledger, the promise returned by `submitAndWait()` will be rejected with an error.
106
- * @returns A promise that contains TxResponse, that will return when the transaction has been validated.
39
+ * // Example 2: Submitting a string representation of the transaction
40
+ * const signedTransactionString = encode(signedTransaction);
41
+ * const response2 = await submitRequest(client, signedTransactionString, true);
107
42
  */
108
- async function submitAndWait<T extends Transaction = Transaction>(
109
- this: Client,
110
- transaction: T | string,
111
- opts?: {
112
- // If true, autofill a transaction.
113
- autofill?: boolean
114
- // If true, and the transaction fails locally, do not retry or relay the transaction to other servers.
115
- failHard?: boolean
116
- // A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.
117
- wallet?: Wallet
118
- },
119
- ): Promise<TxResponse<T>> {
120
- const signedTx = await getSignedTx(this, transaction, opts)
121
-
122
- const lastLedger = getLastLedgerSequence(signedTx)
123
- if (lastLedger == null) {
124
- throw new ValidationError(
125
- 'Transaction must contain a LastLedgerSequence value for reliable submission.',
126
- )
127
- }
128
-
129
- const response = await submitRequest(this, signedTx, opts?.failHard)
130
-
131
- const txHash = hashes.hashSignedTx(signedTx)
132
- return waitForFinalTransactionOutcome(
133
- this,
134
- txHash,
135
- lastLedger,
136
- response.result.engine_result,
137
- )
138
- }
139
-
140
- // Helper functions
141
-
142
- // Encodes and submits a signed transaction.
143
- async function submitRequest(
43
+ export async function submitRequest(
144
44
  client: Client,
145
45
  signedTransaction: Transaction | string,
146
46
  failHard = false,
@@ -161,14 +61,49 @@ async function submitRequest(
161
61
  return client.request(request)
162
62
  }
163
63
 
164
- /*
165
- * The core logic of reliable submission. This polls the ledger until the result of the
166
- * transaction can be considered final, meaning it has either been included in a
167
- * validated ledger, or the transaction's lastLedgerSequence has been surpassed by the
168
- * latest ledger sequence (meaning it will never be included in a validated ledger).
64
+ /**
65
+ * Waits for the final outcome of a transaction by polling the ledger until the result can be considered final,
66
+ * meaning it has either been included in a validated ledger, or the transaction's lastLedgerSequence has been
67
+ * surpassed by the latest ledger sequence (meaning it will never be included in a validated ledger).
68
+ *
69
+ * @template T - The type of the transaction. Defaults to `Transaction`.
70
+ * @param client - The client to use for requesting transaction information.
71
+ * @param txHash - The hash of the transaction to wait for.
72
+ * @param lastLedger - The last ledger sequence of the transaction.
73
+ * @param submissionResult - The preliminary result of the transaction.
74
+ * @returns A promise that resolves with the final transaction response.
75
+ *
76
+ * @throws {XrplError} If the latest ledger sequence surpasses the transaction's lastLedgerSequence.
77
+ *
78
+ * @example
79
+ * import { hashes, Client } from "xrpl"
80
+ * const client = new Client("wss://s.altnet.rippletest.net:51233")
81
+ * await client.connect()
82
+ *
83
+ * const transaction = createTransaction() // your transaction function
84
+ *
85
+ * const signedTx = await getSignedTx(this, transaction)
86
+ *
87
+ * const lastLedger = getLastLedgerSequence(signedTx)
88
+ *
89
+ * if (lastLedger == null) {
90
+ * throw new ValidationError(
91
+ * 'Transaction must contain a LastLedgerSequence value for reliable submission.',
92
+ * )
93
+ * }
94
+ *
95
+ * const response = await submitRequest(this, signedTx, opts?.failHard)
96
+ *
97
+ * const txHash = hashes.hashSignedTx(signedTx)
98
+ * return waitForFinalTransactionOutcome(
99
+ * this,
100
+ * txHash,
101
+ * lastLedger,
102
+ * response.result.engine_result,
103
+ * )
169
104
  */
170
105
  // eslint-disable-next-line max-params, max-lines-per-function -- this function needs to display and do with more information.
171
- async function waitForFinalTransactionOutcome<
106
+ export async function waitForFinalTransactionOutcome<
172
107
  T extends BaseTransaction = Transaction,
173
108
  >(
174
109
  client: Client,
@@ -248,8 +183,40 @@ function isSigned(transaction: Transaction | string): boolean {
248
183
  return tx.SigningPubKey != null && tx.TxnSignature != null
249
184
  }
250
185
 
251
- // initializes a transaction for a submit request
252
- async function getSignedTx(
186
+ /**
187
+ * Updates a transaction with `autofill` then signs it if it is unsigned.
188
+ *
189
+ * @param client - The client from which to retrieve the signed transaction.
190
+ * @param transaction - The transaction to retrieve. It can be either a Transaction object or
191
+ * a string (encode from ripple-binary-codec) representation of the transaction.
192
+ * @param [options={}] - Optional. Additional options for retrieving the signed transaction.
193
+ * @param [options.autofill=true] - Optional. Determines whether the transaction should be autofilled (true)
194
+ * or not (false). Default is true.
195
+ * @param [options.wallet] - Optional. A wallet to sign the transaction. It must be provided when submitting
196
+ * an unsigned transaction. Default is undefined.
197
+ * @returns A promise that resolves with the signed transaction.
198
+ *
199
+ * @throws {ValidationError} If the transaction is not signed and no wallet is provided.
200
+ *
201
+ * @example
202
+ * import { Client } from "xrpl"
203
+ * import { encode } from "ripple-binary-codec"
204
+ *
205
+ * const client = new Client("wss://s.altnet.rippletest.net:51233");
206
+ * await client.connect():
207
+ * const transaction = createTransaction(); // createTransaction is your function to create a transaction
208
+ * const options = {
209
+ * autofill: true,
210
+ * wallet: myWallet,
211
+ * };
212
+ *
213
+ * // Example 1: Retrieving a signed Transaction object
214
+ * const signedTx1 = await getSignedTx(client, transaction, options);
215
+ *
216
+ * // Example 2: Retrieving a string representation of the signed transaction
217
+ * const signedTxString = await getSignedTx(client, encode(transaction), options);
218
+ */
219
+ export async function getSignedTx(
253
220
  client: Client,
254
221
  transaction: Transaction | string,
255
222
  {
@@ -258,8 +225,6 @@ async function getSignedTx(
258
225
  }: {
259
226
  // If true, autofill a transaction.
260
227
  autofill?: boolean
261
- // If true, and the transaction fails locally, do not retry or relay the transaction to other servers.
262
- failHard?: boolean
263
228
  // A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.
264
229
  wallet?: Wallet
265
230
  } = {},
@@ -288,7 +253,26 @@ async function getSignedTx(
288
253
  }
289
254
 
290
255
  // checks if there is a LastLedgerSequence as a part of the transaction
291
- function getLastLedgerSequence(
256
+ /**
257
+ * Retrieves the last ledger sequence from a transaction.
258
+ *
259
+ * @param transaction - The transaction to retrieve the last ledger sequence from. It can be either a Transaction object or
260
+ * a string (encode from ripple-binary-codec) representation of the transaction.
261
+ * @returns The last ledger sequence of the transaction, or null if not available.
262
+ *
263
+ * @example
264
+ * const transaction = createTransaction(); // your function to create a transaction
265
+ *
266
+ * // Example 1: Retrieving the last ledger sequence from a Transaction object
267
+ * const lastLedgerSequence1 = getLastLedgerSequence(transaction);
268
+ * console.log(lastLedgerSequence1); // Output: 12345
269
+ *
270
+ * // Example 2: Retrieving the last ledger sequence from a string representation of the transaction
271
+ * const transactionString = encode(transaction);
272
+ * const lastLedgerSequence2 = getLastLedgerSequence(transactionString);
273
+ * console.log(lastLedgerSequence2); // Output: 67890
274
+ */
275
+ export function getLastLedgerSequence(
292
276
  transaction: Transaction | string,
293
277
  ): number | null {
294
278
  const tx = typeof transaction === 'string' ? decode(transaction) : transaction
@@ -301,5 +285,3 @@ function isAccountDelete(transaction: Transaction | string): boolean {
301
285
  const tx = typeof transaction === 'string' ? decode(transaction) : transaction
302
286
  return tx.TransactionType === 'AccountDelete'
303
287
  }
304
-
305
- export { submit, submitAndWait }