Package io.api.etherscan.core.impl
Class ProxyApiProvider
- java.lang.Object
-
- io.api.etherscan.core.impl.ProxyApiProvider
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<BlockProxy>block(long blockNo)Returns information about a block by block number eth_getBlockByNumberlongblockNoLast()Returns the number of most recent block eth_blockNumberjava.util.Optional<BlockProxy>blockUncle(long blockNo, long index)Returns information about a uncle by block number eth_getUncleByBlockNumberAndIndexjava.util.Optional<java.lang.String>call(java.lang.String address, java.lang.String data)Executes a new message call immediately without creating a transaction on the block chain eth_calljava.util.Optional<java.lang.String>code(java.lang.String address)Returns code at a given address eth_getCodejava.math.BigIntegergasEstimated()Makes a call or transaction, which won't be added to the blockchain and returns the used gas, which can be used for estimating the used gas eth_estimateGasjava.math.BigIntegergasEstimated(java.lang.String hexData)java.math.BigIntegergasPrice()Returns the current price per gas in wei eth_gasPricejava.util.Optional<java.lang.String>storageAt(java.lang.String address, long position)(**experimental) Returns the value from a storage position at a given address eth_getStorageAtjava.util.Optional<TxProxy>tx(long blockNo, long index)Returns information about a transaction by block number and transaction index position eth_getTransactionByBlockNumberAndIndexjava.util.Optional<TxProxy>tx(java.lang.String txhash)Returns the information about a transaction requested by transaction hash eth_getTransactionByHashinttxCount(long blockNo)Returns the number of transactions in a block from a block matching the given block number eth_getBlockTransactionCountByNumberjava.util.Optional<ReceiptProxy>txReceipt(java.lang.String txhash)Returns the receipt of a transaction by transaction hash eth_getTransactionReceiptinttxSendCount(java.lang.String address)Returns the number of transactions sent from an address eth_getTransactionCountjava.util.Optional<java.lang.String>txSendRaw(java.lang.String hexEncodedTx)Creates new message call transaction or a contract creation for signed transactions eth_sendRawTransaction
-
-
-
Method Detail
-
blockNoLast
public long blockNoLast() throws ApiExceptionDescription copied from interface:IProxyApiReturns the number of most recent block eth_blockNumber- Specified by:
blockNoLastin interfaceIProxyApi- Returns:
- last block number
- Throws:
ApiException
-
block
@NotNull public java.util.Optional<BlockProxy> block(long blockNo) throws ApiException
Description copied from interface:IProxyApiReturns information about a block by block number eth_getBlockByNumber- Specified by:
blockin interfaceIProxyApi- Parameters:
blockNo- block number- Returns:
- block info
- Throws:
ApiException
-
blockUncle
@NotNull public java.util.Optional<BlockProxy> blockUncle(long blockNo, long index) throws ApiException
Description copied from interface:IProxyApiReturns information about a uncle by block number eth_getUncleByBlockNumberAndIndex- Specified by:
blockUnclein interfaceIProxyApi- Parameters:
blockNo- block numberindex- uncle block index- Returns:
- block info
- Throws:
ApiException
-
tx
@NotNull public java.util.Optional<TxProxy> tx(java.lang.String txhash) throws ApiException
Description copied from interface:IProxyApiReturns the information about a transaction requested by transaction hash eth_getTransactionByHash- Specified by:
txin interfaceIProxyApi- Parameters:
txhash- tx hash- Returns:
- tx info
- Throws:
ApiException
-
tx
@NotNull public java.util.Optional<TxProxy> tx(long blockNo, long index) throws ApiException
Description copied from interface:IProxyApiReturns information about a transaction by block number and transaction index position eth_getTransactionByBlockNumberAndIndex- Specified by:
txin interfaceIProxyApi- Parameters:
blockNo- block numberindex- tx index in block- Returns:
- tx info
- Throws:
ApiException
-
txCount
public int txCount(long blockNo) throws ApiExceptionDescription copied from interface:IProxyApiReturns the number of transactions in a block from a block matching the given block number eth_getBlockTransactionCountByNumber- Specified by:
txCountin interfaceIProxyApi- Parameters:
blockNo- block number- Returns:
- tx count in block
- Throws:
ApiException
-
txSendCount
public int txSendCount(java.lang.String address) throws ApiExceptionDescription copied from interface:IProxyApiReturns the number of transactions sent from an address eth_getTransactionCount- Specified by:
txSendCountin interfaceIProxyApi- Parameters:
address- to look for- Returns:
- tx send count
- Throws:
ApiException
-
txSendRaw
@NotNull public java.util.Optional<java.lang.String> txSendRaw(java.lang.String hexEncodedTx) throws ApiExceptionDescription copied from interface:IProxyApiCreates new message call transaction or a contract creation for signed transactions eth_sendRawTransaction- Specified by:
txSendRawin interfaceIProxyApi- Parameters:
hexEncodedTx- tx as hex- Returns:
- result (check eth grpc info)
- Throws:
ApiException
-
txReceipt
@NotNull public java.util.Optional<ReceiptProxy> txReceipt(java.lang.String txhash) throws ApiException
Description copied from interface:IProxyApiReturns the receipt of a transaction by transaction hash eth_getTransactionReceipt- Specified by:
txReceiptin interfaceIProxyApi- Parameters:
txhash- tx hash- Returns:
- receipt
- Throws:
ApiException
-
call
@NotNull public java.util.Optional<java.lang.String> call(java.lang.String address, java.lang.String data) throws ApiExceptionDescription copied from interface:IProxyApiExecutes a new message call immediately without creating a transaction on the block chain eth_call- Specified by:
callin interfaceIProxyApi- Parameters:
address- to look fordata- in tx for call- Returns:
- result (check eth grpc info)
- Throws:
ApiException
-
code
@NotNull public java.util.Optional<java.lang.String> code(java.lang.String address) throws ApiExceptionDescription copied from interface:IProxyApiReturns code at a given address eth_getCode- Specified by:
codein interfaceIProxyApi- Parameters:
address- to look for- Returns:
- result (check eth grpc info)
- Throws:
ApiException
-
storageAt
@NotNull public java.util.Optional<java.lang.String> storageAt(java.lang.String address, long position) throws ApiExceptionDescription copied from interface:IProxyApi(**experimental) Returns the value from a storage position at a given address eth_getStorageAt- Specified by:
storageAtin interfaceIProxyApi- Parameters:
address- to look forposition- storage position- Returns:
- result (check eth grpc info)
- Throws:
ApiException
-
gasPrice
@NotNull public java.math.BigInteger gasPrice() throws ApiExceptionDescription copied from interface:IProxyApiReturns the current price per gas in wei eth_gasPrice- Specified by:
gasPricein interfaceIProxyApi- Returns:
- price
- Throws:
ApiException
-
gasEstimated
@NotNull public java.math.BigInteger gasEstimated() throws ApiExceptionDescription copied from interface:IProxyApiMakes a call or transaction, which won't be added to the blockchain and returns the used gas, which can be used for estimating the used gas eth_estimateGas- Specified by:
gasEstimatedin interfaceIProxyApi- Returns:
- gas estimate
- Throws:
ApiException
-
gasEstimated
@NotNull public java.math.BigInteger gasEstimated(java.lang.String hexData) throws ApiException- Specified by:
gasEstimatedin interfaceIProxyApi- Throws:
ApiException
-
-