evm-contracts-tools 0.0.62 → 0.0.65

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 (56) 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/eslint.config.mjs +1 -1
  37. package/evm-contract-call +514 -172
  38. package/evm-contract-deployment-abi +16 -12
  39. package/evm-contract-deployment-address +15 -12
  40. package/evm-contract-deployment-bytecode +15 -12
  41. package/evm-contract-deployment-compiler-output +16 -13
  42. package/evm-contract-deployment-networks +15 -12
  43. package/evm-contract-deployment-versions +15 -12
  44. package/evm-contract-deployments-dir +16 -13
  45. package/evm-contracts-tools +14 -12
  46. package/lib/contract-get +169 -39
  47. package/lib/evm-contract-call-dynamic +1112 -361
  48. package/lib/evm-contract-call-static +463 -73
  49. package/libevm-contract-call +625 -435
  50. package/libevm-contract-deployment +4388 -481
  51. package/libevm-contract-deployment-abi +287 -91
  52. package/libevm-contract-deployment-address +27 -16
  53. package/libevm-contract-deployment-bytecode +275 -80
  54. package/libevm-contract-deployment-compiler-output +341 -93
  55. package/libevm-contract-deployments-dir +53 -50
  56. package/package.json +12 -12
@@ -2,27 +2,31 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
5
+
6
+ /** ----------------------------------------------------------
6
7
  * evm-contract-deployment-abi.js
7
- * ----------------------------------------------------------------
8
+ * ----------------------------------------------------------
8
9
  * Copyright ©
9
10
  * Pellegrino Prevete
10
11
  * 2024, 2025, 2026
11
12
  *
12
13
  * All rights reserved
13
- * ----------------------------------------------------------------
14
+ * ----------------------------------------------------------
14
15
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
16
+ * This program is free software: you can redistribute it
17
+ * and/or modify it under the terms of the GNU General
18
+ * Public License as published by the Free Software
19
+ * Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
19
21
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
22
+ * This program is distributed in the hope that it will
23
+ * be useful, but WITHOUT ANY WARRANTY; without even the
24
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
25
+ * PARTICULAR PURPOSE.
26
+ * See the GNU General Public License for more details.
24
27
  *
25
- * You should have received a copy of the GNU General Public License
28
+ * You should have received a copy of the
29
+ * GNU General Public License
26
30
  * along with this program.
27
31
  * If not, see <https://www.gnu.org/licenses/>.
28
32
  */
@@ -2,27 +2,30 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
5
+ /** ----------------------------------------------------------
6
6
  * evm-contract-deployment-address.js
7
- * ----------------------------------------------------------------
7
+ * ----------------------------------------------------------
8
8
  * Copyright ©
9
9
  * Pellegrino Prevete
10
10
  * 2024, 2025, 2026
11
11
  *
12
12
  * All rights reserved
13
- * ----------------------------------------------------------------
13
+ * ----------------------------------------------------------
14
14
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
15
+ * This program is free software: you can redistribute it
16
+ * and/or modify it under the terms of the GNU General
17
+ * Public License as published by the Free Software
18
+ * Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
19
20
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
21
+ * This program is distributed in the hope that it will
22
+ * be useful, but WITHOUT ANY WARRANTY; without even the
23
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
24
+ * PARTICULAR PURPOSE.
25
+ * See the GNU General Public License for more details.
24
26
  *
25
- * You should have received a copy of the GNU General Public License
27
+ * You should have received a copy of the
28
+ * GNU General Public License
26
29
  * along with this program.
27
30
  * If not, see <https://www.gnu.org/licenses/>.
28
31
  */
