Requires flag: experimental-oneof
This is a feature of the experimental Numscript interpreter. To run it through the API, set runtime: experimental-interpreter in the transaction request body (the default is machine) and enable the relevant feature flag. See Selecting an Interpreter for per-feature availability.
Select the first source or destination that can satisfy the transaction. Unlike ordered sources (which split funds across accounts), oneof picks exactly one branch.
Source#
Try each account in order. The first one with sufficient balance handles the entire amount:
If @users:1234:main has 10000 or more, it's used entirely. If not, @users:1234:savings is tried. Falls through to @world only if neither user account can cover the full amount.
This differs from ordered sources ({ @a @b @c }) which would drain @a first, then take the remainder from @b, then @c. With oneof, it's all-or-nothing per branch.
Destination#
The first matching constraint is used. max caps the amount for that branch; remaining catches everything else.