xrpl 4.3.0-smartescrow.3 → 4.3.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 (339) hide show
  1. package/README.md +2 -2
  2. package/build/xrpl-latest-min.js +3 -0
  3. package/build/xrpl-latest-min.js.map +1 -0
  4. package/build/xrpl-latest.js +395 -140
  5. package/build/xrpl-latest.js.map +1 -1
  6. package/dist/npm/Wallet/batchSigner.d.ts +8 -0
  7. package/dist/npm/Wallet/batchSigner.d.ts.map +1 -0
  8. package/dist/npm/Wallet/batchSigner.js +111 -0
  9. package/dist/npm/Wallet/batchSigner.js.map +1 -0
  10. package/dist/npm/Wallet/defaultFaucets.d.ts +4 -4
  11. package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
  12. package/dist/npm/Wallet/defaultFaucets.js +15 -17
  13. package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
  14. package/dist/npm/Wallet/fundWallet.d.ts.map +1 -1
  15. package/dist/npm/Wallet/fundWallet.js +8 -16
  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 +10 -4
  19. package/dist/npm/Wallet/index.js.map +1 -1
  20. package/dist/npm/Wallet/signer.d.ts.map +1 -1
  21. package/dist/npm/Wallet/signer.js +4 -20
  22. package/dist/npm/Wallet/signer.js.map +1 -1
  23. package/dist/npm/Wallet/utils.d.ts +9 -0
  24. package/dist/npm/Wallet/utils.d.ts.map +1 -0
  25. package/dist/npm/Wallet/utils.js +28 -0
  26. package/dist/npm/Wallet/utils.js.map +1 -0
  27. package/dist/npm/client/RequestManager.d.ts.map +1 -1
  28. package/dist/npm/client/RequestManager.js +3 -3
  29. package/dist/npm/client/RequestManager.js.map +1 -1
  30. package/dist/npm/client/connection.d.ts.map +1 -1
  31. package/dist/npm/client/connection.js.map +1 -1
  32. package/dist/npm/client/index.d.ts.map +1 -1
  33. package/dist/npm/client/index.js +6 -9
  34. package/dist/npm/client/index.js.map +1 -1
  35. package/dist/npm/client/partialPayment.d.ts.map +1 -1
  36. package/dist/npm/client/partialPayment.js.map +1 -1
  37. package/dist/npm/models/ledger/Credential.d.ts +2 -2
  38. package/dist/npm/models/ledger/Credential.d.ts.map +1 -1
  39. package/dist/npm/models/ledger/Escrow.d.ts +0 -2
  40. package/dist/npm/models/ledger/Escrow.d.ts.map +1 -1
  41. package/dist/npm/models/ledger/FeeSettings.d.ts +0 -2
  42. package/dist/npm/models/ledger/FeeSettings.d.ts.map +1 -1
  43. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +1 -2
  44. package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  45. package/dist/npm/models/methods/baseMethod.d.ts +1 -0
  46. package/dist/npm/models/methods/baseMethod.d.ts.map +1 -1
  47. package/dist/npm/models/methods/serverInfo.d.ts +0 -6
  48. package/dist/npm/models/methods/serverInfo.d.ts.map +1 -1
  49. package/dist/npm/models/methods/serverState.d.ts +0 -6
  50. package/dist/npm/models/methods/serverState.d.ts.map +1 -1
  51. package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -1
  52. package/dist/npm/models/transactions/AMMBid.js.map +1 -1
  53. package/dist/npm/models/transactions/AMMClawback.d.ts +2 -2
  54. package/dist/npm/models/transactions/AMMClawback.d.ts.map +1 -1
  55. package/dist/npm/models/transactions/AMMDeposit.d.ts +2 -2
  56. package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
  57. package/dist/npm/models/transactions/AMMWithdraw.d.ts +2 -2
  58. package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -1
  59. package/dist/npm/models/transactions/MPTokenAuthorize.d.ts +2 -2
  60. package/dist/npm/models/transactions/MPTokenAuthorize.d.ts.map +1 -1
  61. package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts +2 -2
  62. package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -1
  63. package/dist/npm/models/transactions/MPTokenIssuanceCreate.js.map +1 -1
  64. package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts +2 -2
  65. package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -1
  66. package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts +2 -2
  67. package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
  68. package/dist/npm/models/transactions/NFTokenMint.d.ts +2 -2
  69. package/dist/npm/models/transactions/NFTokenMint.d.ts.map +1 -1
  70. package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  71. package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  72. package/dist/npm/models/transactions/XChainClaim.js.map +1 -1
  73. package/dist/npm/models/transactions/XChainCommit.js.map +1 -1
  74. package/dist/npm/models/transactions/XChainModifyBridge.d.ts +2 -2
  75. package/dist/npm/models/transactions/XChainModifyBridge.d.ts.map +1 -1
  76. package/dist/npm/models/transactions/accountDelete.d.ts.map +1 -1
  77. package/dist/npm/models/transactions/accountDelete.js.map +1 -1
  78. package/dist/npm/models/transactions/accountSet.d.ts +2 -2
  79. package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
  80. package/dist/npm/models/transactions/accountSet.js.map +1 -1
  81. package/dist/npm/models/transactions/batch.d.ts +39 -0
  82. package/dist/npm/models/transactions/batch.d.ts.map +1 -0
  83. package/dist/npm/models/transactions/batch.js +64 -0
  84. package/dist/npm/models/transactions/batch.js.map +1 -0
  85. package/dist/npm/models/transactions/common.d.ts +22 -6
  86. package/dist/npm/models/transactions/common.d.ts.map +1 -1
  87. package/dist/npm/models/transactions/common.js +25 -10
  88. package/dist/npm/models/transactions/common.js.map +1 -1
  89. package/dist/npm/models/transactions/delegateSet.d.ts.map +1 -1
  90. package/dist/npm/models/transactions/delegateSet.js +1 -0
  91. package/dist/npm/models/transactions/delegateSet.js.map +1 -1
  92. package/dist/npm/models/transactions/depositPreauth.d.ts.map +1 -1
  93. package/dist/npm/models/transactions/depositPreauth.js.map +1 -1
  94. package/dist/npm/models/transactions/escrowCreate.d.ts +0 -2
  95. package/dist/npm/models/transactions/escrowCreate.d.ts.map +1 -1
  96. package/dist/npm/models/transactions/escrowCreate.js +2 -4
  97. package/dist/npm/models/transactions/escrowCreate.js.map +1 -1
  98. package/dist/npm/models/transactions/escrowFinish.d.ts +0 -1
  99. package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
  100. package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
  101. package/dist/npm/models/transactions/index.d.ts +3 -2
  102. package/dist/npm/models/transactions/index.d.ts.map +1 -1
  103. package/dist/npm/models/transactions/index.js.map +1 -1
  104. package/dist/npm/models/transactions/metadata.d.ts +1 -0
  105. package/dist/npm/models/transactions/metadata.d.ts.map +1 -1
  106. package/dist/npm/models/transactions/offerCreate.d.ts +2 -2
  107. package/dist/npm/models/transactions/offerCreate.d.ts.map +1 -1
  108. package/dist/npm/models/transactions/oracleSet.d.ts.map +1 -1
  109. package/dist/npm/models/transactions/oracleSet.js.map +1 -1
  110. package/dist/npm/models/transactions/payment.d.ts +2 -2
  111. package/dist/npm/models/transactions/payment.d.ts.map +1 -1
  112. package/dist/npm/models/transactions/payment.js +3 -0
  113. package/dist/npm/models/transactions/payment.js.map +1 -1
  114. package/dist/npm/models/transactions/paymentChannelClaim.d.ts +2 -2
  115. package/dist/npm/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  116. package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
  117. package/dist/npm/models/transactions/permissionedDomainSet.d.ts.map +1 -1
  118. package/dist/npm/models/transactions/permissionedDomainSet.js +1 -1
  119. package/dist/npm/models/transactions/permissionedDomainSet.js.map +1 -1
  120. package/dist/npm/models/transactions/signerListSet.d.ts.map +1 -1
  121. package/dist/npm/models/transactions/signerListSet.js +1 -1
  122. package/dist/npm/models/transactions/signerListSet.js.map +1 -1
  123. package/dist/npm/models/transactions/transaction.d.ts +2 -1
  124. package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
  125. package/dist/npm/models/transactions/transaction.js +7 -0
  126. package/dist/npm/models/transactions/transaction.js.map +1 -1
  127. package/dist/npm/models/transactions/trustSet.d.ts +2 -2
  128. package/dist/npm/models/transactions/trustSet.d.ts.map +1 -1
  129. package/dist/npm/models/utils/flags.d.ts.map +1 -1
  130. package/dist/npm/models/utils/flags.js +24 -9
  131. package/dist/npm/models/utils/flags.js.map +1 -1
  132. package/dist/npm/models/utils/index.d.ts +2 -0
  133. package/dist/npm/models/utils/index.d.ts.map +1 -1
  134. package/dist/npm/models/utils/index.js +11 -1
  135. package/dist/npm/models/utils/index.js.map +1 -1
  136. package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
  137. package/dist/npm/src/Wallet/batchSigner.d.ts +8 -0
  138. package/dist/npm/src/Wallet/batchSigner.d.ts.map +1 -0
  139. package/dist/npm/src/Wallet/batchSigner.js +111 -0
  140. package/dist/npm/src/Wallet/batchSigner.js.map +1 -0
  141. package/dist/npm/src/Wallet/defaultFaucets.d.ts +4 -4
  142. package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
  143. package/dist/npm/src/Wallet/defaultFaucets.js +15 -17
  144. package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
  145. package/dist/npm/src/Wallet/fundWallet.d.ts.map +1 -1
  146. package/dist/npm/src/Wallet/fundWallet.js +8 -16
  147. package/dist/npm/src/Wallet/fundWallet.js.map +1 -1
  148. package/dist/npm/src/Wallet/index.d.ts.map +1 -1
  149. package/dist/npm/src/Wallet/index.js +10 -4
  150. package/dist/npm/src/Wallet/index.js.map +1 -1
  151. package/dist/npm/src/Wallet/signer.d.ts.map +1 -1
  152. package/dist/npm/src/Wallet/signer.js +4 -20
  153. package/dist/npm/src/Wallet/signer.js.map +1 -1
  154. package/dist/npm/src/Wallet/utils.d.ts +9 -0
  155. package/dist/npm/src/Wallet/utils.d.ts.map +1 -0
  156. package/dist/npm/src/Wallet/utils.js +28 -0
  157. package/dist/npm/src/Wallet/utils.js.map +1 -0
  158. package/dist/npm/src/client/RequestManager.d.ts.map +1 -1
  159. package/dist/npm/src/client/RequestManager.js +3 -3
  160. package/dist/npm/src/client/RequestManager.js.map +1 -1
  161. package/dist/npm/src/client/connection.d.ts.map +1 -1
  162. package/dist/npm/src/client/connection.js.map +1 -1
  163. package/dist/npm/src/client/index.d.ts.map +1 -1
  164. package/dist/npm/src/client/index.js +6 -9
  165. package/dist/npm/src/client/index.js.map +1 -1
  166. package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
  167. package/dist/npm/src/client/partialPayment.js.map +1 -1
  168. package/dist/npm/src/models/ledger/Credential.d.ts +2 -2
  169. package/dist/npm/src/models/ledger/Credential.d.ts.map +1 -1
  170. package/dist/npm/src/models/ledger/Escrow.d.ts +0 -2
  171. package/dist/npm/src/models/ledger/Escrow.d.ts.map +1 -1
  172. package/dist/npm/src/models/ledger/FeeSettings.d.ts +0 -2
  173. package/dist/npm/src/models/ledger/FeeSettings.d.ts.map +1 -1
  174. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +1 -2
  175. package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
  176. package/dist/npm/src/models/methods/baseMethod.d.ts +1 -0
  177. package/dist/npm/src/models/methods/baseMethod.d.ts.map +1 -1
  178. package/dist/npm/src/models/methods/serverInfo.d.ts +0 -6
  179. package/dist/npm/src/models/methods/serverInfo.d.ts.map +1 -1
  180. package/dist/npm/src/models/methods/serverState.d.ts +0 -6
  181. package/dist/npm/src/models/methods/serverState.d.ts.map +1 -1
  182. package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -1
  183. package/dist/npm/src/models/transactions/AMMBid.js.map +1 -1
  184. package/dist/npm/src/models/transactions/AMMClawback.d.ts +2 -2
  185. package/dist/npm/src/models/transactions/AMMClawback.d.ts.map +1 -1
  186. package/dist/npm/src/models/transactions/AMMDeposit.d.ts +2 -2
  187. package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
  188. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts +2 -2
  189. package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -1
  190. package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts +2 -2
  191. package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts.map +1 -1
  192. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts +2 -2
  193. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -1
  194. package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.js.map +1 -1
  195. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts +2 -2
  196. package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -1
  197. package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts +2 -2
  198. package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
  199. package/dist/npm/src/models/transactions/NFTokenMint.d.ts +2 -2
  200. package/dist/npm/src/models/transactions/NFTokenMint.d.ts.map +1 -1
  201. package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
  202. package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -1
  203. package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -1
  204. package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -1
  205. package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts +2 -2
  206. package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts.map +1 -1
  207. package/dist/npm/src/models/transactions/accountDelete.d.ts.map +1 -1
  208. package/dist/npm/src/models/transactions/accountDelete.js.map +1 -1
  209. package/dist/npm/src/models/transactions/accountSet.d.ts +2 -2
  210. package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
  211. package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
  212. package/dist/npm/src/models/transactions/batch.d.ts +39 -0
  213. package/dist/npm/src/models/transactions/batch.d.ts.map +1 -0
  214. package/dist/npm/src/models/transactions/batch.js +64 -0
  215. package/dist/npm/src/models/transactions/batch.js.map +1 -0
  216. package/dist/npm/src/models/transactions/common.d.ts +22 -6
  217. package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
  218. package/dist/npm/src/models/transactions/common.js +25 -10
  219. package/dist/npm/src/models/transactions/common.js.map +1 -1
  220. package/dist/npm/src/models/transactions/delegateSet.d.ts.map +1 -1
  221. package/dist/npm/src/models/transactions/delegateSet.js +1 -0
  222. package/dist/npm/src/models/transactions/delegateSet.js.map +1 -1
  223. package/dist/npm/src/models/transactions/depositPreauth.d.ts.map +1 -1
  224. package/dist/npm/src/models/transactions/depositPreauth.js.map +1 -1
  225. package/dist/npm/src/models/transactions/escrowCreate.d.ts +0 -2
  226. package/dist/npm/src/models/transactions/escrowCreate.d.ts.map +1 -1
  227. package/dist/npm/src/models/transactions/escrowCreate.js +2 -4
  228. package/dist/npm/src/models/transactions/escrowCreate.js.map +1 -1
  229. package/dist/npm/src/models/transactions/escrowFinish.d.ts +0 -1
  230. package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
  231. package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
  232. package/dist/npm/src/models/transactions/index.d.ts +3 -2
  233. package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
  234. package/dist/npm/src/models/transactions/index.js.map +1 -1
  235. package/dist/npm/src/models/transactions/metadata.d.ts +1 -0
  236. package/dist/npm/src/models/transactions/metadata.d.ts.map +1 -1
  237. package/dist/npm/src/models/transactions/offerCreate.d.ts +2 -2
  238. package/dist/npm/src/models/transactions/offerCreate.d.ts.map +1 -1
  239. package/dist/npm/src/models/transactions/oracleSet.d.ts.map +1 -1
  240. package/dist/npm/src/models/transactions/oracleSet.js.map +1 -1
  241. package/dist/npm/src/models/transactions/payment.d.ts +2 -2
  242. package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
  243. package/dist/npm/src/models/transactions/payment.js +3 -0
  244. package/dist/npm/src/models/transactions/payment.js.map +1 -1
  245. package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts +2 -2
  246. package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts.map +1 -1
  247. package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
  248. package/dist/npm/src/models/transactions/permissionedDomainSet.d.ts.map +1 -1
  249. package/dist/npm/src/models/transactions/permissionedDomainSet.js +1 -1
  250. package/dist/npm/src/models/transactions/permissionedDomainSet.js.map +1 -1
  251. package/dist/npm/src/models/transactions/signerListSet.d.ts.map +1 -1
  252. package/dist/npm/src/models/transactions/signerListSet.js +1 -1
  253. package/dist/npm/src/models/transactions/signerListSet.js.map +1 -1
  254. package/dist/npm/src/models/transactions/transaction.d.ts +2 -1
  255. package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
  256. package/dist/npm/src/models/transactions/transaction.js +7 -0
  257. package/dist/npm/src/models/transactions/transaction.js.map +1 -1
  258. package/dist/npm/src/models/transactions/trustSet.d.ts +2 -2
  259. package/dist/npm/src/models/transactions/trustSet.d.ts.map +1 -1
  260. package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
  261. package/dist/npm/src/models/utils/flags.js +24 -9
  262. package/dist/npm/src/models/utils/flags.js.map +1 -1
  263. package/dist/npm/src/models/utils/index.d.ts +2 -0
  264. package/dist/npm/src/models/utils/index.d.ts.map +1 -1
  265. package/dist/npm/src/models/utils/index.js +11 -1
  266. package/dist/npm/src/models/utils/index.js.map +1 -1
  267. package/dist/npm/src/sugar/autofill.d.ts +4 -2
  268. package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
  269. package/dist/npm/src/sugar/autofill.js +114 -42
  270. package/dist/npm/src/sugar/autofill.js.map +1 -1
  271. package/dist/npm/src/sugar/submit.d.ts.map +1 -1
  272. package/dist/npm/src/sugar/submit.js.map +1 -1
  273. package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
  274. package/dist/npm/src/utils/hashes/hashLedger.js +4 -1
  275. package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
  276. package/dist/npm/sugar/autofill.d.ts +4 -2
  277. package/dist/npm/sugar/autofill.d.ts.map +1 -1
  278. package/dist/npm/sugar/autofill.js +114 -42
  279. package/dist/npm/sugar/autofill.js.map +1 -1
  280. package/dist/npm/sugar/submit.d.ts.map +1 -1
  281. package/dist/npm/sugar/submit.js.map +1 -1
  282. package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
  283. package/dist/npm/utils/hashes/hashLedger.js +4 -1
  284. package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
  285. package/package.json +5 -5
  286. package/src/Wallet/batchSigner.ts +198 -0
  287. package/src/Wallet/defaultFaucets.ts +17 -20
  288. package/src/Wallet/fundWallet.ts +17 -28
  289. package/src/Wallet/index.ts +9 -3
  290. package/src/Wallet/signer.ts +4 -39
  291. package/src/Wallet/utils.ts +58 -0
  292. package/src/client/RequestManager.ts +4 -1
  293. package/src/client/connection.ts +0 -1
  294. package/src/client/index.ts +9 -30
  295. package/src/client/partialPayment.ts +3 -4
  296. package/src/models/ledger/Credential.ts +2 -2
  297. package/src/models/ledger/Escrow.ts +0 -4
  298. package/src/models/ledger/FeeSettings.ts +0 -4
  299. package/src/models/ledger/XChainOwnedClaimID.ts +1 -3
  300. package/src/models/methods/baseMethod.ts +1 -0
  301. package/src/models/methods/serverInfo.ts +0 -9
  302. package/src/models/methods/serverState.ts +0 -10
  303. package/src/models/transactions/AMMBid.ts +1 -2
  304. package/src/models/transactions/AMMClawback.ts +2 -2
  305. package/src/models/transactions/AMMDeposit.ts +2 -2
  306. package/src/models/transactions/AMMWithdraw.ts +2 -2
  307. package/src/models/transactions/MPTokenAuthorize.ts +2 -2
  308. package/src/models/transactions/MPTokenIssuanceCreate.ts +3 -2
  309. package/src/models/transactions/MPTokenIssuanceSet.ts +2 -2
  310. package/src/models/transactions/NFTokenCreateOffer.ts +2 -2
  311. package/src/models/transactions/NFTokenMint.ts +2 -2
  312. package/src/models/transactions/XChainAddAccountCreateAttestation.ts +2 -2
  313. package/src/models/transactions/XChainAddClaimAttestation.ts +2 -2
  314. package/src/models/transactions/XChainClaim.ts +1 -1
  315. package/src/models/transactions/XChainCommit.ts +1 -1
  316. package/src/models/transactions/XChainModifyBridge.ts +2 -2
  317. package/src/models/transactions/accountDelete.ts +1 -2
  318. package/src/models/transactions/accountSet.ts +2 -1
  319. package/src/models/transactions/batch.ts +151 -0
  320. package/src/models/transactions/common.ts +82 -30
  321. package/src/models/transactions/delegateSet.ts +1 -0
  322. package/src/models/transactions/depositPreauth.ts +2 -4
  323. package/src/models/transactions/escrowCreate.ts +2 -10
  324. package/src/models/transactions/escrowFinish.ts +1 -4
  325. package/src/models/transactions/index.ts +3 -3
  326. package/src/models/transactions/metadata.ts +2 -0
  327. package/src/models/transactions/offerCreate.ts +2 -2
  328. package/src/models/transactions/oracleSet.ts +95 -91
  329. package/src/models/transactions/payment.ts +8 -6
  330. package/src/models/transactions/paymentChannelClaim.ts +4 -4
  331. package/src/models/transactions/permissionedDomainSet.ts +3 -7
  332. package/src/models/transactions/signerListSet.ts +2 -2
  333. package/src/models/transactions/transaction.ts +15 -0
  334. package/src/models/transactions/trustSet.ts +2 -2
  335. package/src/models/utils/flags.ts +28 -10
  336. package/src/models/utils/index.ts +24 -0
  337. package/src/sugar/autofill.ts +178 -61
  338. package/src/sugar/submit.ts +1 -2
  339. package/src/utils/hashes/hashLedger.ts +5 -2
