evm-chains-info 0.0.31 → 0.0.33

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/evm-chains-info CHANGED
@@ -32,8 +32,8 @@
32
32
 
33
33
  const
34
34
  _libcrash =
35
- require(
36
- 'crash-js');
35
+ await import(
36
+ "libcrash-js");
37
37
  /* global
38
38
  _argv_get */
39
39
  const
@@ -49,11 +49,31 @@ const
49
49
  const
50
50
  _cmdline_check =
51
51
  _libcrash._cmdline_check;
52
+ /* global
53
+ _echo */
54
+ const
55
+ _echo =
56
+ _libcrash._echo;
57
+ /* global
58
+ _exit */
59
+ const
60
+ _exit =
61
+ _libcrash._exit;
62
+ /* global
63
+ _get */
64
+ const
65
+ _get =
66
+ _libcrash._get;
52
67
  /* global
53
68
  _get_date_human */
54
69
  const
55
70
  _get_date_human =
56
71
  _libcrash._get_date_human;
72
+ /* global
73
+ _global_get */
74
+ const
75
+ _global_get =
76
+ _libcrash._global_get;
57
77
  /* global
58
78
  _msg_info */
59
79
  const
@@ -70,14 +90,14 @@ const
70
90
  _override_set =
71
91
  _libcrash._override_set;
72
92
  /* global
73
- _exit */
93
+ _set */
74
94
  const
75
- _exit =
76
- _libcrash._exit;
95
+ _set =
96
+ _libcrash._set;
77
97
 
78
98
  const
79
99
  _libevm_chains_info =
80
- require(
100
+ await import(
81
101
  "./libevm-chains-info");
82
102
  /* global
83
103
  _evm_chains_db_path_get */
@@ -120,87 +140,122 @@ function
120
140
  /* global
121
141
  app_name:
122
142
  writable */
123
- app_name =
124
- "evm-chains-info.js";
143
+ _set(
144
+ "app",
145
+ "name",
146
+ "evm-chains-info.js");
125
147
  /* global
126
148
  app_opts:
127
149
  writable */
128
- app_opts =
129
- [];
150
+ _set(
151
+ "app",
152
+ "opts",
153
+ []);
130
154
  /* global
131
155
  runtime_environment:
132
156
  writable */
133
- runtime_environment =
134
- "";
157
+ _set(
158
+ "runtime",
159
+ "environment",
160
+ "");
135
161
  /* global
136
162
  call_date:
137
163
  writable */
138
- call_date =
139
- "";
164
+ _set(
165
+ "call",
166
+ "date",
167
+ "");
140
168
  /* global
141
169
  target_command:
142
170
  writable */
143
- target_command =
144
- "";
171
+ _set(
172
+ "target",
173
+ "command",
174
+ "");
145
175
  /* global
146
176
  input_type:
147
177
  writable */
148
- input_type =
149
- "";
178
+ _set(
179
+ "input",
180
+ "type",
181
+ "");
150
182
  /* global
151
183
  output_type:
152
184
  writable */
153
- output_type =
154
- "";
185
+ _set(
186
+ "output",
187
+ "type",
188
+ "");
155
189
  /* global
156
190
  retrieval_mode:
157
191
  writable */
158
- retrieval_mode =
159
- "";
192
+ _set(
193
+ "retrieval",
194
+ "mode",
195
+ "");
160
196
  /* global
161
197
  db_types:
162
198
  writable */
163
- db_types =
164
- [];
199
+ _set(
200
+ "retrieval",
201
+ "mode",
202
+ []);
165
203
  /* global
166
204
  user_level:
167
205
  writable */
168
- user_level =
169
- "";
206
+ _set(
207
+ "user",
208
+ "level",
209
+ "");
170
210
  /* global
171
211
  db_paths:
172
212
  writable */
173
- db_paths =
174
- [];
213
+ _set(
214
+ "db",
215
+ "paths",
216
+ []);
175
217
  /* global
176
218
  selection_method:
177
219
  writable */
178
- selection_method =
179
- "";
220
+ _set(
221
+ "selection",
222
+ "method",
223
+ "");
180
224
  /* global
181
225
  api_key:
182
226
  writable */
183
- api_key =
184
- "";
227
+ _set(
228
+ "api",
229
+ "key",
230
+ "");
185
231
  /* global
186
232
  target_chain:
187
233
  writable */
188
- target_chain =
189
- "";
234
+ _set(
235
+ "target",
236
+ "chain",
237
+ "");
190
238
  /* global
191
239
  networks_all:
192
240
  writable */
193
- networks_all =
194
- "";
241
+ _set(
242
+ "networks",
243
+ "all",
244
+ "");
195
245
  /* global
196
246
  quiet:
197
247
  writable */
198
- quiet =
248
+ const
249
+ _global =
250
+ _global_get();
251
+ _global[
252
+ "quiet"] =
199
253
  "";
200
254
  /* global
201
255
  verbose:
202
256
  writable */
203
- verbose =
257
+ _global[
258
+ "verbose"] =
204
259
  "";
205
260
  }
