Skip to content

feat(rates): wire SEP-6 as Tier-3 fallback in fetchCorridorRates#598

Merged
ezedike-evan merged 2 commits into
ezedike-evan:mainfrom
Johnalex-hub:feat/b006-sep6-tier3-rates-439
Jun 29, 2026
Merged

feat(rates): wire SEP-6 as Tier-3 fallback in fetchCorridorRates#598
ezedike-evan merged 2 commits into
ezedike-evan:mainfrom
Johnalex-hub:feat/b006-sep6-tier3-rates-439

Conversation

@Johnalex-hub

Copy link
Copy Markdown
Contributor

Summary

Implements B006 — wires SEP-6 as Tier-3 fallback in fetchCorridorRates after SEP-38 (Tier-1) and SEP-24 indicative (Tier-2) both fail.

  • hasSep6(toml) checks capabilities.sep6 and TRANSFER_SERVER presence
  • sep6IndicativeRate() calls getSep6Info() for fees then applies live FX rate from getUsdFxRate()
  • Tier-3 only attempted when hasSep6(toml) is true — anchors without SEP-6 skip it cleanly
  • Errors[] only populated when all three tiers fail; per-anchor Promise.all isolation preserved
  • Adds sep6-fee to AnchorRate.source union in types/index.ts
  • Cowrie now returns a rate on usdc-ngn instead of landing in errors[]

Test plan

  • SEP-6-only anchor returns rate with source=sep6-fee when Tier-1 and Tier-2 fail
  • totalReceived computed correctly from fees and FX rate
  • errors[] empty when Tier-3 succeeds
  • Anchor lands in errors[] with SEP-6 reason when all tiers fail
  • Anchors without SEP-6 capability skip getSep6Info entirely
  • 5 tests pass (npx vitest run tests/server-rates.sep6.spec.ts)

Closes #439

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Johnalex-hub is attempting to deploy a commit to the ezedikeevan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Johnalex-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@determined-001 determined-001 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commitlint check is failing — the commit subject line doesn't follow Conventional Commits format (e.g. length limit or missing type). Please amend the commit message to match the format (e.g. feat(rates): wire SEP-6 as Tier-3 fallback in fetchCorridorRates) and push.

@ezedike-evan ezedike-evan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commitlint check is failing — the commit subject line exceeds the 72-character limit. Please shorten it (e.g. feat(rates): wire SEP-6 as Tier-3 fallback in fetchCorridorRates) and push so commitlint goes green.

@ezedike-evan ezedike-evan force-pushed the feat/b006-sep6-tier3-rates-439 branch from 7b59ebe to 1788ef1 Compare June 28, 2026 22:25

@ezedike-evan ezedike-evan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check (node 20) and check (node 22) jobs are now failing because main's server-rates.ts was refactored to use isAnchorAssetEnabled instead of USDC_ASSET. When CI runs against the merged ref, the import of USDC_ASSET gets dropped but the usage at line 165 remains, causing: error TS2304: Cannot find name 'USDC_ASSET'.

Please rebase this branch on top of main and update server-rates.ts to work with the current API in constants/anchors.ts (i.e. use isAnchorAssetEnabled / resolve the USDC_ASSET reference against the current export surface).

@Johnalex-hub Johnalex-hub force-pushed the feat/b006-sep6-tier3-rates-439 branch from 1788ef1 to dbee765 Compare June 28, 2026 23:17
@Johnalex-hub Johnalex-hub force-pushed the feat/b006-sep6-tier3-rates-439 branch from dbee765 to ee59f26 Compare June 28, 2026 23:49
@Johnalex-hub Johnalex-hub force-pushed the feat/b006-sep6-tier3-rates-439 branch from 015a570 to c06e46d Compare June 29, 2026 00:07

@ezedike-evan ezedike-evan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Johnalex-hub for addressing the rebase conflict! The USDC_ASSET import is in place, sep6-fee is correctly wired into the QuotePill display, and all CI checks are green. The SEP-6 Tier-3 fallback in fetchCorridorRates looks clean — closes #439. Merging.

@ezedike-evan ezedike-evan merged commit cb11e02 into ezedike-evan:main Jun 29, 2026
11 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

B006: [FEAT] [SEP6] Wire SEP-6 as Tier-3 fallback in fetchCorridorRates

3 participants