IntersectMBO / IntersectMBO/evolution-sdk
feat(builder): lazy UTxO resolvers for retry-safe buildEffect
- 主要言語
- TypeScript
- スター
- 22
- フォーク
- 30
- 平均マージ
- 5時間 29分
- マージ済み PR(30日)
- 12
説明
## 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>` evaluated at build time:
```ts
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>`
- `resolveAvailableUtxos` in `TransactionBuilder.ts` — yield the Effect at build time when lazy
- `CollectFromParams.inputs` — same lazy extension
- `createCollectFromProgram` in `Collect.ts` — evaluate resolver at program execution time
Non-breaking — static arrays continue to work as-is.
コントリビューションガイド
調査の方向性
Start with BuildOptions and resolveAvailableUtxos in TransactionBuilder.ts, then inspect CollectFromParams.inputs and createCollectFromProgram in Collect.ts. Confirm how static arrays are handled before extending both inputs to support lazy Effects. Done means static behavior remains compatible and lazy resolvers are evaluated at build or program execution time so retries obtain fresh UTxOs.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- backend-api-design
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100