evm-contracts-tools 0.0.50 → 0.0.52

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.
Files changed (75) hide show
  1. package/dist/evm-contract-call/evm-contract-call.js +1 -2
  2. package/dist/evm-contract-call/fs-worker.js +1 -1
  3. package/dist/evm-contract-deployment-abi/evm-contract-deployment-abi.js +1 -2
  4. package/dist/evm-contract-deployment-abi/fs-worker.js +1 -1
  5. package/dist/evm-contract-deployment-address/evm-contract-deployment-address.js +1 -2
  6. package/dist/evm-contract-deployment-address/fs-worker.js +1 -1
  7. package/dist/evm-contract-deployment-bytecode/evm-contract-deployment-bytecode.js +1 -2
  8. package/dist/evm-contract-deployment-bytecode/fs-worker.js +1 -1
  9. package/dist/evm-contract-deployment-compiler-output/evm-contract-deployment-compiler-output.js +1 -2
  10. package/dist/evm-contract-deployment-compiler-output/fs-worker.js +1 -1
  11. package/dist/evm-contract-deployment-deployment-networks +1 -1
  12. package/dist/evm-contract-deployment-networks/evm-contract-deployment-networks.js +1 -2
  13. package/dist/evm-contract-deployment-versions/evm-contract-deployment-versions.js +1 -2
  14. package/dist/evm-contract-deployment-versions/fs-worker.js +1 -1
  15. package/dist/evm-contract-deployments-dir/evm-contract-deployments-dir.js +1 -2
  16. package/dist/evm-contract-deployments-dir/fs-worker.js +1 -1
  17. package/dist/evm-contracts-tools/evm-contracts-tools.js +1 -2
  18. package/dist/evm-contracts-tools/fs-worker.js +1 -1
  19. package/dist/libevm-contract-call/fs-worker.js +1 -1
  20. package/dist/libevm-contract-call/libevm-contract-call.js +1 -2
  21. package/dist/libevm-contract-deployment-abi/fs-worker.js +1 -1
  22. package/dist/libevm-contract-deployment-abi/libevm-contract-deployment-abi.js +1 -2
  23. package/dist/libevm-contract-deployment-address/fs-worker.js +1 -1
  24. package/dist/libevm-contract-deployment-address/libevm-contract-deployment-address.js +1 -1
  25. package/dist/libevm-contract-deployment-bytecode/fs-worker.js +1 -1
  26. package/dist/libevm-contract-deployment-bytecode/libevm-contract-deployment-bytecode.js +1 -2
  27. package/dist/libevm-contract-deployment-compiler-output/fs-worker.js +1 -1
  28. package/dist/libevm-contract-deployment-compiler-output/libevm-contract-deployment-compiler-output.js +1 -0
  29. package/dist/libevm-contract-deployment-deployment-networks +1 -1
  30. package/dist/libevm-contract-deployment-networks/libevm-contract-deployment-networks.js +1 -2
  31. package/dist/libevm-contract-deployment-versions/fs-worker.js +1 -1
  32. package/dist/libevm-contract-deployment-versions/libevm-contract-deployment-versions.js +1 -2
  33. package/dist/libevm-contract-deployments-dir/fs-worker.js +1 -1
  34. package/dist/libevm-contract-deployments-dir/libevm-contract-deployments-dir.js +1 -2
  35. package/dist/libevm-contracts-tools +1 -1
  36. package/eslint.config.mjs +131 -0
  37. package/evm-contract-call +348 -151
  38. package/evm-contract-call.webpack.config.cjs +159 -0
  39. package/evm-contract-deployment-abi +212 -87
  40. package/evm-contract-deployment-abi.webpack.config.cjs +159 -0
  41. package/evm-contract-deployment-address +209 -89
  42. package/evm-contract-deployment-address.webpack.config.cjs +159 -0
  43. package/evm-contract-deployment-bytecode +146 -61
  44. package/evm-contract-deployment-bytecode.webpack.config.cjs +159 -0
  45. package/evm-contract-deployment-compiler-output +168 -67
  46. package/evm-contract-deployment-compiler-output.webpack.config.cjs +159 -0
  47. package/evm-contract-deployment-networks +160 -68
  48. package/evm-contract-deployment-networks.webpack.config.cjs +159 -0
  49. package/evm-contract-deployment-versions +138 -66
  50. package/evm-contract-deployment-versions.webpack.config.cjs +159 -0
  51. package/evm-contract-deployments-dir +116 -47
  52. package/evm-contract-deployments-dir.webpack.config.cjs +159 -0
  53. package/evm-contracts-tools +41 -29
  54. package/fs-worker.webpack.config.cjs +82 -0
  55. package/lib/address-check +0 -0
  56. package/lib/evm-contract-call-dynamic +0 -0
  57. package/lib/evm-contract-call-static +0 -0
  58. package/libevm-contract-call +254 -58
  59. package/libevm-contract-call.webpack.config.cjs +159 -0
  60. package/libevm-contract-deployment +39 -41
  61. package/libevm-contract-deployment-abi +31 -18
  62. package/libevm-contract-deployment-abi.webpack.config.cjs +155 -0
  63. package/libevm-contract-deployment-address.webpack.config.cjs +155 -0
  64. package/libevm-contract-deployment-bytecode +31 -18
  65. package/libevm-contract-deployment-bytecode.webpack.config.cjs +155 -0
  66. package/libevm-contract-deployment-compiler-output +32 -19
  67. package/libevm-contract-deployment-compiler-output.webpack.config.cjs +155 -0
  68. package/libevm-contract-deployment-networks +20 -11
  69. package/libevm-contract-deployment-networks.webpack.config.cjs +159 -0
  70. package/libevm-contract-deployment-versions +16 -10
  71. package/libevm-contract-deployment-versions.webpack.config.cjs +159 -0
  72. package/libevm-contract-deployments-dir +12 -7
  73. package/libevm-contract-deployments-dir.webpack.config.cjs +159 -0
  74. package/package.json +49 -50
  75. package/webpack.config.cjs +155 -0
