message: add simple events support
diff: @@ -4,6 +4,7 @@ import {
  ConstantFunctionDeclaration,
  FunctionDeclaration,
  ConstantDeclaration,
  + EventDeclaration,
  } from "../../parser/abiParser";
  import {
  EvmType,
  @@ -42,14 +43,7 @@ export function codegen(contract: Contract) {
  arguments: any[];
  }): TransactionObject<Contract>;
  events: {
  - [eventName: string]: (
  - options?: {
  - filter?: object;
  - fromBlock?: BlockType;
  - topics?: string[];
  - },
  - cb?: Callback<EventLog>
  - ) => EventEmitter;
  + ${contract.events.map(generateEvents).join("\n")}
  allEvents: (
  options?: {
  filter?: object;
  @@ -107,6 +101,18 @@ function generateOutputTypes(outputs: Array<EvmType>): string {
  }
  }
  +function generateEvents(event: EventDeclaration) {
  + return `
  + ${event.name}(
  + options?: {
  + filter?: object;
  + fromBlock?: BlockType;
  + topics?: string[];
  + },
  + cb?: Callback<EventLog>): EventEmitter;
  + `;
  +}
  +
  function generateInputType(evmType: EvmType): string {
  switch (evmType.constructor) {
  case IntegerType:
  