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

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>
  • 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): BigNumber
  • convertToHex(amount: BigNumber): string
  • getABBalance(): Promise<BigNumber>
  • getABNBBContract(isForceRead?: boolean): Promise<Contract>
  • getABNBCContract(isForceRead?: boolean): Promise<Contract>
  • getACAllowance(spender?: string): Promise<BigNumber>
  • getACBalance(): Promise<BigNumber>
  • getACRatio(): 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>
  • 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>
  • getPastEventsAPI(__namedParameters: IGetPastEvents): Promise<EventData[]>
  • getPastEventsBlockchain(__namedParameters: IGetPastEvents): Promise<EventData[]>
  • getPendingClaim(): Promise<BigNumber>
  • getPoolEventsBatch(from: number, to: number): Promise<IEventsBatch>
  • getRelayerFee(): Promise<BigNumber>
  • getSafeBinanceHexAmount(amount: BigNumber): string
  • getStakeGasFee(amount: BigNumber, token: "aBNBb" | "aBNBc" | "aETH" | "aETHc"): Promise<BigNumber>
  • Get stake gas fee.

    note

    Caches computed gas fee value for future computations.

    Parameters

    • amount: BigNumber

      amount to stake

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

      token symbol

    Returns Promise<BigNumber>

  • getStakeMethodName(token: "aBNBb" | "aBNBc" | "aETH" | "aETHc", withCode?: boolean): "stakeAndClaimBonds" | "stakeAndClaimBondsWithCode" | "stakeAndClaimCerts" | "stakeAndClaimCertsWithCode"
  • Internal function to return stake method by token symbol.

    Parameters

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

      token symbol

    • withCode: boolean = false

    Returns "stakeAndClaimBonds" | "stakeAndClaimBondsWithCode" | "stakeAndClaimCerts" | "stakeAndClaimCertsWithCode"

  • getTxType(rawTxType?: string): null | string
  • getUnstakeMethodName(token: "aBNBb" | "aBNBc" | "aETH" | "aETHc"): "unstakeBonds" | "unstakeCerts"
  • getUnstakeToExternalMethodName(token: "aBNBb" | "aBNBc" | "aETH" | "aETHc"): "unstakeBondsFor" | "unstakeCertsFor"
  • 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