Skip to content

feat: JWT-gated Soroban RPC passthrough proxy - #40

Merged
AquiGorka merged 3 commits into
mainfrom
feat/soroban-rpc-proxy
Jun 11, 2026
Merged

feat: JWT-gated Soroban RPC passthrough proxy#40
AquiGorka merged 3 commits into
mainfrom
feat/soroban-rpc-proxy

Conversation

@AquiGorka

@AquiGorka AquiGorka commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Adds POST /api/v1/rpc behind the user jwtMiddleware. Forwards the JSON-RPC 2.0 body verbatim to the server-side STELLAR_RPC_URL and relays the response unchanged, so the SDK Server works against it directly — the RPC-Pro token stays server-side and never reaches the moonlight-pay bundle.

  • Method allowlist: getAccount, getLedgerEntries, simulateTransaction, sendTransaction, getTransaction, getLatestLedger. Non-allowlisted → JSON-RPC error (not 500).
  • Logs method + status only (never request/response bodies).
  • Unit tests: forward / reject / relay-error / non-2xx relay. Verified live against a local Soroban RPC (401 without JWT, real relay with JWT, -32601 reject).

Paired frontend: moonlight-pay. Part of a 6-PR batch that proxies Soroban RPC through the platforms so the Quasar Pro RPC token never ships in any browser bundle (3 backends + 3 frontends; each backend+frontend pair ships together).

Relates to ClickUp 86c9n8cby.


CI note: pins deno to 2.8.2 — 2.8.3 regressed import-map override resolution; tracking upstream.

Add POST /api/v1/rpc behind the user jwtMiddleware. Forwards the JSON-RPC
2.0 body verbatim to the server-side STELLAR_RPC_URL and relays the
response unchanged, so the SDK Server works against it directly. The
RPC-Pro token stays server-side and never reaches the moonlight-pay
bundle.

Method allowlist (getAccount, getLedgerEntries, simulateTransaction,
sendTransaction, getTransaction, getLatestLedger); non-allowlisted
methods are rejected with a JSON-RPC error, not a 500. Logs method +
status only — never request/response bodies.
@AquiGorka

Copy link
Copy Markdown
Contributor Author

Soroban RPC proxy — 6-PR batch (ship together). Each backend+frontend pair is a vertical slice:

  • council-platform#46 ↔ council-console#46
  • pay-platform#40 ↔ moonlight-pay#37
  • network-dashboard-platform#11 ↔ browser-wallet#22

Relates to ClickUp 86c9n8cby.

2.8.3 regressed import-map override resolution (the test mock for
@/config/env.ts is bypassed, so the real loader throws
'DATABASE_URL is not loaded' and crashes the integration runner).
Pin until the upstream regression is fixed.
@AquiGorka
AquiGorka force-pushed the feat/soroban-rpc-proxy branch from 76faff3 to b975962 Compare June 11, 2026 21:46
@AquiGorka
AquiGorka merged commit 98ff92c into main Jun 11, 2026
7 checks passed
@AquiGorka
AquiGorka deleted the feat/soroban-rpc-proxy branch June 11, 2026 22:10
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.

1 participant