randomness-js
Version:
A library for consuming, verifying and using randomness from the dcipher network
195 lines (194 loc) • 11.9 kB
TypeScript
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common";
export interface ChainlinkVRFDirectFundingConsumerInterface extends Interface {
getFunction(nameOrSignature: "acceptOwnership" | "fundContractNative" | "getBalance" | "getRandomWords" | "i_vrfV2PlusWrapper" | "owner" | "randomWordsOf" | "rawFulfillRandomWords" | "requestId" | "requestRandomWords" | "transferOwnership" | "withdrawNative"): FunctionFragment;
getEvent(nameOrSignatureOrTopic: "Funded" | "OwnershipTransferRequested" | "OwnershipTransferred" | "Received" | "Withdrawn"): EventFragment;
encodeFunctionData(functionFragment: "acceptOwnership", values?: undefined): string;
encodeFunctionData(functionFragment: "fundContractNative", values?: undefined): string;
encodeFunctionData(functionFragment: "getBalance", values?: undefined): string;
encodeFunctionData(functionFragment: "getRandomWords", values: [BigNumberish]): string;
encodeFunctionData(functionFragment: "i_vrfV2PlusWrapper", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "randomWordsOf", values: [BigNumberish, BigNumberish]): string;
encodeFunctionData(functionFragment: "rawFulfillRandomWords", values: [BigNumberish, BigNumberish[]]): string;
encodeFunctionData(functionFragment: "requestId", values?: undefined): string;
encodeFunctionData(functionFragment: "requestRandomWords", values: [BigNumberish, boolean]): string;
encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "withdrawNative", values: [BigNumberish, AddressLike]): string;
decodeFunctionResult(functionFragment: "acceptOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "fundContractNative", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "getBalance", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "getRandomWords", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "i_vrfV2PlusWrapper", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "randomWordsOf", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "rawFulfillRandomWords", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "requestId", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "requestRandomWords", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "withdrawNative", data: BytesLike): Result;
}
export declare namespace FundedEvent {
type InputTuple = [sender: AddressLike, amount: BigNumberish];
type OutputTuple = [sender: string, amount: bigint];
interface OutputObject {
sender: string;
amount: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace OwnershipTransferRequestedEvent {
type InputTuple = [from: AddressLike, to: AddressLike];
type OutputTuple = [from: string, to: string];
interface OutputObject {
from: string;
to: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace OwnershipTransferredEvent {
type InputTuple = [from: AddressLike, to: AddressLike];
type OutputTuple = [from: string, to: string];
interface OutputObject {
from: string;
to: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace ReceivedEvent {
type InputTuple = [arg0: AddressLike, arg1: BigNumberish];
type OutputTuple = [arg0: string, arg1: bigint];
interface OutputObject {
arg0: string;
arg1: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace WithdrawnEvent {
type InputTuple = [recipient: AddressLike, amount: BigNumberish];
type OutputTuple = [recipient: string, amount: bigint];
interface OutputObject {
recipient: string;
amount: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export interface ChainlinkVRFDirectFundingConsumer extends BaseContract {
connect(runner?: ContractRunner | null): ChainlinkVRFDirectFundingConsumer;
waitForDeployment(): Promise<this>;
interface: ChainlinkVRFDirectFundingConsumerInterface;
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>;
acceptOwnership: TypedContractMethod<[], [void], "nonpayable">;
fundContractNative: TypedContractMethod<[], [void], "payable">;
getBalance: TypedContractMethod<[], [bigint], "view">;
getRandomWords: TypedContractMethod<[
_requestId: BigNumberish
], [
bigint[]
], "view">;
i_vrfV2PlusWrapper: TypedContractMethod<[], [string], "view">;
owner: TypedContractMethod<[], [string], "view">;
randomWordsOf: TypedContractMethod<[
arg0: BigNumberish,
arg1: BigNumberish
], [
bigint
], "view">;
rawFulfillRandomWords: TypedContractMethod<[
_requestId: BigNumberish,
_randomWords: BigNumberish[]
], [
void
], "nonpayable">;
requestId: TypedContractMethod<[], [bigint], "view">;
requestRandomWords: TypedContractMethod<[
callbackGasLimit: BigNumberish,
arg1: boolean
], [
bigint
], "nonpayable">;
transferOwnership: TypedContractMethod<[
to: AddressLike
], [
void
], "nonpayable">;
withdrawNative: TypedContractMethod<[
amount: BigNumberish,
recipient: AddressLike
], [
void
], "nonpayable">;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: "acceptOwnership"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "fundContractNative"): TypedContractMethod<[], [void], "payable">;
getFunction(nameOrSignature: "getBalance"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "getRandomWords"): TypedContractMethod<[_requestId: BigNumberish], [bigint[]], "view">;
getFunction(nameOrSignature: "i_vrfV2PlusWrapper"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "randomWordsOf"): TypedContractMethod<[
arg0: BigNumberish,
arg1: BigNumberish
], [
bigint
], "view">;
getFunction(nameOrSignature: "rawFulfillRandomWords"): TypedContractMethod<[
_requestId: BigNumberish,
_randomWords: BigNumberish[]
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "requestId"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "requestRandomWords"): TypedContractMethod<[
callbackGasLimit: BigNumberish,
arg1: boolean
], [
bigint
], "nonpayable">;
getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">;
getFunction(nameOrSignature: "withdrawNative"): TypedContractMethod<[
amount: BigNumberish,
recipient: AddressLike
], [
void
], "nonpayable">;
getEvent(key: "Funded"): TypedContractEvent<FundedEvent.InputTuple, FundedEvent.OutputTuple, FundedEvent.OutputObject>;
getEvent(key: "OwnershipTransferRequested"): TypedContractEvent<OwnershipTransferRequestedEvent.InputTuple, OwnershipTransferRequestedEvent.OutputTuple, OwnershipTransferRequestedEvent.OutputObject>;
getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
getEvent(key: "Received"): TypedContractEvent<ReceivedEvent.InputTuple, ReceivedEvent.OutputTuple, ReceivedEvent.OutputObject>;
getEvent(key: "Withdrawn"): TypedContractEvent<WithdrawnEvent.InputTuple, WithdrawnEvent.OutputTuple, WithdrawnEvent.OutputObject>;
filters: {
"Funded(address,uint256)": TypedContractEvent<FundedEvent.InputTuple, FundedEvent.OutputTuple, FundedEvent.OutputObject>;
Funded: TypedContractEvent<FundedEvent.InputTuple, FundedEvent.OutputTuple, FundedEvent.OutputObject>;
"OwnershipTransferRequested(address,address)": TypedContractEvent<OwnershipTransferRequestedEvent.InputTuple, OwnershipTransferRequestedEvent.OutputTuple, OwnershipTransferRequestedEvent.OutputObject>;
OwnershipTransferRequested: TypedContractEvent<OwnershipTransferRequestedEvent.InputTuple, OwnershipTransferRequestedEvent.OutputTuple, OwnershipTransferRequestedEvent.OutputObject>;
"OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
"Received(address,uint256)": TypedContractEvent<ReceivedEvent.InputTuple, ReceivedEvent.OutputTuple, ReceivedEvent.OutputObject>;
Received: TypedContractEvent<ReceivedEvent.InputTuple, ReceivedEvent.OutputTuple, ReceivedEvent.OutputObject>;
"Withdrawn(address,uint256)": TypedContractEvent<WithdrawnEvent.InputTuple, WithdrawnEvent.OutputTuple, WithdrawnEvent.OutputObject>;
Withdrawn: TypedContractEvent<WithdrawnEvent.InputTuple, WithdrawnEvent.OutputTuple, WithdrawnEvent.OutputObject>;
};
}