evm-contracts-tools 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-contract-call +88 -52
- package/evm-contracts-tools +2 -6
- package/lib/evm-contract-call-dynamic +0 -0
- package/lib/evm-contract-call-static +0 -0
- package/libevm-contract-call +107 -5
- package/package.json +8 -8
package/evm-contract-call
CHANGED
|
@@ -30,6 +30,12 @@
|
|
|
30
30
|
/* eslint-disable
|
|
31
31
|
no-unused-vars */
|
|
32
32
|
|
|
33
|
+
/* Crash Javascript global variables */
|
|
34
|
+
/* global
|
|
35
|
+
quiet:
|
|
36
|
+
writable */
|
|
37
|
+
|
|
38
|
+
/* LibEVM global variables */
|
|
33
39
|
/* global
|
|
34
40
|
call_auth:
|
|
35
41
|
writable */
|
|
@@ -92,6 +98,11 @@ const
|
|
|
92
98
|
const
|
|
93
99
|
_msg_error =
|
|
94
100
|
_libcrash._msg_error;
|
|
101
|
+
/* global
|
|
102
|
+
_printf */
|
|
103
|
+
const
|
|
104
|
+
_printf =
|
|
105
|
+
_libcrash._printf;
|
|
95
106
|
/* global
|
|
96
107
|
_process_exit */
|
|
97
108
|
const
|
|
@@ -149,7 +160,7 @@ const
|
|
|
149
160
|
_call_auth_auto_detect */
|
|
150
161
|
const
|
|
151
162
|
_call_auth_auto_detect =
|
|
152
|
-
_libevm_contract_call_module.
|
|
163
|
+
_libevm_contract_call_module._call_auth_auto_detect;
|
|
153
164
|
|
|
154
165
|
function
|
|
155
166
|
_global_variables() {
|
|
@@ -238,9 +249,6 @@ function
|
|
|
238
249
|
writable */
|
|
239
250
|
measure_unit =
|
|
240
251
|
"";
|
|
241
|
-
/* global
|
|
242
|
-
quiet:
|
|
243
|
-
writable */
|
|
244
252
|
quiet =
|
|
245
253
|
"";
|
|
246
254
|
/* global
|
|
@@ -250,9 +258,12 @@ function
|
|
|
250
258
|
"";
|
|
251
259
|
}
|
|
252
260
|
|
|
253
|
-
function
|
|
261
|
+
async function
|
|
254
262
|
_overrides_set() {
|
|
255
|
-
|
|
263
|
+
console.log("cant you really read", quiet);
|
|
264
|
+
if ( call_date == "" ||
|
|
265
|
+
typeof(
|
|
266
|
+
call_date) == "undefined" ) {
|
|
256
267
|
call_date =
|
|
257
268
|
_get_date_human();
|
|
258
269
|
}
|
|
@@ -293,22 +304,25 @@ function
|
|
|
293
304
|
if ( contract_address != "" ) {
|
|
294
305
|
if ( contract_abi == "" ) {
|
|
295
306
|
contract_abi =
|
|
296
|
-
_default_artifact_path_get(
|
|
307
|
+
_default_artifact_path_get(
|
|
308
|
+
"abi");
|
|
297
309
|
_artifact_local_auto_detect(
|
|
298
310
|
"bytecode");
|
|
299
311
|
_artifact_local_auto_detect(
|
|
300
312
|
"compiler_output");
|
|
301
313
|
if ( contract_abi == "" ||
|
|
302
314
|
_default_artifact_path_get(
|
|
303
|
-
|
|
315
|
+
"abi") == contract_abi ) {
|
|
304
316
|
_contract_abi_auto_detect();
|
|
305
317
|
}
|
|
306
318
|
}
|
|
307
319
|
}
|
|
308
|
-
|
|
320
|
+
console.log("this resets it", quiet);
|
|
321
|
+
await _wallet_overrides_set(
|
|
309
322
|
"evm-wallet",
|
|
310
323
|
wallet_name,
|
|
311
324
|
call_auth);
|
|
325
|
+
console.log("hello", quiet);
|
|
312
326
|
}
|
|
313
327
|
|
|
314
328
|
function
|
|
@@ -346,6 +360,9 @@ function
|
|
|
346
360
|
` Contract method: ${contract_method}`,
|
|
347
361
|
` Method arguments: ${method_args}`,
|
|
348
362
|
];
|
|
363
|
+
console.log(
|
|
364
|
+
"Hellooo");
|
|
365
|
+
console.log(quiet);
|
|
349
366
|
for ( _line of _text ) {
|
|
350
367
|
_msg_info(
|
|
351
368
|
_line);
|
|
@@ -458,7 +475,7 @@ function
|
|
|
458
475
|
_exit_code);
|
|
459
476
|
}
|
|
460
477
|
|
|
461
|
-
function
|
|
478
|
+
async function
|
|
462
479
|
_cmdline_parse() {
|
|
463
480
|
let
|
|
464
481
|
_help_display,
|
|
@@ -506,7 +523,7 @@ function
|
|
|
506
523
|
if ( _help_display ) {
|
|
507
524
|
quiet =
|
|
508
525
|
"n";
|
|
509
|
-
_overrides_set();
|
|
526
|
+
await _overrides_set();
|
|
510
527
|
_usage(
|
|
511
528
|
0);
|
|
512
529
|
}
|
|
@@ -677,18 +694,16 @@ function
|
|
|
677
694
|
_argv[
|
|
678
695
|
"network"]);
|
|
679
696
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
true;
|
|
687
|
-
}
|
|
688
|
-
if ( verbose ) {
|
|
697
|
+
_libevm_cmdline_parse(
|
|
698
|
+
_argv);
|
|
699
|
+
if ( _argv[
|
|
700
|
+
"v"] ||
|
|
701
|
+
_argv[
|
|
702
|
+
"verbose"] ) {
|
|
689
703
|
quiet =
|
|
690
704
|
"n";
|
|
691
705
|
}
|
|
706
|
+
console.log("quiet", quiet);
|
|
692
707
|
}
|
|
693
708
|
|
|
694
709
|
function
|
|
@@ -765,20 +780,65 @@ function
|
|
|
765
780
|
}
|
|
766
781
|
}
|
|
767
782
|
|
|
768
|
-
function
|
|
783
|
+
async function
|
|
769
784
|
_evm_contract_call_cmdline(
|
|
770
785
|
_app_opts) {
|
|
771
786
|
let
|
|
772
787
|
_result;
|
|
773
788
|
const
|
|
774
789
|
_results =
|
|
775
|
-
_evm_contract_call.apply(
|
|
790
|
+
await _evm_contract_call.apply(
|
|
776
791
|
null,
|
|
777
792
|
app_opts);
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
793
|
+
const
|
|
794
|
+
_results_type =
|
|
795
|
+
typeof(
|
|
796
|
+
_results);
|
|
797
|
+
if ( _results_type == "object" ) {
|
|
798
|
+
for ( _result of _results ) {
|
|
799
|
+
console.log(
|
|
800
|
+
_result);
|
|
801
|
+
}
|
|
781
802
|
}
|
|
803
|
+
else if ( _results_type == "string" ) {
|
|
804
|
+
_printf(
|
|
805
|
+
_results);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
async function
|
|
810
|
+
_main() {
|
|
811
|
+
console.log("quiet", quiet);
|
|
812
|
+
const
|
|
813
|
+
_overrides_set_up =
|
|
814
|
+
await _overrides_set();
|
|
815
|
+
console.log("now its reset", quiet);
|
|
816
|
+
console.log(quiet);
|
|
817
|
+
console.log(call_date);
|
|
818
|
+
_config_show();
|
|
819
|
+
app_opts = [
|
|
820
|
+
call_type,
|
|
821
|
+
call_timeout,
|
|
822
|
+
wallet_name,
|
|
823
|
+
wallet_path,
|
|
824
|
+
wallet_password,
|
|
825
|
+
wallet_seed,
|
|
826
|
+
api_key,
|
|
827
|
+
msg_value,
|
|
828
|
+
price_gas,
|
|
829
|
+
measure_unit,
|
|
830
|
+
retries_max,
|
|
831
|
+
target_network,
|
|
832
|
+
rpc_selection,
|
|
833
|
+
contract_address,
|
|
834
|
+
contract_abi,
|
|
835
|
+
contract_bytecode,
|
|
836
|
+
contract_compiler_output,
|
|
837
|
+
contract_method,
|
|
838
|
+
method_args
|
|
839
|
+
];
|
|
840
|
+
await _evm_contract_call_cmdline(
|
|
841
|
+
app_opts);
|
|
782
842
|
}
|
|
783
843
|
|
|
784
844
|
_global_variables();
|
|
@@ -786,36 +846,12 @@ _libevm_global_variables();
|
|
|
786
846
|
if ( _cmdline_check(
|
|
787
847
|
"evm-contract-call.js") == true ||
|
|
788
848
|
_cmdline_check(
|
|
789
|
-
|
|
849
|
+
"evm-contract-call") == true ) {
|
|
790
850
|
_cmdline_parse();
|
|
791
|
-
|
|
851
|
+
console.log("quiet", quiet);
|
|
792
852
|
}
|
|
793
853
|
else{
|
|
794
854
|
_url_parse();
|
|
795
855
|
_libevm_url_parse();
|
|
796
856
|
}
|
|
797
|
-
|
|
798
|
-
_config_show();
|
|
799
|
-
app_opts = [
|
|
800
|
-
call_type,
|
|
801
|
-
call_timeout,
|
|
802
|
-
wallet_name,
|
|
803
|
-
wallet_path,
|
|
804
|
-
wallet_password,
|
|
805
|
-
wallet_seed,
|
|
806
|
-
api_key,
|
|
807
|
-
msg_value,
|
|
808
|
-
price_gas,
|
|
809
|
-
measure_unit,
|
|
810
|
-
retries_max,
|
|
811
|
-
target_network,
|
|
812
|
-
rpc_selection,
|
|
813
|
-
contract_address,
|
|
814
|
-
contract_abi,
|
|
815
|
-
contract_bytecode,
|
|
816
|
-
contract_compiler_output,
|
|
817
|
-
contract_method,
|
|
818
|
-
method_args
|
|
819
|
-
];
|
|
820
|
-
_evm_contract_call_cmdline(
|
|
821
|
-
app_opts);
|
|
857
|
+
_main();
|
package/evm-contracts-tools
CHANGED
|
@@ -107,10 +107,6 @@ const
|
|
|
107
107
|
_evm_contract_call_static_module._contract_call_static;
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
function
|
|
111
|
-
_default_artifact_path_get() {
|
|
112
|
-
true;
|
|
113
|
-
}
|
|
114
110
|
|
|
115
111
|
|
|
116
112
|
function
|
|
@@ -125,6 +121,8 @@ module.exports = {
|
|
|
125
121
|
_bytecode_creation_get,
|
|
126
122
|
_bytecode_runtime_get:
|
|
127
123
|
_bytecode_runtime_get,
|
|
124
|
+
_call_auth_auto_detect:
|
|
125
|
+
_call_auth_auto_detect,
|
|
128
126
|
_contract_call_dynamic:
|
|
129
127
|
_contract_call_dynamic,
|
|
130
128
|
_contract_call_static:
|
|
@@ -133,8 +131,6 @@ module.exports = {
|
|
|
133
131
|
_contract_get,
|
|
134
132
|
_contract_run:
|
|
135
133
|
_contract_run,
|
|
136
|
-
_default_artifact_path_get:
|
|
137
|
-
_default_artifact_path_get,
|
|
138
134
|
_deployer_get:
|
|
139
135
|
_deployer_get,
|
|
140
136
|
_deployer_verify:
|
|
File without changes
|
|
File without changes
|
package/libevm-contract-call
CHANGED
|
@@ -33,15 +33,27 @@
|
|
|
33
33
|
/* eslint-disable
|
|
34
34
|
no-useless-assignment */
|
|
35
35
|
|
|
36
|
+
/* EVM Contracts tools global variables */
|
|
37
|
+
/* global
|
|
38
|
+
call_type */
|
|
39
|
+
/* global
|
|
40
|
+
call_auth:
|
|
41
|
+
writable */
|
|
42
|
+
|
|
36
43
|
/* libEVM global variables */
|
|
37
44
|
/* global
|
|
38
45
|
api_key */
|
|
39
46
|
/* global
|
|
40
|
-
contract_abi
|
|
47
|
+
contract_abi:
|
|
48
|
+
writable */
|
|
41
49
|
/* global
|
|
42
50
|
contract_address */
|
|
43
51
|
/* global
|
|
44
|
-
|
|
52
|
+
contract_bytecode:
|
|
53
|
+
writable */
|
|
54
|
+
/* global
|
|
55
|
+
contract_compiler_output:
|
|
56
|
+
writable */
|
|
45
57
|
/* global
|
|
46
58
|
target_network:
|
|
47
59
|
writable */
|
|
@@ -137,8 +149,47 @@ function
|
|
|
137
149
|
}
|
|
138
150
|
|
|
139
151
|
function
|
|
140
|
-
_default_artifact_path_get(
|
|
141
|
-
|
|
152
|
+
_default_artifact_path_get(
|
|
153
|
+
_type) {
|
|
154
|
+
let
|
|
155
|
+
_file_name;
|
|
156
|
+
const
|
|
157
|
+
_home =
|
|
158
|
+
_homedir_get();
|
|
159
|
+
const
|
|
160
|
+
_data_dir =
|
|
161
|
+
_path_join( [
|
|
162
|
+
_home,
|
|
163
|
+
".local",
|
|
164
|
+
"share",
|
|
165
|
+
"evm-contract-call" ]);
|
|
166
|
+
if ( _type == "abi" ) {
|
|
167
|
+
_file_name =
|
|
168
|
+
`${contract_address}.abi.json`;
|
|
169
|
+
}
|
|
170
|
+
else if ( _type == "bytecode" ) {
|
|
171
|
+
_file_name =
|
|
172
|
+
`${contract_address}.bin`;
|
|
173
|
+
}
|
|
174
|
+
else if ( _type == "compiler_output" ) {
|
|
175
|
+
_file_name =
|
|
176
|
+
`${contract_address}.json`;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
const
|
|
180
|
+
_msg =
|
|
181
|
+
`Unknown artifact type '${_type}'.`;
|
|
182
|
+
_msg_error(
|
|
183
|
+
_msg,
|
|
184
|
+
1);
|
|
185
|
+
}
|
|
186
|
+
const
|
|
187
|
+
_artifact =
|
|
188
|
+
_path_join( [
|
|
189
|
+
_data_dir,
|
|
190
|
+
target_network,
|
|
191
|
+
_file_name ]);
|
|
192
|
+
return _artifact;
|
|
142
193
|
}
|
|
143
194
|
|
|
144
195
|
function
|
|
@@ -194,6 +245,26 @@ function
|
|
|
194
245
|
}
|
|
195
246
|
}
|
|
196
247
|
|
|
248
|
+
function
|
|
249
|
+
_call_auth_auto_detect() {
|
|
250
|
+
if ( call_type == "static" ) {
|
|
251
|
+
call_auth =
|
|
252
|
+
"n";
|
|
253
|
+
}
|
|
254
|
+
else if ( call_type == "dynamic" ) {
|
|
255
|
+
call_auth =
|
|
256
|
+
"y";
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
const
|
|
260
|
+
_msg =
|
|
261
|
+
`Unknown call type '${call_type}'.`;
|
|
262
|
+
_msg_error(
|
|
263
|
+
_msg,
|
|
264
|
+
1);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
197
268
|
function
|
|
198
269
|
_evm_contract_call(
|
|
199
270
|
_call_type,
|
|
@@ -217,15 +288,20 @@ function
|
|
|
217
288
|
_method_args) {
|
|
218
289
|
let
|
|
219
290
|
_explorer,
|
|
291
|
+
_out,
|
|
220
292
|
_result,
|
|
221
293
|
_rpc;
|
|
222
294
|
if ( _call_type == "static" ) {
|
|
223
295
|
const
|
|
224
296
|
_infos =
|
|
225
297
|
[];
|
|
298
|
+
_out =
|
|
299
|
+
"";
|
|
300
|
+
|
|
226
301
|
}
|
|
227
302
|
else if ( _call_type == "dynamic" ) {
|
|
228
|
-
|
|
303
|
+
_out =
|
|
304
|
+
"";
|
|
229
305
|
}
|
|
230
306
|
else {
|
|
231
307
|
const
|
|
@@ -236,9 +312,35 @@ function
|
|
|
236
312
|
_msg,
|
|
237
313
|
1);
|
|
238
314
|
}
|
|
315
|
+
return _out;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function
|
|
319
|
+
_artifact_local_auto_detect(
|
|
320
|
+
_type) {
|
|
321
|
+
const
|
|
322
|
+
_artifact =
|
|
323
|
+
_default_artifact_path_get(
|
|
324
|
+
_type);
|
|
325
|
+
if ( _type == "abi" ) {
|
|
326
|
+
contract_abi =
|
|
327
|
+
_artifact;
|
|
328
|
+
}
|
|
329
|
+
else if ( _type == "bytecode" ) {
|
|
330
|
+
contract_bytecode =
|
|
331
|
+
_artifact;
|
|
332
|
+
}
|
|
333
|
+
else if ( _type == "compiler_output" ) {
|
|
334
|
+
contract_compiler_output =
|
|
335
|
+
_artifact;
|
|
336
|
+
}
|
|
239
337
|
}
|
|
240
338
|
|
|
241
339
|
module.exports = {
|
|
340
|
+
_artifact_local_auto_detect:
|
|
341
|
+
_artifact_local_auto_detect,
|
|
342
|
+
_call_auth_auto_detect:
|
|
343
|
+
_call_auth_auto_detect,
|
|
242
344
|
_contract_abi_auto_detect:
|
|
243
345
|
_contract_abi_auto_detect,
|
|
244
346
|
_default_artifact_path_get:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{ "name": "evm-contracts-tools",
|
|
2
2
|
"version":
|
|
3
|
-
"0.0.
|
|
3
|
+
"0.0.33",
|
|
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": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"crash-js-webpack":
|
|
63
|
-
"^0.0.
|
|
63
|
+
"^0.0.10",
|
|
64
64
|
"flatted":
|
|
65
65
|
"^3.2.9",
|
|
66
66
|
"eslint":
|
|
@@ -78,25 +78,25 @@
|
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"crash-js":
|
|
81
|
-
"^0.1.
|
|
81
|
+
"^0.1.111",
|
|
82
82
|
"ethers":
|
|
83
83
|
"^6.13.2",
|
|
84
84
|
"evm-chains-info":
|
|
85
|
-
"^0.0.
|
|
85
|
+
"^0.0.22",
|
|
86
86
|
"evm-transactions-tools":
|
|
87
87
|
"^0.0.9",
|
|
88
88
|
"evm-wallet.js":
|
|
89
|
-
"^0.0.
|
|
89
|
+
"^0.0.49",
|
|
90
90
|
"libevm":
|
|
91
|
-
"^0.0.
|
|
91
|
+
"^0.0.26",
|
|
92
92
|
"yargs":
|
|
93
93
|
"18.0.0"
|
|
94
94
|
},
|
|
95
95
|
"overrides": {
|
|
96
96
|
"evm-contracts-tools":
|
|
97
|
-
"^0.0.
|
|
97
|
+
"^0.0.32",
|
|
98
98
|
"evm-wallet.js":
|
|
99
|
-
"^0.0.
|
|
99
|
+
"^0.0.49"
|
|
100
100
|
},
|
|
101
101
|
"type":
|
|
102
102
|
"commonjs",
|