@certik/skynet 0.10.58 → 0.10.60
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 +9 -0
- package/address.js +17 -4
- package/api.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/address.js
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
function parseAddress(address) {
|
|
2
|
-
|
|
2
|
+
// in case of address has multiple colons, we only split the first one
|
|
3
|
+
const separatorIndex = address.indexOf(":");
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
let protocolPart;
|
|
6
|
+
let addressPart;
|
|
7
|
+
|
|
8
|
+
if (separatorIndex === -1) {
|
|
9
|
+
// if there is no colon, we assume it is an ethereum address
|
|
10
|
+
protocolPart = "eth";
|
|
11
|
+
addressPart = address;
|
|
12
|
+
} else {
|
|
13
|
+
protocolPart = address.slice(0, separatorIndex);
|
|
14
|
+
addressPart = address.slice(separatorIndex + 1);
|
|
15
|
+
}
|
|
16
|
+
if (addressPart.startsWith("0x")) {
|
|
17
|
+
// We only lowercase the address part if it starts with 0x, otherwise it is a case-sensitive address (such as tron)
|
|
18
|
+
addressPart = addressPart.toLowerCase();
|
|
6
19
|
}
|
|
7
20
|
|
|
8
|
-
return [
|
|
21
|
+
return [protocolPart, addressPart];
|
|
9
22
|
}
|
|
10
23
|
|
|
11
24
|
function composeAddress(protocol, addr) {
|
package/api.js
CHANGED
|
@@ -143,7 +143,7 @@ ${getSelectorDesc(selector)}
|
|
|
143
143
|
try {
|
|
144
144
|
await route.handler({ req, res, ...selectorFlags });
|
|
145
145
|
} catch (routeErr) {
|
|
146
|
-
inline.log("caught route err", routeErr);
|
|
146
|
+
inline.log("caught route err", routeErr, routeErr.stack);
|
|
147
147
|
|
|
148
148
|
res.status(500).send(`internal server error: ${routeErr.message}`);
|
|
149
149
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@certik/skynet",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.60",
|
|
4
4
|
"description": "Skynet Shared JS library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "CertiK Engineering",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "eslint *.js test",
|
|
9
|
-
"test": "ava"
|
|
9
|
+
"test": "doppler run -- ava"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">= 14"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"md5": "^2.3.0",
|
|
25
25
|
"meow": "^9.0.0",
|
|
26
26
|
"node-fetch": "^2.6.7",
|
|
27
|
-
"snowflake-sdk": "^1.6.
|
|
27
|
+
"snowflake-sdk": "^1.6.23",
|
|
28
28
|
"web3": "^1.3.5",
|
|
29
29
|
"which": "^2.0.2"
|
|
30
30
|
},
|