Skip to content

Wire browser-wallet build defines to the public RPC proxy#23

Merged
AquiGorka merged 2 commits into
mainfrom
feat/wallet-rpc-proxy-defines
Jun 12, 2026
Merged

Wire browser-wallet build defines to the public RPC proxy#23
AquiGorka merged 2 commits into
mainfrom
feat/wallet-rpc-proxy-defines

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

What

Finishes the wallet RPC cutover started in #22. That PR replaced the hardcoded RPC URL with esbuild build-time defines (__SOROBAN_RPC_PROXY_{MAINNET,TESTNET,LOCAL}__), but those defines defaulted to an empty string and nothing sets them at package time:

  • release.yml's deno task build-prod only sets POSTHOG_* — never the RPC proxy vars.
  • The extension ships via manual Chrome Web Store / Mozilla Add-ons upload (no auto-publish), so there is no iac/CI step to inject them at build time.

So the next packaged build would ship an empty rpcUrl for mainnet/testnet → broken wallet.

Change

Bake the public, non-secret n-d-p read-only proxy URLs as the per-network defaults in src/build.ts, so a bare deno task build-prod is correct on its own. The RPC-Pro (Quasar) token stays server-side on n-d-p — only the public proxy URL ships. Operators/iac can still override any network via the SOROBAN_RPC_PROXY_* env vars.

network baked default
mainnet https://dashboard-api.moonlightprotocol.io/api/v1/public/rpc
testnet https://dashboard-api-testnet.moonlightprotocol.io/api/v1/public/rpc
local http://localhost:8000/soroban/rpc (no public proxy in local-dev; same host network.ts already fell back to)

Both live proxy hosts were verified read-only: getLatestLedger returns the correct network (mainnet seq ~62.9M, testnet seq ~3.0M), and sendTransaction is rejected by the allowlist.

Verification

Production build (deno task build-prod) inspected:

  • Per-network rpcUrl resolves to the proxy URLs above (present in background.js + private-tracking.js).
  • No RPC-Pro token, no lightsail host, no rpc-pro token in the shipped bundle. (lightsail appears only as a doc comment in .map files, which release.yml strips before packaging; quasar matches only a BIP39 mnemonic wordlist entry.)
  • Remaining *.stellar.org / sorobanrpc.com strings are inert Stellar-SDK NetworkConfig library defaults, never used as the wallet's rpcUrl (the wallet builds via CustomNet({rpcUrl: <proxy>}) by design) — plus the intended public, token-free horizon/friendbot endpoints.

deno fmt --check, deno lint, and deno check all pass. (Repo has no test task/tests.)

Version bumped 0.1.20.1.3 (manifest.json).

Out of scope

The actual store publish (manual operator step), the n-d-p proxy itself (already deployed/verified), and the web-app frontends (already done in the RPC-proxy cutover).

The wallet derives per-network rpcUrl from the __SOROBAN_RPC_PROXY_*__
esbuild defines, but they defaulted to empty and release.yml's
build-prod never sets them. Since the wallet publishes via manual store
upload (no auto-publish, no iac at build time), a packaged build would
ship an empty rpcUrl for mainnet/testnet.

Bake the public, non-secret n-d-p read-only proxy URLs as the per-network
defaults so a bare production build is correct, with the RPC-Pro token
staying server-side. Operators/iac can still override via the
SOROBAN_RPC_PROXY_* env vars.

  mainnet  https://dashboard-api.moonlightprotocol.io/api/v1/public/rpc
  testnet  https://dashboard-api-testnet.moonlightprotocol.io/api/v1/public/rpc
  local    http://localhost:8000/soroban/rpc
@AquiGorka AquiGorka merged commit ee4194f into main Jun 12, 2026
2 checks passed
@AquiGorka AquiGorka deleted the feat/wallet-rpc-proxy-defines branch June 12, 2026 00:56
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