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

Public Member Functions

 validate ($val, array $params)
 
 rlpVal ()
 
 hexVal ()
 
 encodedHexVal ()
 
 val ()
 
- Public Member Functions inherited from EthBytes
 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 strToHex ($string)
 
static hexToStr ($string)
 
- Static Public Member Functions inherited from EthBytes
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

String data.

Definition at line 13 of file EthS.php.

Member Function Documentation

◆ cretateFromRLP()

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

Definition at line 49 of file EthS.php.

References Rlp\decode().

+ Here is the call graph for this function:

◆ encodedHexVal()

encodedHexVal ( )
Returns
string

Definition at line 78 of file EthS.php.

References EthS\rlpVal().

+ Here is the call graph for this function:

◆ hexToStr()

static hexToStr (   $string)
static

Converts Hex to string.

See also
http://perldoc.perl.org/perlpacktut.html
Parameters
string$stringHex string to be converted to UTF-8.
Returns
string String value.
Exceptions
Exception

Definition at line 147 of file EthS.php.

Referenced by EthS\validate().

+ Here is the caller graph for this function:

◆ hexVal()

hexVal ( )

Get hexadecimal string representation.

Definition at line 70 of file EthS.php.

References EthereumStatic\ensureHexPrefix(), and EthS\strToHex().

+ Here is the call graph for this function:

◆ rlpVal()

rlpVal ( )

Return hex value.

Returns
string Prefixed Hex value.
Todo:
???

Definition at line 61 of file EthS.php.

References Rlp\encode(), and EthS\strToHex().

Referenced by EthS\encodedHexVal().

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

◆ strToHex()

static strToHex (   $string)
static

Converts a string to Hex.

Parameters
string$stringString to be converted.
Returns
string Hex representation of the string.

Definition at line 128 of file EthS.php.

Referenced by EthS\hexVal(), and EthS\rlpVal().

+ Here is the caller graph for this function:

◆ val()

val ( )

Get string.

Definition at line 86 of file EthS.php.

References EthD\$value.

◆ validate()

validate (   $val,
array  $params 
)
Parameters
string$valA prefixed, ABI Encoded string or a UTF-8 string which does not start with "0x".
array$params
Returns
null|number|string
Exceptions

Definition at line 22 of file EthS.php.

References EthereumStatic\hasHexPrefix(), and EthS\hexToStr().

+ Here is the call graph for this function:

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