@d8x/perpetuals-sdk
Version:
Node TypeScript SDK for D8X Perpetual Futures
841 lines (783 loc) • 23 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
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 PythStructs {
export type PriceStruct = {
price: BigNumberish;
conf: BigNumberish;
expo: BigNumberish;
publishTime: BigNumberish;
};
export type PriceStructOutput = [
price: bigint,
conf: bigint,
expo: bigint,
publishTime: bigint
] & { price: bigint; conf: bigint; expo: bigint; publishTime: bigint };
export type PriceFeedStruct = {
id: BytesLike;
price: PythStructs.PriceStruct;
emaPrice: PythStructs.PriceStruct;
};
export type PriceFeedStructOutput = [
id: string,
price: PythStructs.PriceStructOutput,
emaPrice: PythStructs.PriceStructOutput
] & {
id: string;
price: PythStructs.PriceStructOutput;
emaPrice: PythStructs.PriceStructOutput;
};
}
export interface OnDemandOracleUpgradeableInterface extends Interface {
getFunction(
nameOrSignature:
| "addSigner"
| "getEmaPrice"
| "getEmaPriceNoOlderThan"
| "getEmaPriceUnsafe"
| "getPrice"
| "getPriceNoOlderThan"
| "getPriceUnsafe"
| "getUpdateFee"
| "getValidTimePeriod"
| "initialize"
| "owner"
| "parsePriceFeedUpdates"
| "priceFeedExists"
| "proxiableUUID"
| "queryPriceFeed"
| "removeSigner"
| "renounceOwnership"
| "transferOwnership"
| "updatePriceFeeds"
| "updatePriceFeedsIfNecessary"
| "updateSingleUpdateFeeInWei"
| "updateValidTimePeriodSeconds"
| "upgradeTo"
| "upgradeToAndCall"
): FunctionFragment;
getEvent(
nameOrSignatureOrTopic:
| "AdminChanged"
| "BatchPriceFeedUpdate"
| "BeaconUpgraded"
| "OwnershipTransferred"
| "PriceFeedUpdate"
| "SignerAdded"
| "SignerRemoved"
| "Upgraded"
): EventFragment;
encodeFunctionData(
functionFragment: "addSigner",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "getEmaPrice",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "getEmaPriceNoOlderThan",
values: [BytesLike, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "getEmaPriceUnsafe",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "getPrice", values: [BytesLike]): string;
encodeFunctionData(
functionFragment: "getPriceNoOlderThan",
values: [BytesLike, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "getPriceUnsafe",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "getUpdateFee",
values: [BytesLike[]]
): string;
encodeFunctionData(
functionFragment: "getValidTimePeriod",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "initialize",
values?: undefined
): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "parsePriceFeedUpdates",
values: [BytesLike[], BytesLike[], BigNumberish, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "priceFeedExists",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "proxiableUUID",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "queryPriceFeed",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "removeSigner",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "updatePriceFeeds",
values: [BytesLike[]]
): string;
encodeFunctionData(
functionFragment: "updatePriceFeedsIfNecessary",
values: [BytesLike[], BytesLike[], BigNumberish[]]
): string;
encodeFunctionData(
functionFragment: "updateSingleUpdateFeeInWei",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "updateValidTimePeriodSeconds",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "upgradeTo",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "upgradeToAndCall",
values: [AddressLike, BytesLike]
): string;
decodeFunctionResult(functionFragment: "addSigner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "getEmaPrice",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getEmaPriceNoOlderThan",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getEmaPriceUnsafe",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "getPrice", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "getPriceNoOlderThan",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getPriceUnsafe",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getUpdateFee",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getValidTimePeriod",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "parsePriceFeedUpdates",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "priceFeedExists",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "proxiableUUID",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "queryPriceFeed",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "removeSigner",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "updatePriceFeeds",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "updatePriceFeedsIfNecessary",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "updateSingleUpdateFeeInWei",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "updateValidTimePeriodSeconds",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "upgradeTo", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "upgradeToAndCall",
data: BytesLike
): Result;
}
export namespace AdminChangedEvent {
export type InputTuple = [previousAdmin: AddressLike, newAdmin: AddressLike];
export type OutputTuple = [previousAdmin: string, newAdmin: string];
export interface OutputObject {
previousAdmin: string;
newAdmin: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace BatchPriceFeedUpdateEvent {
export type InputTuple = [
chainId: BigNumberish,
sequenceNumber: BigNumberish
];
export type OutputTuple = [chainId: bigint, sequenceNumber: bigint];
export interface OutputObject {
chainId: bigint;
sequenceNumber: bigint;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace BeaconUpgradedEvent {
export type InputTuple = [beacon: AddressLike];
export type OutputTuple = [beacon: string];
export interface OutputObject {
beacon: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace OwnershipTransferredEvent {
export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike];
export type OutputTuple = [previousOwner: string, newOwner: string];
export interface OutputObject {
previousOwner: string;
newOwner: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace PriceFeedUpdateEvent {
export type InputTuple = [
id: BytesLike,
publishTime: BigNumberish,
price: BigNumberish,
conf: BigNumberish
];
export type OutputTuple = [
id: string,
publishTime: bigint,
price: bigint,
conf: bigint
];
export interface OutputObject {
id: string;
publishTime: bigint;
price: bigint;
conf: bigint;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace SignerAddedEvent {
export type InputTuple = [newSigner: AddressLike];
export type OutputTuple = [newSigner: string];
export interface OutputObject {
newSigner: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace SignerRemovedEvent {
export type InputTuple = [signer: AddressLike];
export type OutputTuple = [signer: string];
export interface OutputObject {
signer: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export namespace UpgradedEvent {
export type InputTuple = [implementation: AddressLike];
export type OutputTuple = [implementation: string];
export interface OutputObject {
implementation: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}
export interface OnDemandOracleUpgradeable extends BaseContract {
connect(runner?: ContractRunner | null): OnDemandOracleUpgradeable;
waitForDeployment(): Promise<this>;
interface: OnDemandOracleUpgradeableInterface;
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>;
addSigner: TypedContractMethod<
[_newSigner: AddressLike],
[void],
"nonpayable"
>;
getEmaPrice: TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getEmaPriceNoOlderThan: TypedContractMethod<
[id: BytesLike, age: BigNumberish],
[PythStructs.PriceStructOutput],
"view"
>;
getEmaPriceUnsafe: TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getPrice: TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getPriceNoOlderThan: TypedContractMethod<
[id: BytesLike, age: BigNumberish],
[PythStructs.PriceStructOutput],
"view"
>;
getPriceUnsafe: TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getUpdateFee: TypedContractMethod<
[updateData: BytesLike[]],
[bigint],
"view"
>;
getValidTimePeriod: TypedContractMethod<[], [bigint], "view">;
initialize: TypedContractMethod<[], [void], "nonpayable">;
owner: TypedContractMethod<[], [string], "view">;
parsePriceFeedUpdates: TypedContractMethod<
[
arg0: BytesLike[],
arg1: BytesLike[],
arg2: BigNumberish,
arg3: BigNumberish
],
[PythStructs.PriceFeedStructOutput[]],
"payable"
>;
priceFeedExists: TypedContractMethod<[id: BytesLike], [boolean], "view">;
proxiableUUID: TypedContractMethod<[], [string], "view">;
queryPriceFeed: TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceFeedStructOutput],
"view"
>;
removeSigner: TypedContractMethod<
[_signer: AddressLike],
[void],
"nonpayable"
>;
renounceOwnership: TypedContractMethod<[], [void], "nonpayable">;
transferOwnership: TypedContractMethod<
[newOwner: AddressLike],
[void],
"nonpayable"
>;
updatePriceFeeds: TypedContractMethod<
[updateData: BytesLike[]],
[void],
"payable"
>;
updatePriceFeedsIfNecessary: TypedContractMethod<
[
updateData: BytesLike[],
priceIds: BytesLike[],
publishTimes: BigNumberish[]
],
[void],
"payable"
>;
updateSingleUpdateFeeInWei: TypedContractMethod<
[newFee: BigNumberish],
[void],
"nonpayable"
>;
updateValidTimePeriodSeconds: TypedContractMethod<
[newValidTimePeriodSeconds: BigNumberish],
[void],
"nonpayable"
>;
upgradeTo: TypedContractMethod<
[newImplementation: AddressLike],
[void],
"nonpayable"
>;
upgradeToAndCall: TypedContractMethod<
[newImplementation: AddressLike, data: BytesLike],
[void],
"payable"
>;
getFunction<T extends ContractMethod = ContractMethod>(
key: string | FunctionFragment
): T;
getFunction(
nameOrSignature: "addSigner"
): TypedContractMethod<[_newSigner: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "getEmaPrice"
): TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getFunction(
nameOrSignature: "getEmaPriceNoOlderThan"
): TypedContractMethod<
[id: BytesLike, age: BigNumberish],
[PythStructs.PriceStructOutput],
"view"
>;
getFunction(
nameOrSignature: "getEmaPriceUnsafe"
): TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getFunction(
nameOrSignature: "getPrice"
): TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getFunction(
nameOrSignature: "getPriceNoOlderThan"
): TypedContractMethod<
[id: BytesLike, age: BigNumberish],
[PythStructs.PriceStructOutput],
"view"
>;
getFunction(
nameOrSignature: "getPriceUnsafe"
): TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceStructOutput],
"view"
>;
getFunction(
nameOrSignature: "getUpdateFee"
): TypedContractMethod<[updateData: BytesLike[]], [bigint], "view">;
getFunction(
nameOrSignature: "getValidTimePeriod"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "initialize"
): TypedContractMethod<[], [void], "nonpayable">;
getFunction(
nameOrSignature: "owner"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "parsePriceFeedUpdates"
): TypedContractMethod<
[
arg0: BytesLike[],
arg1: BytesLike[],
arg2: BigNumberish,
arg3: BigNumberish
],
[PythStructs.PriceFeedStructOutput[]],
"payable"
>;
getFunction(
nameOrSignature: "priceFeedExists"
): TypedContractMethod<[id: BytesLike], [boolean], "view">;
getFunction(
nameOrSignature: "proxiableUUID"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "queryPriceFeed"
): TypedContractMethod<
[id: BytesLike],
[PythStructs.PriceFeedStructOutput],
"view"
>;
getFunction(
nameOrSignature: "removeSigner"
): TypedContractMethod<[_signer: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "renounceOwnership"
): TypedContractMethod<[], [void], "nonpayable">;
getFunction(
nameOrSignature: "transferOwnership"
): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "updatePriceFeeds"
): TypedContractMethod<[updateData: BytesLike[]], [void], "payable">;
getFunction(
nameOrSignature: "updatePriceFeedsIfNecessary"
): TypedContractMethod<
[
updateData: BytesLike[],
priceIds: BytesLike[],
publishTimes: BigNumberish[]
],
[void],
"payable"
>;
getFunction(
nameOrSignature: "updateSingleUpdateFeeInWei"
): TypedContractMethod<[newFee: BigNumberish], [void], "nonpayable">;
getFunction(
nameOrSignature: "updateValidTimePeriodSeconds"
): TypedContractMethod<
[newValidTimePeriodSeconds: BigNumberish],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "upgradeTo"
): TypedContractMethod<
[newImplementation: AddressLike],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "upgradeToAndCall"
): TypedContractMethod<
[newImplementation: AddressLike, data: BytesLike],
[void],
"payable"
>;
getEvent(
key: "AdminChanged"
): TypedContractEvent<
AdminChangedEvent.InputTuple,
AdminChangedEvent.OutputTuple,
AdminChangedEvent.OutputObject
>;
getEvent(
key: "BatchPriceFeedUpdate"
): TypedContractEvent<
BatchPriceFeedUpdateEvent.InputTuple,
BatchPriceFeedUpdateEvent.OutputTuple,
BatchPriceFeedUpdateEvent.OutputObject
>;
getEvent(
key: "BeaconUpgraded"
): TypedContractEvent<
BeaconUpgradedEvent.InputTuple,
BeaconUpgradedEvent.OutputTuple,
BeaconUpgradedEvent.OutputObject
>;
getEvent(
key: "OwnershipTransferred"
): TypedContractEvent<
OwnershipTransferredEvent.InputTuple,
OwnershipTransferredEvent.OutputTuple,
OwnershipTransferredEvent.OutputObject
>;
getEvent(
key: "PriceFeedUpdate"
): TypedContractEvent<
PriceFeedUpdateEvent.InputTuple,
PriceFeedUpdateEvent.OutputTuple,
PriceFeedUpdateEvent.OutputObject
>;
getEvent(
key: "SignerAdded"
): TypedContractEvent<
SignerAddedEvent.InputTuple,
SignerAddedEvent.OutputTuple,
SignerAddedEvent.OutputObject
>;
getEvent(
key: "SignerRemoved"
): TypedContractEvent<
SignerRemovedEvent.InputTuple,
SignerRemovedEvent.OutputTuple,
SignerRemovedEvent.OutputObject
>;
getEvent(
key: "Upgraded"
): TypedContractEvent<
UpgradedEvent.InputTuple,
UpgradedEvent.OutputTuple,
UpgradedEvent.OutputObject
>;
filters: {
"AdminChanged(address,address)": TypedContractEvent<
AdminChangedEvent.InputTuple,
AdminChangedEvent.OutputTuple,
AdminChangedEvent.OutputObject
>;
AdminChanged: TypedContractEvent<
AdminChangedEvent.InputTuple,
AdminChangedEvent.OutputTuple,
AdminChangedEvent.OutputObject
>;
"BatchPriceFeedUpdate(uint16,uint64)": TypedContractEvent<
BatchPriceFeedUpdateEvent.InputTuple,
BatchPriceFeedUpdateEvent.OutputTuple,
BatchPriceFeedUpdateEvent.OutputObject
>;
BatchPriceFeedUpdate: TypedContractEvent<
BatchPriceFeedUpdateEvent.InputTuple,
BatchPriceFeedUpdateEvent.OutputTuple,
BatchPriceFeedUpdateEvent.OutputObject
>;
"BeaconUpgraded(address)": TypedContractEvent<
BeaconUpgradedEvent.InputTuple,
BeaconUpgradedEvent.OutputTuple,
BeaconUpgradedEvent.OutputObject
>;
BeaconUpgraded: TypedContractEvent<
BeaconUpgradedEvent.InputTuple,
BeaconUpgradedEvent.OutputTuple,
BeaconUpgradedEvent.OutputObject
>;
"OwnershipTransferred(address,address)": TypedContractEvent<
OwnershipTransferredEvent.InputTuple,
OwnershipTransferredEvent.OutputTuple,
OwnershipTransferredEvent.OutputObject
>;
OwnershipTransferred: TypedContractEvent<
OwnershipTransferredEvent.InputTuple,
OwnershipTransferredEvent.OutputTuple,
OwnershipTransferredEvent.OutputObject
>;
"PriceFeedUpdate(bytes32,uint64,int64,uint64)": TypedContractEvent<
PriceFeedUpdateEvent.InputTuple,
PriceFeedUpdateEvent.OutputTuple,
PriceFeedUpdateEvent.OutputObject
>;
PriceFeedUpdate: TypedContractEvent<
PriceFeedUpdateEvent.InputTuple,
PriceFeedUpdateEvent.OutputTuple,
PriceFeedUpdateEvent.OutputObject
>;
"SignerAdded(address)": TypedContractEvent<
SignerAddedEvent.InputTuple,
SignerAddedEvent.OutputTuple,
SignerAddedEvent.OutputObject
>;
SignerAdded: TypedContractEvent<
SignerAddedEvent.InputTuple,
SignerAddedEvent.OutputTuple,
SignerAddedEvent.OutputObject
>;
"SignerRemoved(address)": TypedContractEvent<
SignerRemovedEvent.InputTuple,
SignerRemovedEvent.OutputTuple,
SignerRemovedEvent.OutputObject
>;
SignerRemoved: TypedContractEvent<
SignerRemovedEvent.InputTuple,
SignerRemovedEvent.OutputTuple,
SignerRemovedEvent.OutputObject
>;
"Upgraded(address)": TypedContractEvent<
UpgradedEvent.InputTuple,
UpgradedEvent.OutputTuple,
UpgradedEvent.OutputObject
>;
Upgraded: TypedContractEvent<
UpgradedEvent.InputTuple,
UpgradedEvent.OutputTuple,
UpgradedEvent.OutputObject
>;
};
}