Options
All
  • Public
  • Public/Protected
  • All
Menu

FantomSDK allows you to interact with Fantom Liquid Staking smart contracts on Fantom (Mainnet, Tesnet): aFTMb, ankrFTM, and FantomPool.

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

Hierarchy

Implements

Index

Constructors

Properties

apiGateWay: ApiGateway

apiGateWay — gateway instance.

apiUrl?: string

apiUrl — URL of the advanced API.

readonly
contractConfig: IFantomConfig

Contract addresses by current network mode.

currentAccount: string

currentAccount — connected account.

networkMode: ENetworkMode

Network mode.

readonly
readProvider: Web3KeyReadProvider

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

readonly
writeProvider: Web3KeyWriteProvider

writeProvider — provider which has signer for signing transactions.

readonly
instance?: FantomSDK

instance — SDK instance.

static

Accessors

  • get isMainnet(): boolean

Methods

  • addTokenToWallet(token: string): Promise<boolean>
  • approveACForAB(amount?: BigNumber, scale?: number): Promise<undefined | IWeb3SendResult>
  • checkAllowance(amount: BigNumber): 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

    • amount: BigNumber

    Returns Promise<boolean>

    • true if amount doesn't exceed allowance, false - otherwise.
  • convertFromWei(amount: string): BigNumber
  • executeBatchCalls<T>(web3: default, calls: TWeb3Call<T>[]): Promise<T[]>
  • fetchTxReceipt(txHash: string): Promise<null | TransactionReceipt>
  • getABBalance(): Promise<BigNumber>
  • getACAllowance(spender?: string): Promise<BigNumber>
  • getACBalance(): Promise<BigNumber>
  • getACRatio(): Promise<BigNumber>
  • getAftmbTokenContract(): Contract
  • getAnkrFTMTokenContract(): Contract
  • getBlocks(web3: default, blockNumbers: number[]): Promise<BlockTransactionObject[]>
  • getFantomPoolContract(): Contract
  • getFtmBalance(): Promise<BigNumber>
  • Get transaction history for all period that starts from contract creation.

    note

    Amount of certificate event is in FTM. If you need ankrFTM, multiply by ratio. Pending status is not specified.

    Returns Promise<ITxHistory>

    full transaction history.

  • getIncreasedGasLimit(gasLimit: number): number
  • getLatestBlock(): Promise<number>
  • getMinimumStake(): Promise<BigNumber>
  • getStakeGasFee(amount: BigNumber, token: TFtmSyntToken): Promise<BigNumber>
  • getTxEventsHistoryGroup(rawEvents?: EventData[]): Promise<ITxHistoryItem[]>
  • getTxHistoryRange(lowestBlock: number, highestBlock: number, isUnstakeOnly?: boolean): Promise<ITxHistory>
  • Get transaction history for block range.

    note

    Amount of each event is in FTM. If you need ankrFTM, multiply by ratio. Pending status is not specified.

    Parameters

    • lowestBlock: number

      from block number

    • highestBlock: number

      to block number

    • isUnstakeOnly: boolean = false

      if true, only unstake events will be returned

    Returns Promise<ITxHistory>

    • transaction history
  • lockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • stake(amount: BigNumber, token: string): Promise<IStakeData>
  • unlockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • unstake(amount: BigNumber, token: string): Promise<IWeb3SendResult>

Generated using TypeDoc