essential-eth 0.5.11-next.1 → 0.5.12
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/lib/cjs/classes/Contract.d.ts +78 -0
- package/lib/cjs/classes/Contract.js +140 -0
- package/{dist → lib/cjs}/classes/test/Contract/crv-abi.d.ts +2 -2
- package/lib/cjs/classes/test/Contract/crv-abi.js +488 -0
- package/{dist → lib/cjs}/classes/test/Contract/ens-abi.d.ts +2 -2
- package/lib/cjs/classes/test/Contract/ens-abi.js +453 -0
- package/{dist → lib/cjs}/classes/test/Contract/fei-abi.d.ts +2 -2
- package/lib/cjs/classes/test/Contract/fei-abi.js +526 -0
- package/{dist → lib/cjs}/classes/test/Contract/foo-abi.d.ts +2 -2
- package/lib/cjs/classes/test/Contract/foo-abi.js +42 -0
- package/{dist → lib/cjs}/classes/test/Contract/uniswap-abi.d.ts +2 -2
- package/lib/cjs/classes/test/Contract/uniswap-abi.js +121 -0
- package/lib/cjs/classes/utils/clean-block.d.ts +121 -0
- package/lib/cjs/classes/utils/clean-block.js +160 -0
- package/lib/cjs/classes/utils/clean-log.d.ts +9 -0
- package/lib/cjs/classes/utils/clean-log.js +37 -0
- package/lib/cjs/classes/utils/clean-transaction-receipt.d.ts +14 -0
- package/lib/cjs/classes/utils/clean-transaction-receipt.js +50 -0
- package/lib/cjs/classes/utils/clean-transaction.d.ts +14 -0
- package/lib/cjs/classes/utils/clean-transaction.js +51 -0
- package/lib/cjs/classes/utils/encode-decode-transaction.d.ts +16 -0
- package/lib/cjs/classes/utils/encode-decode-transaction.js +137 -0
- package/lib/cjs/classes/utils/fetchers.d.ts +39 -0
- package/lib/cjs/classes/utils/fetchers.js +81 -0
- package/lib/cjs/classes/utils/hex-to-decimal.d.ts +18 -0
- package/lib/cjs/classes/utils/hex-to-decimal.js +24 -0
- package/lib/cjs/classes/utils/prepare-transaction.d.ts +6 -0
- package/lib/cjs/classes/utils/prepare-transaction.js +45 -0
- package/{dist → lib/cjs}/index.d.ts +25 -25
- package/lib/cjs/index.js +54 -0
- package/{dist → lib/cjs}/logger/logger.d.ts +11 -11
- package/lib/cjs/logger/logger.js +36 -0
- package/lib/cjs/logger/package-version.d.ts +1 -0
- package/lib/cjs/logger/package-version.js +5 -0
- package/lib/cjs/providers/BaseProvider.d.ts +353 -0
- package/lib/cjs/providers/BaseProvider.js +512 -0
- package/lib/cjs/providers/FallthroughProvider.d.ts +24 -0
- package/lib/cjs/providers/FallthroughProvider.js +65 -0
- package/lib/cjs/providers/JsonRpcProvider.d.ts +33 -0
- package/lib/cjs/providers/JsonRpcProvider.js +46 -0
- package/{dist → lib/cjs}/providers/test/rpc-urls.d.ts +11 -11
- package/lib/cjs/providers/test/rpc-urls.js +14 -0
- package/{dist → lib/cjs}/providers/utils/chains-info.d.ts +467 -467
- package/lib/cjs/providers/utils/chains-info.js +1402 -0
- package/lib/cjs/shared/tiny-big/helpers.d.ts +17 -0
- package/lib/cjs/shared/tiny-big/helpers.js +97 -0
- package/lib/cjs/shared/tiny-big/tiny-big.d.ts +58 -0
- package/lib/cjs/shared/tiny-big/tiny-big.js +101 -0
- package/{dist → lib/cjs}/shared/validate-type.d.ts +3 -3
- package/lib/cjs/shared/validate-type.js +9 -0
- package/{dist → lib/cjs}/types/Block.types.d.ts +41 -40
- package/lib/cjs/types/Block.types.js +2 -0
- package/{dist → lib/cjs}/types/Contract.types.d.ts +24 -24
- package/lib/cjs/types/Contract.types.js +2 -0
- package/lib/cjs/types/Filter.types.d.ts +16 -0
- package/lib/cjs/types/Filter.types.js +2 -0
- package/lib/cjs/types/Network.types.d.ts +8 -0
- package/lib/cjs/types/Network.types.js +2 -0
- package/lib/cjs/types/Transaction.types.d.ts +123 -0
- package/lib/cjs/types/Transaction.types.js +2 -0
- package/lib/cjs/utils/bytes.d.ts +289 -0
- package/lib/cjs/utils/bytes.js +711 -0
- package/lib/cjs/utils/compute-address.d.ts +17 -0
- package/lib/cjs/utils/compute-address.js +33 -0
- package/lib/cjs/utils/compute-public-key.d.ts +18 -0
- package/lib/cjs/utils/compute-public-key.js +26 -0
- package/lib/cjs/utils/ether-to-gwei.d.ts +27 -0
- package/lib/cjs/utils/ether-to-gwei.js +35 -0
- package/lib/cjs/utils/ether-to-wei.d.ts +27 -0
- package/lib/cjs/utils/ether-to-wei.js +35 -0
- package/lib/cjs/utils/gwei-to-ether.d.ts +27 -0
- package/lib/cjs/utils/gwei-to-ether.js +35 -0
- package/lib/cjs/utils/hash-message.d.ts +14 -0
- package/lib/cjs/utils/hash-message.js +28 -0
- package/lib/cjs/utils/is-address.d.ts +24 -0
- package/lib/cjs/utils/is-address.js +39 -0
- package/lib/cjs/utils/keccak256.d.ts +16 -0
- package/lib/cjs/utils/keccak256.js +31 -0
- package/lib/cjs/utils/solidity-keccak256.d.ts +39 -0
- package/lib/cjs/utils/solidity-keccak256.js +138 -0
- package/lib/cjs/utils/split-signature.d.ts +24 -0
- package/lib/cjs/utils/split-signature.js +163 -0
- package/lib/cjs/utils/to-checksum-address.d.ts +17 -0
- package/lib/cjs/utils/to-checksum-address.js +46 -0
- package/lib/cjs/utils/to-utf8-bytes.d.ts +15 -0
- package/lib/cjs/utils/to-utf8-bytes.js +21 -0
- package/lib/cjs/utils/wei-to-ether.d.ts +27 -0
- package/lib/cjs/utils/wei-to-ether.js +45 -0
- package/{dist → lib/esm}/classes/Contract.d.ts +11 -11
- package/lib/esm/classes/Contract.js +65 -0
- package/lib/esm/classes/test/Contract/crv-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/crv-abi.js +470 -0
- package/lib/esm/classes/test/Contract/ens-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/ens-abi.js +435 -0
- package/lib/esm/classes/test/Contract/fei-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/fei-abi.js +521 -0
- package/lib/esm/classes/test/Contract/foo-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/foo-abi.js +33 -0
- package/lib/esm/classes/test/Contract/uniswap-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/uniswap-abi.js +116 -0
- package/{dist → lib/esm}/classes/utils/clean-block.d.ts +3 -3
- package/lib/esm/classes/utils/clean-block.js +35 -0
- package/{dist → lib/esm}/classes/utils/clean-log.d.ts +2 -2
- package/lib/esm/classes/utils/clean-log.js +26 -0
- package/{dist → lib/esm}/classes/utils/clean-transaction-receipt.d.ts +2 -2
- package/lib/esm/classes/utils/clean-transaction-receipt.js +34 -0
- package/{dist → lib/esm}/classes/utils/clean-transaction.d.ts +2 -2
- package/lib/esm/classes/utils/clean-transaction.js +33 -0
- package/{dist → lib/esm}/classes/utils/encode-decode-transaction.d.ts +4 -4
- package/lib/esm/classes/utils/encode-decode-transaction.js +98 -0
- package/{dist → lib/esm}/classes/utils/fetchers.d.ts +9 -9
- package/lib/esm/classes/utils/fetchers.js +43 -0
- package/{dist → lib/esm}/classes/utils/hex-to-decimal.d.ts +1 -1
- package/lib/esm/classes/utils/hex-to-decimal.js +3 -0
- package/{dist → lib/esm}/classes/utils/prepare-transaction.d.ts +2 -2
- package/lib/esm/classes/utils/prepare-transaction.js +34 -0
- package/lib/esm/index.d.ts +25 -0
- package/lib/esm/index.js +20 -0
- package/lib/esm/logger/logger.d.ts +11 -0
- package/lib/esm/logger/logger.js +33 -0
- package/lib/esm/logger/package-version.d.ts +1 -0
- package/lib/esm/logger/package-version.js +1 -0
- package/{dist → lib/esm}/providers/BaseProvider.d.ts +24 -24
- package/lib/esm/providers/BaseProvider.js +157 -0
- package/{dist → lib/esm}/providers/FallthroughProvider.d.ts +11 -11
- package/lib/esm/providers/FallthroughProvider.js +41 -0
- package/{dist → lib/esm}/providers/JsonRpcProvider.d.ts +7 -7
- package/lib/esm/providers/JsonRpcProvider.js +15 -0
- package/lib/esm/providers/test/rpc-urls.d.ts +11 -0
- package/lib/esm/providers/test/rpc-urls.js +11 -0
- package/lib/esm/providers/utils/chains-info.d.ts +467 -0
- package/lib/esm/providers/utils/chains-info.js +1398 -0
- package/{dist → lib/esm}/shared/tiny-big/helpers.d.ts +1 -1
- package/lib/esm/shared/tiny-big/helpers.js +58 -0
- package/{dist → lib/esm}/shared/tiny-big/tiny-big.d.ts +10 -10
- package/lib/esm/shared/tiny-big/tiny-big.js +45 -0
- package/lib/esm/shared/validate-type.d.ts +3 -0
- package/lib/esm/shared/validate-type.js +5 -0
- package/lib/esm/types/Block.types.d.ts +40 -0
- package/lib/esm/types/Block.types.js +1 -0
- package/lib/esm/types/Contract.types.d.ts +24 -0
- package/lib/esm/types/Contract.types.js +1 -0
- package/{dist → lib/esm}/types/Filter.types.d.ts +12 -12
- package/lib/esm/types/Filter.types.js +1 -0
- package/{dist → lib/esm}/types/Network.types.d.ts +5 -5
- package/lib/esm/types/Network.types.js +1 -0
- package/{dist → lib/esm}/types/Transaction.types.d.ts +113 -113
- package/lib/esm/types/Transaction.types.js +1 -0
- package/{dist → lib/esm}/utils/bytes.d.ts +40 -40
- package/lib/esm/utils/bytes.js +245 -0
- package/{dist → lib/esm}/utils/compute-address.d.ts +1 -1
- package/lib/esm/utils/compute-address.js +11 -0
- package/{dist → lib/esm}/utils/compute-public-key.d.ts +2 -2
- package/lib/esm/utils/compute-public-key.js +6 -0
- package/{dist → lib/esm}/utils/ether-to-gwei.d.ts +3 -3
- package/lib/esm/utils/ether-to-gwei.js +7 -0
- package/{dist → lib/esm}/utils/ether-to-wei.d.ts +3 -3
- package/lib/esm/utils/ether-to-wei.js +7 -0
- package/{dist → lib/esm}/utils/gwei-to-ether.d.ts +3 -3
- package/lib/esm/utils/gwei-to-ether.js +7 -0
- package/{dist → lib/esm}/utils/hash-message.d.ts +2 -2
- package/lib/esm/utils/hash-message.js +12 -0
- package/{dist → lib/esm}/utils/is-address.d.ts +1 -1
- package/lib/esm/utils/is-address.js +12 -0
- package/{dist → lib/esm}/utils/keccak256.d.ts +2 -2
- package/lib/esm/utils/keccak256.js +13 -0
- package/{dist → lib/esm}/utils/solidity-keccak256.d.ts +2 -2
- package/lib/esm/utils/solidity-keccak256.js +85 -0
- package/{dist → lib/esm}/utils/split-signature.d.ts +2 -2
- package/lib/esm/utils/split-signature.js +126 -0
- package/{dist → lib/esm}/utils/to-checksum-address.d.ts +1 -1
- package/lib/esm/utils/to-checksum-address.js +25 -0
- package/{dist → lib/esm}/utils/to-utf8-bytes.d.ts +1 -1
- package/lib/esm/utils/to-utf8-bytes.js +3 -0
- package/{dist → lib/esm}/utils/wei-to-ether.d.ts +3 -3
- package/lib/esm/utils/wei-to-ether.js +16 -0
- package/package.json +14 -26
- package/readme.md +51 -66
- package/dist/index.js +0 -1904
- package/dist/index.js.map +0 -1
- package/dist/index.module.js +0 -1865
- package/dist/index.module.js.map +0 -1
- package/dist/index.umd.js +0 -2
- package/dist/index.umd.js.map +0 -1
- package/dist/logger/package-version.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "essential-eth",
|
|
3
3
|
"description": "Ultralight JS for Ethereum",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.12",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"amdName": "essentialEth",
|
|
10
|
-
"main": "./dist/index.js",
|
|
11
|
-
"module": "./dist/index.module.js",
|
|
12
|
-
"umd:main": "./dist/index.umd.js",
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
7
|
+
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
14
9
|
"files": [
|
|
15
|
-
"
|
|
10
|
+
"lib/"
|
|
16
11
|
],
|
|
17
12
|
"bugs": {
|
|
18
13
|
"url": "https://github.com/dawsbot/essential-eth/issues"
|
|
@@ -24,29 +19,30 @@
|
|
|
24
19
|
"name": "etherToWei",
|
|
25
20
|
"path": "src/index.ts",
|
|
26
21
|
"import": "{ etherToWei }",
|
|
27
|
-
"limit": "3.
|
|
22
|
+
"limit": "3.9kb"
|
|
28
23
|
},
|
|
29
24
|
{
|
|
30
25
|
"name": "JsonRpcProvider",
|
|
31
26
|
"path": "src/index.ts",
|
|
32
27
|
"import": "{ JsonRpcProvider }",
|
|
33
|
-
"limit": "
|
|
28
|
+
"limit": "22kb"
|
|
34
29
|
},
|
|
35
30
|
{
|
|
36
31
|
"name": "Contract",
|
|
37
32
|
"path": "src/index.ts",
|
|
38
33
|
"import": "{ Contract }",
|
|
39
|
-
"limit": "
|
|
34
|
+
"limit": "18kb"
|
|
40
35
|
}
|
|
41
36
|
],
|
|
42
37
|
"scripts": {
|
|
43
38
|
"size": "size-limit",
|
|
44
|
-
"test": "npm-run-all --parallel jest
|
|
39
|
+
"test": "npm-run-all --parallel jest compile lint",
|
|
45
40
|
"test:all-node-versions": "npx trevor",
|
|
46
41
|
"lint": "eslint --cache --fix .",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
42
|
+
"compile": "npm-run-all --parallel tsc:esm tsc:cjs",
|
|
43
|
+
"tsc:esm": "tsc -p tsconfig.json",
|
|
44
|
+
"tsc:cjs": "tsc -p tsconfig-cjs.json",
|
|
45
|
+
"build": "rm -rf lib && npm run compile",
|
|
50
46
|
"build:readme": "bash ./scripts/markdown-magic/build-readme.sh",
|
|
51
47
|
"jest": "jest",
|
|
52
48
|
"build:chains-info": "npx ts-node scripts/fetch-chains-info.ts # used in getNetwork()",
|
|
@@ -81,7 +77,6 @@
|
|
|
81
77
|
"jest-dev-server": "^6.0.3",
|
|
82
78
|
"just-omit": "^2.0.1",
|
|
83
79
|
"lint-staged": "^12.4.1",
|
|
84
|
-
"microbundle": "^0.15.0",
|
|
85
80
|
"npm-run-all": "^4.1.5",
|
|
86
81
|
"perf_hooks": "^0.0.1",
|
|
87
82
|
"prettier": "^2.7.1",
|
|
@@ -90,7 +85,7 @@
|
|
|
90
85
|
"ts-jest": "^27.1.4",
|
|
91
86
|
"ts-node": "^10.2.1",
|
|
92
87
|
"typedoc": "^0.22.15",
|
|
93
|
-
"typescript": "^4.
|
|
88
|
+
"typescript": "^4.6.4",
|
|
94
89
|
"web3": "^1.7.5"
|
|
95
90
|
},
|
|
96
91
|
"dependencies": {
|
|
@@ -110,12 +105,5 @@
|
|
|
110
105
|
"trailingComma": "all",
|
|
111
106
|
"tabWidth": 2,
|
|
112
107
|
"singleQuote": true
|
|
113
|
-
}
|
|
114
|
-
"keywords": [
|
|
115
|
-
"ethereum",
|
|
116
|
-
"polygon",
|
|
117
|
-
"evm",
|
|
118
|
-
"web-performance",
|
|
119
|
-
"tiny"
|
|
120
|
-
]
|
|
108
|
+
}
|
|
121
109
|
}
|
package/readme.md
CHANGED
|
@@ -26,20 +26,12 @@
|
|
|
26
26
|
|
|
27
27
|
<br/>
|
|
28
28
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- 🧪
|
|
32
|
-
|
|
33
|
-
- ⚡️ Similar but improved API to `web3`
|
|
34
|
-
- 🙌 Works for all EVM chains
|
|
35
|
-
- 💎 Ethereum
|
|
36
|
-
- 🟣 Polygon
|
|
37
|
-
- 🔴 Optimism
|
|
38
|
-
- 🔵 Arbitrum
|
|
39
|
-
- [Many more](src/providers/utils/chains-info.ts)
|
|
40
|
-
- 🧪 Strongly tested
|
|
29
|
+
- 🏆️ <sub><sup>[smallest code size possible](https://bundlephobia.com/package/essential-eth)</sup></sub>
|
|
30
|
+
- ʦ Fully typed with TypeScript (also works with JavaScript)
|
|
31
|
+
- 🧪 Tested to match both `web3` and `ethers`
|
|
32
|
+
- - ⚡️ Near-identical API to `ethers`
|
|
41
33
|
- 🌲 Tree-shaking and no side-effects
|
|
42
|
-
- 🙌
|
|
34
|
+
- 🙌 Supports multiple JS versions (CommonJS and ESM)
|
|
43
35
|
- ✅ Node 18, 16, 14, & 12
|
|
44
36
|
- ✅ Web
|
|
45
37
|
|
|
@@ -112,17 +104,10 @@
|
|
|
112
104
|
## Install
|
|
113
105
|
|
|
114
106
|
```sh
|
|
115
|
-
npm install --save essential-eth # TypeScript
|
|
107
|
+
npm install --save essential-eth # TypeScript types load automatically
|
|
116
108
|
|
|
117
109
|
# or yarn
|
|
118
|
-
yarn add essential-eth # TypeScript
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Browsers:
|
|
122
|
-
|
|
123
|
-
```html
|
|
124
|
-
<!-- index.html -->
|
|
125
|
-
<script src="https://unpkg.com/essential-eth@0.5.10"></script>
|
|
110
|
+
yarn add essential-eth # TypeScript types load automatically
|
|
126
111
|
```
|
|
127
112
|
|
|
128
113
|
<br/>
|
|
@@ -138,7 +123,7 @@ const { etherToWei } = require('essential-eth');
|
|
|
138
123
|
|
|
139
124
|
<!-- ⛔️ AUTO-GENERATED-CONTENT:START (FUNCTIONS) -->
|
|
140
125
|
|
|
141
|
-
#### [`arrayify`](https://
|
|
126
|
+
#### [`arrayify`](https://essential-eth.vercel.app/docs/api/modules#arrayify)
|
|
142
127
|
|
|
143
128
|
```typescript
|
|
144
129
|
arrayify(value: number | BytesLike | Hexable, options: DataOptions): Uint8Array
|
|
@@ -170,7 +155,7 @@ arrayify('0x1', { hexPad: 'right' });
|
|
|
170
155
|
|
|
171
156
|
<br/>
|
|
172
157
|
|
|
173
|
-
#### [`computeAddress`](https://
|
|
158
|
+
#### [`computeAddress`](https://essential-eth.vercel.app/docs/api/modules#computeaddress)
|
|
174
159
|
|
|
175
160
|
```typescript
|
|
176
161
|
computeAddress(key: string): string
|
|
@@ -201,7 +186,7 @@ computeAddress(
|
|
|
201
186
|
|
|
202
187
|
<br/>
|
|
203
188
|
|
|
204
|
-
#### [`computePublicKey`](https://
|
|
189
|
+
#### [`computePublicKey`](https://essential-eth.vercel.app/docs/api/modules#computepublickey)
|
|
205
190
|
|
|
206
191
|
```typescript
|
|
207
192
|
computePublicKey(privKey: BytesLike): string
|
|
@@ -233,7 +218,7 @@ computePublicKey([
|
|
|
233
218
|
|
|
234
219
|
<br/>
|
|
235
220
|
|
|
236
|
-
#### [`concat`](https://
|
|
221
|
+
#### [`concat`](https://essential-eth.vercel.app/docs/api/modules#concat)
|
|
237
222
|
|
|
238
223
|
```typescript
|
|
239
224
|
concat(arrayOfBytesLike: Array<BytesLikeWithNumber>): Uint8Array
|
|
@@ -255,7 +240,7 @@ concat([0, 1]);
|
|
|
255
240
|
|
|
256
241
|
<br/>
|
|
257
242
|
|
|
258
|
-
#### [`etherToGwei`](https://
|
|
243
|
+
#### [`etherToGwei`](https://essential-eth.vercel.app/docs/api/modules#ethertogwei)
|
|
259
244
|
|
|
260
245
|
```typescript
|
|
261
246
|
etherToGwei(etherQuantity: string | number | TinyBig | Big): TinyBig
|
|
@@ -286,7 +271,7 @@ etherToGwei(1000).toNumber();
|
|
|
286
271
|
|
|
287
272
|
<br/>
|
|
288
273
|
|
|
289
|
-
#### [`etherToWei`](https://
|
|
274
|
+
#### [`etherToWei`](https://essential-eth.vercel.app/docs/api/modules#ethertowei)
|
|
290
275
|
|
|
291
276
|
```typescript
|
|
292
277
|
etherToWei(etherQuantity: string | number | TinyBig | Big): TinyBig
|
|
@@ -317,7 +302,7 @@ etherToWei(1000).toNumber();
|
|
|
317
302
|
|
|
318
303
|
<br/>
|
|
319
304
|
|
|
320
|
-
#### [`gweiToEther`](https://
|
|
305
|
+
#### [`gweiToEther`](https://essential-eth.vercel.app/docs/api/modules#gweitoether)
|
|
321
306
|
|
|
322
307
|
```typescript
|
|
323
308
|
gweiToEther(gweiQuantity: string | number | TinyBig | Big): TinyBig
|
|
@@ -348,7 +333,7 @@ gweiToEther(1000000000000).toNumber();
|
|
|
348
333
|
|
|
349
334
|
<br/>
|
|
350
335
|
|
|
351
|
-
#### [`hashMessage`](https://
|
|
336
|
+
#### [`hashMessage`](https://essential-eth.vercel.app/docs/api/modules#hashmessage)
|
|
352
337
|
|
|
353
338
|
```typescript
|
|
354
339
|
hashMessage(message: string | Bytes): string
|
|
@@ -370,7 +355,7 @@ hashMessage('Hello World');
|
|
|
370
355
|
|
|
371
356
|
<br/>
|
|
372
357
|
|
|
373
|
-
#### [`hexConcat`](https://
|
|
358
|
+
#### [`hexConcat`](https://essential-eth.vercel.app/docs/api/modules#hexconcat)
|
|
374
359
|
|
|
375
360
|
```typescript
|
|
376
361
|
hexConcat(items: Array<BytesLike>): string
|
|
@@ -392,7 +377,7 @@ hexConcat([[2, 4, 0, 1], 9, '0x2934', '0x3947']);
|
|
|
392
377
|
|
|
393
378
|
<br/>
|
|
394
379
|
|
|
395
|
-
#### [`hexDataLength`](https://
|
|
380
|
+
#### [`hexDataLength`](https://essential-eth.vercel.app/docs/api/modules#hexdatalength)
|
|
396
381
|
|
|
397
382
|
```typescript
|
|
398
383
|
hexDataLength(data: BytesLike): undefined
|
|
@@ -419,7 +404,7 @@ hexDataLength('0x3925');
|
|
|
419
404
|
|
|
420
405
|
<br/>
|
|
421
406
|
|
|
422
|
-
#### [`hexDataSlice`](https://
|
|
407
|
+
#### [`hexDataSlice`](https://essential-eth.vercel.app/docs/api/modules#hexdataslice)
|
|
423
408
|
|
|
424
409
|
```typescript
|
|
425
410
|
hexDataSlice(data: BytesLikeWithNumber, offset: number, endOffset: number): string
|
|
@@ -441,7 +426,7 @@ hexDataSlice([20, 6, 48], 0, 2);
|
|
|
441
426
|
|
|
442
427
|
<br/>
|
|
443
428
|
|
|
444
|
-
#### [`hexStripZeros`](https://
|
|
429
|
+
#### [`hexStripZeros`](https://essential-eth.vercel.app/docs/api/modules#hexstripzeros)
|
|
445
430
|
|
|
446
431
|
```typescript
|
|
447
432
|
hexStripZeros(value: BytesLike): string
|
|
@@ -463,7 +448,7 @@ hexStripZeros([0, 0, 0, 48]);
|
|
|
463
448
|
|
|
464
449
|
<br/>
|
|
465
450
|
|
|
466
|
-
#### [`hexValue`](https://
|
|
451
|
+
#### [`hexValue`](https://essential-eth.vercel.app/docs/api/modules#hexvalue)
|
|
467
452
|
|
|
468
453
|
```typescript
|
|
469
454
|
hexValue(value: number | bigint | BytesLike | Hexable): string
|
|
@@ -490,7 +475,7 @@ hexValue([9, 4, 19, 4]);
|
|
|
490
475
|
|
|
491
476
|
<br/>
|
|
492
477
|
|
|
493
|
-
#### [`hexZeroPad`](https://
|
|
478
|
+
#### [`hexZeroPad`](https://essential-eth.vercel.app/docs/api/modules#hexzeropad)
|
|
494
479
|
|
|
495
480
|
```typescript
|
|
496
481
|
hexZeroPad(value: BytesLikeWithNumber, length: number): string
|
|
@@ -522,7 +507,7 @@ hexZeroPad('12345', 1);
|
|
|
522
507
|
|
|
523
508
|
<br/>
|
|
524
509
|
|
|
525
|
-
#### [`hexlify`](https://
|
|
510
|
+
#### [`hexlify`](https://essential-eth.vercel.app/docs/api/modules#hexlify)
|
|
526
511
|
|
|
527
512
|
```typescript
|
|
528
513
|
hexlify(value: number | bigint | BytesLike | Hexable, options: DataOptions): string
|
|
@@ -549,7 +534,7 @@ hexlify(14);
|
|
|
549
534
|
|
|
550
535
|
<br/>
|
|
551
536
|
|
|
552
|
-
#### [`isAddress`](https://
|
|
537
|
+
#### [`isAddress`](https://essential-eth.vercel.app/docs/api/modules#isaddress)
|
|
553
538
|
|
|
554
539
|
```typescript
|
|
555
540
|
isAddress(address: string): boolean
|
|
@@ -582,7 +567,7 @@ isAddress('vitalik.eth');
|
|
|
582
567
|
|
|
583
568
|
<br/>
|
|
584
569
|
|
|
585
|
-
#### [`isBytes`](https://
|
|
570
|
+
#### [`isBytes`](https://essential-eth.vercel.app/docs/api/modules#isbytes)
|
|
586
571
|
|
|
587
572
|
```typescript
|
|
588
573
|
isBytes(value: any): value
|
|
@@ -614,7 +599,7 @@ isBytes(new Uint8Array(1));
|
|
|
614
599
|
|
|
615
600
|
<br/>
|
|
616
601
|
|
|
617
|
-
#### [`isBytesLike`](https://
|
|
602
|
+
#### [`isBytesLike`](https://essential-eth.vercel.app/docs/api/modules#isbyteslike)
|
|
618
603
|
|
|
619
604
|
```typescript
|
|
620
605
|
isBytesLike(value: any): value
|
|
@@ -646,7 +631,7 @@ isBytesLike(new Uint8Array(1));
|
|
|
646
631
|
|
|
647
632
|
<br/>
|
|
648
633
|
|
|
649
|
-
#### [`isHexString`](https://
|
|
634
|
+
#### [`isHexString`](https://essential-eth.vercel.app/docs/api/modules#ishexstring)
|
|
650
635
|
|
|
651
636
|
```typescript
|
|
652
637
|
isHexString(value: any, length: number): boolean
|
|
@@ -674,7 +659,7 @@ isHexString('0x4924', 4);
|
|
|
674
659
|
|
|
675
660
|
<br/>
|
|
676
661
|
|
|
677
|
-
#### [`jsonRpcProvider`](https://
|
|
662
|
+
#### [`jsonRpcProvider`](https://essential-eth.vercel.app/docs/api/modules#jsonrpcprovider)
|
|
678
663
|
|
|
679
664
|
```typescript
|
|
680
665
|
jsonRpcProvider(rpcUrl: string): JsonRpcProvider
|
|
@@ -700,7 +685,7 @@ jsonRpcProvider()
|
|
|
700
685
|
|
|
701
686
|
<br/>
|
|
702
687
|
|
|
703
|
-
#### [`keccak256`](https://
|
|
688
|
+
#### [`keccak256`](https://essential-eth.vercel.app/docs/api/modules#keccak256)
|
|
704
689
|
|
|
705
690
|
```typescript
|
|
706
691
|
keccak256(data: BytesLike): string
|
|
@@ -725,7 +710,7 @@ keccak256('0x123');
|
|
|
725
710
|
|
|
726
711
|
<br/>
|
|
727
712
|
|
|
728
|
-
#### [`pack`](https://
|
|
713
|
+
#### [`pack`](https://essential-eth.vercel.app/docs/api/modules#pack)
|
|
729
714
|
|
|
730
715
|
```typescript
|
|
731
716
|
pack(types: Array<string>, values: Array<any>): string
|
|
@@ -749,7 +734,7 @@ pack(types, values);
|
|
|
749
734
|
|
|
750
735
|
<br/>
|
|
751
736
|
|
|
752
|
-
#### [`solidityKeccak256`](https://
|
|
737
|
+
#### [`solidityKeccak256`](https://essential-eth.vercel.app/docs/api/modules#soliditykeccak256)
|
|
753
738
|
|
|
754
739
|
```typescript
|
|
755
740
|
solidityKeccak256(types: Array<string>, values: Array<any>): string
|
|
@@ -783,7 +768,7 @@ solidityKeccak256(types, values);
|
|
|
783
768
|
|
|
784
769
|
<br/>
|
|
785
770
|
|
|
786
|
-
#### [`splitSignature`](https://
|
|
771
|
+
#### [`splitSignature`](https://essential-eth.vercel.app/docs/api/modules#splitsignature)
|
|
787
772
|
|
|
788
773
|
```typescript
|
|
789
774
|
splitSignature(signature: SignatureLike): Signature
|
|
@@ -814,7 +799,7 @@ splitSignature(signature);
|
|
|
814
799
|
|
|
815
800
|
<br/>
|
|
816
801
|
|
|
817
|
-
#### [`stripZeros`](https://
|
|
802
|
+
#### [`stripZeros`](https://essential-eth.vercel.app/docs/api/modules#stripzeros)
|
|
818
803
|
|
|
819
804
|
```typescript
|
|
820
805
|
stripZeros(value: BytesLike): Uint8Array
|
|
@@ -837,7 +822,7 @@ stripZeros('0x00002834');
|
|
|
837
822
|
|
|
838
823
|
<br/>
|
|
839
824
|
|
|
840
|
-
#### [`tinyBig`](https://
|
|
825
|
+
#### [`tinyBig`](https://essential-eth.vercel.app/docs/api/modules#tinybig)
|
|
841
826
|
|
|
842
827
|
```typescript
|
|
843
828
|
tinyBig(value: string | number | TinyBig | Big): TinyBig
|
|
@@ -859,7 +844,7 @@ tinyBig(10).times(3).toNumber();
|
|
|
859
844
|
|
|
860
845
|
<br/>
|
|
861
846
|
|
|
862
|
-
#### [`toChecksumAddress`](https://
|
|
847
|
+
#### [`toChecksumAddress`](https://essential-eth.vercel.app/docs/api/modules#tochecksumaddress)
|
|
863
848
|
|
|
864
849
|
```typescript
|
|
865
850
|
toChecksumAddress(address: string): string
|
|
@@ -885,7 +870,7 @@ Similar to ["toChecksumAddress" in web3.js](https://web3js.readthedocs.io/en/v1.
|
|
|
885
870
|
|
|
886
871
|
<br/>
|
|
887
872
|
|
|
888
|
-
#### [`toUtf8Bytes`](https://
|
|
873
|
+
#### [`toUtf8Bytes`](https://essential-eth.vercel.app/docs/api/modules#toutf8bytes)
|
|
889
874
|
|
|
890
875
|
```typescript
|
|
891
876
|
toUtf8Bytes(data: string): Uint8Array
|
|
@@ -910,7 +895,7 @@ toUtf8Bytes('ethereum');
|
|
|
910
895
|
|
|
911
896
|
<br/>
|
|
912
897
|
|
|
913
|
-
#### [`weiToEther`](https://
|
|
898
|
+
#### [`weiToEther`](https://essential-eth.vercel.app/docs/api/modules#weitoether)
|
|
914
899
|
|
|
915
900
|
```typescript
|
|
916
901
|
weiToEther(weiQuantity: string | number | TinyBig | Big): TinyBig
|
|
@@ -941,7 +926,7 @@ weiToEther(1000000000000000000000).toNumber();
|
|
|
941
926
|
|
|
942
927
|
<br/>
|
|
943
928
|
|
|
944
|
-
#### [`zeroPad`](https://
|
|
929
|
+
#### [`zeroPad`](https://essential-eth.vercel.app/docs/api/modules#zeropad)
|
|
945
930
|
|
|
946
931
|
```typescript
|
|
947
932
|
zeroPad(value: BytesLike, length: number): Uint8Array
|
|
@@ -1010,7 +995,7 @@ provider.getGasPrice().toNumber();
|
|
|
1010
995
|
|
|
1011
996
|
<!-- ⛔️ AUTO-GENERATED-CONTENT:START (PROVIDER) -->
|
|
1012
997
|
|
|
1013
|
-
#### [`call`](https://
|
|
998
|
+
#### [`call`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#call)
|
|
1014
999
|
|
|
1015
1000
|
```typescript
|
|
1016
1001
|
provider.call(transaction: TransactionRequest, blockTag?: BlockTag): Promise<string>
|
|
@@ -1036,7 +1021,7 @@ await provider.call({
|
|
|
1036
1021
|
|
|
1037
1022
|
<br/>
|
|
1038
1023
|
|
|
1039
|
-
#### [`estimateGas`](https://
|
|
1024
|
+
#### [`estimateGas`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#estimategas)
|
|
1040
1025
|
|
|
1041
1026
|
```typescript
|
|
1042
1027
|
provider.estimateGas(transaction: TransactionRequest): Promise<TinyBig>
|
|
@@ -1064,7 +1049,7 @@ await provider.estimateGas({
|
|
|
1064
1049
|
|
|
1065
1050
|
<br/>
|
|
1066
1051
|
|
|
1067
|
-
#### [`getBalance`](https://
|
|
1052
|
+
#### [`getBalance`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getbalance)
|
|
1068
1053
|
|
|
1069
1054
|
```typescript
|
|
1070
1055
|
provider.getBalance(address: string, blockTag?: BlockTag): Promise<TinyBig>
|
|
@@ -1087,7 +1072,7 @@ await provider.getBalance('0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8');
|
|
|
1087
1072
|
|
|
1088
1073
|
<br/>
|
|
1089
1074
|
|
|
1090
|
-
#### [`getBlock`](https://
|
|
1075
|
+
#### [`getBlock`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getblock)
|
|
1091
1076
|
|
|
1092
1077
|
```typescript
|
|
1093
1078
|
provider.getBlock(timeFrame?: BlockTag, returnTransactionObjects?: boolean): Promise<BlockResponse>
|
|
@@ -1138,7 +1123,7 @@ await provider.getBlock(14879862);
|
|
|
1138
1123
|
|
|
1139
1124
|
<br/>
|
|
1140
1125
|
|
|
1141
|
-
#### [`getBlockNumber`](https://
|
|
1126
|
+
#### [`getBlockNumber`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getblocknumber)
|
|
1142
1127
|
|
|
1143
1128
|
```typescript
|
|
1144
1129
|
provider.getBlockNumber(): Promise<number>
|
|
@@ -1161,7 +1146,7 @@ await provider.getBlockNumber();
|
|
|
1161
1146
|
|
|
1162
1147
|
<br/>
|
|
1163
1148
|
|
|
1164
|
-
#### [`getCode`](https://
|
|
1149
|
+
#### [`getCode`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getcode)
|
|
1165
1150
|
|
|
1166
1151
|
```typescript
|
|
1167
1152
|
provider.getCode(address: string, blockTag?: BlockTag): Promise<string>
|
|
@@ -1187,7 +1172,7 @@ await jsonRpcProvider().getCode(
|
|
|
1187
1172
|
|
|
1188
1173
|
<br/>
|
|
1189
1174
|
|
|
1190
|
-
#### [`getGasPrice`](https://
|
|
1175
|
+
#### [`getGasPrice`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getgasprice)
|
|
1191
1176
|
|
|
1192
1177
|
```typescript
|
|
1193
1178
|
provider.getGasPrice(): Promise<TinyBig>
|
|
@@ -1210,7 +1195,7 @@ await provider.getGasPrice();
|
|
|
1210
1195
|
|
|
1211
1196
|
<br/>
|
|
1212
1197
|
|
|
1213
|
-
#### [`getLogs`](https://
|
|
1198
|
+
#### [`getLogs`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getlogs)
|
|
1214
1199
|
|
|
1215
1200
|
```typescript
|
|
1216
1201
|
provider.getLogs(filter: Filter | FilterByBlockHash): Promise<Array<Log>>
|
|
@@ -1260,7 +1245,7 @@ provider.getLogs({
|
|
|
1260
1245
|
|
|
1261
1246
|
<br/>
|
|
1262
1247
|
|
|
1263
|
-
#### [`getNetwork`](https://
|
|
1248
|
+
#### [`getNetwork`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getnetwork)
|
|
1264
1249
|
|
|
1265
1250
|
```typescript
|
|
1266
1251
|
provider.getNetwork(): Promise<Network>
|
|
@@ -1288,7 +1273,7 @@ jsonRpcProvider('https://free-eth-node.com/api/MATIC').getNetwork();
|
|
|
1288
1273
|
|
|
1289
1274
|
<br/>
|
|
1290
1275
|
|
|
1291
|
-
#### [`getTransaction`](https://
|
|
1276
|
+
#### [`getTransaction`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#gettransaction)
|
|
1292
1277
|
|
|
1293
1278
|
```typescript
|
|
1294
1279
|
provider.getTransaction(transactionHash: string): Promise<TransactionResponse>
|
|
@@ -1334,7 +1319,7 @@ await provider.getTransaction(
|
|
|
1334
1319
|
|
|
1335
1320
|
<br/>
|
|
1336
1321
|
|
|
1337
|
-
#### [`getTransactionCount`](https://
|
|
1322
|
+
#### [`getTransactionCount`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#gettransactioncount)
|
|
1338
1323
|
|
|
1339
1324
|
```typescript
|
|
1340
1325
|
provider.getTransactionCount(address: string, blockTag?: BlockTag): Promise<number>
|
|
@@ -1375,7 +1360,7 @@ await provider.getTransactionCount(
|
|
|
1375
1360
|
|
|
1376
1361
|
<br/>
|
|
1377
1362
|
|
|
1378
|
-
#### [`getTransactionReceipt`](https://
|
|
1363
|
+
#### [`getTransactionReceipt`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#gettransactionreceipt)
|
|
1379
1364
|
|
|
1380
1365
|
```typescript
|
|
1381
1366
|
provider.getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>
|
|
@@ -1510,7 +1495,7 @@ const contract = new Contract(contractAddress, abi, provider);
|
|
|
1510
1495
|
|
|
1511
1496
|
#### `contractFunctionName(args)`
|
|
1512
1497
|
|
|
1513
|
-
Any function on a contract. Returns are the same as `ethers.js`, except that instead of BigNumber, `essential-eth` always returns a [`TinyBig`](https://
|
|
1498
|
+
Any function on a contract. Returns are the same as `ethers.js`, except that instead of BigNumber, `essential-eth` always returns a [`TinyBig`](https://essential-eth.vercel.app/classes/TinyBig.html)
|
|
1514
1499
|
|
|
1515
1500
|
<br/>
|
|
1516
1501
|
<br/>
|
|
@@ -1543,5 +1528,5 @@ Note: In `web3.js`, almost every method or function can be passed a callback. `e
|
|
|
1543
1528
|
|
|
1544
1529
|
### Miscellaneous
|
|
1545
1530
|
|
|
1546
|
-
- [📓 View full docs](https://
|
|
1531
|
+
- [📓 View full docs](https://essential-eth.vercel.app)
|
|
1547
1532
|
- [📓 View changelog (by looking at releases diff)](https://github.com/dawsbot/essential-eth/releases)
|