xdc3-providers-http
v1.3.13420
Published
Module to handle web3 RPC connections over HTTP.
Downloads
1,393
Readme
xdc3-providers-http
This is a HTTP provider sub-package for xdc3.
Please read the documentation for more.
Installation
Node.js
npm install xdc3-providers-http
Usage
const http = require('http');
const Web3HttpProvider = require('xdc3-providers-http');
const options = {
keepAlive: true,
timeout: 20000, // milliseconds,
headers: [{name: 'Access-Control-Allow-Origin', value: '*'},{...}],
withCredentials: false,
agent: {http: http.Agent(...), baseUrl: ''}
};
const provider = new Web3HttpProvider('http://localhost:8545', options);
Types
All the TypeScript typings are placed in the types
folder.