Support Tuples from function returns

This commit is contained in:
Jacob Evans
2018-04-19 11:21:32 +10:00
parent 62fcb51e1a
commit 12ae7c009d
7 changed files with 93 additions and 15 deletions

View File

@@ -0,0 +1,39 @@
declare module 'ethers' {
export interface TransactionDescription {
name: string;
signature: string;
sighash: string;
data: string;
}
export interface CallDescription extends TransactionDescription {
parse: (...args: any[]) => any;
}
export interface FunctionDescription {
(...params: any[]): TransactionDescription | CallDescription;
inputs: { names: string[]; types: string[] };
outputs: { names: string[]; types: string[] };
type: string;
}
export interface EventDescription {
parse: (...args: any[]) => any;
inputs: { names: string[]; types: string[] };
signature: string;
topic: string;
}
export class Interface {
public functions: { [functionName: string]: FunctionDescription };
public events: { [eventName: string]: EventDescription };
// public static decodeParams(types: string[], data: string): any[];
constructor(abi: any);
}
export class Contract {
constructor(address: string, abi: any, provider: any);
}
}
declare module 'ethers/utils/abi-coder' {
export class Coder {
public decode(names: any[], types: any[], data?: any[]): any[];
defaultCoder: Coder;
}
}