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

Inconsistent API #245

Open
satsen opened this issue Oct 15, 2024 · 0 comments
Open

Inconsistent API #245

satsen opened this issue Oct 15, 2024 · 0 comments

Comments

@satsen
Copy link
Contributor

satsen commented Oct 15, 2024

The appkit API is inconsistent. Transaction-related builder methods are named like "addOutputs", "addInputs", "value", "fee" etc. and take arrays while BoxOperations methods are named like "withAmountToSend", "withFeeAmount", etc. and returns a List. This results in inconsistent code and makes it necessary to convert collections.

To make it consistent I propose that we rename the BoxOperations methods to match the TX-related builder methods, and make the TX-related builder methods take lists instead of arrays.

The methods of the Address class also have a mix of "asABC" and "toABC" methods, this should be standardized as well. "toABC" is probably the best.

In addition, I suggest that we make so that the outboxbuilder tokens method allows empty collections, because having to check the size before calling it ruins the builder pattern and is very very easy to miss.

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