@@ -0,0 +1,159 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+
3
+ /** ---------------------------------------------------------
4
+ * evm-contract-call.webpack.config.cjs
5
+ * ---------------------------------------------------------
6
+ * Copyright ©
7
+ * Pellegrino Prevete
8
+ * 2024, 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
+ `evm-contract-call`;
41
+ const
42
+ _input_file_path =
43
+ `./${_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
+ const
55
+ _node_fs_ignore =
56
+ { resourceRegExp:
57
+ /^node:fs$/ };
58
+ const
59
+ _yargs_ignore =
60
+ { resourceRegExp:
61
+ /^yargs$/ };
62
+ const
63
+ _yargs_helpers_ignore =
64
+ { resourceRegExp:
65
+ /^yargs\/helpers$/ };
66
+ const
67
+ _webpack =
68
+ require(
69
+ "webpack");
70
+ const
71
+ _ignore_plugin =
72
+ _webpack.IgnorePlugin;
73
+ const
74
+ _node_fs_ignore_plugin =
75
+ new _ignore_plugin(
76
+ _node_fs_ignore);
77
+ const
78
+ _yargs_ignore_plugin =
79
+ new _ignore_plugin(
80
+ _yargs_ignore);
81
+ const
82
+ _yargs_helpers_ignore_plugin =
83
+ new _ignore_plugin(
84
+ _yargs_helpers_ignore);
85
+ module.exports = {
86
+ entry:
87
+ _input_file_path,
88
+ output:
89
+ _output,
90
+ optimization: {
91
+ moduleIds: 'deterministic',
92
+ },
93
+ resolve: {
94
+ alias: {
95
+ "node:fs":
96
+ _path.resolve(
97
+ __dirname,
98
+ 'node_modules/opfs/opfs'),
99
+ "fs":
100
+ _path.resolve(
101
+ __dirname,
102
+ 'node_modules/fs/fs'),
103
+ "evm-contracts-tools":
104
+ _path.resolve(
105
+ __dirname,
106
+ "evm-contracts-tools"),
107
+ "evm-transactions-tools":
108
+ _path.resolve(
109
+ __dirname,
110
+ "node_modules/evm-transactions-tools/evm-transactions-tools"),
111
+ "evm-wallet":
112
+ _path.resolve(
113
+ __dirname,
114
+ 'node_modules/evm-wallet/libevm-wallet'),
115
+ "libevm":
116
+ _path.resolve(
117
+ __dirname,
118
+ 'node_modules/libevm/libevm'),
119
+ "path":
120
+ _path.resolve(
121
+ __dirname,
122
+ 'node_modules/path/mod.js'),
123
+ "web-worker":
124
+ _path.resolve(
125
+ __dirname,
126
+ 'node_modules/web-worker/mod.js'),
127
+ "yargs":
128
+ _path.resolve(
129
+ __dirname,
130
+ 'node_modules/yargs/browser.mjs'),
131
+ "yargs/helpers":
132
+ _path.resolve(
133
+ __dirname,
134
+ 'node_modules/yargs/helpers/helpers.mjs'),
135
+ "yargs-parser":
136
+ _path.resolve(
137
+ __dirname,
138
+ 'node_modules/yargs-parser/browser.mjs'),
139
+ },
140
+ fallback: {
141
+ "utils":
142
+ false,
143
+ "web-worker":
144
+ false,
145
+ "yargs":
146
+ false,
147
+ "yargs/helpers":
148
+ false,
149
+ }
150
+ },
151
+ externals:
152
+ { yargs:
153
+ 'yargs' },
154
+ plugins: [
155
+ _node_fs_ignore_plugin,
156
+ _yargs_ignore_plugin,
157
+ _yargs_helpers_ignore_plugin
158
+ ]
159
+ };
@@ -37,8 +37,8 @@
37
37
 
38
38
  const
39
39
  _libcrash =
40
- require(
41
- "crash-js");
40
+ await import(
41
+ "libcrash-js");
42
42
  /* global
43
43
  _argv_get */
