0.4.2 • Published 5 months ago
@direct.dev/ethers v0.4.2
@direct.dev/ethers
An ethers-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 Ethers providers
- 🛡 Dependency-free, ensuring security and stability
- 📉 Lower latency and costs with efficient request routing
Installation
npm install @direct.dev/ethers ethers
# or
yarn add @direct.dev/ethers ethers
# or
pnpm add @direct.dev/ethers ethers
Usage
// Import dependencies
import { DirectEthersProvider } from "@direct.dev/ethers";
// Initialize the Direct.dev provider
const provider = new DirectEthersProvider({
projectId: "your-project-id", // From the Direct.dev dashboard
projectToken: "************", // From the Direct.dev dashboard
networkId: "your-network-id", // e.g. "ethereum", "polygon"
providers: ["https://your-provider-endpoints.com/"],
});
// Example: Fetch the latest block number
const blockNumber = await provider.getBlockNumber();
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.