evm-contracts-tools 0.0.81 → 0.0.85

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 (37) hide show
  1. package/dist/evm-contract-call/evm-contract-call.js +1 -1
  2. package/dist/evm-contract-call/fs-worker.js +1 -1
  3. package/dist/evm-contract-deployment-abi/evm-contract-deployment-abi.js +1 -1
  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 -1
  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 -1
  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 -1
  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 -1
  13. package/dist/evm-contract-deployment-versions/evm-contract-deployment-versions.js +1 -1
  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 -1
  16. package/dist/evm-contract-deployments-dir/fs-worker.js +1 -1
  17. package/dist/evm-contracts-tools/evm-contracts-tools.js +1 -1
  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 -1
  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 -1
  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 -1
  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 -1
  29. package/dist/libevm-contract-deployment-deployment-networks +1 -1
  30. package/dist/libevm-contract-deployment-networks/libevm-contract-deployment-networks.js +1 -1
  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 -1
  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 -1
  35. package/dist/libevm-contracts-tools +1 -1
  36. package/lib/contract-get +170 -52
  37. package/package.json +11 -11
package/lib/contract-get CHANGED
@@ -449,6 +449,86 @@ async function
449
449
  return _contract;
450
450
  }
451
451
 
452
+ function
453
+ _api_key_path_check(
454
+ _api_key_path) {
455
+ let
456
+ _api_key_path_empty,
457
+ _msg;
458
+ _api_key_path_empty =
459
+ false;
460
+ const
461
+ _api_key_path_type =
462
+ typeof(
463
+ _api_key_path);
464
+ if ( _api_key_path_type === "undefined" ) {
465
+ _api_key_path_empty =
466
+ true;
467
+ }
468
+ else if ( _api_key_path_type === "string" ) {
469
+ if ( _api_key_path.length < 1 ) {
470
+ _api_key_path_empty =
471
+ true;
472
+ }
473
+ }
474
+ else if ( _api_key_path_type === "number" ) {
475
+ _api_key_path =
476
+ String(
477
+ _api_key_path);
478
+ }
479
+ else if ( _api_key_path_type === "object" ) {
480
+ _api_key_path_keys =
481
+ Object.keys(
482
+ _api_key_path);
483
+ if ( _api_key_path_keys.length < 1 ) {
484
+ _api_key_path_empty =
485
+ true;
486
+ }
487
+ else {
488
+ _msg =
489
+ "RPC API key path variable " +
490
+ "has type 'object', but " +
491
+ "it should be a path string. " +
492
+ "Current value:";
493
+ _msg_error(
494
+ _msg,
495
+ 0);
496
+ _echo2(
497
+ _api_key_path);
498
+ throw _msg;
499
+ }
500
+ }
501
+ else {
502
+ _msg =
503
+ "RPC API key path variable " +
504
+ `has type '${_api_key_path_type}', but ` +
505
+ "it should be a path string.";
506
+ _msg_error(
507
+ _msg,
508
+ 0);
509
+ throw _msg;
510
+ }
511
+ if ( _api_key_path_empty ) {
512
+ _api_key_path =
513
+ "";
514
+ }
515
+ if ( _api_key_path != "" ) {
516
+ if ( ! _file_exists(
517
+ _api_key_path) ) {
518
+ _msg =
519
+ "The API key file at location " +
520
+ `'${_api_key_path}' does not exist, `,
521
+ "setting an empty string instead.";
522
+ _msg_error(
523
+ _msg,
524
+ 0);
525
+ _api_key_path =
526
+ "";
527
+ }
528
+ }
529
+ return _api_key_path;
530
+ }
531
+
452
532
  async function
