randomness-js
Version:
A library for consuming, verifying and using randomness from the dcipher network
570 lines (525 loc) • 16.7 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
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 MockRandomnessReceiverInterface extends Interface {
getFunction(
nameOrSignature:
| "acceptOwnership"
| "cancelSubscription"
| "createSubscriptionAndFundNative"
| "getBalance"
| "isInFlight"
| "owner"
| "pendingRequestExists"
| "randomness"
| "randomnessSender"
| "receiveRandomness"
| "requestId"
| "rollDiceWithDirectFunding"
| "rollDiceWithSubscription"
| "setRandomnessSender"
| "setSubId"
| "subscriptionId"
| "topUpSubscriptionNative"
| "transferOwnership"
| "updateSubscription"
): FunctionFragment;
getEvent(
nameOrSignatureOrTopic:
| "Funded"
| "NewSubscriptionId"
| "OwnershipTransferRequested"
| "OwnershipTransferred"
| "Received"
| "Withdrawn"
): EventFragment;
encodeFunctionData(
functionFragment: "acceptOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "cancelSubscription",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "createSubscriptionAndFundNative",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getBalance",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "isInFlight",
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "pendingRequestExists",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "randomness",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "randomnessSender",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "receiveRandomness",
values: [BigNumberish, BytesLike]
): string;
encodeFunctionData(functionFragment: "requestId", values?: undefined): string;
encodeFunctionData(
functionFragment: "rollDiceWithDirectFunding",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "rollDiceWithSubscription",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "setRandomnessSender",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "setSubId",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "subscriptionId",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "topUpSubscriptionNative",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "updateSubscription",
values: [AddressLike[]]
): string;
decodeFunctionResult(
functionFragment: "acceptOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "cancelSubscription",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "createSubscriptionAndFundNative",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "getBalance", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isInFlight", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "pendingRequestExists",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "randomness", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "randomnessSender",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "receiveRandomness",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "requestId", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "rollDiceWithDirectFunding",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "rollDiceWithSubscription",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setRandomnessSender",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setSubId", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "subscriptionId",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "topUpSubscriptionNative",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "updateSubscription",
data: BytesLike
): Result;
}
export namespace FundedEvent {
export type InputTuple = [sender: AddressLike, amount: BigNumberish];
export type OutputTuple = [sender: string, amount: bigint];
export interface OutputObject {
sender: string;
amount: bigint;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace NewSubscriptionIdEvent {
export type InputTuple = [subscriptionId: BigNumberish];
export type OutputTuple = [subscriptionId: bigint];
export interface OutputObject {
subscriptionId: bigint;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace OwnershipTransferRequestedEvent {
export type InputTuple = [from: AddressLike, to: AddressLike];
export type OutputTuple = [from: string, to: string];
export interface OutputObject {
from: string;
to: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace OwnershipTransferredEvent {
export type InputTuple = [from: AddressLike, to: AddressLike];
export type OutputTuple = [from: string, to: string];
export interface OutputObject {
from: string;
to: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace ReceivedEvent {
export type InputTuple = [arg0: AddressLike, arg1: BigNumberish];
export type OutputTuple = [arg0: string, arg1: bigint];
export interface OutputObject {
arg0: string;
arg1: bigint;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace WithdrawnEvent {
export type InputTuple = [recipient: AddressLike, amount: BigNumberish];
export type OutputTuple = [recipient: string, amount: bigint];
export interface OutputObject {
recipient: string;
amount: bigint;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export interface MockRandomnessReceiver extends BaseContract {
connect(runner?: ContractRunner | null): MockRandomnessReceiver;
waitForDeployment(): Promise<this>;
interface: MockRandomnessReceiverInterface;
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">;
cancelSubscription: TypedContractMethod<
[to: AddressLike],
[void],
"nonpayable"
>;
createSubscriptionAndFundNative: TypedContractMethod<[], [void], "payable">;
getBalance: TypedContractMethod<[], [bigint], "view">;
isInFlight: TypedContractMethod<[requestId: BigNumberish], [boolean], "view">;
owner: TypedContractMethod<[], [string], "view">;
pendingRequestExists: TypedContractMethod<
[subId: BigNumberish],
[boolean],
"view"
>;
randomness: TypedContractMethod<[], [string], "view">;
randomnessSender: TypedContractMethod<[], [string], "view">;
receiveRandomness: TypedContractMethod<
[requestID: BigNumberish, randomness: BytesLike],
[void],
"nonpayable"
>;
requestId: TypedContractMethod<[], [bigint], "view">;
rollDiceWithDirectFunding: TypedContractMethod<
[callbackGasLimit: BigNumberish],
[[bigint, bigint]],
"payable"
>;
rollDiceWithSubscription: TypedContractMethod<
[callbackGasLimit: BigNumberish],
[bigint],
"nonpayable"
>;
setRandomnessSender: TypedContractMethod<
[_randomnessSender: AddressLike],
[void],
"nonpayable"
>;
setSubId: TypedContractMethod<[subId: BigNumberish], [void], "nonpayable">;
subscriptionId: TypedContractMethod<[], [bigint], "view">;
topUpSubscriptionNative: TypedContractMethod<[], [void], "payable">;
transferOwnership: TypedContractMethod<
[to: AddressLike],
[void],
"nonpayable"
>;
updateSubscription: TypedContractMethod<
[consumers: AddressLike[]],
[void],
"nonpayable"
>;
getFunction<T extends ContractMethod = ContractMethod>(
key: string | FunctionFragment
): T;
getFunction(
nameOrSignature: "acceptOwnership"
): TypedContractMethod<[], [void], "nonpayable">;
getFunction(
nameOrSignature: "cancelSubscription"
): TypedContractMethod<[to: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "createSubscriptionAndFundNative"
): TypedContractMethod<[], [void], "payable">;
getFunction(
nameOrSignature: "getBalance"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "isInFlight"
): TypedContractMethod<[requestId: BigNumberish], [boolean], "view">;
getFunction(
nameOrSignature: "owner"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "pendingRequestExists"
): TypedContractMethod<[subId: BigNumberish], [boolean], "view">;
getFunction(
nameOrSignature: "randomness"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "randomnessSender"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "receiveRandomness"
): TypedContractMethod<
[requestID: BigNumberish, randomness: BytesLike],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "requestId"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "rollDiceWithDirectFunding"
): TypedContractMethod<
[callbackGasLimit: BigNumberish],
[[bigint, bigint]],
"payable"
>;
getFunction(
nameOrSignature: "rollDiceWithSubscription"
): TypedContractMethod<
[callbackGasLimit: BigNumberish],
[bigint],
"nonpayable"
>;
getFunction(
nameOrSignature: "setRandomnessSender"
): TypedContractMethod<
[_randomnessSender: AddressLike],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "setSubId"
): TypedContractMethod<[subId: BigNumberish], [void], "nonpayable">;
getFunction(
nameOrSignature: "subscriptionId"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "topUpSubscriptionNative"
): TypedContractMethod<[], [void], "payable">;
getFunction(
nameOrSignature: "transferOwnership"
): TypedContractMethod<[to: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "updateSubscription"
): TypedContractMethod<[consumers: AddressLike[]], [void], "nonpayable">;
getEvent(
key: "Funded"
): TypedContractEvent<
FundedEvent.InputTuple,
FundedEvent.OutputTuple,
FundedEvent.OutputObject
>;
getEvent(
key: "NewSubscriptionId"
): TypedContractEvent<
NewSubscriptionIdEvent.InputTuple,
NewSubscriptionIdEvent.OutputTuple,
NewSubscriptionIdEvent.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
>;
"NewSubscriptionId(uint256)": TypedContractEvent<
NewSubscriptionIdEvent.InputTuple,
NewSubscriptionIdEvent.OutputTuple,
NewSubscriptionIdEvent.OutputObject
>;
NewSubscriptionId: TypedContractEvent<
NewSubscriptionIdEvent.InputTuple,
NewSubscriptionIdEvent.OutputTuple,
NewSubscriptionIdEvent.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
>;
};
}