evm-contracts-tools 0.0.33 → 0.0.36

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/Makefile ADDED
@@ -0,0 +1,222 @@
1
+ # SPDX-License-Identifier: AGPL-3.0
2
+
3
+ # -----------------------------------------------------
4
+ # Copyright © 2024, 2025, 2026 Pellegrino Prevete
5
+ #
6
+ # All rights reserved
7
+ # -----------------------------------------------------
8
+ #
9
+ # This program is free software: you can redistribute
10
+ # it and/or modify it under the terms of the
11
+ # GNU Affero General Public License as published by
12
+ # the Free Software Foundation, either version 3 of
13
+ # the License, or (at your option) any later version.
14
+ #
15
+ # This program is distributed in the hope that it
16
+ # will be useful, but WITHOUT ANY WARRANTY;
17
+ # without even the implied warranty of
18
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
+ # See the GNU Affero General Public License for
20
+ # more details.
21
+ #
22
+ # You should have received a copy of the
23
+ # GNU Affero General Public License
24
+ # along with this program.
25
+ # If not, see <https://www.gnu.org/licenses/>.
26
+
27
+ SHELL=bash
28
+ PREFIX ?= /usr/local
29
+ _PROJECT_NPM=evm-contracts-tools
30
+ _PROJECT=$(_PROJECT_NPM).js
31
+ _NAMESPACE=themartiancompany
32
+ DOC_DIR=$(DESTDIR)$(PREFIX)/share/doc/$(_PROJECT_NPM)
33
+ USR_DIR=$(DESTDIR)$(PREFIX)
34
+ BIN_DIR=$(DESTDIR)$(PREFIX)/bin
35
+ LIB_DIR=$(DESTDIR)$(PREFIX)/lib/$(_PROJECT_NPM)
36
+ MAN_DIR?=$(DESTDIR)$(PREFIX)/share/man
37
+ NODE_DIR=$(PREFIX)/lib/node_modules/$(_PROJECT_NPM)
38
+ BUILD_NPM_DIR=build
39
+
40
+ _INSTALL_FILE=\
41
+ install \
42
+ -vDm644
43
+ _INSTALL_EXE=\
44
+ install \
45
+ -vDm755
46
+ _INSTALL_DIR=\
47
+ install \
48
+ -vdm755
49
+
50
+ DOC_FILES=\
51
+ $(wildcard \
52
+ *.rst) \
53
+ $(wildcard \
54
+ *.md)
55
+ NPM_FILES=\
56
+ "README.md" \
57
+ "COPYING" \
58
+ "AUTHORS.rst" \
59
+ "Makefile" \
60
+ "dist" \
61
+ "evm-contract-call" \
62
+ "evm-contract-call.webpack.config.cjs" \
63
+ "evm-contract-deployments-dir" \
64
+ "evm-contract-deployments-dir.webpack.config.cjs" \
65
+ "lib" \
66
+ "libevm-contract-call" \
67
+ "libevm-contract-call.webpack.config.cjs" \
68
+ "libevm-contract-deployments-dir" \
69
+ "libevm-contract-deployments-dir.webpack.config.cjs" \
70
+ "$(_PROJECT_NPM)" \
71
+ "eslint.config.mjs" \
72
+ "fs-worker.webpack.config.cjs" \
73
+ "package.json" \
74
+ "webpack.config.cjs"
75
+
76
+ all: build-man build-npm build-scripts
77
+
78
+ check: eslint
79
+
80
+ eslint:
81
+
82
+ npm \
83
+ install \
84
+ --save-dev; \
85
+ npx \
86
+ eslint \
87
+ "."
88
+
89
+ install: install-scripts install-doc install-examples install-man
90
+
91
+ install-scripts:
92
+
93
+ $(_INSTALL_DIR) \
94
+ "$(LIB_DIR)/nodejs/lib"
95
+ for _file in $(NPM_FILES); do
96
+ $(_INSTALL_FILE) \
97
+ "$${_file}" \
98
+ "$(LIB_DIR)/nodejs/$${_file}"; \
99
+ ln \
100
+ -s \
101
+ "$(PREFIX)/lib/$(_PROJECT_NPM)/nodejs/$${_file}" \
102
+ "$(LIB_DIR)/$${_file}" || \
103
+ true; \
104
+ done
105
+ # ln \
106
+ # -s \
107
+ # "$(PREFIX)/lib/$(_PROJECT_NPM)/node/lib$(_PROJECT_NPM)" \
108
+ # "$(LIB_DIR)/$(_PROJECT_NPM)-js" || \
109
+ # true
110
+
111
+ build-man:
112
+
113
+ git \
114
+ submodule \
115
+ update \
116
+ --init \
117
+ "man" || \
118
+ true; \
119
+ _version="$$( \
120
+ npm \
121
+ view \
122
+ "$${PWD}" \
123
+ "version")"; \
124
+ cd \
125
+ "man"; \
126
+ make \
127
+ _VERSION="$${_version}" \
128
+ build-man
129
+ mkdir \
130
+ -p \
131
+ "build/man"
132
+ cp \
133
+ -r \
134
+ "man/build/"* \
135
+ "build/man"
136
+
137
+ build-npm:
138
+
139
+ make \
140
+ build-man
141
+ for _file in $(NPM_FILES); do \
142
+ if [[ -d "$${_file}" ]]; then \
143
+ mkdir \
144
+ -p \
145
+ "build/$${_file}"; \
146
+ cp \
147
+ -r \
148
+ "$${_file}/"* \
149
+ "build/$${_file}"; \
150
+ elif [[ -e "$${_file}" ]]; then \
151
+ cp \
152
+ "$${_file}" \
153
+ "build"; \
154
+ fi; \
155
+ done
156
+ cd \
157
+ "build"; \
158
+ _version="$$( \
159
+ npm \
160
+ view \
161
+ "$${PWD}" \
162
+ "version")"; \
163
+ npm \
164
+ install; \
165
+ npm \
166
+ run \
167
+ "build"; \
168
+ npm \
169
+ pack; \
170
+ mv \
171
+ "$(_PROJECT_NPM)-$${_version}.tgz" \
172
+ ".."
173
+
174
+ install-npm:
175
+
176
+ _npm_opts=( \
177
+ -g \
178
+ --prefix \
179
+ '$(USR_DIR)' \
180
+ ); \
181
+ _version="$$( \
182
+ npm \
183
+ view \
184
+ "$${PWD}" \
185
+ "version")"; \
186
+ npm \
187
+ install \
188
+ "$${_npm_opts[@]}" \
189
+ "$(_PROJECT_NPM)-$${_version}.tgz"; \
190
+ $(_INSTALL_DIR) \
191
+ "$(DESTDIR)$(PREFIX)/lib"; \
192
+ ln \
193
+ -s \
194
+ "$(NODE_DIR)" \
195
+ "$(LIB_DIR)" || \
196
+ true
197
+
198
+ publish-npm:
199
+
200
+ cd \
201
+ "build"; \
202
+ npm \
203
+ publish \
204
+ --access \
205
+ "public"
206
+
207
+ install-doc:
208
+
209
+ $(_INSTALL_FILE) \
210
+ $(DOC_FILES) \
211
+ -t \
212
+ $(DOC_DIR)
213
+
214
+ install-man:
215
+
216
+ $(_INSTALL_DIR) \
217
+ "$(MAN_DIR)/man1"
218
+ $(_INSTALL_FILE) \
219
+ "build/man/$(_PROJECT_NPM).1" \
220
+ "$(MAN_DIR)/man1/$(_PROJECT_NPM).1"
221
+
222
+ .PHONY: check build-man build-npm build-scripts install install-doc install-man install-npm install-scripts shellcheck
@@ -0,0 +1,24 @@
1
+ <!--
2
+ SPDX-License-Identifier: AGPL-3.0-or-later
3
+
4
+ ----------------------------------------------------------------------
5
+ Copyright © 2024, 2025, 2026 Pellegrino Prevete
6
+
7
+ All rights reserved
8
+ ----------------------------------------------------------------------
9
+
10
+ This program is free software: you can redistribute it and/or modify
11
+ it under the terms of the GNU Affero General Public License as published by
12
+ the Free Software Foundation, either version 3 of the License, or
13
+ (at your option) any later version.
14
+
15
+ This program is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU Affero General Public License for more details.
19
+
20
+ You should have received a copy of the GNU Affero General Public License
21
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
22
+ -->
23
+
24
+ <script src="evm-contract-call.js"></script>
@@ -0,0 +1,31 @@
1
+ <!--
2
+ SPDX-License-Identifier: AGPL-3.0-or-later
3
+
4
+ ---------------------------------------------
5
+ Copyright © 2024, 2025, 2026
6
+ Pellegrino Prevete
7
+
8
+ All rights reserved
9
+ ---------------------------------------------
10
+
11
+ This program is free software: you can
12
+ redistribute it and/or modify it under the
13
+ terms of the GNU Affero General Public
14
+ License as published by the Free Software
15
+ Foundation, either version 3 of the License,
16
+ or (at your option) any later version.
17
+
18
+ This program is distributed in the hope that
19
+ it will be useful, but WITHOUT ANY WARRANTY;
20
+ without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR
22
+ PURPOSE. See the GNU Affero General Public
23
+ License for more details.
24
+
25
+ You should have received a copy of the GNU
26
+ Affero General Public License
27
+ along with this program.
28
+ If not, see <https://www.gnu.org/licenses/>.
29
+ -->
30
+
31
+ <script src="evm-contract-deployments-dir.js"></script>
@@ -0,0 +1,24 @@
1
+ <!--
2
+ SPDX-License-Identifier: AGPL-3.0-or-later
3
+
4
+ ----------------------------------------------------------------------
5
+ Copyright © 2024, 2025, 2026 Pellegrino Prevete
6
+
7
+ All rights reserved
8
+ ----------------------------------------------------------------------
9
+
10
+ This program is free software: you can redistribute it and/or modify
11
+ it under the terms of the GNU Affero General Public License as published by
12
+ the Free Software Foundation, either version 3 of the License, or
13
+ (at your option) any later version.
14
+
15
+ This program is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU Affero General Public License for more details.
19
+
20
+ You should have received a copy of the GNU Affero General Public License
21
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
22
+ -->
23
+
24
+ <script src="evm-contracts-tools.js"></script>
@@ -0,0 +1 @@
1
+ (()=>{var e={816(e,o,n){function t(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){let e;try{e=n(816)}catch(e){console.log(e);const o="Error importing the '@themartiancompany/opfs' module as 'opfs'. If you got this error while bundling a webpack for a project depending on this module double check its 'webpack.config.js' file or whether the 'opfs' module is listed in developer dependencies and install them.I'm sorry for this inconvenience but Node packagement system does not currently distinguish 'development' from 'build' dependencies.";throw console.error(o),e}return e}()),e}const r=t();e.exports=r,e.exports.getModule=function(e){let o;if(""==_module_name||"undefined"==typeof _module_name)o=t();else if("opfs"==_module_name)o=n(816);else{if("fs"!=_module_name){const e="Unknown file system module "+`'${_module_name}'.`.const;throw _error={msg:e},console.error(e),_error}o=n(816)}return o}},314(e,o,n){const t=n(816);_sync_agent=t.startSyncAgent,e.exports={_sync_agent},_sync_agent()}},o={};function n(t){var r=o[t];if(void 0!==r)return r.exports;var s=o[t]={exports:{}};return e[t](s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(314)})();
@@ -0,0 +1,24 @@
1
+ <!--
2
+ SPDX-License-Identifier: AGPL-3.0-or-later
3
+
4
+ ----------------------------------------------------------------------
5
+ Copyright © 2024, 2025, 2026 Pellegrino Prevete
6
+
7
+ All rights reserved
8
+ ----------------------------------------------------------------------
9
+
10
+ This program is free software: you can redistribute it and/or modify
11
+ it under the terms of the GNU Affero General Public License as published by
12
+ the Free Software Foundation, either version 3 of the License, or
13
+ (at your option) any later version.
14
+
15
+ This program is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU Affero General Public License for more details.
19
+
20
+ You should have received a copy of the GNU Affero General Public License
21
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
22
+ -->
23
+
24
+ <script src="libevm-contract-call.js"></script>
@@ -0,0 +1,24 @@
1
+ <!--
2
+ SPDX-License-Identifier: AGPL-3.0-or-later
3
+
4
+ ----------------------------------------------------------------------
5
+ Copyright © 2024, 2025, 2026 Pellegrino Prevete
6
+
7
+ All rights reserved
8
+ ----------------------------------------------------------------------
9
+
10
+ This program is free software: you can redistribute it and/or modify
11
+ it under the terms of the GNU Affero General Public License as published by
12
+ the Free Software Foundation, either version 3 of the License, or
13
+ (at your option) any later version.
14
+
15
+ This program is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU Affero General Public License for more details.
19
+
20
+ You should have received a copy of the GNU Affero General Public License
21
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
22
+ -->
23
+
24
+ <script src="libevm-contract-deployments-dir.js"></script>
package/evm-contract-call CHANGED
@@ -141,6 +141,11 @@ const
141
141
  const