44
44
  const
@@ -54,11 +54,31 @@ const
54
54
  const
55
55
  _cmdline_check =
56
56
  _libcrash._cmdline_check;
57
+ /* global
58
+ _echo */
59
+ const
60
+ _echo =
61
+ _libcrash._echo;
62
+ /* global
63
+ _exit */
64
+ const
65
+ _exit =
66
+ _libcrash._exit;
57
67
  /* global
58
68
  _get_date_human */
59
69
  const
60
70
  _get_date_human =
61
71
  _libcrash._get_date_human;
72
+ /* global
73
+ _get */
74
+ const
75
+ _get =
76
+ _libcrash._get;
77
+ /* global
78
+ _global_get */
79
+ const
80
+ _global_get =
81
+ _libcrash._global_get;
62
82
  /* global
63
83
  _msg_info */
64
84
  const
@@ -80,14 +100,14 @@ const
80
100
  _printf =
81
101
  _libcrash._printf;
82
102
  /* global
83
- _process_exit */
103
+ _set */
84
104
  const
85
- _process_exit =
86
- _libcrash._process_exit;
105
+ _set =
106
+ _libcrash._set;
87
107
  const
88
108
  _libevm_contract_deployment_abi_module =
89
- require(
90
- "./libevm-contract-deployment-abi");
109
+ await import(
110
+ "./libevm-contract-deployment-abi");
91
111
  /* global
92
112
  _evm_contract_deployment_abi */
93
113
  const
@@ -119,74 +139,105 @@ function
119
139
  /* global
120
140
  app_name:
121
141
  writable */
122
- app_name =
123
- "evm-contract-deployments-abi.js";
142
+ _set(
143
+ "app",
144
+ "name",
145
+ "evm-contract-deployments-abi.js");
124
146
  /* global
125
147
  app_opts:
126
148
  writable */
127
- app_opts =
128
- [];
149
+ _set(
150
+ "app",
151
+ "opts",
152
+ []);
129
153
  /* global
130
154
  runtime_environment:
131
155
  writable */
132
- runtime_environment =
133
- "";
156
+ _set(
157
+ "runtime",
158
+ "environment",
159
+ "");
134
160
  /* global
135
161
  resolve_date:
136
162
  writable */
137
- resolve_date =
138
- "";
163
+ _set(
164
+ "resolve",
165
+ "date",
166
+ "");
139
167
  /* global
140
168
  target_networks:
141
169
  writable */
142
- target_networks =
143
- [];
170
+ _set(
171
+ "target",
172
+ "network",
173
+ []);
144
174
  /* global
145
175
  network_ids:
146
176
  writable */
147
- network_ids =
148
- [];
177
+ _set(
178
+ "networks",
179
+ "ids",
180
+ []);
149
181
  /* global
150
182
  networks_all:
151
183
  writable */
152
- networks_all =
153
- "";
184
+ _set(
185
+ "networks",
186
+ "all",
187
+ "");
154
188
  /* global
155
189
  target_app:
156
190
  writable */
157
- target_app =
158
- "";
191
+ _set(
192
+ "target",
193
+ "app",
194
+ "");
159
195
  /* global
160
196
  target_contract:
161
197
  writable */
162
- target_contract =
163
- "";
198
+ _set(
199
+ "target",
200
+ "contract",
201
+ "");
164
202
  /* global
165
203
  contract_version:
166
204
  writable */
167
- contract_version =
168
- "";
205
+ _set(
206
+ "contract",
207
+ "version",
208
+ "");
169
209
  /* global
170
210
  user_defined:
171
211
  writable */
172
- user_defined =
173
- "";
212
+ _set(
213
+ "user",
214
+ "defined",
215
+ "");
174
216
  /* global
175
217
  configuration_format:
176
218
  writable */
