BNB Liquid Staking API
To integrate with BNB Liquid Staking, use the smart contract functions and examples below.
Switch aBNBb to aBNBcβ
unlockShares(shares)
β
Switches aBNBb to aBNBc.
Parametersβ
shares
(uint256, required) β amount of aBNBb to be switched to aBNBc.
Smart contractβ
Exampleβ
Mainnet live transaction example
Switch aBNBc to aBNBbβ
approve(spender, amount)
β
Lets the aBNBb
smart contract transfer user's liquid tokens.
Parametersβ
spender
(address, required) β address of the BinancePool contract.amount
(uint256, required) β amount of aBNBc to be switched to aBNBb.
Smart contractβ
Exampleβ
lockShares(shares)
β
Switches aBNBc to aBNBb.
Parametersβ
shares
(uint256, required) β amount of aBNBc to be switched to aBNBb.
Smart contractβ
Exampleβ
Mainnet live transaction example
Stake BNB and claim aBNBbβ
stakeAndClaimBonds(payableAmount)
β
Stakes BNB and claims aBNBb for the staked BNB.
Parametersβ
payableAmount
(BNB, required) β amount of BNB to be staked.
Smart contractβ
Exampleβ
Mainnet live transaction example
Stake BNB and claim aBNBcβ
stakeAndClaimCerts(payableAmount)
β
Stakes BNB and claims aBNBc for the staked BNB.
Parametersβ
payableAmount
(BNB, required) β amount of BNB to be staked.
Smart contractβ
Exampleβ
Mainnet live transaction example
Unstake aBNBb and get BNBβ
unstakeBonds(amount)
β
Unstakes aBNBb and gets BNB for the unstaked aBNBb.
Parametersβ
amount
(uint256, required) β amount of aBNBb to be unstaked.
Smart contractβ
Exampleβ
Unstake aBNBc and get BNBβ
approve(spender, rawAmount)
β
Lets the aBNBb
smart contract transfer user's aBNBc tokens.
Parametersβ
spender
(address, required) β address of theaBNBb
smart contract.rawAmount
(uint256, required) - amount of aBNBc to be unstaked.
Smart contractβ
Exampleβ
unstakeCerts(shares)
β
Unstakes aBNBc and gets BNB for the unstaked aBNBc.
Parametersβ
shares
(uint256, required) β amount of aBNBc to be unstaked.
Smart contractβ
Exampleβ
Get staking metricsβ
To integrate Ankr Staking metrics into your dashboards or use metrics like APY in your products, read Liquid Staking Metrics.