fix(aggregator): populate OneClick affiliateFee from appFees - #1764
Conversation
estimateSwap forwarded affiliate config to the 1Click API but always returned fees.affiliateFee = 0, so wallets showed Affiliate Fee as free. Resolve bps from echoed quoteRequest.appFees (matching recipient), with fallback to configured affiliateBps. Closes #1763
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughChangesOneClick affiliate fee calculation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized change populates affiliate-fee values for OneClick quotes, with unit tests and a successful package build reported; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The implementation satisfies the core objective in [ Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
OneClickProtocol.estimateSwapalways returningfees.affiliateFee = 0even when affiliateappFeeswere sent to the 1Click APIquoteRequest.appFeesmatching the configured affiliate recipient, with fallback to configuredaffiliateBpsamountIn * bps / 10000in the input asset so wallet UIs (e.g. Asgardex) can display the affiliate feeCloses #1763
Test plan
oneclickProtocol.test.ts)yarn build --filter=@xchainjs/xchain-aggregatorSummary by CodeRabbit