206
261
 
@@ -329,14 +384,14 @@ function
329
384
  " -v --verbose Enable verbose output."
330
385
  ];
331
386
  for ( _line of _text ) {
332
- console.log(
387
+ _echo(
333
388
  _line);
334
389
  }
335
390
  _exit(
336
391
  _exit_code);
337
392
  }
338
393
 
339
- function
394
+ async function
340
395
  _cmdline_parse() {
341
396
  let
342
397
  _help_display,
@@ -352,18 +407,24 @@ function
352
407
  };
353
408
  const
354
409
  _argv =
355
- _argv_get(
410
+ await _argv_get(
356
411
  _argv_args);
412
+ const
413
+ _global =
414
+ _global_get();
357
415
  const
358
416
  _options =
359
417
  _argv[
360
418
  "_"];
361
- quiet =
419
+ _global[
420
+ "quiet"] =
362
421
  "y";
363
422
  _help_display =
364
423
  false;
365
- runtime_environment =
366
- "node";
424
+ _set(
425
+ "runtime",
426
+ "environment",
427
+ "node");
367
428
  if ( _argv["h"] == true ) {
368
429
  _help_display =
369
430
  true;
@@ -380,7 +441,8 @@ function
380
441
  true;
381
442
  }
382
443
  if ( _help_display ) {
383
- quiet =
444
+ _global[
445
+ "quiet"] =
384
446
  "n";
385
447
  _overrides_set();
386
448
  _usage(
@@ -403,115 +465,170 @@ function
403
465
  _usage(
404
466
  0);
405
467
  }
406
- target_chain =
468
+ _set(
469
+ "target",
470
+ "chain",
407
471
  _argv[
408
472
  "_"][
409
- 0];
473
+ 0]);
410
474
  if ( "C" in _argv ) {
411
- target_command =
475
+ _set(
476
+ "target",
477
+ "chain",
412
478
  _argv[
413
- "C"];
479
+ "C"]);
414
480
  }
415
481
  if ( "command" in _argv ) {
416
- target_command =
482
+ _set(
483
+ "target",
484
+ "command",
417
485
  _argv[
418
- "command"];
486
+ "command"]);
419
487
  }
420
488
  if ( "i" in _argv ) {
421
- input_type =
489
+ _set(
490
+ "input",
491
+ "type",
422
492
  _argv[
423
- "i"];
493
+ "i"]);
424
494
  }
425
495
  if ( "input-type" in _argv ) {
426
- input_type =
496
+ _set(
497
+ "input",
498
+ "type",
427
499
  _argv[
428
- "input-type"];
500
+ "input-type"]);
429
501
  }
430
502
  if ( "o" in _argv ) {
431
- output_type =
503
+ _set(
504
+ "output",
505
+ "type",
432
506
  _argv[
433
- "o"];
507
+ "o"]);
434
508
  }
