Skip to content

Commit 34cef04

Browse files
authored
Merge pull request #15 from make-software/add_new_rpc_methods
Added missed documentation for query_global_state rpc method
2 parents 00ad7f8 + 9e3e732 commit 34cef04

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ $latestBlockHash = $latestBlock->getHash();
7373
- [getEraSummaryBySwitchBlockHash](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-hash)
7474
- [getEraSummaryBySwitchBlockHeight](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-height)
7575
- [getDictionaryItemByURef](docs/API/RpcClientAPI.md#Get-dictionary-item)
76+
- [getGlobalStateByBlock](docs/API/RpcClientAPI.md#Get-global-state-by-block)
77+
- [getGlobalStateByStateRootHash](docs/API/RpcClientAPI.md#Get-global-state-by-state-root-hash)
7678

7779
### DeployService
7880
- [makeDeploy](docs/API/DeployServiceAPI.md#Make-deploy)

docs/API/RpcClientAPI.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ Returns an item from a Dictionary ([StoredValue](../Entity/StoredValue.md) objec
206206
| `$seedUref` | `string` | The dictionary's seed URef | Yes |
207207

208208
---
209-
## Get global state
209+
## Get global state by block
210210
```php
211-
getGlobalState(
211+
getGlobalStateByBlock(
212212
string $blockHash,
213213
string $key,
214214
array $path
@@ -221,3 +221,20 @@ Returns an [GlobalState](../Entity/GlobalState.md) object by the given block has
221221
| `$blockHash` | `string` | Hex-encoded hash of the block | Yes |
222222
| `$key` | `string` | `casper_types::Key` as formatted string | Yes |
223223
| `$path` | `array` | The path components starting from the key as base | No |
224+
225+
---
226+
## Get global state by state root hash
227+
```php
228+
getGlobalStateByStateRootHash(
229+
string $stateRootHash,
230+
string $key,
231+
array $path
232+
): GlobalState
233+
```
234+
Returns an [GlobalState](../Entity/GlobalState.md) object by the given state root hash and key
235+
### Parameters
236+
| Name | Type | Description | Required |
237+
|---|------|-------------|----|
238+
| `$stateRootHash` | `string` | Hex-encoded hash of the state root | Yes |
239+
| `$key` | `string` | `casper_types::Key` as formatted string | Yes |
240+
| `$path` | `array` | The path components starting from the key as base | No |

docs/Entity/GlobalState.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GlobalState
22

33
```php
4-
getBlockHeader(): BlockHeader
4+
getBlockHeader(): ?BlockHeader
55
```
66
Returns [BlockHeader](BlockHeader.md) object
77

0 commit comments

Comments
 (0)