Private constructor. Instead, use PolygonOnPolygonSDK.getInstance
.
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 (aMATICb or ankrMATIC)
Approve ankrMATIC for SwapPool, i.e. allow SwapPool smart contract to access and transfer ankrMATIC tokens.
Internal function to convert wei value to human-readable format.
value in wei
Internal function to convert wei value to human-readable format.
value in wei
Return aMATICb token balance.
Return aMATICb ratio.
Internal function to get aMATICb token contract.
Return ankrMATIC token allowance.
Return ankrMATIC token balance.
Returns amount of the ankrMATIC token pool liquidity from SwapPool contract.
Returns amount of the ankrMATIC token pool liquidity in MATIC from SwapPool contract.
Return ankrMATIC/MATIC ratio.
Internal function to get ankrMATIC token contract.
Internal function to return increased gas limit.
initial gas limit
Returns amount of the MATIC token pool liquidity in ankrMATIC from SwapPool contract.
Return MATIC token balance.
Internal function to get MATIC token contract.
Get minimum stake amount.
Get total pending unstake amount.
Get pending data for aMATICb and ankrMATIC.
Get stake fee in percents.
Get stake gas fee.
amount to stake
token symbol (aMATICb or ankrMATIC) as reserved value (not using now)
Internal function to get SwapPool contract.
Get transaction data.
transaction hash
Get transaction receipt.
transaction hash
Get unstake fee in percents.
Internal function get write provider. If provider is not connected, it will be connected.
Internal function to check the current network.
current selected provider
Stake token.
amount of token
choose which token to receive (aMATICb or ankrMATIC)
Unstake token.
amount to unstake
choose which token to unstake (aMATICb or ankrMATIC)
Initialization method for the SDK.
Auto-connects writeProvider if chains are the same. Initializes readProvider to support multiple chains.
user defined providers
Generated using TypeDoc
PolygonOnPolygonSDK allows you to interact with Polygon Liquid Staking smart contracts on the Polygon blockchain: MATIC, aMATICb, ankrMATIC, and SwapPool.
For more information on Polygon Liquid Staking from Ankr, refer to the development details.