ERC20Contract
        
        extends ContractService
    
    
            
            in package
            
        
    
    
    
        
            Class EthereumService
Table of Contents
- ETHEREUM_ADDRESS = '/^0x[a-fA-F0-9]{40}$/'
 - Base ethereum regex
 - ETHEREUM_HASH = '/^0x[a-fA-F0-9]{64}$/'
 - RPC_VERSION = "2.0"
 - $ABIService : ABIService
 - $credentials : ConnectionInterface
 - $curl : CurlHandle|resource
 - __construct() : mixed
 - EthereumRPC constructor.
 - __get() : void
 - __isset() : mixed
 - __set() : mixed
 - abi() : array<string|int, mixed>
 - allowance() : string|null
 - apiVersion() : string|null
 - balanceOf() : mixed
 - balanceOfString() : string
 - baseHeaders() : array<string|int, mixed>
 - baseUrl() : string
 - calculateGasLimit() : string
 - callContractFunction() : mixed
 - clientCallContractFunction() : string
 - decimals() : string
 - decodeContractTransactionArgs() : array<string|int, mixed>
 - decodeContractTransactionLogs() : array<string|int, mixed>|null
 - decodeRespose() : mixed
 - encodeApprove() : string
 - encodeBurn() : string
 - encodeBurnFrom() : string
 - encodeMint() : string
 - encodeTransfer() : string
 - encodeTransferFrom() : string
 - ethCall() : string
 - getBalance() : string
 - getBlockTransactions() : array<string|int, mixed>
 - getBlockTransactionsCountByNumber() : int
 - getChainId() : int
 - getCredentials() : ConnectionInterface
 - getCurrentBlockNumber() : int
 - getEventsTopics() : array<string|int, mixed>
 - getGethGasPrice() : string
 - getHost() : string
 - getMethodSelector() : array<string|int, mixed>
 - getMethodSelectors() : array<string|int, mixed>
 - getPort() : int|null
 - getSsl() : bool
 - getTransactionByHash() : array<string|int, mixed>|null
 - getTransactionReceipt() : array<string|int, mixed>|null
 - getTxCountForAddress() : string
 - jsonRPC() : array<string|int, mixed>
 - name() : string
 - owner() : string|null
 - prepareTransaction() : array<string|int, mixed>
 - sendNodeRequest() : array<string|int, mixed>
 - signAndBroadcastTransaction() : string
 - signAndBroadcastTransactionByNode() : string
 - symbol() : string
 - totalSupply() : string
 - validateAddress() : void
 - broadcastTransactionHash() : string|null
 - handleBigCommissionPriceTransactions() : string
 - handleNonceLowTransactions() : string
 - handleUnderPricedTransactions() : string
 - url() : string
 
Constants
ETHEREUM_ADDRESS
Base ethereum regex
    public
        mixed
    ETHEREUM_ADDRESS
    = '/^0x[a-fA-F0-9]{40}$/'
    
        
    
ETHEREUM_HASH
    public
        mixed
    ETHEREUM_HASH
    = '/^0x[a-fA-F0-9]{64}$/'
        
        
    
RPC_VERSION
    public
        mixed
    RPC_VERSION
    = "2.0"
        
        
    
Properties
$ABIService
    protected
        ABIService
    $ABIService
    
        
        
    
$credentials
    protected
        ConnectionInterface
    $credentials
    
        
        
    
$curl
    protected
        CurlHandle|resource
    $curl
    
    
    
    
Methods
__construct()
EthereumRPC constructor.
    public
                    __construct(ConnectionInterface $credentials) : mixed
    
        Parameters
- $credentials : ConnectionInterface
 
Return values
mixed —__get()
    public
                    __get(string $name) : void
    
        Parameters
- $name : string
 
Tags
Return values
void —__isset()
    public
                    __isset(mixed $name) : mixed
        
        Parameters
- $name : mixed
 
Return values
mixed —__set()
    public
                    __set(mixed $name, mixed $value) : mixed
        
        Parameters
- $name : mixed
 - $value : mixed
 
Return values
mixed —abi()
    public
                    abi() : array<string|int, mixed>
        
    
    
        Return values
array<string|int, mixed> —allowance()
    public
                    allowance(string $contractAddress, string $owner, string $spender) : string|null
        
        Parameters
- $contractAddress : string
 - $owner : string
 - $spender : string
 
Return values
string|null —apiVersion()
    public
                    apiVersion() : string|null
        
    
    
        Return values
string|null —balanceOf()
    public
                    balanceOf(string $contractAddress, string $address) : mixed
        
        Parameters
