essential-eth 0.4.8 → 0.4.9-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "essential-eth",
3
3
  "description": "Ultralight JS library for Ethereum utilities",
4
- "version": "0.4.8",
4
+ "version": "0.4.9-alpha.01",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "main": "./lib/cjs/index.js",
@@ -22,11 +22,9 @@
22
22
  "tsc:esm": "tsc -p tsconfig.json",
23
23
  "tsc:cjs": "tsc -p tsconfig-cjs.json",
24
24
  "build": "rm -rf lib && npm run compile",
25
- "prepublishOnly": "npm run build && npm run build:website && npm run build:website:new-version",
25
+ "prepublishOnly": "npm run build",
26
26
  "jest": "jest",
27
27
  "build:chains-info": "npx ts-node scripts/fetch-chains-info.ts # used in getNetwork()",
28
- "build:website": "sh scripts/build-website.sh",
29
- "build:website:new-version": "typedoc --options typedoc/options-new-version.js",
30
28
  "pre-commit": "sh scripts/pre-commit.sh"
31
29
  },
32
30
  "devDependencies": {
@@ -37,29 +35,27 @@
37
35
  "@types/jest": "^27.4.1",
38
36
  "@types/jest-dev-server": "^5.0.0",
39
37
  "@types/node": "^16.10.1",
40
- "@types/prettier": "^2.4.0",
41
- "@types/supertest": "^2.0.11",
42
- "@typescript-eslint/eslint-plugin": "^5.13.0",
43
- "@typescript-eslint/parser": "^5.13.0",
38
+ "@types/prettier": "^2.4.4",
39
+ "@typescript-eslint/eslint-plugin": "^5.17.0",
40
+ "@typescript-eslint/parser": "^5.17.0",
44
41
  "body-parser": "^1.19.0",
45
42
  "dotenv": "^16.0.0",
46
- "eslint": "^8.10.0",
47
- "eslint-plugin-jest": "^26.1.1",
48
- "ethers": "^5.5.4",
43
+ "eslint": "^8.12.0",
44
+ "eslint-plugin-jest": "^26.1.3",
45
+ "ethers": "^5.6.2",
49
46
  "express": "^4.17.1",
50
47
  "husky": "^4.3.0",
51
48
  "jest": "^27.5.1",
52
49
  "jest-dev-server": "^6.0.3",
53
- "just-omit": "^1.2.0",
54
- "lint-staged": "^12.3.4",
50
+ "just-omit": "^2.0.1",
51
+ "lint-staged": "^12.3.7",
55
52
  "npm-run-all": "^4.1.5",
56
- "prettier": "^2.5.1",
53
+ "prettier": "^2.6.2",
57
54
  "prettier-plugin-organize-imports": "^2.3.4",
58
- "supertest": "^6.1.6",
59
- "ts-jest": "^27.1.3",
55
+ "ts-jest": "^27.1.4",
60
56
  "ts-node": "^10.2.1",
61
- "typedoc": "^0.22.12",
62
- "typescript": "^4.6.2",
57
+ "typedoc": "^0.22.13",
58
+ "typescript": "^4.6.3",
63
59
  "web3": "^1.7.1"
64
60
  },
65
61
  "dependencies": {
@@ -70,7 +66,7 @@
70
66
  },
71
67
  "husky": {
72
68
  "hooks": {
73
- "pre-commit": "lint-staged && run-p pre-commit test build:website build:chains-info"
69
+ "pre-commit": "lint-staged && run-p pre-commit test build:chains-info"
74
70
  }
75
71
  },
76
72
  "lint-staged": {
package/readme.md CHANGED
@@ -1,19 +1,18 @@
1
1
  <p align="center">
2
- <a><img src="https://blog.ethereum.org/img/2018/08/grants_eth_logo.png" title="Logo" height="400"/></a>
2
+ <a><img src="https://user-images.githubusercontent.com/3408480/161474132-ae95d289-2298-46f1-b48d-9c02d88f7e38.png" title="Logo" height="400" /></a>
3
3
  </p>
4
4
  <p align="center">
5
5
  <b>
6
6
  Essential Eth
7
7
  </b>
8
- <br>
9
- <i>Ultralight Ethereum utilities for JS and TS</i>
10
- <br>
8
+ <br/>
9
+ <i>A replacement for ethers & web3 that's 50x smaller</i>
10
+ <br/>
11
11
  </p>
12
12
 
13
13
  ---
14
14
 
15
-
16
- <br>
15
+ <br/>
17
16
 
18
17
  ## Why you should replace Ethers.js and web3
19
18
 
@@ -27,7 +26,7 @@
27
26
 
28
27
  ---
29
28
 
30
- <br>
29
+ <br/>
31
30
 
32
31
  - ⚡️ A replacement for `web3` and `ethers`
33
32
  - 🏎 [The TINIEST code size possible](https://bundlephobia.com/package/essential-eth)
@@ -35,7 +34,7 @@
35
34
  - 🧪 Tested to match both `web3` and `ethers`
36
35
  - 🌲 Tree-shaking and no side-effects
37
36
  - 🙌 Supports multiple JS versions (CommonJS and ESM)
38
- - ✅ Node 16, 14, 12, & 10
37
+ - ✅ Node 17, 16, 14, & 12
39
38
  - ✅ Web
40
39
 
41
40
  <br/>
@@ -189,12 +188,38 @@ const essentialEth = new JsonRpcProvider(
189
188
  const essentialEth = new JsonRpcProvider();
190
189
  ```
191
190
 
191
+ #### `getGasPrice`
192
+
193
+ Returns the current gas price in gwei
194
+
195
+ ```typescript
196
+ // Same as ethers.providers.getGasPrice
197
+ getGasPrice(): Promise<TinyBig>
198
+ ```
199
+
200
+ <details>
201
+ <summary>View Example</summary>
202
+
203
+ ```typescript
204
+ import { JsonRpcProvider } from 'essential-eth';
205
+
206
+ const provider = new JsonRpcProvider('https://free-eth-node.com/api/eth');
207
+ provider.getGasPrice().toNumber();
208
+ /*
209
+ 39695942769
210
+ */
211
+ ```
212
+
213
+ </details>
214
+
215
+ <br/>
216
+
192
217
  #### `getNetwork`
193
218
 
194
- Returns a [Network](src/types/Network.types.ts)
219
+ Returns a Network
195
220
 
196
221
  ```typescript
197
- // Same API as ethers getNetwork
222
+ // Same API as ethers.providers.getNetwork
198
223
  getNetwork(): Promise<Network>
199
224
  ```
200
225
 
@@ -225,7 +250,7 @@ xdaiProvider.getNetwork();
225
250
 
226
251
  #### `getBlock`
227
252
 
228
- Returns a [Block](src/types/Block.types.ts)
253
+ Returns a Block
229
254
 
230
255
  ```typescript
231
256
  // Same API as web3.eth.getBlock