ergoplatform / ergoplatform/ergo-appkit

Inconsistent API

Open
#245 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
44
Forks
34
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the transaction-related builders, BoxOperations, Address, and the outboxbuilder tokens method named in the issue. Compare their existing method names and collection types, then map the proposed standardization across these APIs. Done means consistent naming and list-based inputs, with empty token collections accepted without a size check.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, developer-experience
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.