SIGN IN SIGN UP

feat: make the EVM privacy lab mainnet-aware

/privacy-sdk-lab hard-coded Sepolia everywhere - pool, prover, discovery,
account factory, chain name - across five components, so it could not use the
mainnet AccountFactory and Eth712 account class deployed earlier today. This
threads the app's existing network switcher through all of it instead.

lib/privacy/network.ts is the new single source of per-network privacy config
(pool, prover, discovery, RPC, chain name, factory). lib/starknet/constants.ts
gained accountFactory per network. privacyKeyTypedData and inspectEth712Account
take optional overrides, defaulting to the old Sepolia constants so no existing
call site's behavior changes unless it opts in.

eip712-signature-lab, strk20-registration-lab, strk20-shield-lab,
strk20-usdc-lab, and public-strk-transfer-lab all now read `network` from
useNetwork() and derive pool/prover/discovery/factory/chain from it instead of
module-level Sepolia constants. The hard "switch to Sepolia first" gate on
deploy is gone - both networks are real paths now.

The mainnet deploy route stays deliberately more conservative than Sepolia's:
Sepolia keeps its sponsored top-up (relayer funds the account to 20 STRK and
deploys in one call). Mainnet never transfers STRK to a stranger - it requires
the connecting address to already hold at least 15 public STRK (configurable
via MOROKPAY_MAINNET_MIN_DEPLOY_STRK) before it will submit deploy_account, and
the relayer only pays its own gas for that call. A funded, keyed mainnet
relayer still needs to be configured via MOROKPAY_MAINNET_RELAYER_ADDRESS /
_PRIVATE_KEY before this path works end to end in the browser; sponsorship can
be layered in later the same way Sepolia's is.

tsc --noEmit, lint, and the full test suite (97 tests) all pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
S
ssadkov committed
cddc75c2e8e53660ffb44f040226cb91b757b575
Parent: 07ac90c