Skip to content

Fix: 4 issues (#1526, #1527, #1528, #1529) - #1652

Merged
Mystery-CLI merged 1 commit into
Ethereal-Future:mainfrom
topsonDev:simple/1526-1527-1528-1529
Oct 18, 2026
Merged

Mystery-CLI merged 1 commit into
Ethereal-Future:mainfrom
topsonDev:simple/1526-1527-1528-1529

Conversation

@topsonDev

Copy link
Copy Markdown
Contributor

Closes #1526
Closes #1527
Closes #1528
Closes #1529

Issues

#1526 backend/src/routes/admin.js: Top-level export ADMIN_STATS_TTL_SECONDS placed inside route handler

Domain: Backend & Routing | Complexity: Low | Tracking ID: ISSUE-212

Background

In backend/src/routes/admin.js, export const ADMIN_STATS_TTL_SECONDS = 30; is declared inside a route handler function body.

Problem

JavaScript modules prohibit export declarations anywhere other than the top-level module scope, throwing SyntaxError: Unexpected token 'export'.

Proposed Solution / Remediation

Move ADMIN_STATS_TTL_SECONDS to the top level of backend/src/routes/admin.js.

Acceptance Criteria

  • node --check backend/src/routes/admin.js passes.
  • Admin routes mount successfully in Express.

#1527 backend/src/routes/auth.js: Dangling object closing fragment causes SyntaxError

Domain: Backend & Routing | Complexity: Low | Tracking ID: ISSUE-213

Background

In backend/src/routes/auth.js at lines 339-340, a stray block fragment sessionId: session.id,\n }); appears outside of any function or object literal.

Problem

Node.js fails parsing with SyntaxError: Unexpected token '}', preventing authentication routes from registering.

Proposed Solution / Remediation

Remove the dangling code fragment and verify the surrounding route handler structure.

Acceptance Criteria

  • node --check backend/src/routes/auth.js passes without errors.
  • Authentication endpoints (/api/v1/auth/*) respond properly.

#1528 backend/src/services/multiSig.js: Duplicate function signature for buildMultiSigTransaction

Domain: Backend & MultiSig | Complexity: Low | Tracking ID: ISSUE-214

Background

In backend/src/services/multiSig.js, the function header for buildMultiSigTransaction is declared at line 363 and duplicated at line 366.

Problem

The consecutive headers cause SyntaxError: Unexpected identifier 'buildMultiSigTransaction', completely halting multi-signature transaction services.

Proposed Solution / Remediation

Remove the duplicated header on line 366.

Acceptance Criteria

  • node --check backend/src/services/multiSig.js exits 0.
  • Multi-signature transaction builder service loads cleanly.

#1529 backend/src/services/pool.js: Unbalanced parenthesis and undefined networkPassphrase in pool deposit

Domain: Backend & Liquidity Pools | Complexity: Medium | Tracking ID: ISSUE-215

Background

In backend/src/services/pool.js at line 329, an unclosed parenthesis breaks the builder call. Furthermore, networkPassphrase is referenced without being defined or passed in, and deposit operations are added twice.

Problem

The file fails syntax validation with SyntaxError: Unexpected token ')', and if parsed would crash at runtime with ReferenceError: networkPassphrase is not defined.

Proposed Solution / Remediation

Fix parenthesis balancing, resolve networkPassphrase from getConfig().stellar, and remove redundant deposit operation chaining.

Acceptance Criteria

  • node --check backend/src/services/pool.js passes.
  • Pool liquidity deposit transactions construct valid Stellar operations.

Summary

All four fixes are syntax-level. In admin.js, the misplaced export also truncated the first /stats handler; remove that incomplete handler and keep the complete cached /stats route. In pool.js, getNetworkPassphrase is already imported from ../config/stellar.js, so no new import is needed — just call it. After edits, run node --check on each file and smoke-test route mounting/service import.

Changes

  • Move export const ADMIN_STATS_TTL_SECONDS = 30; (currently nested inside the first /stats route handler body) to module top level, placing it near the other module-level constants (e.g. after MAKER_CHECKER_ACTIONS or before STATS_CACHE_KEY). Also remove the orphaned first router.get('/stats', ...) handler that was left truncated by the misplaced export, keeping only the complete /stats route that uses cacheMiddleware(ADMIN_STATS_TTL_SECONDS, ...). Verify with node --check backend/src/routes/admin.js and by mounting the admin router in Express. (backend/src/routes/admin.js)
  • Remove the dangling object fragment sessionId: session.id,\n }); around lines 339-340 that sits outside any function or object literal. Confirm the surrounding route handler (likely a session-creation handler) is structurally complete and properly closed, then run node --check backend/src/routes/auth.js and smoke-test /api/v1/auth/* endpoints. (backend/src/routes/auth.js)
  • Remove the duplicated buildMultiSigTransaction function header (the second declaration around line 366) so only a single valid function declaration remains. Ensure the function body is intact and not duplicated, then verify with node --check backend/src/services/multiSig.js and by importing the service module. (backend/src/services/multiSig.js)
  • In executeDeposit, fix the malformed changeTrust operation block: balance the parentheses so StellarSdk.Operation.changeTrust({ asset: new StellarSdk.LiquidityPoolAsset(poolId), ... }) is closed correctly, and replace the undefined networkPassphrase reference in the TransactionBuilder options with getNetworkPassphrase() (already imported from ../config/stellar.js). Remove the redundant second liquidityPoolDeposit operation (the one with placeholder minPrice: '0.1'/maxPrice: '10') so the deposit is only added once using the computed minPrice/maxPrice. Verify with node --check backend/src/services/pool.js and confirm a deposit transaction builds valid Stellar operations. (backend/src/services/pool.js)

Co-authored-by: Simple Agent <agent@simple.dev>
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

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

@Mystery-CLI
Mystery-CLI merged commit 67b3027 into Ethereal-Future:main Oct 18, 2026
8 of 52 checks 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

2 participants