diff --git a/src.ts/contracts/interface.ts b/src.ts/contracts/interface.ts index 31a9509cb..e03525a76 100644 --- a/src.ts/contracts/interface.ts +++ b/src.ts/contracts/interface.ts @@ -234,7 +234,8 @@ class LogDescription extends Description implements _LogDescription { readonly name: string; readonly signature: string; readonly topic: string; - readonly values: Array + readonly decode: (data: string, topics: Array) => any; + readonly values: any } @@ -378,7 +379,7 @@ export class Interface { name: name, signature: func.signature, sighash: func.sighash, - value: bigNumberify(tx.value || 0), + value: bigNumberify(tx.value || null), }); } } @@ -396,6 +397,7 @@ export class Interface { // @TODO: If anonymous, and the only method, and the input count matches, should we parse and return it? return new LogDescription({ + decode: event.decode, name: event.name, signature: event.signature, topic: event.topic, diff --git a/src.ts/utils/abi-coder.ts b/src.ts/utils/abi-coder.ts index dd421773c..505cf231f 100644 --- a/src.ts/utils/abi-coder.ts +++ b/src.ts/utils/abi-coder.ts @@ -986,7 +986,7 @@ export class AbiCoder { return hexlify(new CoderTuple(this.coerceFunc, coders, '_').encode(values)); } - decode(types: Array, data: Arrayish): Array { + decode(types: Array, data: Arrayish): any { var coders: Array = []; types.forEach(function(type) { diff --git a/src.ts/utils/types.ts b/src.ts/utils/types.ts index ad4f671e1..a30f04cc6 100644 --- a/src.ts/utils/types.ts +++ b/src.ts/utils/types.ts @@ -308,10 +308,11 @@ export interface EventDescription { } export interface LogDescription { + readonly decode: (data: string, topics: Array) => any; readonly name: string; readonly signature: string; readonly topic: string; - readonly values: Array + readonly values: any } export interface TransactionDescription {