@certik/skynet 0.22.1 → 0.22.3

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 (101) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build.ts +23 -0
  3. package/dist/abi.d.ts +1 -2
  4. package/dist/abi.js +569 -563
  5. package/dist/address.d.ts +0 -1
  6. package/dist/address.js +22 -21
  7. package/dist/api.d.ts +0 -1
  8. package/dist/api.js +235 -120
  9. package/dist/app.d.ts +1 -2
  10. package/dist/app.js +2030 -276
  11. package/dist/availability.d.ts +0 -1
  12. package/dist/availability.js +126 -56
  13. package/dist/cli.d.ts +0 -1
  14. package/dist/cli.js +28 -24
  15. package/dist/const.d.ts +0 -1
  16. package/dist/const.js +153 -132
  17. package/dist/databricks.d.ts +0 -1
  18. package/dist/databricks.js +198 -58
  19. package/dist/date.d.ts +0 -1
  20. package/dist/date.js +48 -21
  21. package/dist/deploy.d.ts +0 -1
  22. package/dist/deploy.js +427 -292
  23. package/dist/dynamodb.d.ts +3 -4
  24. package/dist/dynamodb.js +432 -281
  25. package/dist/env.d.ts +2 -3
  26. package/dist/env.js +16 -9
  27. package/dist/graphql.d.ts +0 -1
  28. package/dist/graphql.js +26 -23
  29. package/dist/indexer.d.ts +0 -1
  30. package/dist/indexer.js +1050 -441
  31. package/dist/log.d.ts +0 -1
  32. package/dist/log.js +53 -52
  33. package/dist/object-hash.d.ts +0 -1
  34. package/dist/object-hash.js +49 -59
  35. package/dist/opsgenie.d.ts +97 -19
  36. package/dist/opsgenie.js +35 -30
  37. package/dist/por.d.ts +0 -1
  38. package/dist/por.js +113 -123
  39. package/dist/s3.d.ts +7 -8
  40. package/dist/s3.js +103 -91
  41. package/dist/search.d.ts +0 -1
  42. package/dist/search.js +100 -25
  43. package/dist/selector.d.ts +0 -1
  44. package/dist/selector.js +34 -38
  45. package/dist/slack.d.ts +0 -1
  46. package/dist/slack.js +27 -21
  47. package/dist/util.d.ts +0 -1
  48. package/dist/util.js +21 -20
  49. package/examples/api.ts +1 -1
  50. package/examples/indexer.ts +1 -1
  51. package/examples/mode-indexer.ts +1 -1
  52. package/package.json +4 -3
  53. package/{graphql.ts → src/graphql.ts} +1 -1
  54. package/src/opsgenie.ts +176 -0
  55. package/tsconfig.build.json +2 -5
  56. package/tsconfig.json +11 -20
  57. package/dist/abi.d.ts.map +0 -1
  58. package/dist/address.d.ts.map +0 -1
  59. package/dist/api.d.ts.map +0 -1
  60. package/dist/app.d.ts.map +0 -1
  61. package/dist/availability.d.ts.map +0 -1
  62. package/dist/cli.d.ts.map +0 -1
  63. package/dist/const.d.ts.map +0 -1
  64. package/dist/databricks.d.ts.map +0 -1
  65. package/dist/date.d.ts.map +0 -1
  66. package/dist/deploy.d.ts.map +0 -1
  67. package/dist/dynamodb.d.ts.map +0 -1
  68. package/dist/env.d.ts.map +0 -1
  69. package/dist/graphql.d.ts.map +0 -1
  70. package/dist/indexer.d.ts.map +0 -1
  71. package/dist/log.d.ts.map +0 -1
  72. package/dist/object-hash.d.ts.map +0 -1
  73. package/dist/opsgenie.d.ts.map +0 -1
  74. package/dist/por.d.ts.map +0 -1
  75. package/dist/s3.d.ts.map +0 -1
  76. package/dist/search.d.ts.map +0 -1
  77. package/dist/selector.d.ts.map +0 -1
  78. package/dist/slack.d.ts.map +0 -1
  79. package/dist/util.d.ts.map +0 -1
  80. package/opsgenie.ts +0 -69
  81. /package/{abi.ts → src/abi.ts} +0 -0
  82. /package/{address.ts → src/address.ts} +0 -0
  83. /package/{api.ts → src/api.ts} +0 -0
  84. /package/{app.ts → src/app.ts} +0 -0
  85. /package/{availability.ts → src/availability.ts} +0 -0
  86. /package/{cli.ts → src/cli.ts} +0 -0
  87. /package/{const.ts → src/const.ts} +0 -0
  88. /package/{databricks.ts → src/databricks.ts} +0 -0
  89. /package/{date.ts → src/date.ts} +0 -0
  90. /package/{deploy.ts → src/deploy.ts} +0 -0
  91. /package/{dynamodb.ts → src/dynamodb.ts} +0 -0
  92. /package/{env.ts → src/env.ts} +0 -0
  93. /package/{indexer.ts → src/indexer.ts} +0 -0
  94. /package/{log.ts → src/log.ts} +0 -0
  95. /package/{object-hash.ts → src/object-hash.ts} +0 -0
  96. /package/{por.ts → src/por.ts} +0 -0
  97. /package/{s3.ts → src/s3.ts} +0 -0
  98. /package/{search.ts → src/search.ts} +0 -0
  99. /package/{selector.ts → src/selector.ts} +0 -0
  100. /package/{slack.ts → src/slack.ts} +0 -0
  101. /package/{util.ts → src/util.ts} +0 -0
