Add getOptionalTakerFee and getOptionalMakerFee to Tradeable

This commit is contained in:
chimp1984 2021-11-03 17:06:11 +01:00
parent 080255ce11
commit a5eec8c998
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -64,4 +64,12 @@ public interface Tradable extends PersistablePayload {
default Optional<Coin> getOptionalTxFee() {
return asTradeModel().map(TradeModel::getTxFee);
}
default Optional<Coin> getOptionalTakerFee() {
return asTradeModel().map(TradeModel::getTakerFee);
}
default Optional<Coin> getOptionalMakerFee() {
return asTradeModel().map(TradeModel::getMakerFee).or(() -> Optional.ofNullable(getOffer().getMakerFee()));
}
}