@@ -2,27 +2,30 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
5
+ /** ----------------------------------------------------------
6
6
  * evm-contract-deployment-bytecode.js
7
- * ----------------------------------------------------------------
7
+ * ----------------------------------------------------------
8
8
  * Copyright ©
9
9
  * Pellegrino Prevete
10
10
  * 2024, 2025, 2026
11
11
  *
12
12
  * All rights reserved
13
- * ----------------------------------------------------------------
13
+ * ----------------------------------------------------------
14
14
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
15
+ * This program is free software: you can redistribute it
16
+ * and/or modify it under the terms of the GNU General
17
+ * Public License as published by the Free Software
18
+ * Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
19
20
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
21
+ * This program is distributed in the hope that it will
22
+ * be useful, but WITHOUT ANY WARRANTY; without even the
23
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
24
+ * PARTICULAR PURPOSE.
25
+ * See the GNU General Public License for more details.
24
26
  *
25
- * You should have received a copy of the GNU General Public License
27
+ * You should have received a copy of the
28
+ * GNU General Public License
26
29
  * along with this program.
27
30
  * If not, see <https://www.gnu.org/licenses/>.
28
31
  */
@@ -2,27 +2,30 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
6
- * evm-contract-deployment-address.js
7
- * ----------------------------------------------------------------
5
+ /** ----------------------------------------------------------
6
+ * evm-contract-deployment-compiler-output.js
7
+ * ----------------------------------------------------------
8
8
  * Copyright ©
9
9
  * Pellegrino Prevete
10
10
  * 2024, 2025, 2026
11
11
  *
12
12
  * All rights reserved
13
- * ----------------------------------------------------------------
13
+ * ----------------------------------------------------------
14
14
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
15
+ * This program is free software: you can redistribute it
16
+ * and/or modify it under the terms of the GNU General
17
+ * Public License as published by the Free Software
18
+ * Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
19
20
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
21
+ * This program is distributed in the hope that it will
22
+ * be useful, but WITHOUT ANY WARRANTY; without even the
23
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
24
+ * PARTICULAR PURPOSE.
25
+ * See the GNU General Public License for more details.
24
26
  *
25
- * You should have received a copy of the GNU General Public License
27
+ * You should have received a copy of the
28
+ * GNU General Public License
26
29
  * along with this program.
27
30
  * If not, see <https://www.gnu.org/licenses/>.
28
31
  */
@@ -2,27 +2,30 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
5
+ /** ----------------------------------------------------------
6
6
  * evm-contract-deployment-networks.js
7
- * ----------------------------------------------------------------
7
+ * ----------------------------------------------------------
8
8
  * Copyright ©
9
9
  * Pellegrino Prevete
10
10
  * 2024, 2025, 2026
11
11
  *
12
12
  * All rights reserved
13
- * ----------------------------------------------------------------
13
+ * ----------------------------------------------------------
14
14
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
15
+ * This program is free software: you can redistribute it
16
+ * and/or modify it under the terms of the GNU General
17
+ * Public License as published by the Free Software
18
+ * Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
19
20
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
21
+ * This program is distributed in the hope that it will
22
+ * be useful, but WITHOUT ANY WARRANTY; without even the
23
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
24
+ * PARTICULAR PURPOSE.
25
+ * See the GNU General Public License for more details.
24
26
  *
25
- * You should have received a copy of the GNU General Public License
27
+ * You should have received a copy of the
28
+ * GNU General Public License
26
29
  * along with this program.
27
30
  * If not, see <https://www.gnu.org/licenses/>.
28
31
  */
@@ -2,27 +2,30 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
5
+ /** ----------------------------------------------------------
6
6
  * evm-contract-deployment-versions.js
7
- * ----------------------------------------------------------------
7
+ * ----------------------------------------------------------
8
8
  * Copyright ©
9
9
  * Pellegrino Prevete
10
10
  * 2024, 2025, 2026
11
11
  *
12
12
  * All rights reserved
13
- * ----------------------------------------------------------------
13
+ * ----------------------------------------------------------
14
14
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
15
+ * This program is free software: you can redistribute it
16
+ * and/or modify it under the terms of the GNU General
17
+ * Public License as published by the Free Software
18
+ * Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
19
20
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
21
+ * This program is distributed in the hope that it will
22
+ * be useful, but WITHOUT ANY WARRANTY; without even the
23
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
24
+ * PARTICULAR PURPOSE.
25
+ * See the GNU General Public License for more details.
24
26
  *
25
- * You should have received a copy of the GNU General Public License
27
+ * You should have received a copy of the
28
+ * GNU General Public License
26
29
  * along with this program.
27
30
  * If not, see <https://www.gnu.org/licenses/>.
28
31
  */
