@d8x/perpetuals-sdk
Version:
Node TypeScript SDK for D8X Perpetual Futures
155 lines (154 loc) • 10.5 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";
export interface LimitOrderBookFactoryInterface extends Interface {
getFunction(nameOrSignature: "addExecutor" | "approvedExecutor" | "deployLimitOrderBookProxy" | "getBeacon" | "getImplementation" | "orderBooks" | "owner" | "removeExecutor" | "renounceOwnership" | "transferOwnership"): FunctionFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred" | "PerpetualLimitOrderBookDeployed" | "SetCallbackGasLimit" | "SetExecutor"): EventFragment;
encodeFunctionData(functionFragment: "addExecutor", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "approvedExecutor", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "deployLimitOrderBookProxy", values: [AddressLike, BigNumberish]): string;
encodeFunctionData(functionFragment: "getBeacon", values?: undefined): string;
encodeFunctionData(functionFragment: "getImplementation", values?: undefined): string;
encodeFunctionData(functionFragment: "orderBooks", values: [BigNumberish]): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "removeExecutor", values: [AddressLike]): string;
encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string;
encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string;
decodeFunctionResult(functionFragment: "addExecutor", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "approvedExecutor", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "deployLimitOrderBookProxy", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "getBeacon", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "getImplementation", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "orderBooks", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "removeExecutor", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result;
}
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 PerpetualLimitOrderBookDeployedEvent {
type InputTuple = [
perpetualId: BigNumberish,
perpManagerAddress: AddressLike,
limitOrderBookAddress: AddressLike
];
type OutputTuple = [
perpetualId: bigint,
perpManagerAddress: string,
limitOrderBookAddress: string
];
interface OutputObject {
perpetualId: bigint;
perpManagerAddress: string;
limitOrderBookAddress: string;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace SetCallbackGasLimitEvent {
type InputTuple = [perpetualId: BigNumberish, gasLimit: BigNumberish];
type OutputTuple = [perpetualId: bigint, gasLimit: bigint];
interface OutputObject {
perpetualId: bigint;
gasLimit: bigint;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export declare namespace SetExecutorEvent {
type InputTuple = [executor: AddressLike, authorized: boolean];
type OutputTuple = [executor: string, authorized: boolean];
interface OutputObject {
executor: string;
authorized: boolean;
}
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
type Filter = TypedDeferredTopicFilter<Event>;
type Log = TypedEventLog<Event>;
type LogDescription = TypedLogDescription<Event>;
}
export interface LimitOrderBookFactory extends BaseContract {
connect(runner?: ContractRunner | null): LimitOrderBookFactory;
waitForDeployment(): Promise<this>;
interface: LimitOrderBookFactoryInterface;
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>;
addExecutor: TypedContractMethod<[
_executor: AddressLike
], [
void
], "nonpayable">;
approvedExecutor: TypedContractMethod<[arg0: AddressLike], [boolean], "view">;
deployLimitOrderBookProxy: TypedContractMethod<[
_perpetualManagerAddr: AddressLike,
_perpetualId: BigNumberish
], [
void
], "nonpayable">;
getBeacon: TypedContractMethod<[], [string], "view">;
getImplementation: TypedContractMethod<[], [string], "view">;
orderBooks: TypedContractMethod<[arg0: BigNumberish], [string], "view">;
owner: TypedContractMethod<[], [string], "view">;
removeExecutor: TypedContractMethod<[
_executor: AddressLike
], [
void
], "nonpayable">;
renounceOwnership: TypedContractMethod<[], [void], "nonpayable">;
transferOwnership: TypedContractMethod<[
newOwner: AddressLike
], [
void
], "nonpayable">;
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
getFunction(nameOrSignature: "addExecutor"): TypedContractMethod<[_executor: AddressLike], [void], "nonpayable">;
getFunction(nameOrSignature: "approvedExecutor"): TypedContractMethod<[arg0: AddressLike], [boolean], "view">;
getFunction(nameOrSignature: "deployLimitOrderBookProxy"): TypedContractMethod<[
_perpetualManagerAddr: AddressLike,
_perpetualId: BigNumberish
], [
void
], "nonpayable">;
getFunction(nameOrSignature: "getBeacon"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "getImplementation"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "orderBooks"): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">;
getFunction(nameOrSignature: "removeExecutor"): TypedContractMethod<[_executor: AddressLike], [void], "nonpayable">;
getFunction(nameOrSignature: "renounceOwnership"): TypedContractMethod<[], [void], "nonpayable">;
getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">;
getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
getEvent(key: "PerpetualLimitOrderBookDeployed"): TypedContractEvent<PerpetualLimitOrderBookDeployedEvent.InputTuple, PerpetualLimitOrderBookDeployedEvent.OutputTuple, PerpetualLimitOrderBookDeployedEvent.OutputObject>;
getEvent(key: "SetCallbackGasLimit"): TypedContractEvent<SetCallbackGasLimitEvent.InputTuple, SetCallbackGasLimitEvent.OutputTuple, SetCallbackGasLimitEvent.OutputObject>;
getEvent(key: "SetExecutor"): TypedContractEvent<SetExecutorEvent.InputTuple, SetExecutorEvent.OutputTuple, SetExecutorEvent.OutputObject>;
filters: {
"OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
"PerpetualLimitOrderBookDeployed(uint24,address,address)": TypedContractEvent<PerpetualLimitOrderBookDeployedEvent.InputTuple, PerpetualLimitOrderBookDeployedEvent.OutputTuple, PerpetualLimitOrderBookDeployedEvent.OutputObject>;
PerpetualLimitOrderBookDeployed: TypedContractEvent<PerpetualLimitOrderBookDeployedEvent.InputTuple, PerpetualLimitOrderBookDeployedEvent.OutputTuple, PerpetualLimitOrderBookDeployedEvent.OutputObject>;
"SetCallbackGasLimit(uint24,uint32)": TypedContractEvent<SetCallbackGasLimitEvent.InputTuple, SetCallbackGasLimitEvent.OutputTuple, SetCallbackGasLimitEvent.OutputObject>;
SetCallbackGasLimit: TypedContractEvent<SetCallbackGasLimitEvent.InputTuple, SetCallbackGasLimitEvent.OutputTuple, SetCallbackGasLimitEvent.OutputObject>;
"SetExecutor(address,bool)": TypedContractEvent<SetExecutorEvent.InputTuple, SetExecutorEvent.OutputTuple, SetExecutorEvent.OutputObject>;
SetExecutor: TypedContractEvent<SetExecutorEvent.InputTuple, SetExecutorEvent.OutputTuple, SetExecutorEvent.OutputObject>;
};
}