453
533
  _contract_get(
454
534
  _wallet_seed,
@@ -470,6 +550,22 @@ async function
470
550
  _wallet_get_opts,
471
551
  _wallet_path_list,
472
552
  _wallet_path;
553
+ try {
554
+ _api_key =
555
+ _api_key_path_check(
556
+ _api_key_path);
557
+ }
558
+ catch(
559
+ _error) {
560
+ _msg =
561
+ "Error running '_api_key_path_check'.";
562
+ _msg_error(
563
+ _msg,
564
+ 0);
565
+ _echo2(
566
+ _error);
567
+ throw _error;
568
+ }
473
569
  if ( _api_key_path != "" ) {
474
570
  _api_key =
475
571
  _file_read(
@@ -551,12 +647,22 @@ async function
551
647
  _contract_bytecode_path);
552
648
  _contract_get_fun =
553
649
  _contract_get_bytecode;
650
+ _msg =
651
+ "Selected function " +
652
+ "'_contract_get_bytecode'.";
653
+ _msg_info(
654
+ _msg);
554
655
  }
555
656
  else if ( _contract_compiler_output_path != "" ) {
556
657
  _contract_get_args.push(
557
658
  _contract_compiler_output_path);
558
659
  _contract_get_fun =
559
660
  _contract_get_compiler_output;
661
+ _msg =
662
+ "Selected function " +
663
+ "'_contract_get_compiler_output'.";
664
+ _msg_info(
665
+ _msg);
560
666
  }
561
667
  else if ( _contract_bytecode_path == "" &&
562
668
  _contract_abi_path != "" ) {
@@ -564,6 +670,11 @@ async function
564
670
  _contract_abi_path);
565
671
  _contract_get_fun =
566
672
  _contract_get_abi;
673
+ _msg =
674
+ "Selected function " +
675
+ "'_contract_get_abi'.";
676
+ _msg_info(
677
+ _msg);
567
678
  }
