Wire browser-wallet build defines to the public RPC proxy#23
Merged
Conversation
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
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.
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'sdeno task build-prodonly setsPOSTHOG_*— never the RPC proxy vars.So the next packaged build would ship an empty
rpcUrlfor 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 baredeno task build-prodis 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 theSOROBAN_RPC_PROXY_*env vars.https://dashboard-api.moonlightprotocol.io/api/v1/public/rpchttps://dashboard-api-testnet.moonlightprotocol.io/api/v1/public/rpchttp://localhost:8000/soroban/rpc(no public proxy in local-dev; same hostnetwork.tsalready fell back to)Both live proxy hosts were verified read-only:
getLatestLedgerreturns the correct network (mainnet seq ~62.9M, testnet seq ~3.0M), andsendTransactionis rejected by the allowlist.Verification
Production build (
deno task build-prod) inspected:rpcUrlresolves to the proxy URLs above (present inbackground.js+private-tracking.js).lightsailhost, norpc-protoken in the shipped bundle. (lightsailappears only as a doc comment in.mapfiles, whichrelease.ymlstrips before packaging;quasarmatches only a BIP39 mnemonic wordlist entry.)*.stellar.org/sorobanrpc.comstrings are inert Stellar-SDKNetworkConfiglibrary defaults, never used as the wallet'srpcUrl(the wallet builds viaCustomNet({rpcUrl: <proxy>})by design) — plus the intended public, token-freehorizon/friendbotendpoints.deno fmt --check,deno lint, anddeno checkall pass. (Repo has no test task/tests.)Version bumped
0.1.2→0.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).