@@ -2,27 +2,30 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
6
- * evm-contract-deployment-dir.js
7
- * ----------------------------------------------------------------
5
+ /** ----------------------------------------------------------
6
+ * evm-contract-deployments-dir.js
7
+ * ----------------------------------------------------------
8
8
  * Copyright ©
9
9
  * Pellegrino Prevete
10
10
  * 2024, 2025, 2026
11
11
  *
12
12
  * All rights reserved
13
- * ----------------------------------------------------------------
13
+ * ----------------------------------------------------------
14
14
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
15
+ * This program is free software: you can redistribute it
16
+ * and/or modify it under the terms of the GNU General
17
+ * Public License as published by the Free Software
18
+ * Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
19
20
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
21
+ * This program is distributed in the hope that it will
22
+ * be useful, but WITHOUT ANY WARRANTY; without even the
23
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
24
+ * PARTICULAR PURPOSE.
25
+ * See the GNU General Public License for more details.
24
26
  *
25
- * You should have received a copy of the GNU General Public License
27
+ * You should have received a copy of the
28
+ * GNU General Public License
26
29
  * along with this program.
27
30
  * If not, see <https://www.gnu.org/licenses/>.
28
31
  */
@@ -2,25 +2,27 @@
2
2
 
3
3
  // SPDX-License-Identifier: AGPL-3.0-or-later
4
4
 
5
- /** ----------------------------------------------------------------
5
+ /** ----------------------------------------------------------
6
6
  * evm-contracts-tools
7
- * ----------------------------------------------------------------
7
+ * ----------------------------------------------------------
8
8
  * Copyright ©
9
9
  * Pellegrino Prevete
10
- * 2025, 2026
10
+ * 2024, 2025, 2026
11
11
  *
12
12
  * All rights reserved
13
- * ----------------------------------------------------------------
13
+ * ----------------------------------------------------------
14
14
  *
15
- * This program is free software: you can redistribute it and/or
16
- * modify it under the terms of the GNU General Public License as
17
- * published by the Free Software Foundation, either version 3 of
18
- * the License, or (at your option) any later version.
15
+ * This program is free software: you can redistribute it
16
+ * and/or modify it under the terms of the GNU General
17
+ * Public License as published by the Free Software
18
+ * Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
19
20
  *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
21
+ * This program is distributed in the hope that it will
22
+ * be useful, but WITHOUT ANY WARRANTY; without even the
23
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
24
+ * PARTICULAR PURPOSE.
25
+ * See the GNU General Public License for more details.
24
26
  *
25
27
  * You should have received a copy of the
26
28
  * GNU General Public License
package/lib/contract-get CHANGED
@@ -56,6 +56,11 @@ const
56
56
  const
57
57
  _echo =
58
58
  _libcrash._echo;
59
+ /* global
60
+ _echo2 */
61
+ const
62
+ _echo2 =
63
+ _libcrash._echo2;
59
64
  /* global
60
65
  _exit */
61
66
  const
@@ -276,27 +281,102 @@ async function
276
281
  _contract,
277
282
  _contract_abi,
278
283
  _contract_bytecode,
284
+ _factory,
279
285
  _msg;
