pub trait VaultAction {
// Required methods
fn capture_value(
&self,
session: &SessionKey,
merchant_id: Pubkey,
proof: ZkProof,
) -> Result<CaptureResult, ActionError>;
fn stake_cred(
&self,
session: &SessionKey,
amount: u64,
duration_days: u16,
auto_compound: bool,
) -> Result<StakingPosition, ActionError>;
fn claim_yield(
&self,
session: &SessionKey,
position_id: Option<Pubkey>,
restake: bool,
) -> Result<u64, ActionError>;
fn request_yield_optimization(
&self,
session: &SessionKey,
risk_tolerance: RiskTolerance,
) -> Result<YieldRecommendation, ActionError>;
}Expand description
The Action Interface trait
Implementations handle the actual Solana transaction building. Lambda invokes these, but the SESSION KEY (not Lambda) signs.
Required Methods§
Sourcefn capture_value(
&self,
session: &SessionKey,
merchant_id: Pubkey,
proof: ZkProof,
) -> Result<CaptureResult, ActionError>
fn capture_value( &self, session: &SessionKey, merchant_id: Pubkey, proof: ZkProof, ) -> Result<CaptureResult, ActionError>
Capture value from a verified purchase
§Security
- Requires
Capturescope in session key - Contract enforces 80/14/6 split
- Agent cannot modify distribution
Sourcefn stake_cred(
&self,
session: &SessionKey,
amount: u64,
duration_days: u16,
auto_compound: bool,
) -> Result<StakingPosition, ActionError>
fn stake_cred( &self, session: &SessionKey, amount: u64, duration_days: u16, auto_compound: bool, ) -> Result<StakingPosition, ActionError>
Stake Cred for yield
§Security
- Requires
Stakescope in session key - Funds move from user vault to staking pool
- Position NFT minted to user