@@ -21,4 +21,3 @@ export declare function memoize<F extends AnyAsyncFunction>(func: F, options?: {
21
21
  lruMaxSize?: number;
22
22
  }): F;
23
23
  export { pThrottle as throttle };
24
- //# sourceMappingURL=availability.d.ts.map
@@ -1,63 +1,133 @@
1
+ // src/object-hash.ts
2
+ import xh from "@node-rs/xxhash";
3
+ function getHash(obj) {
4
+ const xxh3 = xh.xxh3.Xxh3.withSeed();
5
+ hash(obj, xxh3);
6
+ return xxh3.digest().toString(16);
7
+ }
8
+ function hash(obj, xxh3) {
9
+ if (obj === null) {
10
+ xxh3.update("null");
11
+ } else if (obj === undefined) {
12
+ xxh3.update("undefined");
13
+ } else if (typeof obj === "string") {
14
+ xxh3.update(obj);
15
+ } else if (typeof obj === "number") {
16
+ xxh3.update(obj.toString());
17
+ } else if (typeof obj === "boolean") {
18
+ xxh3.update(obj.toString());
19
+ } else if (typeof obj === "bigint") {
20
+ xxh3.update(obj.toString());
21
+ } else if (obj instanceof Date) {
22
+ xxh3.update(obj.toISOString());
23
+ } else if (Array.isArray(obj)) {
24
+ arrayHash(obj, xxh3);
25
+ } else if (obj instanceof Set) {
26
+ setHash(obj, xxh3);
27
+ } else if (obj instanceof Map) {
28
+ mapHash(obj, xxh3);
29
+ } else if (typeof obj === "object") {
30
+ objectHash(obj, xxh3);
31
+ } else {
32
+ throw new Error(`Unsupported type: ${obj}`);
33
+ }
34
+ }
35
+ function arrayHash(array, xxh3) {
36
+ xxh3.update("[");
37
+ for (const obj of array) {
38
+ hash(obj, xxh3);
39
+ }
40
+ xxh3.update("]");
41
+ }
42
+ function setHash(_set, _xxh3) {
43
+ throw new Error("Set hashing not implemented");
44
+ }
45
+ function mapHash(map, xxh3) {
46
+ const array = Array.from(map.entries()).sort(([aKey], [bKey]) => aKey.localeCompare(bKey));
47
+ for (const [key, value] of array) {
48
+ hash(key, xxh3);
49
+ hash(value, xxh3);
50
+ }
51
+ }
52
+ function objectHash(obj, xxh3) {
53
+ const array = Object.entries(obj).sort(([aKey], [bKey]) => aKey.localeCompare(bKey));
54
+ for (const [key, value] of array) {
55
+ hash(key, xxh3);
56
+ hash(value, xxh3);
57
+ }
58
+ }
59
+
60
+ // src/availability.ts
1
61
  import pThrottle from "p-throttle";