435
509
  if ( "output-type" in _argv ) {
436
- output_type =
510
+ _set(
511
+ "output",
512
+ "type",
437
513
  _argv[
438
- "output-type"];
514
+ "output-type"]);
439
515
  }
440
516
  if ( "m" in _argv ) {
441
- retrieval_mode =
517
+ _set(
518
+ "retrieval",
519
+ "mode",
442
520
  _argv[
443
- "m"];
521
+ "m"]);
444
522
  }
445
523
  if ( "retrieval-mode" in _argv ) {
446
- retrieval_mode =
524
+ _set(
525
+ "retrieval",
526
+ "mode",
447
527
  _argv[
448
- "retrieval-mode"];
528
+ "retrieval-mode"]);
449
529
  }
450
530
  if ( "u" in _argv ) {
451
- user_level =
531
+ _set(
532
+ "user",
533
+ "level",
452
534
  _argv[
453
- "u"];
535
+ "u"]);
454
536
  }
455
537
  if ( "user-level" in _argv ) {
456
- user_level =
538
+ _set(
539
+ "user",
540
+ "level",
457
541
  _argv[
458
- "user-level"];
542
+ "user-level"]);
459
543
  }
544
+ const
545
+ _db_paths =
546
+ _get(
547
+ "db",
548
+ "paths");
460
549
  if ( "d" in _argv ) {
461
- db_paths.push(
550
+ _db_paths.push(
462
551
  _argv[
463
552
  "d"]);
464
553
  }
465
554
  if ( "db-path" in _argv ) {
466
- db_paths.push(
555
+ _db_paths.push(
467
556
  _argv[
468
557
  "db-paths"]);
469
558
  }
559
+ _set(
560
+ "db",
561
+ "paths",
562
+ _db_paths);
563
+ const
564
+ _db_types =
565
+ _get(
566
+ "db",
567
+ "types");
470
568
  if ( "t" in _argv ) {
471
- db_types.push(
569
+ _db_types.push(
472
570
  _argv[
473
571
  "t"]);
474
572
  }
475
573
  if ( "db-types" in _argv ) {
476
- db_types.push(
574
+ _db_types.push(
477
575
  _argv[
478
576
  "db-types"]);
479
577
  }
578
+ _set(
579
+ "db",
580
+ "types",
581
+ _db_types);
480
582
  if ( "s" in _argv ) {
481
- selection_method =
583
+ _set(
584
+ "selection",
585
+ "method",
482
586
  _argv[
483
- "s"];
587
+ "s"]);
484
588
  }
485
589
  if ( "selection-method" in _argv ) {
486
- selection_method =
590
+ _set(
591
+ "selection",
592
+ "method",
487
593
  _argv[
488
- "selection-method"];
594
+ "selection-method"]);
489
595
  }
490
596
  if ( "k" in _argv ) {
491
- api_key =
492
- "y";
597
+ _set(
598
+ "api",
599
+ "key",
600
+ "y");
493
601
  }
494
602
  if ( "api-key" in _argv ) {
495
- api_key =
496
- "y";
603
+ _set(
604
+ "api",
605
+ "key",
606
+ "y");
497
607
  }
498
608
  if ( "a" in _argv ) {
499
- networks_all =
500
- "y";
609
+ _set(
610
+ "networks",
611
+ "all",
612
+ "y");
501
613
  }
502
614
  if ( "networks-all" in _argv ) {
503
- networks_all =
504
- "y";
615
+ _set(
616
+ "networks",
617
+ "all",
618
+ "y");
505
619
  }
506
620
  if ( _argv[
507
621
  "v"] ||
508
622
  _argv[
509
623
  "verbose"]) {
510
- verbose =
624
+ _global[
625
+ "verbose"] =
511
626
  true;
512
627
  }
513
- if ( verbose ) {
514
- quiet =
628
+ if ( _global[
629
+ "verbose"] ) {
630
+ _global[
631
+ "quiet"] =
515
632
  "n";
516
633
  }
517
634
  }
@@ -577,14 +694,26 @@ async function
577
694
  _evm_chains_info_cmdline(
578
695
  _app_opts) {
579
696
  let
580
- _result;
697
+ _result,
698
+ _results;
699
+ _results =
700
+ await _evm_chains_info.apply(
701
+ null,
702
+ _app_opts);
581
703
  const
704
+ _results_length =
705
+ _results.length;
706
+ const
707
+ _results_length_type =
708
+ typeof(
709
+ _results_length);
710
+ if ( _results_length_type == "undefined" ) {
582
711
  _results =
583
- await _evm_chains_info.apply(
584
- null,
585
- app_opts);
712
+ Object.keys(
713
+ _results);
714
+ }
586
715
  for ( _result of _results ) {
587
- console.log(
716
+ _echo(
588
717
  _result);
589
718
  }
590
719
  _exit(
@@ -592,16 +721,16 @@ async function
592
721
  }
593
722
 
594
723
  _global_variables();
595
- if ( _cmdline_check(
724
+ if ( await _cmdline_check(
596
725
  "evm-chains-info.js") ||
597
- _cmdline_check(
726
+ await _cmdline_check(
598
727
  "evm-chains-info") ) {
599
- _cmdline_parse();
728
+ await _cmdline_parse();
600
729
  }
601
730
  else{
602
731
  _url_parse();
603
732
  }
604
- _overrides_set();
733
+ await _overrides_set();
605
734
  _config_show();
606
735
  app_opts = [
607
736
  target_command,
@@ -616,5 +745,5 @@ app_opts = [
616
745
  db_paths,
617
746
  user_level
618
747
  ];
619
- _evm_chains_info_cmdline(
748
+ await _evm_chains_info_cmdline(
620
749
  app_opts);
@@ -0,0 +1,82 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+
3
+ /** ---------------------------------------------------------
4
+ * fs-worker.webpack.config.cjs
5
+ * ---------------------------------------------------------
6
+ * Copyright ©
7
+ * Pellegrino Prevete
8
+ * 2025, 2026
9
+ *
10
+ * All rights reserved
11
+ * ---------------------------------------------------------
12
+ *
13
+ * This program is free software: you can redistribute it and/or
14
+ * modify it under the terms of the GNU General Public License
15
+ * as published by the Free Software Foundation, either
16
+ * version 3 of the License, or (at your option) any later
17
+ * version.
18
+ *
19
+ * This program is distributed in the hope that it will be
20
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
21
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
22
+ * PURPOSE.
23
+ * See the GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the
26
+ * GNU General Public License along with this program.
27
+ * If not, see <https://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ const
31
+ _path =
32
+ require(
33
+ 'path');
34
+ const
35
+ _output_dir =
36
+ _path.resolve(
37
+ __dirname);
38
+ const
39
+ _input_file_name =
40
+ "fs-worker";
41
+ const
42
+ _input_file_path =
43
+ `./node_modules/opfs/${_input_file_name}`;
44
+ const
45
+ _output_file_name =
46
+ `${_input_file_name}.js`;
47
+ const
48
+ _output = {
49
+ path:
50
+ _output_dir,
51
+ filename:
52
+ _output_file_name
53
+ };
54
+ module.exports = {
55
+ entry:
56
+ _input_file_path,
57
+ output:
58
+ _output,
59
+ optimization: {
60
+ moduleIds: 'deterministic',
61
+ },
62
+ resolve: {
63
+ alias: {
64
+ "fs":
65
+ _path.resolve(
66
+ __dirname,
67
+ "node_modules/fs/fs"),
68
+ "node:fs":
69
+ _path.resolve(
70
+ __dirname,
71
+ "node_modules/opfs/opfs"),
72
+ "opfs":
73
+ _path.resolve(
74
+ __dirname,
75
+ 'node_modules/opfs/opfs'),
76
+ "path":
77
+ _path.resolve(
78
+ __dirname,
79
+ 'node_modules/path/mod.js'),
80
+ },
81
+ }
82
+ };