mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 05:14:06 -06:00
| .. | ||
| lib | ||
| src | ||
| types | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
web3-providers-http
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.