All Wallet SDK methods
Aptos
stake(token, address, amount)
: Stakes user tokens. For the initial stake, you need to stake a minimum of 10 APT. However, if you already have an active stake more than or equal to 10 APT, the minimum amount you can add is 0.1 Aptos.reactivate(token, address, amount)
: Reactivates user Stake. The user can only reactivate that number of APT, which was unlocked previously. If a user possesses 15 unlocked APT, they are only able to reactivate the entire amount. This is due to the fact that the condition specifying the remaining unlocked amount must be equal to or greater than 10 APT is not met when unlocking just 10 APT.unlock(token, address, amount)
: Unlocks user tokens. The user can only unlock more than 10 APT and must have more than or equal to 10 APT in the active stake.If a user possesses 15 APT, they are only able to unlock the entire amount. This is due to the fact that the condition specifying the remaining active stake must be equal to or greater than 10 APT is not met when unlocking just 10 APT.unstake(token, address, amount)
: Unstakes user tokens. The user can only unstake that number of APT, which was unlocked previously. If a user possesses 15 unlocked APT, they are only able to unstake the entire amount. This is due to the fact that the condition specifying the remaining unlocked amount must be equal to or greater than 10 APT is not met when ustaking just 10 APT.sendTransfer(address, recipientAddress, amount)
: Transfers user tokens. Using this method user can transfer APT from one wallet address to another.
getBalanceByAddress(address)
: Gets user balance.getStakeBalanceByAddress(address)
: Gets user stake balance.getMinAmountForStake(address)
: Gets user min amount for stake.getLockupSecs()
: Get validator lockup timeout in seconds
Ethereum JS library methods
Actions
stake(address, amount, source)
: Stakes funds into pool. The minimum amount required for staking is 0.1 ETH.activateStake()
: Activates the pending stake by interchanging it with a withdrawal requests.autocompound(address)
: Claims all autocompound user rewards and restakes them into new pool automatically.unstake(address, amount, allowedInterchangeNum, source)
: You can unstake value from autocompound balance. Your ETH can be unstaked immediately if value <= pool pending balance. Also, if 'allowedInterchangeNum > 0', an instant ustake is possible. Else, you need to create a withdraw request. Please note that the execution of a withdraw request may take some time.simulateUnstake(address, amount, allowedInterchangeNum, source)
: Simulates transactions without committing them. It is required, especially for predicting transaction outcomes and gas fees in Ethereum blockchain.unstakePending(address, amount)
: Unstakes pending amount. Your ETH will be unstaked immediately. Smart contract checks remainder of pending balance after unstake. It should be greater or equal min stake amount (0.1 ETH for now).claimWithdrawRequest(address)
: Claims funds requested by withdraw
Getting Info
balance()
: Returns total deposited and activated pools balance. The total amount of ETH that has been staked.pendingBalance()
: Returns the pending balance of staked ETH in the pool, which is always less than 32 ETH.pendingBalanceOf(address)
: Returns the pending balance of the user, which represents the amount of ETH staked but not yet active due to the pool not being fully filled. There is one type of pending balance: "Autocompound," which represents rewards earned by the user that are automatically staked but not yet active.pendingDepositedBalance()
: Returns pool pending deposited balance. Balance was deposited into Beacon deposit contract but validators are still not active.pendingRestakedRewards()
: Returns pool restaked rewards which in pending status.pendingDepositedBalanceOf(address)
: Returns user pending deposited balance. Balance which deposited into validator but not active yet. Pending deposited balance can't be unstake till validator activation.pendingRestakedRewardOf(address)
: Returns user restaked rewards in pending state.RestakedRewardOf(address)
: Returns total user restaked rewards. Includes rewards in pending state.depositedBalanceOf(address)
: Returns user active origin deposited balance.getPoolFee()
: Returns Pool fee in bips (1/10000). To obtain the pool fee percentage, simply multiply it by 100.autocompoundBalanceOf(address)
: Returns total user autocompound balance. The "Autocompound balance" refers to the user's actively staked ETH balance that continuously increases as rewards are restaked. Part of this balance could be in pending state after rewards autocompound.withdrawRequestQueueParams()
: Provides a overview of the withdrawal request queue. It retrieves information about the total amount of funds requested for withdrawal over the entire operational period, giving an insight into the overall demand for withdrawals. Additionally, the function details the current amount that is permissible for interchange with deposits, which is crucial for maintaining a balanced liquidity between incoming and outgoing funds.withdrawRequest(address)
: Returns user withdraw request info. Actual requested amount and amount ready for claimminStakeAmount()
: Returns the minimum amount required for a single user stake.
Getting Validator Info
closeValidatorsStat()
: Returns the number of validators expected to stop.getPendingValidatorCount()
: Returns number of validators prepared for deposit.getPendingValidator(index)
: By using an index, retrieve the pending validator public key. Please note that the list of pending validators is dynamic, and the ordering may be unstable.getValidatorCount()
: Returns the total number of known validators. Validators can be in one of the following statuses: pending, deposited, or exited. Exited validators will be replaced by new pending validators to optimize memory usage.getValidator(index)
: Returns validator pubkey and status.
Polygon
delegate(address, amount, isPOL = false)
: Delegate user tokens.restake(address, isPOL = false))
: Restake user tokens (Claim reward and auto delegate them).undelegate(address, amount, isPOL = false))
: Undelegate user's tokens.reward(address, isPOL = false))
: Reward user tokens (Claim reward).claimUndelegate(address, isPOL = false))
: Claim undelegate user's tokens.isTransactionLoading(hash)
: Waits for a transaction to be processed and returns the status of the transaction.getReward(address)
: Gets the user's reward balance in tokens.getTotalDelegate(address)
: Gets the user's delegate balance in tokens.getUnbond(address)
: Gets the user's unbond balance in tokens.getBalanceOf(address, isPOL = false)
: Gets the user's balance.getCurrentEpoch()
: Gets current epoch.getUnbondNonces(address)
: Gets unbound nonce by address.
Cosmos
delegate(token, address, amount)
: Delegate user tokens.redelegate(token, address, amount, validatorSrcAddress)
: Redelegate user tokens.undelegate(token, address, amount)
: Undelegate user tokens.withdrawRewards(address)
: Reward user tokens (Claim reward).getDelegations(address)
: Gets all user delegation.
Solana
createAccount(address, lamports, source)
: Create Account for Delegate user tokens.delegate(token, address, lamports, stakeAccount)
: Delegate user tokens.stake(token, address, lamports, source)
: Stake user tokens.deactivate(address, stakeAccountPublicKey)
: Deactivate user tokens.withdraw(token, address, stakeAccountPublicKey, stakeBalance)
: Withdraw user tokens.getDelegations(address)
: Get all user delegations.
Why the Wallet SDK
It is very simple to integrate staking, using described methods with code examples.