> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coinvoyage.io/llms.txt
> Use this file to discover all available pages before exploring further.

# WalletProvider — configure multi-chain wallet connectors

> Configure WalletProvider with chain-specific settings for EVM, Solana, Sui, and UTXO wallets including RPC URLs, adapters, and connectors.

`WalletProvider` manages wallet connections for the CoinVoyage PayKit SDK. It wraps `PayKitProvider` in your provider tree and is required to use `PayButton` and `usePayStatus`. Without it, the payment modal cannot connect to a user's wallet. You configure it through a `config` prop that accepts per-chain settings — you only need to supply configuration for the chains your application uses.

## Setup

Import `WalletProvider` from `@coin-voyage/paykit` and wrap it around `PayKitProvider`:

```tsx theme={null}
"use client";

import { PayKitProvider, WalletProvider } from "@coin-voyage/paykit";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

const queryClient = new QueryClient();

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <QueryClientProvider client={queryClient}>
      <WalletProvider
        config={{
          evm: {
            coinbase: {
              appName: "My App",
            },
            walletConnect: {
              projectId: "your-project-id",
            },
          },
          solana: {
            rpcUrl: "my-solana-rpc-url",
            walletConfiguration: {
              wallets: [customWalletAdapter()],
            },
          },
          sui: {
            grpcUrl: "https://fullnode.mainnet.sui.io:443",
          },
          utxo: {
            lazy: true,
          },
        }}
      >
        <PayKitProvider apiKey={process.env.NEXT_PUBLIC_COIN_VOYAGE_API_KEY!}>
          {children}
        </PayKitProvider>
      </WalletProvider>
    </QueryClientProvider>
  );
}
```

<Note>
  All `config` fields are optional. You can pass `<WalletProvider>` with no props and the SDK will use its default connector configuration.
</Note>

## Configuration options

<ParamField path="config" type="object">
  Object containing chain-type-specific wallet configuration. Every sub-key is optional — include only the chains you need to customize.
</ParamField>

### config.evm

<ParamField path="config.evm" type="object">
  Configuration for EVM-compatible chains (Ethereum, Polygon, Arbitrum, Base, etc.). Lets you configure the bundled wallet connectors and add custom ones.

  <Expandable title="EVM connector options">
    <ParamField path="config.evm.walletConnect" type="object">
      Configuration passed to the WalletConnect connector.

      * `projectId` (string) — your WalletConnect Cloud project ID. Required to enable WalletConnect across all EVM chains.
    </ParamField>

    <ParamField path="config.evm.coinbase" type="object">
      Configuration passed to the Coinbase Wallet connector.

      * `appName` (string) — the display name shown in the Coinbase Wallet app during connection.
    </ParamField>

    <ParamField path="config.evm.metaMask" type="object">
      Configuration passed to the MetaMask connector. Useful when you need to customize MetaMask-specific behavior or pass additional connector options.
    </ParamField>

    <ParamField path="config.evm.rpcConfig" type="object">
      Optional RPC transport configuration keyed by EVM chain ID.
    </ParamField>

    <ParamField path="config.evm.connectors" type="array">
      Custom Wagmi connector factories to include with the default EVM connectors.
    </ParamField>

    <ParamField path="config.evm.lazy" type="boolean">
      When `true`, lazy-loads wallet SDKs unless the wallet was the most recently connected wallet.
    </ParamField>
  </Expandable>
</ParamField>

### config.solana

<ParamField path="config.solana" type="object">
  Configuration for the Solana chain. Provide a custom RPC endpoint or extend the list of supported wallet adapters.

  <Expandable title="Solana options">
    <ParamField path="config.solana.rpcUrl" type="string">
      Custom Solana RPC URL. Use this to point to your own node or a premium RPC provider instead of the default public endpoint.
    </ParamField>

    <ParamField path="config.solana.walletConfiguration" type="object">
      Additional wallet adapter configuration.

      * `wallets` (array) — array of Solana wallet adapter instances to add alongside the default set.
    </ParamField>
  </Expandable>
</ParamField>

### config.sui

<ParamField path="config.sui" type="object">
  Configuration for the Sui chain.

  <Expandable title="Sui options">
    <ParamField path="config.sui.grpcUrl" type="string">
      Custom Sui gRPC URL for connecting to a specific full node.
    </ParamField>

    <ParamField path="config.sui.walletConfiguration" type="object">
      Additional wallet adapter configuration for the Sui chain.
    </ParamField>
  </Expandable>
</ParamField>

### config.utxo

<ParamField path="config.utxo" type="object">
  Configuration for UTXO-based chains such as Bitcoin.

  <Expandable title="UTXO options">
    <ParamField path="config.utxo.lazy" type="boolean">
      When `true`, defers loading UTXO wallet connectors until they are actually needed. This can reduce initial bundle parsing time in applications where UTXO payments are infrequent.
    </ParamField>

    <ParamField path="config.utxo.rpcConfig" type="object">
      Optional Bitcoin RPC transport configuration.
    </ParamField>
  </Expandable>
</ParamField>

## Examples

<Tabs>
  <Tab title="Minimal setup">
    Use `WalletProvider` with no configuration when the SDK defaults are sufficient:

    ```tsx theme={null}
    <WalletProvider>
      <PayKitProvider apiKey={process.env.NEXT_PUBLIC_COIN_VOYAGE_API_KEY!}>
        {children}
      </PayKitProvider>
    </WalletProvider>
    ```
  </Tab>

  <Tab title="EVM with WalletConnect">
    Supply your WalletConnect Cloud project ID to enable QR code and deep link connections across EVM chains:

    ```tsx theme={null}
    <WalletProvider
      config={{
        evm: {
          walletConnect: {
            projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!,
          },
          coinbase: {
            appName: "My Store",
          },
        },
      }}
    >
      <PayKitProvider apiKey={process.env.NEXT_PUBLIC_COIN_VOYAGE_API_KEY!}>
        {children}
      </PayKitProvider>
    </WalletProvider>
    ```
  </Tab>

  <Tab title="Custom Solana RPC">
    Point the Solana connector at a private RPC and add a custom wallet adapter:

    ```tsx theme={null}
    import { PhantomWalletAdapter } from "@solana/wallet-adapter-wallets";

    <WalletProvider
      config={{
        solana: {
          rpcUrl: "https://my-rpc.example.com",
          walletConfiguration: {
            wallets: [new PhantomWalletAdapter()],
          },
        },
      }}
    >
      <PayKitProvider apiKey={process.env.NEXT_PUBLIC_COIN_VOYAGE_API_KEY!}>
        {children}
      </PayKitProvider>
    </WalletProvider>
    ```
  </Tab>
</Tabs>
