@lifi/rpc-wrapper
TypeScript icon, indicating that this package has built-in type declarations

0.0.25 • Public • Published

RPC wrapper

A wrapper around your rpc

license npm latest package npm downloads Average time to resolve an issue Follow on Twitter

The rpc wrapper is a wrapper around evm based rpc. It allows you as an developer not to handle retrying, logging and performance monitoring of your rpcs.

Getting started

The package is available as an NPM package

You can install the package by running

> yarn add @lifi/rpc-wrapper

or if you use npm

> npm install @lifi/rpc-wrapper

Since the RPCProvider extends the ethersproject Fallbackprovider you can easily swap out your rpc handling with the RPCProvider.

// specify your rpc providers for your specific chain
const myRpcProviders = ['https://rpc1.com', 'https://rpc2.com']
// initialize the rpc provider
const provider = new RPCProvider(myRpcProviders)

const blockNumber = provider.getBlockNumber()
console.log('This is a block number ', blockNumber)

Contributing

Awesome! Please read more about contributing to the repo here

Development

Running tests

Test your code with Jest framework:

yarn test

Build

Build production (distribution) files in your dist folder:

yarn build

If you want to test how your changes affect please use

> yarn link

Then in your project, do

> yarn link @lifi/rpc-wrapper

Package Sidebar

Install

npm i @lifi/rpc-wrapper

Weekly Downloads

44

Version

0.0.25

License

Apache-2.0

Unpacked Size

155 kB

Total Files

54

Last publish

Collaborators

  • lifi