avail-js-sdk
Version:
Avail library of functions to interact with blockchain and manipulate transactions
43 lines (42 loc) • 1.43 kB
TypeScript
import { EventRecord as PolkaEventRecord } from "@polkadot/types/interfaces/types";
import { Client, H256 } from ".";
export declare class EventRecords {
inner: EventRecord[];
constructor(value: EventRecord[]);
static new(values: PolkaEventRecord[]): EventRecords;
len(): number;
iter(): EventRecord[];
find<T>(c: {
decode(arg0: EventRecord): T | undefined;
}): T[];
findFirst<T>(c: {
decode(arg0: EventRecord): T | undefined;
}): T | undefined;
static fetch(client: Client, blockHash: H256 | string, txIndex?: number): Promise<EventRecords>;
}
export declare class EventRecord {
inner: PolkaEventRecord;
constructor(value: PolkaEventRecord);
palletName(): string;
palletIndex(): number;
eventName(): string;
eventIndex(): number;
txIndex(): number | undefined;
decode<T>(c: {
decode(arg0: EventRecord): T | undefined;
}): T | undefined;
}
export interface PalletEventMetadata {
PALLET_NAME: string;
PALLET_INDEX: number;
EVENT_NAME: string;
EVENT_INDEX: number;
}
export interface PalletCallMetadata {
PALLET_NAME: string;
PALLET_INDEX: number;
CALL_NAME: string;
CALL_INDEX: number;
}
export declare function palletEventMatch(event: EventRecord, val: PalletEventMetadata): boolean;
export declare function palletCallMatch(palletName: string, callName: string, val: PalletCallMetadata): boolean;