568
679
  else if ( _contract_bytecode_path == "" &&
569
680
  _contract_abi_path == "" &&
@@ -579,7 +690,7 @@ async function
579
690
  _error) {
580
691
  _msg =
581
692
  "Error running " +
582
- `'${_contract_get_fun}' ` +
693
+ `'_contract_get_fun' ` +
583
694
  "with parameters:";
584
695
  _msg_error(
585
696
  _msg,
@@ -596,41 +707,18 @@ async function
596
707
  function
597
708
  _config_show() {
598
709
  let
599
- _line,
600
- _text;
601
- _text = [];
602
- _text.push(
603
- " Wallet seed: {wallet_seed}".replace(
604
- "{wallet_seed}",
605
- wallet_seed));
606
- _text.push(
607
- " Wallet password: {wallet_password_path}".replace(
608
- "{wallet_password_path}",
609
- wallet_password_path));
610
- _text.push(
611
- " Contract address: {contract_address}".replace(
612
- "{contract_address}",
613
- contract_address));
614
- _text.push(
615
- " Contract ABI path: {contract_abi_path}".replace(
616
- "{contract_abi_path}",
617
- contract_abi_path));
618
- _text.push(
619
- " Contract bytecode: {contract_bytecode_path}".replace(
620
- "{contract_bytecode_path}",
621
- contract_bytecode_path));
622
- _text.push(
623
- "Contract compiler output: {contract_compiler_output_path}".replace(
624
- "{contract_compiler_output_path}",
625
- contract_compiler_output_path));
626
- _text.push(
627
- " Target network: {target_network}".replace(
628
- "{target_network}",
629
- target_network));
630
- _text.push(
631
- " API Key: {api_key_path}".replace(
632
- "{api_key_path}",
633
- api_key_path));
710
+ _line;
711
+ const
712
+ _text = [
713
+ ` Wallet seed: ${wallet_seed}`,
714
+ ` Wallet password: ${wallet_password_path}`,
715
+ ` Contract address: ${contract_address}`,
716
+ ` Contract ABI path: ${contract_abi_path}`,
717
+ ` Contract bytecode: ${contract_bytecode_path}`,
718
+ `Contract compiler output: ${contract_compiler_output_path}`,
719
+ ` Target network: ${target_network}`,
720
+ ` API Key: ${api_key_path}`,
721
+ ];
634
722
  for ( _line of _text ) {
635
723
  _msg_info(
636
724
  _line);
@@ -657,23 +745,53 @@ function
657
745
  " (<api-key-path>)",
658
746
  "",
659
747
  "Args:",
660
- " <quiet> Can be 'y' or 'n'",
661
- " Default: y",
662
- " <wallet-seed> Path of the seed phrase.",
663
- " <wallet-password-path> Wallet password path.",
664
- " <contract-address> Contract of the address one is",
665
- " getting the contract of.",
666
- " <contract-abi-path> Path of the contract ABI.",
667
- " <contract-bytecode-path> Path for the contract bytecode.",
668
- " <contract-compiler-output-path> Path for the contract compiler",
669
- " output path (the hardhat artifact).",
670
- " <target-network> Network on which the contract",
671
- " resides.",
672
- " <api-key-path> Path of the API key for the",
673
- " contract ABI provider service.",
674
748
  "",
675
- " Options:",
676
- " -h This help."
749
+ " <quiet>",
750
+ "",
751
+ " Can be 'y' or 'n'",
752
+ ` Default: ${quiet}`,
753
+ "",
754
+ " <wallet-seed>",
755
+ "",
756
+ " Path of the seed phrase.",
757
+ "",
758
+ " <wallet-password-path>",
759
+ "",
760
+ " Wallet password path.",
761
+ "",
762
+ " <contract-address>",
763
+ "",
764
+ " Contract of the address one is",
765
+ " getting the contract of.",
766
+ "",
767
+ " <contract-abi-path>",
768
+ "",
769
+ " Path of the contract ABI.",
770
+ "",
771
+ " <contract-bytecode-path>",
772
+ "",
773
+ " Path for the contract bytecode.",
774
+ "",
775
+ " <contract-compiler-output-path>",
776
+ "",
777
+ " Path for the contract compiler",
778
+ " output path (the hardhat artifact).",
779
+ "",
780
+ " <target-network>",
781
+ "",
782
+ " Network on which the contract",
783
+ " resides.",
784
+ "",
785
+ " <api-key-path>",
786
+ "",
787
+ " Path of the API key for the",
788
+ " contract ABI provider service.",
789
+ "",
790
+ "Options:",
791
+ "",
792
+ " -h, --help",
793
+ "",
794
+ " This help."
677
795
  ];
678
796
  for ( _line of _text ) {
679
797
  _echo(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  { "name": "evm-contracts-tools",
2
2
  "version":
3
- "0.0.81",
3
+ "0.0.85",
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,11 +100,11 @@
100
100
  },
101
101
  "devDependencies": {
102
102
  "crash-js-webpack":
103
- "^0.0.78",
103
+ "^0.0.89",
104
104
  "brace-expansion":
105
105
  "^5.0.9",
106
106
  "eslint":
107
- "^10.3.0",
107
+ "^10.14.0",
108
108
  "@eslint/js":
109
109
  "^10.0.1",
110
110
  "fast-uri":
@@ -112,7 +112,7 @@
112
112
  "globals":
113
113
  "^17.3.0",
114
114
  "safely-serve":
115
- "^0.0.22",
115
+ "^0.0.26",
116
116
  "webpack":
117
117
  "^5.109.2",
118
118
  "webpack-cli":
@@ -120,7 +120,7 @@
120
120
  },
121
121
  "dependencies": {
122
122
  "libcrash-js":
123
- "npm:crash-js@^1000000000000012.1000000000000001.1000000000000001",
123
+ "npm:crash-js@^1000000000000026.1000000000000001.1000000000000001",
124
124
  "ethers":
125
125
  "^6.13.2",
126
126
  "evm-chains-info":
@@ -128,9 +128,9 @@
128
128
  "evm-transactions-tools":
129
129
  "^0.1.10000000000001",
130
130
  "evm-wallet":
131
- "npm:evm-wallet.js@^0.0.103",
131
+ "npm:evm-wallet.js@^0.0.104",
132
132
  "libevm":
133
- "^0.0.50",
133
+ "^0.0.56",
134
134
  "ws":
135
135
  "^8.21.0",
136
136
  "yargs":
@@ -138,15 +138,15 @@
138
138
  },
139
139
  "overrides": {
140
140
  "libcrash-js":
141
- "npm:crash-js@^1000000000000012.1000000000000001.1000000000000001",
141
+ "npm:crash-js@^1000000000000026.1000000000000001.1000000000000001",
142
142
  "evm-contracts-tools":
143
143
  "./evm-contracts-tools",
144
144
  "evm-wallet":
145
- "npm:evm-wallet.js@^0.0.103",
145
+ "npm:evm-wallet.js@^0.0.104",
146
146
  "evm-wallet.js":
147
- "npm:evm-wallet.js@^0.0.103",
147
+ "npm:evm-wallet.js@^0.0.104",
148
148
  "libevm":
149
- "^0.0.50"
149
+ "^0.0.56"
150
150
  },
151
151
  "type":
152
152
  "module",