Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
Loading...
Searching...
No Matches
M8B\EtherBinder\RPC\Modules\Eth Class Reference
Inheritance diagram for M8B\EtherBinder\RPC\Modules\Eth:
M8B\EtherBinder\RPC\Modules\Debug M8B\EtherBinder\RPC\Modules\AbstractModule M8B\EtherBinder\RPC\Modules\Net M8B\EtherBinder\RPC\Modules\Web3 M8B\EtherBinder\RPC\Compound M8B\EtherBinder\RPC\AbstractRPC M8B\EtherBinder\RPC\HttpRPC

Public Member Functions

 ethProtocolVersion ()
 
 ethSyncing ()
 
 ethCoinbase ()
 
 ethChainID ()
 
 ethMining ()
 
 ethHashrate ()
 
 ethGasPrice ()
 
 ethAccounts ()
 
 ethBlockNumber ()
 
 ethGetBalance (Address $address, int|BlockParam $blockParam=BlockParam::LATEST)
 
 ethGetStorageAt (Address $address, OOGmp $position, int|BlockParam $blockParam=BlockParam::LATEST)
 
 ethGetTransactionCount (Address $address, int|BlockParam $blockParam=BlockParam::PENDING)
 
 ethGetBlockTransactionCountByHash (Hash|Block $block)
 
 ethGetBlockTransactionCountByNumber (int|BlockParam $blockParam=BlockParam::LATEST)
 
 ethGetUncleCountByBlockHash (Hash|Block $block)
 
 ethGetUncleCountByBlockNumber (int|BlockParam $blockParam=BlockParam::LATEST)
 
 ethGetCode (Address $address, int|BlockParam $blockParam=BlockParam::LATEST)
 
 ethSign (Address $address, string $dataHex)
 
 ethSignTransaction (Transaction $txn, Address $from)
 
 ethSendTransaction (Transaction $txn, Address $from)
 
 ethSendRawTransaction (Transaction $signedTransaction)
 
 ethSendRawTransactionHex (string $rawTransactionHex)
 
 ethCall (Transaction $message, ?Address $from=null, int|BlockParam $blockParam=BlockParam::LATEST)
 
 ethEstimateGas (Transaction $txn, ?Address $from)
 
 ethGetBlockByHash (Hash $hash, bool $fullBlock=false)
 
 ethGetBlockByNumber (int|BlockParam $blockParam=BlockParam::LATEST, bool $fullBlock=false)
 
 ethGetTransactionByHash (Hash $hash)
 
 ethGetTransactionByBlockHashAndIndex (Hash $hash, int $index)
 
 ethGetTransactionByBlockNumberAndIndex (int|BlockParam $blockParam, int $index)
 
 ethGetTransactionReceipt (Hash $hash)
 
 ethGetUncleByBlockHashAndIndex (Hash $hash, int $unclePos)
 
 ethGetUncleByBlockNumberAndIndex (int|BlockParam $blockParam, int $unclePos)
 
 ethMaxPriorityFeePerGas ()
 
 ethNewFilter (Address|array $address, null|int|BlockParam $fromBlock, null|int|BlockParam $toBlock, string|bool|HashSerializable|array $topic0, null|string|bool|HashSerializable|array $topic1=null, null|string|bool|HashSerializable|array $topic2=null, null|string|bool|HashSerializable|array $topic3=null)
 
 ethGetLogs (Address|array $address, null|int|BlockParam $fromBlock, null|int|BlockParam $toBlock, null|Hash $blockHash, string|bool|HashSerializable|array $topic0, null|string|bool|HashSerializable|array $topic1=null, null|string|bool|HashSerializable|array $topic2=null, null|string|bool|HashSerializable|array $topic3=null)
 
 ethGetFilterChanges (OOGmp $filterId)
 
 ethGetFilterLogs (OOGmp $filterId)
 
 debugGetRawBlock (int|BlockParam $blockParam=BlockParam::LATEST)
 
 debugGetRawHeader (int|BlockParam $blockParam=BlockParam::LATEST)
 
 debugGetRawReceipts (int|BlockParam $blockParam=BlockParam::LATEST)
 
 debugGetRawTransaction (Hash $h)
 
 runRpc (string $method, ?array $params=null)
 

