ethers.js/packages/abi/lib/interface.d.ts

78 lines
3.3 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
import { BytesLike } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
import { AbiCoder } from "./abi-coder";
2020-04-25 03:54:54 -04:00
import { checkResultErrors, Result } from "./coders/abstract-coder";
2019-05-14 18:48:48 -04:00
import { ConstructorFragment, EventFragment, Fragment, FunctionFragment, JsonFragment, ParamType } from "./fragments";
2020-04-25 03:54:54 -04:00
export { checkResultErrors, Result };
2020-01-07 19:58:04 -05:00
export declare class LogDescription extends Description<LogDescription> {
2019-05-14 18:48:48 -04:00
readonly eventFragment: EventFragment;
readonly name: string;
readonly signature: string;
readonly topic: string;
2020-01-07 19:58:04 -05:00
readonly args: Result;
2019-05-14 18:48:48 -04:00
}
2020-01-07 19:58:04 -05:00
export declare class TransactionDescription extends Description<TransactionDescription> {
2019-05-14 18:48:48 -04:00
readonly functionFragment: FunctionFragment;
readonly name: string;
2020-01-07 19:58:04 -05:00
readonly args: Result;
2019-05-14 18:48:48 -04:00
readonly signature: string;
readonly sighash: string;
readonly value: BigNumber;
}
2020-01-07 19:58:04 -05:00
export declare class Indexed extends Description<Indexed> {
2019-05-14 18:48:48 -04:00
readonly hash: string;
2020-01-07 19:58:04 -05:00
readonly _isIndexed: boolean;
2019-06-11 17:57:04 -04:00
static isIndexed(value: any): value is Indexed;
2019-05-14 18:48:48 -04:00
}
export declare class Interface {
readonly fragments: Array<Fragment>;
readonly errors: {
[name: string]: any;
};
readonly events: {
[name: string]: EventFragment;
};
readonly functions: {
[name: string]: FunctionFragment;
};
readonly structs: {
[name: string]: any;
};
readonly deploy: ConstructorFragment;
readonly _abiCoder: AbiCoder;
2020-02-06 18:21:34 -05:00
readonly _isInterface: boolean;
2019-05-14 18:48:48 -04:00
constructor(fragments: string | Array<Fragment | JsonFragment | string>);
2020-01-07 19:58:04 -05:00
format(format?: string): string | Array<string>;
2019-05-14 18:48:48 -04:00
static getAbiCoder(): AbiCoder;
static getAddress(address: string): string;
2020-01-07 19:58:04 -05:00
static getSighash(functionFragment: FunctionFragment): string;
2020-02-26 10:06:48 +00:00
static getEventTopic(eventFragment: EventFragment): string;
2019-05-14 18:48:48 -04:00
getFunction(nameOrSignatureOrSighash: string): FunctionFragment;
getEvent(nameOrSignatureOrTopic: string): EventFragment;
getSighash(functionFragment: FunctionFragment | string): string;
getEventTopic(eventFragment: EventFragment | string): string;
2020-01-07 19:58:04 -05:00
_decodeParams(params: Array<ParamType>, data: BytesLike): Result;
2019-05-14 18:48:48 -04:00
_encodeParams(params: Array<ParamType>, values: Array<any>): string;
encodeDeploy(values?: Array<any>): string;
2020-01-07 19:58:04 -05:00
decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Result;
2019-05-14 18:48:48 -04:00
encodeFunctionData(functionFragment: FunctionFragment | string, values?: Array<any>): string;
2020-01-07 19:58:04 -05:00
decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): Result;
2019-09-28 02:36:19 -04:00
encodeFunctionResult(functionFragment: FunctionFragment | string, values?: Array<any>): string;
2019-05-14 18:48:48 -04:00
encodeFilterTopics(eventFragment: EventFragment, values: Array<any>): Array<string | Array<string>>;
2020-04-25 03:54:54 -04:00
encodeEventLog(eventFragment: EventFragment, values: Array<any>): {
data: string;
topics: Array<string>;
};
2020-01-07 19:58:04 -05:00
decodeEventLog(eventFragment: EventFragment | string, data: BytesLike, topics?: Array<string>): Result;
2019-05-14 18:48:48 -04:00
parseTransaction(tx: {
data: string;
value?: BigNumberish;
}): TransactionDescription;
parseLog(log: {
topics: Array<string>;
data: string;
}): LogDescription;
2019-06-11 17:57:04 -04:00
static isInterface(value: any): value is Interface;
2019-05-14 18:48:48 -04:00
}