142
142
  _artifact_local_auto_detect =
143
143
  _libevm_contract_call_module._artifact_local_auto_detect;
144
+ /* global
145
+ _address_check */
146
+ const
147
+ _address_check =
148
+ _libevm_contract_call_module._address_check;
144
149
  /* global
145
150
  _default_artifact_path_get */
146
151
  const
@@ -260,7 +265,24 @@ function
260
265
 
261
266
  async function
262
267
  _overrides_set() {
263
- console.log("cant you really read", quiet);
268
+ if ( ! _help_display &&
269
+ typeof(_help_display) != "undefined" &&
270
+ _help_display != "" ) {
271
+ const
272
+ _address_valid =
273
+ _address_check(
274
+ contract_address);
275
+ if ( ! _address_valid ) {
276
+ const
277
+ _msg =
278
+ "Contract address " +
279
+ `'${contract_address}' is ` +
280
+ `invalid.`;
281
+ _msg_error(
282
+ _msg,
283
+ 1);
284
+ }
285
+ }
264
286
  if ( call_date == "" ||
265
287
  typeof(
266
288
  call_date) == "undefined" ) {
@@ -317,12 +339,10 @@ async function
317
339
  }
318
340
  }
319
341
  }
320
- console.log("this resets it", quiet);
321
342
  await _wallet_overrides_set(
322
343
  "evm-wallet",
323
344
  wallet_name,
324
345
  call_auth);