- $contractAddress : string
 - $address : string
 
Return values
mixed —balanceOfString()
    public
                    balanceOfString(string $contractAddress, string $address) : string
        
        Parameters
- $contractAddress : string
 - $address : string
 
Return values
string —baseHeaders()
    public
                    baseHeaders() : array<string|int, mixed>
        
    
    
        Return values
array<string|int, mixed> —baseUrl()
    public
                    baseUrl() : string
        
    
    
        Return values
string —calculateGasLimit()
    public
                    calculateGasLimit(string $from, string $to, int $amount[, string $data = '00' ][, string $block = 'latest' ]) : string
        
        Parameters
- $from : string
 - $to : string
 - $amount : int
 - $data : string = '00'
 - $block : string = 'latest'
 
Return values
string —callContractFunction()
    public
                    callContractFunction(string $contractAddress, string $functionName[, array<string|int, mixed> $params = [] ][, mixed $block = "latest" ]) : mixed
        
        Parameters
- $contractAddress : string
 - $functionName : string
 - $params : array<string|int, mixed> = []
 - $block : mixed = "latest"
 
Return values
mixed —clientCallContractFunction()
    public
                    clientCallContractFunction(string $contractAddress, string $functionName[, array<string|int, mixed> $params = [] ][, mixed $block = "latest" ]) : string
        
        Parameters
- $contractAddress : string
 - $functionName : string
 - $params : array<string|int, mixed> = []
 - $block : mixed = "latest"
 
Return values
string —decimals()
    public
                    decimals(string $contractAddress) : string
        
        Parameters
- $contractAddress : string
 
Return values
string —decodeContractTransactionArgs()
    public
                    decodeContractTransactionArgs(string $function, string $encoded) : array<string|int, mixed>
        
        Parameters
- $function : string
 - $encoded : string
 
Return values
array<string|int, mixed> —decodeContractTransactionLogs()
    public
                    decodeContractTransactionLogs(string $topicId, array<string|int, mixed> $encodedLogs) : array<string|int, mixed>|null
        
        Parameters
- $topicId : string
 - $encodedLogs : array<string|int, mixed>
 
Return values
array<string|int, mixed>|null —decodeRespose()
    public
                    decodeRespose(string $function, mixed $response) : mixed
        
        Parameters
- $function : string
 - $response : mixed
 
Return values
mixed —encodeApprove()
    public
                    encodeApprove(string $to, int $amount) : string
        
        Parameters
- $to : string
 - $amount : int
 
Return values
string —encodeBurn()
    public
                    encodeBurn(int $amount) : string
        
        Parameters
- $amount : int
 
Return values
string —encodeBurnFrom()
    public
                    encodeBurnFrom(string $from, int $amount) : string
        
        Parameters
- $from : string
 - $amount : int
 
Return values
string —encodeMint()
    public
                    encodeMint(string $to, int $amount) : string
        
        Parameters
- $to : string
 - $amount : int
 
Return values
string —encodeTransfer()
    public
                    encodeTransfer(string $to, int $amount) : string
        
        Parameters
- $to : string
 - $amount : int
 
Return values
string —encodeTransferFrom()
    public
                    encodeTransferFrom(string $from, string $to, int $amount) : string
        
        Parameters
- $from : string
 - $to : string
 - $amount : int
 
Return values
string —ethCall()
    public
                    ethCall( $tx[, string|int $block = "latest" ][, mixed $functionName = '' ]) : string
    
        Parameters
Tags
Return values
string —getBalance()
    public
                    getBalance(string $address) : string
        
        Parameters
- $address : string
 
Return values
string —getBlockTransactions()
    public
                    getBlockTransactions(int $blockNumber[, bool $onlyHashes = false ]) : array<string|int, mixed>
        
        Parameters
- $blockNumber : int
 - $onlyHashes : bool = false
 
Return values
array<string|int, mixed> —getBlockTransactionsCountByNumber()
    public
                    getBlockTransactionsCountByNumber(int $blockNumber) : int
        
        Parameters
- $blockNumber : int
 
Return values
int —getChainId()
    public
                    getChainId() : int
        
    
    
        Return values
int —getCredentials()
    public
                    getCredentials() : ConnectionInterface
    
    
    
        Return values
ConnectionInterface —getCurrentBlockNumber()
    public
                    getCurrentBlockNumber() : int
        
    
    
        Return values
int —getEventsTopics()
    public
                    getEventsTopics() : array<string|int, mixed>
        
    
    
        Return values