280
- if ( _contract_abi_path == "" ) {
281
- _contract_abi = [];
282
- }
283
- else if ( _contract_abi_path != "" ) {
284
- _contract_abi =
285
- _json_read(
286
+ _msg =
287
+ "Getting contract through ABI + bytecode.";
288
+ _msg_info(
289
+ _msg);
290
+ const
291
+ _contract_abi_path_type =
292
+ typeof(
286
293
  _contract_abi_path);
294
+ if ( _contract_abi_path_type === "undefined" ) {
295
+ _msg =
296
+ "Contract ABI path undefined, " +
297
+ "setting empty contract ABI.";
298
+ _msg_info(
299
+ _msg);
300
+ _contract_abi =
301
+ {};
302
+ }
303
+ if ( _contract_abi_path_type === "string" ) {
304
+ if ( _contract_abi_path.length < 1 ) {
305
+ _msg =
306
+ "Contract ABI path not set, " +
307
+ "setting empty contract ABI.";
308
+ _msg_info(
309
+ _msg);
310
+ _contract_abi =
311
+ {};
312
+ }
313
+ else {
314
+ try {
315
+ _msg =
316
+ `Reading ABI at '${_contract_abi_path}'`;
317
+ _contract_abi =
318
+ await _json_read(
319
+ _contract_abi_path);
320
+ }
321
+ catch(
322
+ _error) {
323
+ _msg =
324
+ "Error running '_json_read' on " +
325
+ `'${_contract_abi_path}'.`;
326
+ _echo2(
327
+ _error);
328
+ throw _error;
329
+ }
330
+ }
287
331
  }
288
332
  if ( _contract_bytecode_path != "" ) {
289
- _contract_bytecode =
290
- _file_read(
291
- _contract_bytecode_path);
333
+ try {
334
+ _contract_bytecode =
335
+ _file_read(
336
+ _contract_bytecode_path);
337
+ }
338
+ catch(
339
+ _error) {
340
+ _msg =
341
+ "Error running '_json_read'.";
342
+ _echo2(
343
+ _error);
344
+ throw _error;
345
+ }
292
346
  }
293
347
  const
348
+ _contract_factory_args = [
349
+ _contract_abi,
350
+ _contract_bytecode,
351
+ _wallet
352
+ ];
353
+ try {
294
354
  _factory =
295
355
  new _contract_factory(
296
356
  _contract_abi,
297
357
  _contract_bytecode,
298
358
  _wallet);
359
+ }
360
+ catch(
361
+ _error) {
362
+ _msg =
363
+ "Error running '_contract_factory' " +
364
+ "with arguments:";
365
+ _msg_error(
366
+ _msg,
367
+ 0);
368
+ _echo2(
369
+ _contract_factory_args);
370
+ _echo2(
371
+ _error);
372
+ throw _error
373
+ }
299
374
  if ( _contract_address != "" ) {
375
+ _msg =
376
+ "Attaching address " +
377
+ `'${_contract_address}' to factory.`;
378
+ _msg_info(
379
+ _msg);
300
380
  _contract =
301
381
  _factory.attach(
302
382
  _contract_address);
@@ -305,15 +385,18 @@ async function
305
385
  try {
306
386
  _contract =
307
387
  _factory.getDeployTransaction();
308
- } catch (e) {
309
- const
310
- _msg =
311
- `Encountered the above error.`;
312
- console.error(
313
- e);
314
- _msg_error(
315
- _msg,
316
- 0);
388
+ }
389
+ catch (
390
+ _error) {
391
+ const
392
+ _msg =
393
+ `Error running 'factory.getDeployTransaction'.`;
394
+ _msg_error(
395
+ _msg,
396
+ 0);
397
+ _echo2(
398
+ _error);
399
+ throw _error;
317
400
  }
318
401
  }
319
402
  return _contract;
@@ -379,7 +462,9 @@ async function
379
462
  let
380
463
  _api_key,
381
464
  _contract,
382
- _contract_get_opts,
465
+ _contract_get_fun,
466
+ _contract_get_args,
467
+ _msg,
383
468
  _network_provider,
384
469
  _wallet,
385
470
  _wallet_get_opts,
@@ -390,11 +475,32 @@ async function
390
475
  _file_read(
391
476
  _api_key_path);
392
477
  }
393
- _network_provider =
394
- _provider_get(
478
+ const
479
+ _provider_get_args = [
395
480
  _target_network,
396
- _api_key);
397
- _contract_get_opts =
481
+ _api_key
482
+ ];
483
+ try {
484
+ _network_provider =
485
+ await _provider_get.apply(
486
+ null,
487
+ _provider_get_args);
488
+ }
489
+ catch(
490
+ _error) {
491
+ _msg =
492
+ "Error running '_provider_get' " +
493
+ "with arguments:";
494
+ _msg_error(
495
+ _msg,
496
+ 0);
497
+ _echo2(
498
+ _provider_get_args);
499
+ _echo2(
500
+ _error);
501
+ throw _error;
502
+ }
503
+ _contract_get_args =
398
504
  [];
399
505
  if ( _wallet_seed != "" ) {
400
506
  _wallet_path_list = [
@@ -411,43 +517,56 @@ async function
411
517
  _wallet_seed,
412
518
  _network_provider
413
519
  ];
414
- _wallet =
415
- _wallet_get.apply(
416
- null,
417
- _wallet_get_opts);
520
+ try {
521
+ _wallet =
522
+ await _wallet_get.apply(
523
+ null,
524
+ _wallet_get_opts);
525
+ }
526
+ catch(
527
+ _error) {
528
+ _msg =
529
+ "Error running '_wallet_get'.";
530
+ _msg_error(
531
+ _msg,
532
+ 0);
533
+ _echo2(
534
+ _error);
535
+ throw _error;
536
+ }
418
537
  _msg_info_wallet_selected(
419
538
  _wallet);
420
- _contract_get_opts.push(
539
+ _contract_get_args.push(
421
540
  _wallet);
422
541
  }
423
542
  else {
424
- _contract_get_opts.push(
543
+ _contract_get_args.push(
425
544
  _network_provider);
426
545
  }
427
- _contract_get_opts.push(
546
+ _contract_get_args.push(
428
547
  _contract_address);
429
548
  if ( _contract_bytecode_path != "" ) {
430
- _contract_get_opts.push(
549
+ _contract_get_args.push(
431
550
  _contract_abi_path,
432
551
  _contract_bytecode_path);
433
552
  _contract_get_fun =
434
553
  _contract_get_bytecode;
435
554
  }
436
555
  else if ( _contract_compiler_output_path != "" ) {
437
- _contract_get_opts.push(
556
+ _contract_get_args.push(
438
557
  _contract_compiler_output_path);
439
558
  _contract_get_fun =
440
559
  _contract_get_compiler_output;
441
560
  }
442
561
  else if ( _contract_bytecode_path == "" &&
443
- _contract_abi_path != "" ) {
444
- _contract_get_opts.push(
562
+ _contract_abi_path != "" ) {
563
+ _contract_get_args.push(
445
564
  _contract_abi_path);
446
565
  _contract_get_fun =
447
566
  _contract_get_abi;
448
567
  }
449
568
  else if ( _contract_bytecode_path == "" &&
450
- _contract_abi_path == "" &&
569
+ _contract_abi_path == "" &&
451
570
  _contract_compiler_output_path == "" ) {
452
571
  _msg_error_no_input_data();
453
572
  }
@@ -455,10 +574,21 @@ async function
455
574
  _contract = await
456
575
  _contract_get_fun.apply(
457
576
  null,
458
- _contract_get_opts);
459
- } catch (e) {
460
- console.error(
461
- e);
577
+ _contract_get_args);
578
+ } catch (
579
+ _error) {
580
+ _msg =
581
+ "Error running " +
582
+ `'${_contract_get_fun}' ` +
583
+ "with parameters:";
584
+ _msg_error(
585
+ _msg,
586
+ 0);
587
+ _echo2(
588
+ _contract_get_args);
589
+ _echo2(
590
+ _error);
591
+ throw _error;
462
592
  }
463
593
  return _contract;
464
594
  }