evm-chains-info 0.0.35 → 0.0.37

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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={495(e,t,r){r.a(e,async(e,t)=>{try{const e=await r.e(35).then(()=>r(35)),o=(e._echo,e._get,e._global_get,e._homedir_get,e._file_exists,e._file_read,e._file_write,e._json_read,e._lib_get,e._mkdir,e._msg_info,e._msg_error,e._path_join,e._range,e._require);e._rm,e._set,(await o("ethereum-data"))._data_get,t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,i,c)=>{let s;c&&((s=[]).d=-1);const a=new Set,l=r.exports;let u,f,p;const d=new Promise((e,t)=>{p=t,f=e});d[t]=l,d[e]=e=>(s&&e(s),a.forEach(e),d.catch(e=>{})),r.exports=d,i(r=>{let i;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const i=[];i.d=0,r.then(e=>{c[t]=e,n(i)},e=>{c[o]=e,n(i)});const c={};return c[e]=e=>e(i),c}}const i={};return i[e]=e=>{},i[t]=r,i}))(r);const c=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{i=()=>t(c),i.r=0;const r=e=>e!==s&&!a.has(e)&&(a.add(e),e&&!e.d&&(i.r++,e.push(i)));u.forEach(t=>t[e](r))});return i.r?l:c()},e=>(e?p(d[o]=e):f(l),n(s))),s?.d<0&&(s.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;r.t=function(o,n){if(1&n&&(o=this(o)),8&n)return o;if("object"==typeof o&&o){if(4&n&&o.__esModule)return o;if(16&n&&"function"==typeof o.then)return o}const i=Object.create(null);r.r(i);const c={};t=t||[null,e({}),e([]),e(e)];for(var s=2&n&&o;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>c[e]=()=>o[e]);return c.default=()=>o,r.d(i,c),i}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],i=t[o++],c=0===i?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:i};r.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,o)=>(r.f[o](e,t),t),[])),r.u=e=>e+".libevm-chains-info.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="evm-chains-info:";r.l=(o,n,i,c)=>{if(e[o])return void e[o].push(n);let s,a;if(void 0!==i){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const r=e[l];if(r.getAttribute("src")==o||r.getAttribute("data-webpack")==t+i){s=r;break}}}s||(a=!0,s=document.createElement("script"),s.charset="utf-8",r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack",t+i),s.src=o),e[o]=[n];const u=(t,r)=>{s.onerror=s.onload=null,clearTimeout(f);const n=e[o];if(delete e[o],s.parentNode?.removeChild(s),n?.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),a&&document.head.appendChild(s)}})(),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;r.g.importScripts&&(e=r.g.location+"");const t=r.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const r=t.getElementsByTagName("script");if(r.length){let t=r.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=r[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=e})(),(()=>{const e={792:0};r.f.j=(t,o)=>{let n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{const i=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=i);const c=new Error,s=o=>{if(r.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;c.message="Loading chunk "+t+" failed.\n("+e+": "+r+")",c.name="ChunkLoadError",c.type=e,c.request=r,c.event=o,n[1](c)}};r.l(r.p+r.u(t),s,"chunk-"+t,t)}};const t=(t,o)=>{let[n,i,c]=o;var s,a,l=0;if(n.some(t=>0!==e[t])){for(s in i)r.o(i,s)&&(r.m[s]=i[s]);c&&c(r)}for(t&&t(o);l<n.length;l++)a=n[l],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0},o=self.webpackChunkevm_chains_info=self.webpackChunkevm_chains_info||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r(495)})();
1
+ (()=>{"use strict";var e={495(e,t,r){r.a(e,async(e,t)=>{try{const e=await r.e(35).then(()=>r(35)),o=(e._echo,e._echo2,e._get,e._global_get,e._homedir_get,e._file_exists,e._file_read,e._file_write,e._json_read,e._lib_get,e._mkdir,e._msg_info,e._msg_error,e._path_join,e._range,e._require);e._rm,e._set,(await o("ethereum-data"))._data_get,t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,i,c)=>{let s;c&&((s=[]).d=-1);const a=new Set,l=r.exports;let u,f,p;const d=new Promise((e,t)=>{p=t,f=e});d[t]=l,d[e]=e=>(s&&e(s),a.forEach(e),d.catch(e=>{})),r.exports=d,i(r=>{let i;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const i=[];i.d=0,r.then(e=>{c[t]=e,n(i)},e=>{c[o]=e,n(i)});const c={};return c[e]=e=>e(i),c}}const i={};return i[e]=e=>{},i[t]=r,i}))(r);const c=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{i=()=>t(c),i.r=0;const r=e=>e!==s&&!a.has(e)&&(a.add(e),e&&!e.d&&(i.r++,e.push(i)));u.forEach(t=>t[e](r))});return i.r?l:c()},e=>(e?p(d[o]=e):f(l),n(s))),s?.d<0&&(s.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;r.t=function(o,n){if(1&n&&(o=this(o)),8&n)return o;if("object"==typeof o&&o){if(4&n&&o.__esModule)return o;if(16&n&&"function"==typeof o.then)return o}const i=Object.create(null);r.r(i);const c={};t=t||[null,e({}),e([]),e(e)];for(var s=2&n&&o;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>c[e]=()=>o[e]);return c.default=()=>o,r.d(i,c),i}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],i=t[o++],c=0===i?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:i};r.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,o)=>(r.f[o](e,t),t),[])),r.u=e=>e+".libevm-chains-info.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="evm-chains-info:";r.l=(o,n,i,c)=>{if(e[o])return void e[o].push(n);let s,a;if(void 0!==i){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const r=e[l];if(r.getAttribute("src")==o||r.getAttribute("data-webpack")==t+i){s=r;break}}}s||(a=!0,s=document.createElement("script"),s.charset="utf-8",r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack",t+i),s.src=o),e[o]=[n];const u=(t,r)=>{s.onerror=s.onload=null,clearTimeout(f);const n=e[o];if(delete e[o],s.parentNode?.removeChild(s),n?.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),a&&document.head.appendChild(s)}})(),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;r.g.importScripts&&(e=r.g.location+"");const t=r.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const r=t.getElementsByTagName("script");if(r.length){let t=r.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=r[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=e})(),(()=>{const e={792:0};r.f.j=(t,o)=>{let n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{const i=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=i);const c=new Error,s=o=>{if(r.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;c.message="Loading chunk "+t+" failed.\n("+e+": "+r+")",c.name="ChunkLoadError",c.type=e,c.request=r,c.event=o,n[1](c)}};r.l(r.p+r.u(t),s,"chunk-"+t,t)}};const t=(t,o)=>{let[n,i,c]=o;var s,a,l=0;if(n.some(t=>0!==e[t])){for(s in i)r.o(i,s)&&(r.m[s]=i[s]);c&&c(r)}for(t&&t(o);l<n.length;l++)a=n[l],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0},o=self.webpackChunkevm_chains_info=self.webpackChunkevm_chains_info||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r(495)})();
@@ -61,6 +61,11 @@ const
61
61
  const
