evm-contracts-tools 0.0.52 → 0.0.55

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-contract-call CHANGED
@@ -83,6 +83,11 @@ const
83
83
  const
84
84
  _cmdline_check =
85
85
  _libcrash._cmdline_check;
86
+ /* global
87
+ _echo */
88
+ const
89
+ _echo =
90
+ _libcrash._echo;
86
91
  /* global
87
92
  _exit */
88
93
  const
@@ -561,7 +566,7 @@ function
561
566
  ""
562
567
  ];
563
568
  for ( _line of _text ) {
564
- console.log(
569
+ _echo(
565
570
  _line);
566
571
  }
567
572
  _exit(
@@ -1009,7 +1014,7 @@ async function
1009
1014
  _results);
1010
1015
  if ( _results_type == "object" ) {
1011
1016
  for ( _result of _results ) {
1012
- console.log(
1017
+ _echo(
1013
1018
  _result);
1014
1019
  }
1015
1020
  }
@@ -1064,6 +1069,8 @@ else{
1064
1069
  _url_parse();
1065
1070
  _libevm_url_parse();
1066
1071
  }
1072
+ _echo(
1073
+ contract_address);
1067
1074
  _main();
1068
1075
 
1069
1076
  export {
package/lib/address-check CHANGED
@@ -28,13 +28,13 @@
28
28
 
29
29
  const
30
30
  _libcrash =
31
- require(
32
- "crash-js");
31
+ await import(
32
+ "libcrash-js");
33
33
  /* global
34
- _argv_get */
34
+ _argv */
35
35
  const
36
- _argv_get =
37
- _libcrash._argv_get;
36
+ _argv =
37
+ _libcrash._argv;
38
38
  /* global
39
39
  _basename */
40
40
  const
@@ -45,11 +45,21 @@ const
45
45
  const
46
46
  _cmdline_check =
47
47
  _libcrash._cmdline_check;
48
+ /* global
49
+ _echo */
50
+ const
51
+ _echo =
52
+ _libcrash._echo;
48
53
  /* global
49
54
  _exit */
50
55
  const
51
56
  _exit =
52
57
  _libcrash._exit;
58
+ /* global
59
+ _global_get */
60
+ const
61
+ _global_get =
62
+ _libcrash._global_get;
53
63
  /* global
54
64
  _msg_info */
55
65
  const
@@ -60,11 +70,21 @@ const
60
70
  const
61
71
  _msg_error =
62
72
  _libcrash._msg_error;
73
+ /* global
74
+ _override_set */
75
+ const
76
+ _override_set =
77
+ _libcrash._override_set;
63
78
  /* global
64
79
  _require */
65
80
  const
66
81
  _require =
67
82
  _libcrash._require;
83
+ /* global
84
+ _set */
85
+ const
86
+ _set =
87
+ _libcrash._override_set;
68
88
  const
69
89
  _ethers_module =
70
90
  await _require(
@@ -80,17 +100,32 @@ const
80
100
 
81
101
  function
82
102
  _global_variables() {
83
- app_name =
84
- "address-check";
85
103
  /* global
86
- target_address:
104
+ app_name:
87
105
  writable */
88
- target_address =
89
- "";
106
+ _set(
107
+ "app",
108
+ "name",
109
+ "address-check");
90
110
  /* global
91
- quiet:
111
+ app_opts:
92
112
  writable */
93
- quiet =
113
+ _set(
114
+ "app",
115
+ "opts",
116
+ []);
117
+ /* global
118
+ target_address:
119
+ writable */
120
+ _set(
121
+ "target",
122
+ "address",
123
+ "");
124
+ const
125
+ _global =
126
+ _global_get();
127
+ _global[
128
+ "quiet"] =
94
129
  "";
95
130
  }
96
131
 
@@ -98,14 +133,11 @@ function
98
133
  _config_show() {
99
134
  let
100
135
  _line;
101
- const
102
- _argv =
103
- _argv_get();
104
136
  const
105
137
  _program =
106
138
  _basename(
107
139
  _argv[
108
- "$0"]);
140
+ 0]);
109
141
  const
110
142
  _text = [
111
143
  `${_program} configuration:`,
@@ -123,14 +155,11 @@ function
123
155
  let
124
156
  _display_fun,
125
157
  _line;
126
- const
127
- _argv =
128
- _argv_get();
129
158
  const
130
159
  _program =
131
160
  _basename(
132
161
  _argv[
133
- "$0"]);
162
+ 0]);
134
163
  const
135
164
  _text = [
136
165
  "Checks whether an address is valid.",
@@ -148,7 +177,7 @@ function
148
177
  " -h --help This help."
149
178
  ];
150
179
  for (_line of _text) {
151
- _msg_info(
180
+ _echo(
152
181
  _line);
153
182
  }
154
183
  _exit(
@@ -164,30 +193,41 @@ function
164
193
  _cmdline_parse() {
165
194
  quiet =
166
195
  "y";
167
- process.argv.forEach(
196
+ _argv.forEach(
168
197
  function (
169
198
  _value,
170
- _index,
171
- _array) {
199
+ _index) {
200
+ const
201
+ _global =
202
+ _global_get();
172
203
  if ( _index == 2 ) {
173
- target_address =
174
- _value;
204
+ _set(
205
+ "target",
206
+ "address",
207
+ _value);
175
208
  }
176
209
  else if ( _value == "-v" ||
177
210
  _value == "--verbose" ) {
178
- quiet =
211
+ _global[
212
+ "quiet"] =
179
213
  "n";
180
214
  }
181
215
  else if ( _value == "-h" ||
182
216
  _value == "--help" ) {
183
- quiet =
217
+ _global[
218
+ "quiet"] =
184
219
  "n";
185
220
  _usage(
186
221
  0);
187
222
  }
188
223
  }
189
224
  );
190
- if ( target_address == "" ) {
225
+ const
226
+ _target_address =
227
+ _get(
228
+ "target",
229
+ "address");
230
+ if ( _target_address == "" ) {
191
231
  const
192
232
  _msg =
193
233
  "No target address specified.";
@@ -237,9 +277,9 @@ async function
237
277
  }
238
278
  }
239
279
 
240
- if ( _cmdline_check(
280
+ if ( await _cmdline_check(
241
281
  "address-check") ||
242
- _cmdline_check(
282
+ await _cmdline_check(
243
283
  "ethereum-address-validate") ) {
244
284
  _global_variables();
245
285
  await _cmdline_parse();
@@ -252,7 +292,11 @@ if ( _cmdline_check(
252
292
  app_opts);
253
293
  }
254
294
 
255
- module.exports = {
256
- _address_check:
257
- _address_check
295
+ export {
296
+ _address_check
258
297
  };
298
+
299
+ // module.exports = {
300
+ // _address_check:
301
+ // _address_check
302
+ // };
@@ -26,8 +26,18 @@
26
26
 
27
27
  const
28
28
  _libcrash =
29
- require(
30
- "crash-js");
29
+ await import(
30
+ "libcrash-js");
31
+ /* global
32
+ _argv */
33
+ const
34
+ _argv =
35
+ _libcrash._argv;
36
+ /* global
37
+ _basename */
38
+ const
39
+ _basename =
40
+ _libcrash._basename;
31
41
  /* global
32
42
  _cmdline_check */
33
43
  const
@@ -38,6 +48,11 @@ const
38
48
  const
39
49
  _error_display =
40
50
  _libcrash._error_display;
51
+ /* global
52
+ _echo */
53
+ const
54
+ _echo =
55
+ _libcrash._echo;
41
56
  /* global
42
57
  _exit */
43
58
  const
@@ -268,45 +283,24 @@ async function
268
283
  function
269
284
  _config_show() {
270
285
  let
271
- _line,
272
- _method_args,
273
- _text;
274
- _text =
275
- [];
276
- _text.push(
277
- "bytecode-creation-get configuration:");
278
- _text.push(
279
- " Wallet seed: {wallet_seed}".replace(
280
- "{wallet_seed}",
281
- wallet_seed));
282
- _text.push(
283
- " Max retries: {retries_max}".replace(
284
- "{retries_max}",
285
- retries_max));
286
- _text.push(
287
- " API Key path: {api_key_path}".replace(
288
- "{api_key_path}",
289
- api_key_path));
290
- _text.push(
291
- " Chain ID: {chain_id}".replace(
292
- "{chain_id}",
293
- chain_id));
294
- _text.push(
295
- " Chain Name: {chain_name}".replace(
296
- "{chain_name}",
297
- chain_name));
298
- _text.push(
299
- " Target network: {target_network}".replace(
300
- "{target_network}",
301
- target_network));
302
- _text.push(
303
- " Contract address: {contract_address}".replace(
304
- "{contract_address}",
305
- contract_address));
306
- _text.push(
307
- " Deployment transaction: {transaction_deployment}".replace(
308
- "{transaction_deployment}",
309
- transaction_deployment));
286
+ _line;
287
+ const
288
+ _program =
289
+ _basename(
290
+ _argv[
291
+ "1"]);
292
+ const
293
+ _text = [
294
+ `${_program} configuration:`,
295
+ ` Wallet seed: ${wallet_seed}`,
296
+ ` Max retries: ${retries_max}`,
297
+ ` API Key path: ${api_key_path}`,
298
+ ` Chain ID: ${chain_id}`,
299
+ ` Chain Name: ${chain_name}`,
300
+ ` Target network: ${target_network}`,
301
+ ` Contract address: ${contract_address}`,
302
+ ` Deployment transaction: ${transaction_deployment}`,
303
+ ];
310
304
  for (_line of _text) {
311
305
  _msg_info(
312
306
  _line);
@@ -317,47 +311,48 @@ function
317
311
  _usage(
318
312
  _exit_code) {
319
313
  let
320
- _display_fun,
321
- _line,
322
- _text;
323
- _text = [
324
- "Returns the creation bytecode for a contract given its deployment transaction hash.",
325
- "",
326
- "Usage:",
327
- " bytecode-creation-get",
328
- " <quiet>",
329
- " <wallet_seed>",
330
- " <retries_max>",
331
- " <api_key_path>",
332
- " <chain_id>",
333
- " <chain_name>",
334
- " <target_network>",
335
- " <contract_address>",
336
- " <transaction_deployment>",
337
- " <contract_bytecode_path>",
338
- "",
339
- "Args:",
340
- " <quiet> Can be 'y' or 'n'",
341
- " Default: y",
342
- " <wallet_seed> Path of the file containing",
343
- " the seed phrase.",
344
- " <retries_max> Maximum number of retries before",
345
- " failing.",
346
- " <api_key_path> Path of the API key for the",
347
- " contract ABI provider service",
348
- " <chain_id> Chain ID for the network.",
349
- " <chain_name> Name for the network.",
350
- " <target_network> Network on which the contract",
351
- " resides.",
352
- " <contract_address> Address of the contract",
353
- " <transaction_deployment> Contract deployment transaction.",
354
- " <contract_bytecode_path> Where to save contract bytecode.",
355
- "",
356
- " Options:",
357
- " -h This help."
358
- ];
314
+ _line;
315
+ const
316
+ _text = [
317
+ "",
318
+ "Returns the creation bytecode for a contract given its deployment transaction hash.",
319
+ "",
320
+ "Usage:",
321
+ ` ${_program}`,
322
+ " <quiet>",
323
+ " <wallet-seed>",
324
+ " <retries-max>",
325
+ " <api-key-path>",
326
+ " <chain-id>",
327
+ " <chain-name>",
328
+ " <target-network>",
329
+ " <contract-address>",
330
+ " <transaction-deployment>",
331
+ " <contract-bytecode-path>",
332
+ "",
333
+ "Args:",
334
+ " <quiet> Can be 'y' or 'n'",
335
+ " Default: y",
336
+ " <wallet-seed> Path of the file containing",
337
+ " the seed phrase.",
338
+ " <retries-max> Maximum number of retries before",
339
+ " failing.",
340
+ " <api-key-path> Path of the API key for the",
341
+ " contract ABI provider service",
342
+ " <chain-id> Chain ID for the network.",
343
+ " <chain-name> Name for the network.",
344
+ " <target-network> Network on which the contract",
345
+ " resides.",
346
+ " <contract-address> Address of the contract",
347
+ " <transaction-deployment> Contract deployment transaction.",
348
+ " <contract-bytecode-path> Where to save contract bytecode.",
349
+ "",
350
+ " Options:",
351
+ " -h This help.",
352
+ ""
353
+ ];
359
354
  for (_line of _text) {
360
- _msg_info(
355
+ _echo(
361
356
  _line);
362
357
  }
363
358
  _exit(
@@ -377,56 +372,79 @@ function
377
372
  let
378
373
  _error,
379
374
  _msg;
380
- quiet =
375
+ const
376
+ _global =
377
+ _global_get();
378
+ _global[
379
+ "quiet"] =
381
380
  "y";
382
- process.argv.forEach(
381
+ _argv.forEach(
383
382
  function (
384
383
  _value,
385
- _index,
386
- _array) {
384
+ _index) {
387
385
  if ( _index == 2 ) {
388
- quiet =
386
+ _global[
387
+ "quiet"] =
389
388
  _value;
390
389
  }
391
390
  if ( _index == 3 ) {
392
- wallet_seed =
393
- _value;
391
+ _set(
392
+ "wallet",
393
+ "seed",
394
+ _value);
394
395
  }
395
396
  if ( _index == 4 ) {
396
- retries_max =
397
- _value;
397
+ _set(
398
+ "retries",
399
+ "max",
400
+ _value);
398
401
  }
399
402
  if ( _index == 5 ) {
400
- api_key_path =
401
- _value;
403
+ _set(
404
+ "api_key",
405
+ "path",
406
+ _value);
402
407
  }
403
408
  if ( _index == 6 ) {
404
- chain_id =
405
- _value;
409
+ _set(
410
+ "chain",
411
+ "id",
412
+ _value);
406
413
  }
407
414
  if ( _index == 7 ) {
408
- chain_name =
409
- _value;
415
+ _set(
416
+ "chain",
417
+ "name",
418
+ _value);
410
419
  }
411
420
  if ( _index == 8 ) {
412
- target_network =
413
- _value;
421
+ _set(
422
+ "target",
423
+ "network",
424
+ _value);
414
425
  }
415
426
  if ( _index == 9 ) {
416
- contract_address =
417
- _value;
427
+ _set(
428
+ "contract",
429
+ "address",
430
+ _value);
418
431
  }
419
432
  if ( _index == 10 ) {
420
- transaction_deployment =
421
- _value;
433
+ _set(
434
+ "transaction",
435
+ "deployment",
436
+ _value);
422
437
  }
423
438
  if ( _index == 11 ) {
424
- contract_bytecode_path =
425
- _value;
439
+ _set(
440
+ "contract_bytecode",
441
+ "path",
442
+ _value);
426
443
  }
427
444
  if ( _value == "-h" ||
428
445
  _value == "--help" ) {
429
- quiet =
446
+ _global[
447
+ "quiet"] =
430
448
  "n";
431
449
  _usage(
432
450
  0);
@@ -451,7 +469,8 @@ function
451
469
  _msg_error(
452
470
  _msg,
453
471
  0);
454
- quiet =
472
+ _global[
473
+ "quiet"] =
455
474
  "n";
456
475
  _usage(
457
476
  1);
@@ -469,8 +488,10 @@ async function
469
488
  null,
470
489
  _app_opts);
471
490
  if ( _bytecode != undefined ) {
491
+ _msg =
492
+ `Bytecode has length '${_bytecode.length}'`;
472
493
  _msg_info(
473
- `Bytecode has length '${_bytecode.length}'`);
494
+ _msg);
474
495
  // _printf(
475
496
  // _bytecode.toString());
476
497
  }
@@ -509,7 +530,11 @@ if ( _cmdline_check(
509
530
  app_opts);
510
531
  }
511
532
 
512
- module.exports = {
513
- _bytecode_creation_get:
514
- _bytecode_creation_get
533
+ export {
534
+ _bytecode_creation_get
515
535
  };
536
+
537
+ // module.exports = {
538
+ // _bytecode_creation_get:
539
+ // _bytecode_creation_get
540
+ // };
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  { "name": "evm-contracts-tools",
2
2
  "version":
3
- "0.0.52",
3
+ "0.0.55",
4
4
  "description":
5
5
  "JavaScript programs and libraries to enable seamless development of native computer applications designed to interact with Ethereum Virtual Machine-compatible networks.",
6
6
  "funding": {
@@ -100,7 +100,7 @@
100
100
  },
101
101
  "devDependencies": {
102
102
  "crash-js-webpack":
103
- "^0.0.64",
103
+ "^0.0.69",
104
104
  "brace-expansion":
105
105
  "^5.0.9",
106
106
  "eslint":
@@ -112,7 +112,7 @@
112
112
  "globals":
113
113
  "^17.3.0",
114
114
  "safely-serve":
115
- "^0.0.11",
115
+ "^0.0.19",
116
116
  "webpack":
117
117
  "^5.109.2",
118
118
  "webpack-cli":
@@ -120,17 +120,17 @@
120
120
  },
121
121
  "dependencies": {
122
122
  "libcrash-js":
123
- "npm:crash-js@^100000001.1000000000000001.1000000000000001",
123
+ "npm:crash-js@^100000000000001.1000000000000001.1000000000000001",
124
124
  "ethers":
125
125
  "^6.13.2",
126
126
  "evm-chains-info":
127
127
  "^0.0.34",
128
128
  "evm-transactions-tools":
129
- "^0.0.11111",
129
+ "^0.0.11111111",
130
130
  "evm-wallet":
131
- "npm:evm-wallet.js@^0.0.82",
131
+ "npm:evm-wallet.js@^0.0.92",
132
132
  "libevm":
133
- "^0.0.37",
133
+ "^0.0.39",
134
134
  "ws":
135
135
  "^8.21.0",
136
136
  "yargs":
@@ -140,11 +140,11 @@
140
140
  "evm-contracts-tools":
141
141
  "./evm-contracts-tools",
142
142
  "evm-wallet":
143
- "npm:evm-wallet.js@^0.0.82",
143
+ "npm:evm-wallet.js@^0.0.92",
144
144
  "evm-wallet.js":
145
- "npm:evm-wallet.js@^0.0.82",
145
+ "npm:evm-wallet.js@^0.0.92",
146
146
  "libevm":
147
- "^0.0.37"
147
+ "^0.0.39"
148
148
  },
149
149
  "type":
150
150
  "module",
@@ -152,10 +152,10 @@
152
152
  "evm-contracts-tools",
153
153
  "bin":
154
154
  {
155
- "ethereum-address-validate":
156
- "lib/address-check",
157
155
  "evm-contract-call":
158
156
  "evm-contract-call",
157
+ "ethereum-address-validate":
158
+ "lib/address-check",
159
159
  "evm-contract-call.js":
160
160
  "evm-contract-call",
161
161
  "evm-contract-call-dynamic.js":