Skip to main content
The Deno 2 Release Candidate is here
Learn more

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.

Usage

import http from 'https://deno.land/std/node/http.ts';
import Web3HttpProvider from 'https://deno.land/x/npm_web3_providers_http@0.0.1/mod.js';

const options = {
    keepAlive: true,
    timeout: 20000,
    headers: [
      {name: 'Access-Control-Allow-Origin', value: '*'}
      ,{...}
    ],
    withCredentials: false,
    agent: {http: http.Agent(...), baseUrl: ''}
};

const provider = new Web3HttpProvider('http://localhost:8545', options);