177
- configuration_format =
178
- "";
219
+ _set(
220
+ "configuration",
221
+ "format",
222
+ "");
179
223
  /* global
180
224
  deployments_dir:
181
225
  writable */
182
- deployments_dir =
183
- "";
184
- quiet =
226
+ _set(
227
+ "deployments",
228
+ "dir",
229
+ "");
230
+ const
231
+ _global =
232
+ _global_get();
233
+ _global[
234
+ "quiet"] =
185
235
  "";
186
236
  /* global
187
237
  verbose:
188
238
  writable */
189
- verbose =
239
+ _global[
240
+ "verbose"] =
190
241
  "";
191
242
  }
192
243
 
@@ -215,9 +266,14 @@ function
215
266
  _config_show() {
216
267
  let
217
268
  _line;
269
+ const
270
+ _app_name =
271
+ _get(
272
+ "app",
273
+ "name");
218
274
  const
219
275
  _text = [
220
- `${app_name} configuration:`,
276
+ `${_app_name} configuration:`,
221
277
  ` Resolve date: ${resolve_date}`,
222
278
  ` Runtime environment: ${runtime_environment}`,
223
279
  ` Target networks: ${target_networks}`,
@@ -238,6 +294,11 @@ function
238
294
  _exit_code) {
239
295
  let
240
296
  _line;
297
+ const
298
+ _app_name =
299
+ _get(
300
+ "app",
301
+ "name");
241
302
  const
242
303
  _text = [
243
304
  "",
@@ -245,7 +306,7 @@ function
245
306
  "",
246
307
  "Usage:",
247
308
  "",
248
- ` ${app_name}`,
309
+ ` ${_app_name}`,
249
310
  " [options]",
250
311
  " <target-contract>",
251
312
  "",
@@ -282,10 +343,10 @@ function
282
343
  ""
283
344
  ];
284
345
  for ( _line of _text ) {
285
- console.log(
346
+ _echo(
286
347
  _line);
287
348
  }
288
- _process_exit(
349
+ _exit(
289
350
  _exit_code);
290
351
  }
291
352
 
@@ -309,7 +370,7 @@ async function
309
370
  };
310
371
  const
311
372
  _argv =
312
- _argv_get(
373
+ await _argv_get(
313
374
  _argv_args);
314
375
  const
315
376
  _options =
@@ -317,8 +378,10 @@ async function
317
378
  "_"];
318
379
  quiet =
319
380
  "y";
320
- runtime_environment =
321
- "node";
381
+ _set(
382
+ "runtime",
383
+ "environment",
384
+ "node");
322
385
  if ( _argv[
323
386
  "h"] ) {
324
387
  _help_display =
@@ -336,8 +399,12 @@ async function
336
399
  _help_display =
337
400
  true;
338
401
  }
402
+ const
403
+ _global =
404
+ _global_get();
339
405
  if ( _help_display ) {
340
- quiet =
406
+ _global[
407
+ 'quiet'] =
341
408
  "n";
342
409
  await _overrides_set(
343
410
  _help_display);
@@ -357,69 +424,102 @@ async function
357
424
  _usage(
358
425
  1);
359
426
  }
360
- target_contract =
427
+ _set(
428
+ "target",
429
+ "contract",
361
430
  _argv[
362
431
  "_"][
363
- 0];
432
+ 0]);
433
+ const
434
+ _target_networks =
435
+ _get(
436
+ "target",
437
+ "networks");
364
438
  if ( "n" in _argv ) {
365
- target_networks.push(
439
+ _target_networks.push(
366
440
  _argv[
367
441
  "n"].toString());
368
442
  }
369
443
  if ( "network" in _argv ) {
370
- target_networks.push(
444
+ _target_networks.push(
371
445
  _argv[
372
446
  "network"].toString());
373
447
  }
448
+ _set(
449
+ "target",
450
+ "networks",
451
+ _target_networks);
452
+ const
453
+ _network_ids =
454
+ _get(
455
+ "networks",
456
+ "ids");
374
457
  if ( "i" in _argv ) {
375
- network_ids.push(
458
+ _network_ids.push(
376
459
  _argv[
377
460
  "i"].toString());
378
461
  }
379
462
  if ( "network-id" in _argv ) {
380
- network_ids.push(
463
+ _network_ids.push(
381
464
  _argv[
382
465
  "network-id"].toString());
383
466
  }
467
+ _set(
468
+ "network",
469
+ "ids",
470
+ _network_ids);
384
471
  if ( "a" in _argv ) {
385
- target_app =
472
+ _set(
473
+ "target",
474
+ "app",
386
475
  _argv[
387
- "a"];
476
+ "a"]);
388
477
  }
389
478
  if ( "target-app" in _argv ) {
390
- target_app =
479
+ _set(
480
+ "target",
481
+ "app",
391
482
  _argv[
392
- "target-app"];
483
+ "target-app"]);
393
484
  }
394
485
  if ( _argv[
395
486
  "A"] ||
396
487
  _argv[
397
488
  "networks-all"] ) {
398
- networks_all =
399
- "y";
489
+ _set(
490
+ "networks",
491
+ "all",
492
+ "y");
400
493
  }
401
494
  if ( _argv[
402
495
  "u"] ||
403
496
  _argv[
404
497
  "user-defined"] ) {
405
- user_defined =
406
- "y";
498
+ _set(
499
+ "user",
500
+ "defined",
501
+ "y");
407
502
  }
408
503
  if ( "f" in _argv ) {
409
- configuration_format =
504
+ _set(
505
+ "configuration",
506
+ "format",
410
507
  _argv[
411
- "f"];
508
+ "f"]);
412
509
  }
413
510
  if ( "configuration-format" in _argv ) {
414
- configuration_format =
511
+ _set(
512
+ "configuration",
513
+ "format",
415
514
  _argv[
416
- "configuration-format"];
515
+ "configuration-format"]);
417
516
  }
418
517
  if ( _argv[
419
518
  "v"] ||
420
519
  _argv[
421
520
  "verbose"] ) {
422
- quiet =
521
+ _global[
522
+ "quiet"] =
423
523
  "n";
424
524
  }
425
525
  }
