sof-json-rpc-infura

json-rpc-engine middleware for infura's REST endpoints.

Usage no npm install needed!

<script type="module">
  import sofJsonRpcInfura from 'https://cdn.skypack.dev/sof-json-rpc-infura';
</script>

README

sof-json-rpc-infura

json-rpc-engine middleware for infura's REST endpoints.

usage as provider

const createInfuraProvider = require('sof-json-rpc-infura/src/createProvider')
const Sofjs = require('sofjs')

const provider = createInfuraProvider({ network: 'mainnet' })
const sof = new Sofjs(provider)

usage as middleware

const createInfuraMiddleware = require('sof-json-rpc-infura')
const RpcEngine = require('json-rpc-engine')

const engine = new RpcEngine()
engine.push(createInfuraMiddleware({ network: 'ropsten' }))