@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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.60
4
+
5
+ - Fixed: print skynet API route error stack trace
6
+ - Upgraded: snowflake-sdk version
7
+
8
+ ## 0.10.59
9
+
10
+ - Fixed: parseAddress() can handle more cases
11
+
3
12
  ## 0.10.58
4
13
 
5
14
  - Fixed: add proxies back to 100 instances
package/address.js CHANGED
@@ -1,11 +1,24 @@
1
1
  function parseAddress(address) {
2
- const parts = address.split(":");
2
+ // in case of address has multiple colons, we only split the first one
3
+ const separatorIndex = address.indexOf(":");
3
4
 
4
- if (parts.length > 1) {
5
- return [parts[0], parts[1].toLowerCase()];
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 ["eth", address.toLowerCase()];
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.58",
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.3",
27
+ "snowflake-sdk": "^1.6.23",
28
28
  "web3": "^1.3.5",
29
29
  "which": "^2.0.2"
30
30
  },