Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    SubscriptionConductor
    PaymentConductor
    Payments Overview
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    News Module
    Member Blogs
    Public Profile Pages
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    SubscriptionConductor
    PaymentConductor
    Payments Overview
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    News Module
    Member Blogs
    Public Profile Pages
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    SubscriptionConductor
    PaymentConductor
    Payments Overview
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    News Module
    Member Blogs
    Public Profile Pages
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    1. Docs
    2. /Integrations
    3. /Ethereum wallets (Wagmi v3)

    Updated Jul 21, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    1. Docs
    2. /Integrations
    3. /Ethereum wallets (Wagmi v3)

    Updated Jul 21, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    1. Docs
    2. /Integrations
    3. /Ethereum wallets (Wagmi v3)

    Updated Jul 21, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    Ethereum wallets (Wagmi v3)

    Use the Founder / Developer tabs in the docs sidebar to filter this page. Founders get the operator view of what the EVM wallet layer enables; developers get verified module paths, the RPC/token single sources of truth, and connector white-labeling steps.

    Ring's EVM (Ethereum / Polygon) wallet stack is Wagmi v3 + viem 2.x with a custom connector picker and account menu — Ring does not bundle @rainbow-me/rainbowkit. Wallet providers mount only on crypto routes through Web3ScopeProvider, and all RPC endpoints and the RING ERC-20 address resolve through config helpers instead of hardcoded strings.

    ConcernSingle source of truthNever do
    Connectors / UIlib/wagmi-config.ts + custom pickerAdd RainbowKit
    EVM RPC URLgetEvmRpcUrl() (lib/ring-config-chain.ts)Hardcode polygon-rpc.com
    EVM chain idgetEvmChainId() (lib/ring-config-chain.ts)Assume 137 inline
    RING ERC-20 addressgetEvmTokenAddress() / getRingTokenAddress()Use getNativeTokenAddress() (Solana SPL mint)
    App runtime librarywagmi + viemethers in features/ / app/ / lib/

    Why this matters for your clone

    EVM wallets let members connect MetaMask, Coinbase Wallet, or any WalletConnect-compatible mobile wallet to your Ring clone — for RING token holdings, staking, and on-chain referral rewards on Polygon. The stack is config-driven: you enable it with environment variables, no code changes for the common case.

    Wallet feature (operator)

    Custodial wallets, credits, top-up, and PIN security for members.

    Token economics

    RING utility token, referral rails, and mainnet deploy checklist.

    Environment configuration

    WalletConnect, Polygon RPC, and RING token address env blocks.

    Module map (verified)

    LayerPathRole
    Wagmi configlib/wagmi-config.tscreateConfig singleton; connectors; Polygon-first chains; ssr: true + cookieStorage
    Providerproviders/web3-provider.tsxWagmiProvider + React Query QueryClientProvider
    Scoped mountcomponents/providers/web3-scope-provider.tsxLazy dynamic(..., { ssr:false }) mount gated by pathNeedsWeb3() + cookie hydration
    Route gatelib/pathname-without-locale.tspathNeedsWeb3(): /login*, /auth/wallet-connect*, /wallet*, /store/checkout*, /nft*, /ai-web3*, /admin/nft*, /admin/web3*
    Account menu

    Environment variables

    VariablePurpose
    NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDWalletConnect / Reown Cloud project ID (cloud.reown.com). Enables QR / deep-link flows; omit to disable WalletConnect.
    POLYGON_RPC_URL / NEXT_PUBLIC_POLYGON_RPC_URLAuthenticated Polygon JSON-RPC endpoint (e.g. Alchemy/Infura). Also settable per-clone via chains.evm.rpcUrlEnv.
    RING_CONTRACT_ADDRESS / NEXT_PUBLIC_RING_TOKEN_ADDRESSRING ERC-20 address on the configured EVM chain.

    Treat every NEXT_PUBLIC_* value as public — it ships in the browser bundle. Keep server-only secrets out of NEXT_PUBLIC_ names.

    Related documentation

    Related documentation

    Wallet & Credit System

    Next-step: custodial wallets, credits, and getWalletBalance Server Action SSOT.

    Wallet API

    Deep-dive: wallet HTTP routes and Server Actions.

    WalletConductor architecture

    Same-workflow: custodial provisioning and native-token orchestration.

    Token Staking System

    See-also: EVM staking adapter on viem (not ethers).

    Web3 Integration

    Ethereum wallets (Wagmi v3)

    Use the Founder / Developer tabs in the docs sidebar to filter this page. Founders get the operator view of what the EVM wallet layer enables; developers get verified module paths, the RPC/token single sources of truth, and connector white-labeling steps.

    Ring's EVM (Ethereum / Polygon) wallet stack is Wagmi v3 + viem 2.x with a custom connector picker and account menu — Ring does not bundle @rainbow-me/rainbowkit. Wallet providers mount only on crypto routes through Web3ScopeProvider, and all RPC endpoints and the RING ERC-20 address resolve through config helpers instead of hardcoded strings.

    ConcernSingle source of truthNever do
    Connectors / UIlib/wagmi-config.ts + custom pickerAdd RainbowKit
    EVM RPC URLgetEvmRpcUrl() (lib/ring-config-chain.ts)Hardcode polygon-rpc.com
    EVM chain idgetEvmChainId() (lib/ring-config-chain.ts)Assume 137 inline
    RING ERC-20 addressgetEvmTokenAddress() / getRingTokenAddress()Use getNativeTokenAddress() (Solana SPL mint)
    App runtime librarywagmi + viemethers in features/ / app/ / lib/

    Why this matters for your clone

    EVM wallets let members connect MetaMask, Coinbase Wallet, or any WalletConnect-compatible mobile wallet to your Ring clone — for RING token holdings, staking, and on-chain referral rewards on Polygon. The stack is config-driven: you enable it with environment variables, no code changes for the common case.

    Wallet feature (operator)

    Custodial wallets, credits, top-up, and PIN security for members.

    Token economics

    RING utility token, referral rails, and mainnet deploy checklist.

    Environment configuration

    WalletConnect, Polygon RPC, and RING token address env blocks.

    Module map (verified)

    LayerPathRole
    Wagmi configlib/wagmi-config.tscreateConfig singleton; connectors; Polygon-first chains; ssr: true + cookieStorage
    Providerproviders/web3-provider.tsxWagmiProvider + React Query QueryClientProvider
    Scoped mountcomponents/providers/web3-scope-provider.tsxLazy dynamic(..., { ssr:false }) mount gated by pathNeedsWeb3() + cookie hydration
    Route gatelib/pathname-without-locale.tspathNeedsWeb3(): /login*, /auth/wallet-connect*, /wallet*, /store/checkout*, /nft*, /ai-web3*, /admin/nft*, /admin/web3*
    Account menu

    Environment variables

    VariablePurpose
    NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDWalletConnect / Reown Cloud project ID (cloud.reown.com). Enables QR / deep-link flows; omit to disable WalletConnect.
    POLYGON_RPC_URL / NEXT_PUBLIC_POLYGON_RPC_URLAuthenticated Polygon JSON-RPC endpoint (e.g. Alchemy/Infura). Also settable per-clone via chains.evm.rpcUrlEnv.
    RING_CONTRACT_ADDRESS / NEXT_PUBLIC_RING_TOKEN_ADDRESSRING ERC-20 address on the configured EVM chain.

    Treat every NEXT_PUBLIC_* value as public — it ships in the browser bundle. Keep server-only secrets out of NEXT_PUBLIC_ names.

    Related documentation

    Related documentation

    Wallet & Credit System

    Next-step: custodial wallets, credits, and getWalletBalance Server Action SSOT.

    Wallet API

    Deep-dive: wallet HTTP routes and Server Actions.

    WalletConductor architecture

    Same-workflow: custodial provisioning and native-token orchestration.

    Token Staking System

    See-also: EVM staking adapter on viem (not ethers).

    Web3 Integration

    Ethereum wallets (Wagmi v3)

    Use the Founder / Developer tabs in the docs sidebar to filter this page. Founders get the operator view of what the EVM wallet layer enables; developers get verified module paths, the RPC/token single sources of truth, and connector white-labeling steps.

    Ring's EVM (Ethereum / Polygon) wallet stack is Wagmi v3 + viem 2.x with a custom connector picker and account menu — Ring does not bundle @rainbow-me/rainbowkit. Wallet providers mount only on crypto routes through Web3ScopeProvider, and all RPC endpoints and the RING ERC-20 address resolve through config helpers instead of hardcoded strings.

    ConcernSingle source of truthNever do
    Connectors / UIlib/wagmi-config.ts + custom pickerAdd RainbowKit
    EVM RPC URLgetEvmRpcUrl() (lib/ring-config-chain.ts)Hardcode polygon-rpc.com
    EVM chain idgetEvmChainId() (lib/ring-config-chain.ts)Assume 137 inline
    RING ERC-20 addressgetEvmTokenAddress() / getRingTokenAddress()Use getNativeTokenAddress() (Solana SPL mint)
    App runtime librarywagmi + viemethers in features/ / app/ / lib/

    Why this matters for your clone

    EVM wallets let members connect MetaMask, Coinbase Wallet, or any WalletConnect-compatible mobile wallet to your Ring clone — for RING token holdings, staking, and on-chain referral rewards on Polygon. The stack is config-driven: you enable it with environment variables, no code changes for the common case.

    Wallet feature (operator)

    Custodial wallets, credits, top-up, and PIN security for members.

    Token economics

    RING utility token, referral rails, and mainnet deploy checklist.

    Environment configuration

    WalletConnect, Polygon RPC, and RING token address env blocks.

    Module map (verified)

    LayerPathRole
    Wagmi configlib/wagmi-config.tscreateConfig singleton; connectors; Polygon-first chains; ssr: true + cookieStorage
    Providerproviders/web3-provider.tsxWagmiProvider + React Query QueryClientProvider
    Scoped mountcomponents/providers/web3-scope-provider.tsxLazy dynamic(..., { ssr:false }) mount gated by pathNeedsWeb3() + cookie hydration
    Route gatelib/pathname-without-locale.tspathNeedsWeb3(): /login*, /auth/wallet-connect*, /wallet*, /store/checkout*, /nft*, /ai-web3*, /admin/nft*, /admin/web3*
    Account menu

    Environment variables

    VariablePurpose
    NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDWalletConnect / Reown Cloud project ID (cloud.reown.com). Enables QR / deep-link flows; omit to disable WalletConnect.
    POLYGON_RPC_URL / NEXT_PUBLIC_POLYGON_RPC_URLAuthenticated Polygon JSON-RPC endpoint (e.g. Alchemy/Infura). Also settable per-clone via chains.evm.rpcUrlEnv.
    RING_CONTRACT_ADDRESS / NEXT_PUBLIC_RING_TOKEN_ADDRESSRING ERC-20 address on the configured EVM chain.

    Treat every NEXT_PUBLIC_* value as public — it ships in the browser bundle. Keep server-only secrets out of NEXT_PUBLIC_ names.

    Related documentation

    Related documentation

    Wallet & Credit System

    Next-step: custodial wallets, credits, and getWalletBalance Server Action SSOT.

    Wallet API

    Deep-dive: wallet HTTP routes and Server Actions.

    WalletConductor architecture

    Same-workflow: custodial provisioning and native-token orchestration.

    Token Staking System

    See-also: EVM staking adapter on viem (not ethers).

    Web3 Integration

    Staking feature

    APR pools and reward claims on the EVM adapter (viem).

    Typical scenarios

    • Members hold RING on Polygon — the connector picker offers injected wallets, MetaMask, Coinbase Wallet, and (optionally) WalletConnect QR.
    • Mobile-first community — set a WalletConnect project ID so phone wallets can scan a QR to connect.
    • No on-chain token yet — leave the RING token address unset; wallet connect still works, token-balance panels degrade gracefully to zero.

    Go-live checklist

    • Authenticated Polygon RPC set (POLYGON_RPC_URL, e.g. an Alchemy or Infura key) — never rely on anonymous public hosts.
    • NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID set from Reown Cloud if you want mobile QR connections.
    • RING ERC-20 address (RING_CONTRACT_ADDRESS) set once your token is deployed.
    • Branding (appName, logo) updated in the connector config for your domain.
    components/web3/connected-wallet-menu.tsx, components/web3/wallet-shell.tsx
    Custom picker + connected account UI
    RPC / chain SSOTlib/ring-config-chain.tsgetEvmRpcUrl(), getEvmChainId()
    Low-level RPClib/web3/polygon-rpc.tsgetPolygonRpcUrl() (env → Ankr fallback)
    Token SSOTlib/ring-config-chain.ts, constants/web3.tsgetEvmTokenAddress(), getRingTokenAddress()

    Provider mount flow

    RPC and chain SSOT

    Do not hardcode public Polygon RPC hosts (polygon-rpc.com blocks anonymous traffic). Resolution order:

    HelperLocationResolves
    getEvmRpcUrl()lib/ring-config-chain.tschains.evm.rpcUrlEnv env → getPolygonRpcUrl() fallback
    getEvmChainId()lib/ring-config-chain.tschains.evm.chainId (default 137)
    getPolygonRpcUrl()lib/web3/polygon-rpc.tsPOLYGON_RPC_URL → NEXT_PUBLIC_POLYGON_RPC_URL → Ankr fallback

    lib/wagmi-config.ts wires the Polygon transport as http(getEvmRpcUrl()) and lists polygon first in chains. Server routes, NFT market, staking, and wallet transfer adapters resolve RPC through the same helpers — never ad-hoc strings.

    Token SSOT

    For the RING ERC-20 address use getEvmTokenAddress() (or getRingTokenAddress(), which wraps it). Never use getNativeTokenAddress() for EVM: when chains.native === 'solana' that helper returns the Solana SPL mint, which is not a valid EVM address.

    Connector config

    WalletConnect is only added when NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID is present and not the demo-project-id placeholder — this avoids 403 responses from WalletConnect Cloud.

    Hooks (Wagmi v3)

    • Prefer useConnection() over legacy useAccount() for address / chain / isConnected.
    • List connectors with useConnectors(); connect via useConnect().mutate({ connector }) (or mutateAsync).
    • Switch chains with useSwitchChain().mutate({ chainId }); read configured chains with useChains().
    • Migration reference: Migrate from v2 to v3.

    White-label: changing connectors

    1. 1

      Edit lib/wagmi-config.ts — add or remove connectors from wagmi/connectors / @wagmi/connectors.

    2. 2

      Install only the peer dependencies for connectors you enable (@metamask/connect-evm, @coinbase/wallet-sdk, @walletconnect/ethereum-provider).

    3. 3

      Set branding (appName, appLogoUrl, WalletConnect metadata) for your domain and update the RPC/token env vars.

    4. 4

      The picker lists useConnectors() output and dedupes EIP-6963 entries by connector.id — verify no duplicate wallet rows after adding a connector.

    Housekeeping (2026-07-21)

    The EVM stack is consolidated to a single wagmi SSOT:

    • RPC / token: getEvmRpcUrl() / getEvmTokenAddress() in lib/ring-config-chain.ts — never hardcode public Polygon hosts or confuse with Solana getNativeTokenAddress().
    • Route gate: pathNeedsWeb3() mounts wagmi only on /login*, /auth/wallet-connect*, /wallet*, /store/checkout*, /nft*, /ai-web3*, /admin/nft*, /admin/web3*.
    • Balance SSOT: dead app/_actions/get-wallet-balance.ts is deleted — use getWalletBalance in app/_actions/wallet.ts.
    • No ethers in app runtime: staking adapters use viem WalletClient (features/staking/adapters/evm.ts). Earlier removals: WalletConnectPopup stub, legacy web3-context wrappers, lib/ring-config.ts facade.

    See-also: legacy ethers examples retired — Wagmi v3 pointer.

    Integrations

    Prerequisite: integrations hub for payments, storage, and wallets.

    Staking feature

    APR pools and reward claims on the EVM adapter (viem).

    Typical scenarios

    • Members hold RING on Polygon — the connector picker offers injected wallets, MetaMask, Coinbase Wallet, and (optionally) WalletConnect QR.
    • Mobile-first community — set a WalletConnect project ID so phone wallets can scan a QR to connect.
    • No on-chain token yet — leave the RING token address unset; wallet connect still works, token-balance panels degrade gracefully to zero.

    Go-live checklist

    • Authenticated Polygon RPC set (POLYGON_RPC_URL, e.g. an Alchemy or Infura key) — never rely on anonymous public hosts.
    • NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID set from Reown Cloud if you want mobile QR connections.
    • RING ERC-20 address (RING_CONTRACT_ADDRESS) set once your token is deployed.
    • Branding (appName, logo) updated in the connector config for your domain.
    components/web3/connected-wallet-menu.tsx, components/web3/wallet-shell.tsx
    Custom picker + connected account UI
    RPC / chain SSOTlib/ring-config-chain.tsgetEvmRpcUrl(), getEvmChainId()
    Low-level RPClib/web3/polygon-rpc.tsgetPolygonRpcUrl() (env → Ankr fallback)
    Token SSOTlib/ring-config-chain.ts, constants/web3.tsgetEvmTokenAddress(), getRingTokenAddress()

    Provider mount flow

    RPC and chain SSOT

    Do not hardcode public Polygon RPC hosts (polygon-rpc.com blocks anonymous traffic). Resolution order:

    HelperLocationResolves
    getEvmRpcUrl()lib/ring-config-chain.tschains.evm.rpcUrlEnv env → getPolygonRpcUrl() fallback
    getEvmChainId()lib/ring-config-chain.tschains.evm.chainId (default 137)
    getPolygonRpcUrl()lib/web3/polygon-rpc.tsPOLYGON_RPC_URL → NEXT_PUBLIC_POLYGON_RPC_URL → Ankr fallback

    lib/wagmi-config.ts wires the Polygon transport as http(getEvmRpcUrl()) and lists polygon first in chains. Server routes, NFT market, staking, and wallet transfer adapters resolve RPC through the same helpers — never ad-hoc strings.

    Token SSOT

    For the RING ERC-20 address use getEvmTokenAddress() (or getRingTokenAddress(), which wraps it). Never use getNativeTokenAddress() for EVM: when chains.native === 'solana' that helper returns the Solana SPL mint, which is not a valid EVM address.

    Connector config

    WalletConnect is only added when NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID is present and not the demo-project-id placeholder — this avoids 403 responses from WalletConnect Cloud.

    Hooks (Wagmi v3)

    • Prefer useConnection() over legacy useAccount() for address / chain / isConnected.
    • List connectors with useConnectors(); connect via useConnect().mutate({ connector }) (or mutateAsync).
    • Switch chains with useSwitchChain().mutate({ chainId }); read configured chains with useChains().
    • Migration reference: Migrate from v2 to v3.

    White-label: changing connectors

    1. 1

      Edit lib/wagmi-config.ts — add or remove connectors from wagmi/connectors / @wagmi/connectors.

    2. 2

      Install only the peer dependencies for connectors you enable (@metamask/connect-evm, @coinbase/wallet-sdk, @walletconnect/ethereum-provider).

    3. 3

      Set branding (appName, appLogoUrl, WalletConnect metadata) for your domain and update the RPC/token env vars.

    4. 4

      The picker lists useConnectors() output and dedupes EIP-6963 entries by connector.id — verify no duplicate wallet rows after adding a connector.

    Housekeeping (2026-07-21)

    The EVM stack is consolidated to a single wagmi SSOT:

    • RPC / token: getEvmRpcUrl() / getEvmTokenAddress() in lib/ring-config-chain.ts — never hardcode public Polygon hosts or confuse with Solana getNativeTokenAddress().
    • Route gate: pathNeedsWeb3() mounts wagmi only on /login*, /auth/wallet-connect*, /wallet*, /store/checkout*, /nft*, /ai-web3*, /admin/nft*, /admin/web3*.
    • Balance SSOT: dead app/_actions/get-wallet-balance.ts is deleted — use getWalletBalance in app/_actions/wallet.ts.
    • No ethers in app runtime: staking adapters use viem WalletClient (features/staking/adapters/evm.ts). Earlier removals: WalletConnectPopup stub, legacy web3-context wrappers, lib/ring-config.ts facade.

    See-also: legacy ethers examples retired — Wagmi v3 pointer.

    Integrations

    Prerequisite: integrations hub for payments, storage, and wallets.

    Staking feature

    APR pools and reward claims on the EVM adapter (viem).

    Typical scenarios

    • Members hold RING on Polygon — the connector picker offers injected wallets, MetaMask, Coinbase Wallet, and (optionally) WalletConnect QR.
    • Mobile-first community — set a WalletConnect project ID so phone wallets can scan a QR to connect.
    • No on-chain token yet — leave the RING token address unset; wallet connect still works, token-balance panels degrade gracefully to zero.

    Go-live checklist

    • Authenticated Polygon RPC set (POLYGON_RPC_URL, e.g. an Alchemy or Infura key) — never rely on anonymous public hosts.
    • NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID set from Reown Cloud if you want mobile QR connections.
    • RING ERC-20 address (RING_CONTRACT_ADDRESS) set once your token is deployed.
    • Branding (appName, logo) updated in the connector config for your domain.
    components/web3/connected-wallet-menu.tsx, components/web3/wallet-shell.tsx
    Custom picker + connected account UI
    RPC / chain SSOTlib/ring-config-chain.tsgetEvmRpcUrl(), getEvmChainId()
    Low-level RPClib/web3/polygon-rpc.tsgetPolygonRpcUrl() (env → Ankr fallback)
    Token SSOTlib/ring-config-chain.ts, constants/web3.tsgetEvmTokenAddress(), getRingTokenAddress()

    Provider mount flow

    RPC and chain SSOT

    Do not hardcode public Polygon RPC hosts (polygon-rpc.com blocks anonymous traffic). Resolution order:

    HelperLocationResolves
    getEvmRpcUrl()lib/ring-config-chain.tschains.evm.rpcUrlEnv env → getPolygonRpcUrl() fallback
    getEvmChainId()lib/ring-config-chain.tschains.evm.chainId (default 137)
    getPolygonRpcUrl()lib/web3/polygon-rpc.tsPOLYGON_RPC_URL → NEXT_PUBLIC_POLYGON_RPC_URL → Ankr fallback

    lib/wagmi-config.ts wires the Polygon transport as http(getEvmRpcUrl()) and lists polygon first in chains. Server routes, NFT market, staking, and wallet transfer adapters resolve RPC through the same helpers — never ad-hoc strings.

    Token SSOT

    For the RING ERC-20 address use getEvmTokenAddress() (or getRingTokenAddress(), which wraps it). Never use getNativeTokenAddress() for EVM: when chains.native === 'solana' that helper returns the Solana SPL mint, which is not a valid EVM address.

    Connector config

    WalletConnect is only added when NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID is present and not the demo-project-id placeholder — this avoids 403 responses from WalletConnect Cloud.

    Hooks (Wagmi v3)

    • Prefer useConnection() over legacy useAccount() for address / chain / isConnected.
    • List connectors with useConnectors(); connect via useConnect().mutate({ connector }) (or mutateAsync).
    • Switch chains with useSwitchChain().mutate({ chainId }); read configured chains with useChains().
    • Migration reference: Migrate from v2 to v3.

    White-label: changing connectors

    1. 1

      Edit lib/wagmi-config.ts — add or remove connectors from wagmi/connectors / @wagmi/connectors.

    2. 2

      Install only the peer dependencies for connectors you enable (@metamask/connect-evm, @coinbase/wallet-sdk, @walletconnect/ethereum-provider).

    3. 3

      Set branding (appName, appLogoUrl, WalletConnect metadata) for your domain and update the RPC/token env vars.

    4. 4

      The picker lists useConnectors() output and dedupes EIP-6963 entries by connector.id — verify no duplicate wallet rows after adding a connector.

    Housekeeping (2026-07-21)

    The EVM stack is consolidated to a single wagmi SSOT:

    • RPC / token: getEvmRpcUrl() / getEvmTokenAddress() in lib/ring-config-chain.ts — never hardcode public Polygon hosts or confuse with Solana getNativeTokenAddress().
    • Route gate: pathNeedsWeb3() mounts wagmi only on /login*, /auth/wallet-connect*, /wallet*, /store/checkout*, /nft*, /ai-web3*, /admin/nft*, /admin/web3*.
    • Balance SSOT: dead app/_actions/get-wallet-balance.ts is deleted — use getWalletBalance in app/_actions/wallet.ts.
    • No ethers in app runtime: staking adapters use viem WalletClient (features/staking/adapters/evm.ts). Earlier removals: WalletConnectPopup stub, legacy web3-context wrappers, lib/ring-config.ts facade.

    See-also: legacy ethers examples retired — Wagmi v3 pointer.

    Integrations

    Prerequisite: integrations hub for payments, storage, and wallets.