Skip to content

Clarify i_with semantics and add generic asset-presence helpers#31

Open
sandykwl wants to merge 1 commit intosidan-lab:mainfrom
sandykwl:feat/input_utils
Open

Clarify i_with semantics and add generic asset-presence helpers#31
sandykwl wants to merge 1 commit intosidan-lab:mainfrom
sandykwl:feat/input_utils

Conversation

@sandykwl
Copy link

This PR addresses #30 by making the singleton assumption in i_with explicit and adding clear, non-breaking helpers for general asset presence.

Changes

  • Added i_with_any - predicate matching inputs that contain the asset (quantity > 0).
  • Added inputs_with_any - list helper using i_with_any.
  • Added i_with_singleton - explicit predicate for singleton/NFT use-cases (quantity == 1).
  • Deprecated i_with - behavior unchanged; doc now points to the explicit helpers.
  • Clarified docs for inputs_with - now states it matches quantity == 1.

Rationale

i_with previously enforced quantity == 1 without reflecting this in its name or docs, which could exclude valid fungible-asset inputs.
This PR improves API clarity while preserving existing behavior to avoid breaking downstream usages. The new helpers provide explicit, composable semantics for both general presence and singleton checks.

Compatibility

  • No breaking changes.
  • Existing functions continue to work as before.
  • Clear migration paths are documented via deprecation notes.

Refs #30

@sandykwl sandykwl changed the title Title: Clarify i_with semantics and add generic asset-presence helpers Clarify i_with semantics and add generic asset-presence helpers Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant