Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
|
Public Member Functions | |
__construct (string $url, array $extraHeaders=[]) | |
__destruct () | |
raw (string $method, ?array $params=null) | |
runRpc (string $method, ?array $params=null) | |
calcAvgTip (int $blockNumbers=3) | |
isLookingLikeLondon () | |
web3ClientVersion () | |
web3Sha3Keccak (string $inputHex) | |
web3Sha3KeccakBin (string $inputBin) | |
netVersion () | |
netListening () | |
netPeerCount () | |
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) | |
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) | |
HttpRPC provides functionality to make JSON-RPC calls over HTTP / HTTPS via curl. Curl handle persist across calls.
M8B\EtherBinder\RPC\HttpRPC::__construct | ( | string | $url, |
array | $extraHeaders = [] ) |
Constructs a new HttpRPC object.
string | $url | Endpoint URL for JSON-RPC calls. |
array | $extraHeaders | Additional HTTP headers. |
InvalidURLException | if the provided URL is not valid or uses unsupported protocols. |
M8B\EtherBinder\RPC\HttpRPC::__destruct | ( | ) |
Closes the cURL handle on object destruction.
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.
Hash | Block | $block | the block object or a Hash object |
|
protectedinherited |
Normalizes a block number parameter for RPC calls.
int | BlockParam | $blockNumber | the block number or a BlockParam object |
|
inherited |
Calculates the average EIP1559 tip over a range of blocks. If the underlying chain doesn't look like EIP1559 chain, it returns fallback of 1 GWEI.
int | $blockNumbers | number of recent blocks to consider |
EthBinderLogicException | |
RPCInvalidResponseParamException | |
EthBinderRuntimeException |
|
inherited |
EthBinderLogicException | |
RPCInvalidResponseParamException | |
RPCGeneralException | |
RPCNotFoundException |
|
inherited |
EthBinderLogicException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
EthBinderLogicException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
Hash | $h |
BadAddressChecksumException | |
EthBinderLogicException | |
InvalidHexException | |
InvalidHexLengthException | |
NotSupportedException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException | |
EthBinderRuntimeException |
|
inherited |
EthBinderLogicException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderRuntimeException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException | |
EthBinderLogicException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
Hash | $hash | |
bool | $fullBlock |
EthBinderLogicException | |
RPCInvalidResponseParamException | |
RPCGeneralException | |
RPCNotFoundException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderLogicException |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderRuntimeException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderRuntimeException |
|
inherited |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
RPCGeneralException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
OOGmp | $filterId |
BadAddressChecksumException | |
EthBinderLogicException | |
InvalidHexException | |
InvalidHexLengthException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
Address | array | $address | |
int | BlockParam | null | $fromBlock | if $blockHash not null, it MUST be null |
int | BlockParam | null | $toBlock | if $blockHash not null, it MUST be null |
Hash | null | $blockHash | if $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 |
BadAddressChecksumException | |
EthBinderArgumentException | |
EthBinderLogicException | |
InvalidHexException | |
InvalidHexLengthException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
RPCInvalidResponseParamException | |
RPCGeneralException | |
RPCNotFoundException |
|
inherited |
NotSupportedException | |
EthBinderLogicException | |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
NotSupportedException | |
EthBinderLogicException | |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
EthBinderLogicException | |
NotSupportedException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
NotSupportedException | |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderLogicException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderLogicException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderLogicException |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderRuntimeException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderRuntimeException |
|
inherited |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
RPCGeneralException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
RPCGeneralException |
|
inherited |
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.
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 |
EthBinderArgumentException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException | |
EthBinderLogicException |
|
inherited |
RPCInvalidResponseParamException | |
RPCGeneralException | |
RPCNotFoundException |
|
inherited |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException | |
UnexpectedUnsignedException | |
EthBinderArgumentException |
|
inherited |
string | $rawTransactionHex |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
RPCInvalidResponseParamException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCInvalidResponseParamException | |
RPCGeneralException | |
RPCNotFoundException |
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
Checks whether the network seems to be like London (EIP-1559) by checking block data fields that are EIP1559 specific
EthBinderLogicException | |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
RPCGeneralException |
|
inherited |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
RPCGeneralException | |
EthBinderRuntimeException |
|
inherited |
RPCInvalidResponseParamException | |
RPCGeneralException | |
RPCNotFoundException |
|
protectedinherited |
EthBinderLogicException | |
EthBinderArgumentException |
EthBinderArgumentException |
M8B\EtherBinder\RPC\HttpRPC::raw | ( | string | $method, |
?array | $params = null ) |
@inheritDoc
RPCGeneralException | if the request fails or response is invalid. |
Reimplemented from M8B\EtherBinder\RPC\AbstractRPC.
|
inherited |
Sends an RPC request and returns only the 'result' data.
string | $method | the RPC method to call |
array | null | $params | optional parameters for the method |
RPCGeneralException | if any unexpected error is present in RPC response |
RPCInvalidResponseParamException | if the 'result' field is missing in the response |
RPCNotFoundException | if the method is not found |
Reimplemented from M8B\EtherBinder\RPC\Modules\AbstractModule.
|
inherited |
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException |
|
inherited |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |
|
inherited |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException |