shared

Functions

readState(input: Input) -> State

Read the State from a transaction input’s inline datum.

inputByRef(ref: OutputReference, tx: Transaction) -> Input

Find an input by reference in regular transaction inputs.

inputOrReferenceByRef(ref: OutputReference, tx: Transaction) -> Input

Find an input by reference in regular inputs first, then reference inputs.

carriesStateToken(
  statePolicyId: PolicyId,
  cageToken: TokenId,
  input: Input,
) -> Bool

Authenticate that an input carries exactly one cage token under the global state policy id.

in_phase1(
  validity_range: Interval<Int>,
  submitted_at: Int,
  process_time: Int,
) -> Bool

Check if the validity range is entirely within Phase 1.

in_phase2(
  validity_range: Interval<Int>,
  submitted_at: Int,
  process_time: Int,
  retract_time: Int,
) -> Bool

Check if the validity range is entirely within Phase 2.

processableRequest(
  request: Request,
  cageToken: TokenId,
  state: State,
  input: Input,
) -> Bool

A request is protected from owner sweep only when it can be processed by state Modify. Matching token alone is not enough: mismatched-deposit or underfunded spam would otherwise be locked at the request address forever. (#183 slice b: the datum binds deposit, not tip.)

Search Document