UNPKG

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