randomness-js
Version:
A library for consuming, verifying and using randomness from the dcipher network
573 lines (569 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 {
SubscriptionAPI,
SubscriptionAPIInterface,
} from "../SubscriptionAPI";
const _abi = [
{
type: "function",
name: "MAX_CONSUMERS",
inputs: [],
outputs: [
{
name: "",
type: "uint16",
internalType: "uint16",
},
],
stateMutability: "view",
},
{
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: "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: "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: "ids",
type: "uint256[]",
internalType: "uint256[]",
},
],
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: "subOwner",
type: "address",
internalType: "address",
},
{
name: "consumers",
type: "address[]",
internalType: "address[]",
},
],
stateMutability: "view",
},
{
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: "requestSubscriptionOwnerTransfer",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "newOwner",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "s_config",
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: "s_currentSubNonce",
inputs: [],
outputs: [
{
name: "",
type: "uint64",
internalType: "uint64",
},
],
stateMutability: "view",
},
{
type: "function",
name: "s_totalNativeBalance",
inputs: [],
outputs: [
{
name: "",
type: "uint96",
internalType: "uint96",
},
],
stateMutability: "view",
},
{
type: "function",
name: "s_withdrawableDirectFundingFeeNative",
inputs: [],
outputs: [
{
name: "",
type: "uint96",
internalType: "uint96",
},
],
stateMutability: "view",
},
{
type: "function",
name: "s_withdrawableSubscriptionFeeNative",
inputs: [],
outputs: [
{
name: "",
type: "uint96",
internalType: "uint96",
},
],
stateMutability: "view",
},
{
type: "event",
name: "SubscriptionCanceled",
inputs: [
{
name: "subId",
type: "uint256",
indexed: true,
internalType: "uint256",
},
{
name: "to",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "amountNative",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "event",
name: "SubscriptionConsumerAdded",
inputs: [
{
name: "subId",
type: "uint256",
indexed: true,
internalType: "uint256",
},
{
name: "consumer",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "SubscriptionConsumerRemoved",
inputs: [
{
name: "subId",
type: "uint256",
indexed: true,
internalType: "uint256",
},
{
name: "consumer",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "SubscriptionCreated",
inputs: [
{
name: "subId",
type: "uint256",
indexed: true,
internalType: "uint256",
},
{
name: "owner",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "SubscriptionFundedWithNative",
inputs: [
{
name: "subId",
type: "uint256",
indexed: true,
internalType: "uint256",
},
{
name: "oldNativeBalance",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "newNativeBalance",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "event",
name: "SubscriptionOwnerTransferRequested",
inputs: [
{
name: "subId",
type: "uint256",
indexed: true,
internalType: "uint256",
},
{
name: "from",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "to",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "SubscriptionOwnerTransferred",
inputs: [
{
name: "subId",
type: "uint256",
indexed: true,
internalType: "uint256",
},
{
name: "from",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "to",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "error",
name: "BalanceInvariantViolated",
inputs: [
{
name: "internalBalance",
type: "uint256",
internalType: "uint256",
},
{
name: "externalBalance",
type: "uint256",
internalType: "uint256",
},
],
},
{
type: "error",
name: "FailedToSendNative",
inputs: [],
},
{
type: "error",
name: "IndexOutOfRange",
inputs: [],
},
{
type: "error",
name: "InsufficientBalance",
inputs: [],
},
{
type: "error",
name: "InvalidCalldata",
inputs: [],
},
{
type: "error",
name: "InvalidConsumer",
inputs: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "consumer",
type: "address",
internalType: "address",
},
],
},
{
type: "error",
name: "InvalidSubscription",
inputs: [],
},
{
type: "error",
name: "MustBeRequestedOwner",
inputs: [
{
name: "proposedOwner",
type: "address",
internalType: "address",
},
],
},
{
type: "error",
name: "MustBeSubOwner",
inputs: [
{
name: "owner",
type: "address",
internalType: "address",
},
],
},
{
type: "error",
name: "PendingRequestExists",
inputs: [],
},
{
type: "error",
name: "ReentrancyGuardReentrantCall",
inputs: [],
},
{
type: "error",
name: "TooManyConsumers",
inputs: [],
},
] as const;
export class SubscriptionAPI__factory {
static readonly abi = _abi;
static createInterface(): SubscriptionAPIInterface {
return new Interface(_abi) as SubscriptionAPIInterface;
}
static connect(
address: string,
runner?: ContractRunner | null
): SubscriptionAPI {
return new Contract(address, _abi, runner) as unknown as SubscriptionAPI;
}
}