essential-eth 0.9.2-beta.7 → 0.10.0
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/dist/cjs/classes/test/Contract/crv-abi.js +0 -75
- package/dist/cjs/classes/test/Contract/jokerrace-abi.d.ts +2 -0
- package/dist/cjs/classes/test/Contract/jokerrace-abi.js +11 -0
- package/dist/cjs/classes/utils/encode-decode-transaction.js +10 -3
- package/dist/cjs/index.d.ts +7 -7
- package/dist/cjs/index.js +22 -22
- package/dist/cjs/index.umd.js +1 -1
- package/dist/cjs/index.umd.js.map +1 -1
- package/dist/cjs/logger/package-version.d.ts +1 -1
- package/dist/cjs/logger/package-version.js +1 -1
- package/dist/esm/classes/test/Contract/crv-abi.js +0 -75
- package/dist/esm/classes/test/Contract/jokerrace-abi.d.ts +2 -0
- package/dist/esm/classes/test/Contract/jokerrace-abi.js +8 -0
- package/dist/esm/classes/utils/encode-decode-transaction.js +10 -3
- package/dist/esm/index.d.ts +7 -7
- package/dist/esm/index.js +4 -4
- package/dist/esm/logger/package-version.d.ts +1 -1
- package/dist/esm/logger/package-version.js +1 -1
- package/package.json +7 -3
- package/readme.md +63 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.
|
|
1
|
+
export declare const version = "0.10.0";
|
|
@@ -1,79 +1,4 @@
|
|
|
1
1
|
export const abi = [
|
|
2
|
-
{
|
|
3
|
-
name: 'Fund',
|
|
4
|
-
inputs: [
|
|
5
|
-
{
|
|
6
|
-
type: 'address',
|
|
7
|
-
name: 'recipient',
|
|
8
|
-
indexed: true,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
type: 'uint256',
|
|
12
|
-
name: 'amount',
|
|
13
|
-
indexed: false,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
anonymous: false,
|
|
17
|
-
type: 'event',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'Claim',
|
|
21
|
-
inputs: [
|
|
22
|
-
{
|
|
23
|
-
type: 'address',
|
|
24
|
-
name: 'recipient',
|
|
25
|
-
indexed: true,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
type: 'uint256',
|
|
29
|
-
name: 'claimed',
|
|
30
|
-
indexed: false,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
anonymous: false,
|
|
34
|
-
type: 'event',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'ToggleDisable',
|
|
38
|
-
inputs: [
|
|
39
|
-
{
|
|
40
|
-
type: 'address',
|
|
41
|
-
name: 'recipient',
|
|
42
|
-
indexed: false,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
type: 'bool',
|
|
46
|
-
name: 'disabled',
|
|
47
|
-
indexed: false,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
anonymous: false,
|
|
51
|
-
type: 'event',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'CommitOwnership',
|
|
55
|
-
inputs: [
|
|
56
|
-
{
|
|
57
|
-
type: 'address',
|
|
58
|
-
name: 'admin',
|
|
59
|
-
indexed: false,
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
anonymous: false,
|
|
63
|
-
type: 'event',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'ApplyOwnership',
|
|
67
|
-
inputs: [
|
|
68
|
-
{
|
|
69
|
-
type: 'address',
|
|
70
|
-
name: 'admin',
|
|
71
|
-
indexed: false,
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
anonymous: false,
|
|
75
|
-
type: 'event',
|
|
76
|
-
},
|
|
77
2
|
{
|
|
78
3
|
outputs: [],
|
|
79
4
|
inputs: [
|
|
@@ -28,7 +28,7 @@ function expandType(type) {
|
|
|
28
28
|
if (type === 'uint[]') {
|
|
29
29
|
return 'uint256[]';
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
if (type === 'int[]') {
|
|
32
32
|
return 'int256[]';
|
|
33
33
|
}
|
|
34
34
|
return type;
|
|
@@ -109,8 +109,15 @@ export function decodeRPCResponse(jsonABIArgument, nodeResponse) {
|
|
|
109
109
|
const hexToDecode = responseData.slice(decimalOffset * 2, decimalOffset * 2 + decimalLength * 2);
|
|
110
110
|
return hexToUtf8(hexToDecode);
|
|
111
111
|
}
|
|
112
|
-
const encodedOutputs = slicedResponse.match(/.{1,64}/g);
|
|
113
|
-
|
|
112
|
+
const encodedOutputs = slicedResponse.match(/.{1,64}/g) || [];
|
|
113
|
+
if (jsonABIArgument?.outputs?.length === 1 &&
|
|
114
|
+
jsonABIArgument.outputs[0].type === 'address[]') {
|
|
115
|
+
const unformattedAddresses = encodedOutputs.slice(2);
|
|
116
|
+
return unformattedAddresses.map((unformattedAddress) => {
|
|
117
|
+
return toChecksumAddress(`0x${unformattedAddress.slice(24)}`);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
const outputs = encodedOutputs.map((output, i) => {
|
|
114
121
|
const outputType = (rawOutputs || [])[i].type;
|
|
115
122
|
switch (outputType) {
|
|
116
123
|
case 'bool':
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BaseContract, Contract } from './classes/Contract';
|
|
2
2
|
export { AlchemyProvider } from './providers/AlchemyProvider';
|
|
3
|
-
export {
|
|
3
|
+
export { ConstructorOptions, FallthroughProvider, } from './providers/FallthroughProvider';
|
|
4
4
|
export { jsonRpcProvider, JsonRpcProvider } from './providers/JsonRpcProvider';
|
|
5
5
|
export { tinyBig, TinyBig } from './shared/tiny-big/tiny-big';
|
|
6
|
-
export { BlockResponse,
|
|
6
|
+
export { BlockResponse, BlockTag, RPCBlock } from './types/Block.types';
|
|
7
7
|
export { ContractTypes, JSONABI, JSONABIArgument, } from './types/Contract.types';
|
|
8
8
|
export { Filter, FilterByBlockHash } from './types/Filter.types';
|
|
9
9
|
export { Network } from './types/Network.types';
|
|
10
|
-
export {
|
|
10
|
+
export { BlockTransactionResponse, Log, RPCLog, RPCTransaction, RPCTransactionReceipt, RPCTransactionRequest, TransactionReceipt, TransactionRequest, TransactionResponse, } from './types/Transaction.types';
|
|
11
|
+
export { arrayify, Bytes, BytesLike, BytesLikeWithNumber, concat, DataOptions, Hexable, hexConcat, hexDataLength, hexDataSlice, hexlify, hexStripZeros, hexValue, hexZeroPad, isBytes, isBytesLike, isHexString, Signature, SignatureLike, stripZeros, zeroPad, } from './utils/bytes';
|
|
11
12
|
export { computeAddress } from './utils/compute-address';
|
|
12
13
|
export { computePublicKey } from './utils/compute-public-key';
|
|
13
14
|
export { etherToGwei } from './utils/ether-to-gwei';
|
|
@@ -15,10 +16,9 @@ export { etherToWei } from './utils/ether-to-wei';
|
|
|
15
16
|
export { gweiToEther } from './utils/gwei-to-ether';
|
|
16
17
|
export { hashMessage } from './utils/hash-message';
|
|
17
18
|
export { isAddress } from './utils/is-address';
|
|
19
|
+
export { keccak256 } from './utils/keccak256';
|
|
20
|
+
export { pack, solidityKeccak256 } from './utils/solidity-keccak256';
|
|
18
21
|
export { splitSignature } from './utils/split-signature';
|
|
19
22
|
export { toChecksumAddress } from './utils/to-checksum-address';
|
|
20
23
|
export { toUtf8Bytes } from './utils/to-utf8-bytes';
|
|
21
24
|
export { weiToEther } from './utils/wei-to-ether';
|
|
22
|
-
export { Bytes, BytesLike, BytesLikeWithNumber, DataOptions, Hexable, SignatureLike, Signature, isBytesLike, isBytes, arrayify, concat, stripZeros, zeroPad, isHexString, hexlify, hexDataLength, hexDataSlice, hexConcat, hexValue, hexStripZeros, hexZeroPad, } from './utils/bytes';
|
|
23
|
-
export { keccak256 } from './utils/keccak256';
|
|
24
|
-
export { pack, solidityKeccak256 } from './utils/solidity-keccak256';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BaseContract, Contract } from './classes/Contract';
|
|
2
2
|
export { AlchemyProvider } from './providers/AlchemyProvider';
|
|
3
3
|
export { FallthroughProvider, } from './providers/FallthroughProvider';
|
|
4
4
|
export { jsonRpcProvider, JsonRpcProvider } from './providers/JsonRpcProvider';
|
|
5
5
|
export { tinyBig, TinyBig } from './shared/tiny-big/tiny-big';
|
|
6
|
+
export { arrayify, concat, hexConcat, hexDataLength, hexDataSlice, hexlify, hexStripZeros, hexValue, hexZeroPad, isBytes, isBytesLike, isHexString, stripZeros, zeroPad, } from './utils/bytes';
|
|
6
7
|
export { computeAddress } from './utils/compute-address';
|
|
7
8
|
export { computePublicKey } from './utils/compute-public-key';
|
|
8
9
|
export { etherToGwei } from './utils/ether-to-gwei';
|
|
@@ -10,10 +11,9 @@ export { etherToWei } from './utils/ether-to-wei';
|
|
|
10
11
|
export { gweiToEther } from './utils/gwei-to-ether';
|
|
11
12
|
export { hashMessage } from './utils/hash-message';
|
|
12
13
|
export { isAddress } from './utils/is-address';
|
|
14
|
+
export { keccak256 } from './utils/keccak256';
|
|
15
|
+
export { pack, solidityKeccak256 } from './utils/solidity-keccak256';
|
|
13
16
|
export { splitSignature } from './utils/split-signature';
|
|
14
17
|
export { toChecksumAddress } from './utils/to-checksum-address';
|
|
15
18
|
export { toUtf8Bytes } from './utils/to-utf8-bytes';
|
|
16
19
|
export { weiToEther } from './utils/wei-to-ether';
|
|
17
|
-
export { isBytesLike, isBytes, arrayify, concat, stripZeros, zeroPad, isHexString, hexlify, hexDataLength, hexDataSlice, hexConcat, hexValue, hexStripZeros, hexZeroPad, } from './utils/bytes';
|
|
18
|
-
export { keccak256 } from './utils/keccak256';
|
|
19
|
-
export { pack, solidityKeccak256 } from './utils/solidity-keccak256';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.
|
|
1
|
+
export declare const version = "0.10.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.
|
|
1
|
+
export const version = '0.10.0';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "essential-eth",
|
|
3
3
|
"description": "Ultralight JS for Ethereum",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"types": "./dist/esm/index.d.ts",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=14"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist/"
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"husky": "^7.0.4",
|
|
66
66
|
"jest": "^27.5.1",
|
|
67
67
|
"lint-staged": "^13.2.1",
|
|
68
|
+
"markdown-magic": "^2.6.1",
|
|
68
69
|
"microbundle": "^0.15.1",
|
|
69
70
|
"npm-run-all": "^4.1.5",
|
|
70
71
|
"perf_hooks": "^0.0.1",
|
|
@@ -92,7 +93,10 @@
|
|
|
92
93
|
"prettier": {
|
|
93
94
|
"trailingComma": "all",
|
|
94
95
|
"tabWidth": 2,
|
|
95
|
-
"singleQuote": true
|
|
96
|
+
"singleQuote": true,
|
|
97
|
+
"plugins": [
|
|
98
|
+
"prettier-plugin-organize-imports"
|
|
99
|
+
]
|
|
96
100
|
},
|
|
97
101
|
"keywords": [
|
|
98
102
|
"ethereum",
|
package/readme.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
🪶 Essential Eth 🪶
|
|
9
9
|
</b>
|
|
10
10
|
<br/>
|
|
11
|
-
<i>An alternative for ethers & web3 that's
|
|
11
|
+
<i>An alternative for ethers & web3 that's 10x smaller</i>
|
|
12
12
|
<br/>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
- 🧪 Strongly tested
|
|
41
41
|
- 🌲 Tree-shaking and no side-effects
|
|
42
42
|
- 🙌 All common JS versions (CommonJS, ESM, & UMD)
|
|
43
|
-
- ✅ Node 20, 18, 16,
|
|
43
|
+
- ✅ Node 20, 18, 16, & 14
|
|
44
44
|
- ✅ Web
|
|
45
45
|
|
|
46
46
|
<br/>
|
|
@@ -126,7 +126,7 @@ Browsers:
|
|
|
126
126
|
|
|
127
127
|
```html
|
|
128
128
|
<!-- index.html -->
|
|
129
|
-
<script src="https://unpkg.com/essential-eth@0.
|
|
129
|
+
<script src="https://unpkg.com/essential-eth@0.10.0"></script>
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
<!-- ⛔️ AUTO-GENERATED-CONTENT:END (UNPKG_SCRIPT_TAG) -->
|
|
@@ -146,6 +146,8 @@ const { etherToWei } = require('essential-eth');
|
|
|
146
146
|
|
|
147
147
|
#### [`arrayify`](https://eeth.dev/docs/api/modules#arrayify)
|
|
148
148
|
|
|
149
|
+

|
|
150
|
+
|
|
149
151
|
```typescript
|
|
150
152
|
arrayify(value: number | BytesLike | Hexable, options: DataOptions): Uint8Array
|
|
151
153
|
```
|
|
@@ -178,6 +180,8 @@ arrayify('0x1', { hexPad: 'right' });
|
|
|
178
180
|
|
|
179
181
|
#### [`computeAddress`](https://eeth.dev/docs/api/modules#computeaddress)
|
|
180
182
|
|
|
183
|
+

|
|
184
|
+
|
|
181
185
|
```typescript
|
|
182
186
|
computeAddress(key: string): string
|
|
183
187
|
```
|
|
@@ -209,6 +213,8 @@ computeAddress(
|
|
|
209
213
|
|
|
210
214
|
#### [`computePublicKey`](https://eeth.dev/docs/api/modules#computepublickey)
|
|
211
215
|
|
|
216
|
+

|
|
217
|
+
|
|
212
218
|
```typescript
|
|
213
219
|
computePublicKey(privKey: BytesLike): string
|
|
214
220
|
```
|
|
@@ -241,6 +247,8 @@ computePublicKey([
|
|
|
241
247
|
|
|
242
248
|
#### [`concat`](https://eeth.dev/docs/api/modules#concat)
|
|
243
249
|
|
|
250
|
+

|
|
251
|
+
|
|
244
252
|
```typescript
|
|
245
253
|
concat(arrayOfBytesLike: Array<BytesLikeWithNumber>): Uint8Array
|
|
246
254
|
```
|
|
@@ -263,6 +271,8 @@ concat([0, 1]);
|
|
|
263
271
|
|
|
264
272
|
#### [`etherToGwei`](https://eeth.dev/docs/api/modules#ethertogwei)
|
|
265
273
|
|
|
274
|
+

|
|
275
|
+
|
|
266
276
|
```typescript
|
|
267
277
|
etherToGwei(etherQuantity: string | number | TinyBig | Big): TinyBig
|
|
268
278
|
```
|
|
@@ -294,6 +304,8 @@ etherToGwei(1000).toNumber();
|
|
|
294
304
|
|
|
295
305
|
#### [`etherToWei`](https://eeth.dev/docs/api/modules#ethertowei)
|
|
296
306
|
|
|
307
|
+

|
|
308
|
+
|
|
297
309
|
```typescript
|
|
298
310
|
etherToWei(etherQuantity: string | number | TinyBig | Big): TinyBig
|
|
299
311
|
```
|
|
@@ -325,6 +337,8 @@ etherToWei(1000).toNumber();
|
|
|
325
337
|
|
|
326
338
|
#### [`gweiToEther`](https://eeth.dev/docs/api/modules#gweitoether)
|
|
327
339
|
|
|
340
|
+

|
|
341
|
+
|
|
328
342
|
```typescript
|
|
329
343
|
gweiToEther(gweiQuantity: string | number | TinyBig | Big): TinyBig
|
|
330
344
|
```
|
|
@@ -356,6 +370,8 @@ gweiToEther(1000000000000).toNumber();
|
|
|
356
370
|
|
|
357
371
|
#### [`hashMessage`](https://eeth.dev/docs/api/modules#hashmessage)
|
|
358
372
|
|
|
373
|
+

|
|
374
|
+
|
|
359
375
|
```typescript
|
|
360
376
|
hashMessage(message: string | Bytes): string
|
|
361
377
|
```
|
|
@@ -378,6 +394,8 @@ hashMessage('Hello World');
|
|
|
378
394
|
|
|
379
395
|
#### [`hexConcat`](https://eeth.dev/docs/api/modules#hexconcat)
|
|
380
396
|
|
|
397
|
+

|
|
398
|
+
|
|
381
399
|
```typescript
|
|
382
400
|
hexConcat(items: Array<BytesLike>): string
|
|
383
401
|
```
|
|
@@ -400,6 +418,8 @@ hexConcat([[2, 4, 0, 1], 9, '0x2934', '0x3947']);
|
|
|
400
418
|
|
|
401
419
|
#### [`hexDataLength`](https://eeth.dev/docs/api/modules#hexdatalength)
|
|
402
420
|
|
|
421
|
+

|
|
422
|
+
|
|
403
423
|
```typescript
|
|
404
424
|
hexDataLength(data: BytesLike): undefined
|
|
405
425
|
```
|
|
@@ -427,6 +447,8 @@ hexDataLength('0x3925');
|
|
|
427
447
|
|
|
428
448
|
#### [`hexDataSlice`](https://eeth.dev/docs/api/modules#hexdataslice)
|
|
429
449
|
|
|
450
|
+

|
|
451
|
+
|
|
430
452
|
```typescript
|
|
431
453
|
hexDataSlice(data: BytesLikeWithNumber, offset: number, endOffset: number): string
|
|
432
454
|
```
|
|
@@ -449,6 +471,8 @@ hexDataSlice([20, 6, 48], 0, 2);
|
|
|
449
471
|
|
|
450
472
|
#### [`hexStripZeros`](https://eeth.dev/docs/api/modules#hexstripzeros)
|
|
451
473
|
|
|
474
|
+

|
|
475
|
+
|
|
452
476
|
```typescript
|
|
453
477
|
hexStripZeros(value: BytesLike): string
|
|
454
478
|
```
|
|
@@ -471,6 +495,8 @@ hexStripZeros([0, 0, 0, 48]);
|
|
|
471
495
|
|
|
472
496
|
#### [`hexValue`](https://eeth.dev/docs/api/modules#hexvalue)
|
|
473
497
|
|
|
498
|
+

|
|
499
|
+
|
|
474
500
|
```typescript
|
|
475
501
|
hexValue(value: number | bigint | BytesLike | Hexable): string
|
|
476
502
|
```
|
|
@@ -498,6 +524,8 @@ hexValue([9, 4, 19, 4]);
|
|
|
498
524
|
|
|
499
525
|
#### [`hexZeroPad`](https://eeth.dev/docs/api/modules#hexzeropad)
|
|
500
526
|
|
|
527
|
+

|
|
528
|
+
|
|
501
529
|
```typescript
|
|
502
530
|
hexZeroPad(value: BytesLikeWithNumber, length: number): string
|
|
503
531
|
```
|
|
@@ -530,6 +558,8 @@ hexZeroPad('12345', 1);
|
|
|
530
558
|
|
|
531
559
|
#### [`hexlify`](https://eeth.dev/docs/api/modules#hexlify)
|
|
532
560
|
|
|
561
|
+

|
|
562
|
+
|
|
533
563
|
```typescript
|
|
534
564
|
hexlify(value: number | bigint | BytesLike | Hexable, options: DataOptions): string
|
|
535
565
|
```
|
|
@@ -557,6 +587,8 @@ hexlify(14);
|
|
|
557
587
|
|
|
558
588
|
#### [`isAddress`](https://eeth.dev/docs/api/modules#isaddress)
|
|
559
589
|
|
|
590
|
+

|
|
591
|
+
|
|
560
592
|
```typescript
|
|
561
593
|
isAddress(address: string): boolean
|
|
562
594
|
```
|
|
@@ -590,6 +622,8 @@ isAddress('vitalik.eth');
|
|
|
590
622
|
|
|
591
623
|
#### [`isBytes`](https://eeth.dev/docs/api/modules#isbytes)
|
|
592
624
|
|
|
625
|
+

|
|
626
|
+
|
|
593
627
|
```typescript
|
|
594
628
|
isBytes(value: any): value
|
|
595
629
|
```
|
|
@@ -622,6 +656,8 @@ isBytes(new Uint8Array(1));
|
|
|
622
656
|
|
|
623
657
|
#### [`isBytesLike`](https://eeth.dev/docs/api/modules#isbyteslike)
|
|
624
658
|
|
|
659
|
+

|
|
660
|
+
|
|
625
661
|
```typescript
|
|
626
662
|
isBytesLike(value: any): value
|
|
627
663
|
```
|
|
@@ -654,6 +690,8 @@ isBytesLike(new Uint8Array(1));
|
|
|
654
690
|
|
|
655
691
|
#### [`isHexString`](https://eeth.dev/docs/api/modules#ishexstring)
|
|
656
692
|
|
|
693
|
+

|
|
694
|
+
|
|
657
695
|
```typescript
|
|
658
696
|
isHexString(value: any, length: number): boolean
|
|
659
697
|
```
|
|
@@ -682,6 +720,8 @@ isHexString('0x4924', 4);
|
|
|
682
720
|
|
|
683
721
|
#### [`jsonRpcProvider`](https://eeth.dev/docs/api/modules#jsonrpcprovider)
|
|
684
722
|
|
|
723
|
+

|
|
724
|
+
|
|
685
725
|
```typescript
|
|
686
726
|
jsonRpcProvider(rpcUrl: string): JsonRpcProvider
|
|
687
727
|
```
|
|
@@ -708,6 +748,8 @@ jsonRpcProvider()
|
|
|
708
748
|
|
|
709
749
|
#### [`keccak256`](https://eeth.dev/docs/api/modules#keccak256)
|
|
710
750
|
|
|
751
|
+

|
|
752
|
+
|
|
711
753
|
```typescript
|
|
712
754
|
keccak256(data: BytesLike): string
|
|
713
755
|
```
|
|
@@ -733,6 +775,8 @@ keccak256('0x123');
|
|
|
733
775
|
|
|
734
776
|
#### [`pack`](https://eeth.dev/docs/api/modules#pack)
|
|
735
777
|
|
|
778
|
+

|
|
779
|
+
|
|
736
780
|
```typescript
|
|
737
781
|
pack(types: Array<string>, values: Array<any>): string
|
|
738
782
|
```
|
|
@@ -757,6 +801,8 @@ pack(types, values);
|
|
|
757
801
|
|
|
758
802
|
#### [`solidityKeccak256`](https://eeth.dev/docs/api/modules#soliditykeccak256)
|
|
759
803
|
|
|
804
|
+

|
|
805
|
+
|
|
760
806
|
```typescript
|
|
761
807
|
solidityKeccak256(types: Array<string>, values: Array<any>): string
|
|
762
808
|
```
|
|
@@ -791,6 +837,8 @@ solidityKeccak256(types, values);
|
|
|
791
837
|
|
|
792
838
|
#### [`splitSignature`](https://eeth.dev/docs/api/modules#splitsignature)
|
|
793
839
|
|
|
840
|
+

|
|
841
|
+
|
|
794
842
|
```typescript
|
|
795
843
|
splitSignature(signature: SignatureLike): Signature
|
|
796
844
|
```
|
|
@@ -822,6 +870,8 @@ splitSignature(signature);
|
|
|
822
870
|
|
|
823
871
|
#### [`stripZeros`](https://eeth.dev/docs/api/modules#stripzeros)
|
|
824
872
|
|
|
873
|
+

|
|
874
|
+
|
|
825
875
|
```typescript
|
|
826
876
|
stripZeros(value: BytesLike): Uint8Array
|
|
827
877
|
```
|
|
@@ -845,6 +895,8 @@ stripZeros('0x00002834');
|
|
|
845
895
|
|
|
846
896
|
#### [`tinyBig`](https://eeth.dev/docs/api/modules#tinybig)
|
|
847
897
|
|
|
898
|
+

|
|
899
|
+
|
|
848
900
|
```typescript
|
|
849
901
|
tinyBig(value: string | number | TinyBig | Big): TinyBig
|
|
850
902
|
```
|
|
@@ -867,6 +919,8 @@ tinyBig(10).times(3).toNumber();
|
|
|
867
919
|
|
|
868
920
|
#### [`toChecksumAddress`](https://eeth.dev/docs/api/modules#tochecksumaddress)
|
|
869
921
|
|
|
922
|
+

|
|
923
|
+
|
|
870
924
|
```typescript
|
|
871
925
|
toChecksumAddress(address: string): string
|
|
872
926
|
```
|
|
@@ -893,6 +947,8 @@ Similar to ["toChecksumAddress" in web3.js](https://web3js.readthedocs.io/en/v1.
|
|
|
893
947
|
|
|
894
948
|
#### [`toUtf8Bytes`](https://eeth.dev/docs/api/modules#toutf8bytes)
|
|
895
949
|
|
|
950
|
+

|
|
951
|
+
|
|
896
952
|
```typescript
|
|
897
953
|
toUtf8Bytes(data: string): Uint8Array
|
|
898
954
|
```
|
|
@@ -918,6 +974,8 @@ toUtf8Bytes('ethereum');
|
|
|
918
974
|
|
|
919
975
|
#### [`weiToEther`](https://eeth.dev/docs/api/modules#weitoether)
|
|
920
976
|
|
|
977
|
+

|
|
978
|
+
|
|
921
979
|
```typescript
|
|
922
980
|
weiToEther(weiQuantity: string | number | TinyBig | Big): TinyBig
|
|
923
981
|
```
|
|
@@ -949,6 +1007,8 @@ weiToEther(1000000000000000000000).toNumber();
|
|
|
949
1007
|
|
|
950
1008
|
#### [`zeroPad`](https://eeth.dev/docs/api/modules#zeropad)
|
|
951
1009
|
|
|
1010
|
+

|
|
1011
|
+
|
|
952
1012
|
```typescript
|
|
953
1013
|
zeroPad(value: BytesLike, length: number): Uint8Array
|
|
954
1014
|
```
|