npm:
npm i @lavanet/lava-ethers-v5
- create()
- new() ...init()
- new() ...relay
import { LavaEthersProvider } from "@lavanet/lava-ethers-v5";
//ethersProvider is initialized upon calling create()
const ethersProvider = await LavaEthersProvider.create({
badge: {
badgeServerAddress: "https://badges.lavanet.xyz",
projectId: "//" //login to gateway.lavanet.xyz to get a projectId!
},
chainIds: "ETH1",
geolocation: "1" //optional
});
const blockNumber = await ethersProvider.getBlockNumber();
import { LavaEthersProvider } from "@lavanet/lava-ethers-v5";
//ethersProvider is initialized by calling init() after new()
const ethersProvider = new LavaEthersProvider({
badge: {
badgeServerAddress: "https://badges.lavanet.xyz",
projectId: "//" //login to gateway.lavanet.xyz to get a projectId!
},
chainIds: "ETH1",
geolocation: "1" //optional
});
//client is initialized after the following call
await ethersProvider.init();
const blockNumber = await ethersProvider.getBlockNumber();
import { LavaEthersProvider } from "@lavanet/lava-ethers-v5";
//ethersProvider is initialized at first relay
const ethersProvider = new LavaEthersProvider({
badge: {
badgeServerAddress: "https://badges.lavanet.xyz",
projectId: "//" //login to gateway.lavanet.xyz to get a projectId!
},
chainIds: "ETH1",
geolocation: "1" //optional
});
//client is initialized at the following call
const blockNumber = await ethersProvider.getBlockNumber();
❓ Looking for more examples? Check out the examples folder on our repository.