Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify TxBuilder and TxBuilderRunner interfaces? #1

Open
michele-nuzzi opened this issue Feb 3, 2025 · 0 comments
Open

unify TxBuilder and TxBuilderRunner interfaces? #1

michele-nuzzi opened this issue Feb 3, 2025 · 0 comments

Comments

@michele-nuzzi
Copy link
Member

to improve UX, we could unify the two classes.

The constructor would take either protocol params or IProvider

if IProvider is passed the getProtocolParameters method can be used

if protocol params are passed, all the async methods of TxBuilderRunner will throw an error.

Additonally the TxBuilder would benefit of the incremental methods exposed in the runner.

One approach for implementation would be to add a _buildArgs private property, that is updated with every TxBuilderRunner method

when calling buildSync if other arguments are passed, the private property _buildArgs and the argument to the method should be merged

buildSync should still be the only "final" way to build a tx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant