| | |
| | | |
| | | @Override |
| | | public BigInteger allowance(String address) { |
| | | String contractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; |
| | | String methodName = "allowance"; |
| | | List<TypeReference<?>> outputParameters = new ArrayList<>(); |
| | | TypeReference<Uint256> typeReference = new TypeReference<Uint256>() { |
| | |
| | | } |
| | | |
| | | public String getGas() { |
| | | String resp = HttpUtil.get("https://etherscan.io/autoUpdateGasTracker.ashx?sid=75f30b765180f29e2b7584b8501c9124"); |
| | | JSONObject data = JSONObject.parseObject(resp); |
| | | String gas = data.getString("avgPrice"); |
| | | String gas; |
| | | if (url.contains("infura.io")) { |
| | | String resp = HttpUtil.get("https://etherscan.io/autoUpdateGasTracker.ashx?sid=75f30b765180f29e2b7584b8501c9124"); |
| | | JSONObject data = JSONObject.parseObject(resp); |
| | | gas = data.getString("avgPrice"); |
| | | } else { |
| | | String resp = HttpUtil.get("https://gbsc.blockscan.com/gasapi.ashx?apikey=key&method=gasoracle"); |
| | | JSONObject data = JSONObject.parseObject(resp); |
| | | gas = data.getString("FastGasPrice"); |
| | | } |
| | | return StrUtil.isBlank(gas) ? "35" : gas; |
| | | } |
| | | |