Useful for: validatorsanalyticsdevelopers
The Big Picture
Governance is using this preimage.
Use Cases
- Track preimage usage
From Chain Metadata
A preimage has been requested.
Triggers
Emitted by
Preconditions
- Hash provided
Effects
Storage Modified
Postconditions
- Status updated to Requested
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | hash | H256 T::Hash | hash: Cryptographic hash (32 bytes) |
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Subscribe to Requested events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.Preimage.Requested.get(block.hash);
for (const evt of events) {
console.log("Requested:", evt.payload);
}
});Runtime Info
- Pallet Index
- 14
- Event Index
- 1
- First Version
- v133
- Current Version
- v411