62
62
  _echo =
63
63
  _libcrash_module._echo;
64
+ /* global
65
+ _echo2 */
66
+ const
67
+ _echo2 =
68
+ _libcrash_module._echo2;
64
69
  /* global
65
70
  _get */
66
71
  const
@@ -159,7 +164,9 @@ async function
159
164
  let
160
165
  _db_name,
161
166
  _db_path,
162
- _msg;
167
+ _exception,
168
+ _msg,
169
+ _lib;
163
170
  if ( typeof(
164
171
  _user) == "undefined" ||
165
172
  _user == "" ) {
@@ -209,9 +216,13 @@ async function
209
216
  ".config",
210
217
  "evm-chains",
211
218
  _db_name ]);
219
+ _msg =
220
+ `Looking for database '${_db_path}'.`;
221
+ _msg_info(
222
+ _msg);
212
223
  const
213
224
  _db_exists =
214
- _file_exists(
225
+ await _file_exists(
215
226
  _db_path);
216
227
  if ( _db_exists == true ) {
217
228
  _msg =
@@ -232,21 +243,43 @@ async function
232
243
  _msg =
233
244
  "wat";
234
245
  _msg_error(
235
- _msg);
246
+ _msg,
247
+ 1);
236
248
  }
237
249
  }
238
250
  else if ( _user == "n" ) {
239
- const
251
+ _msg =
252
+ `Retrieving system libraries directory.`;
253
+ _msg_info(
254
+ _msg);
255
+ try {
240
256
  _lib =
241
- await _lib_get();
257
+ await _lib_get(
258
+ "y",
259
+ "n");
260
+ }
261
+ catch(
262
+ _error) {
263
+ _msg_error(
264
+ _msg,
265
+ 0);
266
+ _exception = {
267
+ "msg":
268
+ _msg
269
+ };
270
+ throw _exception;
271
+ }
242
272
  _msg =
243
273
  `Found system libraries directory ` +
244
274
  `'${_lib}'.`;
275
+ _msg_info(
276
+ _msg);
245
277
  _db_path =
246
- _path_join(
247
- [ _lib,
248
- "evm-chains",
249
- _db_name ]);
278
+ _path_join([
279
+ _lib,
280
+ "evm-chains",
281
+ _db_name
282
+ ]);
250
283
  }
251
284
  else {
252
285
  _msg =
@@ -255,6 +288,11 @@ async function
255
288
  _msg_error(
256
289
  _msg,
257
290
  0);
291
+ _exception = {
292
+ "msg":
293
+ _msg
294
+ };
295
+ throw _exception;
258
296
  }
259
297
  return _db_path;
260
298
  }
@@ -381,7 +419,9 @@ async function
381
419
  _db_path == "" ) {
382
420
  _db_path =
383
421
  await _evm_chains_db_path_get(
384
- "n");
422
+ _user_level,
423
+ _network_chain_id,
424
+ "");
385
425
  }
386
426
  if ( typeof(
387
427
  _db_types) == "undefined" ) {
@@ -425,7 +465,8 @@ async function
425
465
  _rpc_backends_get(
426
466
  _networks_chain_ids,
427
467
  _selection_method,
428
- _db_path) {
468
+ _db_path,
469
+ _user_level) {
429
470
  let
430
471
  _chain_id,
431
472
  _rpc_backend_get_opts,
@@ -437,7 +478,10 @@ async function
437
478
  if ( _db_path == undefined ) {
438
479
  _db_path =
439
480
  await _evm_chains_db_path_get(
440
- "n");
481
+ _user_level,
482
+ _chain_id,
483
+ [ "node",
484
+ "system" ]);
441
485
  }
442
486
  const
443
487
  _rpcs =
@@ -446,7 +490,10 @@ async function
446
490
  _rpc_backend_get_opts = [
447
491
  _chain_id,
448
492
  _selection_method,
449
- _db_path
493
+ _db_path,
494
+ _user_level,
495
+ [ "node",
496
+ "system" ]
450
497
  ];
451
498
  _rpc_backend =
452
499
  await _rpc_backend_get.apply(
@@ -727,7 +774,7 @@ async function
727
774
  _db =
728
775
  await _evm_chains_db_path_get(
729
776
  _type_primary,
730
- "",
777
+ _chain_id,
731
778
  "unified");
732
779
  const
733
780
  _db_split =
@@ -739,7 +786,7 @@ async function
739
786
  _db_fallback =
740
787
  await _evm_chains_db_path_get(
741
788
  _type_fallback,
742
- "",
789
+ _chain_id,
743
790
  "unified");
744
791
  const
745
792
  _db_fallback_split =
@@ -985,9 +1032,8 @@ function
985
1032
  _msg =
986
1033
  `No results found for network ` +
987
1034
  `'${_target_chain}'.`;
988
- _msg_error(
989
- _msg,
990
- 0);
1035
+ _msg_info(
1036
+ _msg);
991
1037
  }
992
1038
  }
