@electra.finance/contracts
Version:
Electra Finance contracts typings
161 lines (160 loc) • 9.76 kB
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.js";
export interface CFDVaultInterface extends Interface {
getFunction(nameOrSignature: "collateral" | "deposit" | "depositTo" | "initialize" | "owner" | "renounceOwnership" | "setAuthority" | "transferOwnership" | "vaultAuthority" | "withdraw"): FunctionFragment;
getEvent(nameOrSignatureOrTopic: "Deposit" | "Initialized" | "OwnershipTransferred" | "Withdrawal"): EventFragment;
encodeFunctionData(functionFragment: "collateral", values?: undefined): string;
encodeFunctionData(functionFragment: "deposit", values: [BigNumberish]): string;
encodeFunctionData(functionFragment: "depositTo", values: [BigNumberish, AddressLike]): string;
encodeFunctionData(functionFragment: "initialize", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string;
encodeFunctionData(functionFragment: "setAuthority", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "vaultAuthority", values?: undefined): string;
encodeFunctionData(functionFragment: "withdraw", values: [BigNumberish, AddressLike]): string;
decodeFunctionResult(functionFragment: "collateral", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "depositTo", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setAuthority", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "vaultAuthority", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
}
export declare namespace DepositEvent {
type InputTuple = [
from: AddressLike,
amount: BigNumberish,
token: AddressLike
];
type OutputTuple = [from: string, amount: bigint, token: string];
interface OutputObject {
from: string;
amount: bigint;
token: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace InitializedEvent {
type InputTuple = [version: BigNumberish];
type OutputTuple = [version: bigint];
interface OutputObject {
version: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace OwnershipTransferredEvent {
type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike];
type OutputTuple = [previousOwner: string, newOwner: string];
interface OutputObject {
previousOwner: string;
newOwner: 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,
amount: BigNumberish,
token: AddressLike
];
type OutputTuple = [to: string, amount: bigint, token: string];
interface OutputObject {
to: string;
amount: bigint;
token: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export interface CFDVault extends BaseContract {
connect(runner?: ContractRunner | null): CFDVault;
waitForDeployment(): Promise<this>;
interface: CFDVaultInterface;
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>;
collateral: TypedContractMethod<[], [string], "view">;
deposit: TypedContractMethod<[amount: BigNumberish], [void], "nonpayable">;
depositTo: TypedContractMethod<[
amount: BigNumberish,
from: AddressLike
], [
void
], "nonpayable">;
initialize: TypedContractMethod<[], [void], "nonpayable">;
owner: TypedContractMethod<[], [string], "view">;
renounceOwnership: TypedContractMethod<[], [void], "nonpayable">;
setAuthority: TypedContractMethod<[
vaultAuthority_: AddressLike
], [
void
], "nonpayable">;
transferOwnership: TypedContractMethod<[
newOwner: AddressLike
], [
void
], "nonpayable">;
vaultAuthority: TypedContractMethod<[], [string], "view">;
withdraw: TypedContractMethod<[
amount: BigNumberish,
to: AddressLike
], [
void
], "nonpayable">;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: "collateral"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "deposit"): TypedContractMethod<[amount: BigNumberish], [void], "nonpayable">;
getFunction(nameOrSignature: "depositTo"): TypedContractMethod<[
amount: BigNumberish,
from: AddressLike
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "initialize"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "renounceOwnership"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "setAuthority"): TypedContractMethod<[vaultAuthority_: AddressLike], [void], "nonpayable">;
getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">;
getFunction(nameOrSignature: "vaultAuthority"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "withdraw"): TypedContractMethod<[
amount: BigNumberish,
to: AddressLike
], [
void
], "nonpayable">;
getEvent(key: "Deposit"): TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>;
getEvent(key: "Initialized"): TypedContractEvent<InitializedEvent.InputTuple, InitializedEvent.OutputTuple, InitializedEvent.OutputObject>;
getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
getEvent(key: "Withdrawal"): TypedContractEvent<WithdrawalEvent.InputTuple, WithdrawalEvent.OutputTuple, WithdrawalEvent.OutputObject>;
filters: {
"Deposit(address,uint256,address)": TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>;
Deposit: TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>;
"Initialized(uint8)": TypedContractEvent<InitializedEvent.InputTuple, InitializedEvent.OutputTuple, InitializedEvent.OutputObject>;
Initialized: TypedContractEvent<InitializedEvent.InputTuple, InitializedEvent.OutputTuple, InitializedEvent.OutputObject>;
"OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
"Withdrawal(address,uint256,address)": TypedContractEvent<WithdrawalEvent.InputTuple, WithdrawalEvent.OutputTuple, WithdrawalEvent.OutputObject>;
Withdrawal: TypedContractEvent<WithdrawalEvent.InputTuple, WithdrawalEvent.OutputTuple, WithdrawalEvent.OutputObject>;
};
}