Class VxPremiaAPI

Hierarchy

  • BaseAPI
    • VxPremiaAPI

Constructors

Properties

premia: Premia

Methods

  • Casts votes.

    Parameters

    • votes: Vote[]

      An array of Vote instances representing the votes to be cast.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.
  • Unstakes early.

    Parameters

    • amount: BigNumberish

      The amount to be unstaked.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.
  • Encodes a transaction to cast votes.

    Parameters

    • votes: Vote[]

      An array of Vote instances representing the votes to be cast.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to unstake early.

    Parameters

    • amount: BigNumberish

      The amount to be unstaked.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to harvest.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to harvest and stake.

    Parameters

    • options: {
          allowanceTarget: string;
          amountOutMin: BigNumberish;
          callee: string;
          data: string;
          refundAddress: string;
          stakePeriod: BigNumberish;
      }

      The options for the operation.

      • allowanceTarget: string

        The allowance target address.

      • amountOutMin: BigNumberish

        The minimum amount out.

      • callee: string

        The callee address.

      • data: string

        The data for the operation.

      • refundAddress: string

        The refund address.

      • stakePeriod: BigNumberish

        The stake period.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to bridge vxPREMIA tokens to the destination chain.

    Parameters

    • from: string

      The address from which the tokens will be sent.

    • destinationChainId: BigNumberish

      The id of the destination chain.

    • toAddress: string

      The address to which the tokens will be sent.

    • amount: BigNumberish

      The amount of tokens to be sent.

    • refundAddress: string

      The address to which the tokens will be refunded in case of failure.

    • zroPaymentAddress: string

      The address to which the ZRO payment will be sent.

    • adapterParams: BytesLike

      The adapter params.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to stake.

    Parameters

    • amount: BigNumberish

      The amount to be staked.

    • period: BigNumberish

      The staking period.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to start a withdrawal.

    Parameters

    • amount: BigNumberish

      The amount to be withdrawn.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to update the lock period.

    Parameters

    • period: BigNumberish

      The lock period.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Encodes a transaction to withdraw.

    Returns Promise<ContractTransaction>

    • A promise that resolves to a ContractTransaction instance representing the encoded transaction.
  • Estimates the fee for bridging vxPREMIA to the destination chain.

    Parameters

    • destinationChainId: BigNumberish

      The id of the destination chain.

    • toAddress: string

      The address to which the tokens will be sent.

    • amount: BigNumberish

      The amount of tokens to be sent.

    • useZro: boolean

      Whether to use ZRO or not.

    • adapterParams: BytesLike

      The adapter params.

    Returns Promise<[bigint, bigint] & {
        nativeFee: bigint;
        zroFee: bigint;
    }>

    • A promise that resolves to the fee for bridging vxPREMIA to the destination chain.
  • Retrieves all the last vault votes.

    Parameters

    • orderBy: string

      The field to order the results by.

    • order: string

      The order direction ('asc' or 'desc').

    • Optional first: number = 100

      The maximum number of records to retrieve.

    • Optional skip: number = 0

      The number of records to skip.

    Returns Promise<VaultVote[]>

    A promise that resolves to an array of vault votes.

  • Gets the available amount of Premia.

    Returns Promise<bigint>

    • A promise that resolves the available amount of Premia.
  • Retrieves the total amount of available rewards.

    Returns Promise<{
        rewards: bigint;
        unstakeRewards: bigint;
    }>

    • A promise that resolves to the amount of available rewards and unstake rewards respectively.
  • Gets the discount a user receives.

    Parameters

    • user: string

      The address of the user.

    Returns Promise<bigint>

    • A promise that resolves to the user's discount.
  • Gets the fee a user would have to pay to unstake early.

    Parameters

    • user: string

      The address of the user.

    Returns Promise<bigint>

    • A promise that resolves to fee for unstaking early.
  • Retrieves the last user stake from a given timestamp.

    Parameters

    • timestamp: number

      The timestamp for retrieving the stake.

    • user: string

      The user's address.

    Returns Promise<UserStake[]>

    A promise that resolves to an array of user stakes.

  • Calculates the total amount of rewards that are pending distribution.

    Returns Promise<bigint>

    • A promise that resolves to a the total amount of pending rewards.
  • Retrieves the amount of rewards that are pending for a specific user.

    Parameters

    • user: string

      The address of the user.

    Returns Promise<{
        reward: bigint;
        unstakeReward: bigint;
    }>

    • A promise that resolves to the amount of rewards and unstake rewards that are pending for the user respectively.
  • Retrieves the information of a pending withdrawal of a user.

    Parameters

    • user: string

      The address of the user.

    Returns Promise<{
        amount: bigint;
        startDate: bigint;
        unlockDate: bigint;
    }>

    • A promise that resolves to the amount, start date, and unlock date of the user's pending withdrawal respectively.
  • Gets the total amount of withdrawals.

    Returns Promise<bigint>

    • A promise that resolves to the total amount of pending withdrawals.
  • Retrieves stake histories for a given start time.

    Parameters

    • startTime: number

      The start time for retrieving stake histories.

    • Optional first: number = 100

      The maximum number of records to retrieve.

    • Optional skip: number = 0

      The number of records to skip.

    Returns Promise<StakeHistory[]>

    A promise that resolves to an array of stake histories.

  • Gets the stake levels.

    Returns Promise<StakeLevelStructOutput[]>

    • A Promise that resolves to a ContractTransactionResponse instance representing the stake levels.
  • Gets the stake period multiplier.

    Parameters

    • period: BigNumberish

      The duration (in seconds) for which tokens are locked

    Returns Promise<bigint>

    • Returns a Promise that resolves to the multiplier for this staking period
  • Gets the total power across all users (applying the bonus from lockup period chosen)

    Returns Promise<bigint>

    • A promise that resolves to the total power across all users
  • Gets the information of a user.

    Parameters

    • user: string

      The address of the user.

    Returns Promise<UserInfoStructOutput>

    • A promise that resolves to a UserInfoStructOutput instance representing the user's information.
  • Gets the power associated with a specific user.

    Parameters

    • user: string

      The address of the user.

    Returns Promise<bigint>

    • A promise that resolves to the user's power.
  • Retrieves user stakes for a given start time.

    Parameters

    • startTime: number

      The start time for retrieving stakes.

    • user: string

      The user's address.

    • Optional first: number = 100

      The maximum number of records to retrieve.

    • Optional skip: number = 0

      The number of records to skip.

    Returns Promise<UserStake[]>

    A promise that resolves to an array of user stakes.

  • Retrieves vault votes for a given user and timestamp range.

    Parameters

    • user: string

      The user's address.

    • timestampFrom: number

      The start timestamp for the range.

    • timestampTo: number

      The end timestamp for the range.

    • Optional first: number = 100

      The maximum number of records to retrieve.

    • Optional skip: number = 0

      The number of records to skip.

    Returns Promise<VaultVote[]>

    A promise that resolves to an array of vault votes.

  • Retrieves all votes a particular user has cast.

    Parameters

    • user: string

      The address of the user.

    Returns Promise<VoteStructOutput[]>

    • A promise that resolves to an array of VoteStructOutput instances representing each vote the user has cast.
  • Retrieves vault votes for a given user.

    Parameters

    • user: string

      The user's address.

    • Optional first: number = 100

      The maximum number of records to retrieve.

    • Optional skip: number = 0

      The number of records to skip.

    Returns Promise<VaultVote[]>

    A promise that resolves to an array of vault votes.

  • Retrieves the total number of votes associated with a specific vault.

    Parameters

    • vaultAddress: string

      The Ethereum address of the vault.

    Returns Promise<bigint>

    • A promise that resolves to the total number of votes.
  • Harvests.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.
  • Harvests and stakes.

    Parameters

    • options: {
          allowanceTarget: string;
          amountOutMin: BigNumberish;
          callee: string;
          data: string;
          refundAddress: string;
          stakePeriod: BigNumberish;
      }

      The options for the operation.

      • allowanceTarget: string

        The allowance target address.

      • amountOutMin: BigNumberish

        The minimum amount out.

      • callee: string

        The callee address.

      • data: string

        The data for the operation.

      • refundAddress: string

        The refund address.

      • stakePeriod: BigNumberish

        The stake period.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.
  • Bridges vxPREMIA tokens to the destination chain.

    Parameters

    • from: string

      The address from which the tokens will be sent.

    • destinationChainId: BigNumberish

      The id of the destination chain.

    • toAddress: string

      The address to which the tokens will be sent.

    • amount: BigNumberish

      The amount of tokens to be sent.

    • refundAddress: string

      The address to which the tokens will be refunded in case of failure.

    • zroPaymentAddress: string

      The address to which the ZRO payment will be sent.

    • adapterParams: BytesLike

      The adapter params.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the transaction.
  • Stakes an amount for a certain period.

    Parameters

    • amount: BigNumberish

      The amount to be staked.

    • period: BigNumberish

      The staking period.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.
  • Starts a withdrawal.

    Parameters

    • amount: BigNumberish

      The amount to be withdrawn.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.
  • Updates the lock period.

    Parameters

    • period: BigNumberish

      The lock period.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.
  • Withdraws.

    Returns Promise<ContractTransactionResponse>

    • A promise that resolves to a ContractTransactionResponse instance representing the result of the transaction.

Generated using TypeDoc