Problem
src/modules/liquidity/liquidity.service.ts currently returns hardcoded placeholder XDR strings for deposit() and withdraw() operations. The real LiquidityContractClient exists in src/blockchain/contracts/ but is not injected, so the mobile app's sponsor flow cannot actually deposit on-chain.
Context
This is the sponsor-side blocker for end-to-end testing. Without real XDR generation, sponsors can sign but the resulting transaction is unsubmittable garbage. Every other sponsor feature (portfolio, APY, withdrawals) depends on this being real.
Before Starting
Read these context files first:
- context/architecture-context.md
- context/code-standards.md
- context/progress-tracker.md
- src/modules/liquidity/liquidity.service.ts
- src/blockchain/contracts/liquidity-contract.client.ts
What To Build
- Inject
LiquidityContractClient into LiquidityService constructor.
- Read
LIQUIDITY_POOL_CONTRACT_ID from ConfigService and pass to the client.
- Replace placeholder in
buildDepositXdr(walletAddress, amount): call client.buildUnsignedXdr('deposit', [walletAddress, amount]) and return the base64 XDR string.
- Same for
buildWithdrawXdr(walletAddress, shares): call client.buildUnsignedXdr('withdraw', [walletAddress, shares]).
- Add error handling: contract simulation errors should return a 400 with the typed Soroban error code mapped to a user-facing message.
- Update e2e test
test/e2e/liquidity.e2e-spec.ts to assert the returned XDR is a valid base64-encoded Stellar transaction (use TransactionBuilder.fromXDR()).
Files To Touch
src/modules/liquidity/liquidity.service.ts
src/modules/liquidity/liquidity.module.ts
src/blockchain/contracts/liquidity-contract.client.ts
src/blockchain/blockchain.module.ts
test/e2e/liquidity.e2e-spec.ts
.env.example
Acceptance Criteria
Mandatory Checks Before PR
Problem
src/modules/liquidity/liquidity.service.tscurrently returns hardcoded placeholder XDR strings fordeposit()andwithdraw()operations. The realLiquidityContractClientexists insrc/blockchain/contracts/but is not injected, so the mobile app's sponsor flow cannot actually deposit on-chain.Context
This is the sponsor-side blocker for end-to-end testing. Without real XDR generation, sponsors can sign but the resulting transaction is unsubmittable garbage. Every other sponsor feature (portfolio, APY, withdrawals) depends on this being real.
Before Starting
Read these context files first:
What To Build
LiquidityContractClientintoLiquidityServiceconstructor.LIQUIDITY_POOL_CONTRACT_IDfromConfigServiceand pass to the client.buildDepositXdr(walletAddress, amount): callclient.buildUnsignedXdr('deposit', [walletAddress, amount])and return the base64 XDR string.buildWithdrawXdr(walletAddress, shares): callclient.buildUnsignedXdr('withdraw', [walletAddress, shares]).test/e2e/liquidity.e2e-spec.tsto assert the returned XDR is a valid base64-encoded Stellar transaction (useTransactionBuilder.fromXDR()).Files To Touch
src/modules/liquidity/liquidity.service.tssrc/modules/liquidity/liquidity.module.tssrc/blockchain/contracts/liquidity-contract.client.tssrc/blockchain/blockchain.module.tstest/e2e/liquidity.e2e-spec.ts.env.exampleAcceptance Criteria
TransactionBuilder.fromXDRLIQUIDITY_POOL_CONTRACT_IDis read viaConfigService, notprocess.envMandatory Checks Before PR
anytypes introduced anywhere