OptionalassertRefuse a spend this contract definitively cannot make right now, with a reason the caller can act on. Called before anything is signed or submitted, for inputs the caller named explicitly.
This is the counterpart to isGenericallySpendable, not a duplicate of it. That gate keeps escrow out of GENERIC selection and deliberately leaves explicit-input APIs open, because naming an outpoint is the intent it protects. Naming one too early is still a mistake though, and without this it is a mistake the server reports — as a protocol-level rejection, after the round trip, in terms that do not name the timelock that was not yet mature.
Throw only on a definite no. Absent, silent, or unsure all mean "no
opinion" and the spend proceeds. A handler must not refuse merely because
it found no path: getSpendablePaths legitimately returns empty for
spendable contracts — arkade's skips every covenant leaf, so a program
spendable only through its emulator-signed leaf reports nothing — and an
unreadable timelock (height-typed with no chain tip) is unknown, not
immature.
Create the VtxoScript from serialized parameters.
Serialized contract parameters
Contract script instance
Deserialize string key-value pairs to typed parameters.
Get all possible spending paths for the current context. Returns empty array if no paths are available.
Useful for showing users which spending options exist regardless of current spendability.
Get all currently spendable paths. Returns empty array if no paths are available.
OptionalisWhether this contract's VTXOs may be picked by generic wallet spending —
send, settle, renewal, asset operations, offboard, available balance.
Explicit-input APIs (settle({ inputs }), send({ selectedVtxos }),
…) stay open regardless: naming an outpoint is the intent this gate protects.
Pure, synchronous and offline — it runs inside the service worker, so no
chain tip, no network, no live plugin object. Absent or false ⇒ NOT
spendable: a type core cannot reason about must not leak by omission.
No script parameter: deriving it costs a taproot tree per contract on a
read path (#521) and no shipped handler needs it. A handler that does can
call its own createScript(contract.params).
Select the preferred spending path based on contract state and context. Returns the best available path (e.g., collaborative over unilateral).
PathSelection if a viable path exists, null otherwise
Serialize typed parameters to string key-value pairs.
Typed contract parameters
Serialized key-value representation
Handler for a specific contract type.
Each contract type (
default,vhtlc, etc.) has a handler that knows how to:Example