UNPKG

randomness-js

Version:

A library for consuming, verifying and using randomness from the dcipher network

67 lines (66 loc) 3.9 kB
import type { BaseContract, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers"; import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common"; export interface FactoryInterface extends Interface { getFunction(nameOrSignature: "computeAddress" | "deploy"): FunctionFragment; getEvent(nameOrSignatureOrTopic: "CreatedContract"): EventFragment; encodeFunctionData(functionFragment: "computeAddress", values: [BytesLike, BytesLike]): string; encodeFunctionData(functionFragment: "deploy", values: [BytesLike, BytesLike]): string; decodeFunctionResult(functionFragment: "computeAddress", data: BytesLike): Result; decodeFunctionResult(functionFragment: "deploy", data: BytesLike): Result; } export declare namespace CreatedContractEvent { type InputTuple = [addr: AddressLike, salt: BytesLike]; type OutputTuple = [addr: string, salt: string]; interface OutputObject { addr: string; salt: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export interface Factory extends BaseContract { connect(runner?: ContractRunner | null): Factory; waitForDeployment(): Promise<this>; interface: FactoryInterface; queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>; queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>; on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>; on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>; once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>; once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>; listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>; listeners(eventName?: string): Promise<Array<Listener>>; removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>; computeAddress: TypedContractMethod<[ salt: BytesLike, creationCodeHash: BytesLike ], [ string ], "view">; deploy: TypedContractMethod<[ salt: BytesLike, creationCode: BytesLike ], [ string ], "payable">; getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T; getFunction(nameOrSignature: "computeAddress"): TypedContractMethod<[ salt: BytesLike, creationCodeHash: BytesLike ], [ string ], "view">; getFunction(nameOrSignature: "deploy"): TypedContractMethod<[ salt: BytesLike, creationCode: BytesLike ], [ string ], "payable">; getEvent(key: "CreatedContract"): TypedContractEvent<CreatedContractEvent.InputTuple, CreatedContractEvent.OutputTuple, CreatedContractEvent.OutputObject>; filters: { "CreatedContract(address,bytes32)": TypedContractEvent<CreatedContractEvent.InputTuple, CreatedContractEvent.OutputTuple, CreatedContractEvent.OutputObject>; CreatedContract: TypedContractEvent<CreatedContractEvent.InputTuple, CreatedContractEvent.OutputTuple, CreatedContractEvent.OutputObject>; }; }