Private constructor. Instead, use FantomSDK.getInstance
.
apiGateWay — gateway instance.
apiUrl — URL of the advanced API.
currentAccount — connected account.
readProvider — provider which allows to read data without connecting the wallet.
writeProvider — provider which has signer for signing transactions.
instance — SDK instance.
Add token to wallet.
token symbol (aFTMb or aFTMc)
Approve aFTMc for aFTMb, i.e. allow aFTMb smart contract to access and transfer aFTMc tokens.
Checks if allowance is greater or equal to amount.
Internal function to convert wei value to human readable format.
value in wei
Fetch transaction data.
transaction hash.
Fetch transaction receipt.
transaction hash.
Return aFTMb token balance.
Checks if allowance is greater or equal to amount.
Return aFTMc token balance.
Return aFTMc/FTM ratio.
Internal function to get aFTMb token contract.
Internal function to get aFTMc token contract.
Get burn fee for amount
amount to burn
Internal function to get FantomPool contract.
read or write provider
Return FTM balance.
Internal function to return increased gas limit.
initial gas limit
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 aFTMb and aFTMc.
Internal function to choose the right provider for read or write purpose.
Get stake gas fee.
amount to stake
token symbol (aFTMb or aFTMc)
Internal function to return stake method by token symbol.
token symbol (aFTMb or aFTMc)
Get transaction history.
Get transaction history.
from block
to block
Internal function to return unstake method by token symbol.
token symbol (aFTMb or aFTMc)
Internal function to check the current network.
Switch aFTMc to aFTMb.
object with amount to switch and scale
Stake token.
amount of token
choose which token to receive (aFTMb or aFTMc)
Switch aFTMb to aFTMc.
object with amount to switch and scale
Unstake token.
amount to unstake
choose which token to unstake (aFTMb or aFTMc)
Initialization method for the SDK.
Auto-connects writeProvider if chains are the same. Initializes readProvider to support multiple chains.
Generated using TypeDoc
FantomSDK allows you to interact with Fantom Liquid Staking smart contracts on Fantom (Mainnet, Tesnet): aFTMb, aFTMc, and FantomPool.
For more information on Fantom Liquid Staking from Ankr, refer to the development details.