-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web3 external provider - Quicknode #7019
Merged
Merged
Changes from 10 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
22e4069
providers package init
jdevcs 2c1d21c
types and quick nodes provider
jdevcs e6d2534
readme update
jdevcs 0708b87
import fixes and unit tests
jdevcs 6e09b81
lint fix
jdevcs 752968d
lint fix
jdevcs 6f25006
added host and quicknodes provider info
jdevcs d37fc2e
added host
jdevcs b5aeac8
tests
jdevcs 857cc97
lint
jdevcs 802bcd9
Merge branch '4.x' into junaid/web3externalproviders
jdevcs 4fab7b0
default provider and itests
jdevcs b525c61
package dir rename
jdevcs 718b2ca
web3-rpc-providers
jdevcs 6dc50ec
web3-rpc-providers in web3
jdevcs 017a7f2
packagejson updates
jdevcs 9c4c303
rename test file
jdevcs bc3187a
tests in web3 package
jdevcs ab747a1
e2e tests update
jdevcs 439a89c
Merge branch '4.x' into junaid/web3externalproviders
jdevcs 3e5ca4f
lint fix
jdevcs adbaf49
empty provider
jdevcs 3de1338
empty provider test fix
jdevcs 6ebda42
lint fix
jdevcs fb4b3af
default provider tests update
jdevcs e8b76d6
lint fix
jdevcs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.eslintignore.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
extends: '../../.eslintrc.js', | ||
parserOptions: { | ||
project: './tsconfig.esm.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.npmignore.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.npmrc.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.prettierignore.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.prettierrc.json.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
<!-- EXAMPLE | ||
|
||
## [1.0.0] | ||
|
||
### Added | ||
|
||
- I've added feature XY (#1000) | ||
|
||
### Changed | ||
|
||
- I've cleaned up XY (#1000) | ||
|
||
### Deprecated | ||
|
||
- I've deprecated XY (#1000) | ||
|
||
### Removed | ||
|
||
- I've removed XY (#1000) | ||
|
||
### Fixed | ||
|
||
- I've fixed XY (#1000) | ||
|
||
### Security | ||
|
||
- I've improved the security in XY (#1000) | ||
|
||
--> | ||
|
||
## [Unreleased] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<p align="center"> | ||
<img src="assets/logo/web3js.jpg" width="500" alt="web3.js" /> | ||
</p> | ||
|
||
# web3.js - Web3 Providers | ||
|
||
![ES Version](https://img.shields.io/badge/ES-2020-yellow) | ||
![Node Version](https://img.shields.io/badge/node-14.x-green) | ||
[![NPM Package][npm-image]][npm-url] | ||
[![Downloads][downloads-image]][npm-url] | ||
|
||
This is a sub-package of [web3.js][repo]. | ||
|
||
|
||
## Installation | ||
|
||
You can install the package either using [NPM](https://www.npmjs.com/package/web3-providers) or using [Yarn](https://yarnpkg.com/package/web3-providers) | ||
|
||
### Using NPM | ||
|
||
```bash | ||
npm install web3-providers | ||
``` | ||
|
||
### Using Yarn | ||
|
||
```bash | ||
yarn add web3-providers | ||
``` | ||
|
||
## Getting Started | ||
|
||
- :writing_hand: If you have questions [submit an issue](https://github.com/ChainSafe/web3.js/issues/new) or join us on [Discord](https://discord.gg/yjyvFRP) | ||
![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord) | ||
|
||
## Prerequisites | ||
|
||
- :gear: [NodeJS](https://nodejs.org/) (LTS/Fermium) | ||
- :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/) | ||
|
||
## Package.json Scripts | ||
|
||
| Script | Description | | ||
| ---------------- | -------------------------------------------------- | | ||
| clean | Uses `rimraf` to remove `dist/` | | ||
| build | Uses `tsc` to build package and dependent packages | | ||
| lint | Uses `eslint` to lint package | | ||
| lint:fix | Uses `eslint` to check and fix any warnings | | ||
| format | Uses `prettier` to format the code | | ||
| test | Uses `jest` to run unit tests | | ||
| test:integration | Uses `jest` to run tests under `/test/integration` | | ||
| test:unit | Uses `jest` to run tests under `/test/unit` | | ||
|
||
[docs]: https://docs.web3js.org/ | ||
[repo]: https://github.com/web3/web3.js/tree/4.x/tools/web3-providers | ||
[npm-image]: https://img.shields.io/github/package-json/v/web3/web3.js/4.x?filename=tools%2Fweb3-providers%2Fpackage.json | ||
[npm-url]: https://npmjs.org/package/web3-providers | ||
[downloads-image]: https://img.shields.io/npm/dm/web3-providers?label=npm%20downloads |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "web3-providers", | ||
"version": "0.1.0", | ||
"description": "Web3 Providers package", | ||
"main": "./lib/commonjs/index.js", | ||
"module": "./lib/esm/index.js", | ||
"exports": { | ||
".": { | ||
"types": "./lib/types/index.d.ts", | ||
"import": "./lib/esm/index.js", | ||
"require": "./lib/commonjs/index.js" | ||
} | ||
}, | ||
"repository": "https://github.com/ChainSafe/web3.js", | ||
"author": "ChainSafe Systems", | ||
"license": "LGPL-3.0", | ||
"engines": { | ||
"node": ">=14", | ||
"npm": ">=6.12.0" | ||
}, | ||
"files": [ | ||
"lib/**/*", | ||
"src/**/*", | ||
"dist/**/*" | ||
], | ||
"scripts": { | ||
"clean": "rimraf dist && rimraf lib", | ||
"prebuild": "yarn clean", | ||
"build": "concurrently --kill-others-on-fail \"yarn:build:*(!check)\"", | ||
"build:cjs": "tsc --build tsconfig.cjs.json", | ||
"build:esm": "tsc --build tsconfig.esm.json", | ||
"build:types": "tsc --build tsconfig.types.json", | ||
"build:check": "node -e \"require('./lib')\"", | ||
"lint": "eslint --ext .js,.ts .", | ||
"lint:fix": "eslint --fix --ext .js,.ts .", | ||
"format": "prettier --write '**/*'", | ||
"test": "jest --config=./test/unit/jest.config.js", | ||
"test:coverage:unit": "jest --config=./test/unit/jest.config.js --coverage=true --coverage-reporters=text", | ||
"test:coverage:integration": "jest --config=./test/integration/jest.config.js --passWithNoTests --coverage=true --coverage-reporters=text", | ||
"test:ci": "jest --coverage=true --coverage-reporters=json --verbose", | ||
"test:watch": "npm test -- --watch", | ||
"test:unit": "jest --config=./test/unit/jest.config.js", | ||
"test:integration": "jest --config=./test/integration/jest.config.js --passWithNoTests" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^28.1.6", | ||
"@typescript-eslint/eslint-plugin": "^5.30.7", | ||
"@typescript-eslint/parser": "^5.30.7", | ||
"eslint": "^8.20.0", | ||
"eslint-config-base-web3": "0.1.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"jest": "^29.7.0", | ||
"jest-extended": "^3.0.1", | ||
"prettier": "^2.7.1", | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^4.7.4" | ||
}, | ||
"dependencies": { | ||
"web3": "^4.8.0", | ||
"web3-providers-http": "^4.1.0", | ||
"web3-providers-ws": "^4.0.7", | ||
"web3-types": "^1.6.0", | ||
"web3-utils": "^4.2.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
This file is part of web3.js. | ||
|
||
web3.js is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
web3.js is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
|
||
You should have received a copy of the GNU Lesser General Public License | ||
along with web3.js. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { QuickNodeProvider } from './web3_provider_quicknode.js'; | ||
|
||
export * from './types.js'; | ||
export * from './web3_provider_quicknode.js'; | ||
export * from './web3_provider.js'; | ||
|
||
// default providers | ||
export const mainnet = new QuickNodeProvider(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
This file is part of web3.js. | ||
|
||
web3.js is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
web3.js is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
|
||
You should have received a copy of the GNU Lesser General Public License | ||
along with web3.js. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
export enum Transport { | ||
HTTPS = "https", | ||
WebSocket = "wss" | ||
}; | ||
|
||
export enum Network { | ||
ETH_MAINNET = "eth_mainnet", | ||
ETH_GOERLI = "eth_goerli", | ||
ETH_SEPOLIA = "eth_sepolia", | ||
ETH_HOLESKY = "eth_holesky", | ||
|
||
POLYGON_MAINNET= "polygon_mainnet", | ||
POLYGON_MUMBAI= "polygon_mumbai", | ||
POLYGON_AMONY= "polygon_amony", | ||
|
||
ARBITRUM_MAINNET = "arbitrum_mainnet", | ||
ARBITRUM_SEPOLIA = "arbitrum_sepolia", | ||
|
||
BASE_MAINNET = "base_mainnet", | ||
BASE_SEPOLIA = "base_sepolia", | ||
|
||
OPTIMISM_MAINNET = "optimism_mainnet", | ||
OPTIMISM_SEPOLIA = "optimism_sepolia", | ||
|
||
BNB_MAINNET = "bnb_mainnet", | ||
BNB_TESTNET = "bnb_testnet" | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we start at 0.1.0 that would that be considered alpha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, 1.0.0 will be prod