Skip to content

Make wallet and chain configuration environment-driven #12

Description

@Lakes41

Summary

Allow supported chains, RPC URLs, and wallet connector options to be configured without editing source code.

Current Behaviour

lib/wallet/providers.tsx hard-codes mainnet, base, and sepolia, uses default transports, and configures only an injected connector. This limits deployment flexibility and makes live environments harder to tune.

Expected Behaviour

Deployments should be able to choose supported chains and RPC URLs through environment variables while preserving safe defaults for local development.

Suggested Implementation

Create a wallet configuration module that parses public environment variables, builds the wagmi chain and transport config, and exposes connector settings. Add validation and fallbacks for mock mode.

Files or Areas Likely Affected

  • lib/wallet/providers.tsx
  • lib/wallet/config.ts
  • .env.example
  • README.md
  • components/wallet/connect-button.tsx

Acceptance Criteria

  • Supported chains can be configured without changing source code
  • RPC URLs can be provided per supported chain
  • Invalid chain or RPC configuration fails clearly in development
  • Mock mode continues to work with default configuration
  • README and .env.example document wallet configuration

Additional Notes

Do not add private RPC credentials to client-exposed environment variables unless the provider explicitly supports browser-safe public keys.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions