chore: require a fee receiver at build time, ignore internal docs

The build now fails fast when KYBERSWAP_FEE_RECEIVER is unset instead of
shipping a bundle that sweeps output fees nowhere. Documents the key in
.env.example alongside what it actually costs: 0 bps on direct swaps, 9 bps
on ZAP's embedded swap leg.

Docs are written for the private tree and get copied in by mistake during a
sync, so *.md is ignored by default and publishing one is opt-in.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
labrinyang
2026-07-22 23:54:50 +08:00
parent 4e317eff6d
commit 3a392cb141
5 changed files with 42 additions and 20 deletions
+13 -12
View File
@@ -1,7 +1,6 @@
# LP TERMINAL — copy to `.env` in the REPO ROOT (next to package.json).
# Vite reads it via envDir/envPrefix (see vite.config.ts); the indexer reads
# `RPC` from the same file. Every key here is OPTIONAL — with no .env at all
# the app runs against the chain's public RPC and the public Kyber aggregator.
# `RPC` from the same file.
# Private JSON-RPC URL for Robinhood Chain (chainId 4663), e.g. a provider URL
# with its key path. SECRET: Vite BAKES this into the JS bundle, so set it only
@@ -10,19 +9,21 @@
# Unset -> https://rpc.mainnet.chain.robinhood.com (keyless, slower).
RPC=
# KyberSwap aggregator base. Absolute URL = browser calls Kyber directly.
# A path like /kyber = route through your own same-origin reverse proxy.
# REQUIRED (the build fails without it): address that receives the terminal
# output fee — currently 0 bps on direct swaps, 9 bps on ZAP's embedded swap
# leg. Use an address you control. (Legacy env name.)
KYBERSWAP_FEE_RECEIVER=
# KyberSwap base for READ-ONLY USD valuation (UP rewards, APR, simulations).
# MARKET and ZAP never call it, and the app has no Kyber transaction builder.
# Absolute URL = browser calls Kyber directly; a path like /kyber = route
# through your own same-origin reverse proxy.
KYBERSWAP_AGGREGATOR_API_BASE_URL=https://aggregator-api.kyberswap.com
KYBERSWAP_CHAIN=robinhood
# WHITELIST: the only address swap calldata is ever sent to. The app hard-fails
# a quote whose routerAddress differs from this. Change only if Kyber migrates.
KYBERSWAP_ROUTER_ADDRESS=0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
# Optional platform fee on Kyber swaps, charged on the output token and paid by
# the Kyber router. BOTH must be set to activate; leave blank for no fee.
# KYBERSWAP_FEE_BPS=10
# KYBERSWAP_FEE_RECEIVER=0x...
# Swap-solver quote API (cross-venue split routing, ready-to-sign Settler tx).
# Defaults to the hosted public instance; point it at your own if you run one.
# VITE_SOLVER_URL=
# Optional: only WalletConnect QR pairing needs this. Injected wallets
# (MetaMask / Rabby / OKX) work without it. Get one at cloud.walletconnect.com