Preimage::Event

Variant 61 v393

pallet_preimage::pallet::Event

The `Event` enum of this pallet

About This Type

Event enum for the Event pallet.

Contains all possible events emitted by the Event pallet. Each variant represents a different event type with its own data fields.

Variants (3)

IndexNameFieldsDocs
0Noted
hash: H256
A preimage has been noted.
1Requested
hash: H256
A preimage has been requested.
2Cleared
hash: H256
A preimage has ben cleared.

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 3 possible variants.
Size
variable (1+ bytes)

Examples

Noted = Noted(hash)
0x00<field0>
00 Variant index 0 = Noted
field 0 hash: H256
Requested = Requested(hash)
0x01<field0>
01 Variant index 1 = Requested
field 0 hash: H256
Cleared = Cleared(hash)
0x02<field0>
02 Variant index 2 = Cleared
field 0 hash: H256

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode Preimage::Event — variant "Noted"
const value = registry.createType("Preimage::Event", { Noted: { hash: 0 } });
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (23)

and 3 more...

Also See

Type Information

Type ID
61
Kind
Variant
Path
pallet_preimage::pallet::Event
Runtime
v393