diff --git a/src.ts/contract.ts b/src.ts/contract.ts index 2c37bd7b27..03ca92d3e1 100644 --- a/src.ts/contract.ts +++ b/src.ts/contract.ts @@ -39,9 +39,20 @@ export type EventFilter = { //topics?: Array> }; +/** + * We add a index signature to Array here + * since we dynamically add argument properties in the array + * that can be accessed via either the dot notation (e.args.foo) + * or + * that can be accessed via the array index notation (e.args['foo']) + */ +interface EventArgs extends Array { + [argKey: string]: any +} + // The (n + 1)th parameter passed to contract event callbacks export interface Event extends Log { - args?: Array; + args?: EventArgs; decode?: (data: string, topics?: Array) => any; event?: string; eventSignature?: string;