Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
philipliu committed Oct 21, 2023
1 parent f29e9c9 commit 001eb85
Show file tree
Hide file tree
Showing 57 changed files with 1,068 additions and 559 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.stellar.anchor.api.rpc.method;

import com.google.gson.annotations.SerializedName;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -9,4 +11,11 @@
@SuperBuilder
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class RequestCustomerInfoUpdateRequest extends RpcMethodParamsRequest {}
public class RequestCustomerInfoUpdateRequest extends RpcMethodParamsRequest {

@SerializedName("required_customer_info_message")
private String requiredCustomerInfoMessage;

@SerializedName("required_customer_info_updates")
private List<String> requiredCustomerInfoUpdates;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.stellar.anchor.api.rpc.method;

import com.google.gson.annotations.SerializedName;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.stellar.anchor.api.shared.InstructionField;

@Data
@SuperBuilder
Expand All @@ -23,4 +25,7 @@ public class RequestOffchainFundsRequest extends RpcMethodParamsRequest {

@SerializedName("amount_expected")
private AmountRequest amountExpected;

@SerializedName("instructions")
Map<String, InstructionField> instructions;
}
18 changes: 18 additions & 0 deletions core/src/main/java/org/stellar/anchor/sep6/Sep6Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ public StartDepositResponse deposit(Sep10Jwt token, StartDepositRequest request)
.type(request.getType())
.assetCode(request.getAssetCode())
.assetIssuer(asset.getIssuer())
// NB: these are purposely set to incorrect values.
// amount_out and amount_fee assets cannot be determined when the
// platform creates the transaction, but the RPC API requires
// these to be set during a notify_amounts_updated call.
.amountOut(request.getAmount())
.amountOutAsset(asset.getSep38AssetName())
.amountFee("0")
.amountFeeAsset(asset.getSep38AssetName())
.amountExpected(request.getAmount())
.startedAt(Instant.now())
.sep10Account(token.getAccount())
Expand Down Expand Up @@ -244,6 +252,16 @@ public StartWithdrawResponse withdraw(Sep10Jwt token, StartWithdrawRequest reque
.type(request.getType())
.assetCode(request.getAssetCode())
.assetIssuer(asset.getIssuer())
.amountIn(request.getAmount())
.amountInAsset(asset.getSep38AssetName())
// NB: these are purposely set to incorrect values.
// amount_out and amount_fee assets cannot be determined when the
// platform creates the transaction, but the RPC API requires
// these to be set during a notify_amounts_updated call.
.amountOut(request.getAmount())
.amountOutAsset(asset.getSep38AssetName())
.amountFee("0")
.amountFeeAsset(asset.getSep38AssetName())
.amountExpected(request.getAmount())
.startedAt(Instant.now())
.sep10Account(token.getAccount())
Expand Down
Loading

0 comments on commit 001eb85

Please sign in to comment.