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 | |
runRpc (string $method, ?array $params=null) | |
Protected Member Functions | |
blockParam (int|BlockParam $blockNumber) | |
blockHash (Hash|Block $block) | |
AbstractModule serves as the base class for specific modules, enabling them to access the runRpc() method. Note that only the first module in the inheritance chain will inherit this, as PHP allows single inheritance only.
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 |
|
protected |
Normalizes a block number parameter for RPC calls.
int | BlockParam | $blockNumber | the block number or a BlockParam object |
|
abstract |
Executes an RPC call with the given method and parameters.
string | $method | the RPC method name |
array | null | $params | optional array of parameters for the RPC call |
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 in M8B\EtherBinder\RPC\AbstractRPC.