@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.
- package/CHANGELOG.md +8 -0
- package/build.ts +23 -0
- package/dist/abi.d.ts +1 -2
- package/dist/abi.js +569 -563
- package/dist/address.d.ts +0 -1
- package/dist/address.js +22 -21
- package/dist/api.d.ts +0 -1
- package/dist/api.js +235 -120
- package/dist/app.d.ts +1 -2
- package/dist/app.js +2030 -276
- package/dist/availability.d.ts +0 -1
- package/dist/availability.js +126 -56
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +28 -24
- package/dist/const.d.ts +0 -1
- package/dist/const.js +153 -132
- package/dist/databricks.d.ts +0 -1
- package/dist/databricks.js +198 -58
- package/dist/date.d.ts +0 -1
- package/dist/date.js +48 -21
- package/dist/deploy.d.ts +0 -1
- package/dist/deploy.js +427 -292
- package/dist/dynamodb.d.ts +3 -4
- package/dist/dynamodb.js +432 -281
- package/dist/env.d.ts +2 -3
- package/dist/env.js +16 -9
- package/dist/graphql.d.ts +0 -1
- package/dist/graphql.js +26 -23
- package/dist/indexer.d.ts +0 -1
- package/dist/indexer.js +1050 -441
- package/dist/log.d.ts +0 -1
- package/dist/log.js +53 -52
- package/dist/object-hash.d.ts +0 -1
- package/dist/object-hash.js +49 -59
- package/dist/opsgenie.d.ts +97 -19
- package/dist/opsgenie.js +35 -30
- package/dist/por.d.ts +0 -1
- package/dist/por.js +113 -123
- package/dist/s3.d.ts +7 -8
- package/dist/s3.js +103 -91
- package/dist/search.d.ts +0 -1
- package/dist/search.js +100 -25
- package/dist/selector.d.ts +0 -1
- package/dist/selector.js +34 -38
- package/dist/slack.d.ts +0 -1
- package/dist/slack.js +27 -21
- package/dist/util.d.ts +0 -1
- package/dist/util.js +21 -20
- package/examples/api.ts +1 -1
- package/examples/indexer.ts +1 -1
- package/examples/mode-indexer.ts +1 -1
- package/package.json +4 -3
- package/{graphql.ts → src/graphql.ts} +1 -1
- package/src/opsgenie.ts +176 -0
- package/tsconfig.build.json +2 -5
- package/tsconfig.json +11 -20
- package/dist/abi.d.ts.map +0 -1
- package/dist/address.d.ts.map +0 -1
- package/dist/api.d.ts.map +0 -1
- package/dist/app.d.ts.map +0 -1
- package/dist/availability.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/const.d.ts.map +0 -1
- package/dist/databricks.d.ts.map +0 -1
- package/dist/date.d.ts.map +0 -1
- package/dist/deploy.d.ts.map +0 -1
- package/dist/dynamodb.d.ts.map +0 -1
- package/dist/env.d.ts.map +0 -1
- package/dist/graphql.d.ts.map +0 -1
- package/dist/indexer.d.ts.map +0 -1
- package/dist/log.d.ts.map +0 -1
- package/dist/object-hash.d.ts.map +0 -1
- package/dist/opsgenie.d.ts.map +0 -1
- package/dist/por.d.ts.map +0 -1
- package/dist/s3.d.ts.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/selector.d.ts.map +0 -1
- package/dist/slack.d.ts.map +0 -1
- package/dist/util.d.ts.map +0 -1
- package/opsgenie.ts +0 -69
- /package/{abi.ts → src/abi.ts} +0 -0
- /package/{address.ts → src/address.ts} +0 -0
- /package/{api.ts → src/api.ts} +0 -0
- /package/{app.ts → src/app.ts} +0 -0
- /package/{availability.ts → src/availability.ts} +0 -0
- /package/{cli.ts → src/cli.ts} +0 -0
- /package/{const.ts → src/const.ts} +0 -0
- /package/{databricks.ts → src/databricks.ts} +0 -0
- /package/{date.ts → src/date.ts} +0 -0
- /package/{deploy.ts → src/deploy.ts} +0 -0
- /package/{dynamodb.ts → src/dynamodb.ts} +0 -0
- /package/{env.ts → src/env.ts} +0 -0
- /package/{indexer.ts → src/indexer.ts} +0 -0
- /package/{log.ts → src/log.ts} +0 -0
- /package/{object-hash.ts → src/object-hash.ts} +0 -0
- /package/{por.ts → src/por.ts} +0 -0
- /package/{s3.ts → src/s3.ts} +0 -0
- /package/{search.ts → src/search.ts} +0 -0
- /package/{selector.ts → src/selector.ts} +0 -0
- /package/{slack.ts → src/slack.ts} +0 -0
- /package/{util.ts → src/util.ts} +0 -0
package/dist/availability.d.ts
CHANGED
package/dist/availability.js
CHANGED
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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 {
|
|
127
|
+
export {
|
|
128
|
+
withRetry,
|
|
129
|
+
wait,
|
|
130
|
+
pThrottle as throttle,
|
|
131
|
+
memoize,
|
|
132
|
+
exponentialRetry
|
|
133
|
+
};
|
package/dist/cli.d.ts
CHANGED
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
+
return detectDirectory(process.argv[1], "SkynetAPIDefinitions.yml");
|
|
10
11
|
}
|
|
11
12
|
function detectWorkingDirectory() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
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
|
-
|
|
35
|
-
|
|
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 {
|
|
36
|
+
export {
|
|
37
|
+
getBinaryName,
|
|
38
|
+
detectWorkingDirectory,
|
|
39
|
+
detectSkynetDirectory,
|
|
40
|
+
detectBin
|
|
41
|
+
};
|
package/dist/const.d.ts
CHANGED
package/dist/const.js
CHANGED
|
@@ -1,141 +1,162 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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 };
|
package/dist/databricks.d.ts
CHANGED