Private constructor. Instead, use BinanceSDK.getInstance
.
apiUrl — URL of the advanced API.
currentAccount — connected account.
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.
Add token to wallet.
token symbol (aBNBb, aBNBc, aETH, aETHc)
Approve aBNBc for aBNBb, i.e. allow aBNBb smart contract to access and transfer aBNBc tokens.
Approve aMATICc for SwapPool, i.e. allow SwapPool smart contract to access and transfer aMATICc 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
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 (aMATICb or aMATICc)
Return aBNBb token balance.
Internal function to get aBNBb token contract.
Internal function to get aBNBc token contract.
Return aBNBc token allowance.
Returns aBNBc token balance
Return aBNBc/BNB ratio.
Return aBNBc Swap Pool token allowance.
Returns old aETHc token balance
Returns aETHc token balance
Internal function to get aETHc contract
Internal function to get old aETHc contract
Returns certificate old aETHc token ratio
Returns available aETHc token balance for oldSwap
Return BNB token balance.
Return BNB swap pool token balance.
Return BNB swap pool max fee.
Internal function to get BinancePartners contract.
Internal function to get BinancePool contract.
Internal function to return increased gas limit.
initial gas limit
Get latest block number.
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 aBNBc.
Internal function to return raw pool events.
Internal function to choose the right provider for read or write purpose.
Get relayer fee.
Internal method for getting a safe amount in HEX format.
amount for stake
Get stake gas fee.
amount to stake
token symbol
Internal function to return stake method by token symbol.
token symbol
Internal function to get Swap Pool contract
Return unstake fee for swap pool.
Get transaction history.
Internal function to return transaction history group from events. TODO: reuse it from stake/api/getTxEventsHistoryGroup
Get transaction history.
from block
to block
Internal function to map event type to transaction type.
Internal function to return unstake method by token symbol.
token symbol
Internal function to return unstake method by token symbol.
token symbol
Return WBNBb swap pool token balance.
Internal function to get WBNB token contract.
Internal function to check the current network.
current selected provider
Switch aBNBc to aBNBb.
object with amount to switch and scale
Stake token.
amount of token
choose which token to receive (aBNBb or aBNBc)
scale factor for amount (not using)
referral code
Swap old aETHc to new aETHc
amount to swap
Switch aBNBb to aBNBc.
object with amount to switch and scale
Unstake token.
amount to unstake
choose which token to unstake (aBNBb or aBNBc)
Unstake token to external address.
amount to unstake
choose which token to unstake (aBNBb or aBNBc)
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, aBNBc, WBNB, and BinancePool.
For more information on Binance Liquid Staking from Ankr, refer to the development details.