agentleFS
celo-orgcelo-org/agent-skills/skills/evm-wallet-integration/SKILL.md

evm-wallet-integration

Skill8 starsChanged 2 months agoApache-2.0View on GitHub

Integrate wallets into Celo dApps. Covers RainbowKit, Dynamic, and wallet connection patterns.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a new project

    line 47
  2. Distinctive:

    Create a new project (select "AppKit" type)

    line 278
  3. Distinctive:

    Add to environment variables:

    line 280
  4. Distinctive:

    Support Multiple Wallets: - Don't force users into one wallet

    line 290

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

EVM Wallet Integration for Celo

This skill covers integrating wallet connection libraries into Celo dApps.

When to Use

  • Adding wallet connection to a dApp
  • Supporting multiple wallet types
  • Implementing authentication flows
  • Building wallet experiences

Wallet Connection Libraries

LibraryDescriptionBest For
Reown AppKitOfficial WalletConnect SDK with wagmiProduction React apps
DynamicAuth-focused with dashboardApps needing user management
ConnectKitSimple wagmi integrationQuick setup
Custom wagmiDirect connector setupFull control

Reown AppKit

Official WalletConnect SDK for React apps with built-in wallet UI. Supports 600+ wallets.

Source: https://docs.reown.com/appkit

Note: Reown is the company formerly known as WalletConnect Inc. (rebranded in 2024). The protocol and npm packages for wagmi connectors still use "walletConnect" naming.

Installation

npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem @tanstack/react-query

Get Project ID

  1. Go to cloud.reown.com
  2. Create a new project
  3. Copy the project ID

Configuration

// config.ts
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
import { celo, celoSepolia } from "@reown/appkit/networks";

const projectId = process.env.NEXT_PUBLIC_REOWN_PROJECT_ID!;

export const wagmiAdapter = new WagmiAdapter({
  networks: [celo, celoSepolia],
  projectId,
  ssr: true,
});

export const config = wagmiAdapter.wagmiConfig;

Provider Setup

"use client";
import { WagmiProvider } from "wagmi";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createAppKit } from "@reown/appkit/react";
import { wagmiAdapter } from "./config";
import { celo, celoSepolia } from "@reown/appkit/networks";

const queryClient = new QueryClient();

createAppKit({
  adapters: [wagmiAdapter],
  networks: [celo, celoSepolia],
  projectId: process.env.NEXT_PUBLIC_REOWN_PROJECT_ID!,
  metadata: {
    name: "My Celo App",
    description: "Celo dApp",
    url: "https://myapp.com",
    icons: ["https://myapp.com/icon.png"],
  },
});

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <WagmiProvider config={wagmiAdapter.wagmiConfig}>
      <QueryClientProvider client={queryClient}>
        {children}
      </QueryClientProvider>
    </WagmiProvider>
  );
}

Connect Button

import { AppKitButton } from "@reown/appkit/react";

function Header() {
  return (
    <nav>
      <AppKitButton />
    </nav>
  );
}

Custom Connect Button

import { useAppKit, useAppKitAccount } from "@reown/appkit/react";

function WalletConnect() {
  const { open } = useAppKit();
  const { address, isConnected } = useAppKitAccount();

  if (isConnected) {
    return (
      <div>
        <p>Connected: {address}</p>
        <button onClick={() => open({ view: "Account" })}>Account</button>
      </div>
    );
  }

  return <button onClick={() => open()}>Connect Wallet</button>;
}

Using Wagmi Hooks with AppKit

import { useAccount, useBalance, useDisconnect } from "wagmi";

function AccountInfo() {
  const { address, isConnected } = useAccount();
  const { data: balance } = useBalance({ address });
  const { disconnect } = useDisconnect();

  if (!isConnected) return null;

  return (
    <div>
      <p>Address: {address}</p>
      <p>Balance: {balance?.formatted} {balance?.symbol}</p>
      <button onClick={() => disconnect()}>Disconnect</button>
    </div>
  );
}

Dynamic

