UNPKG

@make-software/ces-js-parser

Version:

Parser for contract-level events encoded with Casper Event Standard (CES)

16 lines (15 loc) 633 B
import { CLValue, Hash, IResultWithBytes } from 'casper-js-sdk'; import { Schema, Schemas } from './schema'; export interface Event { name: string; contractHash: Hash | null; contractPackageHash: Hash | null; eventId: number; data: Record<string, CLValue>; } export declare function parseEventNameWithRemainder(rawEvent: Uint8Array): IResultWithBytes<string>; export declare function parseEventNameAndData(rawEvent: string, schemas: Schemas): { name: string; data: Record<string, CLValue>; }; export declare function parseEventDataFromBytes(schema: Schema, rawBytes: Uint8Array): Record<string, CLValue>;