Options
All
  • Public
  • Public/Protected
  • All
Menu

Main exported class

Hierarchy

  • UnstakeAg

Index

Constructors

Properties

cluster: Cluster
connection: Connection
hybridPools: HybridPool[]

Pools that implement both StakePool and WithdrawStakePool. Should have no overlap with stakePools and withdrawStakePools

jupiter: Jupiter
lastUpdatePoolsTimestamp: number
lut: null | AddressLookupTableAccount
poolsAccountsToUpdate: string[]

PublicKeys of all accounts of all pools, deduped

routeCacheDuration: number

Same as jupiter's. For refreshing pools.

-1, it will not fetch when shouldFetch == false

0, it will fetch everytime

A duration in ms, the time interval between AMM accounts refetch, recommendation for a UI 20 seconds

Defaults to 0

shouldIgnoreLoadErrors: boolean

Simply console.errors account load errors instead of throwing.

Defaults to false

stakePools: StakePool[]

Pools that only implement StakePool

withdrawStakePools: WithdrawStakePool[]

Pools that only implement WithdrawStakePool;

Methods

  • If withdraw stake route, the withdraw stake instruction will be added to setupTransaction. This means its possible for unstake to fail and user to end up with a stake account

    Parameters

    Returns Promise<ExchangeReturn | ExchangeReturnV0>

  • refreshPoolsIfExpired(forceFetch: boolean): Promise<void>
  • Parameters

    • forceFetch: boolean

    Returns Promise<void>

  • setPoolsAccountsToUpdate(): void
  • Sets this.poolsAccountsToUpdate to deduped list of all required accounts for StakePools and WithdrawStakePools. Call this if this.stakePools or this.withdrawStakePools change for some reason.

    Returns void

  • updatePools(): Promise<void>
  • Returns Promise<void>

  • Parameters

    • cluster: Cluster

    Returns HybridPool[]

  • createStakePools(cluster: Cluster): StakePool[]
  • Parameters

    • cluster: Cluster

    Returns StakePool[]

  • Parameters

    • cluster: Cluster

    Returns WithdrawStakePool[]

  • fetchLoot(connection: Connection): Promise<null | AddressLookupTableAccount>
  • Parameters

    • connection: Connection

    Returns Promise<null | AddressLookupTableAccount>

Generated using TypeDoc