Socket
Socket
Sign inDemoInstall

web3-providers-http

Package Overview
Dependencies
47
Maintainers
2
Versions
384
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.7 to 1.2.8-rc.0

12

package.json
{
"name": "web3-providers-http",
"version": "1.2.7",
"version": "1.2.8-rc.0",
"description": "Module to handle web3 RPC connections over HTTP.",

@@ -11,3 +11,3 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http",

"scripts": {
"dtslint": "dtslint types"
"dtslint": "dtslint --localTs node_modules/typescript/lib types"
},

@@ -17,10 +17,10 @@ "types": "types/index.d.ts",

"dependencies": {
"web3-core-helpers": "1.2.7",
"web3-core-helpers": "1.2.8-rc.0",
"xhr2-cookies": "1.1.0"
},
"devDependencies": {
"definitelytyped-header-parser": "^3.9.0",
"dtslint": "^3.4.1"
"dtslint": "^3.4.1",
"typescript": "latest"
},
"gitHead": "65237be53b5d2ec7d12da12c35d7ddb7af57256f"
"gitHead": "035d11acced0bdd43e500d4defbfdcd1b70768d7"
}

@@ -43,9 +43,10 @@ /*

var keepAlive = (options.keepAlive === true || options.keepAlive !== false) ? true : false;
// keepAlive is true unless explicitly set to false
const keepAlive = options.keepAlive !== false;
this.host = host || 'http://localhost:8545';
if (!this.agent) {
if (this.host.substring(0,5) === "https") {
this.httpsAgent = new https.Agent({ keepAlive: keepAlive });
this.httpsAgent = new https.Agent({ keepAlive });
} else {
this.httpAgent = new http.Agent({ keepAlive: keepAlive });
this.httpAgent = new http.Agent({ keepAlive });
}

@@ -52,0 +53,0 @@ }

@@ -22,7 +22,46 @@ /*

*/
import * as http from 'http';
import * as https from 'https';
// Minimum TypeScript Version: 3.0
import { HttpProviderBase, JsonRpcResponse } from 'web3-core-helpers';
import { HttpProviderBase } from 'web3-core-helpers';
export interface HttpHeader {
name: string;
value: string;
}
export class HttpProvider extends HttpProviderBase {}
export interface HttpProviderAgent {
baseUrl?: string;
http?: http.Agent;
https?: https.Agent;
}
export interface HttpProviderOptions {
withCredentials?: boolean;
timeout?: number;
headers?: HttpHeader[];
agent?: HttpProviderAgent;
keepAlive?: boolean;
}
export class HttpProvider extends HttpProviderBase {
host: string;
withCredentials: boolean;
timeout: number;
headers?: HttpHeader[];
agent?: HttpProviderAgent;
connected: boolean;
constructor(host?: string, options?: HttpProviderOptions);
send(
payload: object,
callback?: (
error: Error | null,
result: JsonRpcResponse | undefined
) => void
): void;
disconnect(): boolean;
supportsSubscriptions(): boolean;
}

@@ -45,8 +45,8 @@ /*

// $ExpectType void
httpProvider.send({} as any, (error: Error | null) => {});
httpProvider.send({}, (error: Error | null) => {});
// $ExpectType void
httpProvider.send({} as any, (error: Error | null, result: JsonRpcResponse | undefined) => {});
httpProvider.send({}, (error: Error | null, result: JsonRpcResponse | undefined) => {});
// $ExpectType boolean
httpProvider.disconnect();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc