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

update mpc api #29

Closed
wants to merge 1 commit into from
Closed
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 @@ -2,8 +2,6 @@

import com.cobo.custody.api.client.domain.ApiResponse;
import com.cobo.custody.api.client.domain.account.*;
import com.cobo.custody.api.client.domain.asset.MPCUnspentInputs;
import com.cobo.custody.api.client.domain.asset.MPCWalletAsset;
import com.cobo.custody.api.client.domain.transaction.*;

import java.math.BigInteger;
Expand All @@ -25,8 +23,6 @@ public interface CoboMPCApiRestClient {

ApiResponse<MPCListSpendable> listSpendable(String coin, String address);

ApiResponse<MPCUnspentInputs> getWalletUnspentInputList(String address, String coin);

ApiResponse<MPCPostTransaction> createTransaction(String coin, String requestId, String fromAddr, String toAddr, BigInteger amount,
String toAddressDetails, BigInteger fee, BigInteger gasPrice, BigInteger gasLimit,
Integer operation, String extraParameters);
Expand All @@ -41,7 +37,7 @@ ApiResponse<MPCPostTransaction> createTransaction(String coin, String requestId,

ApiResponse<MPCTransactionInfos> getTransactionByTxHash(String txId, Integer transactionType);

ApiResponse<MPCTransactions> listWalletTransactions(Long startTime, Long endTime, Integer status, String order,
ApiResponse<MPCTransactions> listWalletTransactions(Long startTime, Long endTime, Integer status, String orderBy, String order,
Integer transactionType, String coins, String fromAddr, String toAddr,
Integer limit);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
package com.cobo.custody.api.client.domain.account;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;


public class MPCAddress {
private String id;
private String address;
private Integer type;
@JsonProperty(value = "hd_path")
private String hdPath;
private Integer encoding;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getAddress() {
return address;
Expand All @@ -14,19 +26,29 @@ public void setAddress(String address) {
this.address = address;
}

public Integer getType() {
return type;
public String getHdPath() {
return hdPath;
}

public void setHdPath(String hdPath) {
this.hdPath = hdPath;
}

public Integer getEncoding() {
return encoding;
}

public void setType(Integer type) {
this.type = type;
public void setEncoding(Integer encoding) {
this.encoding = encoding;
}

@Override
public String toString() {
return "{" +
"address='" + address + '\'' +
", type='" + type + '\'' +
"id='" + id + '\'' +
", address='" + address + '\'' +
", hdPath='" + hdPath + '\'' +
", encoding='" + encoding + '\'' +
'}';
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class EstimateFeeDetail {
private BigInteger feePerByte;
@JsonProperty(value = "gas_price")
private BigInteger gasPrice;
@JsonProperty(value = "gasLimit")
@JsonProperty(value = "gas_limit")
private BigInteger gasLimit;

public BigInteger getFeePerByte() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
public class MPCPostTransaction {
@JsonProperty(value = "cobo_id")
private String coboId;
private Integer status;

public String getCoboId() {
return coboId;
Expand All @@ -15,18 +14,9 @@ public void setCoboId(String coboId) {
this.coboId = coboId;
}

public Integer getStatus() {
return status;
}

public void setStatus(Integer status) {
this.status = status;
}

public String toString() {
return "{" +
"coboId='" + coboId + '\'' +
", status='" + status + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.cobo.custody.api.client.domain.account.*;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.math.BigInteger;
import java.util.List;

public class MPCTransaction {
Expand All @@ -23,8 +22,8 @@ public class MPCTransaction {
@JsonProperty(value = "fee_detail")
private MPCFee feeDetail;

@JsonProperty(value = "source_address")
private String sourceAddress;
@JsonProperty(value = "source_addresses")
private List<String> sourceAddresses;

@JsonProperty(value = "from_address")
private String fromAddress;
Expand All @@ -38,15 +37,19 @@ public class MPCTransaction {
@JsonProperty(value = "vout_n")
private Integer voutN;

private Integer nonce;

@JsonProperty(value = "confirmed_number")
private Integer confirmedNumber;

@JsonProperty(value = "rbf_detail")
private RBFDetail rbfDetail;
@JsonProperty(value = "replace_cobo_id")
private String replaceCoboId;

@JsonProperty(value = "transaction_type")
private Integer transactionType;

private Integer operation;

@JsonProperty(value = "block_detail")
private MPCBlock blockDetail;

Expand Down Expand Up @@ -112,12 +115,12 @@ public void setFeeDetail(MPCFee feeDetail) {
this.feeDetail = feeDetail;
}

public String getSourceAddress() {
return sourceAddress;
public List<String> getSourceAddresses() {
return sourceAddresses;
}

public void setSourceAddress(String sourceAddress) {
this.sourceAddress = sourceAddress;
public void setSourceAddresses(List<String> sourceAddresses) {
this.sourceAddresses = sourceAddresses;
}

public String getFromAddress() {
Expand Down Expand Up @@ -152,6 +155,14 @@ public void setVoutN(Integer voutN) {
this.voutN = voutN;
}

public Integer getNonce() {
return nonce;
}

public void setNonce(Integer nonce) {
this.nonce = nonce;
}

public Integer getConfirmedNumber() {
return confirmedNumber;
}
Expand All @@ -160,12 +171,12 @@ public void setConfirmedNumber(Integer confirmedNumber) {
this.confirmedNumber = confirmedNumber;
}

public RBFDetail getRbfDetail() {
return rbfDetail;
public String getReplaceCoboId() {
return replaceCoboId;
}

public void setRbfDetail(RBFDetail rbfDetail) {
this.rbfDetail = rbfDetail;
public void setReplaceCoboId(String replaceCoboId) {
this.replaceCoboId = replaceCoboId;
}

public Integer getTransactionType() {
Expand All @@ -176,6 +187,14 @@ public void setTransactionType(Integer transactionType) {
this.transactionType = transactionType;
}

public Integer getOperation() {
return operation;
}

public void setOperation(Integer operation) {
this.operation = operation;
}

public MPCBlock getBlockDetail() {
return blockDetail;
}
Expand Down Expand Up @@ -233,11 +252,16 @@ public String toString() {
", coinDetail='" + coinDetail + '\'' +
", amountDetail='" + amountDetail + '\'' +
", feeDetail='" + feeDetail + '\'' +
", sourceAddresses='" + sourceAddresses + '\'' +
", fromAddress='" + fromAddress + '\'' +
", toAddress='" + toAddress + '\'' +
", txHash='" + txHash + '\'' +
", voutN='" + voutN + '\'' +
", nonce='" + nonce + '\'' +
", confirmedNumber='" + confirmedNumber + '\'' +
", replaceCoboId='" + replaceCoboId + '\'' +
", transactionType='" + transactionType + '\'' +
", operation='" + operation + '\'' +
", blockDetail='" + blockDetail + '\'' +
", txDetail='" + txDetail + '\'' +
", extraParameters='" + extraParameters + '\'' +
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@
import com.cobo.custody.api.client.config.Env;
import com.cobo.custody.api.client.domain.ApiResponse;
import com.cobo.custody.api.client.domain.account.*;
import com.cobo.custody.api.client.domain.asset.MPCUnspentInputs;
import com.cobo.custody.api.client.domain.asset.MPCWalletAsset;
import com.cobo.custody.api.client.domain.transaction.*;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.GET;
import retrofit2.http.Query;

import java.math.BigInteger;
import java.util.List;

import static com.cobo.custody.api.client.impl.CoboApiServiceGenerator.createService;
import static com.cobo.custody.api.client.impl.CoboApiServiceGenerator.executeSync;
Expand Down Expand Up @@ -63,11 +56,6 @@ public ApiResponse<MPCListSpendable> listSpendable(String coin, String address)
return executeSync(coboMPCApiService.listSpendable(coin, address));
}

@Override
public ApiResponse<MPCUnspentInputs> getWalletUnspentInputList(String address, String coin) {
return executeSync(coboMPCApiService.getWalletUnspentInputList(address, coin));
}

@Override
public ApiResponse<MPCPostTransaction> createTransaction(String coin, String requestId, String fromAddr, String toAddr, BigInteger amount,
String toAddressDetails, BigInteger fee, BigInteger gasPrice, BigInteger gasLimit,
Expand Down Expand Up @@ -102,10 +90,10 @@ public ApiResponse<MPCTransactionInfos> getTransactionByTxHash(String txHash, In
}

@Override
public ApiResponse<MPCTransactions> listWalletTransactions(Long startTime, Long endTime, Integer status, String order,
public ApiResponse<MPCTransactions> listWalletTransactions(Long startTime, Long endTime, Integer status, String orderBy, String order,
Integer transactionType, String coins, String fromAddr, String toAddr,
Integer limit) {
return executeSync(coboMPCApiService.listWalletTransactions(startTime, endTime, status, order, transactionType,
return executeSync(coboMPCApiService.listWalletTransactions(startTime, endTime, status, orderBy, order, transactionType,
coins, fromAddr, toAddr, limit));
}

Expand Down
Loading