-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
BuildOptions.availableUtxos and collectFrom inputs are static arrays resolved before buildEffect() runs. When an action is retried via Effect.retry, the same stale UTxO arrays are reused — the provider is never queried again.
Proposed Solution
Allow availableUtxos and collectFrom.inputs to also accept a lazy resolver () => Effect<ReadonlyArray<UTxO>> evaluated at build time:
client.newTx()
.collectFrom({ inputs: () => client.Effect.getUtxos(scriptAddress), redeemer })
.buildEffect({ availableUtxos: () => client.Effect.getWalletUtxos() })
.pipe(Effect.flatMap(s => s.Effect.signAndSubmit()))
.pipe(Effect.retry(Schedule.recurs(3)))Each retry calls the resolver fresh, so UTxOs are always up to date with no extra boilerplate required from the user.
Affected Areas
BuildOptions.availableUtxos— extend type to accept() => Effect<ReadonlyArray<UTxO>>resolveAvailableUtxosinTransactionBuilder.ts— yield the Effect at build time when lazyCollectFromParams.inputs— same lazy extensioncreateCollectFromPrograminCollect.ts— evaluate resolver at program execution time
Non-breaking — static arrays continue to work as-is.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request