Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Farm

Index

Constructors

Properties

_suggestedParams: null | SuggestedParams = null
algod: default
appAddress: string
appId: number
internalState: FarmInternalState
rawState: any
state: FarmState

Accessors

  • get suggestedParams(): SuggestedParams

Methods

  • adminBuildAddRewardAssetTx(asset: Asset): Transaction
  • adminBuildDepositRewardsTxs(rewards: FarmingRewards, duration: number): Transaction[]
  • buildClaimRewardsTx(escrow: Escrow, assets?: Asset[]): Transaction
  • buildUpdateGlobalStateTx(sender: string): Transaction
  • buildUpdateIncreaseOpcodeQuotaTx(sender: string): null | Transaction
  • buildUpdateTx(escrow: Escrow): Transaction
  • buildUpdateWithOpcodeIncreaseTxs(escrow: Escrow): Transaction[]
  • calculatePastAccruedRewards(stakedAmount: number, userRpt: FarmingRewards): Record<number, number>
  • fetchAllAssets(): Promise<void>
  • fetchEscrowByAddress(address: string): Promise<null | Escrow>
  • fetchEscrowById(appId: number): Promise<Escrow>
  • fetchEscrowFromAccountInfo(accountInfo: any): Promise<null | Escrow>
  • getUserStateFromAccountInfo(accountInfo: any): null | FarmUserState
  • haveRewards(dt?: Date): boolean
  • prepareDeployEscrowTxs(sender: string): Promise<Transaction[]>
  • refreshSuggestedParams(): Promise<void>
  • setSuggestedParams(suggestedParams: SuggestedParams): void
  • simulateAccruedRewards(atTime: Date, stakedAmount: number, totalStaked: number, options?: { extrapolateFutureRewards?: boolean }): FarmingRewards
  • Parameters

    • atTime: Date
    • stakedAmount: number
    • totalStaked: number
    • options: { extrapolateFutureRewards?: boolean } = {}
      • Optional extrapolateFutureRewards?: boolean

    Returns FarmingRewards

  • updateState(): Promise<void>

Generated using TypeDoc