Skip to content

Commit

Permalink
add coin&add sign message field
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangcongcobo committed Sep 9, 2024
1 parent f039f2e commit 76fa4d9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,6 @@ ApiResponse<TradingTransfer> tradingTransfer(String fromExchangeAccountToken,
* @return balance of gas station
*/
ApiResponse<GasStationBalance> getGasStationBalance();

ApiResponse<Void> addCoin(String coin);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.cobo.custody.api.client.domain.transaction;

import com.cobo.custody.api.client.domain.account.MPCCoin;
import com.fasterxml.jackson.annotation.JsonProperty;

public class SignMessage {
Expand All @@ -17,6 +18,12 @@ public class SignMessage {
@JsonProperty(value = "extra_parameters")
private String extraParameters;

@JsonProperty(value = "coin_detail")
private MPCCoin coinDetail;

@JsonProperty(value = "created_time")
private Long createdTime;

public String getRequestId() {
return requestId;
}
Expand Down Expand Up @@ -73,16 +80,34 @@ public void setExtraParameters(String extraParameters) {
this.extraParameters = extraParameters;
}

public MPCCoin getCoinDetail() {
return coinDetail;
}

public void setCoinDetail(MPCCoin coinDetail) {
this.coinDetail = coinDetail;
}

public Long getCreatedTime() {
return createdTime;
}

public void setCreatedTime(Long createdTime) {
this.createdTime = createdTime;
}

@Override
public String toString() {
return "SignMessage{" +
"coboId='" + coboId + '\'' +
", requestId='" + requestId + '\'' +
", signature=" + signature +
", chainCode=" + chainCode +
"requestId='" + requestId + '\'' +
", coboId='" + coboId + '\'' +
", signature='" + signature + '\'' +
", chainCode='" + chainCode + '\'' +
", fromAddress='" + fromAddress + '\'' +
", signVersion='" + signVersion + '\'' +
", signVersion=" + signVersion +
", extraParameters='" + extraParameters + '\'' +
", coinDetail=" + coinDetail +
", createdTime=" + createdTime +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ public ApiResponse<GasStationBalance> getGasStationBalance() {
return executeSync(coboApiService.getGasStationBalance());
}

@Override
public ApiResponse<Void> addCoin(String coin) {
return executeSync(coboApiService.addCoin(coin));
}

private String intToString(int num) {
if (num == 0) return null;
return String.valueOf(num);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,8 @@ Call<ApiResponse<TradingTransfer>> tradingTransfer(@Field("from_exchange_account

@GET("/v1/custody/get_gas_station_balance/")
Call<ApiResponse<GasStationBalance>> getGasStationBalance();

@FormUrlEncoded
@POST("/v1/custody/add_coin/")
Call<ApiResponse<Void>> addCoin(@Field("coin") String coin);
}

0 comments on commit 76fa4d9

Please sign in to comment.