@pioneer-platform/scamdb 8.4.0 → 8.4.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 +9 -0
- package/package.json +12 -12
- package/lib/index.d.ts +0 -7
- package/lib/index.js +0 -104
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# @pioneer-platform/scamdb
|
2
2
|
|
3
|
+
## 8.4.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Automated patch version bump for all packages
|
8
|
+
- Updated dependencies
|
9
|
+
- @pioneer-platform/loggerdog@8.4.1
|
10
|
+
- @pioneer-platform/pioneer-types@8.4.1
|
11
|
+
|
3
12
|
## 8.4.0
|
4
13
|
|
5
14
|
### Minor Changes
|
package/package.json
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pioneer-platform/scamdb",
|
3
|
-
"version": "8.4.
|
3
|
+
"version": "8.4.1",
|
4
4
|
"main": "./lib/index.js",
|
5
5
|
"types": "./lib/index.d.ts",
|
6
6
|
"dependencies": {
|
7
|
-
"@pioneer-platform/loggerdog": "^8.4.
|
8
|
-
"@pioneer-platform/pioneer-types": "^8.4.
|
7
|
+
"@pioneer-platform/loggerdog": "^8.4.1",
|
8
|
+
"@pioneer-platform/pioneer-types": "^8.4.1",
|
9
9
|
"axios": "^1.6.0",
|
10
10
|
"axios-retry": "^3.2.0",
|
11
11
|
"dotenv": "^8.2.0"
|
12
12
|
},
|
13
|
+
"scripts": {
|
14
|
+
"npm": "pnpm i",
|
15
|
+
"test": "pnpm run build && node __tests__/test-module.js",
|
16
|
+
"build": "tsc -p .",
|
17
|
+
"build:watch": "pnpm run build && onchange 'src/**/*.ts' -- pnpm run build",
|
18
|
+
"prepublish": "pnpm run build",
|
19
|
+
"refresh": "rm -rf ./node_modules ./package-lock.json && pnpm install"
|
20
|
+
},
|
13
21
|
"devDependencies": {
|
14
22
|
"@types/jest": "^25.2.3",
|
15
23
|
"@types/node": "^18.16.0",
|
@@ -21,13 +29,5 @@
|
|
21
29
|
"ts-jest": "^29.0.5",
|
22
30
|
"typescript": "^5.0.4"
|
23
31
|
},
|
24
|
-
"gitHead": "aeae28273014ab69b42f22abec159c6693a56c40"
|
25
|
-
"scripts": {
|
26
|
-
"npm": "pnpm i",
|
27
|
-
"test": "pnpm run build && node __tests__/test-module.js",
|
28
|
-
"build": "tsc -p .",
|
29
|
-
"build:watch": "pnpm run build && onchange 'src/**/*.ts' -- pnpm run build",
|
30
|
-
"prepublish": "pnpm run build",
|
31
|
-
"refresh": "rm -rf ./node_modules ./package-lock.json && pnpm install"
|
32
|
-
}
|
32
|
+
"gitHead": "aeae28273014ab69b42f22abec159c6693a56c40"
|
33
33
|
}
|
package/lib/index.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
declare const TAG = " | market-module | ";
|
2
|
-
declare const Axios: any;
|
3
|
-
declare const https: any;
|
4
|
-
declare const axios: any;
|
5
|
-
declare const log: any;
|
6
|
-
declare const URL_SCAMDB = "https://api.cryptoscamdb.org/v1/";
|
7
|
-
declare const check_address: (address: string) => Promise<any>;
|
package/lib/index.js
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
https://www.coingecko.com/api/documentations/v3
|
7
|
-
|
8
|
-
*/
|
9
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
10
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
11
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
12
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
13
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
14
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
15
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
16
|
-
});
|
17
|
-
};
|
18
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
19
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
20
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
21
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
22
|
-
function step(op) {
|
23
|
-
if (f) throw new TypeError("Generator is already executing.");
|
24
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
25
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
26
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
27
|
-
switch (op[0]) {
|
28
|
-
case 0: case 1: t = op; break;
|
29
|
-
case 4: _.label++; return { value: op[1], done: false };
|
30
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
31
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
32
|
-
default:
|
33
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
34
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
35
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
36
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
37
|
-
if (t[2]) _.ops.pop();
|
38
|
-
_.trys.pop(); continue;
|
39
|
-
}
|
40
|
-
op = body.call(thisArg, _);
|
41
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
42
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
43
|
-
}
|
44
|
-
};
|
45
|
-
var TAG = " | market-module | ";
|
46
|
-
var Axios = require('axios');
|
47
|
-
var https = require('https');
|
48
|
-
var axios = Axios.create({
|
49
|
-
httpsAgent: new https.Agent({
|
50
|
-
rejectUnauthorized: false,
|
51
|
-
headers: {
|
52
|
-
"Authorization": "Bearer " + process.env['COINCAP_API_KEY'],
|
53
|
-
}
|
54
|
-
})
|
55
|
-
});
|
56
|
-
var log = require('@pioneer-platform/loggerdog')();
|
57
|
-
// const axiosRetry = require('axios-retry');
|
58
|
-
//
|
59
|
-
// axiosRetry(axios, {
|
60
|
-
// retries: 5, // number of retries
|
61
|
-
// retryDelay: (retryCount: number) => {
|
62
|
-
// console.log(`retry attempt: ${retryCount}`);
|
63
|
-
// return retryCount * 1000; // time interval between retries
|
64
|
-
// },
|
65
|
-
// retryCondition: (error: { response: { status: number; }; }) => {
|
66
|
-
// console.error(error)
|
67
|
-
// // if retry condition is not specified, by default idempotent requests are retried
|
68
|
-
// return error.response.status === 503;
|
69
|
-
// },
|
70
|
-
// });
|
71
|
-
var URL_SCAMDB = "https://api.cryptoscamdb.org/v1/";
|
72
|
-
module.exports = {
|
73
|
-
checkAddress: function (address) {
|
74
|
-
return check_address(address);
|
75
|
-
}
|
76
|
-
};
|
77
|
-
var check_address = function (address) {
|
78
|
-
return __awaiter(this, void 0, void 0, function () {
|
79
|
-
var tag, url, result, e_1;
|
80
|
-
return __generator(this, function (_a) {
|
81
|
-
switch (_a.label) {
|
82
|
-
case 0:
|
83
|
-
tag = " | check_address | ";
|
84
|
-
_a.label = 1;
|
85
|
-
case 1:
|
86
|
-
_a.trys.push([1, 3, , 4]);
|
87
|
-
url = URL_SCAMDB + "check/" + address;
|
88
|
-
log.debug(url);
|
89
|
-
return [4 /*yield*/, axios({
|
90
|
-
url: url,
|
91
|
-
method: 'GET'
|
92
|
-
})];
|
93
|
-
case 2:
|
94
|
-
result = _a.sent();
|
95
|
-
return [2 /*return*/, result.data];
|
96
|
-
case 3:
|
97
|
-
e_1 = _a.sent();
|
98
|
-
log.error(tag, "e: ", e_1);
|
99
|
-
return [3 /*break*/, 4];
|
100
|
-
case 4: return [2 /*return*/];
|
101
|
-
}
|
102
|
-
});
|
103
|
-
});
|
104
|
-
};
|