array<string|int, mixed> —getGethGasPrice()
    public
                    getGethGasPrice() : string
        
    
    
        Return values
string —getHost()
    public
                    getHost() : string
        
    
    
        Return values
string —getMethodSelector()
    public
                    getMethodSelector(string $functionName) : array<string|int, mixed>
        
        Parameters
- $functionName : string
 
Return values
array<string|int, mixed> —getMethodSelectors()
    public
                    getMethodSelectors() : array<string|int, mixed>
        
    
    
        Return values
array<string|int, mixed> —getPort()
    public
                    getPort() : int|null
        
    
    
        Return values
int|null —getSsl()
    public
                    getSsl() : bool
        
    
    
        Return values
bool —getTransactionByHash()
    public
                    getTransactionByHash(string $hash) : array<string|int, mixed>|null
        
        Parameters
- $hash : string
 
Return values
array<string|int, mixed>|null —getTransactionReceipt()
    public
                    getTransactionReceipt(string $txHash) : array<string|int, mixed>|null
        
        Parameters
- $txHash : string
 
Return values
array<string|int, mixed>|null —getTxCountForAddress()
    public
                    getTxCountForAddress(string $address[, string $quantity = "pending" ]) : string
        
        Parameters
- $address : string
 - $quantity : string = "pending"
 
Return values
string —jsonRPC()
    public
                    jsonRPC(string $command[, string|null $endpoint = null ][, array<string|int, mixed>|null $params = null ][, mixed $functionName = '' ]) : array<string|int, mixed>
        
        Parameters
- $command : string
 - $endpoint : string|null = null
 - $params : array<string|int, mixed>|null = null
 - $functionName : mixed = ''
 
Return values
array<string|int, mixed> —name()
    public
                    name(string $contractAddress) : string
        
        Parameters
- $contractAddress : string
 
Return values
string —owner()
    public
                    owner(string $contractAddress) : string|null
        
        Parameters
- $contractAddress : string
 
Return values
string|null —prepareTransaction()
    public
                    prepareTransaction(string $from, string $to, int $amountInWEI[, string $data = '00' ]) : array<string|int, mixed>
        
        Parameters
- $from : string
 - $to : string
 - $amountInWEI : int
 - $data : string = '00'
 
Return values
array<string|int, mixed> —sendNodeRequest()
    public
                    sendNodeRequest([null $data = null ][, null $method = null ][, false $need_encode = true ][, false $is_put = false ][, mixed $functionName = '' ]) : array<string|int, mixed>
    
        Parameters
- $data : null = null
 - $method : null = null
 - $need_encode : false = true
 - $is_put : false = false
 - $functionName : mixed = ''
 
Tags
Return values
array<string|int, mixed> —signAndBroadcastTransaction()
    public
                    signAndBroadcastTransaction(Transaction $transaction, string $privateKey) : string
        
        Parameters
- $transaction : Transaction
 - $privateKey : string
 
Return values
string —signAndBroadcastTransactionByNode()
    public
                    signAndBroadcastTransactionByNode(Transaction $transaction, string $privateKey) : string
        
        Parameters
- $transaction : Transaction
 - $privateKey : string
 
Return values
string —symbol()
    public
                    symbol(string $contractAddress) : string
        
        Parameters
- $contractAddress : string
 
Return values
string —totalSupply()
    public
                    totalSupply(string $contractAddress) : string
        
        Parameters
- $contractAddress : string
 
Return values
string —validateAddress()
    public
                    validateAddress(mixed ...$addresses) : void
    
        Parameters
- $addresses : mixed
 
Tags
Return values
void —broadcastTransactionHash()
    protected
                    broadcastTransactionHash(string $hash) : string|null
        
        Parameters
- $hash : string
 
Return values
string|null —handleBigCommissionPriceTransactions()
    protected
                    handleBigCommissionPriceTransactions(Transaction $transaction, string $privateKey) : string
    
        Parameters
- $transaction : Transaction
 - $privateKey : string
 
Return values
string —handleNonceLowTransactions()
    protected
                    handleNonceLowTransactions(Transaction $transaction, string $privateKey) : string
    
        Parameters
- $transaction : Transaction
 - $privateKey : string
 
Return values
string —handleUnderPricedTransactions()
    protected
                    handleUnderPricedTransactions(Transaction $transaction, string $privateKey) : string
        
        Parameters
- $transaction : Transaction
 - $privateKey : string
 
Return values
string —url()
    private
                    url([null|string $endPoint = null ]) : string
    
        Parameters
- $endPoint : null|string = null