OfflineQuery
Overview
An offline query object used to insert the global state root and state paths needed to create a valid inclusion proof offline. This is useful for creating proofs without requiring a live connection to the network.
Constructors
OfflineQuery
Creates a new offline query object. The state root is required to be passed in as a string
OfflineQuery(block_height, state_root)
| Param | Type | Description |
|---|---|---|
| block_height | u32 | The block height |
| state_root | string | The state root of the current network |
| return | OfflineQuery | The newly created offline query object |
Methods
addBlockHeight
Add a new block height to the offline query object
addBlockHeight(block_height) ► void
| Param | Type | Description |
|---|---|---|
| block_height | u32 | The block height to add |
| return | void |
addStatePath
Add a new state path to the offline query object
addStatePath(commitment:, state_path:) ► void
| Param | Type | Description |
|---|---|---|
| commitment: | string | The commitment corresponding to a record input |
| state_path: | string | The state path corresponding to the commitment |
| return | void |
toString
Get a json string representation of the offline query object
toString() ► string
| Param | Type |
|---|---|
| return | string |
fromString
Create an offline query object from a json string representation
fromString(JSON) ► OfflineQuery
| Param | Type | Description |
|---|---|---|
| JSON | string | string representation of the offline query object |
| return | OfflineQuery |