├── Java_demon_socket_version.java ├── README.md └── token_interface.java /Java_demon_socket_version.java: -------------------------------------------------------------------------------- 1 | package work.pomz; 2 | 3 | import org.web3j.crypto.*; 4 | import org.web3j.protocol.Web3j; 5 | import org.web3j.protocol.core.RemoteCall; 6 | import org.web3j.protocol.core.methods.response.TransactionReceipt; 7 | import org.web3j.protocol.http.HttpService; 8 | 9 | import java.io.*; 10 | import java.math.BigDecimal; 11 | import java.math.BigInteger; 12 | import java.net.ServerSocket; 13 | import java.net.Socket; 14 | import java.security.InvalidAlgorithmParameterException; 15 | import java.security.NoSuchAlgorithmException; 16 | import java.security.NoSuchProviderException; 17 | import java.text.DateFormat; 18 | import java.text.SimpleDateFormat; 19 | import java.util.Arrays; 20 | import java.util.Calendar; 21 | import java.util.Date; 22 | import java.util.UUID; 23 | 24 | public class Main { 25 | private static Web3j web3j; 26 | private static Credentials credentials; 27 | private static String url = "http://localhost:8545"; 28 | private static String privateKeyRaw = null; 29 | private static BigInteger privateKey = null; 30 | private static final String tokenAddress = ; 31 | private static BigInteger gasPrice = BigInteger.valueOf(17000000000l); 32 | private static BigInteger gasLimit = BigInteger.valueOf(60000); 33 | private static TPOMZ tokenTPOMZ; 34 | 35 | public static void main(String[] args) { 36 | web3j = Web3j.build(new HttpService(url)); 37 | 38 | ECKeyPair ecKeyPair = ECKeyPair.create(privateKey); 39 | credentials = Credentials.create(ecKeyPair); 40 | 41 | Long summ = 0l; 42 | String tx = null; 43 | 44 | tokenTPOMZ = TPOMZ.load(tokenAddress, web3j, credentials, gasPrice, gasLimit); 45 | while (true) { 46 | try (ServerSocket serverSocket = new ServerSocket(8189); 47 | Socket socket = serverSocket.accept()) { 48 | System.out.println("Client connected"); 49 | OutputStream os = socket.getOutputStream(); 50 | PrintWriter pw = new PrintWriter(os, true); 51 | BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream())); 52 | String msg = br.readLine(); 53 | String response = null; 54 | String request[] = msg.split("\\s"); 55 | if (request[0].equalsIgnoreCase("setgaslimit")) { 56 | if (request.length < 2) { 57 | response = "Missed argument"; 58 | break; 59 | } 60 | if (request[1].matches("\\D")) { 61 | response = "Incorrect argument, expected long value"; 62 | break; 63 | } 64 | Long gl = new Long(request[1]); 65 | gasLimit = BigInteger.valueOf(gl); 66 | tokenTPOMZ = TPOMZ.load(tokenAddress, web3j, credentials, gasPrice, gasLimit); 67 | response = "Success: Gas Limit is " + gl; 68 | } else if (request[0].equalsIgnoreCase("setgasprice")) { 69 | if (request.length < 2) { 70 | response = "Missed argument"; 71 | break; 72 | } 73 | if (request[1].matches("\\D")) { 74 | response = "Incorrect argument, expected integer value"; 75 | break; 76 | } 77 | Long gp = new Long(request[1]); 78 | gasPrice = BigInteger.valueOf(gp); 79 | tokenTPOMZ = TPOMZ.load(tokenAddress, web3j, credentials, gasPrice, gasLimit); 80 | response = "Success: Gas Price is " + gp; 81 | } else if (request[0].equalsIgnoreCase("setnode")) { 82 | if (request.length < 2) { 83 | response = "Missed argument"; 84 | break; 85 | } 86 | url = request[1]; 87 | web3j = Web3j.build(new HttpService(url)); 88 | tokenTPOMZ = TPOMZ.load(tokenAddress, web3j, credentials, gasPrice, gasLimit); 89 | response = "Success: url node is " + url; 90 | } else if (request[0].equalsIgnoreCase("setprivatekey")) { 91 | if (request.length < 2) { 92 | response = "Missed argument"; 93 | break; 94 | } 95 | privateKeyRaw = request[1]; 96 | privateKey = new BigInteger(privateKeyRaw, 16); 97 | credentials = Credentials.create(ecKeyPair); 98 | tokenTPOMZ = TPOMZ.load(tokenAddress, web3j, credentials, gasPrice, gasLimit); 99 | } else if (request[0].equalsIgnoreCase("getgasprice")) { 100 | response = String.valueOf(gasPrice); 101 | } else if (request[0].equalsIgnoreCase("getgaslimit")) { 102 | response = String.valueOf(gasLimit); 103 | } else if (request[0].equalsIgnoreCase("getaccount")) { 104 | response = credentials.getAddress(); 105 | } else if (request[0].equalsIgnoreCase("setnode")) { 106 | if (request.length < 2) { 107 | response = "Missed argument"; 108 | break; 109 | } 110 | url = request[1]; 111 | web3j = Web3j.build(new HttpService(url)); 112 | tokenTPOMZ = TPOMZ.load(tokenAddress, web3j, credentials, gasPrice, gasLimit); 113 | } else if (request[0].equalsIgnoreCase("getnode")) { 114 | response = url; 115 | } else if (request[0].equalsIgnoreCase("newwallet")) { 116 | if (request.length == 1) { 117 | try { 118 | response = createWallet(); 119 | } catch (InvalidAlgorithmParameterException e) { 120 | response = e.getMessage(); 121 | } catch (NoSuchAlgorithmException e) { 122 | response = e.getMessage(); 123 | } catch (NoSuchProviderException e) { 124 | response = e.getMessage(); 125 | } 126 | } else { 127 | try { 128 | response = createWallet(request[1]); 129 | } catch (InvalidAlgorithmParameterException e) { 130 | response = e.getMessage(); 131 | } catch (NoSuchAlgorithmException e) { 132 | response = e.getMessage(); 133 | } catch (NoSuchProviderException e) { 134 | response = e.getMessage(); 135 | } catch (CipherException e) { 136 | response = e.getMessage(); 137 | } 138 | } 139 | } else if (request[0].equalsIgnoreCase("balanceof")) { 140 | if (request.length < 2) { 141 | response = "Missed argument"; 142 | break; 143 | } 144 | try { 145 | response = getTpomzBalance(request[1]).toEngineeringString(); 146 | } catch (Exception e) { 147 | response = e.getMessage(); 148 | } 149 | } else if (request[0].equalsIgnoreCase("transfer")) { 150 | if (request.length < 3) { 151 | response = "Missed argument"; 152 | break; 153 | } 154 | Long count = Long.valueOf(request[2]); 155 | try { 156 | response = sendTPOMZ(request[1], count); 157 | } catch (Exception e) { 158 | response = e.getMessage(); 159 | } 160 | } else if (request[0].equalsIgnoreCase("help")) { 161 | response = "setGasLimit\n\tSet gas limit for transaction\n\tExample: setGasLimit \n\tDefault: 60000\n\n" + 162 | "setGasPrice\n\tSet gas price in Wei\n\tExample: setGasPrice \n\tDefault: 17000000000\n\n" + 163 | "setNode\n\tSet node url\n\tExample: setNode \n\tDefault: http://localhost:8545\n\n" + 164 | "setPrivateKey\n\tSet private key for wallet\n\tExample: setPrivateKey \n\n" + 165 | "setWalletFile\n\tSet wallet file and password\n\tExample: setWalletFile \n\n" + 166 | "getGasPrice\n\tGet current gas price settings\n\n" + 167 | "getGasLimit\n\tGet current gas limit settings\n\n" + 168 | "getAccount\n\tGet current account\n\n" + 169 | "getNode\n\tGet current node url\n\n" + 170 | "balanceOf\n\tGet balance of account in TPOMZ tokens\n\tExample: balanceOf \n\n" + 171 | "transfer\n\tTransfer TPOMZ tokens from current account to another\n\t" + 172 | "Example: transfer \n\t" + 173 | "Decimals = 8 i.e. 100000000 = 1 TPOMZ or 1 = 0.00000001 TPOMZ\n\n" + 174 | "newWallet\n\tCreate new wallet and return keys\n\t" + 175 | "Example: newWallet — create wallet file encrypted by password\n\t" + 176 | "Example: newWallet — create private key\n\n" + 177 | "help\n\tShow quick help on commands"; 178 | } else { 179 | response = "unknown command"; 180 | } 181 | pw.println(response); 182 | pw.close(); 183 | br.close(); 184 | os.close(); 185 | } catch (IOException e) { 186 | e.printStackTrace(); 187 | } 188 | } 189 | } 190 | 191 | private static String sendTPOMZ(String to, Long value) throws Exception { 192 | RemoteCall transactionReceiptRemoteCall = 193 | tokenTPOMZ.transfer(to, BigInteger.valueOf(value)); 194 | TransactionReceipt transactionReceipt = transactionReceiptRemoteCall.send(); 195 | 196 | return transactionReceipt.getTransactionHash(); 197 | } 198 | 199 | private static String createWallet() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { 200 | ECKeyPair ecKeyPair = Keys.createEcKeyPair(); 201 | Credentials cr = Credentials.create(ecKeyPair); 202 | return cr.getAddress() + " " + cr.getEcKeyPair().getPrivateKey().toString(16); 203 | } 204 | 205 | private static String createWallet(String password) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException, CipherException, IOException { 206 | String walletFile = WalletUtils.generateFullNewWalletFile(password, new File(WalletUtils.getDefaultKeyDirectory())); 207 | return walletFile; 208 | } 209 | 210 | private static BigDecimal getTpomzBalance(String address) throws Exception { 211 | RemoteCall bigIntegerRemoteCall = tokenTPOMZ.balanceOf(address); 212 | BigInteger bigInteger = bigIntegerRemoteCall.send(); 213 | BigDecimal bigDecimal = new BigDecimal(bigInteger); 214 | return bigDecimal.divide(BigDecimal.valueOf(Math.pow(10, 8))); 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java 2 | -------------------------------------------------------------------------------- /token_interface.java: -------------------------------------------------------------------------------- 1 | package work.pomz; 2 | 3 | import java.math.BigInteger; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.Collections; 7 | import java.util.List; 8 | import org.web3j.abi.EventEncoder; 9 | import org.web3j.abi.TypeReference; 10 | import org.web3j.abi.datatypes.Address; 11 | import org.web3j.abi.datatypes.Event; 12 | import org.web3j.abi.datatypes.Function; 13 | import org.web3j.abi.datatypes.Type; 14 | import org.web3j.abi.datatypes.Utf8String; 15 | import org.web3j.abi.datatypes.generated.Uint256; 16 | import org.web3j.crypto.Credentials; 17 | import org.web3j.protocol.Web3j; 18 | import org.web3j.protocol.core.DefaultBlockParameter; 19 | import org.web3j.protocol.core.RemoteCall; 20 | import org.web3j.protocol.core.methods.request.EthFilter; 21 | import org.web3j.protocol.core.methods.response.Log; 22 | import org.web3j.protocol.core.methods.response.TransactionReceipt; 23 | import org.web3j.tx.Contract; 24 | import org.web3j.tx.TransactionManager; 25 | import rx.Observable; 26 | import rx.functions.Func1; 27 | 28 | public class POMZ extends Contract { 29 | private static final String BINARY = "60806040526706f05b59d3b2000060025534801561001c57600080fd5b50600254336000908152602081905260409020556105bc8061003f6000396000f3006080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100aa578063095ea7b31461013457806318160ddd1461016c57806323b872dd14610193578063313ce567146101bd57806370a08231146101d257806395d89b41146100aa578063a9059cbb146101f3578063dd62ed3e14610217575b3480156100a457600080fd5b50600080fd5b3480156100b657600080fd5b506100bf61023e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f95781810151838201526020016100e1565b50505050905090810190601f1680156101265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014057600080fd5b50610158600160a060020a0360043516602435610275565b604080519115158252519081900360200190f35b34801561017857600080fd5b506101816102dc565b60408051918252519081900360200190f35b34801561019f57600080fd5b50610158600160a060020a03600435811690602435166044356102e2565b3480156101c957600080fd5b5061018161044d565b3480156101de57600080fd5b50610181600160a060020a0360043516610452565b3480156101ff57600080fd5b50610158600160a060020a036004351660243561046d565b34801561022357600080fd5b50610181600160a060020a0360043581169060243516610546565b60408051808201909152600581527f54504f4d5a000000000000000000000000000000000000000000000000000000602082015281565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025481565b600160a060020a038316600090815260208190526040812054821180159061032d5750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b80156103395750600082115b1561044257600160a060020a038416600090815260208190526040902054610367908363ffffffff61057116565b600160a060020a0385166000908152602081815260408083209390935560018152828220338352905220546103a2908363ffffffff61057116565b600160a060020a03808616600090815260016020908152604080832033845282528083209490945591861681529081905220546103e5908363ffffffff61058316565b600160a060020a038085166000818152602081815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001610446565b5060005b9392505050565b600881565b600160a060020a031660009081526020819052604090205490565b33600090815260208190526040812054821180159061048c5750600082115b1561053e57336000908152602081905260409020546104b1908363ffffffff61057116565b3360009081526020819052604080822092909255600160a060020a038516815220546104e3908363ffffffff61058316565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060016102d6565b5060006102d6565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b60008282111561057d57fe5b50900390565b818101828110156102d657fe00a165627a7a72305820d24bf58acfb8a34d01779e6c4aa6a9f116b17395539a0c134fb447e612f454800029"; 30 | 31 | public static final String FUNC_NAME = "name"; 32 | 33 | public static final String FUNC_APPROVE = "approve"; 34 | 35 | public static final String FUNC_TOTALSUPPLY = "totalSupply"; 36 | 37 | public static final String FUNC_TRANSFERFROM = "transferFrom"; 38 | 39 | public static final String FUNC_DECIMALS = "decimals"; 40 | 41 | public static final String FUNC_BALANCEOF = "balanceOf"; 42 | 43 | public static final String FUNC_SYMBOL = "symbol"; 44 | 45 | public static final String FUNC_TRANSFER = "transfer"; 46 | 47 | public static final String FUNC_ALLOWANCE = "allowance"; 48 | 49 | public static final Event TRANSFER_EVENT = new Event("Transfer", 50 | Arrays.>asList(new TypeReference
() {}, new TypeReference
() {}), 51 | Arrays.>asList(new TypeReference() {})); 52 | ; 53 | 54 | public static final Event APPROVAL_EVENT = new Event("Approval", 55 | Arrays.>asList(new TypeReference
() {}, new TypeReference
() {}), 56 | Arrays.>asList(new TypeReference() {})); 57 | ; 58 | 59 | protected POMZ(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { 60 | super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); 61 | } 62 | 63 | protected POMZ(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { 64 | super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); 65 | } 66 | 67 | public RemoteCall name() { 68 | final Function function = new Function(FUNC_NAME, 69 | Arrays.asList(), 70 | Arrays.>asList(new TypeReference() {})); 71 | return executeRemoteCallSingleValueReturn(function, String.class); 72 | } 73 | 74 | public RemoteCall approve(String _spender, BigInteger _value) { 75 | final Function function = new Function( 76 | FUNC_APPROVE, 77 | Arrays.asList(new org.web3j.abi.datatypes.Address(_spender), 78 | new org.web3j.abi.datatypes.generated.Uint256(_value)), 79 | Collections.>emptyList()); 80 | return executeRemoteCallTransaction(function); 81 | } 82 | 83 | public RemoteCall totalSupply() { 84 | final Function function = new Function(FUNC_TOTALSUPPLY, 85 | Arrays.asList(), 86 | Arrays.>asList(new TypeReference() {})); 87 | return executeRemoteCallSingleValueReturn(function, BigInteger.class); 88 | } 89 | 90 | public RemoteCall transferFrom(String _from, String _to, BigInteger _value) { 91 | final Function function = new Function( 92 | FUNC_TRANSFERFROM, 93 | Arrays.asList(new org.web3j.abi.datatypes.Address(_from), 94 | new org.web3j.abi.datatypes.Address(_to), 95 | new org.web3j.abi.datatypes.generated.Uint256(_value)), 96 | Collections.>emptyList()); 97 | return executeRemoteCallTransaction(function); 98 | } 99 | 100 | public RemoteCall decimals() { 101 | final Function function = new Function(FUNC_DECIMALS, 102 | Arrays.asList(), 103 | Arrays.>asList(new TypeReference() {})); 104 | return executeRemoteCallSingleValueReturn(function, BigInteger.class); 105 | } 106 | 107 | public RemoteCall balanceOf(String _owner) { 108 | final Function function = new Function(FUNC_BALANCEOF, 109 | Arrays.asList(new org.web3j.abi.datatypes.Address(_owner)), 110 | Arrays.>asList(new TypeReference() {})); 111 | return executeRemoteCallSingleValueReturn(function, BigInteger.class); 112 | } 113 | 114 | public RemoteCall symbol() { 115 | final Function function = new Function(FUNC_SYMBOL, 116 | Arrays.asList(), 117 | Arrays.>asList(new TypeReference() {})); 118 | return executeRemoteCallSingleValueReturn(function, String.class); 119 | } 120 | 121 | public RemoteCall transfer(String _to, BigInteger _value) { 122 | final Function function = new Function( 123 | FUNC_TRANSFER, 124 | Arrays.asList(new org.web3j.abi.datatypes.Address(_to), 125 | new org.web3j.abi.datatypes.generated.Uint256(_value)), 126 | Collections.>emptyList()); 127 | return executeRemoteCallTransaction(function); 128 | } 129 | 130 | public RemoteCall allowance(String _owner, String _spender) { 131 | final Function function = new Function(FUNC_ALLOWANCE, 132 | Arrays.asList(new org.web3j.abi.datatypes.Address(_owner), 133 | new org.web3j.abi.datatypes.Address(_spender)), 134 | Arrays.>asList(new TypeReference() {})); 135 | return executeRemoteCallSingleValueReturn(function, BigInteger.class); 136 | } 137 | 138 | public static RemoteCall deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { 139 | return deployRemoteCall(POMZ.class, web3j, credentials, gasPrice, gasLimit, BINARY, ""); 140 | } 141 | 142 | public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { 143 | return deployRemoteCall(POMZ.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, ""); 144 | } 145 | 146 | public List getTransferEvents(TransactionReceipt transactionReceipt) { 147 | List valueList = extractEventParametersWithLog(TRANSFER_EVENT, transactionReceipt); 148 | ArrayList responses = new ArrayList(valueList.size()); 149 | for (Contract.EventValuesWithLog eventValues : valueList) { 150 | TransferEventResponse typedResponse = new TransferEventResponse(); 151 | typedResponse.log = eventValues.getLog(); 152 | typedResponse._from = (String) eventValues.getIndexedValues().get(0).getValue(); 153 | typedResponse._to = (String) eventValues.getIndexedValues().get(1).getValue(); 154 | typedResponse._value = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); 155 | responses.add(typedResponse); 156 | } 157 | return responses; 158 | } 159 | 160 | public Observable transferEventObservable(EthFilter filter) { 161 | return web3j.ethLogObservable(filter).map(new Func1() { 162 | @Override 163 | public TransferEventResponse call(Log log) { 164 | Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFER_EVENT, log); 165 | TransferEventResponse typedResponse = new TransferEventResponse(); 166 | typedResponse.log = log; 167 | typedResponse._from = (String) eventValues.getIndexedValues().get(0).getValue(); 168 | typedResponse._to = (String) eventValues.getIndexedValues().get(1).getValue(); 169 | typedResponse._value = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); 170 | return typedResponse; 171 | } 172 | }); 173 | } 174 | 175 | public Observable transferEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { 176 | EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); 177 | filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); 178 | return transferEventObservable(filter); 179 | } 180 | 181 | public List getApprovalEvents(TransactionReceipt transactionReceipt) { 182 | List valueList = extractEventParametersWithLog(APPROVAL_EVENT, transactionReceipt); 183 | ArrayList responses = new ArrayList(valueList.size()); 184 | for (Contract.EventValuesWithLog eventValues : valueList) { 185 | ApprovalEventResponse typedResponse = new ApprovalEventResponse(); 186 | typedResponse.log = eventValues.getLog(); 187 | typedResponse._owner = (String) eventValues.getIndexedValues().get(0).getValue(); 188 | typedResponse._spender = (String) eventValues.getIndexedValues().get(1).getValue(); 189 | typedResponse._value = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); 190 | responses.add(typedResponse); 191 | } 192 | return responses; 193 | } 194 | 195 | public Observable approvalEventObservable(EthFilter filter) { 196 | return web3j.ethLogObservable(filter).map(new Func1() { 197 | @Override 198 | public ApprovalEventResponse call(Log log) { 199 | Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(APPROVAL_EVENT, log); 200 | ApprovalEventResponse typedResponse = new ApprovalEventResponse(); 201 | typedResponse.log = log; 202 | typedResponse._owner = (String) eventValues.getIndexedValues().get(0).getValue(); 203 | typedResponse._spender = (String) eventValues.getIndexedValues().get(1).getValue(); 204 | typedResponse._value = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); 205 | return typedResponse; 206 | } 207 | }); 208 | } 209 | 210 | public Observable approvalEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { 211 | EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); 212 | filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT)); 213 | return approvalEventObservable(filter); 214 | } 215 | 216 | public static POMZ load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { 217 | return new POMZ(contractAddress, web3j, credentials, gasPrice, gasLimit); 218 | } 219 | 220 | public static POMZ load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { 221 | return new POMZ(contractAddress, web3j, transactionManager, gasPrice, gasLimit); 222 | } 223 | 224 | public static class TransferEventResponse { 225 | public Log log; 226 | 227 | public String _from; 228 | 229 | public String _to; 230 | 231 | public BigInteger _value; 232 | } 233 | 234 | public static class ApprovalEventResponse { 235 | public Log log; 236 | 237 | public String _owner; 238 | 239 | public String _spender; 240 | 241 | public BigInteger _value; 242 | } 243 | } 244 | --------------------------------------------------------------------------------