@pioneer-platform/pioneer 8.12.0 → 8.12.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 +10 -0
- package/lib/index.d.ts +1 -42
- package/lib/index.js +29 -15
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @pioneer-platform/pioneer
|
|
2
2
|
|
|
3
|
+
## 8.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cache work
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @pioneer-platform/blockbook@8.11.1
|
|
10
|
+
- @pioneer-platform/unchained@8.11.2
|
|
11
|
+
- @pioneer-platform/redis-queue@8.11.1
|
|
12
|
+
|
|
3
13
|
## 8.12.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare const queue: any;
|
|
3
|
-
declare const uuid: any;
|
|
4
|
-
declare let blocknative: any;
|
|
5
|
-
declare const blockbook: any;
|
|
6
|
-
declare let zapper: any;
|
|
7
|
-
declare let shortListSymbolToCaip: any, evmCaips: any;
|
|
8
|
-
declare const networks: any;
|
|
9
|
-
declare let get_address_from_xpub: any, getNativeAssetForBlockchain: any;
|
|
10
|
-
declare var numbro: any;
|
|
11
|
-
declare const log: any;
|
|
12
|
-
declare const subscriber: any, publisher: any, redis: any, redisQueue: any;
|
|
13
|
-
declare let connection: any;
|
|
14
|
-
declare let wait: any;
|
|
15
|
-
declare let sleep: any;
|
|
16
|
-
declare let usersDB: any;
|
|
17
|
-
declare let txsDB: any;
|
|
18
|
-
declare let pubkeysDB: any;
|
|
19
|
-
declare let inputsDB: any;
|
|
20
|
-
declare let assetsDB: any;
|
|
21
|
-
declare let nodesDB: any;
|
|
22
|
-
declare const BALANCE_ON_REGISTER = true;
|
|
23
|
-
declare let onStart: () => Promise<true | undefined>;
|
|
24
|
-
declare function getFromCache(key: any): Promise<any>;
|
|
25
|
-
declare function setInCache(key: any, data: any, expiration: any): Promise<void>;
|
|
26
|
-
declare let get_pubkey_balances: (pubkey: any) => Promise<any>;
|
|
27
|
-
declare let get_and_rescan_pubkeys: (username: string) => Promise<{
|
|
28
|
-
pubkeys: any;
|
|
29
|
-
masters: any;
|
|
30
|
-
}>;
|
|
31
|
-
declare let get_and_verify_pubkeys: (username: string, context?: string) => Promise<{
|
|
32
|
-
pubkeys: any;
|
|
33
|
-
balances: any;
|
|
34
|
-
}>;
|
|
35
|
-
declare let register_zpub: (username: string, pubkey: any, context: string) => Promise<any>;
|
|
36
|
-
declare let register_xpub: (username: string, pubkey: any, context: string) => Promise<{
|
|
37
|
-
nfts: any;
|
|
38
|
-
balances: any;
|
|
39
|
-
}>;
|
|
40
|
-
declare let register_address: (username: string, pubkey: any, context: string) => Promise<any>;
|
|
41
|
-
declare let update_pubkeys: (username: string, pubkeys: any, context: string) => Promise<any>;
|
|
42
|
-
declare const register_pubkeys: (username: string, pubkeys: any) => Promise<any>;
|
|
1
|
+
export {};
|
package/lib/index.js
CHANGED
|
@@ -74,6 +74,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
74
74
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
78
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
79
|
+
};
|
|
80
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
81
|
var TAG = " | Pioneer | ";
|
|
78
82
|
var queue = require('@pioneer-platform/redis-queue');
|
|
79
83
|
var uuid = require('short-uuid');
|
|
@@ -99,15 +103,15 @@ var _b = require('@pioneer-platform/cointools'), get_address_from_xpub = _b.get_
|
|
|
99
103
|
var numbro = require("numbro");
|
|
100
104
|
var log = require('@pioneer-platform/loggerdog')();
|
|
101
105
|
var _c = require('@pioneer-platform/default-redis'), subscriber = _c.subscriber, publisher = _c.publisher, redis = _c.redis, redisQueue = _c.redisQueue;
|
|
102
|
-
var
|
|
106
|
+
var default_mongo_v2_1 = __importDefault(require("@pioneer-platform/default-mongo-v2"));
|
|
103
107
|
var wait = require('wait-promise');
|
|
104
108
|
var sleep = wait.sleep;
|
|
105
|
-
var usersDB =
|
|
106
|
-
var txsDB =
|
|
107
|
-
var pubkeysDB =
|
|
108
|
-
var inputsDB =
|
|
109
|
-
var assetsDB =
|
|
110
|
-
var nodesDB =
|
|
109
|
+
var usersDB = default_mongo_v2_1.default.get('users');
|
|
110
|
+
var txsDB = default_mongo_v2_1.default.get('transactions');
|
|
111
|
+
var pubkeysDB = default_mongo_v2_1.default.get('pubkeys');
|
|
112
|
+
var inputsDB = default_mongo_v2_1.default.get('unspent');
|
|
113
|
+
var assetsDB = default_mongo_v2_1.default.get('assets');
|
|
114
|
+
var nodesDB = default_mongo_v2_1.default.get('nodes');
|
|
111
115
|
usersDB.createIndex({ id: 1 }, { unique: true });
|
|
112
116
|
txsDB.createIndex({ txid: 1 }, { unique: true });
|
|
113
117
|
inputsDB.createIndex({ txid: 1 }, { unique: true });
|
|
@@ -123,28 +127,34 @@ var onStart = function () {
|
|
|
123
127
|
tag = TAG + " | onStart | ";
|
|
124
128
|
_a.label = 1;
|
|
125
129
|
case 1:
|
|
126
|
-
_a.trys.push([1,
|
|
130
|
+
_a.trys.push([1, 6, , 7]);
|
|
127
131
|
log.debug(tag, "starting...");
|
|
128
|
-
|
|
132
|
+
// Initialize MongoDB v2 connection
|
|
133
|
+
return [4 /*yield*/, default_mongo_v2_1.default.init()];
|
|
129
134
|
case 2:
|
|
135
|
+
// Initialize MongoDB v2 connection
|
|
136
|
+
_a.sent();
|
|
137
|
+
log.info(tag, "MongoDB v2 connection initialized");
|
|
138
|
+
return [4 /*yield*/, nodesDB.find({ type: 'blockbook' })];
|
|
139
|
+
case 3:
|
|
130
140
|
servers = _a.sent();
|
|
131
141
|
log.debug(tag, "servers: ", servers.length);
|
|
132
142
|
return [4 /*yield*/, blockbook.init(servers)
|
|
133
143
|
// networks.ANY.init('full')
|
|
134
144
|
];
|
|
135
|
-
case
|
|
145
|
+
case 4:
|
|
136
146
|
_a.sent();
|
|
137
147
|
// networks.ANY.init('full')
|
|
138
148
|
return [4 /*yield*/, networks.ETH.init()];
|
|
139
|
-
case
|
|
149
|
+
case 5:
|
|
140
150
|
// networks.ANY.init('full')
|
|
141
151
|
_a.sent();
|
|
142
152
|
return [2 /*return*/, true];
|
|
143
|
-
case
|
|
153
|
+
case 6:
|
|
144
154
|
e_1 = _a.sent();
|
|
145
155
|
log.error(e_1);
|
|
146
|
-
return [3 /*break*/,
|
|
147
|
-
case
|
|
156
|
+
return [3 /*break*/, 7];
|
|
157
|
+
case 7: return [2 /*return*/];
|
|
148
158
|
}
|
|
149
159
|
});
|
|
150
160
|
});
|
|
@@ -220,8 +230,12 @@ function setInCache(key, data, expiration) {
|
|
|
220
230
|
switch (_a.label) {
|
|
221
231
|
case 0:
|
|
222
232
|
_a.trys.push([0, 2, , 3]);
|
|
223
|
-
|
|
233
|
+
// NEVER EXPIRE - data persists forever for instant responses
|
|
234
|
+
// expiration parameter kept for backwards compatibility but ignored
|
|
235
|
+
return [4 /*yield*/, redis.set(key, data)];
|
|
224
236
|
case 1:
|
|
237
|
+
// NEVER EXPIRE - data persists forever for instant responses
|
|
238
|
+
// expiration parameter kept for backwards compatibility but ignored
|
|
225
239
|
_a.sent();
|
|
226
240
|
return [3 /*break*/, 3];
|
|
227
241
|
case 2:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/pioneer",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.1",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"clean": "rm -rf coverage src/**/*.js src/**/*.map lib node_modules"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pioneer-platform/blockbook": "^8.11.
|
|
23
|
+
"@pioneer-platform/blockbook": "^8.11.1",
|
|
24
24
|
"@pioneer-platform/blocknative-client": "^8.11.0",
|
|
25
25
|
"@pioneer-platform/cointools": "^8.3.1",
|
|
26
26
|
"@pioneer-platform/loggerdog": "^8.11.0",
|
|
27
27
|
"@pioneer-platform/pioneer-caip": "^9.10.0",
|
|
28
28
|
"@pioneer-platform/pioneer-coins": "^9.11.0",
|
|
29
|
-
"@pioneer-platform/redis-queue": "^8.11.
|
|
30
|
-
"@pioneer-platform/unchained": "^8.11.
|
|
29
|
+
"@pioneer-platform/redis-queue": "^8.11.1",
|
|
30
|
+
"@pioneer-platform/unchained": "^8.11.2",
|
|
31
31
|
"@pioneer-platform/zapper-client": "^8.11.0",
|
|
32
32
|
"dotenv": "^8.2.0",
|
|
33
33
|
"short-uuid": "^4.2.2"
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
"typescript": "^5.0.4"
|
|
45
45
|
},
|
|
46
46
|
"gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3"
|
|
47
|
-
}
|
|
47
|
+
}
|