diff --git a/xchange-core/src/main/java/org/knowm/xchange/dto/account/FundingRecord.java b/xchange-core/src/main/java/org/knowm/xchange/dto/account/FundingRecord.java index 991999b86c7..0cc502fdc14 100644 --- a/xchange-core/src/main/java/org/knowm/xchange/dto/account/FundingRecord.java +++ b/xchange-core/src/main/java/org/knowm/xchange/dto/account/FundingRecord.java @@ -68,6 +68,19 @@ public class FundingRecord implements Serializable { private final String toSubAccount; + /** + * Customizing amount method to always be positive. Rest of the builder code will be auto generated by Lombok. + * + */ + public abstract static class FundingRecordBuilder< + C extends FundingRecord, B extends FundingRecordBuilder> { + + public B amount(BigDecimal amount) { + this.amount = amount == null ? null : amount.abs(); + return self(); + } + } + @Deprecated // for backward compatibility. Will be removed public String getExternalId() { return blockchainTransactionHash;