Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
create-web3-provider
Advanced tools
Create a web3 provider from scratch, with minimal to no configuration.
You can then pass the created provider directly into the Web3 constructor.
npm install create-web3-provider
# or
yarn install create-web3-provider
const cw3p = require('create-web3-provider');
// Create an infura-backed provider on the mainnet.
let provider = cw3p();
// Create an infura-backed provider on the ropsten network.
provider = cw3p({network: 'ropsten'});
// Same, but use websockets.
provider = cw3p({ws: true, network: 'ropsten'});
// Create an infura-backed provider using your own API key.
provider = cw3p({infuraKey: 'MySecretInfuraKey'});
// Create a provider connected to 'http://localhost:8545'
provider = cw3p({uri: 'http://localhost:8545'});
// Create a provider connected to a websocket.
provider = cw3p({uri: 'ws://mydomain.com/path'});
// Create a provider connected to an IPC path.
provider = cw3p({uri: '/path/to/provider.ipc', net: require('net')});
// Full options:
cw3p({
// Network to connect to. May be 'main', ''mainnet', 'ropsten', or 'rinkeby'.
network: String,
// Infura project ID, if not connecting to a custom provider.
infuraKey: String,
// Use websocket infura endpoint instead of HTTP.
ws: Boolean,
// Connect to a custom provider.
// May be an http://, https://, ws://, wss:// or IPC path.
// IPC paths require the 'net' option as well.
uri: String,
// If using an IPC path, set this to `require('net')`
net: Object,
// Array of {name: ..., value: ...} HTTP or websocket headers.
headers: Array,
// Timeout for HTTP or websocket requests, in ms.
timeout: Number
});
FAQs
Easily create a web3 provider from scratch.
We found that create-web3-provider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.