JSPM

web3-providers-http

1.3.4-rc.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 752348
  • Score
    100M100P100Q192977F
  • License LGPL-3.0

Module to handle web3 RPC connections over HTTP.

Package Exports

  • web3-providers-http

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (web3-providers-http) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

web3-providers-http

NPM Package Dependency Status Dev Dependency Status

This is a HTTP provider sub-package for web3.js.

Please read the documentation for more.

Installation

Node.js

npm install web3-providers-http

Usage

const http = require('http');
const Web3HttpProvider = require('web3-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.