tornado-contracts/dist/contracts/Classic/PermitTornado.d.ts

325 lines
18 KiB
TypeScript

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 declare namespace PermitTornado {
type PermitCommitmentsStruct = {
instance: AddressLike;
commitmentsHash: BytesLike;
};
type PermitCommitmentsStructOutput = [
instance: string,
commitmentsHash: string
] & {
instance: string;
commitmentsHash: string;
};
}
export interface PermitTornadoInterface extends Interface {
getFunction(nameOrSignature: "COMMITMENT_TYPE" | "COMMITMENT_TYPEHASH" | "FIELD_SIZE" | "ROOT_HISTORY_SIZE" | "WITNESS_TYPE_STRING" | "ZERO_VALUE" | "commitments" | "currentRootIndex" | "denomination" | "deposit" | "depositCommitment" | "filledSubtrees" | "getLastRoot" | "hashLeftRight" | "hasher" | "isKnownRoot" | "isSpent" | "isSpentArray" | "levels" | "nextIndex" | "nullifierHashes" | "permit2" | "permit2Commitments" | "permitCommitments" | "roots" | "token" | "tornadoProxyLight" | "verifiedCommitments" | "verifier" | "withdraw" | "witness" | "zeros"): FunctionFragment;
getEvent(nameOrSignatureOrTopic: "Deposit" | "VerifiedCommitment" | "Withdrawal"): EventFragment;
encodeFunctionData(functionFragment: "COMMITMENT_TYPE", values?: undefined): string;
encodeFunctionData(functionFragment: "COMMITMENT_TYPEHASH", values?: undefined): string;
encodeFunctionData(functionFragment: "FIELD_SIZE", values?: undefined): string;
encodeFunctionData(functionFragment: "ROOT_HISTORY_SIZE", values?: undefined): string;
encodeFunctionData(functionFragment: "WITNESS_TYPE_STRING", values?: undefined): string;
encodeFunctionData(functionFragment: "ZERO_VALUE", values?: undefined): string;
encodeFunctionData(functionFragment: "commitments", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "currentRootIndex", values?: undefined): string;
encodeFunctionData(functionFragment: "denomination", values?: undefined): string;
encodeFunctionData(functionFragment: "deposit", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "depositCommitment", values: [BytesLike, AddressLike]): string;
encodeFunctionData(functionFragment: "filledSubtrees", values: [BigNumberish]): string;
encodeFunctionData(functionFragment: "getLastRoot", values?: undefined): string;
encodeFunctionData(functionFragment: "hashLeftRight", values: [AddressLike, BytesLike, BytesLike]): string;
encodeFunctionData(functionFragment: "hasher", values?: undefined): string;
encodeFunctionData(functionFragment: "isKnownRoot", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "isSpent", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "isSpentArray", values: [BytesLike[]]): string;
encodeFunctionData(functionFragment: "levels", values?: undefined): string;
encodeFunctionData(functionFragment: "nextIndex", values?: undefined): string;
encodeFunctionData(functionFragment: "nullifierHashes", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "permit2", values?: undefined): string;
encodeFunctionData(functionFragment: "permit2Commitments", values: [AddressLike, BytesLike[], BigNumberish, BigNumberish, BytesLike]): string;
encodeFunctionData(functionFragment: "permitCommitments", values: [AddressLike, BytesLike[], BigNumberish, BytesLike, BytesLike]): string;
encodeFunctionData(functionFragment: "roots", values: [BigNumberish]): string;
encodeFunctionData(functionFragment: "token", values?: undefined): string;
encodeFunctionData(functionFragment: "tornadoProxyLight", values?: undefined): string;
encodeFunctionData(functionFragment: "verifiedCommitments", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "verifier", values?: undefined): string;
encodeFunctionData(functionFragment: "withdraw", values: [
BytesLike,
BytesLike,
BytesLike,
AddressLike,
AddressLike,
BigNumberish,
BigNumberish
]): string;
encodeFunctionData(functionFragment: "witness", values: [PermitTornado.PermitCommitmentsStruct]): string;
encodeFunctionData(functionFragment: "zeros", values: [BigNumberish]): string;
decodeFunctionResult(functionFragment: "COMMITMENT_TYPE", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "COMMITMENT_TYPEHASH", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "FIELD_SIZE", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "ROOT_HISTORY_SIZE", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "WITNESS_TYPE_STRING", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "ZERO_VALUE", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "commitments", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "currentRootIndex", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "denomination", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "depositCommitment", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "filledSubtrees", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "getLastRoot", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "hashLeftRight", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "hasher", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isKnownRoot", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isSpent", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isSpentArray", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "levels", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "nextIndex", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "nullifierHashes", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "permit2", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "permit2Commitments", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "permitCommitments", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "roots", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "token", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "tornadoProxyLight", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "verifiedCommitments", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "verifier", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "witness", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "zeros", data: BytesLike): Result;
}
export declare namespace DepositEvent {
type InputTuple = [
commitment: BytesLike,
leafIndex: BigNumberish,
timestamp: BigNumberish
];
type OutputTuple = [
commitment: string,
leafIndex: bigint,
timestamp: bigint
];
interface OutputObject {
commitment: string;
leafIndex: bigint;
timestamp: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace VerifiedCommitmentEvent {
type InputTuple = [commitment: BytesLike, owner: AddressLike];
type OutputTuple = [commitment: string, owner: string];
interface OutputObject {
commitment: string;
owner: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace WithdrawalEvent {
type InputTuple = [
to: AddressLike,
nullifierHash: BytesLike,
relayer: AddressLike,
fee: BigNumberish
];
type OutputTuple = [
to: string,
nullifierHash: string,
relayer: string,
fee: bigint
];
interface OutputObject {
to: string;
nullifierHash: string;
relayer: string;
fee: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export interface PermitTornado extends BaseContract {
connect(runner?: ContractRunner | null): PermitTornado;
waitForDeployment(): Promise<this>;
interface: PermitTornadoInterface;
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>;
COMMITMENT_TYPE: TypedContractMethod<[], [string], "view">;
COMMITMENT_TYPEHASH: TypedContractMethod<[], [string], "view">;
FIELD_SIZE: TypedContractMethod<[], [bigint], "view">;
ROOT_HISTORY_SIZE: TypedContractMethod<[], [bigint], "view">;
WITNESS_TYPE_STRING: TypedContractMethod<[], [string], "view">;
ZERO_VALUE: TypedContractMethod<[], [bigint], "view">;
commitments: TypedContractMethod<[arg0: BytesLike], [boolean], "view">;
currentRootIndex: TypedContractMethod<[], [bigint], "view">;
denomination: TypedContractMethod<[], [bigint], "view">;
deposit: TypedContractMethod<[_commitment: BytesLike], [void], "payable">;
depositCommitment: TypedContractMethod<[
_commitment: BytesLike,
owner: AddressLike
], [
void
], "nonpayable">;
filledSubtrees: TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getLastRoot: TypedContractMethod<[], [string], "view">;
hashLeftRight: TypedContractMethod<[
_hasher: AddressLike,
_left: BytesLike,
_right: BytesLike
], [
string
], "view">;
hasher: TypedContractMethod<[], [string], "view">;
isKnownRoot: TypedContractMethod<[_root: BytesLike], [boolean], "view">;
isSpent: TypedContractMethod<[_nullifierHash: BytesLike], [boolean], "view">;
isSpentArray: TypedContractMethod<[
_nullifierHashes: BytesLike[]
], [
boolean[]
], "view">;
levels: TypedContractMethod<[], [bigint], "view">;
nextIndex: TypedContractMethod<[], [bigint], "view">;
nullifierHashes: TypedContractMethod<[arg0: BytesLike], [boolean], "view">;
permit2: TypedContractMethod<[], [string], "view">;
permit2Commitments: TypedContractMethod<[
owner: AddressLike,
_commitments: BytesLike[],
nonce: BigNumberish,
deadline: BigNumberish,
_signature: BytesLike
], [
void
], "nonpayable">;
permitCommitments: TypedContractMethod<[
owner: AddressLike,
_commitments: BytesLike[],
v: BigNumberish,
r: BytesLike,
s: BytesLike
], [
void
], "nonpayable">;
roots: TypedContractMethod<[arg0: BigNumberish], [string], "view">;
token: TypedContractMethod<[], [string], "view">;
tornadoProxyLight: TypedContractMethod<[], [string], "view">;
verifiedCommitments: TypedContractMethod<[arg0: BytesLike], [string], "view">;
verifier: TypedContractMethod<[], [string], "view">;
withdraw: TypedContractMethod<[
_proof: BytesLike,
_root: BytesLike,
_nullifierHash: BytesLike,
_recipient: AddressLike,
_relayer: AddressLike,
_fee: BigNumberish,
_refund: BigNumberish
], [
void
], "payable">;
witness: TypedContractMethod<[
permitData: PermitTornado.PermitCommitmentsStruct
], [
string
], "view">;
zeros: TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: "COMMITMENT_TYPE"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "COMMITMENT_TYPEHASH"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "FIELD_SIZE"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "ROOT_HISTORY_SIZE"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "WITNESS_TYPE_STRING"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "ZERO_VALUE"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "commitments"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">;
getFunction(nameOrSignature: "currentRootIndex"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "denomination"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "deposit"): TypedContractMethod<[_commitment: BytesLike], [void], "payable">;
getFunction(nameOrSignature: "depositCommitment"): TypedContractMethod<[
_commitment: BytesLike,
owner: AddressLike
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "filledSubtrees"): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getFunction(nameOrSignature: "getLastRoot"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "hashLeftRight"): TypedContractMethod<[
_hasher: AddressLike,
_left: BytesLike,
_right: BytesLike
], [
string
], "view">;
getFunction(nameOrSignature: "hasher"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "isKnownRoot"): TypedContractMethod<[_root: BytesLike], [boolean], "view">;
getFunction(nameOrSignature: "isSpent"): TypedContractMethod<[_nullifierHash: BytesLike], [boolean], "view">;
getFunction(nameOrSignature: "isSpentArray"): TypedContractMethod<[_nullifierHashes: BytesLike[]], [boolean[]], "view">;
getFunction(nameOrSignature: "levels"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "nextIndex"): TypedContractMethod<[], [bigint], "view">;
getFunction(nameOrSignature: "nullifierHashes"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">;
getFunction(nameOrSignature: "permit2"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "permit2Commitments"): TypedContractMethod<[
owner: AddressLike,
_commitments: BytesLike[],
nonce: BigNumberish,
deadline: BigNumberish,
_signature: BytesLike
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "permitCommitments"): TypedContractMethod<[
owner: AddressLike,
_commitments: BytesLike[],
v: BigNumberish,
r: BytesLike,
s: BytesLike
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "roots"): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getFunction(nameOrSignature: "token"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "tornadoProxyLight"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "verifiedCommitments"): TypedContractMethod<[arg0: BytesLike], [string], "view">;
getFunction(nameOrSignature: "verifier"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "withdraw"): TypedContractMethod<[
_proof: BytesLike,
_root: BytesLike,
_nullifierHash: BytesLike,
_recipient: AddressLike,
_relayer: AddressLike,
_fee: BigNumberish,
_refund: BigNumberish
], [
void
], "payable">;
getFunction(nameOrSignature: "witness"): TypedContractMethod<[
permitData: PermitTornado.PermitCommitmentsStruct
], [
string
], "view">;
getFunction(nameOrSignature: "zeros"): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getEvent(key: "Deposit"): TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>;
getEvent(key: "VerifiedCommitment"): TypedContractEvent<VerifiedCommitmentEvent.InputTuple, VerifiedCommitmentEvent.OutputTuple, VerifiedCommitmentEvent.OutputObject>;
getEvent(key: "Withdrawal"): TypedContractEvent<WithdrawalEvent.InputTuple, WithdrawalEvent.OutputTuple, WithdrawalEvent.OutputObject>;
filters: {
"Deposit(bytes32,uint32,uint256)": TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>;
Deposit: TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>;
"VerifiedCommitment(bytes32,address)": TypedContractEvent<VerifiedCommitmentEvent.InputTuple, VerifiedCommitmentEvent.OutputTuple, VerifiedCommitmentEvent.OutputObject>;
VerifiedCommitment: TypedContractEvent<VerifiedCommitmentEvent.InputTuple, VerifiedCommitmentEvent.OutputTuple, VerifiedCommitmentEvent.OutputObject>;
"Withdrawal(address,bytes32,address,uint256)": TypedContractEvent<WithdrawalEvent.InputTuple, WithdrawalEvent.OutputTuple, WithdrawalEvent.OutputObject>;
Withdrawal: TypedContractEvent<WithdrawalEvent.InputTuple, WithdrawalEvent.OutputTuple, WithdrawalEvent.OutputObject>;
};
}