New file |
| | |
| | | package com.xcong.excoin.utils; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-11-05 |
| | | **/ |
| | | public class TRC20ApiUtils { |
| | | private static final String SRC_API = "http://27.50.59.35:5002/"; |
| | | private static final String SIGN_STR = "w@a!llokmet"; |
| | | |
| | | public static void apply() { |
| | | Map<String, Object> param = new HashMap<>(); |
| | | String orderNo = "123445"; |
| | | String userid = "11"; |
| | | String symbol = "USDT"; |
| | | String amount = "1"; |
| | | String toAddress = "Ox"; |
| | | param.put("orderno", orderNo); |
| | | param.put("userid", userid); |
| | | param.put("symbol", symbol); |
| | | param.put("toAddress", toAddress); |
| | | param.put("amount", new BigDecimal(amount)); |
| | | param.put("sign", SecureUtil.md5(orderNo + userid + symbol + amount + toAddress + SIGN_STR)); |
| | | HttpRequest request = HttpRequest.post(SRC_API + "transout/created"); |
| | | String body = request.body(JSONObject.toJSONString(param)).execute().body(); |
| | | System.out.println(body); |
| | | } |
| | | |
| | | } |