package com.cobo.custody.api.client.impl;
import com.cobo.custody.api.client.CoboApiClientFactory;
import com.cobo.custody.api.client.CoboMPCApiRestClient;
import com.cobo.custody.api.client.config.Env;
import com.cobo.custody.api.client.domain.ApiResponse;
import com.cobo.custody.api.client.domain.transaction.MPCPostTransaction;
import java.math.BigInteger;
public class CobоCustodyApiClientExample {
private static CoboMPCApiRestClient mpcClient;
public static void main(String[] args) {
String apiSecret = "your_api_secret_here";
mpcClient = CoboApiClientFactory.newInstance(
new LocalSigner(apiSecret),
Env.DEVELOP,
false).newMPCRestClient();
String coin = "ETH";
String requestId = String.valueOf(System.currentTimeMillis());
String fromAddr = "0x5bc25b43fad2525c9efaa913070aca4d8bb0c15d";
String toAddr = "0x4629a4b6b4FEBd13536871E167151be9d16535b3";
BigInteger amount = new BigInteger("100000000000000000");
String toAddressDetails = null;
BigInteger fee = null;
BigInteger gasPrice = new BigInteger("6500000000");
BigInteger gasLimit = new BigInteger("21000");
Integer operation = null;
String extraParameters = null;
ApiResponse<MPCPostTransaction> response = mpcClient.createTransaction(
coin, requestId, fromAddr,toAddr, amount, toAddressDetails, gasPrice, gasLimit, fee, operation, extraParameters
);
System.out.println(response.getResult());
}
}