Pacto uses a single canonical source for all chain and asset configuration:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/covenant-gov/pacto-app/llms.txt
Use this file to discover all available pages before exploring further.
src/lib/wallet/wallet-assets.json. Both the TypeScript frontend and the Rust backend embed this file so token addresses, explorer URLs, and network metadata are never duplicated or allowed to drift between layers. RPC URL resolution follows a deterministic priority order — operator key first, user preferences second, public defaults last.
Supported networks
| Network key | Chain | Alchemy host |
|---|---|---|
mainnet | Ethereum Mainnet | eth-mainnet |
sepolia | Ethereum Sepolia (testnet) | eth-sepolia |
arbitrum | Arbitrum One | arb-mainnet |
optimism | OP Mainnet | opt-mainnet |
gnosis | Gnosis Chain | gnosis-mainnet |
Arbitrum is the product-default preferred network in Settings → EVM. For production-like use, configure an
ALCHEMY_RPC_KEY in your .env file — one key covers all five supported chains.wallet-assets.json
src/lib/wallet/wallet-assets.json defines the following fields for each network key:
- Display name and viem chain key (frontend)
- Explorer transaction URL prefix
- Native ETH symbol and decimals
- USDC and USDT contract addresses and decimals
WALLET_ASSETS is the canonical token and network registry for all TypeScript code. Do not hardcode addresses or decimals elsewhere.
Rust embed:
wallet_chain_config helpers (wallet_networks, network_by_key, rpc_urls_for, etc.).
RPC URL resolution
A singleALCHEMY_RPC_KEY environment variable builds per-chain URLs automatically:
getEffectiveRpcUrlsForChain:
- Operator provider key URL + curated fallbacks (when
ALCHEMY_RPC_KEYis set) - User default / personal RPC preferences (Settings → EVM)
- Curated public defaults
src/lib/wallet/rpc-providers.ts — Vite exposes ALCHEMY_* via envPrefix in vite.config.ts; getEffectiveRpcUrlsForChain in chains.ts is the single merge point for viem read clients.
Backend: src-tauri/src/evm/wallet_rpc_providers.rs — reads the same ALCHEMY_RPC_KEY at runtime and appends curated public fallbacks when a key is present.
Read vs. write separation
| Concern | Layer | Mechanism |
|---|---|---|
| RPC URL selection (UI reads) | Frontend | ALCHEMY_RPC_KEY + user prefs + getEffectiveRpcUrlsForChain |
| RPC URL selection (backend sends) | Backend | Same ALCHEMY_RPC_KEY via wallet_rpc_providers.rs + curated fallbacks |
| Read-only JSON-RPC | Frontend | viem createPublicClient + fallback via src/lib/evm/read-plane.ts |
| Generic contract reads (observation) | Frontend | readContract / multicall in read-plane.ts — not duplicated in Rust for ad-hoc ABIs |
| WalletBar send / raw tx | Backend | Rust (Alloy): encode, sign, eth_sendRawTransaction |
| Advanced opaque contract call | Backend | evm_send_advanced_contract_call — advanced-purpose signer only (advanced_contract_call.rs) |
| Squad curated deploy / gov writes | Backend | Typed Alloy commands + squad-purpose gate |
| USD spot display | Backend + TS | wallet_get_usd_spot_prices + src/lib/wallet/pricing.ts |
Adding a new network
- Edit
wallet-assets.json: add the network key with display name, viem chain key, explorer URL, native symbol, decimals, and token addresses. - If the chain ID or viem mapping changes, also update
chains.ts. - Add the Alchemy host mapping in
src/lib/wallet/rpc-providers.ts(TypeScript) andsrc-tauri/src/evm/wallet_rpc_providers.rs(Rust). - Run
cargo checkinsidesrc-taurito exercise the compile-time JSON embed and catch parse errors early.
USD spot pricing
Wallet balances are annotated with live USD values sourced from Chainlink on-chain price feeds on Ethereum mainnet, regardless of which chain the user has selected for sending. The backend issueseth_call to the standard aggregator proxy addresses:
| Pair | Proxy address |
|---|---|
| ETH / USD | 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 |
| USDC / USD | 0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6 |
| USDT / USD | 0x3E7d1eAB13ad0104d2750B8863b489D65364e32D |
wallet_get_usd_spot_prices; the TypeScript helper is getWalletUsdSpotPrices() in src/lib/wallet/pricing.ts.