Private constructor. Instead, use BinanceSDK.getInstance
.
apiUrl — URL of the advanced API.
Contract addresses by current network mode.
currentAccount — connected account.
Network mode.
readProvider — provider which allows to read data without connecting the wallet.
stakeGasFee — cached stake gas fee.
writeProvider — provider which has signer for signing transactions.
instance — SDK instance.
Returns true
if instance is initialized with production mode.
Add token to wallet.
token symbol (aBNBb, ankrBNB, aETH, ankrETH)
Approve ankrBNB for aBNBb, i.e. allow aBNBb smart contract to access and transfer ankrBNB tokens.
Checks if allowance is greater or equal to amount.
Checking whether a code partner exists.
partner code
Claim partner rewards.
Internal function to convert wei value to human readable format.
value in wei
units
Internal function to convert value to hex format.
value in wei
executeBatchCalls
is supposed to decrease calls to blockchain.
It only sends one request and returns data from each call.
web3 instance
web3 calls
array of return values from web3 calls
Fetch flash unstake transaction data.
transaction hash.
Fetch transaction data.
transaction hash.
Fetch transaction receipt.
transaction hash.
Fetch transaction receipt.
transaction hash.
Fetch unstake to external transaction data.
transaction hash.
Flash Unstake token.
amount to unstake
choose which token to unstake (aBNBb or aBNBc)
Return aBNBb token balance.
Internal function to get aBNBb token contract.
Return ankrBNB token allowance.
Returns ankrBNB token balance
Return ankrBNB/BNB ratio.
Returns old ankrETH token balance
Internal function to get old ankrETH contract
Returns certificate old ankrETH token ratio
Internal function to get ankrBNB token contract.
Returns ankrETH token balance
Internal function to get ankrETH contract
Returns available ankrETH token balance for oldSwap
Return BNB token balance.
Return BNB token balance for flash unstake.
Internal function to get BinancePartners contract.
Internal function to get BinancePool contract.
Internal function to get BinancePool contract.
Internal function to get blocks by block number. It uses cache to avoid unnecessary requests.
web3 instance.
block numbers to get.
blocks data.
Return flash unstake fee.
Get transaction history for all period that starts from contract creation.
full transaction history.
Internal function to return increased gas limit.
initial gas limit
Get latest block number.
Returns max block range for past events request.
Get minimum stake amount.
Get minimum stake amount.
Get claim history for partner.
Get claimable rewards for partner.
partner code
Get partner code by address.
partner address
An internal function for getting past events from the API or blockchain according to the current environment.
Internal function to get past events from indexed logs API.
Internal function to get past events, using the defined range.
Get total pending unstake amount.
Get pending data for aBNBb and ankrBNB.
Internal function to return raw pool events.
Internal method for getting a safe amount in HEX format.
amount for stake
Get stake gas fee.
amount to stake
Internal function to return stake method by token symbol.
token symbol
Returns Stake transaction data.
staker wallet address
block number, where the stake event was emitted
Internal function to return transaction history group from events.
Get transaction history for block range.
from block number
to block number
if true, only unstake events will be returned
from block number
to block number
if true, only unstake events will be returned
from block number
to block number
if true, only unstake events will be returned
Internal function to map event type to transaction type.
Returns Unstake transaction data.
unstake wallet address
block number, where the unstake event was emitted
Internal function to get WBNB token contract.
Internal function get write provider. If provider isn't connected, it will be connected.
Internal function to check the current network.
current selected provider
Switch ankrBNB to aBNBb.
object with amount to switch and scale
Stake token.
amount of token
choose which token to receive (aBNBb or ankrBNB)
scale factor for amount (not using)
referral code
Swap old ankrETH to new ankrETH
amount to swap
Switch aBNBb to ankrBNB.
object with amount to switch and scale
Unstake token.
amount to unstake
choose which token to unstake (aBNBb or ankrBNB)
Unstake token to external address.
amount to unstake
choose which token to unstake (aBNBb or ankrBNB)
choose external address to unstake to
Initialization method for SDK.
Auto-connects writeProvider if chains are the same. Initializes readProvider to support multiple chains.
Generated using TypeDoc
BinanceSDK allows you to interact with Binance Liquid Staking smart contracts on BNB Smart Chain: aBNBb, ankrBNB, WBNB, and BinancePool.
For more information on Binance Liquid Staking from Ankr, refer to the development details.