@certik/skynet 0.18.4-beta → 0.18.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.5
4
+
5
+ - Removed references to deleted S3 bucket in const.js
6
+
3
7
  ## 0.18.4
4
8
 
5
9
  - `api`: allow APIs to define its own index handler
package/cli.js CHANGED
@@ -45,9 +45,4 @@ function detectBin() {
45
45
  return process.argv[1].slice(wd.length + path.sep.length).replace(path.sep, "/");
46
46
  }
47
47
 
48
- export {
49
- getBinaryName,
50
- detectSkynetDirectory,
51
- detectWorkingDirectory,
52
- detectBin,
53
- };
48
+ export { getBinaryName, detectSkynetDirectory, detectWorkingDirectory, detectBin };
package/const.js CHANGED
@@ -6,7 +6,7 @@ const PROTOCOLS = {
6
6
  nativeTokenSymbol: "ETH",
7
7
  nativeTokenDecimals: 18,
8
8
  nativeTokenAddress: "eth:0x0000000000000000000000000000000000000000",
9
- nativeTokenLogo: `https://token-logo.certik-assets.com/eth:0x0000000000000000000000000000000000000000.png`,
9
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/eth:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
10
10
  nativeTokenCoinGeckoId: "ethereum",
11
11
  nativeTokenCmcId: 1027,
12
12
  endpoint: `https://eth-mainnet.nodereal.io/v1/${getNodeRealApiKey("ETH")}`,
@@ -25,7 +25,7 @@ const PROTOCOLS = {
25
25
  nativeTokenSymbol: "BNB",
26
26
  nativeTokenDecimals: 18,
27
27
  nativeTokenAddress: "bsc:0x0000000000000000000000000000000000000000",
28
- nativeTokenLogo: `https://token-logo.certik-assets.com/bsc:0x0000000000000000000000000000000000000000.png`,
28
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/bsc:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
29
29
  nativeTokenCoinGeckoId: "binance-coin",
30
30
  nativeTokenCmcId: 1839,
31
31
  endpoint: `https://bsc-mainnet.nodereal.io/v1/${getNodeRealApiKey("BSC")}`,
@@ -44,7 +44,7 @@ const PROTOCOLS = {
44
44
  nativeTokenSymbol: "MATIC",
45
45
  nativeTokenDecimals: 18,
46
46
  nativeTokenAddress: "polygon:0x0000000000000000000000000000000000000000",
47
- nativeTokenLogo: `https://token-logo.certik-assets.com/polygon:0x0000000000000000000000000000000000000000.png`,
47
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/polygon:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
48
48
  nativeTokenCoinGeckoId: "matic-network",
49
49
  nativeTokenCmcId: 3890,
50
50
  endpoint: `https://polygon-mainnet.nodereal.io/v1/${getNodeRealApiKey("POLYGON")}`,
@@ -75,7 +75,7 @@ const PROTOCOLS = {
75
75
  nativeTokenSymbol: "AVAX",
76
76
  nativeTokenDecimals: 18,
77
77
  nativeTokenAddress: "avax:0x0000000000000000000000000000000000000000",
78
- nativeTokenLogo: `https://token-logo.certik-assets.com/avax:0x0000000000000000000000000000000000000000.png`,
78
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/avax:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
79
79
  nativeTokenCoinGeckoId: "avalanche-2",
80
80
  nativeTokenCmcId: 5805,
81
81
  endpoint: `https://api.avax.network/ext/bc/C/rpc`,
@@ -92,7 +92,7 @@ const PROTOCOLS = {
92
92
  nativeTokenSymbol: "FTM",
93
93
  nativeTokenDecimals: 18,
94
94
  nativeTokenAddress: "ftm:0x0000000000000000000000000000000000000000",
95
- nativeTokenLogo: `https://token-logo.certik-assets.com/ftm:0x0000000000000000000000000000000000000000.png`,
95
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/ftm:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
96
96
  nativeTokenCoinGeckoId: "fantom",
97
97
  nativeTokenCmcId: 3513,
98
98
  endpoint: `https://rpcapi.fantom.network`,
@@ -109,7 +109,7 @@ const PROTOCOLS = {
109
109
  nativeTokenSymbol: "ALGO",
110
110
  nativeTokenDecimals: 6,
111
111
  nativeTokenAddress: "algo:native",
112
- nativeTokenLogo: `https://token-logo.certik-assets.com/algo:native.png`,
112
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/algo:native.png`,
113
113
  nativeTokenCoinGeckoId: "algorand",
114
114
  nativeTokenCmcId: 4030,
115
115
  endpoint: "https://algo-node.certik-skynet.com/",
package/date.js CHANGED
@@ -40,9 +40,4 @@ function dateRange(from, to, step) {
40
40
  return windows.map((w) => [w[0], w[w.length - 1]]);
41
41
  }
42
42
 
43
- export {
44
- getDateOnly,
45
- findDateAfter,
46
- daysInRange,
47
- dateRange,
48
- };
43
+ export { getDateOnly, findDateAfter, daysInRange, dateRange };
package/env.js CHANGED
@@ -39,11 +39,4 @@ function isDev() {
39
39
  return getEnvironment() === "dev";
40
40
  }
41
41
 
42
- export {
43
- ensureAndGet,
44
- getEnvOrThrow,
45
- getEnvironment,
46
- isProduction,
47
- isDev,
48
- getNodeRealApiKey,
49
- };
42
+ export { ensureAndGet, getEnvOrThrow, getEnvironment, isProduction, isDev, getNodeRealApiKey };
package/indexer.js CHANGED
@@ -200,8 +200,8 @@ function createModeIndexerApp({
200
200
  inline.log(
201
201
  `[MODE INDEXER] building range, from=${from}, to=${to}, ${toSelectorString(
202
202
  selectorFlags,
203
- ", "
204
- )}, batchSize=${buildBatchSize}, concurrency=${buildConcurrency}`
203
+ ", ",
204
+ )}, batchSize=${buildBatchSize}, concurrency=${buildConcurrency}`,
205
205
  );
206
206
 
207
207
  const failedIds = await execBuild(selectorFlags, from, to, verbose, false);
@@ -226,14 +226,14 @@ function createModeIndexerApp({
226
226
  inline.log(
227
227
  `[MODE INDEXER] validating, from=${from}, to=${to}, ${toSelectorString(
228
228
  selectorFlags,
229
- ", "
230
- )}, batchSize=${validateBatchSize}, concurrency=${validateConcurrency}`
229
+ ", ",
230
+ )}, batchSize=${validateBatchSize}, concurrency=${validateConcurrency}`,
231
231
  );
232
232
 
233
233
  const windows = range(from, to, validateBatchSize * validateConcurrency);
234
234
 
235
235
  inline.log(
236
- `[MODE INDEXER] from=${from}, to=${to}, batchSize=${validateBatchSize}, concurrency=${validateConcurrency}`
236
+ `[MODE INDEXER] from=${from}, to=${to}, batchSize=${validateBatchSize}, concurrency=${validateConcurrency}`,
237
237
  );
238
238
 
239
239
  for (let [windowStart, windowEnd] of windows) {
@@ -265,13 +265,13 @@ function createModeIndexerApp({
265
265
  maxRetry,
266
266
  test: (r) => r,
267
267
  verbose,
268
- }
268
+ },
269
269
  );
270
270
 
271
271
  if (!result) {
272
272
  throw new Error(`Terminate validation due to critical errors, from=${batchStart}, to=${batchEnd}`);
273
273
  }
274
- })
274
+ }),
275
275
  );
276
276
 
277
277
  if (shouldSaveState) {
@@ -287,7 +287,7 @@ function createModeIndexerApp({
287
287
  }
288
288
 
289
289
  inline.log(
290
- `[MODE INDEXER] validated ${offsetRange(from, to)} ${finalState.type} successfully in ${Date.now() - startTime}ms`
290
+ `[MODE INDEXER] validated ${offsetRange(from, to)} ${finalState.type} successfully in ${Date.now() - startTime}ms`,
291
291
  );
292
292
  }
293
293
 
@@ -329,9 +329,9 @@ function createModeIndexerApp({
329
329
  maxRetry,
330
330
  test: (r) => !r,
331
331
  verbose,
332
- }
332
+ },
333
333
  );
334
- })
334
+ }),
335
335
  );
336
336
 
337
337
  if (shouldSaveState) {
@@ -363,8 +363,8 @@ function createModeIndexerApp({
363
363
  inline.log(
364
364
  `[MODE INDEXER] rebuilding, from=${from}, to=${to}, ${toSelectorString(
365
365
  selectorFlags,
366
- ", "
367
- )}, batchSize=${buildBatchSize}, concurrency=${buildConcurrency}`
366
+ ", ",
367
+ )}, batchSize=${buildBatchSize}, concurrency=${buildConcurrency}`,
368
368
  );
369
369
 
370
370
  // add a flag to stop delta from running
@@ -390,14 +390,14 @@ function createModeIndexerApp({
390
390
  if (failedIds.length > 0) {
391
391
  inline.log(
392
392
  `[MODE INDEXER] built ${offsetRange(from, to)} ${finalState.type}(s) with some failed ${finalState.type}`,
393
- failedIds
393
+ failedIds,
394
394
  );
395
395
  process.exit(1);
396
396
  } else {
397
397
  inline.log(
398
398
  `[MODE INDEXER] built ${offsetRange(from, to)} ${finalState.type}(s) successfully in ${
399
399
  Date.now() - startTime
400
- }ms`
400
+ }ms`,
401
401
  );
402
402
  process.exit(0);
403
403
  }
@@ -410,8 +410,8 @@ function createModeIndexerApp({
410
410
  inline.log(
411
411
  `[MODE INDEXER] skip delta, there're no more items need to be processed, from=${from}, to=${to}, ${toSelectorString(
412
412
  selectorFlags,
413
- ", "
414
- )}`
413
+ ", ",
414
+ )}`,
415
415
  );
416
416
 
417
417
  return;
@@ -420,8 +420,8 @@ function createModeIndexerApp({
420
420
  inline.log(
421
421
  `[MODE INDEXER] starting delta, from=${from}, to=${to}, ${toSelectorString(
422
422
  selectorFlags,
423
- ", "
424
- )}, batchSize=${buildBatchSize}, concurrency=${buildConcurrency}`
423
+ ", ",
424
+ )}, batchSize=${buildBatchSize}, concurrency=${buildConcurrency}`,
425
425
  );
426
426
 
427
427
  try {
@@ -532,7 +532,7 @@ ${getSelectorDesc(selector)}
532
532
  default: false,
533
533
  },
534
534
  },
535
- }
535
+ },
536
536
  );
537
537
 
538
538
  return runMode(cli.flags).catch((err) => {
@@ -573,7 +573,7 @@ ${getSelectorDesc(selector)}
573
573
  default: false,
574
574
  },
575
575
  },
576
- }
576
+ },
577
577
  );
578
578
 
579
579
  async function runBuild({ verbose, ...selectorFlags }) {
@@ -601,7 +601,7 @@ ${getSelectorDesc(selector)}
601
601
  maxRetry,
602
602
  test: (r) => r,
603
603
  verbose,
604
- }
604
+ },
605
605
  );
606
606
 
607
607
  if (!result) {
package/log.js CHANGED
@@ -4,11 +4,13 @@ function isObject(a) {
4
4
 
5
5
  function print(o) {
6
6
  if (Array.isArray(o)) {
7
- return `[${o.map(print).join(", ")}]`
7
+ return `[${o.map(print).join(", ")}]`;
8
8
  }
9
9
 
10
10
  if (isObject(o)) {
11
- return `{${Object.keys(o).map(k => `${k}: ${o[k]}`).join(", ")}}`;
11
+ return `{${Object.keys(o)
12
+ .map((k) => `${k}: ${o[k]}`)
13
+ .join(", ")}}`;
12
14
  }
13
15
 
14
16
  return `${o}`;
@@ -40,8 +42,4 @@ const inline = {
40
42
  },
41
43
  };
42
44
 
43
- export {
44
- getLine,
45
- print,
46
- inline,
47
- };
45
+ export { getLine, print, inline };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.18.4-beta",
3
+ "version": "0.18.5",
4
4
  "description": "Skynet Shared JS library",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/selector.js CHANGED
@@ -22,7 +22,7 @@ function getSelectorFlags(selector) {
22
22
  return Object.keys(selector).reduce((acc, name) => {
23
23
  const flag = {
24
24
  type: selector[name].type || "string",
25
- ...selector[name]
25
+ ...selector[name],
26
26
  };
27
27
 
28
28
  // by default to be required
@@ -68,9 +68,4 @@ function getJobName(name, selectorFlags, mode = null) {
68
68
  return jobName;
69
69
  }
70
70
 
71
- export {
72
- getJobName,
73
- getSelectorDesc,
74
- getSelectorFlags,
75
- toSelectorString,
76
- };
71
+ export { getJobName, getSelectorDesc, getSelectorFlags, toSelectorString };
package/snowflake.js CHANGED
@@ -30,7 +30,4 @@ async function executeSql(options, sql, binds) {
30
30
  });
31
31
  }
32
32
 
33
- export {
34
- getConnection,
35
- executeSql,
36
- };
33
+ export { getConnection, executeSql };
package/util.js CHANGED
@@ -58,10 +58,4 @@ function chunk(array, count) {
58
58
  return result;
59
59
  }
60
60
 
61
- export {
62
- arrayGroup,
63
- partition,
64
- range,
65
- fillRange,
66
- chunk
67
- };
61
+ export { arrayGroup, partition, range, fillRange, chunk };
package/web3.js CHANGED
@@ -110,8 +110,4 @@ async function multiCall({ protocol, limiter = null, target, abi, calls }) {
110
110
  return { actualCallCount: callChunks.length, output: responses };
111
111
  }
112
112
 
113
- export {
114
- newWeb3ByProtocol,
115
- singleCall,
116
- multiCall,
117
- };
113
+ export { newWeb3ByProtocol, singleCall, multiCall };