Staking Related Modules
Overview
The provided examples illustrate a series of Move modules focused on staking functionality within Initia. These modules enable users to register for staking, delegate and undelegate tokens, claim rewards, and obtain information about their staking activities and unbonding processes. Here's a breakdown of the functionality provided by each entry and view function within the staking module context:
Entry Functions
Register an Account Delegation Store
Initializes a storage area for an account's delegation activities, allowing it to participate in staking operations.
Delegate Coin and Deposit Rewards
Allows an account to delegate tokens to a validator. This process involves specifying the token type through metadata, the validator's address, and the amount to be delegated.
Undelegate
Enables the withdrawal of a previously delegated amount from a validator. Note that the returned amount might slightly vary due to rounding errors.
Claim unbonding_coin
from Expired Unbonding
unbonding_coin
from Expired UnbondingPermits the claiming of tokens after the unbonding period has expired, based on the specified metadata, validator, and release time.
Claim Rewards
Allows an account to claim staking rewards from a specific validator, based on the tokens delegated.
View Functions
Get Delegation Info of an Address and a Validator Address
Retrieves detailed information about a specific delegation, including the metadata of the delegated tokens, the validator involved, and the response details like share and unclaimed rewards.
Get All Delegation Info of an Address
Fetches all delegation records for a given address, with the ability to paginate results using a start_after
validator address and limit the number of responses.
Example Response of get_delegation
and get_delegations
get_delegation
and get_delegations
Contains information returned by the delegation queries, including details about the delegation share, unclaimed rewards, and the tokens involved.
Get Unbonding Info
Obtains information about a specific unbonding operation, detailing the metadata, validator, release time, and other relevant data.
Get All Unbondings of an Address
Retrieves all unbonding records for a specific address and validator, offering pagination through start_after_validator
and start_after_release_time
, alongside a response limit.
Example Response of get_unbondings
get_unbondings
Provides details from unbonding queries, such as the amount being unbonded, the associated release time, and other pertinent data.
Last updated