Skip to content

feat(sep6): add SEP-6 deposit endpoint with fee calculation#478

Merged
Ceejaytech25 merged 1 commit into
ceejaylaboratory:mainfrom
Damola09:feat/sep6-deposit-373
May 29, 2026
Merged

feat(sep6): add SEP-6 deposit endpoint with fee calculation#478
Ceejaytech25 merged 1 commit into
ceejaylaboratory:mainfrom
Damola09:feat/sep6-deposit-373

Conversation

@Damola09
Copy link
Copy Markdown
Contributor

Summary

Implements the SEP-6 non-interactive deposit endpoint as specified in issue #373.

  • Accepts first_name, last_name, memo, memo_type, callback_url, lang query parameters
  • Computes fee_amount using computeAssetFee from the fee service
  • Stores senderInfo (email, first_name, last_name, memo, memo_type), callbackUrl, feeAmount, feeAssetCode, feeType on the transaction
  • Returns fee_amount in the JSON response
  • Includes caller-supplied memo in extra_info.memo
  • Validates amount range and rejects unsupported assets
  • Gracefully handles DB errors with a 500 response and structured logger output

Test plan

  • Returns fee_amount in the response
  • Stores senderInfo with all fields including memo
  • Stores callbackUrl and fee fields on the transaction
  • Propagates memo to extra_info.memo in the response
  • Rejects NaN, below-min, and above-max amounts with 400
  • Returns 500 on DB errors

Fixes #373

- Add fee calculation via computeAssetFee (flat/percentage/tiered)
- Accept memo, memo_type, callback_url, and lang query params per SEP-6 spec
- Persist senderInfo JSON (email, first_name, last_name, memo, memo_type),
  callbackUrl, feeAmount, feeAssetCode, feeType on the Transaction record
- Return fee_amount in every response for transparent cost disclosure
- Caller-supplied memo propagated into extra_info.memo in the response
- Replace console.error with structured logger; mask error details
- Update depositQuerySchema with new optional fields
- Add 11 new deposit tests covering fees, senderInfo, callbackUrl, memo,
  amount boundaries, NaN, and downstream DB errors

Fixes ceejaylaboratory#373
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

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

@Ceejaytech25
Copy link
Copy Markdown
Contributor

LGTM!

@Ceejaytech25 Ceejaytech25 merged commit 9a0cff2 into ceejaylaboratory:main May 29, 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.

[Backend] Implement SEP-6 Deposit Endpoint

2 participants