UNPKG

@descent-protocol/sdk

Version:

A Typescript library for interacting with the Descent Protocol

178 lines (177 loc) 12 kB
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 interface FeedInterface extends Interface { getFunction(nameOrSignature: "cancelOwnershipHandover" | "collaterals" | "completeOwnershipHandover" | "mockUpdatePrice" | "owner" | "ownershipHandoverExpiresAt" | "pause" | "renounceOwnership" | "requestOwnershipHandover" | "setCollateralOSM" | "status" | "transferOwnership" | "unpause" | "updatePrice" | "vault"): FunctionFragment; getEvent(nameOrSignatureOrTopic: "OwnershipHandoverCanceled" | "OwnershipHandoverRequested" | "OwnershipTransferred" | "Read"): EventFragment; encodeFunctionData(functionFragment: "cancelOwnershipHandover", values?: undefined): string; encodeFunctionData(functionFragment: "collaterals", values: [AddressLike]): string; encodeFunctionData(functionFragment: "completeOwnershipHandover", values: [AddressLike]): string; encodeFunctionData(functionFragment: "mockUpdatePrice", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "owner", values?: undefined): string; encodeFunctionData(functionFragment: "ownershipHandoverExpiresAt", values: [AddressLike]): string; encodeFunctionData(functionFragment: "pause", values?: undefined): string; encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string; encodeFunctionData(functionFragment: "requestOwnershipHandover", values?: undefined): string; encodeFunctionData(functionFragment: "setCollateralOSM", values: [AddressLike, AddressLike]): string; encodeFunctionData(functionFragment: "status", values?: undefined): string; encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string; encodeFunctionData(functionFragment: "unpause", values?: undefined): string; encodeFunctionData(functionFragment: "updatePrice", values: [AddressLike]): string; encodeFunctionData(functionFragment: "vault", values?: undefined): string; decodeFunctionResult(functionFragment: "cancelOwnershipHandover", data: BytesLike): Result; decodeFunctionResult(functionFragment: "collaterals", data: BytesLike): Result; decodeFunctionResult(functionFragment: "completeOwnershipHandover", data: BytesLike): Result; decodeFunctionResult(functionFragment: "mockUpdatePrice", data: BytesLike): Result; decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; decodeFunctionResult(functionFragment: "ownershipHandoverExpiresAt", data: BytesLike): Result; decodeFunctionResult(functionFragment: "pause", data: BytesLike): Result; decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result; decodeFunctionResult(functionFragment: "requestOwnershipHandover", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setCollateralOSM", data: BytesLike): Result; decodeFunctionResult(functionFragment: "status", data: BytesLike): Result; decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result; decodeFunctionResult(functionFragment: "unpause", data: BytesLike): Result; decodeFunctionResult(functionFragment: "updatePrice", data: BytesLike): Result; decodeFunctionResult(functionFragment: "vault", data: BytesLike): Result; } export declare namespace OwnershipHandoverCanceledEvent { type InputTuple = [pendingOwner: AddressLike]; type OutputTuple = [pendingOwner: string]; interface OutputObject { pendingOwner: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace OwnershipHandoverRequestedEvent { type InputTuple = [pendingOwner: AddressLike]; type OutputTuple = [pendingOwner: string]; interface OutputObject { pendingOwner: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace OwnershipTransferredEvent { type InputTuple = [oldOwner: AddressLike, newOwner: AddressLike]; type OutputTuple = [oldOwner: string, newOwner: string]; interface OutputObject { oldOwner: string; newOwner: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace ReadEvent { type InputTuple = [collateral: AddressLike, price: BigNumberish]; type OutputTuple = [collateral: string, price: bigint]; interface OutputObject { collateral: string; price: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export interface Feed extends BaseContract { connect(runner?: ContractRunner | null): Feed; waitForDeployment(): Promise<this>; interface: FeedInterface; 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>; cancelOwnershipHandover: TypedContractMethod<[], [void], "payable">; collaterals: TypedContractMethod<[arg0: AddressLike], [string], "view">; completeOwnershipHandover: TypedContractMethod<[ pendingOwner: AddressLike ], [ void ], "payable">; mockUpdatePrice: TypedContractMethod<[ collateral: AddressLike, price: BigNumberish ], [ void ], "nonpayable">; owner: TypedContractMethod<[], [string], "view">; ownershipHandoverExpiresAt: TypedContractMethod<[ pendingOwner: AddressLike ], [ bigint ], "view">; pause: TypedContractMethod<[], [void], "nonpayable">; renounceOwnership: TypedContractMethod<[], [void], "payable">; requestOwnershipHandover: TypedContractMethod<[], [void], "payable">; setCollateralOSM: TypedContractMethod<[ collateral: AddressLike, oracle: AddressLike ], [ void ], "nonpayable">; status: TypedContractMethod<[], [bigint], "view">; transferOwnership: TypedContractMethod<[ newOwner: AddressLike ], [ void ], "payable">; unpause: TypedContractMethod<[], [void], "nonpayable">; updatePrice: TypedContractMethod<[ collateral: AddressLike ], [ void ], "nonpayable">; vault: TypedContractMethod<[], [string], "view">; getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T; getFunction(nameOrSignature: "cancelOwnershipHandover"): TypedContractMethod<[], [void], "payable">; getFunction(nameOrSignature: "collaterals"): TypedContractMethod<[arg0: AddressLike], [string], "view">; getFunction(nameOrSignature: "completeOwnershipHandover"): TypedContractMethod<[pendingOwner: AddressLike], [void], "payable">; getFunction(nameOrSignature: "mockUpdatePrice"): TypedContractMethod<[ collateral: AddressLike, price: BigNumberish ], [ void ], "nonpayable">; getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "ownershipHandoverExpiresAt"): TypedContractMethod<[pendingOwner: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "pause"): TypedContractMethod<[], [void], "nonpayable">; getFunction(nameOrSignature: "renounceOwnership"): TypedContractMethod<[], [void], "payable">; getFunction(nameOrSignature: "requestOwnershipHandover"): TypedContractMethod<[], [void], "payable">; getFunction(nameOrSignature: "setCollateralOSM"): TypedContractMethod<[ collateral: AddressLike, oracle: AddressLike ], [ void ], "nonpayable">; getFunction(nameOrSignature: "status"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[newOwner: AddressLike], [void], "payable">; getFunction(nameOrSignature: "unpause"): TypedContractMethod<[], [void], "nonpayable">; getFunction(nameOrSignature: "updatePrice"): TypedContractMethod<[collateral: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "vault"): TypedContractMethod<[], [string], "view">; getEvent(key: "OwnershipHandoverCanceled"): TypedContractEvent<OwnershipHandoverCanceledEvent.InputTuple, OwnershipHandoverCanceledEvent.OutputTuple, OwnershipHandoverCanceledEvent.OutputObject>; getEvent(key: "OwnershipHandoverRequested"): TypedContractEvent<OwnershipHandoverRequestedEvent.InputTuple, OwnershipHandoverRequestedEvent.OutputTuple, OwnershipHandoverRequestedEvent.OutputObject>; getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>; getEvent(key: "Read"): TypedContractEvent<ReadEvent.InputTuple, ReadEvent.OutputTuple, ReadEvent.OutputObject>; filters: { "OwnershipHandoverCanceled(address)": TypedContractEvent<OwnershipHandoverCanceledEvent.InputTuple, OwnershipHandoverCanceledEvent.OutputTuple, OwnershipHandoverCanceledEvent.OutputObject>; OwnershipHandoverCanceled: TypedContractEvent<OwnershipHandoverCanceledEvent.InputTuple, OwnershipHandoverCanceledEvent.OutputTuple, OwnershipHandoverCanceledEvent.OutputObject>; "OwnershipHandoverRequested(address)": TypedContractEvent<OwnershipHandoverRequestedEvent.InputTuple, OwnershipHandoverRequestedEvent.OutputTuple, OwnershipHandoverRequestedEvent.OutputObject>; OwnershipHandoverRequested: TypedContractEvent<OwnershipHandoverRequestedEvent.InputTuple, OwnershipHandoverRequestedEvent.OutputTuple, OwnershipHandoverRequestedEvent.OutputObject>; "OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>; OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>; "Read(address,uint256)": TypedContractEvent<ReadEvent.InputTuple, ReadEvent.OutputTuple, ReadEvent.OutputObject>; Read: TypedContractEvent<ReadEvent.InputTuple, ReadEvent.OutputTuple, ReadEvent.OutputObject>; }; }