Protected Member Functions

 parseFilterInput (Address|array $address, null|int|BlockParam $fromBlock, null|int|BlockParam $toBlock, null|Hash $blockHash, string|bool|HashSerializable|array $topic0, null|string|bool|HashSerializable|array $topic1=null, null|string|bool|HashSerializable|array $topic2=null, null|string|bool|HashSerializable|array $topic3=null)
 
 blockParam (int|BlockParam $blockNumber)
 
 blockHash (Hash|Block $block)
 

Member Function Documentation

◆ blockHash()

M8B\EtherBinder\RPC\Modules\AbstractModule::blockHash ( Hash|Block $block)
protectedinherited

Either extracts block hash from block and returns it as hex string, or returns hash hex string. Used for parameter normalization in RPC calls, for convenience of API.

Parameters
Hash | Block$blockthe block object or a Hash object
Returns
string hexadecimal representation of the block hash

◆ blockParam()

M8B\EtherBinder\RPC\Modules\AbstractModule::blockParam ( int|BlockParam $blockNumber)
protectedinherited

Normalizes a block number parameter for RPC calls.

Parameters
int | BlockParam$blockNumberthe block number or a BlockParam object
Returns
string hexadecimal representation of the block number or RPC alias string, such as "latest"

◆ debugGetRawBlock()

M8B\EtherBinder\RPC\Modules\Debug::debugGetRawBlock ( int|BlockParam $blockParam = BlockParam::LATEST)
inherited
Exceptions
EthBinderLogicException
RPCInvalidResponseParamException
RPCGeneralException
RPCNotFoundException

◆ debugGetRawHeader()

M8B\EtherBinder\RPC\Modules\Debug::debugGetRawHeader ( int|BlockParam $blockParam = BlockParam::LATEST)
inherited
Exceptions
EthBinderLogicException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException

◆ debugGetRawReceipts()

M8B\EtherBinder\RPC\Modules\Debug::debugGetRawReceipts ( int|BlockParam $blockParam = BlockParam::LATEST)
inherited
Exceptions
EthBinderLogicException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException

◆ debugGetRawTransaction()

M8B\EtherBinder\RPC\Modules\Debug::debugGetRawTransaction ( Hash $h)
inherited
Parameters
Hash$h
Returns
Transaction
Exceptions
BadAddressChecksumException
EthBinderLogicException
InvalidHexException
InvalidHexLengthException
NotSupportedException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException
EthBinderRuntimeException

◆ ethAccounts()

M8B\EtherBinder\RPC\Modules\Eth::ethAccounts ( )
Returns
Address[]
Exceptions
EthBinderLogicException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException

◆ ethBlockNumber()

M8B\EtherBinder\RPC\Modules\Eth::ethBlockNumber ( )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderRuntimeException

◆ ethCall()

M8B\EtherBinder\RPC\Modules\Eth::ethCall ( Transaction $message,
?Address $from = null,
int|BlockParam $blockParam = BlockParam::LATEST )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethChainID()

M8B\EtherBinder\RPC\Modules\Eth::ethChainID ( )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethCoinbase()

M8B\EtherBinder\RPC\Modules\Eth::ethCoinbase ( )
Exceptions
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException
EthBinderLogicException

◆ ethEstimateGas()

M8B\EtherBinder\RPC\Modules\Eth::ethEstimateGas ( Transaction $txn,
?Address $from )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethGasPrice()

M8B\EtherBinder\RPC\Modules\Eth::ethGasPrice ( )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethGetBalance()

M8B\EtherBinder\RPC\Modules\Eth::ethGetBalance ( Address $address,
int|BlockParam $blockParam = BlockParam::LATEST )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethGetBlockByHash()

M8B\EtherBinder\RPC\Modules\Eth::ethGetBlockByHash ( Hash $hash,
bool $fullBlock = false )
Parameters
Hash$hash
bool$fullBlock
Returns
Block
Exceptions
EthBinderLogicException
RPCInvalidResponseParamException
RPCGeneralException
RPCNotFoundException

◆ ethGetBlockByNumber()

M8B\EtherBinder\RPC\Modules\Eth::ethGetBlockByNumber ( int|BlockParam $blockParam = BlockParam::LATEST,
bool $fullBlock = false )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderLogicException

◆ ethGetBlockTransactionCountByHash()

M8B\EtherBinder\RPC\Modules\Eth::ethGetBlockTransactionCountByHash ( Hash|Block $block)
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderRuntimeException

◆ ethGetBlockTransactionCountByNumber()

M8B\EtherBinder\RPC\Modules\Eth::ethGetBlockTransactionCountByNumber ( int|BlockParam $blockParam = BlockParam::LATEST)
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderRuntimeException

◆ ethGetCode()

M8B\EtherBinder\RPC\Modules\Eth::ethGetCode ( Address $address,
int|BlockParam $blockParam = BlockParam::LATEST )
Exceptions
RPCNotFoundException
RPCInvalidResponseParamException
RPCGeneralException

◆ ethGetFilterChanges()

M8B\EtherBinder\RPC\Modules\Eth::ethGetFilterChanges ( OOGmp $filterId)
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethGetFilterLogs()

M8B\EtherBinder\RPC\Modules\Eth::ethGetFilterLogs ( OOGmp $filterId)
Parameters
OOGmp$filterId
Returns
Log[]
Exceptions
BadAddressChecksumException
EthBinderLogicException
InvalidHexException
InvalidHexLengthException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException

◆ ethGetLogs()

M8B\EtherBinder\RPC\Modules\Eth::ethGetLogs ( Address|array $address,
null|int|BlockParam $fromBlock,
null|int|BlockParam $toBlock,
null|Hash $blockHash,
string|bool|HashSerializable|array $topic0,
null|string|bool|HashSerializable|array $topic1 = null,
null|string|bool|HashSerializable|array $topic2 = null,
null|string|bool|HashSerializable|array $topic3 = null )
Parameters
Address | array$address
int | BlockParam | null$fromBlockif $blockHash not null, it MUST be null
int | BlockParam | null$toBlockif $blockHash not null, it MUST be null
Hash | null$blockHashif $fromBlock and/or $toBlock is not null, it MUST be null
string | bool | HashSerializable | array$topic0
string | bool | HashSerializable | array | null$topic1
string | bool | HashSerializable | array | null$topic2
string | bool | HashSerializable | array | null$topic3
Returns
Log[]
Exceptions
BadAddressChecksumException
EthBinderArgumentException
EthBinderLogicException
InvalidHexException
InvalidHexLengthException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException

◆ ethGetStorageAt()

M8B\EtherBinder\RPC\Modules\Eth::ethGetStorageAt ( Address $address,
OOGmp $position,
int|BlockParam $blockParam = BlockParam::LATEST )
Exceptions
RPCInvalidResponseParamException
RPCGeneralException
RPCNotFoundException

◆ ethGetTransactionByBlockHashAndIndex()

M8B\EtherBinder\RPC\Modules\Eth::ethGetTransactionByBlockHashAndIndex ( Hash $hash,
int $index )
Exceptions
NotSupportedException
EthBinderLogicException
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethGetTransactionByBlockNumberAndIndex()

M8B\EtherBinder\RPC\Modules\Eth::ethGetTransactionByBlockNumberAndIndex ( int|BlockParam $blockParam,
int $index )
Exceptions
NotSupportedException
EthBinderLogicException
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethGetTransactionByHash()

M8B\EtherBinder\RPC\Modules\Eth::ethGetTransactionByHash ( Hash $hash)
Exceptions
EthBinderLogicException
NotSupportedException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException

◆ ethGetTransactionCount()

M8B\EtherBinder\RPC\Modules\Eth::ethGetTransactionCount ( Address $address,
int|BlockParam $blockParam = BlockParam::PENDING )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethGetTransactionReceipt()

M8B\EtherBinder\RPC\Modules\Eth::ethGetTransactionReceipt ( Hash $hash)
Exceptions
NotSupportedException
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderLogicException

◆ ethGetUncleByBlockHashAndIndex()

M8B\EtherBinder\RPC\Modules\Eth::ethGetUncleByBlockHashAndIndex ( Hash $hash,
int $unclePos )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderLogicException

◆ ethGetUncleByBlockNumberAndIndex()

M8B\EtherBinder\RPC\Modules\Eth::ethGetUncleByBlockNumberAndIndex ( int|BlockParam $blockParam,
int $unclePos )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderLogicException

◆ ethGetUncleCountByBlockHash()

M8B\EtherBinder\RPC\Modules\Eth::ethGetUncleCountByBlockHash ( Hash|Block $block)
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderRuntimeException

◆ ethGetUncleCountByBlockNumber()

M8B\EtherBinder\RPC\Modules\Eth::ethGetUncleCountByBlockNumber ( int|BlockParam $blockParam = BlockParam::LATEST)
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
EthBinderRuntimeException

◆ ethHashrate()

M8B\EtherBinder\RPC\Modules\Eth::ethHashrate ( )
Exceptions
RPCNotFoundException
RPCInvalidResponseParamException
RPCGeneralException

