import { BigNumberish, ContractTransaction, ContractTransactionResponse, Provider } from 'ethers'; import { ActionAuthorization, LiquidityPositionExtended, OptionPositionExtended, OrderType, TransactionData, User, UserExtended, UserPortfolio, UserPortfolioExtended, UserSnapshot, UserSnapshotExtended } from '../entities'; import { BaseAPI } from './baseAPI'; /** * @class UserAPI * * The UserAPI class extends the BaseAPI and provides methods to interact with the user data. * It implements caching mechanisms to optimize the repeated fetching of data. * * @extends {BaseAPI} */ export declare class UserAPI extends BaseAPI { /** * Fetches a User based on the provided address. * * @param {string} address - The address of the User to fetch. * @returns {Promise} A promise that resolves to a User object. */ getUser(address: string): Promise; /** * Fetches an extended User based on the provided address. * * @param {string} address - The address of the User to fetch. * @returns {Promise} A promise that resolves to a UserExtended object. */ getUserExtended(address: string): Promise; /** * Fetches multiple Users based on the provided addresses. * * @param {string[]} addresses - An array of addresses of Users to fetch. * @returns {Promise} A promise that resolves to an array of User objects. */ getUsers(addresses: string[]): Promise; /** * Fetches multiple extended Users based on the provided addresses. * * @param {string[]} addresses - An array of addresses of Users to fetch. * @returns {Promise} A promise that resolves to an array of UserExtended objects. */ getUsersExtended(addresses: string[]): Promise; /** * Fetches a UserSnapshot for a specific User at a specific timestamp. * * @param {string} address - The address of the User to fetch the snapshot for. * @param {BigNumberish} timestamp - The timestamp for the snapshot. * @returns {Promise} A promise that resolves to a UserSnapshot object. */ getUserSnapshot(address: string, timestamp: BigNumberish): Promise; /** * Fetches an extended snapshot of a User at a specified timestamp. * * @param {string} address - The address of the User to fetch. * @param {BigNumberish} timestamp - The timestamp of the User snapshot. * @returns {Promise} A promise that resolves to a UserSnapshotExtended object. */ getUserSnapshotExtended(address: string, timestamp: BigNumberish): Promise; /** * Fetches multiple snapshots of a User within a specified time frame. * * @method getUserSnapshots * @param {string} address - The address of the User to fetch. * @param {BigNumberish} startTime - The start time of the time frame. * @param {BigNumberish} endTime - The end time of the time frame. * @param {string} [orderBy='timestamp'] - The field to order the snapshots by. Default is 'timestamp'. * @param {string} [order='ASC'] - The order of the snapshots. Default is 'ASC'. * @param {number} [limit=100] - The number of snapshots to fetch. Default is 100. * @param {number} [skip=0] - The number of snapshots to skip. Default is 0. * @returns {Promise} A promise that resolves to an array of UserSnapshot objects. */ getUserSnapshots(address: string, startTime: BigNumberish, endTime: BigNumberish, orderBy?: string, order?: string, limit?: number, skip?: number): Promise; /** * Fetches multiple extended snapshots of a User within a specified time frame. * * @param {string} address - The address of the User to fetch. * @param {BigNumberish} startTime - The start time of the time frame. * @param {BigNumberish} endTime - The end time of the time frame. * @param {string} [orderBy='timestamp'] - The field to order the snapshots by. Default is 'timestamp'. * @param {string} [order='ASC'] - The order of the snapshots. Default is 'ASC'. * @param {number} [limit=100] - The number of snapshots to fetch. Default is 100. * @param {number} [skip=0] - The number of snapshots to skip. Default is 0. * @returns {Promise} A promise that resolves to an array of UserSnapshotExtended objects. */ getUserSnapshotsExtended(address: string, startTime: BigNumberish, endTime: BigNumberish, orderBy?: string, order?: string, limit?: number, skip?: number): Promise; /** * Fetches a portfolio of a User. * * @param {string} address - The address of the User to fetch. * @returns {Promise} A promise that resolves to a UserPortfolio object. */ getUserPortfolio(address: string): Promise; /** * Fetches an extended portfolio of a User. * * @param {string} address - The address of the User to fetch. * @returns {Promise} A promise that resolves to a UserPortfolioExtended object. */ getUserPortfolioExtended(address: string): Promise; /** * Retrieves extended option positions for a given user. * * @param {string} owner - The address of the user for whom to retrieve option positions. * @param {boolean} [isOpen] - Optional parameter that if set to true, only returns open option positions. * If set to false, returns closed option positions. If omitted, returns all option positions. * * @returns {Promise} A promise that resolves to an array of extended option positions for the given user. */ getOptionPositionsExtendedForUser(owner: string, isOpen?: boolean): Promise; /** * Retrieves extended reward option positions for a given user. * * @param {string} owner - The address of the user for whom to retrieve option positions. * @param {number} timestamp - Timestamp to check maturity of the option. * @param {boolean} [isOpen] - Optional parameter that if set to true, only returns open option positions. * If set to false, returns closed option positions. If omitted, returns all option positions. * * @returns {Promise} A promise that resolves to an array of extended option positions for the given user. */ getRewardOptionPositionsExtendedForUser(owner: string, timestamp?: number, isOpen?: boolean): Promise; /** * Retrieves extended liquidity positions for a given user. * * @param {string} owner - The address of the user for whom to retrieve liquidity positions. * @param {OrderType} [orderType] - Optional parameter to filter the positions by order type. * If omitted, returns all liquidity positions for the given user. * * @returns {Promise} A promise that resolves to an array of extended liquidity positions for the given user. */ getLiquidityPositionsExtendedForUser(owner: string, orderType?: OrderType): Promise; /** * Fetches a user's authorized cost setting for automatic settlement. * * @param {string} address - The address of the User to fetch settings for. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to a user's authorized cost setting. */ getAuthorizedCost(address: string, provider?: Provider): Promise; /** * Encodes a transaction to set the authorized cost of a User. * * @method encodeSetAuthorizedCost * @param {BigNumberish} authorizedCost - The authorized cost to set. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to an encoded ContractTransaction object. */ encodeSetAuthorizedCost(authorizedCost: BigNumberish, provider?: Provider): Promise; /** * Encodes a transaction to set the authorized cost of a User. * * @method encodeSetAuthorizedCost * @param {BigNumberish} authorizedCost - The authorized cost to set. * @param {Provider} provider - The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeSetAuthorizedCostSync(authorizedCost: BigNumberish, provider?: Provider): TransactionData; /** * Sets the authorized cost of a User. * * @method setAuthorizedCost * @param {BigNumberish} authorizedCost - The authorized cost to set. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to a ContractTransactionResponse object after the transaction is complete. */ setAuthorizedCost(authorizedCost: BigNumberish, provider?: Provider): Promise; /** * Fetches a user's authorized actions for a specific operator. * * @param {string} user - The address of the User to fetch settings for. * @param {string} operator - The address of the Operator to fetch authorizations for. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to a user's authorized actions for a specific operator. */ getActionAuthorization(user: string, operator: string, provider?: Provider): Promise; /** * Encodes a transaction to set the authorized actions for an operator. * * @param {string} operator - The operator to (un)authorize actions for. * @param {bigint[]} actions - The actions to (un)authorize. * @param {boolean[]} authorization - The authorization status of the actions. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to an encoded ContractTransaction object. */ encodeSetActionAuthorization(operator: string, actions: bigint[], authorization: boolean[], provider?: Provider): Promise; /** * Encodes a transaction to set the authorized actions for an operator. * * @param {string} operator - The operator to (un)authorize actions for. * @param {bigint[]} actions - The actions to (un)authorize. * @param {boolean[]} authorization - The authorization status of the actions. * @param {Provider} provider - The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeSetActionAuthorizationSync(operator: string, actions: bigint[], authorization: boolean[], provider?: Provider): TransactionData; /** * Sets the authorized actions for an operator. * * @param {string} operator - The operator to (un)authorize actions for. * @param {bigint[]} actions - The actions to (un)authorize. * @param {boolean[]} authorization - The authorization status of the actions. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to an encoded ContractTransactionResponse object. */ setActionAuthorization(operator: string, actions: bigint[], authorization: boolean[], provider?: Provider): Promise; /** * Sets the authorized cost and actions for an operator using multicall. * * @param {string} operator - The operator to (un)authorize actions for. * @param {bigint[]} actions - The actions to (un)authorize. * @param {boolean[]} authorization - The authorization status of the actions. * @param {BigNumberish} authorizedCost - The authorized cost to set. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to an encoded ContractTransactionResponse object. */ updateUserSettings(operator: string, actions: bigint[], authorization: boolean[], authorizedCost: BigNumberish, provider?: Provider): Promise; }