@direct.dev/wagmi
v0.7.2
Published
Wagmi transport for Direct.dev, optimizing performance and enhancing reliability.
Readme
@direct.dev/wagmi
A Wagmi-compatible transport 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 [email protected] [email protected]
# or
yarn add @direct.dev/wagmi [email protected] [email protected]
# or
pnpm add @direct.dev/wagmi [email protected] [email protected]Usage
// Import dependencies
import { http } from "wagmi";
import { mainnet, sepolia, polygon } from "wagmi/chains";
import createDirectConfig from "@direct.dev/wagmi";
// Configure the Wagmi through the Direct.dev Client
const config = createDirectConfig(
// Wagmi configurations
(direct) => ({
chains: [mainnet, sepolia, polygon],
transports:{
[mainnet.id]: direct(),
[sepolia.id]: direct(),
[polygon.id]: http(),
}
}),
// Direct.dev configurations
{
projectId: "your-project-id", // From the Direct.dev dashboard
projectToken: "************", // From the Direct.dev dashboard
},
);
// Example: Provide the Wagmi config to your application
export default function App() {
return (
<WagmiConfig config={config}>
<Home />
</WagmiConfig>
);
}Note: If you're already using client callback in your Wagmi setup (instead of transports), we recommend using @direct.dev/viem directly to construct the Viem client for supported chains. This gives you full control while retaining Direct.dev's performance benefits.
Documentation
For full API reference and detailed usage guides, visit our official documentation.
Support
Join our Discord community for discussions and support.
License
🛡️ License: This software is provided under the Direct.dev Terms and Conditions.
Use of this software requires agreement to those terms.
For inquiries, contact [email protected].
