Skip to content

feat(api): invoke vault contract on deposit/withdraw#35

Merged
robertocarlous merged 1 commit intoNeurowealth:mainfrom
edehvictor:codex/feat-vault-deposit-withdraw-32
Mar 29, 2026
Merged

feat(api): invoke vault contract on deposit/withdraw#35
robertocarlous merged 1 commit intoNeurowealth:mainfrom
edehvictor:codex/feat-vault-deposit-withdraw-32

Conversation

@edehvictor
Copy link
Copy Markdown
Contributor

Closes #32

Changes

  • add typed depositForUser and withdrawForUser helpers in src/stellar/contract.ts
  • use the existing Soroban build/submit/confirm flow for vault write calls
  • make the signing strategy explicit: custodial backend signing via src/stellar/wallet.ts
  • update POST /api/deposit and POST /api/withdraw to submit on-chain transactions
  • persist the real on-chain txHash and confirmed status in Prisma transactions
  • return a stable API response including top-level txHash and status
  • document the custodial signing model in src/stellar/README.md
  • mock Stellar contract calls in API tests and expand coverage for deposit/withdraw behavior

Signing Strategy

This implementation uses a custodial model. The backend decrypts the user’s encrypted Stellar secret from src/stellar/wallet.ts, signs the Soroban transaction server-side, and submits it through the configured RPC flow. Secrets are not returned or logged.

Testing

  • node .\node_modules\typescript\bin\tsc --noEmit
  • node .\node_modules\jest\bin\jest.js --runInBand

Notes

  • I could not fetch upstream from Neurowealth/Backend in this environment, so this branch is based on the current local main rather than a verified upstream-rebased main.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

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

@robertocarlous robertocarlous merged commit 63ad3dd into Neurowealth:main Mar 29, 2026
1 check 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.

Wire POST /api/deposit and POST /api/withdraw to the vault Soroban contract

2 participants