Private constructor. Instead, use AvalancheSDK.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 (aAVAXb or aAVAXc)
Approve aAVAXc for aAVAXb, i.e. allow aAVAXb smart contract to access and transfer aAVAXc 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
Fetch transaction data.
transaction hash.
Fetch transaction receipt.
transaction hash.
Internal function to get aAVAXb token contract.
Internal function to get aAVAXc token contract.
Return aAVAXb token balance.
Checks if allowance is greater or equal to amount.
Return aAVAXc token balance.
Return aAVAXc/AVAX ratio.
Return AVAX balance.
Internal function to get AvalanchePool contract.
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 aAVAXc.
Internal function to return raw pool events.
from block
to block
Internal function to choose the right provider for read or write purpose.
Get stake gas fee.
amount to stake
token symbol (aAVAXb or aAVAXc)
Internal function to return stake method by token symbol.
token symbol (aAVAXb or aAVAXc)
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 (aAVAXb or aAVAXc)
Internal function to check the current network.
current selected provider
Switch aAVAXc to aAVAXb.
object with amount to switch and scale
Stake token.
amount of token
choose which token to receive (aAVAXb or aAVAXc)
Switch aAVAXb to aAVAXc.
object with amount to switch and scale
Unstake token.
amount to unstake
choose which token to unstake (aAVAXb or aAVAXc)
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, aAVAXc, and AvalanchePool.
For more information on Avalanche Liquid Staking from Ankr, refer to the development details.