2
62
  import pMemoize from "p-memoize";
3
63
  import QuickLRU from "quick-lru";
4
- import { getHash } from "./object-hash";
5
- export async function wait(time) {
6
- return new Promise((resolve) => {
7
- setTimeout(resolve, time);
8
- });
9
- }
10
- export async function exponentialRetry(func, { maxRetry, initialDuration, growFactor, test, verbose, }) {
11
- let retries = maxRetry;
12
- let duration = initialDuration || 5000;
13
- const growFactorFinal = growFactor || 2;
14
- let result = await func();
15
- while (!test(result) && retries > 0) {
16
- if (verbose) {
17
- console.log("failed attempt result", result);
18
- console.log(`sleep for ${duration}ms after failed attempt, remaining ${retries} attempts`);
19
- }
64
+ async function wait(time) {
65
+ return new Promise((resolve) => {
66
+ setTimeout(resolve, time);
67
+ });
68
+ }
69
+ async function exponentialRetry(func, {
70
+ maxRetry,
71
+ initialDuration,
72
+ growFactor,
73
+ test,
74
+ verbose
75
+ }) {
76
+ let retries = maxRetry;
77
+ let duration = initialDuration || 5000;
78
+ const growFactorFinal = growFactor || 2;
79
+ let result = await func();
80
+ while (!test(result) && retries > 0) {
81
+ if (verbose) {
82
+ console.log("failed attempt result", result);
83
+ console.log(`sleep for ${duration}ms after failed attempt, remaining ${retries} attempts`);
84
+ }
85
+ retries = retries - 1;
86
+ await wait(duration);
87
+ result = await func();
88
+ duration = duration * growFactorFinal;
89
+ }
90
+ if (verbose) {
91
+ console.log(`function to retry ends with status ${test(result)}, number of retries done: ${maxRetry - retries}}`);
92
+ }
93
+ return result;
94
+ }
95
+ function withRetry(func, options) {
96
+ let retries = options?.maxRetry || 3;
97
+ let duration = options?.initialDuration || 500;
98
+ const growFactorFinal = options?.growFactor || 2;
99
+ return async (...args) => {
100
+ do {
101
+ try {
102
+ return await func(...args);
103
+ } catch (error) {
20
104
  retries = retries - 1;
105
+ if (retries <= 0) {
106
+ throw error;
107
+ }
21
108
  await wait(duration);
22
- result = await func();
23
109
  duration = duration * growFactorFinal;
24
- }
25
- if (verbose) {
26
- console.log(`function to retry ends with status ${test(result)}, number of retries done: ${maxRetry - retries}}`);
27
- }
28
- return result;
29
- }
30
- export function withRetry(func, options) {
31
- let retries = options?.maxRetry || 3;
32
- let duration = options?.initialDuration || 500;
33
- const growFactorFinal = options?.growFactor || 2;
34
- return (async (...args) => {
35
- do {
36
- try {
37
- return await func(...args);
38
- }
39
- catch (error) {
40
- retries = retries - 1;
41
- if (retries <= 0) {
42
- throw error;
43
- }
44
- await wait(duration);
45
- duration = duration * growFactorFinal;
46
- }
47
- } while (retries > 0);
48
- throw new Error("unreachable");
49
- });
50
- }
51
- export function memoize(func, options) {
52
- if (!options) {
53
- options = {};
54
- }
55
- if (!options.cache) {
56
- options.cache = new QuickLRU({ maxSize: options.lruMaxSize || 10000 });
57
- }
58
- if (!options.cacheKey) {
59
- options.cacheKey = (args) => getHash(args);
60
- }
61
- return pMemoize(func, options);
110
+ }
111
+ } while (retries > 0);
112
+ throw new Error("unreachable");
113
+ };
114
+ }
115
+ function memoize(func, options) {
116
+ if (!options) {
117
+ options = {};
118
+ }
119
+ if (!options.cache) {
120
+ options.cache = new QuickLRU({ maxSize: options.lruMaxSize || 1e4 });
121
+ }
122
+ if (!options.cacheKey) {
123
+ options.cacheKey = (args) => getHash(args);
124
+ }
125
+ return pMemoize(func, options);
62
126
  }
63
- export { pThrottle as throttle };
127
+ export {
128
+ withRetry,
129
+ wait,
130
+ pThrottle as throttle,
131
+ memoize,
132
+ exponentialRetry
133
+ };
package/dist/cli.d.ts CHANGED
@@ -3,4 +3,3 @@ declare function detectSkynetDirectory(): string;
3
3
  declare function detectWorkingDirectory(): string;
4
4
  declare function detectBin(): string;
5
5
  export { getBinaryName, detectSkynetDirectory, detectWorkingDirectory, detectBin };
6
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -1,37 +1,41 @@
1
+ // src/cli.ts
1
2
  import path from "path";
2
3
  import fs from "fs";
3
4
  function getBinaryName() {
4
- const binaryNameParts = process.argv[1].split(path.sep);
5
- const binaryName = binaryNameParts[binaryNameParts.length - 1];
6
- return binaryName;
5
+ const binaryNameParts = process.argv[1].split(path.sep);
6
+ const binaryName = binaryNameParts[binaryNameParts.length - 1];
7
+ return binaryName;
7
8
  }
8
9
  function detectSkynetDirectory() {
9
- return detectDirectory(process.argv[1], "SkynetAPIDefinitions.yml");
10
+ return detectDirectory(process.argv[1], "SkynetAPIDefinitions.yml");
10
11
  }
11
12
  function detectWorkingDirectory() {
12
- const wd = detectDirectory(process.argv[1], "package.json");
13
- const skynetd = detectDirectory(process.argv[1], "SkynetAPIDefinitions.yml");
14
- return wd.slice(skynetd.length + path.sep.length).replace(path.sep, "/");
13
+ const wd = detectDirectory(process.argv[1], "package.json");
14
+ const skynetd = detectDirectory(process.argv[1], "SkynetAPIDefinitions.yml");
15
+ return wd.slice(skynetd.length + path.sep.length).replace(path.sep, "/");
15
16
  }
16
17
  function detectDirectory(fullBinPath, sentinel = "package.json") {
17
- let parentFolder = path.dirname(fullBinPath);
18
- while (parentFolder) {
19
- // check if parentFolder length is greater than 0
20
- const sentinelPath = path.join(parentFolder, sentinel);
21
- if (fs.existsSync(sentinelPath)) {
22
- return parentFolder;
23
- }
24
- const newParentFolder = path.dirname(parentFolder);
25
- if (newParentFolder === parentFolder) {
26
- // we have reached the root folder
27
- break;
28
- }
29
- parentFolder = newParentFolder;
18
+ let parentFolder = path.dirname(fullBinPath);
19
+ while (parentFolder) {
20
+ const sentinelPath = path.join(parentFolder, sentinel);
21
+ if (fs.existsSync(sentinelPath)) {
22
+ return parentFolder;
30
23
  }
31
- throw new Error("Cannot detect current working directory");
24
+ const newParentFolder = path.dirname(parentFolder);
25
+ if (newParentFolder === parentFolder) {
26
+ break;
27
+ }
28
+ parentFolder = newParentFolder;
29
+ }
30
+ throw new Error("Cannot detect current working directory");
32
31
  }
33
32
  function detectBin() {
34
- const wd = detectDirectory(process.argv[1], "package.json");
35
- return process.argv[1].slice(wd.length + path.sep.length).replace(path.sep, "/");
33
+ const wd = detectDirectory(process.argv[1], "package.json");
34
+ return process.argv[1].slice(wd.length + path.sep.length).replace(path.sep, "/");
36
35
  }
37
- export { getBinaryName, detectSkynetDirectory, detectWorkingDirectory, detectBin };
36
+ export {
37
+ getBinaryName,
38
+ detectWorkingDirectory,
39
+ detectSkynetDirectory,
40
+ detectBin
41
+ };
package/dist/const.d.ts CHANGED
@@ -32,4 +32,3 @@ declare const TIME: {
32
32
  BY_S: TimeIntervals;
33
33
  };
34
34
  export { PROTOCOLS, TIME };
35
- //# sourceMappingURL=const.d.ts.map
package/dist/const.js CHANGED
@@ -1,141 +1,162 @@
1
- import { ensureAndGet } from "./env";
1
+ // src/env.ts
2
+ function ensureAndGet(envName, defaultValue) {
3
+ return process.env[envName] || defaultValue;
4
+ }
5
+ function getEnvironment() {
6
+ return ensureAndGet("SKYNET_ENVIRONMENT", "dev");
7
+ }
8
+ function getEnvOrThrow(envName) {
9
+ if (!process.env[envName]) {
10
+ throw new Error(`Must set environment variable ${envName}`);
11
+ }
12
+ return process.env[envName];
13
+ }
14
+ function isProduction() {
15
+ return getEnvironment() === "prd";
16
+ }
17
+ function isDev() {
18
+ return getEnvironment() === "dev";
19
+ }
20
+ // src/const.ts
2
21
  function getNodeRealApiKey(identifier) {
3
- // NodeReal API keys are different for each NodeReal app
4
- return ensureAndGet(`SKYNET_NODEREAL_API_${identifier.toUpperCase()}_KEY`) ?? ensureAndGet("SKYNET_NODEREAL_API_KEY");
22
+ return ensureAndGet(`SKYNET_NODEREAL_API_${identifier.toUpperCase()}_KEY`) ?? ensureAndGet("SKYNET_NODEREAL_API_KEY");
5
23
  }
6
- const PROTOCOLS = {
7
- eth: {
8
- nativeTokenName: "Ethereum",
9
- nativeTokenSymbol: "ETH",
10
- nativeTokenDecimals: 18,
11
- nativeTokenAddress: "eth:0x0000000000000000000000000000000000000000",
12
- nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/eth:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
13
- nativeTokenCoinGeckoId: "ethereum",
14
- nativeTokenCmcId: 1027,
15
- endpoint: `https://eth-mainnet.nodereal.io/v1/${getNodeRealApiKey("ETH")}`,
16
- archiveEndpoint: `https://eth-mainnet.nodereal.io/v1/${getNodeRealApiKey("ETH")}`,
17
- tokenStandard: "ERC20",
18
- scanApi: {
19
- endpoint: "https://api.etherscan.io/api",
20
- key: ensureAndGet("SKYNET_ETHER_SCAN_API_KEY"),
21
- },
22
- multiCallProvider: "0xCa731e0f33Afbcfa9363d6F7449d1f5447d10C80",
23
- scanUrl: "https://etherscan.io/",
24
- chainId: 1,
24
+ var PROTOCOLS = {
25
+ eth: {
26
+ nativeTokenName: "Ethereum",
27
+ nativeTokenSymbol: "ETH",
28
+ nativeTokenDecimals: 18,
29
+ nativeTokenAddress: "eth:0x0000000000000000000000000000000000000000",
30
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/eth:0x0000000000000000000000000000000000000000.png`,
31
+ nativeTokenCoinGeckoId: "ethereum",
32
+ nativeTokenCmcId: 1027,
33
+ endpoint: `https://eth-mainnet.nodereal.io/v1/${getNodeRealApiKey("ETH")}`,
34
+ archiveEndpoint: `https://eth-mainnet.nodereal.io/v1/${getNodeRealApiKey("ETH")}`,
35
+ tokenStandard: "ERC20",
36
+ scanApi: {
37
+ endpoint: "https://api.etherscan.io/api",
38
+ key: ensureAndGet("SKYNET_ETHER_SCAN_API_KEY")
25
39
  },
26
- bsc: {
27
- nativeTokenName: "Binance Coin",
28
- nativeTokenSymbol: "BNB",
29
- nativeTokenDecimals: 18,
30
- nativeTokenAddress: "bsc:0x0000000000000000000000000000000000000000",
31
- nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/bsc:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
32
- nativeTokenCoinGeckoId: "binance-coin",
33
- nativeTokenCmcId: 1839,
34
- endpoint: `https://bsc-mainnet.nodereal.io/v1/${getNodeRealApiKey("BSC")}`,
35
- archiveEndpoint: `https://bsc-mainnet.nodereal.io/v1/${getNodeRealApiKey("BSC")}`,
36
- tokenStandard: "BEP20",
37
- scanApi: {
38
- endpoint: "https://api.bscscan.com/api",
39
- key: ensureAndGet("SKYNET_BSC_SCAN_API_KEY"),
40
- },
41
- multiCallProvider: "0xe7144e57d832c9005D252f415d205b4b8D78228e",
42
- scanUrl: "https://bscscan.com/",
43
- chainId: 56,
40
+ multiCallProvider: "0xCa731e0f33Afbcfa9363d6F7449d1f5447d10C80",
41
+ scanUrl: "https://etherscan.io/",
42
+ chainId: 1
43
+ },
44
+ bsc: {
45
+ nativeTokenName: "Binance Coin",
46
+ nativeTokenSymbol: "BNB",
47
+ nativeTokenDecimals: 18,
48
+ nativeTokenAddress: "bsc:0x0000000000000000000000000000000000000000",
49
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/bsc:0x0000000000000000000000000000000000000000.png`,
50
+ nativeTokenCoinGeckoId: "binance-coin",
51
+ nativeTokenCmcId: 1839,
52
+ endpoint: `https://bsc-mainnet.nodereal.io/v1/${getNodeRealApiKey("BSC")}`,
53
+ archiveEndpoint: `https://bsc-mainnet.nodereal.io/v1/${getNodeRealApiKey("BSC")}`,
54
+ tokenStandard: "BEP20",
55
+ scanApi: {
56
+ endpoint: "https://api.bscscan.com/api",
57
+ key: ensureAndGet("SKYNET_BSC_SCAN_API_KEY")
44
58
  },
45
- polygon: {
46
- nativeTokenName: "Polygon",
47
- nativeTokenSymbol: "MATIC",
48
- nativeTokenDecimals: 18,
49
- nativeTokenAddress: "polygon:0x0000000000000000000000000000000000000000",
50
- nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/polygon:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
51
- nativeTokenCoinGeckoId: "matic-network",
52
- nativeTokenCmcId: 3890,
53
- endpoint: `https://polygon-mainnet.nodereal.io/v1/${getNodeRealApiKey("POLYGON")}`,
54
- archiveEndpoint: `https://polygon-mainnet.nodereal.io/v1/${getNodeRealApiKey("POLYGON")}`,
55
- backupEndpoint: `https://polygon-mainnet.nodereal.io/v1/${getNodeRealApiKey("POLYGON")}`,
56
- tokenStandard: "ERC20",
57
- scanApi: {
58
- endpoint: "https://api.polygonscan.com/api",
59
- key: ensureAndGet("SKYNET_POLYGON_SCAN_API_KEY"),
60
- },
61
- multiCallProvider: "0x8eC86392e0aDB57d00fDffbA39b8870e107c0757",
62
- scanUrl: "https://polygonscan.com/",
63
- chainId: 137,
59
+ multiCallProvider: "0xe7144e57d832c9005D252f415d205b4b8D78228e",
60
+ scanUrl: "https://bscscan.com/",
61
+ chainId: 56
62
+ },
63
+ polygon: {
64
+ nativeTokenName: "Polygon",
65
+ nativeTokenSymbol: "MATIC",
66
+ nativeTokenDecimals: 18,
67
+ nativeTokenAddress: "polygon:0x0000000000000000000000000000000000000000",
68
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/polygon:0x0000000000000000000000000000000000000000.png`,
69
+ nativeTokenCoinGeckoId: "matic-network",
70
+ nativeTokenCmcId: 3890,
71
+ endpoint: `https://polygon-mainnet.nodereal.io/v1/${getNodeRealApiKey("POLYGON")}`,
72
+ archiveEndpoint: `https://polygon-mainnet.nodereal.io/v1/${getNodeRealApiKey("POLYGON")}`,
73
+ backupEndpoint: `https://polygon-mainnet.nodereal.io/v1/${getNodeRealApiKey("POLYGON")}`,
74
+ tokenStandard: "ERC20",
75
+ scanApi: {
76
+ endpoint: "https://api.polygonscan.com/api",
77
+ key: ensureAndGet("SKYNET_POLYGON_SCAN_API_KEY")
64
78
  },
65
- heco: {
66
- nativeTokenName: "Heco",
67
- nativeTokenSymbol: "HT",
68
- nativeTokenDecimals: 18,
69
- nativeTokenAddress: "heco:0x0000000000000000000000000000000000000000",
70
- endpoint: `https://http-mainnet.hecochain.com`, // use heco public RPC node
71
- tokenStandard: "HRC20",
72
- multiCallProvider: "0xe7144e57d832c9005d252f415d205b4b8d78228e",
73
- scanUrl: "https://hecoinfo.com/",
74
- chainId: 128,
79
+ multiCallProvider: "0x8eC86392e0aDB57d00fDffbA39b8870e107c0757",
80
+ scanUrl: "https://polygonscan.com/",
81
+ chainId: 137
82
+ },
83
+ heco: {
84
+ nativeTokenName: "Heco",
85
+ nativeTokenSymbol: "HT",
86
+ nativeTokenDecimals: 18,
87
+ nativeTokenAddress: "heco:0x0000000000000000000000000000000000000000",
88
+ endpoint: `https://http-mainnet.hecochain.com`,
89
+ tokenStandard: "HRC20",
90
+ multiCallProvider: "0xe7144e57d832c9005d252f415d205b4b8d78228e",
91
+ scanUrl: "https://hecoinfo.com/",
92
+ chainId: 128
93
+ },
94
+ avax: {
95
+ nativeTokenName: "Avalanche",
96
+ nativeTokenSymbol: "AVAX",
97
+ nativeTokenDecimals: 18,
98
+ nativeTokenAddress: "avax:0x0000000000000000000000000000000000000000",
99
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/avax:0x0000000000000000000000000000000000000000.png`,
100
+ nativeTokenCoinGeckoId: "avalanche-2",
101
+ nativeTokenCmcId: 5805,
102
+ endpoint: `https://api.avax.network/ext/bc/C/rpc`,
103
+ tokenStandard: "ARC20",
104
+ scanApi: {
105
+ endpoint: "https://api.snowtrace.io/api",
106
+ key: ensureAndGet("SKYNET_AVASCAN_API_KEY")
75
107
  },
76
- avax: {
77
- nativeTokenName: "Avalanche",
78
- nativeTokenSymbol: "AVAX",
79
- nativeTokenDecimals: 18,
80
- nativeTokenAddress: "avax:0x0000000000000000000000000000000000000000",
81
- nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/avax:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
82
- nativeTokenCoinGeckoId: "avalanche-2",
83
- nativeTokenCmcId: 5805,
84
- endpoint: `https://api.avax.network/ext/bc/C/rpc`,
85
- tokenStandard: "ARC20",
86
- scanApi: {
87
- endpoint: "https://api.snowtrace.io/api",
88
- key: ensureAndGet("SKYNET_AVASCAN_API_KEY"),
89
- },
90
- scanUrl: "https://snowtrace.io/",
91
- chainId: 43114,
92
- },
93
- ftm: {
94
- nativeTokenName: "Fantom",
95
- nativeTokenSymbol: "FTM",
96
- nativeTokenDecimals: 18,
97
- nativeTokenAddress: "ftm:0x0000000000000000000000000000000000000000",
98
- nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/ftm:0x0000000000000000000000000000000000000000.png`, // TODO: Can replace domain if needed
99
- nativeTokenCoinGeckoId: "fantom",
100
- nativeTokenCmcId: 3513,
101
- endpoint: `https://rpcapi.fantom.network`,
102
- tokenStandard: "ERC20",
103
- scanApi: {
104
- endpoint: "https://api.ftmscan.com/api",
105
- key: ensureAndGet("SKYNET_FTMSCAN_API_KEY"),
106
- },
107
- scanUrl: "https://ftmscan.com/",
108
- chainId: 250,
109
- },
110
- algo: {
111
- nativeTokenName: "Algorand",
112
- nativeTokenSymbol: "ALGO",
113
- nativeTokenDecimals: 6,
114
- nativeTokenAddress: "algo:native",
115
- nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/algo:native.png`,
116
- nativeTokenCoinGeckoId: "algorand",
117
- nativeTokenCmcId: 4030,
118
- endpoint: "https://algo-node.certik-skynet.com/",
119
- tokenStandard: "ASA",
120
- chainId: 1300,
108
+ scanUrl: "https://snowtrace.io/",
109
+ chainId: 43114
110
+ },
111
+ ftm: {
112
+ nativeTokenName: "Fantom",
113
+ nativeTokenSymbol: "FTM",
114
+ nativeTokenDecimals: 18,
115
+ nativeTokenAddress: "ftm:0x0000000000000000000000000000000000000000",
116
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/ftm:0x0000000000000000000000000000000000000000.png`,
117
+ nativeTokenCoinGeckoId: "fantom",
118
+ nativeTokenCmcId: 3513,
119
+ endpoint: `https://rpcapi.fantom.network`,
120
+ tokenStandard: "ERC20",
121
+ scanApi: {
122
+ endpoint: "https://api.ftmscan.com/api",
123
+ key: ensureAndGet("SKYNET_FTMSCAN_API_KEY")
121
124
  },
125
+ scanUrl: "https://ftmscan.com/",
126
+ chainId: 250
127
+ },
128
+ algo: {
129
+ nativeTokenName: "Algorand",
130
+ nativeTokenSymbol: "ALGO",
131
+ nativeTokenDecimals: 6,
132
+ nativeTokenAddress: "algo:native",
133
+ nativeTokenLogo: `https://d1w63vqp8iwj2x.cloudfront.net/algo:native.png`,
134
+ nativeTokenCoinGeckoId: "algorand",
135
+ nativeTokenCmcId: 4030,
136
+ endpoint: "https://algo-node.certik-skynet.com/",
137
+ tokenStandard: "ASA",
138
+ chainId: 1300
139
+ }
122
140
  };
123
- const TIME = {
124
- BY_MS: {
125
- SECOND: 1000,
126
- MINUTE: 1000 * 60,
127
- HOUR: 1000 * 60 * 60,
128
- DAY: 1000 * 60 * 60 * 24,
129
- WEEK: 1000 * 60 * 60 * 24 * 7,
130
- YEAR: 1000 * 60 * 60 * 24 * 365,
131
- },
132
- BY_S: {
133
- SECOND: 1,
134
- MINUTE: 60,
135
- HOUR: 60 * 60,
136
- DAY: 60 * 60 * 24,
137
- WEEK: 60 * 60 * 24 * 7,
138
- YEAR: 60 * 60 * 24 * 365,
139
- },
141
+ var TIME = {
142
+ BY_MS: {
143
+ SECOND: 1000,
144
+ MINUTE: 1000 * 60,
145
+ HOUR: 1000 * 60 * 60,
146
+ DAY: 1000 * 60 * 60 * 24,
147
+ WEEK: 1000 * 60 * 60 * 24 * 7,
148
+ YEAR: 1000 * 60 * 60 * 24 * 365
149
+ },
150
+ BY_S: {
151
+ SECOND: 1,
152
+ MINUTE: 60,
153
+ HOUR: 60 * 60,
154
+ DAY: 60 * 60 * 24,
155
+ WEEK: 60 * 60 * 24 * 7,
156
+ YEAR: 60 * 60 * 24 * 365
157
+ }
158
+ };
159
+ export {
160
+ TIME,
161
+ PROTOCOLS
140
162
  };
141
- export { PROTOCOLS, TIME };
@@ -1,4 +1,3 @@
1
1
  import type { DBSQLParameterValue } from "@databricks/sql/dist/DBSQLParameter.js";
2
2
  declare function executeSql<T>(sql: string, bindings: Record<string, DBSQLParameterValue>): Promise<T[]>;
3
3
  export { executeSql };
4
- //# sourceMappingURL=databricks.d.ts.map