| | |
| | | public final static String TRX_ADDRESS = "TPSPfAZ8UG9WiXDNX6SbYHNpX46oLV6xAs"; |
| | | public final static String POOL_ADDRESS = "TPSPfAZ8UG9WiXDNX6SbYHNpX46oLV6xAs"; |
| | | |
| | | public final static String API_KEY="a7b0c96a-cfcd-474d-88c5-75c6277fedbf"; |
| | | |
| | | |
| | | /** |
| | | * 创建用户钱包地址 |
| | |
| | | public static void sendTrx(String sendPrivateKey,String receiveAddress,BigDecimal amount) { |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | TransactionResult transactionResult = service.testSendTrxTransaction(sendPrivateKey, receiveAddress, amount); |
| | | TransactionResult transactionResult = service.testSendTrxTransaction(sendPrivateKey, receiveAddress, amount,API_KEY); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public static void sendTrc20(String sendPrivateKey,String receiveAddress,BigDecimal amount){ |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | TransactionResult transactionResult = service.sendTrc20TransactionTest(sendPrivateKey, receiveAddress, amount); |
| | | TransactionResult transactionResult = service.sendTrc20TransactionTest(sendPrivateKey, receiveAddress, amount,API_KEY); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public static BigDecimal getTrxBalance(String address){ |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | BigDecimal trxBalanceTest = service.getTrxBalanceTest(address); |
| | | BigDecimal trxBalanceTest = service.getTrxBalanceTest(address,API_KEY); |
| | | return trxBalanceTest; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | public static BigDecimal getTrc20Balance(String address){ |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | BigDecimal trxBalanceTest = service.trc20BalanceOfTest(address); |
| | | BigDecimal trxBalanceTest = service.trc20BalanceOfTest(address,API_KEY); |
| | | return trxBalanceTest; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |