pub struct StakeInfo {
pub staker: Address,
pub amount: u128,
pub provider_type: ProviderType,
pub staked_at: Timestamp,
pub unbonding_at: Option<Timestamp>,
pub slashing_history: Vec<SlashEvent>,
pub restoration_history: Vec<RestoreEvent>,
pub total_rewards: u128,
pub status: StakeStatus,
pub lifecycle_freeze: bool,
}Expand description
Staking information for a provider
Fields§
§staker: AddressStaker address
amount: u128Amount staked
provider_type: ProviderTypeProvider type
staked_at: TimestampTimestamp when staked
unbonding_at: Option<Timestamp>Unbonding timestamp (if unbonding)
slashing_history: Vec<SlashEvent>Slashing history
restoration_history: Vec<RestoreEvent>Restoration history (governance-authorized un-slashings)
total_rewards: u128Total rewards earned
status: StakeStatusStake status
lifecycle_freeze: boolKill-switch lifecycle freeze (Agent-Swarm Spec 1).
Set by the node post-execute scan when a KillSwitchPause or
KillSwitchQuarantine log is observed for the machine DID that
owns this stake address; cleared on ResumedFromPause /
ResumedFromQuarantine. While frozen, unstake, withdraw, and
reward accrual are rejected. slash is not gated — terminate
flow needs to slash even when frozen.
Implementations§
Source§impl StakeInfo
impl StakeInfo
Sourcepub fn new(staker: Address, amount: u128, provider_type: ProviderType) -> Self
pub fn new(staker: Address, amount: u128, provider_type: ProviderType) -> Self
Creates a new stake info
Sourcepub fn is_unbonding_complete(&self) -> bool
pub fn is_unbonding_complete(&self) -> bool
Checks if unbonding period has completed
Sourcepub fn add_slash(&mut self, event: SlashEvent)
pub fn add_slash(&mut self, event: SlashEvent)
Adds a slash event
Note: Caller must verify self.amount >= event.amount before calling.
Sourcepub fn add_rewards(&mut self, amount: u128) -> Result<()>
pub fn add_rewards(&mut self, amount: u128) -> Result<()>
Adds rewards.
Rejected when the stake is under a kill-switch lifecycle freeze
(Paused / Quarantined). The terminate path slashes via
StakingManager::slash directly and never reaches this method.