ergoplatform / ergo-appkit

Appkit: A Library for Java/Scala/Kotlin Development of Ergo Applications
MIT License
38 stars 27 forks source link

BoxOperations: provide method preparing TransactionBuilder with fee, inputs and change address #142

Closed MrStahlfelge closed 2 years ago

MrStahlfelge commented 2 years ago

When I prepared the examples for Ergo Pay, I found myself writing repeating code preparing a transaction with inputs, fee, change box, only differing in the way how outputs are built.

I switched to use a helper method for Ergo Pay example to get rid of the repeating code, and I think it is useful to have it on Appkit for others to use. When found useful and merged, we can use it for adding more logic depending on it like minting a new token.

MrStahlfelge commented 2 years ago

Addressed your feedback, however, I did not move getCoveringBoxes. I agree it is more of a helper method that could be moved, but I found no better place and BoxOperations is the class making use of it at the moment.