Options
All
  • Public
  • Public/Protected
  • All
Menu

AvalancheSDK allows you to interact with Avalanche Liquid Staking smart contracts on Avalanche network: aAVAXb, aAVAXc, and AvalanchePool.

For more information on Avalanche Liquid Staking from Ankr, refer to the development details.

Hierarchy

  • AvalancheSDK

Implements

Index

Constructors

Properties

currentAccount: string

currentAccount — connected account.

readProvider: Web3KeyReadProvider

readProvider — provider which allows to read data without connecting the wallet.

readonly
stakeGasFee?: BigNumber

stakeGasFee — cached stake gas fee.

writeProvider: Web3KeyWriteProvider

writeProvider — provider which has signer for signing transactions.

readonly
instance?: AvalancheSDK

instance — SDK instance.

static

Methods

  • addTokenToWallet(token: string): Promise<boolean>
  • approveACForAB(amount?: BigNumber, scale?: number): Promise<undefined | IWeb3SendResult>
  • checkAllowance(hexAmount: string): Promise<boolean>
  • Checks if allowance is greater or equal to amount.

    note

    Allowance is the amount which spender is still allowed to withdraw from owner.

    Parameters

    • hexAmount: string

    Returns Promise<boolean>

    • true if amount doesn't exceed allowance, false - otherwise.
  • convertFromWei(amount: string): BigNumber
  • convertToHex(amount: BigNumber): string
  • fetchTxReceipt(txHash: string): Promise<null | TransactionReceipt>
  • getAAVAXBTokenContract(isForceRead?: boolean): Promise<Contract>
  • getAAVAXCTokenContract(isForceRead?: boolean): Promise<Contract>
  • getABBalance(): Promise<BigNumber>
  • getACAllowance(spender?: string): Promise<BigNumber>
  • getACBalance(): Promise<BigNumber>
  • getACRatio(): Promise<BigNumber>
  • getAVAXBalance(): Promise<BigNumber>
  • getAvalanchePoolContract(isForceRead?: boolean): Promise<Contract>
  • getLatestBlock(): Promise<number>
  • getMinimumStake(): Promise<BigNumber>
  • getPastEventsAPI(__namedParameters: IGetPastEvents): Promise<EventData[]>
  • getPastEventsBlockchain(__namedParameters: IGetPastEvents): Promise<EventData[]>
  • getPendingClaim(): Promise<BigNumber>
  • getPoolEventsBatch(from: number, to: number): Promise<IEventsBatch>
  • getStakeGasFee(amount: BigNumber, token: string): Promise<BigNumber>
  • Get stake gas fee.

    note

    Caches computed gas fee value for future computations.

    Parameters

    • amount: BigNumber

      amount to stake

    • token: string

      token symbol (aAVAXb or aAVAXc)

    Returns Promise<BigNumber>

  • getStakeMethodName(token: string): string
  • getTxType(rawTxType?: string): null | string
  • getUnstakeMethodName(token: string): string
  • lockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • stake(amount: BigNumber, token: string): Promise<IStakeData>
  • unlockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • unstake(amount: BigNumber, token: string): Promise<IWeb3SendResult>
  • getIncreasedGasLimit(gasLimit: number): number

Generated using TypeDoc