fix: wire real XDR generation into liquidity deposit/withdraw#94
Open
Godfrey-Delight wants to merge 1 commit into
Open
fix: wire real XDR generation into liquidity deposit/withdraw#94Godfrey-Delight wants to merge 1 commit into
Godfrey-Delight wants to merge 1 commit into
Conversation
Wires the real LiquidityContractClient into LiquidityService for deposit and withdraw, replacing the hardcoded placeholder XDR strings that were blocking the sponsor deposit flow end-to-end. LIQUIDITY_POOL_CONTRACT_ID is read via ConfigService, and contract simulation errors (codes 100–104) are mapped to typed BadRequestExceptions instead of surfacing raw Soroban errors. Closes StepFi-app#1
EmeditWeb
reviewed
Jul 21, 2026
EmeditWeb
left a comment
Member
There was a problem hiding this comment.
Review verdict: ✅ APPROVE with minor corrections
Solid money-path work. The new liquidity client and service wiring are clean:
STROOPS = 10_000_000nandMath.round(amount * 10_000_000)— correct 7-decimal conversion (avoids the* 100bug fixed in #89).- Share-price math for deposit/withdraw; proper service/client separation;
BadRequestExceptionon failure; noanyin the new client; e2e + unit tests added. CI green.
Minor corrections:
liquidity.service.ts:279—handleContractError(error: any, operation: string)usesany. Per code-standards, useunknownand narrow (e.g.error instanceof Error).- Cross-verify the
deposit/withdraw2-arg call signatures against the deployed liquidity-pool contract (same class of check as #90 for repay; lower risk since deposit/withdraw are simpler and more stable).
Merge-ready once the any is addressed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issue
Closes #1
🔖 Title
Wire real XDR generation into liquidity deposit/withdraw
📝 Description
Wires the real LiquidityContractClient into LiquidityService for deposit and withdraw, replacing the hardcoded placeholder XDR strings that were blocking the sponsor deposit flow end-to-end. LIQUIDITY_POOL_CONTRACT_ID is read via ConfigService, and contract simulation errors (codes 100–104) are mapped to typed BadRequestExceptions instead of surfacing raw Soroban errors.
🔄 Changes Made
📸 Screenshots (if applicable)
🗒️ Additional Notes
-npm run build passes with zero TypeScript errors, no new any types introduced
-E2E tests run against mocked RPC simulation responses rather than a live Soroban testnet RPC — worth flagging since the acceptance criteria specifically asks for the e2e test to pass against a running testnet RPC; happy to add that run if a testnet endpoint/funded account is available in CI, or confirm this mock-based coverage is sufficient
-No schema changes, so no new migration file