| | |
| | |
|
| | | import cc.mrbird.febs.common.exception.FebsException;
|
| | | import cn.hutool.core.collection.CollUtil;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | import org.web3j.abi.FunctionEncoder;
|
| | |
| | | byte[] signedMessage = TransactionEncoder.signMessage(rawTransaction, credentials);
|
| | | String hexValue = Numeric.toHexString(signedMessage);
|
| | |
|
| | | // log.debug("transfer hexValue:" + hexValue);
|
| | |
|
| | | CompletableFuture<EthSendTransaction> ethSendTransactionCompletableFuture = web3j.ethSendRawTransaction(hexValue).sendAsync();
|
| | | EthSendTransaction ethSendTransaction = ethSendTransactionCompletableFuture.get();
|
| | | //return "hash";
|
| | | // log.info("====:{}", JSONObject.toJSONString(ethSendTransaction));
|
| | |
|
| | | if (ethSendTransaction.hasError()) {
|
| | | // log.info("transfer error:", ethSendTransaction.getError().getMessage());
|
| | | return "";
|
| | | } else {
|
| | | String transactionHash = ethSendTransaction.getTransactionHash();
|