Skip to content

feat(deposit): detect and add USDC trustline via Freighter - #1348

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
iyiade08:feat/usdc-trustline-step
Oct 19, 2026
Merged

greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
iyiade08:feat/usdc-trustline-step

Conversation

@iyiade08

Copy link
Copy Markdown

Closes #1316

Summary

Wallets without the vault’s classic USDC trustline previously reached deposit simulation and received a generic failure. The modal now detects the missing trustline and offers to add it through Freighter before depositing.

  • Added configurable USDC asset constants with Ed25519 issuer validation.
  • Added Horizon detection for present, missing, unfunded-account, and unknown states.
  • Added a transaction containing exactly one changeTrust operation for the configured asset.
  • Added the trustline step with the 0.5 XLM reserve explanation.
  • Added testnet-only Friendbot guidance for unfunded accounts.
  • Allowed deposit approval with a warning when the Horizon check is unavailable.
  • Treated rejected trustline signatures as cancellation without an error toast.
  • Added keyboard-accessible controls and announced status updates.
  • Updated .env.example, Configuration.md, and Deposit-Flow.md.

Validation

  • npm ci — passed.
  • npx tsc -p tsconfig.json --noEmit — passed.
  • npm run build — passed.
  • Full test suite — 142 files and 2,169 tests passed with one worker.
  • Wallet service coverage — 94.17% lines, 92.42% branches, 100% functions.
  • Newly added trustline service lines — 100% covered.

The service tests decode the actual XDR passed to mocked Freighter and assert exactly one changeTrust operation for the configured asset.

Full-suite output:

Test Files  142 passed (142)
     Tests  2169 passed (2169)
  Duration  645.42s

PowerShell settings used for the full-suite run:

$env:VITEST_MAX_THREADS = '1'
$env:VITEST_MIN_THREADS = '1'
npx vitest run

Regression verification: the original main modal permits approval without the configured trustline and displays a generic failure when simulation is mocked to reject. The updated modal offers Add USDC trustline first.

Recording

Attach stellar.mp4 below this paragraph.

The recording shows Freighter approving the trustline and the app enabling Approve Transaction afterward. Horizon independently confirmed the new trustline.

The subsequent deposit remains blocked by deployment setup: simulation returns contract error 44, CallerNotInAllowlist. The wallet also has zero balance of the vault issuer’s test USDC. Maintainer allowlisting and matching test USDC are needed to complete the deposit recording.

Coverage limitation

The repository-wide npm run test:coverage run reported 73.67% line/statement coverage, below the configured 80% floor, with gaps in untouched modules.

The focused wallet service coverage run passes above 90%. Coverage thresholds and exclusions were not changed.

stellar.mp4

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@iyiade08 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

@greatest0fallt1me
greatest0fallt1me merged commit 4c412e4 into CalloraOrg:main Oct 19, 2026
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.

Detect a missing test-USDC trustline and offer to add it before depositing

2 participants