xrpl.js
xrpl.js copied to clipboard
Refactor `Transaction` type to better reflect its true usage
Before #2515 pseudo transactions were not typed to be returned by tx or ledger commands. The type used by those was Transaction. In order to not be a breaking change a new type of PseudoTransaction was added and Transaction | PseudoTransaction was used everywhere Transaction was used but a PseudoTransaction always could have come back.
A cleaner implementation would be to create a new type of SubmittableTransaction which equals the current value of Transaction. Transaction would then be updated to equal SubmittableTransaction | PseudoTransaction. The SubmittableTransaction can be used with client.submit.
Related to https://github.com/XRPLF/xrpl.js/pull/2515#discussion_r1358796765 and https://github.com/XRPLF/xrpl.js/pull/2515#pullrequestreview-1677340320