Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

  • new StakingClient(params: AccountInterface, contractId: number): StakingClient

Properties

id: undefined | number
property

Unique identifier for the contract

mnemonic?: string
property

An optional string of 25 words seperated by spaces that can be used to recover an algorand account

network?: "LocalHost" | "MainNet" | "TestNet"
property

The desired network to connect to, the default value is LocalHost

networkAccount?: any
property

An optional instance of an account from the reach standard library. Used to reconnect via a frontend

provider?: any
property

An instance of the provider object for the signer specified

providerEnv?: any
property

providerEnv for indexer

reachAccount: any
property

An account created from the reach sdk

reachStdLib: any
property

An instance of the reach standard library

secretKey?: number[]
property

An optional array of numbers that can be used to recover an algorand account

signer?: string
propertyan

optional name of a signer or wallet provider that can be used to sign transactions, should be set along with the provider property. Only required when not using a mnemonic or secretKey

Methods

  • cachePoints(address: string): Promise<boolean>
  • description

    update accrued points for an account

    Parameters

    • address: string

      address of the user to accrue points for

    Returns Promise<boolean>

    boolean

  • exchangePoints(amount: number): Promise<boolean>
  • description

    exchange accrued points for rewards in the contract

    Parameters

    • amount: number

      amount of points to exchange for rewards

    Returns Promise<boolean>

    Boolean

  • fundFromFaucet(): Promise<boolean>
  • Allows you to fund this account from the faucet when on the Reach devnet

    Returns Promise<boolean>

    A boolean indicating if this account was successfully funded or not

  • getAddress(): Promise<any>
  • getBalance(params: { tokenId: number }): Promise<number>
  • Parameters

    • params: { tokenId: number }

      An object with key tokenId that indicates the ASA id whose balance this function must return, this key's value should be set to zero for the native token balance

      • tokenId: number

    Returns Promise<number>

    The balance of the specified tokenId

  • getContractAbi(params: { backend: any; contractId: number }): Promise<AbiInterface>
  • Parameters

    • params: { backend: any; contractId: number }

      contractId which indicates the contract we want to interact with, and the backend to use (see utils.ts for backend options)

      • backend: any
      • contractId: number

    Returns Promise<AbiInterface>

  • getContractAddress(params: { backend: any; contractId: number }): Promise<string>
  • Returns the contract address

    Parameters

    • params: { backend: any; contractId: number }

      An object with key vault that indicates the contract whose address is to be retrieved, and the backend to use (see utils.ts for backend options)

      • backend: any
      • contractId: number

    Returns Promise<string>

    A formatted address of the specified contract as a string

  • getSecret(): Promise<any>
  • getState(params: { account: Account }): Promise<StakeGlobalView>
  • description

    Get global state of contract

    Parameters

    • params: { account: Account }

      account object that contains the reach account

    Returns Promise<StakeGlobalView>

    StakeGlobalView

  • getUserInfo(params: { account: Account; address: string }): Promise<StakeLocalView>
  • description

    Get local state of user

    Parameters

    • params: { account: Account; address: string }

      account object that contains the reach account, address for the look up

    Returns Promise<StakeLocalView>

    StakeLocalView

  • initialiseReachAccount(): Promise<void>
  • liquidateVault(stakerAddress: string, liquidateAddress: string, amount: string): Promise<boolean>
  • description

    Use staked xUSD in a liquidation of a vault

    Parameters

    • stakerAddress: string

      address of the staked xUSD

    • liquidateAddress: string

      address to liquidate

    • amount: string

      amount of xUSD to use in liquidation

    Returns Promise<boolean>

    boolean

  • optIntoToken(tokenID: number): Promise<void>
  • Allows an instance of the account class to opt into an Algorand standard Asset

    Parameters

    • tokenID: number

      The asa ID to opt into

    Returns Promise<void>

  • stakeAsset(amount: number): Promise<boolean>
  • description

    stake assets to the contract

    Parameters

    • amount: number

      amount to be staked

    Returns Promise<boolean>

    boolean

  • unstakeAsset(amount: number): Promise<boolean>
  • description

    unstake assets from the contract

    Parameters

    • amount: number

      amount to be unstaked

    Returns Promise<boolean>

    boolean

  • withdrawRewards(amount: number): Promise<boolean>
  • description

    withdraw accrued rewards from liquidations

    Parameters

    • amount: number

      amount of liquidation rewards to withdraw

    Returns Promise<boolean>

  • parseUserInfo(stakingState: any): StakeLocalView
  • description

    Used for internal formatting of BigNumbers

    Parameters

    • stakingState: any

      StakeLocalView type

    Returns StakeLocalView

    StakeLocalView

Generated using TypeDoc