Private constructor. Instead, use FantomSDK.getInstance
.
apiGateWay — gateway instance.
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 (aFTMb or ankrFTM)
Approve ankrFTM for aFTMb, i.e. allow aFTMb smart contract to access and transfer ankrFTM tokens.
Checks if allowance is greater or equal to amount.
Internal function to convert wei value to human readable format.
value in wei
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.
Return aFTMb token balance.
Checks if allowance is greater or equal to amount.
Return ankrFTM token balance.
Return ankrFTM/FTM ratio.
Internal function to get aFTMb token contract.
Internal function to get ankrFTM token contract.
Internal function to get blocks by block number. It uses cache to avoid unnecessary requests.
web3 instance.
block numbers to get.
blocks data.
Internal function to get FantomPool contract.
Return FTM balance.
Get transaction history for all period that starts from contract creation.
full transaction history.
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 ankrFTM.
Get stake gas fee.
amount to stake
token symbol (aFTMb or ankrFTM)
Internal function to return stake method by token symbol.
token symbol (aFTMb or ankrFTM)
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 return unstake method by token symbol.
token symbol (aFTMb or ankrFTM)
Internal function to get write provider. If write provider is not connected, it will be connected.
Internal function to check the current network.
Switch ankrFTM to aFTMb.
object with amount to switch and scale
Stake token.
amount of token
choose which token to receive (aFTMb or ankrFTM)
Switch aFTMb to ankrFTM.
object with amount to switch and scale
Unstake token.
amount to unstake
choose which token to unstake (aFTMb or ankrFTM)
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, ankrFTM, and FantomPool.
For more information on Fantom Liquid Staking from Ankr, refer to the development details.