@@ -429,47 +529,72 @@ function
429
529
  let
430
530
  _method,
431
531
  _network;
432
- runtime_environment =
433
- "browser";
434
- target_networks =
532
+ _set(
533
+ "runtime",
534
+ "environment",
535
+ "browser");
536
+ _set(
537
+ "target",
538
+ "networks",
435
539
  _argv_url_get(
436
- "network");
437
- network_ids =
540
+ "network"));
541
+ _set(
542
+ "network",
543
+ "ids",
438
544
  _argv_url_get(
439
- "network_id");
440
- networks_all =
545
+ "network_id"));
546
+ _set(
547
+ "networks",
548
+ "all",
441
549
  _argv_url_get(
442
550
  "networks_all")[
443
- 0];
444
- target_app =
551
+ 0]);
552
+ _set(
553
+ "target",
554
+ "app",
445
555
  _argv_url_get(
446
556
  "target_app")[
447
- 0];
448
- target_contract =
557
+ 0]);
558
+ _set(
559
+ "target",
560
+ "contract",
449
561
  _argv_url_get(
450
562
  "target_contract")[
451
- 0];
452
- contract_version =
563
+ 0]);
564
+ _set(
565
+ "contract",
566
+ "version",
453
567
  _argv_url_get(
454
568
  "contract_version")[
455
- 0];
456
- user_defined =
569
+ 0]);
570
+ _set(
571
+ "user",
572
+ "defined",
457
573
  _argv_url_get(
458
574
  "user_defined")[
459
- 0];
460
- configuration_format =
575
+ 0]);
576
+ _set(
577
+ "configuration",
578
+ "format",
461
579
  _argv_url_get(
462
580
  "configuration_format")[
463
- 0];
464
- deployments_dir =
581
+ 0]);
582
+ _set(
583
+ "deployments",
584
+ "dir",
465
585
  _argv_url_get(
466
586
  "deployments_dir")[
467
- 0];
468
- quiet =
587
+ 0]);
588
+ const
589
+ _global =
590
+ _global_get();
591
+ _global[
592
+ "quiet"] =
469
593
  _argv_url_get(
470
594
  "quiet");
471
595
  if ( quiet.length === 0 ) {
472
- quiet =
596
+ _global[
597
+ "quiet"] =
473
598
  "n";
474
599
  }
475
600
  }
@@ -490,7 +615,7 @@ async function
490
615
  _results);
491
616
  if ( _results_type == "object" ) {
492
617
  for ( _result of _results ) {
493
- console.log(
618
+ _echo(
494
619
  _result);
495
620
  }
496
621
  }
@@ -526,9 +651,9 @@ async function
526
651
  }
527
652
 
528
653
  _global_variables();
529
- if ( _cmdline_check(
654
+ if ( await _cmdline_check(
530
655
  "evm-contract-deployment-abi.js") ||
531
- _cmdline_check(
656
+ await _cmdline_check(
532
657
  "evm-contract-deployment-abi") ) {
533
658
  _cmdline_parse();
534
659
  }