phph1
in package
The PHPH1 wrapper class.
This file and config.php must be included in your project before invoking the PHPH1 class, for example:
require('config.php');
require('phph1.php');
Once included the phph1 class can be invoked by setting a class handle. Be sure to check the config.php settings to be sure they are set how you would like. There is commented documentation in the config.php file as well as below for all required variables. See the __construct() function below for more information.
Example:
$phph1 = new phph1($phph1_apiaddresses, $max_pagesize, $default_pagesize, $default_network, $default_shard)
Methods that require input have a validation method available. Validation methods return either 1 for good or 0 if it finds bad input. When validating, if there is an invalid input, the error details are saved as an array in the $errors variable. You cannot retrieve the contents of the errors variable directly as it is set to private. There is a get_errors() function built into the class to retrieve any errors. See the example below.
Example:
if ($phph1->val_estimateGas($toaddr, $fromaddr, $gas, $gasprice, $value, $data)){
$gasData = $phph1->hmyv2_estimateGas($toaddr, $fromaddr, $gas, $gasprice, $value, $data);
// You can use this to see a raw dump of the returned data
print_r($gasData);
}else{
$errors = $phph1->get_errors();
// You can use this to see a raw dump of the errors
print_r($errors);
}
Table of Contents
- $apiaddr : string
- $default_pagesize : int
- $errors : array<string|int, mixed>
- $max_pagesize : int
- $network : string
- $phph1_apiaddresses : array<string|int, mixed>
- $shard : int
- __construct() : void
- The __construct function is used to set PHPH1 configurations settings when invoking the class. The parameters are all REQUIRED when invoking the class
- convert_atto() : number
- Converts numbers in atto to decimal
- docurlrequest() : object
- docurlrequest() takes the generated json request for the current method from genjsonrequest() and makes the call to the API RPC Node. If rpc_call is set to 0, it generates a data object for output.
- genjsonrequest() : string
- genjsonrequest() is used by the method functions to generate the JSON request for the Node API host
- get_apiaddr() : string
- get_apiaddr() is used to get the currently used Node API address The API address is set during _construct using the supplied network and shard information
- get_errors() : array<string|int, mixed>
- get_errors() is used to get the current array of errors from method requests The error array is generated during the validation of method inputs
- get_sessionnetwork() : string
- get_sessionnetwork() is used to get the current network we are working on The network is set when creating a class handle in _construct and the settings are found in config.php
- get_sessionshard() : string
- get_sessionshard() is used to get the current network shard we are working on The network shard is set when creating a class handle in _construct and the settings array is found in config.php
- getapiaddr() : string
- getapiaddr() is used to set the Node API host address during __construct. It gets the address using the network name and shard from $phph1_apiaddresses which is also set during __construct using settings from config.php
- hmyv2_blockNumber() : int
- Get the current block number
- hmyv2_call() : string
- hmyv2_call() Executes a new message call immediately, without creating a transaction on the block chain. The hmyv2_call method can be used to query internal contract state, to execute validations coded into a contract or even to test what the effect of a transaction would be without running it live.
- hmyv2_epochLastBlock() : int
- Get the last block for a specified epoch
- hmyv2_estimateGas() : string
- hmyv2_estimateGas() Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
- hmyv2_gasPrice() : int
- Gets the current average gas price of transactions
- hmyv2_getAllValidatorAddresses() : array<string|int, mixed>
- Gets a list of wallet addresses that have created validators on the network.
- hmyv2_getAllValidatorInformation() : array<string|int, mixed>
- Gets all information for all validators.
- hmyv2_getAllValidatorInformationByBlockNumber() : array<string|int, mixed>
- Get all validator information by block number
- hmyv2_getBalance() : number
- Gets the current balance in atto for the specified wallet
- hmyv2_getBalanceByBlockNumber() : number
- Gets the current balance in atto for the specified wallet at the specified block number
- hmyv2_getBlockByHash() : array<string|int, mixed>
- Gets block information using the specified block hash.
- hmyv2_getBlockByNumber() : array<string|int, mixed>
- Gets block information using the specified block number.
- hmyv2_getBlocks() : array<string|int, mixed>
- Gets block information on a series of blocks between two block numbers.
- hmyv2_getBlockSignerKeys() : array<string|int, mixed>
- Gets block signer BLS keys using the specified block number.
- hmyv2_getBlockSigners() : array<string|int, mixed>
- Gets a list of block signer wallet addresses using the specified block number.
- hmyv2_getBlockTransactionCountByHash() : number
- Gets the number of transactions in a block using the specified block hash.
- hmyv2_getBlockTransactionCountByNumber() : number
- Gets the number of transactions in a block using the specified block number.
- hmyv2_getCirculatingSupply() : int
- Get the current circulating supply of tokens in ONE
- hmyv2_getCode() : string
- This method can be used to distinguish between contract addresses and wallet addresses.
- hmyv2_getCurrentBadBlocks() : array<string|int, mixed>
- Gets a list of bad blocks in node memory
- hmyv2_getCurrentStakingErrorSink() : array<string|int, mixed>
- Retrieves a list of transaction errors currently in the staking error sink
- hmyv2_getCurrentTransactionErrorSink() : array<string|int, mixed>
- Retrieves a list of transaction errors currently in the transaction error sink
- hmyv2_getCurrentUtilityMetrics() : array<string|int, mixed>
- Retrieves the current utility metrics
- hmyv2_getCXReceiptByHash() : array<string|int, mixed>
- Query the CX receipt hash on the receiving shard endpoint
- hmyv2_getDelegationsByDelegator() : array<string|int, mixed>
- Get delegations by delegator address
- hmyv2_getDelegationsByDelegatorByBlockNumber() : array<string|int, mixed>
- Get delegations using delegator address and block number
- hmyv2_getDelegationsByValidator() : mixed
- Get delegations using validator address
- hmyv2_getElectedValidatorAddresses() : array<string|int, mixed>
- Get all elected Validator addresses
- hmyv2_getEpoch() : int
- Get the current epoch
- hmyv2_getHeaderByNumber() : array<string|int, mixed>
- Gets the block header data for the specified block number.
- hmyv2_getLastCrossLinks() : array<string|int, mixed>
- Get the current information on the last crosslinks
- hmyv2_getLatestChainHeaders() : array<string|int, mixed>
- Gets a list of the latest beacon chain headers and their related information.
- hmyv2_getLeader() : string
- Get the wallet address of current leader
- hmyv2_getMedianRawStakeSnapshot() : array<string|int, mixed>
- Retrieves the median raw stake snapshot
- hmyv2_getNodeMetadata() : array<string|int, mixed>
- Gets the current node metadata.
- hmyv2_getPendingCXReceipts() : array<string|int, mixed>
- Retrieves a list of currently pending cross shard transaction receipts
- hmyv2_getPoolStats() : array<string|int, mixed>
- Retrieves current transaction pool stats
- hmyv2_getShardingStructure() : array<string|int, mixed>
- Get a list of all shards and their information
- hmyv2_getStakingNetworkInfo() : array<string|int, mixed>
- Retrieves current network staking information
- hmyv2_getStakingTransactionByBlockHashAndIndex() : array<string|int, mixed>
- Use this API call to retrieve a staking transaction info using block hash and transaction index
- hmyv2_getStakingTransactionByBlockNumberAndIndex() : array<string|int, mixed>
- Use this API call to retrieve a staking transaction info using block number and transaction index
- hmyv2_getStakingTransactionByHash() : array<string|int, mixed>
- Use this API call to retrieve a staking transaction info using the staking transaction hash (stkhash is validated in boot.php)
- hmyv2_getStakingTransactionsCount() : number
- Gets the number of staking transactions for the specified ONE wallet address.
- hmyv2_getStakingTransactionsHistory() : string
- Gets staking transactions history for a specified ONE wallet.
- hmyv2_getStorageAt() : string
- Returns the value from a storage position at a given address, or in other words, returns the state of the contract's storage, which may not be exposed via the contract's methods.
- hmyv2_getSuperCommittees() : array<string|int, mixed>
- Retrieves current super committee information
- hmyv2_getTotalSupply() : int
- Get the total number of pre-mined tokens
- hmyv2_getTransactionByBlockHashAndIndex() : array<string|int, mixed>
- Use this API call to retrieve transaction info using block hash and transaction index (blockhash is validated in boot.php)
- hmyv2_getTransactionByBlockNumberAndIndex() : array<string|int, mixed>
- Use this API call to retrieve transaction info using block number and transaction index
- hmyv2_getTransactionByHash() : array<string|int, mixed>
- Use this API call to retrieve transaction info using the transaction hash
- hmyv2_getTransactionReceipt() : array<string|int, mixed>
- Use this API call to retrieve transaction info using the transaction hash
- hmyv2_getTransactionsCount() : number
- Gets the number of transactions for the specified ONE wallet address.
- hmyv2_getTransactionsHistory() : string
- Gets transactions history for a specified ONE wallet.
- hmyv2_getValidatorInformation() : array<string|int, mixed>
- Get all information for a validator
- hmyv2_getValidatorKeys() : array<string|int, mixed>
- Get validator information from epoch number
- hmyv2_getValidators() : array<string|int, mixed>
- Get validator information from epoch number
- hmyv2_isBlockSigner() : booleen
- Gets whether specified ONE address is a block signer for a specified block number.
- hmyv2_latestHeader() : array<string|int, mixed>
- Gets the current blockchain header information.
- hmyv2_pendingStakingTransactions() : array<string|int, mixed>
- Retrieves a list of currently pending staking transactions
- hmyv2_pendingTransactions() : array<string|int, mixed>
- Retrieves a list of currently pending transactions
- hmyv2_protocolVersion() : number
- Gets the current network protocol version.
- hmyv2_resendCx() : bool
- Use this API call to resend the cross shard receipt to the receiving shard to re-process if the transaction did not pay out
- hmyv2_sendRawStakingTransaction() : string
- Send a raw staking transaction using the hex representation of a signed staking transaction
- hmyv2_sendRawTransaction() : string
- Send a raw transaction using the hex representation of a signed transaction
- net_peerCount() : number
- Gets the current number of peers on the network in the form of a hex string.
- phph1_reset() : booleen
- phph1_reset() resets all dynamic class information after a request has been finished.
- val_blockhash() : booleen
- Validates a block hash
- val_blocknum() : booleen
- Validates a block number
- val_call() : booleen
- val_call() Validates user input for hmyv2_call()
- val_cxtxhash() : booleen
- Validates a cross shard transaction hash
- val_epoch() : booleen
- Validates an epoch
- val_epochLastBlock() : booleen
- Validate input for hmyv2_epochLastBlock
- val_estimateGas() : booleen
- val_estimateGas() Validates the user input for hmyv2_estimateGas()
- val_ethaddr() : booleen
- Validates an ETH wallet address
- val_getAllValidatorInformation() : int
- Validation function for hmyv2_getAllValidatorInformation()
- val_getAllValidatorInformationByBlockNumber() : int
- Validation function for hmyv2_getAllValidatorInformationByBlockNumber
- val_getBalance() : number
- Validate input for hmyv2_getBalance
- val_getBalanceByBlockNumber() : number
- Validate input for hmyv2_getBalanceByBlockNumber
- val_getBlockByHash() : booleen
- Validates the input data for hmyv2_getBlockByHash()
- val_getBlockByNumber() : booleen
- Validates the input data for hmyv2_getBlockByNumber().
- val_getBlocks() : booleen
- Validates the input for hmyv2_getBlocks().
- val_getBlockSignerKeys() : booleen
- Validates the input data for hmyv2_getBlockSignerKeys().
- val_getBlockSigners() : booleen
- Validates the input data for hmyv2_getBlockSigners()
- val_getBlockTransactionCountByHash() : booleen
- Validates the input data for hmyv2_getBlockTransactionCountByHash()
- val_getBlockTransactionCountByNumber() : booleen
- Validates the input data for hmyv2_getBlockTransactionCountByNumber().
- val_getCode() : string
- Validates hmyv2_getCode input
- val_getCXReceiptByHash() : booleen
- Validate the CX receipt transaction hash input for hmyv2_getCXReceiptByHash
- val_getDelegationsByDelegator() : booleen
- Validation function for hmyv2_getDelegationsByDelegator()
- val_getDelegationsByDelegatorByBlockNumber() : int
- Validation function for hmyv2_getDelegationsByDelegatorByBlockNumber()
- val_getDelegationsByValidator() : int
- Validation function for hmyv2_getDelegationsByValidator()
- val_getHeaderByNumber() : booleen
- Validates the input data for hmyv2_getHeaderByNumber()
- val_getStakingTransactionByBlockHashAndIndex() : booleen
- Validate input for hmyv2_getStakingTransactionByBlockHashAndIndex (blockhash is validated in boot.php)
- val_getStakingTransactionByBlockNumberAndIndex() : booleen
- Validate input for val_getStakingTransactionByBlockNumberAndIndex (blocknum is validated in boot.php)
- val_getStakingTransactionByHash() : booleen
- Validate input for hmyv2_getStakingTransactionByHash
- val_getStakingTransactionsCount() : booleen
- Validates the input for hmyv2_getStakingTransactionsCount().
- val_getStakingTransactionsHistory() : booleen
- Validates the input data for hmyv2_getStakingTransactionsHistory().
- val_getStorageAt() : booleen
- Validation function for hmyv2_getStorageAt()
- val_getTransactionByBlockHashAndIndex() : booleen
- Validate input for val_getTransactionByBlockHashAndIndex (blockhash is validated in boot.php)
- val_getTransactionByBlockNumberAndIndex() : booleen
- Validate input for hmyv2_getTransactionByBlockNumberAndIndex (blocknum is validated in boot.php)
- val_getTransactionByHash() : booleen
- Validate input for hmyv2_getTransactionByHash
- val_getTransactionReceipt() : booleen
- Validate input for hmyv2_getTransactionReceipt
- val_getTransactionsCount() : booleen
- Validates the input for hmyv2_getTransactionsCount().
- val_getTransactionsHistory() : booleen
- Validates the input data for hmyv2_getTransactionsHistory().
- val_getValidatorInformation() : int
- Validation function for hmyv2_getValidatorInformation
- val_getValidatorKeys() : booleen
- Validate input for hmyv2_getValidatorKeys
- val_getValidators() : booleen
- Validate input for hmyv2_getValidators
- val_hash() : booleen
- Validates a hash
- val_isBlockSigner() : booleen
- Validation for hmyv2_isBlockSigner
- val_oneaddr() : booleen
- Validates a ONE wallet address
- val_resendCx() : booleen
- Validate the cross transaction receipt transaction hash input for hmyv2_resendCx
- val_scaddress() : booleen
- Validates a smart contract address
- val_sendRawStakingTransaction() : booleen
- Validate input for hmyv2_sendRawStakingTransaction
- val_sendRawTransaction() : booleen
- Validate input for hmyv2_sendRawTransaction
- val_stlocation() : booleen
- Validates storage location
- val_txindex() : booleen
- Validates transaction index
Properties
$apiaddr
private
string
$apiaddr
The API address being used during this session. It is set during __construct by applying the $network and $shard inputs to the function getapiaddr(). It is set during __construct
$default_pagesize
private
int
$default_pagesize
Sets the default page size for methods that output multiple pages of data. It is set during __construct
$errors
private
array<string|int, mixed>
$errors
= array()
An array of errors generated when creating the class handle and validating method inputs. This is later used to output any errors to the explorer method output page.
$max_pagesize
private
int
$max_pagesize
Sets the maximum page size a multi-paged method output can output. This is mostly used to prevent a call from a user asking for a huge page size which could slow things down due to memory and network usage
$network
private
string
$network
This sets the network currently being used for the API calls during __construct and is one from the $phph1_apiaddresses array set in config.php. example "mainnet"
$phph1_apiaddresses
private
array<string|int, mixed>
$phph1_apiaddresses
This is set during _construct when the class is invoked and is defined in config.php. This is a multi-dimensional array that holds the node and shard information.
$shard
private
int
$shard
Methods
__construct()
The __construct function is used to set PHPH1 configurations settings when invoking the class. The parameters are all REQUIRED when invoking the class
public
__construct(array<string|int, mixed> $phph1_apiaddresses, int $max_pagesize, int $default_pagesize, string $network, int $shard) : void
Parameters
- $phph1_apiaddresses : array<string|int, mixed>
-
This is set in config.php and is an array of arrays, each array item is the network "name" such as "mainnet" and is an array itself of addresses used as shards for that network. For example $phph1_apiaddresses['mainnet'][0] would be an address for shard 0 on the mainnet network.
- $max_pagesize : int
-
This sets the maximum number of return items per page on API calls that return multiple pages of data in the explorer or your project. This is helpful in preventing huge return data sets which could present a heavy load on the web server or the web servers data throughput.
- $default_pagesize : int
-
This sets the default page size for API calls that return pages of data. This is helpful in the Explorer and can also be used in your project when not using the explorer.
- $network : string
-
This sets the network currently being used for the API calls and is one from the $phph1_apiaddresses array set in config.php. example "mainnet"
- $shard : int
-
This is the index number of the shard from the $network array. The shard MUST be defined in the config.php $phph1_apiaddresses array. example: If 'mainnet' were selected for $network above and we wanted to use chard 0, the value for this would be 0.
Return values
void —convert_atto()
Converts numbers in atto to decimal
public
convert_atto(mixed $attonum) : number
Parameters
- $attonum : mixed
Return values
number —The converted atto number in decimal format
docurlrequest()
docurlrequest() takes the generated json request for the current method from genjsonrequest() and makes the call to the API RPC Node. If rpc_call is set to 0, it generates a data object for output.
public
docurlrequest(string $thisjson) : object
If rpc_call is set to 1, it returns the raw json output from API RPC Node.
Parameters
- $thisjson : string
-
The JSON API request generated by genjsonrequest()
Return values
object —An object containing the output data
genjsonrequest()
genjsonrequest() is used by the method functions to generate the JSON request for the Node API host
public
genjsonrequest(string $method, array<string|int, mixed> $paramsarr) : string
Parameters
- $method : string
-
The method being used in this request. example: hmyv2_getBalance
- $paramsarr : array<string|int, mixed>
-
This is an array of the parameters for the method being called. It is formatted in each method function in this class
Return values
string —The formatted json data for this method request
get_apiaddr()
get_apiaddr() is used to get the currently used Node API address The API address is set during _construct using the supplied network and shard information
public
get_apiaddr() : string
Return values
string —The API address currently being used (example: https://a.api.s0.t.hmny.io/)
get_errors()
get_errors() is used to get the current array of errors from method requests The error array is generated during the validation of method inputs
public
get_errors() : array<string|int, mixed>
Return values
array<string|int, mixed> —A list of errors from the currently run method
get_sessionnetwork()
get_sessionnetwork() is used to get the current network we are working on The network is set when creating a class handle in _construct and the settings are found in config.php
public
get_sessionnetwork() : string
Return values
string —The current network name the class is using (example: mainnet)
get_sessionshard()
get_sessionshard() is used to get the current network shard we are working on The network shard is set when creating a class handle in _construct and the settings array is found in config.php
public
get_sessionshard() : string
Return values
string —The current network shard the class is using (example: 0)
getapiaddr()
getapiaddr() is used to set the Node API host address during __construct. It gets the address using the network name and shard from $phph1_apiaddresses which is also set during __construct using settings from config.php
public
getapiaddr(string $network, number $shard, mixed $phph1_apiaddresses) : string
Parameters
- $network : string
-
The network name from the $phph1_apiaddresses array, default is mainnet
- $shard : number
-
The network shard for the network we will be using, default is shard 0
- $phph1_apiaddresses : mixed
Return values
string —The URL for the API Node that was selected
hmyv2_blockNumber()
Get the current block number
public
hmyv2_blockNumber() : int
See Explorer Method Page or Harmony API Documentation for output details.
Return values
int —Current block number.
hmyv2_call()
hmyv2_call() Executes a new message call immediately, without creating a transaction on the block chain. The hmyv2_call method can be used to query internal contract state, to execute validations coded into a contract or even to test what the effect of a transaction would be without running it live.
public
hmyv2_call(string $scaddress, string $from, string $gas, string $gasprice, string $value, string $data, number $blocknum) : string
See Explorer method page or Harmony API Documentation for output details.
Parameters
- $scaddress : string
-
The ETH address the transaction was sent to
- $from : string
-
The ETH address the transaction was sent from (optional)
- $gas : string
-
Gas to execute the smart contract call (optional)
- $gasprice : string
-
Gas price to execute smart contract call (optional)
- $value : string
-
Value sent with the smart contract call (optional)
- $data : string
-
Hash of smart contract method and parameters (optional)
- $blocknum : number
-
Block number
Return values
string —Return value of the executed smart contract.
hmyv2_epochLastBlock()
Get the last block for a specified epoch
public
hmyv2_epochLastBlock(int $epoch) : int
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $epoch : int
-
Epoch number
Return values
int —Last block of the given epoch
hmyv2_estimateGas()
hmyv2_estimateGas() Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
public
hmyv2_estimateGas(string $toaddr, string $from, string $gas, string $gasprice, string $value, string $data) : string
See Explorer method page or Harmony API Documentation for output details.
Parameters
- $toaddr : string
-
The ETH wallet address the transaction would be sent to (required)
- $from : string
-
The ETH wallet address the transaction would be sent from (optional)
- $gas : string
-
Gas to execute the transaction (optional)
- $gasprice : string
-
Gas price to execute the transaction (optional)
- $value : string
-
Value sent with the transaction (optional)
- $data : string
-
Hash of transaction method and parameters (optional)
Return values
string —Hex value of estimated gas price for the transaction.
hmyv2_gasPrice()
Gets the current average gas price of transactions
public
hmyv2_gasPrice() : int
See Explorer Method Page or Harmony API Documentation for output details.
Return values
int —Current average gas price of transactions.
hmyv2_getAllValidatorAddresses()
Gets a list of wallet addresses that have created validators on the network.
public
hmyv2_getAllValidatorAddresses() : array<string|int, mixed>
See Explorer method page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —List of wallet addresses that have created validators on the network.
hmyv2_getAllValidatorInformation()
Gets all information for all validators.
public
hmyv2_getAllValidatorInformation(number $pagenum) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $pagenum : number
-
Page to request (page size is 100), -1 for all validators (needs to be added to explorer)
Return values
array<string|int, mixed> —List of all validator detailed information.
hmyv2_getAllValidatorInformationByBlockNumber()
Get all validator information by block number
public
hmyv2_getAllValidatorInformationByBlockNumber(int $pagenum, number $blocknum) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $pagenum : int
- $blocknum : number
-
Block number
Return values
array<string|int, mixed> —List of all validator detailed information.
hmyv2_getBalance()
Gets the current balance in atto for the specified wallet
public
hmyv2_getBalance(string $oneaddr) : number
Parameters
- $oneaddr : string
-
The ONE address of the wallet
Return values
number —Current wallet balance in atto. See Explorer Method Page or Harmony API Documentation for output details.
hmyv2_getBalanceByBlockNumber()
Gets the current balance in atto for the specified wallet at the specified block number
public
hmyv2_getBalanceByBlockNumber(string $oneaddr, number $blocknum) : number
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $blocknum : number
-
The block number to get the wallet balance from
Return values
number —Current wallet balance in atto. See Explorer Method Page or Harmony API Documentation for output details.
hmyv2_getBlockByHash()
Gets block information using the specified block hash.
public
hmyv2_getBlockByHash(string $blockhash, booleen $fulltx, booleen $incltx, booleen $withsigners, booleen $inclstaking) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blockhash : string
-
Block hash
- $fulltx : booleen
-
Include full transaction data
- $incltx : booleen
-
Include regular transactions
- $withsigners : booleen
-
Block hash
- $inclstaking : booleen
-
Include staking transactions
Return values
array<string|int, mixed> —Block information.
hmyv2_getBlockByNumber()
Gets block information using the specified block number.
public
hmyv2_getBlockByNumber(int $blocknum, mixed $fulltx, booleen $incltx, booleen $withsigners, booleen $inclstaking) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : int
-
Block number
- $fulltx : mixed
- $incltx : booleen
-
Include regular transactions
- $withsigners : booleen
-
Include the block signers information
- $inclstaking : booleen
-
Include staking transactions
Return values
array<string|int, mixed> —The block information
hmyv2_getBlocks()
Gets block information on a series of blocks between two block numbers.
public
hmyv2_getBlocks(mixed $blocknum, mixed $blocknum2, booleen $fulltx, booleen $withsigners, booleen $inclstaking) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : mixed
- $blocknum2 : mixed
- $fulltx : booleen
-
Include full transaction data
- $withsigners : booleen
-
Include the block signers information
- $inclstaking : booleen
-
Include staking transactions
Return values
array<string|int, mixed> —List of blocks and the information for each block searched
hmyv2_getBlockSignerKeys()
Gets block signer BLS keys using the specified block number.
public
hmyv2_getBlockSignerKeys(string $blocknum) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : string
-
Block number
Return values
array<string|int, mixed> —List of block signer public BLS keys.
hmyv2_getBlockSigners()
Gets a list of block signer wallet addresses using the specified block number.
public
hmyv2_getBlockSigners(mixed $blocknum) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : mixed
Return values
array<string|int, mixed> —List of block signer wallet addresses.
hmyv2_getBlockTransactionCountByHash()
Gets the number of transactions in a block using the specified block hash.
public
hmyv2_getBlockTransactionCountByHash(string $blockhash) : number
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blockhash : string
-
Block hash
Return values
number —Number of transactions in the block
hmyv2_getBlockTransactionCountByNumber()
Gets the number of transactions in a block using the specified block number.
public
hmyv2_getBlockTransactionCountByNumber(string $blocknum) : number
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : string
-
Block number
Return values
number —Number of transactions in the block
hmyv2_getCirculatingSupply()
Get the current circulating supply of tokens in ONE
public
hmyv2_getCirculatingSupply() : int
See Explorer Method Page or Harmony API Documentation for output details.
Return values
int —Circulation supply of tokens in ONE.
hmyv2_getCode()
This method can be used to distinguish between contract addresses and wallet addresses.
public
hmyv2_getCode(string $scaddress, int $blocknum) : string
Will return contract code if it's a contract and nothing (0x) if it's a wallet
See Explorer method page or Harmony API Documentation for output details.
Parameters
- $scaddress : string
-
Smart contract address
- $blocknum : int
-
Block number
Return values
string —Return value of the executed smart contract.
hmyv2_getCurrentBadBlocks()
Gets a list of bad blocks in node memory
public
hmyv2_getCurrentBadBlocks() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details. NOTE: This method currently has known issues with the RPC not returning correctly.
Return values
array<string|int, mixed> —List of bad blocks in node memory
hmyv2_getCurrentStakingErrorSink()
Retrieves a list of transaction errors currently in the staking error sink
public
hmyv2_getCurrentStakingErrorSink() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of current transaction errors in the staking error sink.
hmyv2_getCurrentTransactionErrorSink()
Retrieves a list of transaction errors currently in the transaction error sink
public
hmyv2_getCurrentTransactionErrorSink() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of current errors in the transaction error sink.
hmyv2_getCurrentUtilityMetrics()
Retrieves the current utility metrics
public
hmyv2_getCurrentUtilityMetrics() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of current utility metrics.
hmyv2_getCXReceiptByHash()
Query the CX receipt hash on the receiving shard endpoint
public
hmyv2_getCXReceiptByHash(mixed $txhash) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $txhash : mixed
Return values
array<string|int, mixed> —hmyv2_getDelegationsByDelegator()
Get delegations by delegator address
public
hmyv2_getDelegationsByDelegator(string $deladdr) : array<string|int, mixed>
See Explorer method page or Harmony API Documentation for output details.
Parameters
- $deladdr : string
-
Delegator address
Return values
array<string|int, mixed> —hmyv2_getDelegationsByDelegatorByBlockNumber()
Get delegations using delegator address and block number
public
hmyv2_getDelegationsByDelegatorByBlockNumber(mixed $oneaddr, string $blocknum) : array<string|int, mixed>
See Explorer method page or Harmony API Documentation for output details.
Parameters
- $oneaddr : mixed
- $blocknum : string
-
Block Number
Return values
array<string|int, mixed> —hmyv2_getDelegationsByValidator()
Get delegations using validator address
public
hmyv2_getDelegationsByValidator(string $oneaddr) : mixed
See Explorer method page or Harmony API Documentation for output details.
Parameters
- $oneaddr : string
-
Validator wallet address. This is validated in boot.php
$return array List of delegations for the provided validator address
Return values
mixed —hmyv2_getElectedValidatorAddresses()
Get all elected Validator addresses
public
hmyv2_getElectedValidatorAddresses() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —List of wallet addresses that are currently elected.
hmyv2_getEpoch()
Get the current epoch
public
hmyv2_getEpoch() : int
See Explorer Method Page or Harmony API Documentation for output details.
Return values
int —The current epoch.
hmyv2_getHeaderByNumber()
Gets the block header data for the specified block number.
public
hmyv2_getHeaderByNumber(string $blocknum) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : string
-
Block number
Return values
array<string|int, mixed> —Block header data
hmyv2_getLastCrossLinks()
Get the current information on the last crosslinks
public
hmyv2_getLastCrossLinks() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —current information on the last crosslinks.
hmyv2_getLatestChainHeaders()
Gets a list of the latest beacon chain headers and their related information.
public
hmyv2_getLatestChainHeaders() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Chain header data
hmyv2_getLeader()
Get the wallet address of current leader
public
hmyv2_getLeader() : string
See Explorer Method Page or Harmony API Documentation for output details.
Return values
string —Wallet address of current leader.
hmyv2_getMedianRawStakeSnapshot()
Retrieves the median raw stake snapshot
public
hmyv2_getMedianRawStakeSnapshot() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of current utility metrics.
hmyv2_getNodeMetadata()
Gets the current node metadata.
public
hmyv2_getNodeMetadata() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —List of bad blocks in node memory
hmyv2_getPendingCXReceipts()
Retrieves a list of currently pending cross shard transaction receipts
public
hmyv2_getPendingCXReceipts() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of currently pending cross shard transaction receipts.
hmyv2_getPoolStats()
Retrieves current transaction pool stats
public
hmyv2_getPoolStats() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of current transaction pool stats.
hmyv2_getShardingStructure()
Get a list of all shards and their information
public
hmyv2_getShardingStructure() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Current shards on the network and their information.
hmyv2_getStakingNetworkInfo()
Retrieves current network staking information
public
hmyv2_getStakingNetworkInfo() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of current utility metrics.
hmyv2_getStakingTransactionByBlockHashAndIndex()
Use this API call to retrieve a staking transaction info using block hash and transaction index
public
hmyv2_getStakingTransactionByBlockHashAndIndex(string $blockhash, int $txindex) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blockhash : string
-
Block number
- $txindex : int
-
Staking transaction index
Return values
array<string|int, mixed> —hmyv2_getStakingTransactionByBlockNumberAndIndex()
Use this API call to retrieve a staking transaction info using block number and transaction index
public
hmyv2_getStakingTransactionByBlockNumberAndIndex(int $blocknum, int $txindex) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : int
-
Block number
- $txindex : int
-
Staking transaction index
Return values
array<string|int, mixed> —hmyv2_getStakingTransactionByHash()
Use this API call to retrieve a staking transaction info using the staking transaction hash (stkhash is validated in boot.php)
public
hmyv2_getStakingTransactionByHash(string $hash) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $hash : string
-
Staking transaction hash
Return values
array<string|int, mixed> —hmyv2_getStakingTransactionsCount()
Gets the number of staking transactions for the specified ONE wallet address.
public
hmyv2_getStakingTransactionsCount(string $oneaddr, string $txtype) : number
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $txtype : string
-
The transaction type to count (ALL, SENT, RECEIVED)
Return values
number —Number of staking transactions.
hmyv2_getStakingTransactionsHistory()
Gets staking transactions history for a specified ONE wallet.
public
hmyv2_getStakingTransactionsHistory(string $oneaddr, number $pagenum, number $pagesize, booleen $fulltx, string $txtype, string $order) : string
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $pagenum : number
-
Which page of transactions to retrieve
- $pagesize : number
-
Number of transactions per page
- $fulltx : booleen
-
return full transaction data or just transaction hashes
- $txtype : string
-
Which type of transactions to display (ALL, RECEIVED, or SENT)
- $order : string
-
Sort transactions in ascending or descending order based on timestamp (ASC or DESC)
Return values
string —List of transaction hashes
hmyv2_getStorageAt()
Returns the value from a storage position at a given address, or in other words, returns the state of the contract's storage, which may not be exposed via the contract's methods.
public
hmyv2_getStorageAt(string $scaddress, string $stlocation, number $blocknum) : string
See Explorer method page or Harmony API Documentation for output details.
Parameters
- $scaddress : string
-
Smart contract address
- $stlocation : string
-
Hex representation of storage location
- $blocknum : number
-
Block number
Return values
string —Data stored at the smart contract location.
hmyv2_getSuperCommittees()
Retrieves current super committee information
public
hmyv2_getSuperCommittees() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of current utility metrics.
hmyv2_getTotalSupply()
Get the total number of pre-mined tokens
public
hmyv2_getTotalSupply() : int
See Explorer Method Page or Harmony API Documentation for output details.
Return values
int —Total number of pre-mined tokens.
hmyv2_getTransactionByBlockHashAndIndex()
Use this API call to retrieve transaction info using block hash and transaction index (blockhash is validated in boot.php)
public
hmyv2_getTransactionByBlockHashAndIndex(mixed $blockhash, int $txindex) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blockhash : mixed
- $txindex : int
-
Staking transaction index
Return values
array<string|int, mixed> —hmyv2_getTransactionByBlockNumberAndIndex()
Use this API call to retrieve transaction info using block number and transaction index
public
hmyv2_getTransactionByBlockNumberAndIndex(int $blocknum, int $txindex) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $blocknum : int
-
Block number
- $txindex : int
-
Transaction index
Return values
array<string|int, mixed> —hmyv2_getTransactionByHash()
Use this API call to retrieve transaction info using the transaction hash
public
hmyv2_getTransactionByHash(string $hash) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $hash : string
-
Transaction hash
Return values
array<string|int, mixed> —hmyv2_getTransactionReceipt()
Use this API call to retrieve transaction info using the transaction hash
public
hmyv2_getTransactionReceipt(mixed $hash) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $hash : mixed
Return values
array<string|int, mixed> —hmyv2_getTransactionsCount()
Gets the number of transactions for the specified ONE wallet address.
public
hmyv2_getTransactionsCount(string $oneaddr[, string $txtype = 'ALL' ]) : number
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $txtype : string = 'ALL'
-
The transaction type to count (ALL, SENT, RECEIVED)
Return values
number —Number of transactions.
hmyv2_getTransactionsHistory()
Gets transactions history for a specified ONE wallet.
public
hmyv2_getTransactionsHistory(string $oneaddr, number $pagenum, number $pagesize, booleen $fulltx, string $txtype, string $order) : string
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $pagenum : number
-
Which page of transactions to retrieve
- $pagesize : number
-
Number of transactions per page
- $fulltx : booleen
-
return full transaction data or just transaction hashes
- $txtype : string
-
Which type of transactions to display (ALL, RECEIVED, or SENT)
- $order : string
-
Sort transactions in ascending or descending order based on timestamp (ASC or DESC)
Return values
string —List of transaction hashes
hmyv2_getValidatorInformation()
Get all information for a validator
public
hmyv2_getValidatorInformation(string $valaddr) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $valaddr : string
-
The validator's wallet address
Return values
array<string|int, mixed> —Array of validator detailed information.
hmyv2_getValidatorKeys()
Get validator information from epoch number
public
hmyv2_getValidatorKeys(int $epoch) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $epoch : int
-
Epoch number (default is epoch 1 or everything)
Return values
array<string|int, mixed> —List of public BLS keys in the elected committee.
hmyv2_getValidators()
Get validator information from epoch number
public
hmyv2_getValidators(int $epoch) : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $epoch : int
-
Epoch number (default is epoch 1 or everything)
Return values
array<string|int, mixed> —Array of validators ONE addresses and some of their information.
hmyv2_isBlockSigner()
Gets whether specified ONE address is a block signer for a specified block number.
public
hmyv2_isBlockSigner(string $oneaddr, number $blocknum) : booleen
See Explorer Method Page for output details.
Parameters
- $oneaddr : string
-
The ONE address of the validator
- $blocknum : number
-
Block number
Return values
booleen —Returns 1 if address is a block signer
hmyv2_latestHeader()
Gets the current blockchain header information.
public
hmyv2_latestHeader() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Current blockchain header information
hmyv2_pendingStakingTransactions()
Retrieves a list of currently pending staking transactions
public
hmyv2_pendingStakingTransactions() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of currently pending staking transactions.
hmyv2_pendingTransactions()
Retrieves a list of currently pending transactions
public
hmyv2_pendingTransactions() : array<string|int, mixed>
See Explorer Method Page or Harmony API Documentation for output details.
Return values
array<string|int, mixed> —Array of currently pending transactions.
hmyv2_protocolVersion()
Gets the current network protocol version.
public
hmyv2_protocolVersion() : number
See Explorer Method Page or Harmony API Documentation for output details.
Return values
number —Protocol version
hmyv2_resendCx()
Use this API call to resend the cross shard receipt to the receiving shard to re-process if the transaction did not pay out
public
hmyv2_resendCx(mixed $txhash) : bool
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $txhash : mixed
Return values
bool —If cross shard receipt was successfully resent (true) or not (false)
hmyv2_sendRawStakingTransaction()
Send a raw staking transaction using the hex representation of a signed staking transaction
public
hmyv2_sendRawStakingTransaction(string $transhex) : string
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $transhex : string
-
Hex representation of signed staking transaction
Return values
string —if successful returns staking transaction hash. If failed it returns an error
hmyv2_sendRawTransaction()
Send a raw transaction using the hex representation of a signed transaction
public
hmyv2_sendRawTransaction(string $transhex) : string
See Explorer Method Page or Harmony API Documentation for output details.
Parameters
- $transhex : string
-
Hex representation of signed staking transaction
Return values
string —if successful returns staking transaction hash. If failed it returns an error
net_peerCount()
Gets the current number of peers on the network in the form of a hex string.
public
net_peerCount() : number
See Explorer Method Page or Harmony API Documentation for output details.
Return values
number —Protocol version in hex
phph1_reset()
phph1_reset() resets all dynamic class information after a request has been finished.
public
phph1_reset() : booleen
This is intended to be used for custom built applications using the class so it can make multiple requests using a single class handle for a single page load
Return values
booleen —1 = success
val_blockhash()
Validates a block hash
public
val_blockhash(mixed $blockhash) : booleen
Parameters
- $blockhash : mixed
Return values
booleen —1 = good address, 0 = bad address
val_blocknum()
Validates a block number
public
val_blocknum(mixed $blocknum) : booleen
Parameters
- $blocknum : mixed
Return values
booleen —1 = good address, 0 = bad address
val_call()
val_call() Validates user input for hmyv2_call()
public
val_call(string $scaddress, mixed $fromaddr, string $gas, string $gasprice, string $value, string $data, number $blocknum) : booleen
Parameters
- $scaddress : string
-
The ETH address the transaction was sent to
- $fromaddr : mixed
- $gas : string
-
Gas to execute the smart contract call (optional)
- $gasprice : string
-
Gas price to execute smart contract call (optional)
- $value : string
-
Value sent with the smart contract call (optional)
- $data : string
-
Hash of smart contract method and parameters (optional)
- $blocknum : number
-
Block number
Return values
booleen —1 = Good input, 0 = bad input
val_cxtxhash()
Validates a cross shard transaction hash
public
val_cxtxhash(string $trhash) : booleen
Parameters
- $trhash : string
-
The cross shard transaction hash
Return values
booleen —1 = good address, 0 = bad address
val_epoch()
Validates an epoch
public
val_epoch(mixed $epoch) : booleen
Parameters
- $epoch : mixed
Return values
booleen —1 = good address, 0 = bad address
val_epochLastBlock()
Validate input for hmyv2_epochLastBlock
public
val_epochLastBlock(int $epoch) : booleen
Parameters
- $epoch : int
-
Epoch number
Return values
booleen —1 = good input, 0 = bad input
val_estimateGas()
val_estimateGas() Validates the user input for hmyv2_estimateGas()
public
val_estimateGas(string $toaddr, mixed $fromaddr, string $gas, string $gasprice, string $value, string $data) : booleen
Parameters
- $toaddr : string
-
The ETH smart contract address the transaction would be sent to
- $fromaddr : mixed
- $gas : string
-
Gas to execute the smart contract call (optional)
- $gasprice : string
-
Gas price to execute smart contract call (optional)
- $value : string
-
Value sent with the smart contract call (optional)
- $data : string
-
Hash of smart contract method and parameters (optional)
Return values
booleen —1 = Good input, 0 = bad input
val_ethaddr()
Validates an ETH wallet address
public
val_ethaddr(mixed $addr) : booleen
Parameters
- $addr : mixed
Return values
booleen —1 = good address, 0 = bad address
val_getAllValidatorInformation()
Validation function for hmyv2_getAllValidatorInformation()
public
val_getAllValidatorInformation(int $pagenum) : int
Parameters
- $pagenum : int
-
Page number to display
Return values
int —good data = 1, bad data = 0
val_getAllValidatorInformationByBlockNumber()
Validation function for hmyv2_getAllValidatorInformationByBlockNumber
public
val_getAllValidatorInformationByBlockNumber(int $pagenum, string $blocknum) : int
Parameters
- $pagenum : int
- $blocknum : string
-
Block number
Return values
int —good data =1, bad data = 0
val_getBalance()
Validate input for hmyv2_getBalance
public
val_getBalance(string $oneaddr) : number
Parameters
- $oneaddr : string
-
The ONE address of the wallet
Return values
number —0 = bad input, 1 = good input
val_getBalanceByBlockNumber()
Validate input for hmyv2_getBalanceByBlockNumber
public
val_getBalanceByBlockNumber(string $oneaddr, string $blocknum) : number
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $blocknum : string
-
Block number
Return values
number —0 = bad input, 1 = good input
val_getBlockByHash()
Validates the input data for hmyv2_getBlockByHash()
public
val_getBlockByHash(string $blockhash, booleen $fulltx, booleen $incltx, booleen $withsigners, booleen $inclstaking) : booleen
Parameters
- $blockhash : string
-
Block hash
- $fulltx : booleen
-
Include full transaction data
- $incltx : booleen
-
Include regular transactions
- $withsigners : booleen
-
Block hash
- $inclstaking : booleen
-
Include staking transactions
Return values
booleen —1 = good data, 0 = bad data
val_getBlockByNumber()
Validates the input data for hmyv2_getBlockByNumber().
public
val_getBlockByNumber(int $blocknum, mixed $fulltx, booleen $incltx, booleen $withsigners, booleen $inclstaking) : booleen
Parameters
- $blocknum : int
-
Block number
- $fulltx : mixed
- $incltx : booleen
-
Include regular transactions
- $withsigners : booleen
-
Include the block signers information
- $inclstaking : booleen
-
Include staking transactions
Return values
booleen —1 = good data, 0 = bad data
val_getBlocks()
Validates the input for hmyv2_getBlocks().
public
val_getBlocks(int $blocknum, mixed $blocknum2, mixed $fulltx, booleen $withsigners, booleen $inclstaking) : booleen
Parameters
- $blocknum : int
-
Starting block number
- $blocknum2 : mixed
- $fulltx : mixed
- $withsigners : booleen
-
Include the block signers information
- $inclstaking : booleen
-
Include staking transactions
Return values
booleen —1 = good data, 0 = bad data
val_getBlockSignerKeys()
Validates the input data for hmyv2_getBlockSignerKeys().
public
val_getBlockSignerKeys(int $blocknum) : booleen
Parameters
- $blocknum : int
-
Block number
Return values
booleen —1 = good data, 0 = bad data
val_getBlockSigners()
Validates the input data for hmyv2_getBlockSigners()
public
val_getBlockSigners(string $blocknum) : booleen
Parameters
- $blocknum : string
-
Block number
Return values
booleen —1 = good data, 0 = bad data
val_getBlockTransactionCountByHash()
Validates the input data for hmyv2_getBlockTransactionCountByHash()
public
val_getBlockTransactionCountByHash(string $blockhash) : booleen
Parameters
- $blockhash : string
-
Block hash
Return values
booleen —1 = good data, 0 = bad data
val_getBlockTransactionCountByNumber()
Validates the input data for hmyv2_getBlockTransactionCountByNumber().
public
val_getBlockTransactionCountByNumber(int $blocknum) : booleen
Parameters
- $blocknum : int
-
Block number
Return values
booleen —1 = good data, 0 = bad data
val_getCode()
Validates hmyv2_getCode input
public
val_getCode(string $scaddress, int $blocknum) : string
Parameters
- $scaddress : string
-
Smart contract address
- $blocknum : int
-
Block number
Return values
string —Return value of the executed smart contract.
val_getCXReceiptByHash()
Validate the CX receipt transaction hash input for hmyv2_getCXReceiptByHash
public
val_getCXReceiptByHash(string $txhash) : booleen
Parameters
- $txhash : string
-
Cross shard receipt transaction hash
Return values
booleen —good input = 1, bad input = 0
val_getDelegationsByDelegator()
Validation function for hmyv2_getDelegationsByDelegator()
public
val_getDelegationsByDelegator(string $oneaddr) : booleen
Parameters
- $oneaddr : string
-
delegate ONE address
Return values
booleen —1 = Good input, 0 = bad input
val_getDelegationsByDelegatorByBlockNumber()
Validation function for hmyv2_getDelegationsByDelegatorByBlockNumber()
public
val_getDelegationsByDelegatorByBlockNumber(string $oneaddr, string $blocknum) : int
Parameters
- $oneaddr : string
-
Delegator address
- $blocknum : string
-
Block Number
Return values
int —good data = 1, bad data = 0
val_getDelegationsByValidator()
Validation function for hmyv2_getDelegationsByValidator()
public
val_getDelegationsByValidator(string $oneaddr) : int
Parameters
- $oneaddr : string
-
Validator address
Return values
int —good data = 1, bad data = 0
val_getHeaderByNumber()
Validates the input data for hmyv2_getHeaderByNumber()
public
val_getHeaderByNumber(string $blocknum) : booleen
Parameters
- $blocknum : string
-
Block number
Return values
booleen —1 = good data, 0 = bad data
val_getStakingTransactionByBlockHashAndIndex()
Validate input for hmyv2_getStakingTransactionByBlockHashAndIndex (blockhash is validated in boot.php)
public
val_getStakingTransactionByBlockHashAndIndex(string $blockhash, string $txindex) : booleen
Parameters
- $blockhash : string
-
Block hash
- $txindex : string
-
Staking transaction index
Return values
booleen —1 = good input, 0 = bad input
val_getStakingTransactionByBlockNumberAndIndex()
Validate input for val_getStakingTransactionByBlockNumberAndIndex (blocknum is validated in boot.php)
public
val_getStakingTransactionByBlockNumberAndIndex(int $blocknum, int $txindex) : booleen
Parameters
- $blocknum : int
-
Block number
- $txindex : int
-
Staking transaction index
Return values
booleen —1 = good input, 0 = bad input
val_getStakingTransactionByHash()
Validate input for hmyv2_getStakingTransactionByHash
public
val_getStakingTransactionByHash(string $hash) : booleen
Parameters
- $hash : string
-
Staking transaction hash
Return values
booleen —1 = good input, 0 = bad input
val_getStakingTransactionsCount()
Validates the input for hmyv2_getStakingTransactionsCount().
public
val_getStakingTransactionsCount(string $oneaddr, string $txtype) : booleen
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $txtype : string
-
The transaction type to count (ALL, SENT, RECEIVED)
Return values
booleen —1 = good input, 0 = bad input
val_getStakingTransactionsHistory()
Validates the input data for hmyv2_getStakingTransactionsHistory().
public
val_getStakingTransactionsHistory(string $oneaddr, number $pagenum, number $pagesize, booleen $fulltx, string $txtype, string $order) : booleen
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $pagenum : number
-
Which page number of transactions to retrieve
- $pagesize : number
-
Number of transactions per page
- $fulltx : booleen
-
return full transaction data or just transaction hashes
- $txtype : string
-
Which type of transactions to display (ALL, RECEIVED, or SENT)
- $order : string
-
Sort transactions in ascending or descending order based on timestamp (ASC or DESC)
Return values
booleen —1 = good input, 0 = bad input
val_getStorageAt()
Validation function for hmyv2_getStorageAt()
public
val_getStorageAt(string $scaddress, string $stlocation, number $blocknum) : booleen
Parameters
- $scaddress : string
-
Smart contract address
- $stlocation : string
-
Hex representation of storage location
- $blocknum : number
-
Block number
Return values
booleen —1 = Good input, 0 = bad input
val_getTransactionByBlockHashAndIndex()
Validate input for val_getTransactionByBlockHashAndIndex (blockhash is validated in boot.php)
public
val_getTransactionByBlockHashAndIndex(string $blockhash, string $txindex) : booleen
Parameters
- $blockhash : string
-
Block hash
- $txindex : string
-
Transaction index
Return values
booleen —1 = good input, 0 = bad input
val_getTransactionByBlockNumberAndIndex()
Validate input for hmyv2_getTransactionByBlockNumberAndIndex (blocknum is validated in boot.php)
public
val_getTransactionByBlockNumberAndIndex(int $blocknum, int $txindex) : booleen
Parameters
- $blocknum : int
-
Block number
- $txindex : int
-
Staking transaction index
Return values
booleen —1 = good input, 0 = bad input
val_getTransactionByHash()
Validate input for hmyv2_getTransactionByHash
public
val_getTransactionByHash(int $hash) : booleen
Parameters
- $hash : int
-
hash
Return values
booleen —1 = good input, 0 = bad input
val_getTransactionReceipt()
Validate input for hmyv2_getTransactionReceipt
public
val_getTransactionReceipt(int $hash) : booleen
Parameters
- $hash : int
-
hash
Return values
booleen —1 = good input, 0 = bad input
val_getTransactionsCount()
Validates the input for hmyv2_getTransactionsCount().
public
val_getTransactionsCount(string $oneaddr, string $txtype) : booleen
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $txtype : string
-
The transaction type to count (ALL, SENT, RECEIVED)
Return values
booleen —1 = good input, 0 = bad input
val_getTransactionsHistory()
Validates the input data for hmyv2_getTransactionsHistory().
public
val_getTransactionsHistory(string $oneaddr, number $pagenum, number $pagesize, booleen $fulltx, string $txtype, string $order) : booleen
Parameters
- $oneaddr : string
-
The ONE address of the wallet
- $pagenum : number
-
Which page of transactions to retrieve
- $pagesize : number
-
Number of transactions per page
- $fulltx : booleen
-
return full transaction data or just transaction hashes
- $txtype : string
-
Which type of transactions to display (ALL, RECEIVED, or SENT)
- $order : string
-
Sort transactions in ascending or descending order based on timestamp (ASC or DESC)
Return values
booleen —1 = good input, 0 = bad input
val_getValidatorInformation()
Validation function for hmyv2_getValidatorInformation
public
val_getValidatorInformation(string $oneaddr) : int
Parameters
- $oneaddr : string
-
The validator's wallet address
Return values
int —good data =1, bad data = 0
val_getValidatorKeys()
Validate input for hmyv2_getValidatorKeys
public
val_getValidatorKeys(int $epoch) : booleen
Parameters
- $epoch : int
-
Epoch number
Return values
booleen —1 = good input, 0 = bad input
val_getValidators()
Validate input for hmyv2_getValidators
public
val_getValidators(int $epoch) : booleen
Parameters
- $epoch : int
-
Epoch number
Return values
booleen —1 = good input, 0 = bad input
val_hash()
Validates a hash
public
val_hash(mixed $hash) : booleen
Parameters
- $hash : mixed
Return values
booleen —1 = good address, 0 = bad address
val_isBlockSigner()
Validation for hmyv2_isBlockSigner
public
val_isBlockSigner(string $oneaddr, number $blocknum) : booleen
Parameters
- $oneaddr : string
-
The ONE address of the validator
- $blocknum : number
-
Block number
Return values
booleen —good data = 1, bad data = 0
val_oneaddr()
Validates a ONE wallet address
public
val_oneaddr(mixed $oneaddr) : booleen
Parameters
- $oneaddr : mixed
Return values
booleen —1 = good address, 0 = bad address
val_resendCx()
Validate the cross transaction receipt transaction hash input for hmyv2_resendCx
public
val_resendCx(string $txhash) : booleen
Parameters
- $txhash : string
-
Cross shard receipt transaction hash
Return values
booleen —good input = 1, bad input = 0
val_scaddress()
Validates a smart contract address
public
val_scaddress(string $scaddress) : booleen
Parameters
- $scaddress : string
-
The smart contract address
Return values
booleen —1 = good address, 0 = bad address
val_sendRawStakingTransaction()
Validate input for hmyv2_sendRawStakingTransaction
public
val_sendRawStakingTransaction(string $transhex) : booleen
Parameters
- $transhex : string
-
Hex representation of signed staking transaction
Return values
booleen —1 = good input, 0 = bad input
val_sendRawTransaction()
Validate input for hmyv2_sendRawTransaction
public
val_sendRawTransaction(string $transhex) : booleen
Parameters
- $transhex : string
-
Hex representation of signed staking transaction
Return values
booleen —1 = good input, 0 = bad input
val_stlocation()
Validates storage location
public
val_stlocation(string $stlocation) : booleen
Parameters
- $stlocation : string
-
The storage location hash
Return values
booleen —1 = good address, 0 = bad address
val_txindex()
Validates transaction index
public
val_txindex(int $txindex) : booleen
Parameters
- $txindex : int
-
The transaction index
Return values
booleen —1 = good transaction index, 0 = bad transaction index