Private constructor. Instead, use AvalancheSDK.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 (aAVAXb or ankrAVAX)
Approve ankrAVAX for aAVAXb, i.e. allow aAVAXb smart contract to access and transfer ankrAVAX tokens.
Checks if allowance is greater or equal to amount.
Internal function to convert wei value to human readable format.
value in wei
Internal function to convert value to hex format.
value in human readable format
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.
Internal function to get aAVAXb token contract.
Return aAVAXb token balance.
Checks if allowance is greater or equal to amount.
Return ankrAVAX token balance.
Return ankrAVAX/AVAX ratio.
Return AVAX balance.
Internal function to get ankrAVAX token contract.
Internal function to get AvalanchePool contract.
Internal function to get blocks by block number. It uses cache to avoid unnecessary requests.
web3 instance.
block numbers to get.
blocks data.
Get transaction history for all period that starts from contract creation.
full transaction history.
Get latest block number.
Get minimum stake 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 aAVAXb and ankrAVAX.
Internal function to return raw pool events.
from block
to block
Get stake gas fee.
amount to stake
token symbol (aAVAXb or ankrAVAX)
Internal function to return stake method by token symbol.
token symbol (aAVAXb or ankrAVAX)
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
Internal function to map event type to transaction type.
Internal function to return unstake method by token symbol.
token symbol (aAVAXb or ankrAVAX)
Internal function to get write provider. If provider is not connected, it will be connected.
Internal function to check the current network.
current selected provider
Switch ankrAVAX to aAVAXb.
object with amount to switch and scale
Stake token.
amount of token
choose which token to receive (aAVAXb or ankrAVAX)
Switch aAVAXb to ankrAVAX.
object with amount to switch and scale
Unstake token.
amount to unstake
choose which token to unstake (aAVAXb or ankrAVAX)
Internal function to return increased gas limit.
initial gas limit
Initialization method for SDK.
Auto-connects writeProvider if chains are the same. Initializes readProvider to support multiple chains.
Generated using TypeDoc
AvalancheSDK allows you to interact with Avalanche Liquid Staking smart contracts on Avalanche network: aAVAXb, ankrAVAX, and AvalanchePool.
For more information on Avalanche Liquid Staking from Ankr, refer to the development details.