From bf9cd194b1c9e32dce75f70780685e0f8929c240 Mon Sep 17 00:00:00 2001 From: Maximum-Prosper Date: Sat, 27 Jun 2026 11:29:33 +0100 Subject: [PATCH] fix: align relayer fee-bump route for issue 32 --- client/src/services/soroban.ts | 2 +- server/src/__tests__/deploymentSmoke.test.ts | 1 + server/src/__tests__/routeAudit.test.ts | 3 +++ server/src/app.ts | 1 + server/src/services/rebalanceExecutorService.ts | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/services/soroban.ts b/client/src/services/soroban.ts index e8a7d9ae5..b0086e78e 100644 --- a/client/src/services/soroban.ts +++ b/client/src/services/soroban.ts @@ -286,7 +286,7 @@ export async function executeContractCallOn( let finalXdr = signedXdr; if (useFeeBump) { onPhase?.("submitting"); - const resp = await fetch("/api/relayer/fee-bump", { + const resp = await apiFetch("/api/relayer/fee-bump", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ innerTxXdr: signedXdr }), diff --git a/server/src/__tests__/deploymentSmoke.test.ts b/server/src/__tests__/deploymentSmoke.test.ts index fc77bd912..60d56a4d5 100644 --- a/server/src/__tests__/deploymentSmoke.test.ts +++ b/server/src/__tests__/deploymentSmoke.test.ts @@ -158,6 +158,7 @@ describe("Backend runtime wiring — client-facing routes must not 404", () => { ["get", "/api/analytics/providers/uptime"], ["get", "/api/analytics/sources/health"], ["get", "/api/vaults/test-vault/share-price-history"], + ["post", "/relay/sign-fee-bump"], ["post", "/api/auth/challenge"], ["post", "/api/stress-scenarios/run"], ]; diff --git a/server/src/__tests__/routeAudit.test.ts b/server/src/__tests__/routeAudit.test.ts index cb0843eda..b55410055 100644 --- a/server/src/__tests__/routeAudit.test.ts +++ b/server/src/__tests__/routeAudit.test.ts @@ -34,6 +34,9 @@ describe("Route audit — mounted routes match client API calls (#723)", () => { it("GET /api/relayer/status is mounted", () => probeRouteExists("get", "/api/relayer/status")); + it("POST /relay/sign-fee-bump is mounted", () => + probeRouteExists("post", "/relay/sign-fee-bump")); + it("POST /api/risk/drift/detect is mounted", () => probeRouteExists("post", "/api/risk/drift/detect")); diff --git a/server/src/app.ts b/server/src/app.ts index 6cb653202..46663531c 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -115,6 +115,7 @@ export function createApp() { }); app.post("/api/relayer/fee-bump", relayerLimiter, signFeeBump); + app.post("/relay/sign-fee-bump", relayerLimiter, signFeeBump); app.use("/api/yields", yieldsRouter); app.use("/api/leaderboard", leaderboardRouter); app.use("/api/notifications", notificationsRouter); diff --git a/server/src/services/rebalanceExecutorService.ts b/server/src/services/rebalanceExecutorService.ts index 9c807b5db..d21a0bdcf 100644 --- a/server/src/services/rebalanceExecutorService.ts +++ b/server/src/services/rebalanceExecutorService.ts @@ -271,7 +271,7 @@ export class RebalanceExecutorService { } private async signWithRelayer(innerXdr: string): Promise { - const response = await fetch(`${this.config.relayerUrl}/relay/sign-fee-bump`, { + const response = await fetch(`${this.config.relayerUrl}/api/relayer/fee-bump`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ innerTxXdr: innerXdr }),