@pioneer-platform/pioneer 8.2.26 → 8.2.28

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 (2) hide show
  1. package/lib/index.js +18 -17
  2. package/package.json +2 -1
package/lib/index.js CHANGED
@@ -242,7 +242,7 @@ var get_pubkey_balances = function (pubkey) {
242
242
  tag = TAG + " | get_pubkey_balances | ";
243
243
  _d.label = 1;
244
244
  case 1:
245
- _d.trys.push([1, 35, , 36]);
245
+ _d.trys.push([1, 37, , 38]);
246
246
  output = {};
247
247
  if (!pubkey.symbol && pubkey.asset)
248
248
  pubkey.symbol = pubkey.asset;
@@ -250,10 +250,8 @@ var get_pubkey_balances = function (pubkey) {
250
250
  pubkey.type = "address";
251
251
  if (!pubkey.context)
252
252
  throw Error("100: invalid pubkey! missing context");
253
- if (!pubkey.symbol)
254
- throw Error("101: invalid pubkey! missing symbol");
255
- if (!pubkey.username)
256
- throw Error("102: invalid pubkey! missing username");
253
+ // if (!pubkey.symbol) throw Error("101: invalid pubkey! missing symbol");
254
+ // if (!pubkey.username) throw Error("102: invalid pubkey! missing username");
257
255
  if (!pubkey.pubkey)
258
256
  throw Error("103: invalid pubkey! missing pubkey");
259
257
  if (!pubkey.type)
@@ -297,9 +295,9 @@ var get_pubkey_balances = function (pubkey) {
297
295
  lastUpdated: new Date().getTime(),
298
296
  balance: balance
299
297
  });
300
- return [3 /*break*/, 33];
298
+ return [3 /*break*/, 35];
301
299
  case 7:
302
- if (!(pubkey.type === "address")) return [3 /*break*/, 33];
300
+ if (!(pubkey.type === "address")) return [3 /*break*/, 35];
303
301
  _c = pubkey.symbol;
304
302
  switch (_c) {
305
303
  case "ETH": return [3 /*break*/, 8];
@@ -448,8 +446,9 @@ var get_pubkey_balances = function (pubkey) {
448
446
  }
449
447
  });
450
448
  }
451
- return [3 /*break*/, 33];
449
+ return [3 /*break*/, 35];
452
450
  case 27:
451
+ if (!(pubkey.symbol && networks[pubkey.symbol])) return [3 /*break*/, 33];
453
452
  cacheKeyNetwork = "balances:".concat(pubkey.symbol, ":getBalance:").concat(pubkey.pubkey);
454
453
  return [4 /*yield*/, getFromCache(cacheKeyNetwork)];
455
454
  case 28:
@@ -481,9 +480,13 @@ var get_pubkey_balances = function (pubkey) {
481
480
  context: pubkey.context,
482
481
  source: "pioneer-network-" + pubkey.symbol
483
482
  });
484
- return [3 /*break*/, 33];
485
- case 33: return [4 /*yield*/, pubkeysDB.findOne({ pubkey: pubkey.pubkey })];
486
- case 34:
483
+ return [3 /*break*/, 34];
484
+ case 33:
485
+ console.error("Unhandled Pubkey: ", pubkey);
486
+ _d.label = 34;
487
+ case 34: return [3 /*break*/, 35];
488
+ case 35: return [4 /*yield*/, pubkeysDB.findOne({ pubkey: pubkey.pubkey })];
489
+ case 36:
487
490
  pubkeyInfo = _d.sent();
488
491
  if (!pubkeyInfo || !pubkeyInfo.balances) {
489
492
  pubkeyInfo = {
@@ -509,11 +512,11 @@ var get_pubkey_balances = function (pubkey) {
509
512
  output.nfts = nfts;
510
513
  output.success = true;
511
514
  return [2 /*return*/, output];
512
- case 35:
515
+ case 37:
513
516
  e_2 = _d.sent();
514
517
  console.error(tag, "e: ", e_2);
515
518
  throw e_2;
516
- case 36: return [2 /*return*/];
519
+ case 38: return [2 /*return*/];
517
520
  }
518
521
  });
519
522
  });
@@ -1049,14 +1052,12 @@ var register_pubkeys = function (username, pubkeys) {
1049
1052
  throw Error("104: invalid pubkey! missing type!");
1050
1053
  if (!pubkeyInfo.symbol)
1051
1054
  pubkeyInfo.symbol = nativeAsset;
1052
- if (!pubkeyInfo.script_type)
1053
- throw Error("Invalid pubkey required field: script_type coin:" + pubkeyInfo.blockchain);
1055
+ //if (!pubkeyInfo.script_type) throw Error("Invalid pubkey required field: script_type coin:" + pubkeyInfo.blockchain);
1054
1056
  if (!pubkeyInfo.network)
1055
1057
  throw Error("Invalid pubkey required field: network coin:" + pubkeyInfo.blockchain);
1056
1058
  if (!pubkeyInfo.master)
1057
1059
  throw Error("Invalid pubkey required field: master coin:" + pubkeyInfo.blockchain);
1058
- if (!pubkeyInfo.path)
1059
- throw Error("Invalid pubkey required field: path coin:" + pubkeyInfo.blockchain);
1060
+ //if (!pubkeyInfo.path) throw Error("Invalid pubkey required field: path coin:" + pubkeyInfo.blockchain);
1060
1061
  if (!pubkeyInfo.context)
1061
1062
  throw Error("Invalid pubkey required field: context:" + pubkeyInfo.blockchain);
1062
1063
  return [4 /*yield*/, pubkeysDB.findOne({ pubkey: pubkeyInfo.pubkey })];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer",
3
- "version": "8.2.26",
3
+ "version": "8.2.28",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {
@@ -25,6 +25,7 @@
25
25
  "@pioneer-platform/cointools": "^8.1.72",
26
26
  "@pioneer-platform/loggerdog": "^8.1.31",
27
27
  "@pioneer-platform/pioneer-caip": "^8.1.79",
28
+ "@pioneer-platform/pioneer-coins": "^8.1.86",
28
29
  "@pioneer-platform/redis-queue": "^8.1.24",
29
30
  "@pioneer-platform/unchained": "^8.1.66",
30
31
  "@pioneer-platform/zapper-client": "^8.1.26",