essential-eth 0.5.10 โ†’ 0.5.11-next.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.
@@ -1 +1 @@
1
- export declare const version = "0.5.10";
1
+ export declare const version = "0.5.11-next.0";
package/package.json CHANGED
@@ -1,29 +1,20 @@
1
1
  {
2
2
  "name": "essential-eth",
3
3
  "description": "Ultralight JS for Ethereum",
4
- "version": "0.5.10",
4
+ "version": "0.5.11-next.0",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "private": false,
8
8
  "source": "src/index.ts",
9
+ "exports": {
10
+ "require": "./dist/index.js",
11
+ "default": "./dist/index.modern.mjs"
12
+ },
13
+ "amdName": "essentialEth",
9
14
  "main": "./dist/index.js",
10
- "browser": "./dist/index.umd.js",
11
- "umd:main": "./dist/index.umd.js",
12
- "jsnext:main": "./dist/index.modern.js",
13
15
  "module": "./dist/index.module.js",
14
- "syntax": {
15
- "esmodules": "./dist/index.modern.js"
16
- },
16
+ "umd:main": "./dist/index.umd.js",
17
17
  "types": "./dist/index.d.ts",
18
- "typings": "./dist/index.d.ts",
19
- "exports": {
20
- ".": {
21
- "browser": "./dist/index.module.js",
22
- "umd": "./dist/index.umd.js",
23
- "import": "./dist/index.module.js",
24
- "require": "./dist/index.js"
25
- }
26
- },
27
18
  "files": [
28
19
  "dist/"
29
20
  ],
@@ -57,7 +48,9 @@
57
48
  "test": "npm-run-all --parallel jest build lint",
58
49
  "test:all-node-versions": "npx trevor",
59
50
  "lint": "eslint --cache --fix .",
60
- "build": "rm -rf lib && microbundle",
51
+ "build": "rm -rf dist && run-p build:most build:umd",
52
+ "build:most": "microbundle --format modern,esm,cjs",
53
+ "build:umd": "microbundle --external none --format umd",
61
54
  "build:readme": "bash ./scripts/markdown-magic/build-readme.sh",
62
55
  "jest": "jest",
63
56
  "build:chains-info": "npx ts-node scripts/fetch-chains-info.ts # used in getNetwork()",
package/readme.md CHANGED
@@ -26,12 +26,20 @@
26
26
 
27
27
  <br/>
28
28
 
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`
29
+ - ๐Ÿœ๏ธ [tiny](https://bundlephobia.com/package/essential-eth)
30
+ - ๐Ÿ” Strongly written TypeScript
31
+ - ๐Ÿงช Matches both `ethers` and `web3`
32
+ - โšก๏ธ Near-identical API to `ethers`
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
33
41
  - ๐ŸŒฒ Tree-shaking and no side-effects
34
- - ๐Ÿ™Œ Supports multiple JS versions (CommonJS and ESM)
42
+ - ๐Ÿ™Œ All common JS versions (CommonJS, ESM, UMD, modern)
35
43
  - โœ… Node 18, 16, 14, & 12
36
44
  - โœ… Web
37
45
 
@@ -104,10 +112,17 @@
104
112
  ## Install
105
113
 
106
114
  ```sh
107
- npm install --save essential-eth # TypeScript types load automatically
115
+ npm install --save essential-eth # TypeScript included
108
116
 
109
117
  # or yarn
110
- yarn add essential-eth # TypeScript types load automatically
118
+ yarn add essential-eth # TypeScript included
119
+ ```
120
+
121
+ Browsers:
122
+
123
+ ```html
124
+ <!-- index.html -->
125
+ <script src="https://unpkg.com/essential-eth@0.5.10"></script>
111
126
  ```
112
127
 
113
128
  <br/>
@@ -123,7 +138,7 @@ const { etherToWei } = require('essential-eth');
123
138
 
124
139
  <!-- โ›”๏ธ AUTO-GENERATED-CONTENT:START (FUNCTIONS) -->
125
140
 
126
- #### [`arrayify`](https://essential-eth.vercel.app/docs/api/modules#arrayify)
141
+ #### [`arrayify`](https://eeth.dev/docs/api/modules#arrayify)
127
142
 
128
143
  ```typescript
129
144
  arrayify(value: number | BytesLike | Hexable, options: DataOptions): Uint8Array
@@ -155,7 +170,7 @@ arrayify('0x1', { hexPad: 'right' });
155
170
 
156
171
  <br/>
157
172
 
158
- #### [`computeAddress`](https://essential-eth.vercel.app/docs/api/modules#computeaddress)
173
+ #### [`computeAddress`](https://eeth.dev/docs/api/modules#computeaddress)
159
174
 
160
175
  ```typescript
161
176
  computeAddress(key: string): string
@@ -186,7 +201,7 @@ computeAddress(
186
201
 
187
202
  <br/>
188
203
 
189
- #### [`computePublicKey`](https://essential-eth.vercel.app/docs/api/modules#computepublickey)
204
+ #### [`computePublicKey`](https://eeth.dev/docs/api/modules#computepublickey)
190
205
 
191
206
  ```typescript
192
207
  computePublicKey(privKey: BytesLike): string
@@ -218,7 +233,7 @@ computePublicKey([
218
233
 
219
234
  <br/>
220
235
 
221
- #### [`concat`](https://essential-eth.vercel.app/docs/api/modules#concat)
236
+ #### [`concat`](https://eeth.dev/docs/api/modules#concat)
222
237
 
223
238
  ```typescript
224
239
  concat(arrayOfBytesLike: Array<BytesLikeWithNumber>): Uint8Array
@@ -240,7 +255,7 @@ concat([0, 1]);
240
255
 
241
256
  <br/>
242
257
 
243
- #### [`etherToGwei`](https://essential-eth.vercel.app/docs/api/modules#ethertogwei)
258
+ #### [`etherToGwei`](https://eeth.dev/docs/api/modules#ethertogwei)
244
259
 
245
260
  ```typescript
246
261
  etherToGwei(etherQuantity: string | number | TinyBig | Big): TinyBig
@@ -271,7 +286,7 @@ etherToGwei(1000).toNumber();
271
286
 
272
287
  <br/>
273
288
 
274
- #### [`etherToWei`](https://essential-eth.vercel.app/docs/api/modules#ethertowei)
289
+ #### [`etherToWei`](https://eeth.dev/docs/api/modules#ethertowei)
275
290
 
276
291
  ```typescript
277
292
  etherToWei(etherQuantity: string | number | TinyBig | Big): TinyBig
@@ -302,7 +317,7 @@ etherToWei(1000).toNumber();
302
317
 
303
318
  <br/>
304
319
 
305
- #### [`gweiToEther`](https://essential-eth.vercel.app/docs/api/modules#gweitoether)
320
+ #### [`gweiToEther`](https://eeth.dev/docs/api/modules#gweitoether)
306
321
 
307
322
  ```typescript
308
323
  gweiToEther(gweiQuantity: string | number | TinyBig | Big): TinyBig
@@ -333,7 +348,7 @@ gweiToEther(1000000000000).toNumber();
333
348
 
334
349
  <br/>
335
350
 
336
- #### [`hashMessage`](https://essential-eth.vercel.app/docs/api/modules#hashmessage)
351
+ #### [`hashMessage`](https://eeth.dev/docs/api/modules#hashmessage)
337
352
 
338
353
  ```typescript
339
354
  hashMessage(message: string | Bytes): string
@@ -355,7 +370,7 @@ hashMessage('Hello World');
355
370
 
356
371
  <br/>
357
372
 
358
- #### [`hexConcat`](https://essential-eth.vercel.app/docs/api/modules#hexconcat)
373
+ #### [`hexConcat`](https://eeth.dev/docs/api/modules#hexconcat)
359
374
 
360
375
  ```typescript
361
376
  hexConcat(items: Array<BytesLike>): string
@@ -377,7 +392,7 @@ hexConcat([[2, 4, 0, 1], 9, '0x2934', '0x3947']);
377
392
 
378
393
  <br/>
379
394
 
380
- #### [`hexDataLength`](https://essential-eth.vercel.app/docs/api/modules#hexdatalength)
395
+ #### [`hexDataLength`](https://eeth.dev/docs/api/modules#hexdatalength)
381
396
 
382
397
  ```typescript
383
398
  hexDataLength(data: BytesLike): undefined
@@ -404,7 +419,7 @@ hexDataLength('0x3925');
404
419
 
405
420
  <br/>
406
421
 
407
- #### [`hexDataSlice`](https://essential-eth.vercel.app/docs/api/modules#hexdataslice)
422
+ #### [`hexDataSlice`](https://eeth.dev/docs/api/modules#hexdataslice)
408
423
 
409
424
  ```typescript
410
425
  hexDataSlice(data: BytesLikeWithNumber, offset: number, endOffset: number): string
@@ -426,7 +441,7 @@ hexDataSlice([20, 6, 48], 0, 2);
426
441
 
427
442
  <br/>
428
443
 
429
- #### [`hexStripZeros`](https://essential-eth.vercel.app/docs/api/modules#hexstripzeros)
444
+ #### [`hexStripZeros`](https://eeth.dev/docs/api/modules#hexstripzeros)
430
445
 
431
446
  ```typescript
432
447
  hexStripZeros(value: BytesLike): string
@@ -448,7 +463,7 @@ hexStripZeros([0, 0, 0, 48]);
448
463
 
449
464
  <br/>
450
465
 
451
- #### [`hexValue`](https://essential-eth.vercel.app/docs/api/modules#hexvalue)
466
+ #### [`hexValue`](https://eeth.dev/docs/api/modules#hexvalue)
452
467
 
453
468
  ```typescript
454
469
  hexValue(value: number | bigint | BytesLike | Hexable): string
@@ -475,7 +490,7 @@ hexValue([9, 4, 19, 4]);
475
490
 
476
491
  <br/>
477
492
 
478
- #### [`hexZeroPad`](https://essential-eth.vercel.app/docs/api/modules#hexzeropad)
493
+ #### [`hexZeroPad`](https://eeth.dev/docs/api/modules#hexzeropad)
479
494
 
480
495
  ```typescript
481
496
  hexZeroPad(value: BytesLikeWithNumber, length: number): string
@@ -507,7 +522,7 @@ hexZeroPad('12345', 1);
507
522
 
508
523
  <br/>
509
524
 
510
- #### [`hexlify`](https://essential-eth.vercel.app/docs/api/modules#hexlify)
525
+ #### [`hexlify`](https://eeth.dev/docs/api/modules#hexlify)
511
526
 
512
527
  ```typescript
513
528
  hexlify(value: number | bigint | BytesLike | Hexable, options: DataOptions): string
@@ -534,7 +549,7 @@ hexlify(14);
534
549
 
535
550
  <br/>
536
551
 
537
- #### [`isAddress`](https://essential-eth.vercel.app/docs/api/modules#isaddress)
552
+ #### [`isAddress`](https://eeth.dev/docs/api/modules#isaddress)
538
553
 
539
554
  ```typescript
540
555
  isAddress(address: string): boolean
@@ -567,7 +582,7 @@ isAddress('vitalik.eth');
567
582
 
568
583
  <br/>
569
584
 
570
- #### [`isBytes`](https://essential-eth.vercel.app/docs/api/modules#isbytes)
585
+ #### [`isBytes`](https://eeth.dev/docs/api/modules#isbytes)
571
586
 
572
587
  ```typescript
573
588
  isBytes(value: any): value
@@ -599,7 +614,7 @@ isBytes(new Uint8Array(1));
599
614
 
600
615
  <br/>
601
616
 
602
- #### [`isBytesLike`](https://essential-eth.vercel.app/docs/api/modules#isbyteslike)
617
+ #### [`isBytesLike`](https://eeth.dev/docs/api/modules#isbyteslike)
603
618
 
604
619
  ```typescript
605
620
  isBytesLike(value: any): value
@@ -631,7 +646,7 @@ isBytesLike(new Uint8Array(1));
631
646
 
632
647
  <br/>
633
648
 
634
- #### [`isHexString`](https://essential-eth.vercel.app/docs/api/modules#ishexstring)
649
+ #### [`isHexString`](https://eeth.dev/docs/api/modules#ishexstring)
635
650
 
636
651
  ```typescript
637
652
  isHexString(value: any, length: number): boolean
@@ -659,7 +674,7 @@ isHexString('0x4924', 4);
659
674
 
660
675
  <br/>
661
676
 
662
- #### [`jsonRpcProvider`](https://essential-eth.vercel.app/docs/api/modules#jsonrpcprovider)
677
+ #### [`jsonRpcProvider`](https://eeth.dev/docs/api/modules#jsonrpcprovider)
663
678
 
664
679
  ```typescript
665
680
  jsonRpcProvider(rpcUrl: string): JsonRpcProvider
@@ -685,7 +700,7 @@ jsonRpcProvider()
685
700
 
686
701
  <br/>
687
702
 
688
- #### [`keccak256`](https://essential-eth.vercel.app/docs/api/modules#keccak256)
703
+ #### [`keccak256`](https://eeth.dev/docs/api/modules#keccak256)
689
704
 
690
705
  ```typescript
691
706
  keccak256(data: BytesLike): string
@@ -710,7 +725,7 @@ keccak256('0x123');
710
725
 
711
726
  <br/>
712
727
 
713
- #### [`pack`](https://essential-eth.vercel.app/docs/api/modules#pack)
728
+ #### [`pack`](https://eeth.dev/docs/api/modules#pack)
714
729
 
715
730
  ```typescript
716
731
  pack(types: Array<string>, values: Array<any>): string
@@ -734,7 +749,7 @@ pack(types, values);
734
749
 
735
750
  <br/>
736
751
 
737
- #### [`solidityKeccak256`](https://essential-eth.vercel.app/docs/api/modules#soliditykeccak256)
752
+ #### [`solidityKeccak256`](https://eeth.dev/docs/api/modules#soliditykeccak256)
738
753
 
739
754
  ```typescript
740
755
  solidityKeccak256(types: Array<string>, values: Array<any>): string
@@ -768,7 +783,7 @@ solidityKeccak256(types, values);
768
783
 
769
784
  <br/>
770
785
 
771
- #### [`splitSignature`](https://essential-eth.vercel.app/docs/api/modules#splitsignature)
786
+ #### [`splitSignature`](https://eeth.dev/docs/api/modules#splitsignature)
772
787
 
773
788
  ```typescript
774
789
  splitSignature(signature: SignatureLike): Signature
@@ -799,7 +814,7 @@ splitSignature(signature);
799
814
 
800
815
  <br/>
801
816
 
802
- #### [`stripZeros`](https://essential-eth.vercel.app/docs/api/modules#stripzeros)
817
+ #### [`stripZeros`](https://eeth.dev/docs/api/modules#stripzeros)
803
818
 
804
819
  ```typescript
805
820
  stripZeros(value: BytesLike): Uint8Array
@@ -822,7 +837,7 @@ stripZeros('0x00002834');
822
837
 
823
838
  <br/>
824
839
 
825
- #### [`tinyBig`](https://essential-eth.vercel.app/docs/api/modules#tinybig)
840
+ #### [`tinyBig`](https://eeth.dev/docs/api/modules#tinybig)
826
841
 
827
842
  ```typescript
828
843
  tinyBig(value: string | number | TinyBig | Big): TinyBig
@@ -844,7 +859,7 @@ tinyBig(10).times(3).toNumber();
844
859
 
845
860
  <br/>
846
861
 
847
- #### [`toChecksumAddress`](https://essential-eth.vercel.app/docs/api/modules#tochecksumaddress)
862
+ #### [`toChecksumAddress`](https://eeth.dev/docs/api/modules#tochecksumaddress)
848
863
 
849
864
  ```typescript
850
865
  toChecksumAddress(address: string): string
@@ -870,7 +885,7 @@ Similar to ["toChecksumAddress" in web3.js](https://web3js.readthedocs.io/en/v1.
870
885
 
871
886
  <br/>
872
887
 
873
- #### [`toUtf8Bytes`](https://essential-eth.vercel.app/docs/api/modules#toutf8bytes)
888
+ #### [`toUtf8Bytes`](https://eeth.dev/docs/api/modules#toutf8bytes)
874
889
 
875
890
  ```typescript
876
891
  toUtf8Bytes(data: string): Uint8Array
@@ -895,7 +910,7 @@ toUtf8Bytes('ethereum');
895
910
 
896
911
  <br/>
897
912
 
898
- #### [`weiToEther`](https://essential-eth.vercel.app/docs/api/modules#weitoether)
913
+ #### [`weiToEther`](https://eeth.dev/docs/api/modules#weitoether)
899
914
 
900
915
  ```typescript
901
916
  weiToEther(weiQuantity: string | number | TinyBig | Big): TinyBig
@@ -926,7 +941,7 @@ weiToEther(1000000000000000000000).toNumber();
926
941
 
927
942
  <br/>
928
943
 
929
- #### [`zeroPad`](https://essential-eth.vercel.app/docs/api/modules#zeropad)
944
+ #### [`zeroPad`](https://eeth.dev/docs/api/modules#zeropad)
930
945
 
931
946
  ```typescript
932
947
  zeroPad(value: BytesLike, length: number): Uint8Array
@@ -995,7 +1010,7 @@ provider.getGasPrice().toNumber();
995
1010
 
996
1011
  <!-- โ›”๏ธ AUTO-GENERATED-CONTENT:START (PROVIDER) -->
997
1012
 
998
- #### [`call`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#call)
1013
+ #### [`call`](https://eeth.dev/docs/api/classes/JsonRpcProvider#call)
999
1014
 
1000
1015
  ```typescript
1001
1016
  provider.call(transaction: TransactionRequest, blockTag?: BlockTag): Promise<string>
@@ -1021,7 +1036,7 @@ await provider.call({
1021
1036
 
1022
1037
  <br/>
1023
1038
 
1024
- #### [`estimateGas`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#estimategas)
1039
+ #### [`estimateGas`](https://eeth.dev/docs/api/classes/JsonRpcProvider#estimategas)
1025
1040
 
1026
1041
  ```typescript
1027
1042
  provider.estimateGas(transaction: TransactionRequest): Promise<TinyBig>
@@ -1049,7 +1064,7 @@ await provider.estimateGas({
1049
1064
 
1050
1065
  <br/>
1051
1066
 
1052
- #### [`getBalance`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getbalance)
1067
+ #### [`getBalance`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getbalance)
1053
1068
 
1054
1069
  ```typescript
1055
1070
  provider.getBalance(address: string, blockTag?: BlockTag): Promise<TinyBig>
@@ -1072,7 +1087,7 @@ await provider.getBalance('0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8');
1072
1087
 
1073
1088
  <br/>
1074
1089
 
1075
- #### [`getBlock`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getblock)
1090
+ #### [`getBlock`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getblock)
1076
1091
 
1077
1092
  ```typescript
1078
1093
  provider.getBlock(timeFrame?: BlockTag, returnTransactionObjects?: boolean): Promise<BlockResponse>
@@ -1123,7 +1138,7 @@ await provider.getBlock(14879862);
1123
1138
 
1124
1139
  <br/>
1125
1140
 
1126
- #### [`getBlockNumber`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getblocknumber)
1141
+ #### [`getBlockNumber`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getblocknumber)
1127
1142
 
1128
1143
  ```typescript
1129
1144
  provider.getBlockNumber(): Promise<number>
@@ -1146,7 +1161,7 @@ await provider.getBlockNumber();
1146
1161
 
1147
1162
  <br/>
1148
1163
 
1149
- #### [`getCode`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getcode)
1164
+ #### [`getCode`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getcode)
1150
1165
 
1151
1166
  ```typescript
1152
1167
  provider.getCode(address: string, blockTag?: BlockTag): Promise<string>
@@ -1172,7 +1187,7 @@ await jsonRpcProvider().getCode(
1172
1187
 
1173
1188
  <br/>
1174
1189
 
1175
- #### [`getGasPrice`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getgasprice)
1190
+ #### [`getGasPrice`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getgasprice)
1176
1191
 
1177
1192
  ```typescript
1178
1193
  provider.getGasPrice(): Promise<TinyBig>
@@ -1195,7 +1210,7 @@ await provider.getGasPrice();
1195
1210
 
1196
1211
  <br/>
1197
1212
 
1198
- #### [`getLogs`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getlogs)
1213
+ #### [`getLogs`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getlogs)
1199
1214
 
1200
1215
  ```typescript
1201
1216
  provider.getLogs(filter: Filter | FilterByBlockHash): Promise<Array<Log>>
@@ -1245,7 +1260,7 @@ provider.getLogs({
1245
1260
 
1246
1261
  <br/>
1247
1262
 
1248
- #### [`getNetwork`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#getnetwork)
1263
+ #### [`getNetwork`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getnetwork)
1249
1264
 
1250
1265
  ```typescript
1251
1266
  provider.getNetwork(): Promise<Network>
@@ -1273,7 +1288,7 @@ jsonRpcProvider('https://free-eth-node.com/api/MATIC').getNetwork();
1273
1288
 
1274
1289
  <br/>
1275
1290
 
1276
- #### [`getTransaction`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#gettransaction)
1291
+ #### [`getTransaction`](https://eeth.dev/docs/api/classes/JsonRpcProvider#gettransaction)
1277
1292
 
1278
1293
  ```typescript
1279
1294
  provider.getTransaction(transactionHash: string): Promise<TransactionResponse>
@@ -1319,7 +1334,7 @@ await provider.getTransaction(
1319
1334
 
1320
1335
  <br/>
1321
1336
 
1322
- #### [`getTransactionCount`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#gettransactioncount)
1337
+ #### [`getTransactionCount`](https://eeth.dev/docs/api/classes/JsonRpcProvider#gettransactioncount)
1323
1338
 
1324
1339
  ```typescript
1325
1340
  provider.getTransactionCount(address: string, blockTag?: BlockTag): Promise<number>
@@ -1360,7 +1375,7 @@ await provider.getTransactionCount(
1360
1375
 
1361
1376
  <br/>
1362
1377
 
1363
- #### [`getTransactionReceipt`](https://essential-eth.vercel.app/docs/api/classes/JsonRpcProvider#gettransactionreceipt)
1378
+ #### [`getTransactionReceipt`](https://eeth.dev/docs/api/classes/JsonRpcProvider#gettransactionreceipt)
1364
1379
 
1365
1380
  ```typescript
1366
1381
  provider.getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>
@@ -1495,7 +1510,7 @@ const contract = new Contract(contractAddress, abi, provider);
1495
1510
 
1496
1511
  #### `contractFunctionName(args)`
1497
1512
 
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)
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://eeth.dev/classes/TinyBig.html)
1499
1514
 
1500
1515
  <br/>
1501
1516
  <br/>
@@ -1528,5 +1543,5 @@ Note: In `web3.js`, almost every method or function can be passed a callback. `e
1528
1543
 
1529
1544
  ### Miscellaneous
1530
1545
 
1531
- - [๐Ÿ““ View full docs](https://essential-eth.vercel.app)
1546
+ - [๐Ÿ““ View full docs](https://eeth.dev)
1532
1547
  - [๐Ÿ““ View changelog (by looking at releases diff)](https://github.com/dawsbot/essential-eth/releases)
package/dist/index.cjs DELETED
@@ -1,2 +0,0 @@
1
- var t=require("sha3"),e=require("isomorphic-unfetch"),r=require("big.js"),n=require("@noble/secp256k1");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=/*#__PURE__*/o(e),s=/*#__PURE__*/o(r);function a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},a.apply(this,arguments)}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,f(t,e)}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}function c(t){return BigInt(t).toString()}var h="0".repeat(64),l="0".repeat(63)+"1";function p(e,r){var n=new t.Keccak(256),o=e.name+"("+e.inputs.map(function(t){return"uint[]"===(e=t.type)?"uint256[]":"int[]"===e?"int256[]":e;var e})+")",i=n.update(o).digest("hex"),s=e.inputs.length,a=!0;if(e.inputs.find(function(t){return t.type.includes("[")})&&(a=!1),a&&r.length!==s)throw new Error('args inputs of "'+r.length+'" does not match expected length of "'+e.inputs.length+'"');var u=(e.inputs||[]).reduce(function(t,e,n){if(e.type.includes("[")){var o,i=null==(o=/([^[]*)\[.*$/g.exec(e.type))?void 0:o[1];return r.forEach(function(e){t=t.concat([[e,i]])}),t}return t.concat([[r[n],e.type]])},[]),f=u.map(function(t){var e=t[0],r=t[1],n=e;switch(r){case"bool":return e?l:h;case"address":n=e.replace(/^0x/g,"").toLowerCase();break;default:if(r.startsWith("bytes"))return n.split("").map(function(t){return t.charCodeAt(0).toString(16)}).join("").padEnd(64,"0");if("uint256"===r)return BigInt(e).toString(16).padStart(64,"0");if(r.startsWith("uint"))break;throw new Error('essential-eth does not yet support "'+r+'" inputs. Make a PR today!"')}return n.toString(16).padStart(64,"0")});return"0x"+i.slice(0,8)+f.join("")}function g(t,e){var r=t.outputs,n=(e.slice(2).match(/.{1,64}/g)||[]).map(function(t,e){var n=(r||[])[e].type;switch(n){case"bool":return t===l;case"address":return I("0x"+t.slice(24));case"uint256":return A(c("0x"+t));case"bytes32":return"0x"+t;case"uint8":return Number(c("0x"+t));default:throw new Error('essential-eth does not yet support "'+n+'" outputs. Make a PR today!"')}});return 1===n.length?n[0]:n}function y(t,e){return i.default(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(t){try{return Promise.resolve(t.text()).then(function(t){try{return JSON.parse(t)}catch(e){throw new Error('Invalid JSON RPC response: "'+t+'"')}})}catch(t){return Promise.reject(t)}}).then(function(t){if(!(null==t?void 0:t.result))throw new Error("Invalid JSON RPC response: "+JSON.stringify(t));return t.result})}function m(t,e){return{jsonrpc:"2.0",id:1,method:t,params:e}}function d(t){t.split("").reduce(function(t,e){return t+("0"===e?4:68)},0)}var v=function(t,e,r){var n=this,o=this;this._address=void 0,this._provider=void 0,this._address=t,this._provider=r,e.filter(function(t){return"function"===t.type}).forEach(function(t){var e;"name"in t&&"string"==typeof t.name&&(e=function(){try{var e=arguments,r=[].slice.call(e),n=r,i={},s=r[r.length-1];Array.isArray(s)||"object"!=typeof s||(i=s,n=r.slice(0,r.length-1));var u=p(t,n),f="number"==typeof i.gasLimit?i.gasLimit:"number"==typeof(null==t?void 0:t.gas)?d(u):null,c=function(){try{return Promise.resolve(y(o._provider.selectRpcUrl(),m("eth_call",[a({to:o._address.toLowerCase(),data:u},f?{gas:"0x"+f.toString(16)}:{}),"latest"])))}catch(t){return Promise.reject(t)}};return Promise.resolve(c()).then(function(e){return g(t,e)})}catch(t){return Promise.reject(t)}},Object.defineProperty(n,t.name,{enumerable:!0,value:e,writable:!1}))})},b=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(v),w=new(/*#__PURE__*/function(){function t(){this.packageVersion=void 0,this.packageVersion="0.5.10-next.0"}var e=t.prototype;return e.throwError=function(t,e){var r=Object.keys(e).length;throw new Error(t+" ("+Object.entries(e).map(function(t,e){return t[0]+"="+t[1]+(e<r-1&&", ")})+", version=essential-eth@"+this.packageVersion+")")},e.throwArgumentError=function(t,e,r){throw new Error(t+' (argument="'+e+'" value='+r+", version=essential-eth@"+this.packageVersion+")")},e.checkSafeUint53=function(t,e){void 0===e&&(e="value not safe"),"number"==typeof t&&((t<0||t>=9007199254740991)&&this.throwError(e,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,{operation:"checkSafeInteger",fault:"non-integer",value:t}))},t}());function x(t){var e=t.startsWith("-");return(t=(t=(t=t.replace("-","")).replace(/\.0*$/g,"")).replace(/^0+/,"")).includes(".")&&(t=t.replace(/0+$/,"")),t.startsWith(".")&&(t="0"+t),(e?"-":"")+t}function E(t){if(!t.match(/e/i))return x(t);var e=t.split(/e/i),r=e[0],n=e[1],o=Number(r)<0,i=(r=x(r=r.replace("-",""))).split("."),s=i[0],a=i[1],u=void 0===a?"":a;if(0===Number(n))return(o?"-":"")+x(r);r.includes(".")||(r+=".");var f,c=(r=r.replace(".","")).length;return Number(n)<0?(s.length<Math.abs(Number(n))&&(r=r.padStart(c+Math.abs(Number(n))-s.length,"0")),f=r.split(""),s.length<Math.abs(Number(n))?f=["."].concat(f):f.splice(f.length-Math.abs(Number(n)),0,".")):(u.length<Math.abs(Number(n))&&(r=r.padEnd(c+Math.abs(Number(n))-u.length,"0")),f=r.split(""),u.length>Math.abs(Number(n))&&f.splice(f.length-Math.abs(Number(n)),0,".")),(o?"-":"")+x(f.join(""))}var B=/*#__PURE__*/function(t){function e(e){var r;return"string"==typeof e&&e.startsWith("0x")&&(e=c(e)),(r=t.call(this,e)||this).padAndChop=function(t,e,r){return(Array(r).fill(e).join("")+t).slice(-1*r)},r}u(e,t);var r=e.prototype;return r.toHexString=function(){return"0x"+BigInt(this.toString()).toString(16)},r.toNumber=function(){return Number(E(t.prototype.toString.call(this)))},r.toString=function(){return 0===this.toNumber()?"0":E(t.prototype.toString.call(this))},r.toTwos=function(t){var e;if(this.gte(0)){var r=this.toNumber().toString(2);e=this.padAndChop(r,"0",t||r.length)}else if(e=this.plus(Math.pow(2,t)).toNumber().toString(2),Number(e)<0)throw new Error("Cannot calculate twos complement");return A(Number("0b"+e))},e}(s.default);function A(t){return new B(t)}function P(t){var e=a({},t);return Object.keys(t).forEach(function(r){if(t[r])switch(r){case"blockNumber":case"chainId":case"transactionIndex":case"type":case"v":e[r]=Number(c(t[r]));break;case"from":case"to":t[r]&&(e[r]=I(t[r]));break;case"value":case"gas":case"gasPrice":case"maxFeePerGas":case"maxPriorityFeePerGas":case"nonce":e[r]=A(c(t[r]))}}),e}var k=function(t,e){if(!e.includes(typeof t))throw new Error(e.join(" or ")+" required. Received "+typeof t)};function I(e){if(k(e,["string"]),!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error('Invalid Ethereum address "'+e+'"');for(var r=e.toLowerCase().replace(/^0x/i,""),n=new t.Keccak(256).update(r).digest("hex").replace(/^0x/i,""),o="0x",i=0;i<r.length;i++)parseInt(n[i],16)>7?o+=r[i].toUpperCase():o+=r[i];if(e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&o!==e)throw new Error('Invalid Checksum address for "'+e+'"');return o}function U(t,e){var r=a({},t);return Object.keys(t).forEach(function(n){switch(n){case"address":r[n]=I(t[n]);break;case"blockNumber":case"logIndex":case"transactionIndex":r[n]=Number(c(t[n]));break;case"removed":e&&delete r[n]}}),r}function S(t){return!!t.toHexString}function T(t){return L(t)&&!(t.length%2)||C(t)}function _(t){return"number"==typeof t&&t==t&&t%1==0}function C(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!_(t.length)||t.length<0)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(!_(r)||r<0||r>=256)return!1}return!0}function O(t,e){if(e||(e={}),"number"==typeof t){w.checkSafeUint53(t,"invalid arrayify value");for(var r=[];t;)r.unshift(255&t),t=parseInt(String(t/256));return 0===r.length&&r.push(0),new Uint8Array(r)}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),S(t)&&(t=t.toHexString()),L(t)){var n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":w.throwArgumentError("hex data is odd-length","value",t));for(var o=[],i=0;i<n.length;i+=2)o.push(parseInt(n.substring(i,i+2),16));return new Uint8Array(o)}return C(t)?new Uint8Array(t):w.throwArgumentError("invalid arrayify value","value",t)}function R(t){var e=t.map(function(t){return O(t)}),r=e.reduce(function(t,e){return t+e.length},0),n=new Uint8Array(r);return e.reduce(function(t,e){return n.set(e,t),t+e.length},0),n}function N(t,e){(t=O(t)).length>e&&w.throwArgumentError("value out of range","value",t);var r=new Uint8Array(e);return r.set(t,e-t.length),r}function L(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function M(t,e){if(e||(e={}),"number"==typeof t){w.checkSafeUint53(t,"invalid hexlify value");for(var r="";t;)r="0123456789abcdef"[15&t]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),S(t))return t.toHexString();if(L(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":w.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(C(t)){for(var n="0x",o=0;o<t.length;o++){var i=t[o];n+="0123456789abcdef"[(240&i)>>4]+"0123456789abcdef"[15&i]}return n}return w.throwArgumentError("invalid hexlify value","value",t)}function j(t,e,r){return"string"!=typeof t?t=M(t):(!L(t)||t.length%2)&&w.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function F(t){"string"!=typeof t&&(t=M(t)),L(t)||w.throwArgumentError("invalid hex string","value",t),t=t.substring(2);for(var e=0;e<t.length&&"0"===t[e];)e++;return"0x"+t.substring(e)}function G(t,e){for("string"!=typeof t?t=M(t):L(t)||w.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&w.throwError("value out of range",{value:t,length:e});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function q(t){var e=a({},t);return Object.keys(t).forEach(function(r){switch(r){case"gas":case"gasPrice":case"nonce":case"maxFeePerGas":case"maxPriorityFeePerGas":case"value":var n=t[r];e[r]=n instanceof B?n.toHexString():n instanceof s.default?"0x"+BigInt(n.toString()).toString(16):"number"==typeof t[r]?"0x"+t[r].toString(16):t[r].toString();break;case"data":e[r]=M(t[r])}}),e}var $={1:["eth","0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"],2:["exp"],3:["rop","0x112234455c3a32fd11230c42e7bccd4a84e02010"],4:["rin","0xe7410170f87102df0055eb195163a03b7f2bff4a"],5:["gor","0x112234455c3a32fd11230c42e7bccd4a84e02010"],6:["kot"],7:["tch"],8:["ubq"],9:["tubq"],10:["oeth"],11:["meta"],12:["kal"],13:["dstg"],14:["flr"],15:["diode"],16:["cflr"],17:["tfi"],18:["TST"],19:["sgb"],20:["elaeth"],21:["elaetht"],22:["eladid"],23:["eladidt"],24:["dthmainnet"],25:["cro"],26:["L1test"],27:["shib"],28:["Boba Rinkeby"],29:["L1"],30:["rsk"],31:["trsk"],32:["GooDT"],33:["GooD"],34:["dth"],35:["tbwg"],36:["dx"],38:["val"],40:["Telos EVM"],41:["Telos EVM Testnet"],42:["kov"],43:["pangolin"],44:["crab"],45:["pangoro"],46:["darwinia"],50:["xdc"],51:["TXDC"],52:["cet"],53:["tcet"],54:["OP"],55:["ZYX"],56:["bnb"],57:["sys"],58:["Ontology Mainnet"],59:["EOS Mainnet"],60:["go"],61:["etc"],62:["tetc"],63:["metc"],64:["ellaism"],65:["tokt"],66:["okt"],67:["dbm"],68:["SO1"],69:["okov"],70:["hsc"],71:["cfxtest"],72:["dxc"],74:["idchain"],76:["mix"],77:["spoa"],78:["primuschain"],79:["zenith"],80:["GeneChain"],81:["VIL"],82:["Meter"],83:["MeterTest"],85:["gttest"],86:["gt"],87:["nnw"],88:["tomo"],89:["tomot"],90:["gar-s0"],91:["gar-s1"],92:["gar-s2"],93:["gar-s3"],95:["Kylin Testnet"],96:["nsc"],97:["bnbt"],99:["poa"],100:["gno"],101:["eti"],102:["tw3g"],104:["tklc"],105:["dw3g"],106:["vlx"],107:["ntn"],108:["TT"],110:["xpr"],111:["ETL"],122:["fuse"],123:["spark"],124:["dwu"],125:["oychain testnet"],126:["oychain mainnet"],127:["feth"],128:["heco"],137:["MATIC"],141:["OPtest"],142:["dax"],162:["tpht"],163:["pht"],168:["aioz"],170:["hoosmartchain"],172:["resil"],180:["ame"],186:["Seele"],188:["BMC"],189:["BMCT"],193:["cem"],199:["BTT"],200:["aox"],211:["EDI"],218:["SO1-old"],222:["ASK"],225:["LA"],226:["TLA"],246:["ewt"],250:["ftm"],256:["hecot"],258:["setm"],262:["SUR"],269:["hpb"],280:["zksync-goerli"],288:["Boba"],300:["ogc"],321:["kcs"],322:["kcst"],333:["w3q"],335:["DFKTEST"],336:["sdn"],338:["tcro"],361:["theta-mainnet"],363:["theta-sapphire"],364:["theta-amber"],365:["theta-testnet"],369:["pls"],385:["lisinski"],416:["SX"],420:["ogor"],499:["rupx"],512:["aac"],513:["aact"],520:["xt"],530:["f(x)Core"],534:["CNDL"],555:["CLASS"],558:["tao"],588:["metis-stardust"],592:["astr"],595:["maca"],596:["tkar"],597:["taca"],600:["mesh-chain-testnet"],647:["SX-Testnet"],666:["pixie-chain-testnet"],686:["kar"],700:["SNS"],707:["bcs"],708:["tbcs"],721:["tfeth"],776:["opc"],777:["cth"],787:["aca"],788:["taero"],803:["haic"],808:["PFTEST"],820:["clo"],821:["tclo"],880:["ambros"],888:["wan"],900:["gar-test-s0"],901:["gar-test-s1"],902:["gar-test-s2"],903:["gar-test-s3"],909:["PF"],940:["tpls"],941:["t2bpls"],942:["t3pls"],977:["yeti"],980:["top_evm"],989:["top"],998:["ln"],999:["twan"],1e3:["gton"],1001:["Baobab"],1007:["tnew"],1008:["eun"],1010:["EVC"],1012:["new"],1022:["sku"],1023:["tclv"],1024:["clv"],1028:["tbtt"],1030:["cfx"],1088:["metis-andromeda"],1139:["MATH"],1140:["tMATH"],1197:["iora"],1201:["avis"],1202:["wtt"],1213:["popcat"],1214:["enter"],1246:["om"],1280:["HO"],1284:["mbeam"],1285:["mriver"],1286:["mrock-old"],1287:["mbase"],1288:["mrock"],1297:["Bobabase"],1319:["aitd"],1320:["aitdtestnet"],1337:["cennz-old"],1506:["Sherpax"],1507:["Sherpax Testnet"],1618:["cate"],1620:["ath"],1657:["bta"],1688:["LUDAN"],1818:["cube"],1819:["cubet"],1856:["tsf"],1898:["boya"],1984:["euntest"],1987:["egem"],2001:["milkAda"],2008:["cloudwalk_testnet"],2009:["cloudwalk_mainnet"],2020:["420"],2021:["edg"],2022:["edgt"],2023:["taycan-testnet"],2025:["rpg"],2100:["eco"],2101:["esp"],2152:["fra"],2153:["findora-testnet"],2213:["evanesco"],2221:["tkava"],2222:["kava"],2223:["VChain"],2559:["ktoc"],2569:["tpc"],2612:["EZChain"],2613:["Fuji-EZChain"],3e3:["cennz-r"],3001:["cennz-n"],3331:["zcrbeach"],3333:["w3q-t"],3334:["w3q-g"],3400:["prb"],3500:["prbtestnet"],3501:["jfin"],3690:["btx"],3737:["csb"],3966:["dyno"],3967:["tdyno"],3999:["ycc"],4002:["tftm"],4051:["Bobaopera Testnet"],4102:["aioz-testnet"],4181:["PHI"],4689:["iotex-mainnet"],4690:["iotex-testnet"],4918:["txvm"],4919:["xvm"],5177:["tlc"],5197:["es"],5315:["UZMI"],5551:["Nahmii"],5553:["Nahmii testnet"],5700:["tsys"],5777:["dgcc"],5851:["Ontology Testnet"],5869:["rbd"],6626:["pixie-chain"],6969:["tombchain"],7027:["ELLA"],7341:["shyft"],7777:["Rise of the Warbots Testnet"],7878:["tscas"],8e3:["teleport"],8001:["teleport-testnet"],8029:["mdgl"],8080:["GeneChainAdn"],8217:["Cypress"],8285:["Kortho"],8723:["olo"],8724:["tolo"],8888:["ambrostestnet"],8898:["mmt"],8995:["berg"],9e3:["evmos-testnet"],9001:["evmos"],9012:["brb"],9100:["GENEC"],9527:["trpg"],9999:["myn"],1e4:["smartbch"],10001:["smartbchtest"],10101:["GEN"],10823:["CCP"],10946:["quadrans"],10947:["quadranstestnet"],11111:["WAGMI"],11437:["shyftt"],12051:["tZERO"],12052:["ZERO"],13381:["Phoenix"],16e3:["mtt"],16001:["mtttest"],16888:["tivar"],19845:["btcix"],21337:["cennz-a"],21816:["omc"],22023:["SFL"],24484:["web"],24734:["mintme"],26863:["OAC"],30067:["Piece"],31102:["esn"],31337:["got"],32520:["Brise"],32659:["fsn"],35441:["q"],35443:["q-testnet"],39797:["nrg"],42069:["PC"],42161:["arb1"],42170:["arb-nova"],42220:["CELO"],42261:["emerald"],42262:["oasis"],43110:["avaeth"],43113:["Fuji"],43114:["avax"],44787:["ALFA"],45e3:["Autobahn Network"],47805:["REI"],49797:["tnrg"],50021:["tgton"],53935:["DFK"],55555:["reichain"],55556:["trei"],6e4:["TKM-test0"],60001:["TKM-test1"],60002:["TKM-test2"],60103:["TKM-test103"],62320:["BKLV"],62621:["mtv"],63e3:["ecs"],63001:["ecs-testnet"],69420:["cndr"],7e4:["TKM0"],70001:["TKM1"],70002:["TKM2"],70103:["TKM103"],71393:["ckb"],71401:["gw-testnet-v1"],71402:["gw-mainnet-v1"],73799:["vt"],73927:["mvm"],75e3:["resin"],78110:["firenze"],80001:["maticmum"],88888:["ivar"],99998:["usctest"],99999:["usc"],1e5:["qkc-r"],100001:["qkc-s0"],100002:["qkc-s1"],100003:["qkc-s2"],100004:["qkc-s3"],100005:["qkc-s4"],100006:["qkc-s5"],100007:["qkc-s6"],100008:["qkc-s7"],103090:["CRFI"],108801:["bro"],11e4:["qkc-d-r"],110001:["qkc-d-s0"],110002:["qkc-d-s1"],110003:["qkc-d-s2"],110004:["qkc-d-s3"],110005:["qkc-d-s4"],110006:["qkc-d-s5"],110007:["qkc-d-s6"],110008:["qkc-d-s7"],131419:["ETND"],200101:["milkTAda"],200625:["aka"],201018:["alaya"],201030:["alayadev"],210425:["platon"],234666:["hym"],246529:["ats"],246785:["atstau"],281121:["SoChain"],333888:["sparta"],333999:["olympus"],421611:["arb-rinkeby"],421613:["arb-goerli"],432201:["Dexalot"],444900:["wlkt"],474142:["oc"],512512:["cmp"],666666:["vpioneer"],846e3:["bloqs4good"],888888:["vision"],955305:["elv"],1313114:["etho"],1313500:["xero"],1337702:["kintsugi"],1337802:["kiln"],2203181:["platondev"],2206132:["platondev2"],7762959:["music"],11155111:["sep"],13371337:["tpep"],18289463:["ilt"],20180430:["spectrum"],20181205:["qki"],28945486:["auxi"],35855456:["JOYS"],61717561:["aqua"],99415706:["TOYS"],192837465:["GTH"],245022926:["neonevm-devnet"],245022934:["neonevm-mainnet"],245022940:["neonevm-testnet"],311752642:["oneledger"],356256156:["tGTH"],486217935:["dGTH"],1122334455:["ipos"],1313161554:["aurora"],1313161555:["aurora-testnet"],1313161556:["aurora-betanet"],16666e5:["hmy-s0"],1666600001:["hmy-s1"],1666600002:["hmy-s2"],1666600003:["hmy-s3"],16667e5:["hmy-b-s0"],1666700001:["hmy-b-s1"],1666700002:["hmy-b-s2"],1666700003:["hmy-b-s3"],2021121117:["hop"],3125659152:["pirl"],4216137055:["frankenstein"],11297108099:["tpalm"],11297108109:["palm"],197710212030:["ntt"],197710212031:["ntt-haradev"],6022140761023:["mole"],868455272153094:["gw-testnet-v1-deprecated"]};function D(t){return"number"==typeof t?A(t).toHexString():t}var z=/*#__PURE__*/function(){function t(t){var e=this;this._rpcUrls=[],this._post=function(t){return y(e.selectRpcUrl(),t)},this._rpcUrls=t}var e=t.prototype;return e.getNetwork=function(){try{return Promise.resolve(this.post(m("eth_chainId",[]))).then(function(t){var e=c(t),r=$[e];return{chainId:Number(e),name:r[0]||"unknown",ensAddress:r[1]||null}})}catch(t){return Promise.reject(t)}},e.getBlockNumber=function(){try{return Promise.resolve(this.post(m("eth_blockNumber",[]))).then(function(t){return Number(c(t))})}catch(t){return Promise.reject(t)}},e.getTransaction=function(t){try{return Promise.resolve(Promise.all([this.post(m("eth_getTransactionByHash",[t])),this.getBlock("latest")])).then(function(t){var e=t[1],r=P(t[0]);return r.confirmations=e.number-r.blockNumber+1,r})}catch(t){return Promise.reject(t)}},e.getTransactionReceipt=function(t){try{return Promise.resolve(Promise.all([this.post(m("eth_getTransactionReceipt",[t])),this.getBlock("latest")])).then(function(t){var e=t[1],r=function(t){var e=a({},P(t));return Object.keys(t).forEach(function(r){if(t[r])switch(r){case"status":e[r]=Number(c(t[r]));break;case"contractAddress":t[r]&&(e[r]=I(t[r]));break;case"cumulativeGasUsed":case"effectiveGasPrice":case"gasUsed":e[r]=A(c(t[r]));break;case"logs":t[r].forEach(function(t,n){e[r][n]=U(t,!0)})}}),e.byzantium=e.blockNumber>=437e4,e}(t[0]);return r.confirmations=e.number-r.blockNumber+1,r})}catch(t){return Promise.reject(t)}},e.getTransactionCount=function(t,e){void 0===e&&(e="latest");try{return e=D(e),Promise.resolve(this.post(m("eth_getTransactionCount",[t,e]))).then(function(t){return Number(c(t))})}catch(t){return Promise.reject(t)}},e.getBlock=function(t,e){void 0===t&&(t="latest"),void 0===e&&(e=!1);try{var r="Number";return"string"==typeof t&&66===t.length?r="Hash":t=D(t),Promise.resolve(this.post(m("eth_getBlockBy"+r,[t,e]))).then(function(t){return function(t,e){var r=a({},t);return Object.keys(t).forEach(function(e){if(t[e])switch(e){case"difficulty":case"totalDifficulty":case"gasLimit":case"gasUsed":case"size":case"timestamp":case"baseFeePerGas":r[e]=A(c(t[e]));break;case"number":r[e]=Number(c(t[e]));break;case"miner":r[e]=I(t[e])}}),e&&t.transactions.forEach(function(t,e){r.transactions[e]=P(t)}),r}(t,e)})}catch(t){return Promise.reject(t)}},e.getGasPrice=function(){try{return Promise.resolve(this.post(m("eth_gasPrice",[]))).then(function(t){return A(c(t))})}catch(t){return Promise.reject(t)}},e.getBalance=function(t,e){void 0===e&&(e="latest");try{return e=D(e),Promise.resolve(this.post(m("eth_getBalance",[t,e]))).then(function(t){return A(c(t))})}catch(t){return Promise.reject(t)}},e.getCode=function(t,e){void 0===e&&(e="latest");try{return e=D(e),Promise.resolve(this.post(m("eth_getCode",[t,e])))}catch(t){return Promise.reject(t)}},e.estimateGas=function(t){try{var e=q(t);return Promise.resolve(this.post(m("eth_estimateGas",[e]))).then(function(t){return A(c(t))})}catch(t){return Promise.reject(t)}},e.getLogs=function(t){try{var e=t;return e.fromBlock&&(e.fromBlock=D(e.fromBlock)),e.toBlock&&(e.toBlock=D(e.toBlock)),Promise.resolve(this.post(m("eth_getLogs",[t]))).then(function(t){return t.map(function(t){return U(t,!1)})})}catch(t){return Promise.reject(t)}},e.call=function(t,e){void 0===e&&(e="latest");try{t.gasPrice&&(t.maxPriorityFeePerGas||t.maxFeePerGas)&&w.throwError('Cannot specify both "gasPrice" and ("maxPriorityFeePerGas" or "maxFeePerGas")',{gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas}),t.maxFeePerGas&&t.maxPriorityFeePerGas&&w.throwError('Cannot specify both "maxFeePerGas" and "maxPriorityFeePerGas"',{maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas}),e=D(e);var r=q(t);return Promise.resolve(this.post(m("eth_call",[r,e])))}catch(t){return Promise.reject(t)}},t}(),K=/*#__PURE__*/function(t){function e(e,r){var n;return void 0===r&&(r={}),Array.isArray(e)||w.throwError("Array required",{rpcUrls:e}),e.length<=1&&w.throwError("More than one rpcUrl is required",{rpcUrls:e}),(n=t.call(this,e)||this).rpcUrlCounter=0,n.timeoutDuration=void 0,n.post=function(t){var e=n.rpcUrlCounter;return function r(){var o,i,s=n.selectRpcUrl();return(o=n._post(t),i=n.timeoutDuration,Promise.race([o,new Promise(function(t,e){return setTimeout(function(){return e("Promise timed out")},i)})])).catch(function(t){if(s===n.selectRpcUrl()&&(n.rpcUrlCounter=(n.rpcUrlCounter+1)%n._rpcUrls.length),n.rpcUrlCounter===e)throw t;return r()})}()},n.timeoutDuration=r.timeoutDuration||8e3,n}return u(e,t),e.prototype.selectRpcUrl=function(){return this._rpcUrls[this.rpcUrlCounter]},e}(z),H=/*#__PURE__*/function(t){u(r,t);var e=r.prototype;function r(e){return void 0===e&&(e="https://free-eth-node.com/api/eth"),t.call(this,[e])||this}return e.selectRpcUrl=function(){return this._rpcUrls[0]},e.post=function(t){return this._post(t)},r}(z);function V(e){var r;return r="string"==typeof e?Buffer.from(e.replace(/^0x/,""),"hex"):Buffer.from(e),"0x"+new t.Keccak(256).update(r).digest("hex")}function W(t){return t=M(t).slice(2),"0x"+n.Point.fromPrivateKey(t).toHex()}function Z(t){return new Uint8Array(Buffer.from(t))}for(var Y=[],J=[],X="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tt=0,et=Q.length;tt<et;++tt)Y[tt]=Q[tt],J[Q.charCodeAt(tt)]=tt;function rt(t,e,r){for(var n,o=[],i=e;i<r;i+=3)o.push(Y[(n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]))>>18&63]+Y[n>>12&63]+Y[n>>6&63]+Y[63&n]);return o.join("")}J["-".charCodeAt(0)]=62,J["_".charCodeAt(0)]=63;var nt,ot,it=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,f=u>>1,c=-7,h=r?o-1:0,l=r?-1:1,p=t[e+h];for(h+=l,i=p&(1<<-c)-1,p>>=-c,c+=a;c>0;i=256*i+t[e+h],h+=l,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+t[e+h],h+=l,c-=8);if(0===i)i=1-f;else{if(i===u)return s?NaN:Infinity*(p?-1:1);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},st=function(t,e,r,n,o,i){var s,a,u,f=8*i-o-1,c=(1<<f)-1,h=c>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,g=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||Infinity===e?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?l/u:l*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,o),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=g,a/=256,o-=8);for(s=s<<o|a,f+=o;f>0;t[r+p]=255&s,p+=g,s/=256,f-=8);t[r+p-g]|=128*y},at=(nt=function(t,e){const r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},e.INSPECT_MAX_BYTES=50;const n=2147483647;function o(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|l(t,e);let n=o(r);const s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){const e=new Uint8Array(t);return c(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return c(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return c(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return i.from(n,e,r);const s=function(t){if(i.isBuffer(t)){const e=0|h(t.length),r=o(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||V(t.length)?o(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return a(t),o(t<0?0:0|h(t))}function f(t){const e=t.length<0?0:0|h(t.length),r=o(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,i.prototype),n}function h(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function l(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(o)return n?-1:D(t).length;e=(""+e).toLowerCase(),o=!0}}function p(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){let i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){let n=-1;for(i=r;i<a;i++)if(f(t,i)===f(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(f(t,i+n)!==f(e,n)){r=!1;break}if(r)return i}return-1}function d(t,e,r,n){r=Number(r)||0;const o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=e.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(V(n))return s;t[r+s]=n}return s}function v(t,e,r,n){return K(D(e,t.length-r),t,r,n)}function b(t,e,r,n){return K(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return K(z(e),t,r,n)}function x(t,e,r,n){return K(function(t,e){let r,n,o;const i=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function E(t,e,r){return function(t){for(var e,r=t.length,n=r%3,o=[],i=16383,s=0,a=r-n;s<a;s+=i)o.push(rt(t,s,s+i>a?a:s+i));return 1===n?o.push(Y[(e=t[r-1])>>2]+Y[e<<4&63]+"=="):2===n&&o.push(Y[(e=(t[r-2]<<8)+t[r-1])>>10]+Y[e>>4&63]+Y[e<<2&63]+"="),o.join("")}(0===e&&r===t.length?t:t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o<r;){const e=t[o];let i=null,s=e>239?4:e>223?3:e>191?2:1;if(o+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(i=u));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=t[o+1],n=t[o+2],a=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));return r}(n)}e.kMaxLength=n,(i.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(t,e,r){return function(t,e,r){return a(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}(t,e,r)},i.allocUnsafe=function(t){return u(t)},i.allocUnsafeSlow=function(t){return u(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(H(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=i.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(H(e,Uint8Array))o+e.length>n.length?(i.isBuffer(e)||(e=i.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!i.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},i.byteLength=l,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},i.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},i.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},i.prototype.toLocaleString=i.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?B(this,0,t):p.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(t,e,r,n,o){if(H(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const u=Math.min(s,a),f=this.slice(n,o),c=t.slice(e,r);for(let t=0;t<u;++t)if(f[t]!==c[t]){s=f[t],a=c[t];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return d(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":case"latin1":case"binary":return b(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function P(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function k(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function I(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=W[t[n]];return o}function U(t,e,r){const n=t.slice(e,r);let o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}function S(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,n,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function _(t,e,r,n,o){F(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function C(t,e,r,n,o){F(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function O(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,4),st(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,8),st(t,e,r,n,52,8),r+8}i.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,i.prototype),n},i.prototype.readUintLE=i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readBigUInt64LE=Z(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),i.prototype.readBigUInt64BE=Z(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readBigInt64LE=Z(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];return void 0!==e&&void 0!==r||q(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),i.prototype.readBigInt64BE=Z(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),it(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),it(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),it(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),it(this,t,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||T(this,t,e,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||T(this,t,e,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeBigUInt64LE=Z(function(t,e=0){return _(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=Z(function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}let o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeBigInt64LE=Z(function(t,e=0){return _(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=Z(function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{const s=i.isBuffer(t)?t:i.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};const L={};function M(t,e,r){L[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function j(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,n,o,i){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let o;throw o=i>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new L.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(n,o,i)}function G(t,e){if("number"!=typeof t)throw new L.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new L.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),M("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=j(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=j(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function D(t,e){let r;e=e||Infinity;const n=t.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(t){return function(t){var e,r,n=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),o=n[0],i=n[1],s=new X(function(t,e,r){return 3*(e+r)/4-r}(0,o,i)),a=0,u=i>0?o-4:o;for(r=0;r<u;r+=4)e=J[t.charCodeAt(r)]<<18|J[t.charCodeAt(r+1)]<<12|J[t.charCodeAt(r+2)]<<6|J[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===i&&(e=J[t.charCodeAt(r)]<<2|J[t.charCodeAt(r+1)]>>4,s[a++]=255&e),1===i&&(e=J[t.charCodeAt(r)]<<10|J[t.charCodeAt(r+1)]<<4|J[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s}(function(t){if((t=(t=t.split("=")[0]).trim().replace($,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}const W=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function Z(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},nt(ot={exports:{}},ot.exports),ot.exports),ut=new RegExp("^bytes([0-9]+)$"),ft=new RegExp("^(u?int)([0-9]*)$"),ct=new RegExp("^(.*)\\[([0-9]*)\\]$");function ht(t,e,r){switch(t){case"address":return r?N(e,32):O(e);case"string":return at.Buffer.from(e);case"bytes":return O(e);case"bool":return e=e?"0x01":"0x00",r?N(e,32):O(e)}var n=t.match(ft);if(n){var o=parseInt(n[2]||"256");return(n[2]&&String(o)!==n[2]||o%8!=0||0===o||o>256)&&w.throwArgumentError("invalid number type","type",t),r&&(o=256),N(M(e=A(e).toTwos(o).toNumber()),o/8)}if(n=t.match(ut)){var i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&w.throwArgumentError("invalid bytes type","type",t),O(e).byteLength!==i&&w.throwArgumentError("invalid value for "+t,"value",e),r?O((e+h).substring(0,66)):e}if((n=t.match(ct))&&Array.isArray(e)){var s=n[1];parseInt(n[2]||String(e.length))!=e.length&&w.throwArgumentError("invalid array length for "+t,"value",e);var a=[];return e.forEach(function(t){a.push(ht(s,t,!0))}),R(a)}return w.throwArgumentError("invalid type","type",t)}function lt(t,e){t.length!=e.length&&w.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);var r=[];return t.forEach(function(t,n){r.push(ht(t,e[n]))}),M(R(r))}exports.BaseContract=v,exports.Contract=b,exports.FallthroughProvider=K,exports.JsonRpcProvider=H,exports.TinyBig=B,exports.arrayify=O,exports.computeAddress=function(t){return t.startsWith("0x04")||t.startsWith("0x03")||t.startsWith("0x02")||(t=W(t)),I(j(V(j(t,1)),12))},exports.computePublicKey=W,exports.concat=R,exports.etherToGwei=function(t){k(t,["string","number","object"]);var e=A(t).times("1000000000");return A(e)},exports.etherToWei=function(t){k(t,["string","number","object"]);var e=A(t).times("1000000000000000000");return A(e)},exports.gweiToEther=function(t){k(t,["string","number","object"]);var e=A(t).div("1000000000");return A(e)},exports.hashMessage=function(t){return"string"==typeof t&&(t=Z(t)),V(R([Z("Ethereum Signed Message:\n"),Z(String(t.length)),t]))},exports.hexConcat=function(t){var e="0x";return t.forEach(function(t){e+=M(t).substring(2)}),e},exports.hexDataLength=function(t){if("string"!=typeof t)t=M(t);else if(!L(t)||t.length%2)return null;return(t.length-2)/2},exports.hexDataSlice=j,exports.hexStripZeros=F,exports.hexValue=function(t){var e=F(M(t,{hexPad:"left"}));return"0x"===e?"0x0":e},exports.hexZeroPad=G,exports.hexlify=M,exports.isAddress=function(t){k(t,["string"]);try{return I(t),!0}catch(t){return!1}},exports.isBytes=C,exports.isBytesLike=T,exports.isHexString=L,exports.jsonRpcProvider=function(t){return new H(t)},exports.keccak256=V,exports.pack=lt,exports.solidityKeccak256=function(t,e){return V(lt(t,e))},exports.splitSignature=function(t){var e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(T(t)){var r=O(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=M(r.slice(0,32)),e.s=M(r.slice(32,64))):65===r.length?(e.r=M(r.slice(0,32)),e.s=M(r.slice(32,64)),e.v=r[64]):w.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:w.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=M(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){var n=N(O(e._vs),32);e._vs=M(n);var o=n[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=o:e.recoveryParam!==o&&w.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;var i=M(n);null==e.s?e.s=i:e.s!==i&&w.throwArgumentError("signature v mismatch _vs","signature",t)}null==e.recoveryParam?null==e.v?w.throwArgumentError("signature missing v and recoveryParam","signature",t):e.recoveryParam=0===e.v||1===e.v?e.v:1-e.v%2:null==e.v?e.v=27+e.recoveryParam:e.recoveryParam!==(0===e.v||1===e.v?e.v:1-e.v%2)&&w.throwArgumentError("signature recoveryParam mismatch v","signature",t),null!=e.r&&L(e.r)?e.r=G(e.r,32):w.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&L(e.s)?e.s=G(e.s,32):w.throwArgumentError("signature missing or invalid s","signature",t);var s=O(e.s);s[0]>=128&&w.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(s[0]|=128);var a=M(s);e._vs&&(L(e._vs)||w.throwArgumentError("signature invalid _vs","signature",t),e._vs=G(e._vs,32)),null==e._vs?e._vs=a:e._vs!==a&&w.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e},exports.stripZeros=function(t){var e=O(t);if(0===e.length)return e;for(var r=0;r<e.length&&0===e[r];)r++;return r&&(e=e.slice(r)),e},exports.tinyBig=A,exports.toChecksumAddress=I,exports.toUtf8Bytes=Z,exports.weiToEther=function(t){k(t,["string","number","object"]);try{var e=t;"string"==typeof t&&"0x"===t.slice(0,2)&&(e=BigInt(t).toString());var r=A(e).div("1000000000000000000");return A(r)}catch(t){throw t}},exports.zeroPad=N;
2
- //# sourceMappingURL=index.cjs.map