@@ -0,0 +1,198 @@
1
+ import { encode, encodeForSigningBatch } from 'ripple-binary-codec'
2
+ import { sign } from 'ripple-keypairs'
3
+
4
+ import { ValidationError } from '../errors'
5
+ import { Batch, Transaction, validate } from '../models'
6
+ import { BatchSigner, validateBatch } from '../models/transactions/batch'
7
+ import { hashSignedTx } from '../utils/hashes'
8
+
9
+ import { compareSigners, getDecodedTransaction } from './utils'
10
+
11
+ import { Wallet } from '.'
12
+
13
+ // eslint-disable-next-line max-params -- okay for helper function
14
+ function constructBatchSignerObject(
15
+ batchAccount: string,
16
+ wallet: Wallet,
17
+ signature: string,
18
+ multisignAddress: string | false = false,
19
+ ): BatchSigner {
20
+ let batchSigner: BatchSigner
21
+ if (multisignAddress) {
22
+ batchSigner = {
23
+ BatchSigner: {
24
+ Account: batchAccount,
25
+ Signers: [
26
+ {
27
+ Signer: {
28
+ Account: multisignAddress,
29
+ SigningPubKey: wallet.publicKey,
30
+ TxnSignature: signature,
31
+ },
32
+ },
33
+ ],
34
+ },
35
+ }
36
+ } else {
37
+ batchSigner = {
38
+ BatchSigner: {
39
+ Account: batchAccount,
40
+ SigningPubKey: wallet.publicKey,
41
+ TxnSignature: signature,
42
+ },
43
+ }
44
+ }
45
+ return batchSigner
46
+ }
47
+
48
+ /**
49
+ * Sign a multi-account Batch transaction.
50
+ *
51
+ * @param wallet - Wallet instance.
52
+ * @param transaction - The Batch transaction to sign.
53
+ * @param opts - Additional options for regular key and multi-signing complexity.
54
+ * @param opts.batchAccount - The account submitting the inner Batch transaction, on behalf of which is this signature.
55
+ * @param opts.multisign - Specify true/false to use multisign or actual address (classic/x-address) to make multisign tx request.
56
+ * The actual address is only needed in the case of regular key usage.
57
+ * @throws ValidationError if the transaction is malformed.
58
+ */
59
+ export function signMultiBatch(
60
+ wallet: Wallet,
61
+ transaction: Batch,
62
+ opts: { batchAccount?: string; multisign?: boolean | string } = {},
63
+ ): void {
64
+ const batchAccount = opts.batchAccount ?? wallet.classicAddress
65
+ let multisignAddress: boolean | string = false
66
+ if (typeof opts.multisign === 'string') {
67
+ multisignAddress = opts.multisign
68
+ } else if (opts.multisign) {
69
+ multisignAddress = wallet.classicAddress
70
+ }
71
+
72
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- for JS purposes
73
+ if (transaction.TransactionType !== 'Batch') {
74
+ throw new ValidationError('Must be a Batch transaction.')
75
+ }
76
+ /*
77
+ * This will throw a more clear error for JS users if the supplied transaction has incorrect formatting
78
+ */
79
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- validate does not accept Transaction type
80
+ validate(transaction as unknown as Record<string, unknown>)
81
+
82
+ const involvedAccounts = new Set(
83
+ transaction.RawTransactions.map((raw) => raw.RawTransaction.Account),
84
+ )
85
+ if (!involvedAccounts.has(batchAccount)) {
86
+ throw new ValidationError(
87
+ 'Must be signing for an address submitting a transaction in the Batch.',
88
+ )
89
+ }
90
+ const fieldsToSign = {
91
+ flags: transaction.Flags,
92
+ txIDs: transaction.RawTransactions.map((rawTx) =>
93
+ hashSignedTx(rawTx.RawTransaction),
94
+ ),
95
+ }
96
+ const signature = sign(encodeForSigningBatch(fieldsToSign), wallet.privateKey)
97
+
98
+ // eslint-disable-next-line no-param-reassign -- okay for signing
99
+ transaction.BatchSigners = [
100
+ constructBatchSignerObject(
101
+ batchAccount,
102
+ wallet,
103
+ signature,
104
+ multisignAddress,
105
+ ),
106
+ ]
107
+ }
108
+
109
+ /**
110
+ * Takes several transactions with BatchSigners fields (in object or blob form) and creates a
111
+ * single transaction with all BatchSigners that then gets signed and returned.
112
+ *
113
+ * @param transactions The transactions to combine `BatchSigners` values on.
114
+ * @returns A single signed Transaction which has all BatchSigners from transactions within it.
115
+ * @throws ValidationError if:
116
+ * - There were no transactions given to sign
117
+ * @category Signing
118
+ */
119
+ export function combineBatchSigners(
120
+ transactions: Array<Batch | string>,
121
+ ): string {
122
+ if (transactions.length === 0) {
123
+ throw new ValidationError('There are 0 transactions to combine.')
124
+ }
125
+
126
+ const decodedTransactions: Transaction[] = transactions.map((txOrBlob) => {
127
+ return getDecodedTransaction(txOrBlob)
128
+ })
129
+
130
+ decodedTransactions.forEach((tx) => {
131
+ if (tx.TransactionType !== 'Batch') {
132
+ throw new ValidationError('TransactionType must be `Batch`.')
133
+ }
134
+ /*
135
+ * This will throw a more clear error for JS users if any of the supplied transactions has incorrect formatting
136
+ */
137
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- validate does not accept Transaction type
138
+ validateBatch(tx as unknown as Record<string, unknown>)
139
+ if (tx.BatchSigners == null || tx.BatchSigners.length === 0) {
140
+ throw new ValidationError(
141
+ 'For combining Batch transaction signatures, all transactions must include a BatchSigners field containing an array of signatures.',
142
+ )
143
+ }
144
+
145
+ if (tx.TxnSignature != null || tx.Signers != null) {
146
+ throw new ValidationError('Batch transaction must be unsigned.')
147
+ }
148
+ })
149
+
150
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- checked above
151
+ const batchTransactions = decodedTransactions as Batch[]
152
+
153
+ validateBatchTransactionEquivalence(batchTransactions)
154
+
155
+ return encode(getTransactionWithAllBatchSigners(batchTransactions))
156
+ }
157
+
158
+ /**
159
+ * The transactions should all be equal except for the 'Signers' field.
160
+ *
161
+ * @param transactions - An array of Transactions which are expected to be equal other than 'Signers'.
162
+ * @throws ValidationError if the transactions are not equal in any field other than 'Signers'.
163
+ */
164
+ function validateBatchTransactionEquivalence(transactions: Batch[]): void {
165
+ const exampleTransaction = JSON.stringify({
166
+ flags: transactions[0].Flags,
167
+ transactionIDs: transactions[0].RawTransactions.map((rawTx) =>
168
+ hashSignedTx(rawTx.RawTransaction),
169
+ ),
170
+ })
171
+ if (
172
+ transactions.slice(1).some(
173
+ (tx) =>
174
+ JSON.stringify({
175
+ flags: tx.Flags,
176
+ transactionIDs: tx.RawTransactions.map((rawTx) =>
177
+ hashSignedTx(rawTx.RawTransaction),
178
+ ),
179
+ }) !== exampleTransaction,
180
+ )
181
+ ) {
182
+ throw new ValidationError(
183
+ 'Flags and transaction hashes are not the same for all provided transactions.',
184
+ )
185
+ }
186
+ }
187
+
188
+ function getTransactionWithAllBatchSigners(transactions: Batch[]): Batch {
189
+ // Signers must be sorted in the combined transaction - See compareSigners' documentation for more details
190
+ const sortedSigners: BatchSigner[] = transactions
191
+ .flatMap((tx) => tx.BatchSigners ?? [])
192
+ .filter((signer) => signer.BatchSigner.Account !== transactions[0].Account)
193
+ .sort((signer1, signer2) =>
194
+ compareSigners(signer1.BatchSigner, signer2.BatchSigner),
195
+ )
196
+
197
+ return { ...transactions[0], BatchSigners: sortedSigners }
198
+ }
@@ -14,42 +14,39 @@ export interface FaucetWallet {
14
14
  export enum FaucetNetwork {
15
15
  Testnet = 'faucet.altnet.rippletest.net',
16
16
  Devnet = 'faucet.devnet.rippletest.net',
17
- WasmDevnet = 'wasmfaucet.devnet.rippletest.net',
18
17
  }
19
18
 
20
- export const FaucetNetworkPaths: Record<string, string> = {
19
+ export const faucetNetworkPaths: Record<string, string> = {
21
20
  [FaucetNetwork.Testnet]: '/accounts',
22
21
  [FaucetNetwork.Devnet]: '/accounts',
23
- [FaucetNetwork.WasmDevnet]: '/accounts',
24
22
  }
25
23
 
24
+ export const faucetNetworkIDs: Map<number, FaucetNetwork> = new Map([
25
+ [1, FaucetNetwork.Testnet],
26
+ [2, FaucetNetwork.Devnet],
27
+ ])
28
+
26
29
  /**
27
30
  * Get the faucet host based on the Client connection.
28
31
  *
29
32
  * @param client - Client.
30
33
  * @returns A {@link FaucetNetwork}.
31
- * @throws When the client url is not on altnet or devnet.
34
+ * @throws When there is no known faucet for the client's network ID.
32
35
  */
33
36
  export function getFaucetHost(client: Client): FaucetNetwork | undefined {
34
- const connectionUrl = client.url
35
-
36
- // 'altnet' for Ripple Testnet server and 'testnet' for XRPL Labs Testnet server
37
- if (connectionUrl.includes('altnet') || connectionUrl.includes('testnet')) {
38
- return FaucetNetwork.Testnet
39
- }
40
-
41
- if (connectionUrl.includes('sidechain-net2')) {
37
+ if (client.networkID == null) {
42
38
  throw new XRPLFaucetError(
43
- 'Cannot fund an account on an issuing chain. Accounts must be created via the bridge.',
39
+ 'Cannot create faucet URL without networkID or the faucetHost information',
44
40
  )
45
41
  }
46
42
 
47
- if (connectionUrl.includes('wasm')) {
48
- return FaucetNetwork.WasmDevnet
43
+ if (faucetNetworkIDs.has(client.networkID)) {
44
+ return faucetNetworkIDs.get(client.networkID)
49
45
  }
50
46
 
51
- if (connectionUrl.includes('devnet')) {
52
- return FaucetNetwork.Devnet
47
+ if (client.networkID === 0) {
48
+ // mainnet does not have a faucet
49
+ throw new XRPLFaucetError('Faucet is not available for mainnet.')
53
50
  }
54
51
 
55
52
  throw new XRPLFaucetError('Faucet URL is not defined or inferrable.')
@@ -60,11 +57,11 @@ export function getFaucetHost(client: Client): FaucetNetwork | undefined {
60
57
  *
61
58
  * @param hostname - hostname.
62
59
  * @returns A String with the correct path for the input hostname.
63
- * If hostname undefined or cannot find (key, value) pair in {@link FaucetNetworkPaths}, defaults to '/accounts'
60
+ * If hostname undefined or cannot find (key, value) pair in {@link faucetNetworkPaths}, defaults to '/accounts'
64
61
  */
65
- export function getDefaultFaucetPath(hostname: string | undefined): string {
62
+ export function getFaucetPath(hostname: string | undefined): string {
66
63
  if (hostname === undefined) {
67
64
  return '/accounts'
68
65
  }
69
- return FaucetNetworkPaths[hostname] || '/accounts'
66
+ return faucetNetworkPaths[hostname] || '/accounts'
70
67
  }
@@ -3,11 +3,7 @@ import { isValidClassicAddress } from 'ripple-address-codec'
3
3
  import type { Client } from '../client'
4
4
  import { XRPLFaucetError } from '../errors'
5
5
 
6
- import {
7
- FaucetWallet,
8
- getFaucetHost,
9
- getDefaultFaucetPath,
10
- } from './defaultFaucets'
6
+ import { FaucetWallet, getFaucetHost, getFaucetPath } from './defaultFaucets'
11
7
 
12
8
  import { Wallet } from '.'
13
9
 
@@ -148,7 +144,7 @@ export async function requestFunding(
148
144
  if (!hostname) {
149
145
  throw new XRPLFaucetError('No faucet hostname could be derived')
150
146
  }
151
- const pathname = options.faucetPath ?? getDefaultFaucetPath(hostname)
147
+ const pathname = options.faucetPath ?? getFaucetPath(hostname)
152
148
  const response = await fetch(`https://${hostname}${pathname}`, {
153
149
  method: 'POST',
154
150
  headers: {
@@ -190,31 +186,24 @@ async function processSuccessfulResponse(
190
186
  new XRPLFaucetError(`The faucet account is undefined`),
191
187
  )
192
188
  }
193
- try {
194
- // Check at regular interval if the address is enabled on the XRPL and funded
195
- const updatedBalance = await getUpdatedBalance(
196
- client,
197
- classicAddress,
198
- startingBalance,
199
- )
189
+ // Check at regular interval if the address is enabled on the XRPL and funded
190
+ const updatedBalance = await getUpdatedBalance(
191
+ client,
192
+ classicAddress,
193
+ startingBalance,
194
+ )
200
195
 
201
- if (updatedBalance > startingBalance) {
202
- return {
203
- wallet: walletToFund,
204
- balance: updatedBalance,
205
- }
196
+ if (updatedBalance > startingBalance) {
197
+ return {
198
+ wallet: walletToFund,
199
+ balance: updatedBalance,
206
200
  }
207
- throw new XRPLFaucetError(
208
- `Unable to fund address with faucet after waiting ${
209
- INTERVAL_SECONDS * MAX_ATTEMPTS
210
- } seconds`,
211
- )
212
- } catch (err) {
213
- if (err instanceof Error) {
214
- throw new XRPLFaucetError(err.message)
215
- }
216
- throw err
217
201
  }
202
+ throw new XRPLFaucetError(
203
+ `Unable to fund address with faucet after waiting ${
204
+ INTERVAL_SECONDS * MAX_ATTEMPTS
205
+ } seconds`,
206
+ )
218
207
  }
219
208
 
220
209
  async function processError(response: Response, body): Promise<never> {
@@ -24,6 +24,8 @@ import {
24
24
  import ECDSA from '../ECDSA'
25
25
  import { ValidationError } from '../errors'
26
26
  import { Transaction, validate } from '../models/transactions'
27
+ import { GlobalFlags } from '../models/transactions/common'
28
+ import { hasFlag } from '../models/utils'
27
29
  import { ensureClassicAddress } from '../sugar/utils'
28
30
  import { omitBy } from '../utils/collections'
29
31
  import { hashSignedTx } from '../utils/hashes/hashLedger'
@@ -367,6 +369,7 @@ export class Wallet {
367
369
  * @param this - Wallet instance.
368
370
  * @param transaction - A transaction to be signed offline.
369
371
  * @param multisign - Specify true/false to use multisign or actual address (classic/x-address) to make multisign tx request.
372
+ * The actual address is only needed in the case of regular key usage.
370
373
  * @returns A signed transaction.
371
374
  * @throws ValidationError if the transaction is already signed or does not encode/decode to same result.
372
375
  * @throws XrplError if the issued currency being signed is XRP ignoring case.
@@ -381,7 +384,7 @@ export class Wallet {
381
384
  hash: string
382
385
  } {
383
386
  let multisignAddress: boolean | string = false
384
- if (typeof multisign === 'string' && multisign.startsWith('X')) {
387
+ if (typeof multisign === 'string') {
385
388
  multisignAddress = multisign
386
389
  } else if (multisign) {
387
390
  multisignAddress = this.classicAddress
@@ -407,12 +410,14 @@ export class Wallet {
407
410
  */
408
411
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- validate does not accept Transaction type
409
412
  validate(tx as unknown as Record<string, unknown>)
413
+ if (hasFlag(tx, GlobalFlags.tfInnerBatchTxn, 'tfInnerBatchTxn')) {
414
+ throw new ValidationError('Cannot sign a Batch inner transaction.')
415
+ }
410
416
 
411
417
  const txToSignAndEncode = { ...tx }
412
418
 
413
- txToSignAndEncode.SigningPubKey = multisignAddress ? '' : this.publicKey
414
-
415
419
  if (multisignAddress) {
420
+ txToSignAndEncode.SigningPubKey = ''
416
421
  const signer = {
417
422
  Account: multisignAddress,
418
423
  SigningPubKey: this.publicKey,
@@ -424,6 +429,7 @@ export class Wallet {
424
429
  }
425
430
  txToSignAndEncode.Signers = [{ Signer: signer }]
426
431
  } else {
432
+ txToSignAndEncode.SigningPubKey = this.publicKey
427
433
  txToSignAndEncode.TxnSignature = computeSignature(
428
434
  txToSignAndEncode,
429
435
  this.privateKey,
@@ -1,13 +1,12 @@
1
- import { bytesToHex } from '@xrplf/isomorphic/utils'
2
- import { BigNumber } from 'bignumber.js'
3
- import { decodeAccountID } from 'ripple-address-codec'
4
- import { decode, encode, encodeForSigning } from 'ripple-binary-codec'
1
+ import { encode, encodeForSigning } from 'ripple-binary-codec'
5
2
  import { verify } from 'ripple-keypairs'
6
3
 
7
4
  import { ValidationError } from '../errors'
8
5
  import { Signer } from '../models/common'
9
6
  import { Transaction, validate } from '../models/transactions'
10
7
 
8
+ import { compareSigners, getDecodedTransaction } from './utils'
9
+
11
10
  /**
12
11
  * Takes several transactions with Signer fields (in object or blob form) and creates a
13
12
  * single transaction with all Signers that then gets signed and returned.
@@ -121,43 +120,9 @@ function getTransactionWithAllSigners(
121
120
  // Signers must be sorted in the combined transaction - See compareSigners' documentation for more details
122
121
  const sortedSigners: Signer[] = transactions
123
122
  .flatMap((tx) => tx.Signers ?? [])
124
- .sort(compareSigners)
123
+ .sort((signer1, signer2) => compareSigners(signer1.Signer, signer2.Signer))
125
124
 
126
125
  return { ...transactions[0], Signers: sortedSigners }
127
126
  }
128
127
 
129
- /**
130
- * If presented in binary form, the Signers array must be sorted based on
131
- * the numeric value of the signer addresses, with the lowest value first.
132
- * (If submitted as JSON, the submit_multisigned method handles this automatically.)
133
- * https://xrpl.org/multi-signing.html.
134
- *
135
- * @param left - A Signer to compare with.
136
- * @param right - A second Signer to compare with.
137
- * @returns 1 if left \> right, 0 if left = right, -1 if left \< right, and null if left or right are NaN.
138
- */
139
- function compareSigners(left: Signer, right: Signer): number {
140
- return addressToBigNumber(left.Signer.Account).comparedTo(
141
- addressToBigNumber(right.Signer.Account),
142
- )
143
- }
144
-
145
- const NUM_BITS_IN_HEX = 16
146
-
147
- function addressToBigNumber(address: string): BigNumber {
148
- const hex = bytesToHex(decodeAccountID(address))
149
- return new BigNumber(hex, NUM_BITS_IN_HEX)
150
- }
151
-
152
- function getDecodedTransaction(txOrBlob: Transaction | string): Transaction {
153
- if (typeof txOrBlob === 'object') {
154
- // We need this to handle X-addresses in multisigning
155
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- We are casting here to get strong typing
156
- return decode(encode(txOrBlob)) as unknown as Transaction
157
- }
158
-
159
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- We are casting here to get strong typing
160
- return decode(txOrBlob) as unknown as Transaction
161
- }
162
-
163
128
  export { verifySignature, multisign }
@@ -0,0 +1,58 @@
1
+ import { bytesToHex } from '@xrplf/isomorphic/utils'
2
+ import BigNumber from 'bignumber.js'
3
+ import { decodeAccountID } from 'ripple-address-codec'
4
+ import { decode, encode } from 'ripple-binary-codec'
5
+
6
+ import { Transaction } from '../models'
7
+
8
+ /**
9
+ * If presented in binary form, the Signers array must be sorted based on
10
+ * the numeric value of the signer addresses, with the lowest value first.
11
+ * (If submitted as JSON, the submit_multisigned method handles this automatically.)
12
+ * https://xrpl.org/multi-signing.html.
13
+ *
14
+ * @param left - A Signer to compare with.
15
+ * @param right - A second Signer to compare with.
16
+ * @returns 1 if left \> right, 0 if left = right, -1 if left \< right, and null if left or right are NaN.
17
+ */
18
+ export function compareSigners<T extends { Account: string }>(
19
+ left: T,
20
+ right: T,
21
+ ): number {
22
+ return addressToBigNumber(left.Account).comparedTo(
23
+ addressToBigNumber(right.Account),
24
+ )
25
+ }
26
+
27
+ export const NUM_BITS_IN_HEX = 16
28
+
29
+ /**
30
+ * Converts an address to a BigNumber.
31
+ *
32
+ * @param address - The address to convert.
33
+ * @returns A BigNumber representing the address.
34
+ */
35
+ export function addressToBigNumber(address: string): BigNumber {
36
+ const hex = bytesToHex(decodeAccountID(address))
37
+ return new BigNumber(hex, NUM_BITS_IN_HEX)
38
+ }
39
+
40
+ /**
41
+ * Decodes a transaction or transaction blob into a Transaction object.
42
+ *
43
+ * @param txOrBlob - A Transaction object or a hex string representing a transaction blob.
44
+ * @returns A Transaction object.
45
+ * @throws If the input is not a valid Transaction or transaction blob.
46
+ */
47
+ export function getDecodedTransaction(
48
+ txOrBlob: Transaction | string,
49
+ ): Transaction {
50
+ if (typeof txOrBlob === 'object') {
51
+ // We need this to handle X-addresses in multisigning
52
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- We are casting here to get strong typing
53
+ return decode(encode(txOrBlob)) as unknown as Transaction
54
+ }
55
+
56
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- We are casting here to get strong typing
57
+ return decode(txOrBlob) as unknown as Transaction
58
+ }
@@ -175,6 +175,7 @@ export default class RequestManager {
175
175
  * @param response - The response to handle.
176
176
  * @throws ResponseFormatError if the response format is invalid, RippledError if rippled returns an error.
177
177
  */
178
+ // eslint-disable-next-line complexity -- handling a response is complex
178
179
  public handleResponse(
179
180
  response: Partial<Response<APIVersion> | ErrorResponse>,
180
181
  ): void {
@@ -195,7 +196,9 @@ export default class RequestManager {
195
196
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- We know this must be true
196
197
  const errorResponse = response as Partial<ErrorResponse>
197
198
  const error = new RippledError(
198
- errorResponse.error_message ?? errorResponse.error,
199
+ errorResponse.error_message ??
200
+ errorResponse.error_exception ??
201
+ errorResponse.error,
199
202
  errorResponse,
200
203
  )
201
204
  this.reject(response.id, error)
@@ -349,7 +349,6 @@ export class Connection extends EventEmitter {
349
349
  try {
350
350
  this.requestManager.handleResponse(data)
351
351
  } catch (error) {
352
- // eslint-disable-next-line max-depth -- okay here
353
352
  if (error instanceof Error) {
354
353
  this.emit('error', 'badMessage', error.message, message)
355
354
  } else {
@@ -63,10 +63,12 @@ import {
63
63
  import {
64
64
  setValidAddresses,
65
65
  setNextValidSequenceNumber,
66
- calculateFeePerTransactionType,
67
66
  setLatestValidatedLedgerSequence,
68
67
  checkAccountDeleteBlockers,
69
68
  txNeedsNetworkID,
69
+ autofillBatchTxn,
70
+ handleDeliverMax,
71
+ getTransactionFee,
70
72
  } from '../sugar/autofill'
71
73
  import { formatBalances } from '../sugar/balances'
72
74
  import {
@@ -662,7 +664,6 @@ class Client extends EventEmitter<EventTypes> {
662
664
  * @throws ValidationError If Amount and DeliverMax fields are not identical in a Payment Transaction
663
665
  */
664
666
 
665
- // eslint-disable-next-line complexity -- handling Payment transaction API v2 requires more logic
666
667
  public async autofill<T extends SubmittableTransaction>(
667
668
  transaction: T,
668
669
  signersCount?: number,
@@ -680,7 +681,7 @@ class Client extends EventEmitter<EventTypes> {
680
681
  promises.push(setNextValidSequenceNumber(this, tx))
681
682
  }
682
683
  if (tx.Fee == null) {
683
- promises.push(calculateFeePerTransactionType(this, tx, signersCount))
684
+ promises.push(getTransactionFee(this, tx, signersCount))
684
685
  }
685
686
  if (tx.LastLedgerSequence == null) {
686
687
  promises.push(setLatestValidatedLedgerSequence(this, tx))
@@ -688,33 +689,11 @@ class Client extends EventEmitter<EventTypes> {
688
689
  if (tx.TransactionType === 'AccountDelete') {
689
690
  promises.push(checkAccountDeleteBlockers(this, tx))
690
691
  }
691
-
692
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- ignore type-assertions on the DeliverMax property
693
- // @ts-expect-error -- DeliverMax property exists only at the RPC level, not at the protocol level
694
- if (tx.TransactionType === 'Payment' && tx.DeliverMax != null) {
695
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- This is a valid null check for Amount
696
- if (tx.Amount == null) {
697
- // If only DeliverMax is provided, use it to populate the Amount field
698
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- ignore type-assertions on the DeliverMax property
699
- // @ts-expect-error -- DeliverMax property exists only at the RPC level, not at the protocol level
700
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- DeliverMax is a known RPC-level property
701
- tx.Amount = tx.DeliverMax
702
- }
703
-
704
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- ignore type-assertions on the DeliverMax property
705
- // @ts-expect-error -- DeliverMax property exists only at the RPC level, not at the protocol level
706
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- This is a valid null check for Amount
707
- if (tx.Amount != null && tx.Amount !== tx.DeliverMax) {
708
- return Promise.reject(
709
- new ValidationError(
710
- 'PaymentTransaction: Amount and DeliverMax fields must be identical when both are provided',
711
- ),
712
- )
713
- }
714
-
715
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- ignore type-assertions on the DeliverMax property
716
- // @ts-expect-error -- DeliverMax property exists only at the RPC level, not at the protocol level
717
- delete tx.DeliverMax
692
+ if (tx.TransactionType === 'Batch') {
693
+ promises.push(autofillBatchTxn(this, tx))
694
+ }
695
+ if (tx.TransactionType === 'Payment') {
696
+ handleDeliverMax(tx)
718
697
  }
719
698
 
720
699
  return Promise.all(promises).then(() => tx)
@@ -96,10 +96,9 @@ function isPartialPayment(
96
96
  }
97
97
 
98
98
  const delivered = meta.delivered_amount
99
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- DeliverMax is a valid field on Payment response
100
- // @ts-expect-error -- DeliverMax is a valid field on Payment response
101
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- DeliverMax is a valid field on Payment response
102
- const amount = tx.DeliverMax
99
+
100
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- needed here
101
+ const amount = tx.DeliverMax as Amount | MPTAmount
103
102
 
104
103
  if (delivered === undefined) {
105
104
  return false
@@ -1,8 +1,8 @@
1
- import { GlobalFlags } from '../transactions/common'
1
+ import { GlobalFlagsInterface } from '../transactions/common'
2
2
 
3
3
  import { BaseLedgerEntry, HasPreviousTxnID } from './BaseLedgerEntry'
4
4
 
5
- export interface CredentialFlags extends GlobalFlags {
5
+ export interface CredentialFlags extends GlobalFlagsInterface {
6
6
  lsfAccepted?: boolean
7
7
  }
8
8
 
@@ -61,8 +61,4 @@ export default interface Escrow extends BaseLedgerEntry, HasPreviousTxnID {
61
61
  * this object, in case the directory consists of multiple pages.
62
62
  */
63
63
  DestinationNode?: string
64
-
65
- FinishFunction?: string
66
-
67
- Data?: string
68
64
  }
@@ -24,10 +24,6 @@ export interface FeeSettingsPostAmendmentFields {
24
24
  ReserveBaseDrops: string
25
25
  /** The incremental owner reserve for owning objects, as drops of XRP. */
26
26
  ReserveIncrementDrops: string
27
-
28
- ExtensionComputeLimit: number
29
-
30
- ExtensionSizeLimit: number
31
27
  }
32
28
 
33
29
  export interface FeeSettingsBase
@@ -1,6 +1,4 @@
1
- import { Amount } from 'ripple-binary-codec/dist/types'
2
-
3
- import { XChainBridge } from '../common'
1
+ import { Amount, XChainBridge } from '../common'
4
2
 
5
3
  import { BaseLedgerEntry, HasPreviousTxnID } from './BaseLedgerEntry'
6
4
 
@@ -53,6 +53,7 @@ export interface ErrorResponse {
53
53
  error: string
54
54
  error_code?: string
55
55
  error_message?: string
56
+ error_exception?: string
56
57
  request: Request
57
58
  api_version?: number
58
59
  }