pub fn transfer(
ctx: &mut SpendContext,
owner: &Owner<'_>,
created: &CreatedOption,
new_owner_puzzle_hash: Bytes32,
) -> Result<OptionSpend>Expand description
Build the unsigned coin spend that TRANSFERS created’s option singleton to
new_owner_puzzle_hash, authorized by its current owner.
Spends the option singleton through owner’s p2 layer and recreates it (same launcher id,
same underlying, same amount) at new_owner_puzzle_hash with a hint so the recipient’s
wallet discovers it. The locked underlying coin and the option’s terms are unchanged — only
the ticket’s p2_puzzle_hash moves.
A Owner::Standard owner whose puzzle hash does not match the option’s current
p2_puzzle_hash is rejected up front; a Owner::Custom owner 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: Some(..) — the
option in its NEW-owner state (its coin now lives at new_owner_puzzle_hash), so the caller
can chain further transfers or an exercise/clawback against the transferred singleton once
this spend is confirmed.