@privy-io/wagmi
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

@privy-io/wagmi

wagmi bindings for the @privy-io/react-auth library.

Installation

npm install -S @privy-io/wagmi

Setup

Configuration

import {http} from 'wagmi';
import {mainnet} from 'wagmi/chains';

import {createConfig} from '@privy-io/wagmi';

export const config = createConfig({
  chains: [mainnet],
  transports: {
    [mainnet.id]: http(),
  },
});

declare module 'wagmi' {
  interface Register {
    config: typeof config;
  }
}

Providers

import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {type ReactNode} from 'react';

import {PrivyProvider} from '@privy-io/react-auth';
import {WagmiProvider} from '@privy-io/wagmi';

import config from './config';

const queryClient = new QueryClient();

export const Providers = ({children}: {children: ReactNode}) => (
  <PrivyProvider appId="<your-app-id">
    <QueryClientProvider client={queryClient}>
      <WagmiProvider config={config}>{children}</WagmiProvider>
    </QueryClientProvider>
  </PrivyProvider>
);

Usage

Use wagmi as you normally would!

Readme

Keywords

Package Sidebar

Install

npm i @privy-io/wagmi

Weekly Downloads

2,570

Version

0.2.3

License

Apache-2.0

Unpacked Size

20.3 kB

Total Files

5

Last publish

Collaborators

  • koleok
  • joshnaviprivy
  • payton-privy
  • privy-bot
  • ankushswar1
  • ahollenbach
  • asta-li
  • sternhenri