Class for interacting with the network via RPC
__constructor(string $nodeUrl)
Name | Type | Description | Required |
---|---|---|---|
$nodeUrl |
string |
Full node url string | Yes |
putDeploy(Deploy $deploy): string
Put deploy into the network and returns deploy hash string
Name | Type | Description | Required |
---|---|---|---|
$deploy |
Deploy |
Signed Deploy object | Yes |
getDeploy(string $deployHash): Deploy
Returns a Deploy object by the given deploy hash
Name | Type | Description | Required |
---|---|---|---|
$deployHash |
string |
Hex-encoded hash of a deploy | Yes |
getBlockByHash(string $blockHash): Block
Returns a Block object by the given block hash
Name | Type | Description | Required |
---|---|---|---|
$blockHash |
string |
Hex-encoded hash of a block | Yes |
getBlockByHeight(int $height): Block
Returns a Block object by the given block height
Name | Type | Description | Required |
---|---|---|---|
$height |
int |
Block height | Yes |
getLatestBlock(): Block
Returns a Block object that represents the latest block from the network
getPeers(): array
Returns a list of Peer objects connected to the node
getStatus(): Status
Returns the current Status of the node
getAuctionState(): AuctionState
Returns 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): string
Returns 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): Account
Returns 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): \GMP
Returns 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
): \GMP
Returns 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): CLURef
Returns 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): CLURef
Returns 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 = []): StoredValue
Returns 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): array
Returns 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): ?EraSummary
Returns 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): ?EraSummary
Returns 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
): StoredValue
Returns 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
): GlobalState
Returns 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
): GlobalState
Returns 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(): ChainspecRegistryBytes
Returns a ChainspecRegistryBytes object
speculativeExecution(Deploy $signedDeploy, string $blockHash): DeployExecutionResult
Puts 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 |