@certik/skynet 0.22.0 → 0.22.1
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 +4 -0
- package/dist/abi.js +563 -614
- package/dist/address.js +21 -67
- package/dist/api.js +127 -35155
- package/dist/app.js +297 -71683
- package/dist/availability.js +54 -917
- package/dist/cli.js +24 -73
- package/dist/const.js +132 -198
- package/dist/databricks.js +54 -84906
- package/dist/date.js +21 -93
- package/dist/deploy.js +306 -17358
- package/dist/dynamodb.js +279 -27316
- package/dist/env.js +9 -61
- package/dist/graphql.js +22 -70
- package/dist/indexer.js +443 -36930
- package/dist/log.js +52 -98
- package/dist/object-hash.js +52 -427
- package/dist/opsgenie.js +31 -313
- package/dist/por.js +123 -157
- package/dist/s3.js +77 -28845
- package/dist/search.js +21 -37745
- package/dist/selector.js +38 -79
- package/dist/slack.js +19 -16837
- package/dist/util.js +20 -66
- package/examples/api.ts +0 -0
- package/examples/indexer.ts +0 -0
- package/examples/mode-indexer.ts +0 -0
- package/package.json +3 -3
- package/tsconfig.build.json +0 -1
- package/.vscode/settings.json +0 -5
- package/bun.lockb +0 -0
- package/dist/xxhash.win32-x64-msvc-hrdz34v7.node +0 -0
package/dist/address.js
CHANGED
|
@@ -1,69 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var __toCommonJS = (from) => {
|
|
21
|
-
var entry = __moduleCache.get(from), desc;
|
|
22
|
-
if (entry)
|
|
23
|
-
return entry;
|
|
24
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
25
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
26
|
-
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
27
|
-
get: () => from[key],
|
|
28
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
-
}));
|
|
30
|
-
__moduleCache.set(from, entry);
|
|
31
|
-
return entry;
|
|
32
|
-
};
|
|
33
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
-
var __export = (target, all) => {
|
|
35
|
-
for (var name in all)
|
|
36
|
-
__defProp(target, name, {
|
|
37
|
-
get: all[name],
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true,
|
|
40
|
-
set: (newValue) => all[name] = () => newValue
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
44
|
-
var __require = import.meta.require;
|
|
45
|
-
|
|
46
|
-
// address.ts
|
|
47
|
-
function parseAddress(address) {
|
|
48
|
-
const separatorIndex = address.indexOf(":");
|
|
49
|
-
let protocolPart;
|
|
50
|
-
let addressPart;
|
|
51
|
-
if (separatorIndex === -1) {
|
|
52
|
-
protocolPart = "eth";
|
|
53
|
-
addressPart = address;
|
|
54
|
-
} else {
|
|
55
|
-
protocolPart = address.slice(0, separatorIndex);
|
|
56
|
-
addressPart = address.slice(separatorIndex + 1);
|
|
57
|
-
}
|
|
58
|
-
if (addressPart.startsWith("0x")) {
|
|
59
|
-
addressPart = addressPart.toLowerCase();
|
|
60
|
-
}
|
|
61
|
-
return [protocolPart, addressPart];
|
|
1
|
+
export function parseAddress(address) {
|
|
2
|
+
// in case of address has multiple colons, we only split the first one
|
|
3
|
+
const separatorIndex = address.indexOf(":");
|
|
4
|
+
let protocolPart;
|
|
5
|
+
let addressPart;
|
|
6
|
+
if (separatorIndex === -1) {
|
|
7
|
+
// if there is no colon, we assume it is an ethereum address
|
|
8
|
+
protocolPart = "eth";
|
|
9
|
+
addressPart = address;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
protocolPart = address.slice(0, separatorIndex);
|
|
13
|
+
addressPart = address.slice(separatorIndex + 1);
|
|
14
|
+
}
|
|
15
|
+
if (addressPart.startsWith("0x")) {
|
|
16
|
+
// We only lowercase the address part if it starts with 0x, otherwise it is a case-sensitive address (such as tron)
|
|
17
|
+
addressPart = addressPart.toLowerCase();
|
|
18
|
+
}
|
|
19
|
+
return [protocolPart, addressPart];
|
|
62
20
|
}
|
|
63
|
-
function composeAddress(protocol, addr) {
|
|
64
|
-
|
|
21
|
+
export function composeAddress(protocol, addr) {
|
|
22
|
+
return `${protocol}:${addr}`;
|
|
65
23
|
}
|
|
66
|
-
export {
|
|
67
|
-
parseAddress,
|
|
68
|
-
composeAddress
|
|
69
|
-
};
|