Documentation

ABIGen
in package

Core class for generating ABI bindings.

Tags
author

DubbaThony

Table of Contents

Constants

autogenWarning  = <<<HDC // Code auto generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. // If you need to edit this class, extend it. HDC
throwsCommentCall  = <<<HDC /** \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t */ HDC
throwsCommentDeploy  = <<<HDC /** \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t * @throws \\M8B\\EtherBinder\\Exceptions\\InvalidLengthException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t * @throws \\M8B\\EtherBinder\\Exceptions\\UnexpectedUnsignedException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCGeneralException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCNotFoundException \t */ HDC
throwsCommentFilterFetch  = <<<HDC /** \t* @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t* @throws \\M8B\\EtherBinder\\Exceptions\\RPCGeneralException \t* @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t* @throws \\M8B\\EtherBinder\\Exceptions\\BadAddressChecksumException \t* @throws \\M8B\\EtherBinder\\Exceptions\\InvalidHexLengthException \t* @throws \\M8B\\EtherBinder\\Exceptions\\RPCNotFoundException \t* @throws \\M8B\\EtherBinder\\Exceptions\\InvalidHexException \t* @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t* @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t*/ HDC
throwsCommentTransact  = <<<HDC /** \t * @throws \\M8B\\EtherBinder\\Exceptions\\UnexpectedUnsignedException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t * @throws \\M8B\\EtherBinder\\Exceptions\\InvalidLengthException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t */ HDC

Properties

$abiConstructor  : array<string|int, mixed>
$abiEvents  : array<string|int, mixed>
$abiFunctions  : array<string|int, mixed>
$className  : string
$compiledBlob  : string|null
$tuplesRegistry  : array<string|int, mixed>

Methods

generate()  : array<string|int, mixed>
This function returns array of generated bindings code. Bindings include tuples, events and contract.
__construct()  : mixed
buildMethodParams()  : Assign[], signature: string}
buildTupleSignatureFromTuple()  : string
gen()  : array<string|int, mixed>
generateEventClasses()  : array<string|int, mixed>
generateTuples()  : array<string|int, mixed>
getPhpTypingFromOutputs()  : string
getPhpTypingFromType()  : string
innerPrepareOutputTupleInfo()  : null|array<string|int, mixed>
prepareOutputTupleInfo()  : null|array<string|int, mixed>
registerTuple()  : void
tupleInternalTypeToType()  : string
emptyr()  : bool

Constants

autogenWarning

protected mixed autogenWarning = <<<HDC // Code auto generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. // If you need to edit this class, extend it. HDC

throwsCommentCall

protected mixed throwsCommentCall = <<<HDC /** \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t */ HDC

throwsCommentDeploy

protected mixed throwsCommentDeploy = <<<HDC /** \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t * @throws \\M8B\\EtherBinder\\Exceptions\\InvalidLengthException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t * @throws \\M8B\\EtherBinder\\Exceptions\\UnexpectedUnsignedException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCGeneralException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCNotFoundException \t */ HDC

throwsCommentFilterFetch

protected mixed throwsCommentFilterFetch = <<<HDC /** \t* @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t* @throws \\M8B\\EtherBinder\\Exceptions\\RPCGeneralException \t* @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t* @throws \\M8B\\EtherBinder\\Exceptions\\BadAddressChecksumException \t* @throws \\M8B\\EtherBinder\\Exceptions\\InvalidHexLengthException \t* @throws \\M8B\\EtherBinder\\Exceptions\\RPCNotFoundException \t* @throws \\M8B\\EtherBinder\\Exceptions\\InvalidHexException \t* @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t* @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t*/ HDC

throwsCommentTransact

protected mixed throwsCommentTransact = <<<HDC /** \t * @throws \\M8B\\EtherBinder\\Exceptions\\UnexpectedUnsignedException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderLogicException \t * @throws \\M8B\\EtherBinder\\Exceptions\\InvalidLengthException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderRuntimeException \t * @throws \\M8B\\EtherBinder\\Exceptions\\EthBinderArgumentException \t * @throws \\M8B\\EtherBinder\\Exceptions\\RPCInvalidResponseParamException \t */ HDC

Properties

$abiConstructor

protected array<string|int, mixed> $abiConstructor

$abiEvents

protected array<string|int, mixed> $abiEvents

$abiFunctions

protected array<string|int, mixed> $abiFunctions

$className

protected string $className

$compiledBlob

protected string|null $compiledBlob = null

$tuplesRegistry

protected array<string|int, mixed> $tuplesRegistry = []

Methods

generate()

This function returns array of generated bindings code. Bindings include tuples, events and contract.

public static generate(string $fullyQualifiedClassName, array<string|int, mixed> $abi[, string|null $compiledBlob = null ]) : array<string|int, mixed>

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.

Parameters
$fullyQualifiedClassName : string
$abi : array<string|int, mixed>
$compiledBlob : string|null = null
Tags
throws
NotSupportedException
throws
EthBinderArgumentException
Return values
array<string|int, mixed>

__construct()

protected __construct(array<string|int, mixed> $abi[, string|null $compiledBlob = null ]) : mixed
Parameters
$abi : array<string|int, mixed>
$compiledBlob : string|null = null
Tags
throws
EthBinderArgumentException

buildMethodParams()

protected buildMethodParams(string $fnName, array<string|int, mixed> $inputs, BuilderFactory $bld) : Assign[], signature: string}
Parameters
$fnName : string
$inputs : array<string|int, mixed>
$bld : BuilderFactory
Tags
throws
NotSupportedException
Return values
Assign[], signature: string}

buildTupleSignatureFromTuple()

protected buildTupleSignatureFromTuple(array<string|int, mixed> $tupleAbiData) : string
Parameters
$tupleAbiData : array<string|int, mixed>
Return values
string

generateEventClasses()

protected generateEventClasses(string $namespace) : array<string|int, mixed>
Parameters
$namespace : string
Tags
throws
NotSupportedException
throws
Exception
Return values
array<string|int, mixed>

generateTuples()

protected generateTuples(string $namespace) : array<string|int, mixed>
Parameters
$namespace : string
Tags
throws
NotSupportedException
Return values
array<string|int, mixed>

getPhpTypingFromOutputs()

protected getPhpTypingFromOutputs(array<string|int, mixed> $outputs) : string
Parameters
$outputs : array<string|int, mixed>
Tags
throws
NotSupportedException
Return values
string

getPhpTypingFromType()

protected getPhpTypingFromType(string $type, string $internalType) : string
Parameters
$type : string
$internalType : string
Tags
throws
NotSupportedException
Return values
string

innerPrepareOutputTupleInfo()

protected innerPrepareOutputTupleInfo(array<string|int, mixed> $abiOutputs, string $namespace) : null|array<string|int, mixed>
Parameters
$abiOutputs : array<string|int, mixed>
$namespace : string
Return values
null|array<string|int, mixed>

prepareOutputTupleInfo()

protected prepareOutputTupleInfo(array<string|int, mixed> $abiOutputs, string $namespace) : null|array<string|int, mixed>
Parameters
$abiOutputs : array<string|int, mixed>
$namespace : string
Return values
null|array<string|int, mixed>

registerTuple()

protected registerTuple(array<string|int, mixed> $tupleData) : void
Parameters
$tupleData : array<string|int, mixed>

tupleInternalTypeToType()

protected tupleInternalTypeToType(string $internalName) : string
Parameters
$internalName : string
Return values
string

emptyr()

private emptyr(mixed $var) : bool
Parameters
$var : mixed
Return values
bool

        
On this page

Search results