Options
All
  • Public
  • Public/Protected
  • All
Menu

EthereumSDK allows you to interact with Ethereum Liquid Staking smart contracts on Ethereum (Mainnet, Holesky Tesnet) BNB Smart Chain: aETHb, ankrETH, and GlobalPool.

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

Hierarchy

Implements

Index

Constructors

Properties

apiUrl?: string

apiUrl — URL of the advanced API.

readonly
contractConfig: IEthereumConfig

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?: EthereumSDK

instance — SDK instance.

static

Accessors

  • get isMainnet(): boolean

Methods

  • addTokenToWallet(token: string): Promise<boolean>
  • approveACForAB(amount?: BigNumber, scale?: number): Promise<IWeb3SendResult>
  • approveACTokenForSwapPool(amount?: BigNumber, scale?: number): Promise<IWeb3SendResult>
  • claim(token: string): Promise<IWeb3SendResult>
  • convertFromWei(amount: string, unit?: Unit): BigNumber
  • executeBatchCalls<T>(web3: default, calls: TWeb3Call<T>[]): Promise<T[]>
  • fetchTxData(txHash: string, shouldDecodeAmount?: boolean): Promise<IFetchTxData>
  • fetchTxReceipt(txHash: string): Promise<null | TransactionReceipt>
  • flashUnstake(amount: BigNumber, token: string, scale?: number): Promise<IWeb3SendResult>
  • getABBalance(isFormatted?: boolean): Promise<BigNumber>
  • getACAllowance(): Promise<BigNumber>
  • getACBalance(isFormatted?: boolean): Promise<BigNumber>
  • getACRatio(isFormatted?: boolean): Promise<BigNumber>
  • getACSwapPoolAllowance(): Promise<BigNumber>
  • getBNBSwapPoolLiquidity(): Promise<BigNumber>
  • getBNBSwapPoolMaxFee(): Promise<BigNumber>
  • getBlocks(web3: default, blockNumbers: number[]): Promise<BlockTransactionObject[]>
  • getClaimable(token: string): Promise<BigNumber>
  • getEthBalance(): Promise<BigNumber>
  • getIncreasedGasLimit(gasLimit: number): number
  • getIsEthChain(): boolean
  • getIsUnstakePaused(): Promise<boolean>
  • getLatestBlock(): Promise<number>
  • getMinimumStake(): Promise<BigNumber>
  • getPendingClaim(): Promise<BigNumber>
  • getStakeGasFee(amount: BigNumber, token: string): Promise<BigNumber>
  • getSwapPoolContract(): Contract
  • getSwapPoolUnstakeFee(): Promise<BigNumber>
  • getTokenConfigBySymbol(token: string): ITokenInfo
  • getTxEventsHistoryGroup(rawEvents?: EventData[]): Promise<ITxHistoryItem[]>
  • getTxEventsSwapHistoryGroup(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 ETH. If you need ankrETH, 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>
  • stakeWithoutClaim(amount: BigNumber): Promise<IWeb3SendResult>
  • unlockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • unstake(amount: BigNumber, token: string): Promise<IWeb3SendResult>

Generated using TypeDoc