325
- console.log("hello", quiet);
326
346
  }
327
347
 
328
348
  function
@@ -360,9 +380,6 @@ function
360
380
  ` Contract method: ${contract_method}`,
361
381
  ` Method arguments: ${method_args}`,
362
382
  ];
363
- console.log(
364
- "Hellooo");
365
- console.log(quiet);
366
383
  for ( _line of _text ) {
367
384
  _msg_info(
368
385
  _line);
@@ -523,7 +540,8 @@ async function
523
540
  if ( _help_display ) {
524
541
  quiet =
525
542
  "n";
526
- await _overrides_set();
543
+ await _overrides_set(
544
+ _help_display);
527
545
  _usage(
528
546
  0);
529
547
  }
@@ -703,7 +721,6 @@ async function
703
721
  quiet =
704
722
  "n";
705
723
  }
706
- console.log("quiet", quiet);
707
724
  }
708
725
 
709
726
  function
@@ -808,13 +825,9 @@ async function
808
825
 
809
826
  async function
810
827
  _main() {
811
- console.log("quiet", quiet);
812
828
  const
813
829
  _overrides_set_up =
814
830
  await _overrides_set();
815
- console.log("now its reset", quiet);
816
- console.log(quiet);
817
- console.log(call_date);
818
831
  _config_show();
819
832
  app_opts = [
820
833
  call_type,
@@ -848,7 +861,6 @@ if ( _cmdline_check(
848
861
  _cmdline_check(
849
862
  "evm-contract-call") == true ) {
850
863
  _cmdline_parse();
851
- console.log("quiet", quiet);
852
864
  }
853
865
  else{
854
866
  _url_parse();