Class UserAPI

Hierarchy

  • BaseAPI
    • UserAPI

Constructors

Properties

premia: Premia

Methods

  • Encodes a transaction to set the authorized actions for an operator.

    Parameters

    • operator: string

      The operator to (un)authorize actions for.

    • actions: bigint[]

      The actions to (un)authorize.

    • authorization: boolean[]

      The authorization status of the actions.

    Returns Promise<ContractTransaction>

    A promise that resolves to an encoded ContractTransaction object.

  • Encodes a transaction to set the authorized cost of a User.

    Method

    encodeSetAuthorizedCost

    Parameters

    • authorizedCost: BigNumberish

      The authorized cost to set.

    Returns Promise<ContractTransaction>

    A promise that resolves to an encoded ContractTransaction object.

  • Fetches a user's authorized actions for a specific operator.

    Parameters

    • user: string

      The address of the User to fetch settings for.

    • operator: string

      The address of the Operator to fetch authorizations for.

    Returns Promise<ActionAuthorization>

    A promise that resolves to a user's authorized actions for a specific operator.

  • Fetches a user's authorized cost setting for automatic settlement.

    Parameters

    • address: string

      The address of the User to fetch settings for.

    Returns Promise<bigint>

    A promise that resolves to a user's authorized cost setting.

  • Retrieves extended liquidity positions for a given user.

    Parameters

    • owner: string

      The address of the user for whom to retrieve liquidity positions.

    • Optional orderType: OrderType

      Optional parameter to filter the positions by order type. If omitted, returns all liquidity positions for the given user.

    Returns Promise<LiquidityPositionExtended[]>

    A promise that resolves to an array of extended liquidity positions for the given user.

  • Retrieves extended option positions for a given user.

    Parameters

    • owner: string

      The address of the user for whom to retrieve option positions.

    • Optional isOpen: boolean

      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<OptionPositionExtended[]>

    A promise that resolves to an array of extended option positions for the given user.

  • Fetches a User based on the provided address and caches the result for a day.

    Parameters

    • address: string

      The address of the User to fetch.

    Returns Promise<User>

    A promise that resolves to a User object.

  • Fetches an extended User based on the provided address and caches the result for a minute.

    Parameters

    • address: string

      The address of the User to fetch.

    Returns Promise<UserExtended>

    A promise that resolves to a UserExtended object.

  • Fetches a portfolio of a User and caches the result for a day.

    Parameters

    • address: string

      The address of the User to fetch.

    Returns Promise<UserPortfolio>

    A promise that resolves to a UserPortfolio object.

  • Fetches an extended portfolio of a User and caches the result for a minute.

    Parameters

    • address: string

      The address of the User to fetch.

    Returns Promise<UserPortfolioExtended>

    A promise that resolves to a UserPortfolioExtended object.

  • Fetches a UserSnapshot for a specific User at a specific timestamp and caches the result for a day.

    Parameters

    • address: string

      The address of the User to fetch the snapshot for.

    • timestamp: BigNumberish

      The timestamp for the snapshot.

    Returns Promise<UserSnapshot>

    A promise that resolves to a UserSnapshot object.

  • Fetches an extended snapshot of a User at a specified timestamp and caches the result for a minute.

    Parameters

    • address: string

      The address of the User to fetch.

    • timestamp: BigNumberish

      The timestamp of the User snapshot.

    Returns Promise<UserSnapshotExtended>

    A promise that resolves to a UserSnapshotExtended object.

  • Fetches multiple snapshots of a User within a specified time frame and caches the result for a day.

    Method

    getUserSnapshots

    Parameters

    • address: string

      The address of the User to fetch.

    • startTime: BigNumberish

      The start time of the time frame.

    • endTime: BigNumberish

      The end time of the time frame.

    • Optional orderBy: string = 'timestamp'

      The field to order the snapshots by. Default is 'timestamp'.

    • Optional order: string = 'asc'

      The order of the snapshots. Default is 'asc'.

    • Optional first: number = 100

      The number of snapshots to fetch. Default is 100.

    • Optional skip: number = 0

      The number of snapshots to skip. Default is 0.

    Returns Promise<UserSnapshot[]>

    A promise that resolves to an array of UserSnapshot objects.

  • Fetches multiple extended snapshots of a User within a specified time frame and caches the result for a minute.

    Parameters

    • address: string

      The address of the User to fetch.

    • startTime: BigNumberish

      The start time of the time frame.

    • endTime: BigNumberish

      The end time of the time frame.

    • Optional orderBy: string = 'timestamp'

      The field to order the snapshots by. Default is 'timestamp'.

    • Optional order: string = 'asc'

      The order of the snapshots. Default is 'asc'.

    • Optional first: number = 100

      The number of snapshots to fetch. Default is 100.

    • Optional skip: number = 0

      The number of snapshots to skip. Default is 0.

    Returns Promise<UserSnapshotExtended[]>

    A promise that resolves to an array of UserSnapshotExtended objects.

  • Fetches multiple Users based on the provided addresses and caches the result for a day.

    Parameters

    • addresses: string[]

      An array of addresses of Users to fetch.

    Returns Promise<User[]>

    A promise that resolves to an array of User objects.

  • Fetches multiple extended Users based on the provided addresses and caches the result for a minute.

    Parameters

    • addresses: string[]

      An array of addresses of Users to fetch.

    Returns Promise<UserExtended[]>

    A promise that resolves to an array of UserExtended objects.

  • Sets the authorized actions for an operator.

    Parameters

    • operator: string

      The operator to (un)authorize actions for.

    • actions: bigint[]

      The actions to (un)authorize.

    • authorization: boolean[]

      The authorization status of the actions.

    Returns Promise<ContractTransactionResponse>

    A promise that resolves to an encoded ContractTransactionResponse object.

  • Sets the authorized cost of a User.

    Method

    setAuthorizedCost

    Parameters

    • authorizedCost: BigNumberish

      The authorized cost to set.

    Returns Promise<ContractTransactionResponse>

    A promise that resolves to a ContractTransactionResponse object after the transaction is complete.

  • Sets the authorized cost and actions for an operator using multicall.

    Parameters

    • operator: string

      The operator to (un)authorize actions for.

    • actions: bigint[]

      The actions to (un)authorize.

    • authorization: boolean[]

      The authorization status of the actions.

    • authorizedCost: BigNumberish

      The authorized cost to set.

    Returns Promise<ContractTransactionResponse>

    A promise that resolves to an encoded ContractTransactionResponse object.

Generated using TypeDoc