import Big from "big.js"; import { ContractName } from "../../contracts"; import { Channel, ChannelEventSource } from "../../internal"; import { NonSettlementCollateralToken } from "../wallet/NonSettlementCollateralToken"; import { SettlementToken } from "../wallet/SettlementToken"; import type { PerpetualProtocol } from "../PerpetualProtocol"; export declare type VaultEventName = "updated" | "accountValueUpdated" | "balanceListUpdated" | "freeCollateralUpdated" | "freeCollateralListUpdated" | "updatedVaultDataAll" | "updateError"; declare class Vault extends Channel { private readonly _perp; readonly account: string; private readonly _contract; private readonly _contractReader; private _cache; constructor(_perp: PerpetualProtocol, account: string); getAccountValue({ cache }?: { cache?: boolean | undefined; }): Promise; getBalanceList({ cache }?: { cache?: boolean | undefined; }): Promise; getFreeCollateral({ cache }?: { cache?: boolean | undefined; }): Promise; getFreeCollateralList({ cache }?: { cache?: boolean | undefined; }): Promise; deposit(token: NonSettlementCollateralToken | SettlementToken, amount: Big): Promise<{ transaction: import("ethers").ContractTransaction; metadata: { contractName: ContractName; contractFunctionName: keyof import("ethers").Contract; args: unknown[]; txPayload: { from?: string | undefined; to?: string | undefined; inputData?: string | undefined; } | { from: string; to: string; value: import("ethers").BigNumber | undefined; inputData: string; }; }; gasLimit: string; }>; depositETH(amount: Big): Promise<{ transaction: import("ethers").ContractTransaction; metadata: { contractName: ContractName; contractFunctionName: keyof import("ethers").Contract; args: unknown[]; txPayload: { from?: string | undefined; to?: string | undefined; inputData?: string | undefined; } | { from: string; to: string; value: import("ethers").BigNumber | undefined; inputData: string; }; }; gasLimit: string; }>; withdraw(token: NonSettlementCollateralToken | SettlementToken, amount: Big): Promise<{ transaction: import("ethers").ContractTransaction; metadata: { contractName: ContractName; contractFunctionName: keyof import("ethers").Contract; args: unknown[]; txPayload: { from?: string | undefined; to?: string | undefined; inputData?: string | undefined; } | { from: string; to: string; value: import("ethers").BigNumber | undefined; inputData: string; }; }; gasLimit: string; }>; withdrawETH(amount: Big): Promise<{ transaction: import("ethers").ContractTransaction; metadata: { contractName: ContractName; contractFunctionName: keyof import("ethers").Contract; args: unknown[]; txPayload: { from?: string | undefined; to?: string | undefined; inputData?: string | undefined; } | { from: string; to: string; value: import("ethers").BigNumber | undefined; inputData: string; }; }; gasLimit: string; }>; withdrawAll(token: NonSettlementCollateralToken | SettlementToken): Promise<{ transaction: import("ethers").ContractTransaction; metadata: { contractName: ContractName; contractFunctionName: keyof import("ethers").Contract; args: unknown[]; txPayload: { from?: string | undefined; to?: string | undefined; inputData?: string | undefined; } | { from: string; to: string; value: import("ethers").BigNumber | undefined; inputData: string; }; }; gasLimit: string; }>; withdrawAllEther(): Promise<{ transaction: import("ethers").ContractTransaction; metadata: { contractName: ContractName; contractFunctionName: keyof import("ethers").Contract; args: unknown[]; txPayload: { from?: string | undefined; to?: string | undefined; inputData?: string | undefined; } | { from: string; to: string; value: import("ethers").BigNumber | undefined; inputData: string; }; }; gasLimit: string; }>; protected _getEventSourceMap(): { accountValueUpdated: ChannelEventSource; balanceListUpdated: ChannelEventSource; freeCollateralUpdated: ChannelEventSource; freeCollateralListUpdated: ChannelEventSource; updatedVaultDataAll: ChannelEventSource; }; private _fetchUpdateData; private _fetch; private _createFetchAndEmitAccountValueUpdated; private _createFetchAndEmitBalanceListUpdated; private _createFetchAndEmitFreeCollateralUpdated; private _createFetchAndEmitFreeCollateralListUpdated; protected getVaultDataAll(): Promise; } export { Vault }; export declare type VaultDataAllByCollateral = { [key: string]: { freeCollateral: Big; balance: Big; }; }; export declare type VaultDataAllCrossCollateral = { accountBalance: Big; accountFreeCollateral: Big; }; export declare type VaultDataAll = { vaultDataAllByCollateral: VaultDataAllByCollateral; vaultDataAllCrossCollateral: VaultDataAllCrossCollateral; };