@gelatonetwork/smartwallet-react-privy
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

@gelatonetwork/smartwallet-react-privy

A React package that provides integration with Privy WaaS (Wallet-as-a-Service) for Gelato Smart Wallet.

Features

  • Privy WaaS integration for Gelato smart wallet management
  • Connect button component for easy wallet connection
  • Integration with wagmi for Web3 functionality

Installation

pnpm add @gelatonetwork/smartwallet-react-privy

Usage

Provider Setup

import { GelatoSmartWalletPrivyContextProvider } from '@gelatonetwork/smartwallet-react-privy';

function App() {
  return (
    <GelatoSmartWalletPrivyContextProvider
      settings={{
        waas: {
          appId: 'your-privy-app-id'
        },
        defaultChain: yourDefaultChain,
        wagmi: {
          config: yourWagmiConfig
        }
      }}
    >
      <YourApp />
    </GelatoSmartWalletPrivyContextProvider>
  );
}

Using the Connect Button

import { GelatoSmartWalletPrivyConnectButton } from '@gelatonetwork/smartwallet-react-privy';

function ConnectWallet() {
  return (
    <GelatoSmartWalletPrivyConnectButton>
      Connect Wallet
    </GelatoSmartWalletPrivyConnectButton>
  );
}

Accessing Wallet Context

import { useGelatoSmartWalletPrivyContext } from '@gelatonetwork/smartwallet-react-privy';

function YourComponent() {
  const { wagmi, logout, switchNetwork } = useGelatoSmartWalletPrivyContext();
  
  // Use the context values as needed
}

Readme

Keywords

none

Package Sidebar

Install

npm i @gelatonetwork/smartwallet-react-privy

Weekly Downloads

203

Version

0.0.9

License

none

Unpacked Size

561 kB

Total Files

21

Last publish

Collaborators

  • brandon.cs
  • pedrogelato
  • aless-io
  • denispanov
  • mkykadir