Socket
Socket
Sign inDemoInstall

web3-net

Package Overview
Dependencies
0
Maintainers
4
Versions
383
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.8-dev.d8b8e18.0 to 4.0.8-dev.dd172c7.0

17

lib/commonjs/net.d.ts

@@ -5,2 +5,19 @@ import { Web3Context } from 'web3-core';

* Net class allows you to interact with an Ethereum node’s network properties.
* For using Net package, first install Web3 package using: `npm i web3` or `yarn add web3` based on your package manager, after that Net features can be used.
* ```ts
*
* import { Web3 } from 'web3';
* const web3 = new Web3('https://mainnet.infura.io/v3/<YOURPROJID>');
*
* console.log(await web3.eth.net.getId());
*
* ```
* For using individual package install `web3-net` packages using: `npm i web3-net` or `yarn add web3-net`.
*
* ```ts
* import {Net} from 'web3-net';
*
* const net = new Net('https://mainnet.infura.io/v3/<YOURPROJID>');
* console.log(await net.getId());
* ```
*/

@@ -7,0 +24,0 @@ export declare class Net extends Web3Context<Web3NetAPI> {

22

lib/commonjs/net.js

@@ -53,6 +53,22 @@ "use strict";

const web3_core_1 = require("web3-core");
const web3_types_1 = require("web3-types");
const rpcMethodsWrappers = __importStar(require("./rpc_method_wrappers.js"));
/**
* Net class allows you to interact with an Ethereum node’s network properties.
* For using Net package, first install Web3 package using: `npm i web3` or `yarn add web3` based on your package manager, after that Net features can be used.
* ```ts
*
* import { Web3 } from 'web3';
* const web3 = new Web3('https://mainnet.infura.io/v3/<YOURPROJID>');
*
* console.log(await web3.eth.net.getId());
*
* ```
* For using individual package install `web3-net` packages using: `npm i web3-net` or `yarn add web3-net`.
*
* ```ts
* import {Net} from 'web3-net';
*
* const net = new Net('https://mainnet.infura.io/v3/<YOURPROJID>');
* console.log(await net.getId());
* ```
*/

@@ -72,3 +88,3 @@ class Net extends web3_core_1.Web3Context {

*/
getId(returnFormat = web3_types_1.DEFAULT_RETURN_FORMAT) {
getId(returnFormat = this.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -90,3 +106,3 @@ return rpcMethodsWrappers.getId(this, returnFormat);

*/
getPeerCount(returnFormat = web3_types_1.DEFAULT_RETURN_FORMAT) {
getPeerCount(returnFormat = this.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -93,0 +109,0 @@ return rpcMethodsWrappers.getPeerCount(this, returnFormat);

@@ -27,6 +27,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { Web3Context } from 'web3-core';
import { DEFAULT_RETURN_FORMAT } from 'web3-types';
import * as rpcMethodsWrappers from './rpc_method_wrappers.js';
/**
* Net class allows you to interact with an Ethereum node’s network properties.
* For using Net package, first install Web3 package using: `npm i web3` or `yarn add web3` based on your package manager, after that Net features can be used.
* ```ts
*
* import { Web3 } from 'web3';
* const web3 = new Web3('https://mainnet.infura.io/v3/<YOURPROJID>');
*
* console.log(await web3.eth.net.getId());
*
* ```
* For using individual package install `web3-net` packages using: `npm i web3-net` or `yarn add web3-net`.
*
* ```ts
* import {Net} from 'web3-net';
*
* const net = new Net('https://mainnet.infura.io/v3/<YOURPROJID>');
* console.log(await net.getId());
* ```
*/

@@ -46,3 +62,3 @@ export class Net extends Web3Context {

*/
getId(returnFormat = DEFAULT_RETURN_FORMAT) {
getId(returnFormat = this.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -64,3 +80,3 @@ return rpcMethodsWrappers.getId(this, returnFormat);

*/
getPeerCount(returnFormat = DEFAULT_RETURN_FORMAT) {
getPeerCount(returnFormat = this.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -67,0 +83,0 @@ return rpcMethodsWrappers.getPeerCount(this, returnFormat);

@@ -5,2 +5,19 @@ import { Web3Context } from 'web3-core';

* Net class allows you to interact with an Ethereum node’s network properties.
* For using Net package, first install Web3 package using: `npm i web3` or `yarn add web3` based on your package manager, after that Net features can be used.
* ```ts
*
* import { Web3 } from 'web3';
* const web3 = new Web3('https://mainnet.infura.io/v3/<YOURPROJID>');
*
* console.log(await web3.eth.net.getId());
*
* ```
* For using individual package install `web3-net` packages using: `npm i web3-net` or `yarn add web3-net`.
*
* ```ts
* import {Net} from 'web3-net';
*
* const net = new Net('https://mainnet.infura.io/v3/<YOURPROJID>');
* console.log(await net.getId());
* ```
*/

@@ -7,0 +24,0 @@ export declare class Net extends Web3Context<Web3NetAPI> {

16

package.json
{
"name": "web3-net",
"version": "4.0.8-dev.d8b8e18.0+d8b8e18",
"version": "4.0.8-dev.dd172c7.0+dd172c7",
"description": "Web3 module to interact with the Ethereum nodes networking properties.",

@@ -52,15 +52,15 @@ "main": "./lib/commonjs/index.js",

"eslint-plugin-import": "^2.26.0",
"jest": "^28.1.3",
"jest": "^29.7.0",
"jest-extended": "^3.0.1",
"prettier": "^2.7.1",
"ts-jest": "^28.0.7",
"ts-jest": "^29.1.1",
"typescript": "^4.7.4"
},
"dependencies": {
"web3-core": "4.3.2-dev.d8b8e18.0+d8b8e18",
"web3-rpc-methods": "1.1.4-dev.d8b8e18.0+d8b8e18",
"web3-types": "1.3.2-dev.d8b8e18.0+d8b8e18",
"web3-utils": "4.0.8-dev.d8b8e18.0+d8b8e18"
"web3-core": "4.3.3-dev.dd172c7.0+dd172c7",
"web3-rpc-methods": "1.2.1-dev.dd172c7.0+dd172c7",
"web3-types": "1.6.1-dev.dd172c7.0+dd172c7",
"web3-utils": "4.2.4-dev.dd172c7.0+dd172c7"
},
"gitHead": "d8b8e18f7e80ceb3dc0bfbdd9bcb7734dd1c0e94"
"gitHead": "dd172c78daa518778aa2ac07aa2cc2a8bf0aa9e2"
}

@@ -24,2 +24,19 @@ /*

* Net class allows you to interact with an Ethereum node’s network properties.
* For using Net package, first install Web3 package using: `npm i web3` or `yarn add web3` based on your package manager, after that Net features can be used.
* ```ts
*
* import { Web3 } from 'web3';
* const web3 = new Web3('https://mainnet.infura.io/v3/<YOURPROJID>');
*
* console.log(await web3.eth.net.getId());
*
* ```
* For using individual package install `web3-net` packages using: `npm i web3-net` or `yarn add web3-net`.
*
* ```ts
* import {Net} from 'web3-net';
*
* const net = new Net('https://mainnet.infura.io/v3/<YOURPROJID>');
* console.log(await net.getId());
* ```
*/

@@ -40,3 +57,3 @@ export class Net extends Web3Context<Web3NetAPI> {

public async getId<ReturnFormat extends DataFormat = typeof DEFAULT_RETURN_FORMAT>(
returnFormat: ReturnFormat = DEFAULT_RETURN_FORMAT as ReturnFormat,
returnFormat: ReturnFormat = this.defaultReturnFormat as ReturnFormat,
) {

@@ -59,3 +76,3 @@ return rpcMethodsWrappers.getId(this, returnFormat);

public async getPeerCount<ReturnFormat extends DataFormat = typeof DEFAULT_RETURN_FORMAT>(
returnFormat: ReturnFormat = DEFAULT_RETURN_FORMAT as ReturnFormat,
returnFormat: ReturnFormat = this.defaultReturnFormat as ReturnFormat,
) {

@@ -62,0 +79,0 @@ return rpcMethodsWrappers.getPeerCount(this, returnFormat);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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