Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inventorecupiditate

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inventorecupiditate

Collection of Lava implementation for different providers

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source


Logo

Lava Ethers Provider - ALPHA

Use the Ethers.js, the Lava way 🌋

This repository contains implementations of Ether.js provider using Lava-SDK to achive decentralized access.

(back to top)

Installation

Prerequisites (Alpha version)

SDK setup requires additional steps at the moment, but we're working on minimizing prerequisites as we progress through the roadmap.

  1. Create a wallet on the Lava Testnet, have LAVA tokens
  2. Stake in the chain you want to access
  3. Stake in Lava chain

Need help? We've got you covered 😻 Head over to our Discord channel #developers and we'll provide testnet tokens and further support

Yarn

yarn add lava-sdk-providers

NPM

npm install lava-sdk-providers

(back to top)

Usage

To use the LavaEthersProvider, you will first need to import and initialize it.

const ethersProvider = await new LavaEthersProvider({
  privKey: privKey,
  chainID: chainID,
  pairingListConfig: localConfigPath, // Optional
  networkId: networkID, // Optional
});
  • privateKey parameter is required and should be the private key of the staked Lava client for the specified chainID.

  • chainID parameter is required and should be the ID of the chain you want to query. You can find all supported chains with their IDs supportedChains

  • pairingListConfig is an optional field that specifies the lava pairing list config used for communicating with lava network. Lava SDK does not rely on one centralized rpc for querying lava network. It uses a list of rpc providers to fetch list of the providers for specified chainID and rpcInterface from lava network. If not pairingListConfig set, the default list will be used default lava pairing list

  • networkId represents chain id of the network we want to query. By default every supported chain has matching chain id (https://github.com/lavanet/lava-sdk-providers/blob/main/ethersjs/supportedChains.json)

Once the LavaEthersProvider is initialized, you can use any method provided by the Ether.js library to interact with the blockchain. For example, to get the latest block number, you can use the following code:

const blockNumber = await ethersProvider.getBlockNumber();

This will return the block number of the latest block on the specified chain. You can find more information on available methods in the official Ether.js documentation

(back to top)

Keywords

FAQs

Package last updated on 03 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc