Staking Protocolinterfaces

IAmountsFacet

It defines the basic interface of CampaignAmounts Facets.

initAmountsFacet

function initAmountsFacet(bytes initAmountsData) external

Initialization function.

The structure and content of initAmountsData are implementation specific.

Parameters

NameTypeDescription
initAmountsDatabytesThe ABI-encoded initialization data.

setCampaignAmountsData

function setCampaignAmountsData(uint256 campaignId, bytes campaignAmountsData) external

Setter function for configuring amount-based input packet constraints for the specified staking campaign.

Setter functions are executed during the creation process of campaigns. The structure and content of campaignAmountsData are implementation specific.

Parameters

NameTypeDescription
campaignIduint256The unique identifier of the targeted staking campaign.
campaignAmountsDatabytesThe ABI-encoded amount-based configuration data.

checkInputPackets

function checkInputPackets(uint256 campaignId, uint256 nftId, uint256 amountOfPackets) external view

Checks whether the specified amount of packets can be allocated within a given campaign's position.

If nftId == 0, the check is performed for a stake operation; otherwise, it is performed for a restake operation.

Parameters

NameTypeDescription
campaignIduint256The unique identifier of the targeted staking campaign.
nftIduint256The unique identifier of the NFT associated with the position.
amountOfPacketsuint256The number of input packets to check.

checkUnstakePackets

function checkUnstakePackets(uint256 campaignId, uint256 nftId, uint256 amountOfPackets, bool isPartialUnstake) external view

Checks whether the specified amount of packets can be withdrawn from a given campaign's position.

Parameters

NameTypeDescription
campaignIduint256The unique identifier of the targeted staking campaign.
nftIduint256The unique identifier of the NFT associated with the position.
amountOfPacketsuint256The number of input packets to check.
isPartialUnstakeboolA flag indicating whether the unstake is partial (true) or full (false).

On this page