◆ ethMaxPriorityFeePerGas()

M8B\EtherBinder\RPC\Modules\Eth::ethMaxPriorityFeePerGas ( )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethMining()

M8B\EtherBinder\RPC\Modules\Eth::ethMining ( )
Exceptions
RPCNotFoundException
RPCInvalidResponseParamException
RPCGeneralException

◆ ethNewFilter()

M8B\EtherBinder\RPC\Modules\Eth::ethNewFilter ( Address|array $address,
null|int|BlockParam $fromBlock,
null|int|BlockParam $toBlock,
string|bool|HashSerializable|array $topic0,
null|string|bool|HashSerializable|array $topic1 = null,
null|string|bool|HashSerializable|array $topic2 = null,
null|string|bool|HashSerializable|array $topic3 = null )

Installs event filterer on rpc node and returns ID of the filter. Accepts few types, but bear in mind that string type is always considered to be binary blob.

Parameters
int | BlockParam | null$fromBlock
int | BlockParam | null$toBlock
Address | Address[]$address
string | bool | HashSerializable | string[] | bool[] | HashSerializable[]$topic0
null | string | bool | HashSerializable | string[] | bool[] | HashSerializable[]$topic1
null | string | bool | HashSerializable | string[] | bool[] | HashSerializable[]$topic2
null | string | bool | HashSerializable | string[] | bool[] | HashSerializable[]$topic3
Returns
OOGmp
Exceptions
EthBinderArgumentException
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException
EthBinderLogicException

◆ ethProtocolVersion()

M8B\EtherBinder\RPC\Modules\Eth::ethProtocolVersion ( )
Exceptions
RPCInvalidResponseParamException
RPCGeneralException
RPCNotFoundException

◆ ethSendRawTransaction()

M8B\EtherBinder\RPC\Modules\Eth::ethSendRawTransaction ( Transaction $signedTransaction)
Exceptions
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException
UnexpectedUnsignedException
EthBinderArgumentException

◆ ethSendRawTransactionHex()

M8B\EtherBinder\RPC\Modules\Eth::ethSendRawTransactionHex ( string $rawTransactionHex)
Parameters
string$rawTransactionHex
Returns
Hash
Exceptions
RPCGeneralException
RPCInvalidResponseParamException
RPCNotFoundException

◆ ethSendTransaction()

M8B\EtherBinder\RPC\Modules\Eth::ethSendTransaction ( Transaction $txn,
Address $from )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException
RPCInvalidResponseParamException

◆ ethSign()

M8B\EtherBinder\RPC\Modules\Eth::ethSign ( Address $address,
string $dataHex )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ ethSignTransaction()

M8B\EtherBinder\RPC\Modules\Eth::ethSignTransaction ( Transaction $txn,
Address $from )
Exceptions
RPCInvalidResponseParamException
RPCGeneralException
RPCNotFoundException

◆ ethSyncing()

M8B\EtherBinder\RPC\Modules\Eth::ethSyncing ( )
Exceptions
RPCGeneralException
RPCNotFoundException
RPCInvalidResponseParamException

◆ parseFilterInput()

M8B\EtherBinder\RPC\Modules\Eth::parseFilterInput ( Address|array $address,
null|int|BlockParam $fromBlock,
null|int|BlockParam $toBlock,
null|Hash $blockHash,
string|bool|HashSerializable|array $topic0,
null|string|bool|HashSerializable|array $topic1 = null,
null|string|bool|HashSerializable|array $topic2 = null,
null|string|bool|HashSerializable|array $topic3 = null )
protected
Exceptions
EthBinderLogicException
EthBinderArgumentException
Exceptions
EthBinderArgumentException

◆ runRpc()

M8B\EtherBinder\RPC\Modules\AbstractModule::runRpc ( string $method,
?array $params = null )
abstractinherited

Executes an RPC call with the given method and parameters.

Parameters
string$methodthe RPC method name
array | null$paramsoptional array of parameters for the RPC call
Returns
array result of the RPC call
array 'result' field of the RPC response. If the result is not an array, it's wrapped in an array under key 0.
Exceptions
RPCGeneralExceptionif any unexpected error is present in RPC response
RPCInvalidResponseParamExceptionif the 'result' field is missing in the response
RPCNotFoundExceptionif the method is not found

Reimplemented in M8B\EtherBinder\RPC\AbstractRPC.


The documentation for this class was generated from the following file: