Skip to main content

clawback

Function clawback 

Source
pub fn clawback(
    ctx: &mut SpendContext,
    creator: &Owner<'_>,
    created: &CreatedOption,
) -> Result<OptionSpend>
Expand description

Build the unsigned coin spends that CLAW BACK created’s locked XCH underlying to its creator, authorized by creator.

Recovers exactly created.underlying_coin.amount mojos to created.underlying.creator_puzzle_hash through the underlying’s clawback path — valid only AFTER created.underlying.seconds (the holder had until expiry to exercise). A Owner::Standard creator whose puzzle hash does not match the option’s creator is rejected up front; a Owner::Custom creator cannot be checked here and relies on the consensus to reject a wrong-party spend.

Pure: does NOT sign or broadcast. Returns OptionSpend with created: None.