Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
EthBytes Class Reference
+ Inheritance diagram for EthBytes:
+ Collaboration diagram for EthBytes:

Public Member Functions

 validate ($val, array $params)
 
 validateLength ($val)
 
 hexVal ()
 
 encodedHexVal ()
 
 rlpVal ()
 
 val ()
 
- Public Member Functions inherited from EthD
const const __construct ($val, array $params=[])
 
 convertByAbi ($abiType)
 
 validate ($val, array $params)
 
 validateHexString ($val)
 
 convertTo ($type)
 
 toArray ()
 
 hexVal ()
 
 encodedHexVal ()
 
 val ()
 
- Public Member Functions inherited from EthDataType
 getProperty (string $property='value', bool $returnHexVal=false)
 
 setValue ($val, array $params=[])
 
 getClassName ()
 

Static Public Member Functions

static cretateFromRLP ($hexVal)
 
static getDataLengthType ()
 
- Static Public Member Functions inherited from EthD
static getPrimitiveTypes ()
 
static isPrimitive ()
 
static typeMap (string $type)
 
static reverseTypeMap ($class_name)
 
static getSchemaType ()
 
static getTypeArray ()
 
- Static Public Member Functions inherited from EthDataType
const static getClassByAbi (string $abiType)
 
static getDataLengthType ()
 
static isPrimitive ()
 
static getTypeClass (string $type, bool $typed_constructor=false)
 
static getAllTypeClasses ()
 
- Static Public Member Functions inherited from EthereumStatic
static getMethodSignature ($input)
 
static phpKeccak256 ($string)
 
static sha3 ($string)
 
static isValidFunction ($input)
 
static getDefinition ()
 
static isValidHexQuantity ($str)
 
static isValidHexData ($str)
 
static isValidAddress ($address, $throw=false)
 
static hasHexPrefix ($str)
 
static removeHexPrefix ($str)
 
static ensureHexPrefix ($str)
 
static convertCurrency (float $amount, string $from='wei', string $to='ether')
 

Additional Inherited Members

- Protected Attributes inherited from EthD
 $value
 
 $abi
 

Detailed Description

Complex Array or byte data.

Some Complex types base on EthBytes.

Definition at line 14 of file EthBytes.php.

Member Function Documentation

◆ cretateFromRLP()

static cretateFromRLP (   $hexVal)
static
Parameters
$hexVal
Returns
Exceptions
Exception

Definition at line 70 of file EthBytes.php.

References Rlp\decode().

+ Here is the call graph for this function:

◆ encodedHexVal()

encodedHexVal ( )
Returns
string

Definition at line 90 of file EthBytes.php.

References EthBytes\rlpVal().

+ Here is the call graph for this function:

◆ getDataLengthType()

static getDataLengthType ( )
static
Returns
string|int

Implements EthDataTypeInterface.

Definition at line 122 of file EthBytes.php.

◆ hexVal()

hexVal ( )

Return hex value.

Returns
string Prefixed Hex value.

Definition at line 82 of file EthBytes.php.

References EthD\$value.

◆ rlpVal()

rlpVal ( )

Return hex value.

Returns
string Prefixed Hex value.

Definition at line 101 of file EthBytes.php.

References Rlp\encode().

Referenced by EthBytes\encodedHexVal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ val()

val ( )

Return un-prefixed bin value.

Subclasses may return other types.

Returns
string Un-prefixed Hex value.

Definition at line 114 of file EthBytes.php.

References EthereumStatic\removeHexPrefix().

+ Here is the call graph for this function:

◆ validateLength()

validateLength (   $val)

Implement validation.

Parameters
string$valHexadecimal "0x"prefixed byte value.
Exceptions
InvalidArgumentException
Returns
string Validated D20 value.

Definition at line 54 of file EthBytes.php.


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