Debug
extends AbstractModule
in package
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.
Table of Contents
Methods
- debugGetRawBlock() : array<string|int, mixed>
- debugGetRawHeader() : array<string|int, mixed>
- debugGetRawReceipts() : array<string|int, mixed>
- debugGetRawTransaction() : Transaction
- runRpc() : array<string|int, mixed>
- Executes an RPC call with the given method and parameters.
- blockHash() : string
- 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.
- blockParam() : string
- Normalizes a block number parameter for RPC calls.
Methods
debugGetRawBlock()
public
debugGetRawBlock([int|BlockParam $blockParam = BlockParam::LATEST ]) : array<string|int, mixed>
Parameters
- $blockParam : int|BlockParam = BlockParam::LATEST
Tags
Return values
array<string|int, mixed>debugGetRawHeader()
public
debugGetRawHeader([int|BlockParam $blockParam = BlockParam::LATEST ]) : array<string|int, mixed>
Parameters
- $blockParam : int|BlockParam = BlockParam::LATEST
Tags
Return values
array<string|int, mixed>debugGetRawReceipts()
public
debugGetRawReceipts([int|BlockParam $blockParam = BlockParam::LATEST ]) : array<string|int, mixed>
Parameters
- $blockParam : int|BlockParam = BlockParam::LATEST
Tags
Return values
array<string|int, mixed>debugGetRawTransaction()
public
debugGetRawTransaction(Hash $h) : Transaction
Parameters
- $h : Hash
Tags
Return values
TransactionrunRpc()
Executes an RPC call with the given method and parameters.
public
abstract runRpc(string $method[, array<string|int, mixed>|null $params = null ]) : array<string|int, mixed>
Parameters
- $method : string
-
the RPC method name
- $params : array<string|int, mixed>|null = null
-
optional array of parameters for the RPC call
Tags
Return values
array<string|int, mixed> —result of the RPC call
blockHash()
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.
protected
blockHash(Hash|Block $block) : string
@param Hash|Block $block the block object or a Hash object
Parameters
Return values
string —hexadecimal representation of the block hash
blockParam()
Normalizes a block number parameter for RPC calls.
protected
blockParam(int|BlockParam $blockNumber) : string
Parameters
- $blockNumber : int|BlockParam
-
the block number or a BlockParam object
Return values
string —hexadecimal representation of the block number or RPC alias string, such as "latest"