Skip to content

Inconsistent API #245

@satsen

Description

@satsen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions