@lifi/rpc-wrapper v0.0.28
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-wrapperor if you use npm
> npm install @lifi/rpc-wrapperSince 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 testBuild
Build production (distribution) files in your dist folder:
yarn buildIf you want to test how your changes affect please use
> yarn linkThen in your project, do
> yarn link @lifi/rpc-wrapper1 year ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago