diff --git a/README.md b/README.md index 4608351..95d0a96 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ $latestBlockHash = $latestBlock->getHash(); - [getEraSummaryBySwitchBlockHash](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-hash) - [getEraSummaryBySwitchBlockHeight](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-height) - [getDictionaryItemByURef](docs/API/RpcClientAPI.md#Get-dictionary-item) +- [getGlobalStateByBlock](docs/API/RpcClientAPI.md#Get-global-state-by-block) +- [getGlobalStateByStateRootHash](docs/API/RpcClientAPI.md#Get-global-state-by-state-root-hash) ### DeployService - [makeDeploy](docs/API/DeployServiceAPI.md#Make-deploy) diff --git a/docs/API/RpcClientAPI.md b/docs/API/RpcClientAPI.md index 1cf9990..dd21450 100644 --- a/docs/API/RpcClientAPI.md +++ b/docs/API/RpcClientAPI.md @@ -206,9 +206,9 @@ Returns an item from a Dictionary ([StoredValue](../Entity/StoredValue.md) objec | `$seedUref` | `string` | The dictionary's seed URef | Yes | --- -## Get global state +## Get global state by block ```php -getGlobalState( +getGlobalStateByBlock( string $blockHash, string $key, array $path @@ -221,3 +221,20 @@ Returns an [GlobalState](../Entity/GlobalState.md) object by the given block has | `$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 | + +--- +## Get global state by state root hash +```php +getGlobalStateByStateRootHash( + string $stateRootHash, + string $key, + array $path +): GlobalState +``` +Returns an [GlobalState](../Entity/GlobalState.md) object by the given state root hash and key +### Parameters +| 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 | diff --git a/docs/Entity/GlobalState.md b/docs/Entity/GlobalState.md index 7b7b7c8..a9f49fc 100644 --- a/docs/Entity/GlobalState.md +++ b/docs/Entity/GlobalState.md @@ -1,7 +1,7 @@ # GlobalState ```php -getBlockHeader(): BlockHeader +getBlockHeader(): ?BlockHeader ``` Returns [BlockHeader](BlockHeader.md) object