Skip to content

Commit

Permalink
[CoinbasePro] Fix FundingRecord amount value to never be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
makarid committed Oct 19, 2023
1 parent 8f218eb commit dee239c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<C, B>> {

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;
Expand Down

0 comments on commit dee239c

Please sign in to comment.