Authentication-focused wallet connection with user management dashboard.

Source: https://docs.dynamic.xyz

Installation

npm install @dynamic-labs/sdk-react

Setup

import {
  DynamicContextProvider,
  DynamicWidget,
} from "@dynamic-labs/sdk-react";

function App() {
  return (
    <DynamicContextProvider
      settings={{
        environmentId: process.env.NEXT_PUBLIC_DYNAMIC_ENV_ID!,
      }}
    >
      <DynamicWidget />
    </DynamicContextProvider>
  );
}

Enable Celo

  1. Go to app.dynamic.xyz dashboard
  2. Navigate to Configurations
  3. Select EVM card
  4. Toggle Celo on

Custom Implementation

Build wallet connection without a library using wagmi directly.

Wagmi Configuration

import { http, createConfig } from "wagmi";
import { celo, celoSepolia } from "wagmi/chains";
import { injected, walletConnect, metaMask } from "wagmi/connectors";

const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!;

export const config = createConfig({
  chains: [celo, celoSepolia],
  connectors: [
    injected(),
    walletConnect({ projectId }),
    metaMask(),
  ],
  transports: {
    [celo.id]: http(),
    [celoSepolia.id]: http(),
  },
});

Wallet Connect Component

import { useConnect, useConnectors, useAccount, useDisconnect } from "wagmi";

function WalletConnect() {
  const { connect } = useConnect();
  const connectors = useConnectors();
  const { address, isConnected } = useAccount();
  const { disconnect } = useDisconnect();

  if (isConnected) {
    return (
      <div>
        <p>Connected: {address}</p>
        <button onClick={() => disconnect()}>Disconnect</button>
      </div>
    );
  }

  return (
    <div>
      {connectors.map((connector) => (
        <button
          key={connector.uid}
          onClick={() => connect({ connector })}
        >
          {connector.name}
        </button>
      ))}
    </div>
  );
}

Network Configuration

Celo Networks

NetworkChain IDReown ImportWagmi Import
Mainnet42220celo from @reown/appkit/networkscelo from wagmi/chains
Celo Sepolia11142220celoSepolia from @reown/appkit/networksceloSepolia from wagmi/chains
Celo Sepolia11142220-celoSepolia from wagmi/chains

Reown Project ID

Required for WalletConnect connections. WalletConnect Inc. rebranded to Reown in 2024.

  1. Go to cloud.reown.com (formerly WalletConnect Cloud)
  2. Create a new project (select "AppKit" type)
  3. Copy the project ID
  4. Add to environment variables:
NEXT_PUBLIC_REOWN_PROJECT_ID=your_project_id

Note: The wagmi walletConnect connector still uses the same project ID. Only the cloud console was rebranded.

Best Practices

  1. Support Multiple Wallets - Don't force users into one wallet
  2. Handle Network Switching - Prompt users to switch to Celo
  3. Show Connection State - Clear UI for connected/disconnected
  4. Handle Errors - User-friendly error messages
  5. Test on Mobile - Mobile browsers and wallet apps

Dependencies

Reown AppKit

{
  "dependencies": {
    "@reown/appkit": "^1.0.0",
    "@reown/appkit-adapter-wagmi": "^1.0.0",
    "wagmi": "^2.0.0",
    "viem": "^2.0.0",
    "@tanstack/react-query": "^5.0.0"
  }
}

Custom wagmi (without AppKit)

{
  "dependencies": {
    "wagmi": "^2.0.0",
    "viem": "^2.0.0",
    "@tanstack/react-query": "^5.0.0"
  }
}

Additional Resources

  • wallet-connectors.md - Connector configuration reference

Source of truth: Celopedia

These skills are focused, task-level references. For anything broader — verified contract addresses, ecosystem and protocol data, listing requirements, grants, governance, migration guides, or cross-cutting Celo questions — Celopedia is the canonical source and is kept current. Where this skill and Celopedia disagree, Celopedia wins.

npx skills add celo-org/celopedia-skills

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.