1 | import type { AnyTuple, Codec, Registry } from '@polkadot/types-codec/types';
|
2 | import type { DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces/index.js';
|
3 | import type { StorageEntry } from '../../primitive/types.js';
|
4 | import type { CallFunction, IEvent, IEventLike } from '../../types/index.js';
|
5 | export interface ConstantCodec extends Codec {
|
6 | readonly meta: PalletConstantMetadataLatest;
|
7 | }
|
8 | export interface IsError {
|
9 | readonly meta: ErrorMetadataLatest;
|
10 | is: (moduleError: DispatchErrorModule | DispatchErrorModuleU8 | DispatchErrorModuleU8a) => boolean;
|
11 | }
|
12 | export interface IsEvent<T extends AnyTuple, N = unknown> {
|
13 | readonly meta: EventMetadataLatest;
|
14 | is: (event: IEventLike) => event is IEvent<T, N>;
|
15 | }
|
16 | export type ModuleConstants = Record<string, ConstantCodec>;
|
17 | export type ModuleErrors = Record<string, IsError>;
|
18 | export type ModuleEvents = Record<string, IsEvent<AnyTuple>>;
|
19 | export type ModuleExtrinsics = Record<string, CallFunction>;
|
20 | export type ModuleStorage = Record<string, StorageEntry>;
|
21 | export type Constants = Record<string, ModuleConstants>;
|
22 | export type Errors = Record<string, ModuleErrors>;
|
23 | export type Events = Record<string, ModuleEvents>;
|
24 | export type Extrinsics = Record<string, ModuleExtrinsics>;
|
25 | export type Storage = Record<string, ModuleStorage>;
|
26 | export interface DecoratedMeta {
|
27 | readonly consts: Constants;
|
28 | readonly errors: Errors;
|
29 | readonly events: Events;
|
30 | readonly query: Storage;
|
31 | readonly registry: Registry;
|
32 | readonly tx: Extrinsics;
|
33 | }
|