Crypto-APIs / Java-Library

Java library/SDK for Crypto APIs
MIT License
29 stars 19 forks source link

Using int/long and satoshi instead of double #1

Closed Gameghostify closed 5 years ago

Gameghostify commented 5 years ago

Using java.lang.Double potentially is subject to rounding errors, which is why the use of it is risky and unusual for monetary calculations.

As the rest api on cryptoapis.io accepts satoshi/wei by default, I'd suggest using satoshi/wei as the default unit for this sdk as well (e.g. changing com.cryptoapis.blockchains.bitcoin_based.models.Transaction.CreateTransaction.Inputs#setValue to accept a long value in satoshi instead of a double value)

What do you think?