|
| 1 | +package io.api.etherscan.model; |
| 2 | + |
| 3 | +import java.math.BigInteger; |
| 4 | +import java.util.Objects; |
| 5 | + |
| 6 | +/** |
| 7 | + * ! NO DESCRIPTION ! |
| 8 | + * |
| 9 | + * @author Abhay Gupta |
| 10 | + * @since 14.11.2022 |
| 11 | + */ |
| 12 | +public class GasOracle { |
| 13 | + private Long LastBlock; |
| 14 | + private Integer SafeGasPrice; |
| 15 | + private Integer ProposeGasPrice; |
| 16 | + private Integer FastGasPrice; |
| 17 | + private Double suggestBaseFee; |
| 18 | + private String gasUsedRatio; |
| 19 | + |
| 20 | + public Long getLastBlock() { |
| 21 | + return LastBlock; |
| 22 | + } |
| 23 | + |
| 24 | + public BigInteger getSafeGasPriceInWei() { |
| 25 | + return BigInteger.valueOf(SafeGasPrice).multiply(BigInteger.TEN.pow(9)); |
| 26 | + } |
| 27 | + |
| 28 | + public BigInteger getProposeGasPriceInWei() { |
| 29 | + return BigInteger.valueOf(ProposeGasPrice).multiply(BigInteger.TEN.pow(9)); |
| 30 | + } |
| 31 | + |
| 32 | + public BigInteger getFastGasPriceInWei() { |
| 33 | + return BigInteger.valueOf(FastGasPrice).multiply(BigInteger.TEN.pow(9)); |
| 34 | + } |
| 35 | + |
| 36 | + public Double getSuggestBaseFee() { |
| 37 | + return suggestBaseFee; |
| 38 | + } |
| 39 | + |
| 40 | + public String getGasUsedRatio() { |
| 41 | + return gasUsedRatio; |
| 42 | + } |
| 43 | + |
| 44 | + @Override |
| 45 | + public boolean equals(Object o) { |
| 46 | + if (this == o) return true; |
| 47 | + if (o == null || getClass() != o.getClass()) return false; |
| 48 | + GasOracle gasOracle = (GasOracle) o; |
| 49 | + return LastBlock.equals(gasOracle.LastBlock) && SafeGasPrice.equals(gasOracle.SafeGasPrice) && ProposeGasPrice.equals(gasOracle.ProposeGasPrice) && FastGasPrice.equals(gasOracle.FastGasPrice) && suggestBaseFee.equals(gasOracle.suggestBaseFee) && gasUsedRatio.equals(gasOracle.gasUsedRatio); |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public int hashCode() { |
| 54 | + return Objects.hash(LastBlock, SafeGasPrice, ProposeGasPrice, FastGasPrice, suggestBaseFee, gasUsedRatio); |
| 55 | + } |
| 56 | + |
| 57 | + @Override |
| 58 | + public String toString() { |
| 59 | + return "GasOracle{" + |
| 60 | + "LastBlock=" + LastBlock + |
| 61 | + ", SafeGasPrice=" + SafeGasPrice + |
| 62 | + ", ProposeGasPrice=" + ProposeGasPrice + |
| 63 | + ", FastGasPrice=" + FastGasPrice + |
| 64 | + ", suggestBaseFee=" + suggestBaseFee + |
| 65 | + ", gasUsedRatio='" + gasUsedRatio + '\'' + |
| 66 | + '}'; |
| 67 | + } |
| 68 | +} |
0 commit comments