Private constructor. Instead, use EthereumSDK.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.
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 (aETHb or ankrETH)
Approve ankrETH for aETHb, i.e. allow aETHb smart contract to access and transfer ankrETH tokens.
Approve ankrMATIC for SwapPool, i.e. allow SwapPool smart contract to access and transfer ankrMATIC tokens.
Claim tokens.
token symbol
Internal function to convert wei value to human readable format.
value in wei
units
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 transaction data.
transaction hash
Fetch transaction receipt.
transaction hash.
Flash Unstake token.
amount to unstake
choose which token to unstake (aMATICb or ankrMATIC)
Return aETHb token balance.
Return ankrETH allowance.
Return ankrETH token balance.
Return ankrETH/ETH ratio.
Return ankrBNB Swap Pool token allowance.
Internal function to get aETHb token contract.
readProvider or writeProvider
Internal function to get ankrETH token contract.
readProvider or writeProvider
Return BNB swap pool token balance.
Return BNB swap pool max fee.
Internal function to get blocks by block number. It uses cache to avoid unnecessary requests.
web3 instance.
block numbers to get.
blocks data.
Get claimable amount.
token symbol
Return ETH balance.
Internal function to get GlobalPool contract.
readProvider or writeProvider
Get transaction history for all period that starts from contract creation.
full transaction history.
Internal function to return increased gas limit.
initial gas limit
Internal function to check the current network.
Return true if unstake is paused.
Get latest block number.
Get minimum stake amount.
smallest possible stake amount - 1 wei
Get minimum unstake amount
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 aETHb and ankrETH.
zero values
Returns pool config contract instance.
readProvider or writeProvider
Get stake gas fee.
amount to stake
token symbol
Internal function to get Swap Pool contract
Return unstake fee for swap pool.
Internal function to return transaction history group from events.
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
Switch ankrETH to aETHb.
object with amount to switch and scale
Stake token.
amount of token
choose which token to receive (aETHb or ankrETH)
Stake without claim.
This method is only for creating a testing capability. It is related to the STAKAN-1259 Do not use it for the production code.
amount to stake
Switch aETHb to ankrETH.
object with amount to switch and scale
Unstake token.
amount to unstake
choose which token to unstake (aETHb or ankrETH)
Initialization method for SDK.
Auto-connects write provider if chains are the same. Initializes read provider to support multiple chains.
Generated using TypeDoc
EthereumSDK allows you to interact with Ethereum Liquid Staking smart contracts on Ethereum (Mainnet, Holesky Tesnet) BNB Smart Chain: aETHb, ankrETH, and GlobalPool.
For more information on Ethereum Liquid Staking from Ankr, refer to the development details.