UNPKG

2.21 kBTypeScriptView Raw
1import type { AnyJson, Codec } from '@polkadot/types-codec/types';
2import type { TypeDef } from '@polkadot/types-create/types';
3import type { EventMetadataLatest } from '../interfaces/metadata';
4import type { EventId } from '../interfaces/system';
5import type { IEvent, IEventData, Registry } from '../types';
6import { Struct, Tuple } from '@polkadot/types-codec';
7/**
8 * @name GenericEventData
9 * @description
10 * Wrapper for the actual data that forms part of an [[Event]]
11 */
12export declare class GenericEventData extends Tuple implements IEventData {
13 #private;
14 constructor(registry: Registry, value: Uint8Array, meta: EventMetadataLatest, section?: string, method?: string);
15 /**
16 * @description The wrapped [[EventMetadata]]
17 */
18 get meta(): EventMetadataLatest;
19 /**
20 * @description The method as a string
21 */
22 get method(): string;
23 /**
24 * @description The section as a string
25 */
26 get section(): string;
27 /**
28 * @description The [[TypeDef]] for this event
29 */
30 get typeDef(): TypeDef[];
31}
32/**
33 * @name GenericEvent
34 * @description
35 * A representation of a system event. These are generated via the [[Metadata]] interfaces and
36 * specific to a specific Substrate runtime
37 */
38export declare class GenericEvent extends Struct implements IEvent<Codec[]> {
39 constructor(registry: Registry, _value?: Uint8Array);
40 /**
41 * @description The wrapped [[EventData]]
42 */
43 get data(): GenericEventData;
44 /**
45 * @description The [[EventId]], identifying the raw event
46 */
47 get index(): EventId;
48 /**
49 * @description The [[EventMetadata]] with the documentation
50 */
51 get meta(): EventMetadataLatest;
52 /**
53 * @description The method string identifying the event
54 */
55 get method(): string;
56 /**
57 * @description The section string identifying the event
58 */
59 get section(): string;
60 /**
61 * @description The [[TypeDef]] for the event
62 */
63 get typeDef(): TypeDef[];
64 /**
65 * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
66 */
67 toHuman(isExpanded?: boolean): Record<string, AnyJson>;
68}