randomness-js
Version:
A library for consuming, verifying and using randomness from the dcipher network
532 lines (528 loc) • 10.7 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
IRandomnessSender,
IRandomnessSenderInterface,
} from "../IRandomnessSender";
const _abi = [
{
type: "function",
name: "acceptSubscriptionOwnerTransfer",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "addConsumer",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "consumer",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "calculateRequestPriceNative",
inputs: [
{
name: "_callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "cancelSubscription",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "to",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "createSubscription",
inputs: [],
outputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "estimateRequestPriceNative",
inputs: [
{
name: "_callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "_requestGasPriceWei",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "fundSubscriptionWithNative",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "getActiveSubscriptionIds",
inputs: [
{
name: "startIndex",
type: "uint256",
internalType: "uint256",
},
{
name: "maxCount",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "",
type: "uint256[]",
internalType: "uint256[]",
},
],
stateMutability: "view",
},
{
type: "function",
name: "getAllRequests",
inputs: [],
outputs: [
{
name: "",
type: "tuple[]",
internalType: "struct TypesLib.RandomnessRequest[]",
components: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "directFundingFeePaid",
type: "uint256",
internalType: "uint256",
},
{
name: "callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "requestId",
type: "uint256",
internalType: "uint256",
},
{
name: "message",
type: "bytes",
internalType: "bytes",
},
{
name: "condition",
type: "bytes",
internalType: "bytes",
},
{
name: "signature",
type: "bytes",
internalType: "bytes",
},
{
name: "nonce",
type: "uint256",
internalType: "uint256",
},
{
name: "callback",
type: "address",
internalType: "address",
},
],
},
],
stateMutability: "view",
},
{
type: "function",
name: "getConfig",
inputs: [],
outputs: [
{
name: "maxGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "gasAfterPaymentCalculation",
type: "uint32",
internalType: "uint32",
},
{
name: "fulfillmentFlatFeeNativePPM",
type: "uint32",
internalType: "uint32",
},
{
name: "weiPerUnitGas",
type: "uint32",
internalType: "uint32",
},
{
name: "blsPairingCheckOverhead",
type: "uint32",
internalType: "uint32",
},
{
name: "nativePremiumPercentage",
type: "uint8",
internalType: "uint8",
},
{
name: "gasForCallExactCheck",
type: "uint32",
internalType: "uint32",
},
],
stateMutability: "view",
},
{
type: "function",
name: "getRequest",
inputs: [
{
name: "requestId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "",
type: "tuple",
internalType: "struct TypesLib.RandomnessRequest",
components: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "directFundingFeePaid",
type: "uint256",
internalType: "uint256",
},
{
name: "callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "requestId",
type: "uint256",
internalType: "uint256",
},
{
name: "message",
type: "bytes",
internalType: "bytes",
},
{
name: "condition",
type: "bytes",
internalType: "bytes",
},
{
name: "signature",
type: "bytes",
internalType: "bytes",
},
{
name: "nonce",
type: "uint256",
internalType: "uint256",
},
{
name: "callback",
type: "address",
internalType: "address",
},
],
},
],
stateMutability: "view",
},
{
type: "function",
name: "getSubscription",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "nativeBalance",
type: "uint96",
internalType: "uint96",
},
{
name: "reqCount",
type: "uint64",
internalType: "uint64",
},
{
name: "owner",
type: "address",
internalType: "address",
},
{
name: "consumers",
type: "address[]",
internalType: "address[]",
},
],
stateMutability: "view",
},
{
type: "function",
name: "isInFlight",
inputs: [
{
name: "requestId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "",
type: "bool",
internalType: "bool",
},
],
stateMutability: "view",
},
{
type: "function",
name: "messageFrom",
inputs: [
{
name: "r",
type: "tuple",
internalType: "struct TypesLib.RandomnessRequestCreationParams",
components: [
{
name: "nonce",
type: "uint256",
internalType: "uint256",
},
{
name: "callback",
type: "address",
internalType: "address",
},
],
},
],
outputs: [
{
name: "",
type: "bytes",
internalType: "bytes",
},
],
stateMutability: "pure",
},
{
type: "function",
name: "pendingRequestExists",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "",
type: "bool",
internalType: "bool",
},
],
stateMutability: "view",
},
{
type: "function",
name: "removeConsumer",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "consumer",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "requestRandomness",
inputs: [
{
name: "callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
],
outputs: [
{
name: "requestID",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "payable",
},
{
type: "function",
name: "requestRandomnessWithSubscription",
inputs: [
{
name: "callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "requestID",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "payable",
},
{
type: "function",
name: "requestSubscriptionOwnerTransfer",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "newOwner",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setSignatureSender",
inputs: [
{
name: "newSignatureSender",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
] as const;
export class IRandomnessSender__factory {
static readonly abi = _abi;
static createInterface(): IRandomnessSenderInterface {
return new Interface(_abi) as IRandomnessSenderInterface;
}
static connect(
address: string,
runner?: ContractRunner | null
): IRandomnessSender {
return new Contract(address, _abi, runner) as unknown as IRandomnessSender;
}
}