Label: complexity: high
Points: 200
Description
For payers choosing between direct token payment vs. pay_with_token/bridge_pay (DEX swap path), compare estimated total cost (resource fee + any swap slippage) across both paths to recommend the cheaper option.
Technical Context
New src/feeComparator.ts. Combines Issue 34's fee estimator with a swap-cost estimate (querying the configured DEX contract's quote, if available) to produce a side-by-side comparison.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
For payers choosing between direct token payment vs.
pay_with_token/bridge_pay(DEX swap path), compare estimated total cost (resource fee + any swap slippage) across both paths to recommend the cheaper option.Technical Context
New
src/feeComparator.ts. Combines Issue 34's fee estimator with a swap-cost estimate (querying the configured DEX contract's quote, if available) to produce a side-by-side comparison.Acceptance Criteria
compareFundingPaths(invoice, sourceToken, amount)returns{ direct: CostEstimate | "unsupported", swap: CostEstimate | "unsupported", recommended: "direct"|"swap" }"unsupported"rather than erroring when, e.g., the source token isn't the invoice token and no DEX is configured