Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
|
Static Public Member Functions | |
static | generate (string $fullyQualifiedClassName, array $abi, ?string $compiledBlob=null) |
Protected Member Functions | |
__construct (array $abi, protected ?string $compiledBlob=null) | |
gen (string $fullyQualifiedClassName) | |
generateEventClasses (string $namespace) | |
generateTuples (string $namespace) | |
buildMethodParams (string $fnName, array $inputs, BuilderFactory $bld) | |
buildTupleSignatureFromTuple (array $tupleAbiData) | |
getPhpTypingFromType (string $type, string $internalType) | |
prepareOutputTupleInfo (array $abiOutputs, string $namespace) | |
innerPrepareOutputTupleInfo (array $abiOutputs, string $namespace) | |
getPhpTypingFromOutputs (array $outputs) | |
tupleInternalTypeToType (string $internalName) | |
registerTuple (array $tupleData) | |
Core class for generating ABI bindings.
|
protected |
EthBinderArgumentException |
|
protected |
NotSupportedException |
|
protected |
NotSupportedException | |
EthBinderArgumentException |
|
static |
This function returns array of generated bindings code. Bindings include tuples, events and contract.
Output array shape is: [ "contract" => "<?php root source code", "events" => [ "PHPClassName" => "<?php event source code", "PHPClassName" => "<?php event source code" ] "tuples" => [ "PHPClassName" => "<?php tuple source code" ] ]
ABIGen accepts 2 files, one is ABI JSON file, which is required, and should be sourced from solidity
LIMITATIONS: currently event allows parsing event data into appropriate object (to "events" sub-array class). There is a rare case of having events that emit indexed dynamic data such as strings, arrays or tuples. Solidity in such case returns keccak256 hash of such data, not the data itself, making the data itself unrecoverable. If the ABIGen stumbles upon such event, it will throw NotSupportedException. Such events are not supported. In pinch, it's OK to remove the event from ABI JSON manually, but of course, such events will not be parsed.
NotSupportedException | |
EthBinderArgumentException |
|
protected |
NotSupportedException | |
GlobalException |
|
protected |
NotSupportedException |
|
protected |
NotSupportedException |
|
protected |
NotSupportedException |