Skip to content

Prepare deposit transactions with Soroban simulation so /api/vault/de… - #1542

Open
IFEANYIBRIGHT wants to merge 7 commits into
CalloraOrg:mainfrom
IFEANYIBRIGHT:feat/deposit-prepare-soroban-simulation
Open

IFEANYIBRIGHT wants to merge 7 commits into
CalloraOrg:mainfrom
IFEANYIBRIGHT:feat/deposit-prepare-soroban-simulation

Conversation

@IFEANYIBRIGHT

Copy link
Copy Markdown
Contributor

closes #1494

Summary of Changes

  1. TransactionBuilderService (src/services/transactionBuilder.ts)
  • Added Soroban RPC simulation (simulateTransaction) and assembly (assembleTransaction) to produce XDR with sorobanData
  • Changed BuildDepositParams from userPublicKey to userStellarAddress to use the user's Stellar address from their profile
  • Added isBackendOwnedAccount option to only use sequence store for backend-owned accounts (prevents sequence burning for user-owned accounts)
  • Added new response fields: resourceFee, minResourceFee, latestLedger
  • Moved all error class definitions to top of file for proper TypeScript hoisting
  • Used rpc.assembleTransaction instead of deprecated prepareTransaction API
  1. DepositController (src/controllers/depositController.ts)
  • Added userRepository dependency to fetch user's stellarAddress
  • Returns 400 STELLAR_ADDRESS_REQUIRED when user lacks a Stellar address
  • Updated response to include new metadata fields
  • Fixed error handling for unknown error types
  1. OpenAPI Specification (docs/openapi.json)
  • Added /api/vault/deposit/prepare endpoint with full request/response schemas
  • Added new metadata fields: resourceFee, minResourceFee, latestLedger
  • Added STELLAR_ADDRESS_REQUIRED error example
  1. Error Codes (docs/error-codes.yaml)
  • Added STELLAR_ADDRESS_REQUIRED error code
  1. Documentation (docs/deposit-transaction-builder.md)
  • Updated response format with new fields
  • Added simulation/assembly explanation
  • Documented sequence store behavior for backend vs user-owned accounts
  1. Tests
  • Updated transactionBuilder.test.ts with new mocks for Soroban RPC and tests for simulation/assembly
  • Updated depositController.test.ts with userRepository mock and new test cases
    Verification
  • ✅ npm run typecheck - Passes for modified files (pre-existing errors in other files)
  • ✅ npm run validate:openapi - Passes (46 paths, 60 operations)
  • ✅ npm run build - Compiles successfully
  • ⚠️ npm run lint - Fails due to Node.js version mismatch (pre-existing dependency issue)
  • ⚠️ Tests - Quarantined in jest.quarantine.json, require JEST_RUN_QUARANTINED=1 to run

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

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

@IFEANYIBRIGHT
IFEANYIBRIGHT force-pushed the feat/deposit-prepare-soroban-simulation branch from d1ca6b0 to 68bd830 Compare October 21, 2026 18:23
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.

Prepare deposit transactions with Soroban simulation so /api/vault/deposit/prepare returns submittable XDR

1 participant