Class for interacting with the network via RPC
__constructor(string $nodeUrl, array $headers = array())| Name | Type | Description | Required |
|---|---|---|---|
$nodeUrl |
string |
Full node url string | Yes |
$headers |
array |
Additional headers | No |
putDeploy(Deploy $deploy): stringPut deploy into the network and returns deploy hash string
| Name | Type | Description | Required |
|---|---|---|---|
$deploy |
Deploy |
Signed Deploy object | Yes |
getDeploy(string $deployHash): DeployReturns a Deploy object by the given deploy hash
| Name | Type | Description | Required |
|---|---|---|---|
$deployHash |
string |
Hex-encoded hash of a deploy | Yes |
getBlockByHash(string $blockHash): BlockReturns a Block object by the given block hash
| Name | Type | Description | Required |
|---|---|---|---|
$blockHash |
string |
Hex-encoded hash of a block | Yes |
getBlockByHeight(int $height): BlockReturns a Block object by the given block height
| Name | Type | Description | Required |
|---|---|---|---|
$height |
int |
Block height | Yes |
getLatestBlock(): BlockReturns a Block object that represents the latest block from the network
getPeers(): arrayReturns a list of Peer objects connected to the node
getStatus(): StatusReturns the current Status of the node
getAuctionState(): AuctionStateReturns AuctionState object that contains the bids and validators as of either if specific block (by height or hash), or the most recently added block
getStateRootHash(string $blockHash): stringReturns state root hash string by the given block hash
| Name | Type | Description | Required |
|---|---|---|---|
$blockHash |
string |
Hex-encoded hash of the block | Yes |
getAccount(string $blockHash, CLPublicKey $publicKey): AccountReturns an Account object by the given block hash and account public key
| Name | Type | Description | Required |
|---|---|---|---|
$blockHash |
string |
Hex-encoded hash of the block | Yes |
$publicKey |
CLPublicKey |
Public key object | Yes |
getAccountBalance(string $stateRootHash, CLURef $balanceUref): \GMPReturns purse's balance from the network
| Name | Type | Description | Required |
|---|---|---|---|
$stateRootHash |
string |
Hex-encoded hash of the state root | Yes |
$balanceUref |
CLURef |
Balance URef object | Yes |
queryBalance(
string $purseIdentifierType,
string $purseIdentifier,
string $stateRootHash = null
): \GMPReturns a purse’s balance from global state at a given Block or state root hash.
| Name | Type | Description | Required |
|---|---|---|---|
$purseIdentifierType |
string |
Purse identifier type. Available values: purse_uref, main_purse_under_public_key, main_purse_under_account_hash |
Yes |
$purseIdentifier |
string |
Purse identifier | Yes |
$stateRootHash |
string |
Hex-encoded hash of the state root | No |
getAccountBalanceUrefByAccountHash(string $stateRootHash, CLAccountHash $accountHash): CLURefReturns an account balance URef by the given state root hash and account hash
| Name | Type | Description | Required |
|---|---|---|---|
$stateRootHash |
string |
Hex-encoded hash of the state root | Yes |
$accountHash |
CLAccountHash |
Account hash object | Yes |
getAccountBalanceUrefByPublicKey(string $stateRootHsh, CLPublicKey $publicKey): CLURefReturns an account balance CLURef by the given state root hash and public key
| Name | Type | Description | Required |
|---|---|---|---|
$stateRootHash |
string |
Hex-encoded hash of the state root | Yes |
$publicKey |
CLPublicKey |
Public key object | Yes |
getBlockState(string $stateRootHash, string $key, array $path = []): StoredValueReturns StoredValue object by state root hash, key and path
| Name | Type | Description | Required |
|---|---|---|---|
$stateRootHash |
string |
Hex-encoded hash of the state root | Yes |
$key |
string |
casper_types::Key as formatted string |
Yes |
$path |
array |
The path components starting from the key as base. | No |
getBlockTransfers(string $blockHash = null): arrayReturns a list of Transfer objects for the block from the network by the given block hash
| Name | Type | Description | Required |
|---|---|---|---|
$blockHash |
string |
Hex-encoded hash of the block | No |
getEraSummaryBySwitchBlockHash(string $blockHash): ?EraSummaryReturns an EraSummary object or null by the given block hash
| Name | Type | Description | Required |
|---|---|---|---|
$blockHash |
string |
Hex-encoded hash of the block | Yes |
getEraSummaryBySwitchBlockHeight(int $height): ?EraSummaryReturns an EraSummary object or null by the given block height
| Name | Type | Description | Required |
|---|---|---|---|
$height |
int |
Block height | Yes |
getDictionaryItemByURef(
string $stateRootHash,
string $dictionaryItemKey,
string $seedUref
): StoredValueReturns an item from a Dictionary (StoredValue object) by the given state root hash, dictionary item key and seed URef
| Name | Type | Description | Required |
|---|---|---|---|
$stateRootHash |
string |
Hex-encoded hash of the state root | Yes |
$dictionaryItemKey |
string |
The dictionary item key formatted as a string | Yes |
$seedUref |
string |
The dictionary's seed URef | Yes |
getGlobalStateByBlock(
string $blockHash,
string $key,
array $path
): GlobalStateReturns an GlobalState object by the given block hash and key
| Name | Type | Description | Required |
|---|---|---|---|
$blockHash |
string |
Hex-encoded hash of the block | Yes |
$key |
string |
casper_types::Key as formatted string |
Yes |
$path |
array |
The path components starting from the key as base | No |
getGlobalStateByStateRootHash(
string $stateRootHash,
string $key,
array $path
): GlobalStateReturns an GlobalState object by the given state root hash and key
| Name | Type | Description | Required |
|---|---|---|---|
$stateRootHash |
string |
Hex-encoded hash of the state root | Yes |
$key |
string |
casper_types::Key as formatted string |
Yes |
$path |
array |
The path components starting from the key as base | No |
getChainspecInfo(): ChainspecRegistryBytesReturns a ChainspecRegistryBytes object
speculativeExecution(Deploy $signedDeploy, string $blockHash): DeployExecutionResultPuts a Deploy to a single node for speculative execution on that node only.
| Name | Type | Description | Required |
|---|---|---|---|
$signedDeploy |
Deploy |
Signed Deploy object | Yes |
$blockHash |
string |
Hex-encoded hash of the block | Yes |