0.4.2 • Published 10 months ago

@direct.dev/wagmi v0.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@direct.dev/wagmi

A Wagmi-compatible provider that integrates with the Direct.dev RPC infrastructure, providing read-layer caching for improved performance and reduced costs.

Features

  • 🚀 Optimized RPC calls via Direct.dev
  • 🔌 Drop-in replacement for your existing Wagmi configurations
  • 🛡 Dependency-free, ensuring security and stability
  • 📉 Lower latency and costs with efficient request routing

Installation

npm install @direct.dev/wagmi wagmi@2.x viem@2.x
# or
yarn add @direct.dev/wagmi wagmi@2.x viem@2.x
# or
pnpm add @direct.dev/wagmi wagmi@2.x viem@2.x

Usage

// Import dependencies
import { createConfig } from "wagmi";
import { direct } from "@direct.dev/wagmi";

// Configure the Direct.dev Client
const directConfig = {
  projectId: "123",
  projectToken: "abc",
};

// Configure the Wagmi Client
const config = createConfig({
  chains: [mainnet, sepolia],
  transports: {
    [mainnet.id]: direct({
      ...directConfig,
      networkId: "ethereum",
      providers: ["https://your-provider-endpoint.com/"],
    }),
    [sepolia.id]: direct({
      ...directConfig,
      networkId: "ethereum-sepolia",
      providers: ["https://your-provider-endpoint.com/"],
    }),
  },
});


// Example: Provide the Wagmi config to your application
export default function App() {
  return (
    <WagmiConfig config={config}>
      <Home />
    </WagmiConfig>
  );
}

Documentation

For full API reference and detailed usage guides, visit our official documentation.

Contributing

We welcome contributions! If you find a bug or have an improvement, feel free to open an issue or submit a pull request.

Support

Join our Discord community for discussions and support.

License

This project is licensed under the MIT License.

0.4.2

10 months ago

0.4.1

10 months ago

0.4.0

10 months ago

0.3.1

11 months ago

0.3.0

11 months ago

0.2.0

12 months ago