UNPKG

randomness-js

Version:

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

182 lines (181 loc) 11.2 kB
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 ChainlinkVRFSubscriptionConsumerInterface extends Interface { getFunction(nameOrSignature: "acceptOwnership" | "addConsumer" | "createSubscription" | "fundSubscriptionWithNative" | "getRandomWords" | "owner" | "randomWordsOf" | "rawFulfillRandomWords" | "requestId" | "requestRandomWords" | "s_vrfCoordinator" | "setCoordinator" | "setSubscription" | "transferOwnership"): FunctionFragment; getEvent(nameOrSignatureOrTopic: "CoordinatorSet" | "OwnershipTransferRequested" | "OwnershipTransferred"): EventFragment; encodeFunctionData(functionFragment: "acceptOwnership", values?: undefined): string; encodeFunctionData(functionFragment: "addConsumer", values: [BigNumberish, AddressLike]): string; encodeFunctionData(functionFragment: "createSubscription", values?: undefined): string; encodeFunctionData(functionFragment: "fundSubscriptionWithNative", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "getRandomWords", values: [BigNumberish]): 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]): string; encodeFunctionData(functionFragment: "s_vrfCoordinator", values?: undefined): string; encodeFunctionData(functionFragment: "setCoordinator", values: [AddressLike]): string; encodeFunctionData(functionFragment: "setSubscription", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string; decodeFunctionResult(functionFragment: "acceptOwnership", data: BytesLike): Result; decodeFunctionResult(functionFragment: "addConsumer", data: BytesLike): Result; decodeFunctionResult(functionFragment: "createSubscription", data: BytesLike): Result; decodeFunctionResult(functionFragment: "fundSubscriptionWithNative", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getRandomWords", 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: "s_vrfCoordinator", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setCoordinator", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setSubscription", 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 ChainlinkVRFSubscriptionConsumer extends BaseContract { connect(runner?: ContractRunner | null): ChainlinkVRFSubscriptionConsumer; waitForDeployment(): Promise<this>; interface: ChainlinkVRFSubscriptionConsumerInterface; 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">; addConsumer: TypedContractMethod<[ subId: BigNumberish, consumer: AddressLike ], [ void ], "nonpayable">; createSubscription: TypedContractMethod<[], [bigint], "nonpayable">; fundSubscriptionWithNative: TypedContractMethod<[ subId: BigNumberish ], [ void ], "payable">; getRandomWords: TypedContractMethod<[ _requestId: BigNumberish ], [ bigint[] ], "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 ], [ bigint ], "nonpayable">; s_vrfCoordinator: TypedContractMethod<[], [string], "view">; setCoordinator: TypedContractMethod<[ _vrfCoordinator: AddressLike ], [ void ], "nonpayable">; setSubscription: TypedContractMethod<[ subId: BigNumberish ], [ 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: "addConsumer"): TypedContractMethod<[ subId: BigNumberish, consumer: AddressLike ], [ void ], "nonpayable">; getFunction(nameOrSignature: "createSubscription"): TypedContractMethod<[], [bigint], "nonpayable">; getFunction(nameOrSignature: "fundSubscriptionWithNative"): TypedContractMethod<[subId: BigNumberish], [void], "payable">; getFunction(nameOrSignature: "getRandomWords"): TypedContractMethod<[_requestId: BigNumberish], [bigint[]], "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 ], [ bigint ], "nonpayable">; getFunction(nameOrSignature: "s_vrfCoordinator"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "setCoordinator"): TypedContractMethod<[_vrfCoordinator: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "setSubscription"): TypedContractMethod<[subId: BigNumberish], [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>; }; }