soroban-cli
soroban-cli copied to clipboard
feat: add `tx::builder` module and initial classic commands
What
Add a transaction builder and operation builder trait. Also adds the first two stellar classic commands under the subcommand tx new:
- [x] Create account
- [x] Payment
- [x] Set options
- [x] Bump sequence
- [x] Account Merge
- [x] Manage data
- [x] InvokeFunction
- [x] Extend footprint ttl
- [x] Restore footprint
- [x] Allow trust
- [x] Change trust
- [x] Set trustline flags
- [x] Doc review
Todo:
- [x] Tests
Why
Currently all transactions are built by hand and require a lot of knowledge around the internal types. Furthermore, there is a lot of redundant code around creating, submitting transaction.
These examples should make it easy to have a quick design discussion before adding the rest of the operations.
Known limitations
[TODO or N/A]
@leighmcculloch Updated to reflect feedback. Still need to update tests.
@leighmcculloch, I've removed all of the builder types that I could. One that still needs to be added to the xdr crate is the FromStr for Asset, which I will open another PR for soon. Also I removed the unneeded Operation trait and just use From for Operation Body, all of which simplified the code a good deal.
@janewang @stellar/devx There's a large amount of functionality being introduced with this PR. We should plan to do some dog fooding of it for ergonomics in the next couple weeks, maybe get some others to dog food it too.