0.0.1 • Published 5 months ago

berakin-wagmi-tests v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

Berakin Wagmi Adapter

This package provides a custom wallet adapter for the Berachain network using the Wagmi library.

Installation

To install the package, run:

npm install berakin-wagmi-adapter

Example Implementation

Below is an example of how to integrate the Berakin wallet with RainbowKit and Wagmi:

import { connectorsForWallets } from '@rainbow-me/rainbowkit';
import {
    injectedWallet,
    walletConnectWallet,
} from '@rainbow-me/rainbowkit/wallets';
import { berachain } from 'wagmi/chains';
import { createConfig, http } from 'wagmi';
import { berakinWallet } from 'berakin-wagmi-adapter';

const connectors = connectorsForWallets(
    [
        {
            groupName: 'Recommended',
            wallets: [berakinWallet, injectedWallet, walletConnectWallet],
        },
    ],
    {
        appName: 'Demo Dapp',
        projectId: 'YOUR_PROJECT_ID',
    }
);

export const config = createConfig({
    connectors,
    chains: [berachain],
    ssr: true,
    transports: {
        [berachain.id]: http(berachain.rpcUrls.default.http[0]),
    },
});

Configuration

  • appName: The name of your application.
  • projectId: Your project ID.
  • chains: The blockchain networks you want to support.
  • ssr: Enable or disable server-side rendering.
  • transports: Define the transport methods for the chains.

License

This project is licensed under the MIT License.