randomness-js
Version:
A library for consuming, verifying and using randomness from the dcipher network
110 lines (109 loc) • 7.55 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 VRFConsumerBaseV2PlusInterface extends Interface {
getFunction(nameOrSignature: "acceptOwnership" | "owner" | "rawFulfillRandomWords" | "s_vrfCoordinator" | "setCoordinator" | "transferOwnership"): FunctionFragment;
getEvent(nameOrSignatureOrTopic: "CoordinatorSet" | "OwnershipTransferRequested" | "OwnershipTransferred"): EventFragment;
encodeFunctionData(functionFragment: "acceptOwnership", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "rawFulfillRandomWords", values: [BigNumberish, BigNumberish[]]): string;
encodeFunctionData(functionFragment: "s_vrfCoordinator", values?: undefined): string;
encodeFunctionData(functionFragment: "setCoordinator", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string;
decodeFunctionResult(functionFragment: "acceptOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "rawFulfillRandomWords", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "s_vrfCoordinator", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setCoordinator", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result;
}
export declare namespace CoordinatorSetEvent {
type InputTuple = [vrfCoordinator: AddressLike];
type OutputTuple = [vrfCoordinator: string];
interface OutputObject {
vrfCoordinator: string;
}
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 interface VRFConsumerBaseV2Plus extends BaseContract {
connect(runner?: ContractRunner | null): VRFConsumerBaseV2Plus;
waitForDeployment(): Promise<this>;
interface: VRFConsumerBaseV2PlusInterface;
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">;
owner: TypedContractMethod<[], [string], "view">;
rawFulfillRandomWords: TypedContractMethod<[
requestId: BigNumberish,
randomWords: BigNumberish[]
], [
void
], "nonpayable">;
s_vrfCoordinator: TypedContractMethod<[], [string], "view">;
setCoordinator: TypedContractMethod<[
_vrfCoordinator: AddressLike
], [
void
], "nonpayable">;
transferOwnership: TypedContractMethod<[
to: AddressLike
], [
void
], "nonpayable">;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: "acceptOwnership"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "rawFulfillRandomWords"): TypedContractMethod<[
requestId: BigNumberish,
randomWords: BigNumberish[]
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "s_vrfCoordinator"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "setCoordinator"): TypedContractMethod<[_vrfCoordinator: AddressLike], [void], "nonpayable">;
getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">;
getEvent(key: "CoordinatorSet"): TypedContractEvent<CoordinatorSetEvent.InputTuple, CoordinatorSetEvent.OutputTuple, CoordinatorSetEvent.OutputObject>;
getEvent(key: "OwnershipTransferRequested"): TypedContractEvent<OwnershipTransferRequestedEvent.InputTuple, OwnershipTransferRequestedEvent.OutputTuple, OwnershipTransferRequestedEvent.OutputObject>;
getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
filters: {
"CoordinatorSet(address)": TypedContractEvent<CoordinatorSetEvent.InputTuple, CoordinatorSetEvent.OutputTuple, CoordinatorSetEvent.OutputObject>;
CoordinatorSet: TypedContractEvent<CoordinatorSetEvent.InputTuple, CoordinatorSetEvent.OutputTuple, CoordinatorSetEvent.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>;
};
}