| | |
| | | **/ |
| | | @Slf4j |
| | | public class TRC20ApiUtils { |
| | | private static final String TRC20_API = "http://27.50.59.35:5002/"; |
| | | private static final String SIGN_STR = "w@a!llokmet"; |
| | | private static final String TRC20_API = "http://101.132.189.0:5002/"; |
| | | //public static final String SIGN_STR = "w@a!llokmet"; |
| | | public static final String SIGN_STR = "51F40C224CACE2204A998DAB85D5618EE4F3"; |
| | | |
| | | /** |
| | | * 提币申请 |
| | |
| | | } |
| | | |
| | | public static void createWallet(Long userId, String userName, String symbol, String address) { |
| | | log.info("创建钱包开始:{}", System.currentTimeMillis()); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("userId", userId); |
| | | param.put("symbol", symbol); |
| | |
| | | param.put("accountFlag", 1); |
| | | param.put("sign", SecureUtil.md5(userId + symbol + address + SIGN_STR)); |
| | | String body = HttpRequest.post(TRC20_API + "account/created").body(JSONObject.toJSONString(param)).execute().body(); |
| | | log.info("创建钱包结束:{}", System.currentTimeMillis()); |
| | | if (!"200".equals(JSONObject.parseObject(body).getString("code"))) { |
| | | log.error("TRC20创建钱包失败:{}, {}, {}", userId, address, body); |
| | | throw new GlobalException("获取订单失败"); |