blocklock-js
Version:
A library for encrypting and decrypting data for the future
584 lines (580 loc) • 12 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
IBlocklockSender,
IBlocklockSenderInterface,
} from "../IBlocklockSender";
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: "decrypt",
inputs: [
{
name: "ciphertext",
type: "tuple",
internalType: "struct TypesLib.Ciphertext",
components: [
{
name: "u",
type: "tuple",
internalType: "struct BLS.PointG2",
components: [
{
name: "x",
type: "uint256[2]",
internalType: "uint256[2]",
},
{
name: "y",
type: "uint256[2]",
internalType: "uint256[2]",
},
],
},
{
name: "v",
type: "bytes",
internalType: "bytes",
},
{
name: "w",
type: "bytes",
internalType: "bytes",
},
],
},
{
name: "decryptionKey",
type: "bytes",
internalType: "bytes",
},
],
outputs: [
{
name: "",
type: "bytes",
internalType: "bytes",
},
],
stateMutability: "view",
},
{
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: "getChainId",
inputs: [],
outputs: [
{
name: "chainId",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "getRequest",
inputs: [
{
name: "requestId",
type: "uint256",
internalType: "uint256",
},
],
outputs: [
{
name: "",
type: "tuple",
internalType: "struct TypesLib.BlocklockRequest",
components: [
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "directFundingFeePaid",
type: "uint256",
internalType: "uint256",
},
{
name: "callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "decryptionRequestId",
type: "uint256",
internalType: "uint256",
},
{
name: "condition",
type: "bytes",
internalType: "bytes",
},
{
name: "ciphertext",
type: "tuple",
internalType: "struct TypesLib.Ciphertext",
components: [
{
name: "u",
type: "tuple",
internalType: "struct BLS.PointG2",
components: [
{
name: "x",
type: "uint256[2]",
internalType: "uint256[2]",
},
{
name: "y",
type: "uint256[2]",
internalType: "uint256[2]",
},
],
},
{
name: "v",
type: "bytes",
internalType: "bytes",
},
{
name: "w",
type: "bytes",
internalType: "bytes",
},
],
},
{
name: "signature",
type: "bytes",
internalType: "bytes",
},
{
name: "decryptionKey",
type: "bytes",
internalType: "bytes",
},
{
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: "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: "requestBlocklock",
inputs: [
{
name: "callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "condition",
type: "bytes",
internalType: "bytes",
},
{
name: "ciphertext",
type: "tuple",
internalType: "struct TypesLib.Ciphertext",
components: [
{
name: "u",
type: "tuple",
internalType: "struct BLS.PointG2",
components: [
{
name: "x",
type: "uint256[2]",
internalType: "uint256[2]",
},
{
name: "y",
type: "uint256[2]",
internalType: "uint256[2]",
},
],
},
{
name: "v",
type: "bytes",
internalType: "bytes",
},
{
name: "w",
type: "bytes",
internalType: "bytes",
},
],
},
],
outputs: [
{
name: "requestId",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "payable",
},
{
type: "function",
name: "requestBlocklockWithSubscription",
inputs: [
{
name: "callbackGasLimit",
type: "uint32",
internalType: "uint32",
},
{
name: "subId",
type: "uint256",
internalType: "uint256",
},
{
name: "condition",
type: "bytes",
internalType: "bytes",
},
{
name: "ciphertext",
type: "tuple",
internalType: "struct TypesLib.Ciphertext",
components: [
{
name: "u",
type: "tuple",
internalType: "struct BLS.PointG2",
components: [
{
name: "x",
type: "uint256[2]",
internalType: "uint256[2]",
},
{
name: "y",
type: "uint256[2]",
internalType: "uint256[2]",
},
],
},
{
name: "v",
type: "bytes",
internalType: "bytes",
},
{
name: "w",
type: "bytes",
internalType: "bytes",
},
],
},
],
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: "setDecryptionSender",
inputs: [
{
name: "newDecryptionSender",
type: "address",
internalType: "address",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "version",
inputs: [],
outputs: [
{
name: "",
type: "string",
internalType: "string",
},
],
stateMutability: "pure",
},
] as const;
export class IBlocklockSender__factory {
static readonly abi = _abi;
static createInterface(): IBlocklockSenderInterface {
return new Interface(_abi) as IBlocklockSenderInterface;
}
static connect(
address: string,
runner?: ContractRunner | null
): IBlocklockSender {
return new Contract(address, _abi, runner) as unknown as IBlocklockSender;
}
}