Options
All
  • Public
  • Public/Protected
  • All
Menu

BinanceSDK allows you to interact with Binance Liquid Staking smart contracts on BNB Smart Chain: aBNBb, aBNBc, WBNB, and BinancePool.

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

Hierarchy

  • BinanceSDK

Implements

Index

Constructors

Properties

apiUrl?: string

apiUrl — URL of the advanced API.

readonly
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?: BinanceSDK

instance — SDK instance.

static

Methods

  • addTokenToWallet(token: string): Promise<boolean>
  • approveACForAB(amount?: BigNumber, scale?: number): Promise<undefined | IWeb3SendResult>
  • approveACTokenForSwapPool(amount?: BigNumber, scale?: number): Promise<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.
  • checkExistPartnerCode(partnerCode: string): Promise<boolean>
  • claimPartnerRewards(): Promise<IWeb3SendResult>
  • convertFromWei(amount: string, unit?: Unit): BigNumber
  • convertToHex(amount: BigNumber): string
  • Fetch transaction receipt.

    deprecated

    usefull only for old BNB tokens contracts in the testnet.

    note

    Scans logs to find topic 0x0f0bc5b519ddefdd8e5f9e6423433aa2b869738de2ae34d58ebc796fc749fa0d to show the aBNBc amount.

    Parameters

    • txHash: string

      transaction hash.

    Returns Promise<null | IGetTxReceipt>

  • flashUnstake(amount: BigNumber, token: string, scale?: number): Promise<IWeb3SendResult>
  • getABBalance(): Promise<BigNumber>
  • getABNBBContract(isForceRead?: boolean): Promise<Contract>
  • getABNBCContract(isForceRead?: boolean): Promise<Contract>
  • getACAllowance(): Promise<BigNumber>
  • getACBalance(): Promise<BigNumber>
  • getACRatio(): Promise<BigNumber>
  • getACSwapPoolAllowance(): Promise<BigNumber>
  • getAETHBalance(): Promise<BigNumber>
  • getAETHCBalance(): Promise<BigNumber>
  • getAETHCContract(isForceRead?: boolean): Promise<Contract>
  • getAETHContract(isForceRead?: boolean): Promise<Contract>
  • getAETHRatio(): Promise<BigNumber>
  • getAvailableToSwapAETHC(): Promise<BigNumber>
  • getBNBBalance(): Promise<BigNumber>
  • getBNBSwapPoolLiquidity(): Promise<BigNumber>
  • getBNBSwapPoolMaxFee(): Promise<BigNumber>
  • getBinancePartersContract(isForceRead?: boolean): Promise<Contract>
  • getBinancePoolContract(isForceRead?: boolean): Promise<Contract>
  • getIncreasedGasLimit(gasLimit: number): number
  • getLatestBlock(): Promise<number>
  • getMinimumStake(): Promise<BigNumber>
  • getPartnerClaimableRewards(code: string): Promise<BigNumber>
  • getPartnerCodeByAddress(address: string): Promise<string>
  • getPendingClaim(): Promise<BigNumber>
  • getPoolEventsBatch(from: number, to: number): Promise<IEventsBatch>
  • getRelayerFee(): Promise<BigNumber>
  • getSafeBinanceHexAmount(amount: BigNumber): string
  • getStakeGasFee(amount: BigNumber, token: "aETHc" | "aBNBb" | "aBNBc" | "aETH"): Promise<BigNumber>
  • Get stake gas fee.

    note

    Caches computed gas fee value for future computations.

    Parameters

    • amount: BigNumber

      amount to stake

    • token: "aETHc" | "aBNBb" | "aBNBc" | "aETH"

      token symbol

    Returns Promise<BigNumber>

  • getStakeMethodName(token: "aETHc" | "aBNBb" | "aBNBc" | "aETH", withCode?: boolean): string
  • getSwapPoolContract(isForceRead?: boolean): Promise<Contract>
  • getSwapPoolUnstakeFee(): Promise<BigNumber>
  • getTxType(rawTxType?: string): null | string
  • getUnstakeMethodName(token: "aETHc" | "aBNBb" | "aBNBc" | "aETH"): "unstakeBonds" | "unstakeCerts"
  • getUnstakeToExternalMethodName(token: "aETHc" | "aBNBb" | "aBNBc" | "aETH"): "unstakeBondsFor" | "unstakeCertsFor"
  • getWBNBSwapPoolBalance(): Promise<BigNumber>
  • getWrappedBNBContract(isForceRead?: boolean): Promise<Contract>
  • lockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • stake(amount: BigNumber, token: string, scale?: number, referralCode?: string): Promise<IStakeData>
  • swapOldAETHC(amount: BigNumber): Promise<IWeb3SendResult>
  • unlockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • unstake(amount: BigNumber, token: string): Promise<IWeb3SendResult>
  • unstakeToExternal(amount: BigNumber, token: string, externalAddress: string): Promise<IWeb3SendResult>

Generated using TypeDoc