993
1039
  else if ( _input_type == "amount" ) {
@@ -1282,6 +1328,12 @@ async function
1282
1328
  _msg,
1283
1329
  _result,
1284
1330
  _rpc;
1331
+ _msg =
1332
+ `Running command '${_target_command}', ` +
1333
+ `retrieving results of type '${_output_type}' ` +
1334
+ `for chain '${_target_chain}'.`;
1335
+ _msg_info(
1336
+ _msg);
1285
1337
  if ( typeof(
1286
1338
  _db_paths) == "undefined" ||
1287
1339
  _db_paths == "" ) {
@@ -1289,10 +1341,18 @@ async function
1289
1341
  [];
1290
1342
  }
1291
1343
  if ( _db_paths.length == 0 ) {
1292
- _db_paths =
1293
- await _db_paths_get(
1294
- _target_chain,
1295
- _user_level);
1344
+ try {
1345
+ _db_paths =
1346
+ await _db_paths_get(
1347
+ _target_chain,
1348
+ _user_level);
1349
+ }
1350
+ catch(
1351
+ _error) {
1352
+ _msg_error(
1353
+ _error,
1354
+ 0);
1355
+ }
1296
1356
  }
1297
1357
  if ( _target_command == "get" ) {
1298
1358
  const
@@ -1380,12 +1440,29 @@ async function
1380
1440
  return _status;
1381
1441
  }
1382
1442
  else {
1443
+ const
1444
+ _target_command_type =
1445
+ typeof(
1446
+ _target_command);
1383
1447
  _msg =
1384
1448
  `Unknown command ` +
1385
1449
  `'${_target_command}'.`;
1386
- _msg_error(
1387
- _msg,
1388
- 1);
1450
+ if ( _target_command_type === "string" ) {
1451
+ _msg_error(
1452
+ _msg,
1453
+ 0);
1454
+ }
1455
+ else if ( _target_command_type === "object" ) {
1456
+ const
1457
+ _msg_unknown =
1458
+ `Unknown command:`;
1459
+ _msg_error(
1460
+ _msg_unknown,
1461
+ 0);
1462
+ _echo2(
1463
+ _target_command);
1464
+ }
1465
+ throw _msg;
1389
1466
  }
1390
1467
  }
1391
1468
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name":
3
3
  "evm-chains-info",
4
4
  "version":
5
- "0.0.35",
5
+ "0.0.37",
6
6
  "description":
7
7
  "Returns information about Ethereum Virtual Machine (EVM) blockchains.",
8
8
  "funding": {
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "crash-js-webpack":
60
- "^0.0.74",
60
+ "^0.0.78",
61
61
  "flatted":
62
62
  "^3.4.4",
63
63
  "eslint":
@@ -75,23 +75,23 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "libcrash-js":
78
- "npm:crash-js@^1000000000000005.1000000000000001.1000000000000001",
78
+ "npm:crash-js@^1000000000000012.1000000000000001.1000000000000001",
79
79
  "ethereum-data":
80
- "^0.0.11",
80
+ "^0.0.12",
81
81
  "yargs":
82
82
  "18.0.0"
83
83
  },
84
84
  "optionalDependencies": {
85
85
  "evm-wallet":
86
- "npm:evm-wallet.js@^0.0.94"
86
+ "npm:evm-wallet.js@^0.0.96"
87
87
  },
88
88
  "overrides": {
89
89
  "evm-chains-info":
90
90
  "./libevm-chains-info",
91
91
  "evm-contracts-tools":
92
- "^0.0.57",
92
+ "^0.0.62",
93
93
  "evm-wallet":
94
- "npm:evm-wallet.js@^0.0.94"
94
+ "npm:evm-wallet.js@^0.0.96"
95
95
  },
96
96
  "type":
97
97
  "module",