Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE] Merge release/2.6.1 to main #1300

Merged
merged 7 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.stellar.anchor.api.sep.sep38.RateFee;
import org.stellar.anchor.api.shared.FeeDetails;
import reactor.util.annotation.Nullable;

/**
Expand Down Expand Up @@ -37,7 +37,7 @@ public GetRateResponse(Rate rate) {
* @return a GET /rate response with price, total_price, sell_amount, buy_amount and fee.
*/
public static GetRateResponse indicativePrice(
String price, String sellAmount, String buyAmount, RateFee fee) {
String price, String sellAmount, String buyAmount, FeeDetails fee) {
Rate rate =
Rate.builder().price(price).sellAmount(sellAmount).buyAmount(buyAmount).fee(fee).build();
return new GetRateResponse(rate);
Expand All @@ -60,6 +60,6 @@ public static class Rate {
@Nullable
Instant expiresAt;

@Nullable RateFee fee;
@Nullable FeeDetails fee;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.sep.sep38.RateFee;
import org.stellar.anchor.api.shared.FeeDetails;
import org.stellar.anchor.api.shared.StellarId;

@Data
Expand Down Expand Up @@ -51,5 +51,5 @@ public class GetQuoteResponse {
@SerializedName("created_at")
Instant createdAt;

RateFee fee;
FeeDetails fee;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ public class PlatformTransactionData {
Amount amountOut;

@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
Amount amountFee;

@SerializedName("fee_details")
FeeDetails feeDetails;

@SerializedName("quote_id")
String quoteId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.shared.FeeDetails;

@Data
@SuperBuilder
Expand All @@ -18,6 +19,9 @@ public class NotifyAmountsUpdatedRequest extends RpcMethodParamsRequest {
private AmountRequest amountOut;

@SerializedName("amount_fee")
@NotNull
@Deprecated // ANCHOR-636
private AmountRequest amountFee;

@SerializedName("fee_details")
private FeeDetails feeDetails;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.shared.FeeDetails;

@Data
@SuperBuilder
Expand All @@ -21,10 +22,13 @@ public class NotifyInteractiveFlowCompletedRequest extends RpcMethodParamsReques
@SerializedName("amount_out")
private AmountAssetRequest amountOut;

@NotNull
@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
private AmountAssetRequest amountFee;

@SerializedName("fee_details")
private FeeDetails feeDetails;

@SerializedName("amount_expected")
private AmountRequest amountExpected;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.shared.FeeDetails;

@Data
@SuperBuilder
Expand All @@ -26,5 +27,9 @@ public class NotifyOffchainFundsReceivedRequest extends RpcMethodParamsRequest {
private AmountRequest amountOut;

@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
private AmountRequest amountFee;

@SerializedName("fee_details")
private FeeDetails feeDetails;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.shared.FeeDetails;

@Data
@SuperBuilder
Expand All @@ -24,5 +25,9 @@ public class NotifyOnchainFundsReceivedRequest extends RpcMethodParamsRequest {
private AmountRequest amountOut;

@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
private AmountRequest amountFee;

@SerializedName("fee_details")
private FeeDetails feeDetails;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.shared.FeeDetails;
import org.stellar.anchor.api.shared.InstructionField;

@Data
Expand All @@ -21,8 +22,12 @@ public class RequestOffchainFundsRequest extends RpcMethodParamsRequest {
private AmountAssetRequest amountOut;

@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
private AmountAssetRequest amountFee;

@SerializedName("fee_details")
private FeeDetails feeDetails;

@SerializedName("amount_expected")
private AmountRequest amountExpected;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.shared.FeeDetails;

@Data
@SuperBuilder
Expand All @@ -19,8 +20,12 @@ public class RequestOnchainFundsRequest extends RpcMethodParamsRequest {
private AmountAssetRequest amountOut;

@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
private AmountAssetRequest amountFee;

@SerializedName("fee_details")
private FeeDetails feeDetails;

@SerializedName("amount_expected")
private AmountRequest amountExpected;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.gson.annotations.SerializedName;
import java.time.Instant;
import lombok.Data;
import org.stellar.anchor.api.shared.FeeDetails;

/** Base class of transaction responses for withdraw and deposit. */
@Data
Expand Down Expand Up @@ -32,11 +33,16 @@ public class TransactionResponse {
String amountOutAsset;

@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
String amountFee;

@SerializedName("amount_fee_asset")
@Deprecated // ANCHOR-636
String amountFeeAsset;

@SerializedName("fee_details")
FeeDetails feeDetails;

@SerializedName("started_at")
Instant startedAt;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.Data;
import org.stellar.anchor.api.shared.FeeDetails;

/**
* The response body of the GET /price endpoint of SEP-38.
Expand All @@ -25,5 +26,5 @@ public class GetPriceResponse {
@SerializedName("buy_amount")
String buyAmount;

RateFee fee;
FeeDetails fee;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.time.Instant;
import lombok.Builder;
import lombok.Data;
import org.stellar.anchor.api.shared.FeeDetails;

/**
* The response body of the POST /quote endpoint of SEP-38.
Expand Down Expand Up @@ -37,5 +38,5 @@ public class Sep38QuoteResponse {
@SerializedName("buy_amount")
String buyAmount;

RateFee fee;
FeeDetails fee;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Map;
import lombok.Builder;
import lombok.Data;
import org.stellar.anchor.api.shared.FeeDetails;
import org.stellar.anchor.api.shared.InstructionField;
import org.stellar.anchor.api.shared.Refunds;

Expand Down Expand Up @@ -36,11 +37,16 @@ public class Sep6TransactionResponse {
String amountOutAsset;

@SerializedName("amount_fee")
@Deprecated // ANCHOR-636
String amountFee;

@SerializedName("amount_fee_asset")
@Deprecated // ANCHOR-636
String amountFeeAsset;

@SerializedName("fee_details")
FeeDetails feeDetails;

@SerializedName("quote_id")
String quoteId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.stellar.anchor.api.sep.sep38;
package org.stellar.anchor.api.shared;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand All @@ -7,12 +7,12 @@
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RateFeeDetail {
public class FeeDescription {
String name;
String description;
String amount;

public RateFeeDetail(String name, String amount) {
public FeeDescription(String name, String amount) {
this.name = name;
this.amount = amount;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.stellar.anchor.api.sep.sep38;
package org.stellar.anchor.api.shared;

import java.math.BigDecimal;
import java.math.RoundingMode;
Expand All @@ -12,17 +12,17 @@
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RateFee {
public class FeeDetails {
String total;
String asset;
List<RateFeeDetail> details;
List<FeeDescription> details;

public RateFee(String total, String asset) {
public FeeDetails(String total, String asset) {
this.total = total;
this.asset = asset;
}

public void addFeeDetail(RateFeeDetail feeDetail) {
public void addFeeDetail(FeeDescription feeDetail) {
if (feeDetail == null || feeDetail.amount == null) {
return;
}
Expand Down
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,14 @@ subprojects {
exclude(group = "ch.qos.logback", module = "logback-classic")
exclude(group = "org.apache.logging.log4j", module = "log4j-to-slf4j")
exclude(group = "org.slf4j", module = "slf4j-log4j12")
}
exclude(group = "org.slf4j", module ="slf4j-simple")
}
}
}

allprojects {
group = "org.stellar.anchor-sdk"
version = "2.6.0"
version = "2.6.1"

tasks.jar {
manifest {
Expand Down
Loading
Loading