@xyo-network/crypto-nft-diviner-score-plugin 2.75.14 → 2.75.16
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/dist/browser/Diviner.d.cts +1 -1
- package/dist/browser/Diviner.d.cts.map +1 -1
- package/dist/browser/Diviner.d.mts +1 -1
- package/dist/browser/Diviner.d.mts.map +1 -1
- package/dist/browser/Diviner.d.ts +1 -1
- package/dist/browser/Diviner.d.ts.map +1 -1
- package/dist/browser/Plugin.d.cts +2 -2
- package/dist/browser/Plugin.d.mts +2 -2
- package/dist/browser/Plugin.d.ts +2 -2
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/docs.json +789 -392
- package/dist/node/Diviner.d.cts +1 -1
- package/dist/node/Diviner.d.cts.map +1 -1
- package/dist/node/Diviner.d.mts +1 -1
- package/dist/node/Diviner.d.mts.map +1 -1
- package/dist/node/Diviner.d.ts +1 -1
- package/dist/node/Diviner.d.ts.map +1 -1
- package/dist/node/Plugin.d.cts +2 -2
- package/dist/node/Plugin.d.mts +2 -2
- package/dist/node/Plugin.d.ts +2 -2
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/Diviner.ts +1 -1
- package/dist/browser/Diviner.cjs +0 -407
- package/dist/browser/Diviner.cjs.map +0 -1
- package/dist/browser/Diviner.js +0 -390
- package/dist/browser/Diviner.js.map +0 -1
- package/dist/browser/Plugin.cjs +0 -421
- package/dist/browser/Plugin.cjs.map +0 -1
- package/dist/browser/Plugin.js +0 -404
- package/dist/browser/Plugin.js.map +0 -1
- package/dist/browser/lib/index.cjs +0 -378
- package/dist/browser/lib/index.cjs.map +0 -1
- package/dist/browser/lib/index.js +0 -355
- package/dist/browser/lib/index.js.map +0 -1
- package/dist/browser/lib/rating/analyzeNft.cjs +0 -378
- package/dist/browser/lib/rating/analyzeNft.cjs.map +0 -1
- package/dist/browser/lib/rating/analyzeNft.js +0 -355
- package/dist/browser/lib/rating/analyzeNft.js.map +0 -1
- package/dist/browser/lib/rating/criteria/index.cjs +0 -364
- package/dist/browser/lib/rating/criteria/index.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/index.js +0 -341
- package/dist/browser/lib/rating/criteria/index.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/contract.cjs +0 -37
- package/dist/browser/lib/rating/criteria/scoring/contract.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/contract.js +0 -16
- package/dist/browser/lib/rating/criteria/scoring/contract.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/index.cjs +0 -363
- package/dist/browser/lib/rating/criteria/scoring/index.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/index.js +0 -340
- package/dist/browser/lib/rating/criteria/scoring/index.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/lib/index.cjs +0 -43
- package/dist/browser/lib/rating/criteria/scoring/lib/index.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/lib/index.js +0 -20
- package/dist/browser/lib/rating/criteria/scoring/lib/index.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.cjs +0 -42
- package/dist/browser/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.js +0 -19
- package/dist/browser/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/lib/toBigNumber.cjs +0 -34
- package/dist/browser/lib/rating/criteria/scoring/lib/toBigNumber.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/lib/toBigNumber.js +0 -13
- package/dist/browser/lib/rating/criteria/scoring/lib/toBigNumber.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/animationUrl.cjs +0 -67
- package/dist/browser/lib/rating/criteria/scoring/metadata/animationUrl.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/animationUrl.js +0 -46
- package/dist/browser/lib/rating/criteria/scoring/metadata/animationUrl.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.cjs +0 -103
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.js +0 -82
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/index.cjs +0 -105
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/index.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/index.js +0 -82
- package/dist/browser/lib/rating/criteria/scoring/metadata/attributes/index.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/backgroundColor.cjs +0 -44
- package/dist/browser/lib/rating/criteria/scoring/metadata/backgroundColor.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/backgroundColor.js +0 -23
- package/dist/browser/lib/rating/criteria/scoring/metadata/backgroundColor.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/description.cjs +0 -37
- package/dist/browser/lib/rating/criteria/scoring/metadata/description.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/description.js +0 -16
- package/dist/browser/lib/rating/criteria/scoring/metadata/description.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/externalUrl.cjs +0 -58
- package/dist/browser/lib/rating/criteria/scoring/metadata/externalUrl.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/externalUrl.js +0 -37
- package/dist/browser/lib/rating/criteria/scoring/metadata/externalUrl.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/image.cjs +0 -67
- package/dist/browser/lib/rating/criteria/scoring/metadata/image.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/image.js +0 -46
- package/dist/browser/lib/rating/criteria/scoring/metadata/image.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/imageData.cjs +0 -50
- package/dist/browser/lib/rating/criteria/scoring/metadata/imageData.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/imageData.js +0 -29
- package/dist/browser/lib/rating/criteria/scoring/metadata/imageData.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/index.cjs +0 -287
- package/dist/browser/lib/rating/criteria/scoring/metadata/index.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/index.js +0 -264
- package/dist/browser/lib/rating/criteria/scoring/metadata/index.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/index.cjs +0 -48
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/index.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/index.js +0 -25
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/index.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/urlHelpers.cjs +0 -46
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/urlHelpers.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/urlHelpers.js +0 -25
- package/dist/browser/lib/rating/criteria/scoring/metadata/lib/urlHelpers.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/name.cjs +0 -37
- package/dist/browser/lib/rating/criteria/scoring/metadata/name.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/name.js +0 -16
- package/dist/browser/lib/rating/criteria/scoring/metadata/name.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/youtubeUrl.cjs +0 -60
- package/dist/browser/lib/rating/criteria/scoring/metadata/youtubeUrl.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/metadata/youtubeUrl.js +0 -39
- package/dist/browser/lib/rating/criteria/scoring/metadata/youtubeUrl.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/supply.cjs +0 -56
- package/dist/browser/lib/rating/criteria/scoring/supply.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/supply.js +0 -35
- package/dist/browser/lib/rating/criteria/scoring/supply.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/tokenId.cjs +0 -56
- package/dist/browser/lib/rating/criteria/scoring/tokenId.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/tokenId.js +0 -35
- package/dist/browser/lib/rating/criteria/scoring/tokenId.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/type.cjs +0 -37
- package/dist/browser/lib/rating/criteria/scoring/type.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoring/type.js +0 -16
- package/dist/browser/lib/rating/criteria/scoring/type.js.map +0 -1
- package/dist/browser/lib/rating/criteria/scoringCriteria.cjs +0 -364
- package/dist/browser/lib/rating/criteria/scoringCriteria.cjs.map +0 -1
- package/dist/browser/lib/rating/criteria/scoringCriteria.js +0 -341
- package/dist/browser/lib/rating/criteria/scoringCriteria.js.map +0 -1
- package/dist/browser/lib/rating/index.cjs +0 -378
- package/dist/browser/lib/rating/index.cjs.map +0 -1
- package/dist/browser/lib/rating/index.js +0 -355
- package/dist/browser/lib/rating/index.js.map +0 -1
- package/dist/node/Diviner.js +0 -429
- package/dist/node/Diviner.js.map +0 -1
- package/dist/node/Diviner.mjs +0 -407
- package/dist/node/Diviner.mjs.map +0 -1
- package/dist/node/Plugin.js +0 -442
- package/dist/node/Plugin.js.map +0 -1
- package/dist/node/Plugin.mjs +0 -421
- package/dist/node/Plugin.mjs.map +0 -1
- package/dist/node/lib/index.js +0 -399
- package/dist/node/lib/index.js.map +0 -1
- package/dist/node/lib/index.mjs +0 -372
- package/dist/node/lib/index.mjs.map +0 -1
- package/dist/node/lib/rating/analyzeNft.js +0 -399
- package/dist/node/lib/rating/analyzeNft.js.map +0 -1
- package/dist/node/lib/rating/analyzeNft.mjs +0 -372
- package/dist/node/lib/rating/analyzeNft.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/index.js +0 -385
- package/dist/node/lib/rating/criteria/index.js.map +0 -1
- package/dist/node/lib/rating/criteria/index.mjs +0 -358
- package/dist/node/lib/rating/criteria/index.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/contract.js +0 -41
- package/dist/node/lib/rating/criteria/scoring/contract.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/contract.mjs +0 -16
- package/dist/node/lib/rating/criteria/scoring/contract.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/index.js +0 -406
- package/dist/node/lib/rating/criteria/scoring/index.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/index.mjs +0 -357
- package/dist/node/lib/rating/criteria/scoring/index.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/lib/index.js +0 -48
- package/dist/node/lib/rating/criteria/scoring/lib/index.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/lib/index.mjs +0 -20
- package/dist/node/lib/rating/criteria/scoring/lib/index.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.js +0 -46
- package/dist/node/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.mjs +0 -19
- package/dist/node/lib/rating/criteria/scoring/lib/isValidPositiveBigNumber.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/lib/toBigNumber.js +0 -38
- package/dist/node/lib/rating/criteria/scoring/lib/toBigNumber.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/lib/toBigNumber.mjs +0 -13
- package/dist/node/lib/rating/criteria/scoring/lib/toBigNumber.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/animationUrl.js +0 -79
- package/dist/node/lib/rating/criteria/scoring/metadata/animationUrl.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/animationUrl.mjs +0 -53
- package/dist/node/lib/rating/criteria/scoring/metadata/animationUrl.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.js +0 -112
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.mjs +0 -85
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/index.js +0 -114
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/index.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/index.mjs +0 -85
- package/dist/node/lib/rating/criteria/scoring/metadata/attributes/index.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/backgroundColor.js +0 -50
- package/dist/node/lib/rating/criteria/scoring/metadata/backgroundColor.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/backgroundColor.mjs +0 -24
- package/dist/node/lib/rating/criteria/scoring/metadata/backgroundColor.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/description.js +0 -43
- package/dist/node/lib/rating/criteria/scoring/metadata/description.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/description.mjs +0 -17
- package/dist/node/lib/rating/criteria/scoring/metadata/description.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/externalUrl.js +0 -70
- package/dist/node/lib/rating/criteria/scoring/metadata/externalUrl.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/externalUrl.mjs +0 -44
- package/dist/node/lib/rating/criteria/scoring/metadata/externalUrl.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/image.js +0 -79
- package/dist/node/lib/rating/criteria/scoring/metadata/image.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/image.mjs +0 -53
- package/dist/node/lib/rating/criteria/scoring/metadata/image.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/imageData.js +0 -56
- package/dist/node/lib/rating/criteria/scoring/metadata/imageData.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/imageData.mjs +0 -30
- package/dist/node/lib/rating/criteria/scoring/metadata/imageData.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/index.js +0 -326
- package/dist/node/lib/rating/criteria/scoring/metadata/index.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/index.mjs +0 -281
- package/dist/node/lib/rating/criteria/scoring/metadata/index.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/index.js +0 -63
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/index.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/index.mjs +0 -31
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/index.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/urlHelpers.js +0 -61
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/urlHelpers.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/urlHelpers.mjs +0 -31
- package/dist/node/lib/rating/criteria/scoring/metadata/lib/urlHelpers.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/name.js +0 -43
- package/dist/node/lib/rating/criteria/scoring/metadata/name.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/name.mjs +0 -17
- package/dist/node/lib/rating/criteria/scoring/metadata/name.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/youtubeUrl.js +0 -72
- package/dist/node/lib/rating/criteria/scoring/metadata/youtubeUrl.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/metadata/youtubeUrl.mjs +0 -46
- package/dist/node/lib/rating/criteria/scoring/metadata/youtubeUrl.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/supply.js +0 -60
- package/dist/node/lib/rating/criteria/scoring/supply.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/supply.mjs +0 -35
- package/dist/node/lib/rating/criteria/scoring/supply.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/tokenId.js +0 -60
- package/dist/node/lib/rating/criteria/scoring/tokenId.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/tokenId.mjs +0 -35
- package/dist/node/lib/rating/criteria/scoring/tokenId.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/type.js +0 -41
- package/dist/node/lib/rating/criteria/scoring/type.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoring/type.mjs +0 -16
- package/dist/node/lib/rating/criteria/scoring/type.mjs.map +0 -1
- package/dist/node/lib/rating/criteria/scoringCriteria.js +0 -385
- package/dist/node/lib/rating/criteria/scoringCriteria.js.map +0 -1
- package/dist/node/lib/rating/criteria/scoringCriteria.mjs +0 -358
- package/dist/node/lib/rating/criteria/scoringCriteria.mjs.map +0 -1
- package/dist/node/lib/rating/index.js +0 -399
- package/dist/node/lib/rating/index.js.map +0 -1
- package/dist/node/lib/rating/index.mjs +0 -372
- package/dist/node/lib/rating/index.mjs.map +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/lib/rating/criteria/scoring/metadata/externalUrl.ts
|
|
21
|
-
var externalUrl_exports = {};
|
|
22
|
-
__export(externalUrl_exports, {
|
|
23
|
-
scoreExternalUrl: () => scoreExternalUrl,
|
|
24
|
-
scoreNftExternalUrl: () => scoreNftExternalUrl
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(externalUrl_exports);
|
|
27
|
-
var import_crypto_nft_score_model = require("@xyo-network/crypto-nft-score-model");
|
|
28
|
-
|
|
29
|
-
// src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts
|
|
30
|
-
var import_url = require("@xylabs/url");
|
|
31
|
-
var web3Protocols = ["ipfs:", "ar:"];
|
|
32
|
-
var toUrl = (url) => {
|
|
33
|
-
if (!url)
|
|
34
|
-
return void 0;
|
|
35
|
-
try {
|
|
36
|
-
return new import_url.URL(url);
|
|
37
|
-
} catch (e) {
|
|
38
|
-
return void 0;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var isValidUrl = (url) => toUrl(url) !== void 0;
|
|
42
|
-
var isWeb3 = (url) => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol);
|
|
43
|
-
var isSecure = (url) => isWeb3(url) || toUrl(url)?.protocol === "https:";
|
|
44
|
-
|
|
45
|
-
// src/lib/rating/criteria/scoring/metadata/externalUrl.ts
|
|
46
|
-
var scoreNftExternalUrl = (nft) => {
|
|
47
|
-
return scoreExternalUrl(nft?.metadata?.external_url);
|
|
48
|
-
};
|
|
49
|
-
var scoreExternalUrl = (external_url) => {
|
|
50
|
-
const score = [0, 2];
|
|
51
|
-
if (external_url === void 0 || external_url === null || typeof external_url !== "string" || !isValidUrl(external_url))
|
|
52
|
-
return score;
|
|
53
|
-
(0, import_crypto_nft_score_model.incrementTotal)(score);
|
|
54
|
-
if (!isSecure(external_url))
|
|
55
|
-
return score;
|
|
56
|
-
return (0, import_crypto_nft_score_model.incrementTotal)(score);
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=externalUrl.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/lib/rating/criteria/scoring/metadata/externalUrl.ts","../../../../../../../src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts"],"sourcesContent":["import { NftInfoFields, OpenSeaNftInfoFields } from '@xyo-network/crypto-nft-payload-plugin'\nimport { incrementTotal, ScaledScore } from '@xyo-network/crypto-nft-score-model'\n\nimport { isSecure, isValidUrl } from './lib'\n\nexport const scoreNftExternalUrl = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {\n return scoreExternalUrl(nft?.metadata?.external_url)\n}\nexport const scoreExternalUrl = (external_url: unknown): ScaledScore => {\n const score: ScaledScore = [0, 2]\n if (external_url === undefined || external_url === null || typeof external_url !== 'string' || !isValidUrl(external_url)) return score\n incrementTotal(score)\n if (!isSecure(external_url)) return score\n return incrementTotal(score)\n}\n","import { URL } from '@xylabs/url'\n\nexport const web3Protocols = ['ipfs:', 'ar:']\n\nexport const toUrl = (url?: string | null): URL | undefined => {\n if (!url) return undefined\n try {\n return new URL(url)\n } catch (e) {\n return undefined\n }\n}\n\nexport const isValidUrl = (url?: string | null): boolean => toUrl(url) !== undefined\nexport const isWeb3 = (url?: string | null): boolean => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol)\nexport const isWeb2 = (url?: string | null): boolean => !isWeb3(url)\nexport const isSecure = (url?: string | null): boolean => isWeb3(url) || toUrl(url)?.protocol === 'https:'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oCAA4C;;;ACD5C,iBAAoB;AAEb,IAAM,gBAAgB,CAAC,SAAS,KAAK;AAErC,IAAM,QAAQ,CAAC,QAAyC;AAC7D,MAAI,CAAC;AAAK,WAAO;AACjB,MAAI;AACF,WAAO,IAAI,eAAI,GAAG;AAAA,EACpB,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACF;AAEO,IAAM,aAAa,CAAC,QAAiC,MAAM,GAAG,MAAM;AACpE,IAAM,SAAS,CAAC,QAAiC,cAAc,KAAK,CAAC,aAAa,aAAa,MAAM,GAAG,GAAG,QAAQ;AAEnH,IAAM,WAAW,CAAC,QAAiC,OAAO,GAAG,KAAK,MAAM,GAAG,GAAG,aAAa;;;ADX3F,IAAM,sBAAsB,CAAC,QAA2D;AAC7F,SAAO,iBAAiB,KAAK,UAAU,YAAY;AACrD;AACO,IAAM,mBAAmB,CAAC,iBAAuC;AACtE,QAAM,QAAqB,CAAC,GAAG,CAAC;AAChC,MAAI,iBAAiB,UAAa,iBAAiB,QAAQ,OAAO,iBAAiB,YAAY,CAAC,WAAW,YAAY;AAAG,WAAO;AACjI,oDAAe,KAAK;AACpB,MAAI,CAAC,SAAS,YAAY;AAAG,WAAO;AACpC,aAAO,8CAAe,KAAK;AAC7B;","names":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/lib/rating/criteria/scoring/metadata/externalUrl.ts
|
|
2
|
-
import { incrementTotal } from "@xyo-network/crypto-nft-score-model";
|
|
3
|
-
|
|
4
|
-
// src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts
|
|
5
|
-
import { URL } from "@xylabs/url";
|
|
6
|
-
var web3Protocols = ["ipfs:", "ar:"];
|
|
7
|
-
var toUrl = (url) => {
|
|
8
|
-
if (!url)
|
|
9
|
-
return void 0;
|
|
10
|
-
try {
|
|
11
|
-
return new URL(url);
|
|
12
|
-
} catch (e) {
|
|
13
|
-
return void 0;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var isValidUrl = (url) => toUrl(url) !== void 0;
|
|
17
|
-
var isWeb3 = (url) => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol);
|
|
18
|
-
var isSecure = (url) => isWeb3(url) || toUrl(url)?.protocol === "https:";
|
|
19
|
-
|
|
20
|
-
// src/lib/rating/criteria/scoring/metadata/externalUrl.ts
|
|
21
|
-
var scoreNftExternalUrl = (nft) => {
|
|
22
|
-
return scoreExternalUrl(nft?.metadata?.external_url);
|
|
23
|
-
};
|
|
24
|
-
var scoreExternalUrl = (external_url) => {
|
|
25
|
-
const score = [0, 2];
|
|
26
|
-
if (external_url === void 0 || external_url === null || typeof external_url !== "string" || !isValidUrl(external_url))
|
|
27
|
-
return score;
|
|
28
|
-
incrementTotal(score);
|
|
29
|
-
if (!isSecure(external_url))
|
|
30
|
-
return score;
|
|
31
|
-
return incrementTotal(score);
|
|
32
|
-
};
|
|
33
|
-
export {
|
|
34
|
-
scoreExternalUrl,
|
|
35
|
-
scoreNftExternalUrl
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=externalUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/lib/rating/criteria/scoring/metadata/externalUrl.ts","../../../../../../../src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts"],"sourcesContent":["import { NftInfoFields, OpenSeaNftInfoFields } from '@xyo-network/crypto-nft-payload-plugin'\nimport { incrementTotal, ScaledScore } from '@xyo-network/crypto-nft-score-model'\n\nimport { isSecure, isValidUrl } from './lib'\n\nexport const scoreNftExternalUrl = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {\n return scoreExternalUrl(nft?.metadata?.external_url)\n}\nexport const scoreExternalUrl = (external_url: unknown): ScaledScore => {\n const score: ScaledScore = [0, 2]\n if (external_url === undefined || external_url === null || typeof external_url !== 'string' || !isValidUrl(external_url)) return score\n incrementTotal(score)\n if (!isSecure(external_url)) return score\n return incrementTotal(score)\n}\n","import { URL } from '@xylabs/url'\n\nexport const web3Protocols = ['ipfs:', 'ar:']\n\nexport const toUrl = (url?: string | null): URL | undefined => {\n if (!url) return undefined\n try {\n return new URL(url)\n } catch (e) {\n return undefined\n }\n}\n\nexport const isValidUrl = (url?: string | null): boolean => toUrl(url) !== undefined\nexport const isWeb3 = (url?: string | null): boolean => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol)\nexport const isWeb2 = (url?: string | null): boolean => !isWeb3(url)\nexport const isSecure = (url?: string | null): boolean => isWeb3(url) || toUrl(url)?.protocol === 'https:'\n"],"mappings":";AACA,SAAS,sBAAmC;;;ACD5C,SAAS,WAAW;AAEb,IAAM,gBAAgB,CAAC,SAAS,KAAK;AAErC,IAAM,QAAQ,CAAC,QAAyC;AAC7D,MAAI,CAAC;AAAK,WAAO;AACjB,MAAI;AACF,WAAO,IAAI,IAAI,GAAG;AAAA,EACpB,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACF;AAEO,IAAM,aAAa,CAAC,QAAiC,MAAM,GAAG,MAAM;AACpE,IAAM,SAAS,CAAC,QAAiC,cAAc,KAAK,CAAC,aAAa,aAAa,MAAM,GAAG,GAAG,QAAQ;AAEnH,IAAM,WAAW,CAAC,QAAiC,OAAO,GAAG,KAAK,MAAM,GAAG,GAAG,aAAa;;;ADX3F,IAAM,sBAAsB,CAAC,QAA2D;AAC7F,SAAO,iBAAiB,KAAK,UAAU,YAAY;AACrD;AACO,IAAM,mBAAmB,CAAC,iBAAuC;AACtE,QAAM,QAAqB,CAAC,GAAG,CAAC;AAChC,MAAI,iBAAiB,UAAa,iBAAiB,QAAQ,OAAO,iBAAiB,YAAY,CAAC,WAAW,YAAY;AAAG,WAAO;AACjI,iBAAe,KAAK;AACpB,MAAI,CAAC,SAAS,YAAY;AAAG,WAAO;AACpC,SAAO,eAAe,KAAK;AAC7B;","names":[]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/lib/rating/criteria/scoring/metadata/image.ts
|
|
21
|
-
var image_exports = {};
|
|
22
|
-
__export(image_exports, {
|
|
23
|
-
scoreImage: () => scoreImage,
|
|
24
|
-
scoreNftImage: () => scoreNftImage
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(image_exports);
|
|
27
|
-
var import_crypto_nft_score_model = require("@xyo-network/crypto-nft-score-model");
|
|
28
|
-
|
|
29
|
-
// src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts
|
|
30
|
-
var import_url = require("@xylabs/url");
|
|
31
|
-
var web3Protocols = ["ipfs:", "ar:"];
|
|
32
|
-
var toUrl = (url) => {
|
|
33
|
-
if (!url)
|
|
34
|
-
return void 0;
|
|
35
|
-
try {
|
|
36
|
-
return new import_url.URL(url);
|
|
37
|
-
} catch (e) {
|
|
38
|
-
return void 0;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var isValidUrl = (url) => toUrl(url) !== void 0;
|
|
42
|
-
var isWeb3 = (url) => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol);
|
|
43
|
-
var isSecure = (url) => isWeb3(url) || toUrl(url)?.protocol === "https:";
|
|
44
|
-
|
|
45
|
-
// src/lib/rating/criteria/scoring/metadata/image.ts
|
|
46
|
-
var MaxPossibleImageScore = 3;
|
|
47
|
-
var scoreNftImage = (nft) => {
|
|
48
|
-
if (!nft?.metadata?.image) {
|
|
49
|
-
return nft.metadata?.image_data ? import_crypto_nft_score_model.PASS : [0, MaxPossibleImageScore];
|
|
50
|
-
} else {
|
|
51
|
-
return scoreImage(nft.metadata?.image);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var scoreImage = (image) => {
|
|
55
|
-
const score = [0, MaxPossibleImageScore];
|
|
56
|
-
if (!image || typeof image !== "string" || !isValidUrl(image))
|
|
57
|
-
return score;
|
|
58
|
-
(0, import_crypto_nft_score_model.incrementTotal)(score);
|
|
59
|
-
if (!isSecure(image))
|
|
60
|
-
return score;
|
|
61
|
-
(0, import_crypto_nft_score_model.incrementTotal)(score);
|
|
62
|
-
if (!isWeb3(image))
|
|
63
|
-
return score;
|
|
64
|
-
(0, import_crypto_nft_score_model.incrementTotal)(score);
|
|
65
|
-
return score;
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=image.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/lib/rating/criteria/scoring/metadata/image.ts","../../../../../../../src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts"],"sourcesContent":["import { NftInfoFields, OpenSeaNftInfoFields } from '@xyo-network/crypto-nft-payload-plugin'\nimport { incrementTotal, PASS, ScaledScore } from '@xyo-network/crypto-nft-score-model'\n\nimport { isSecure, isValidUrl, isWeb3 } from './lib'\n\nconst MaxPossibleImageScore = 3\n\nexport const scoreNftImage = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {\n // If there's no image data\n if (!nft?.metadata?.image) {\n // but there is image data, skip this scoring criteria, otherwise fail it completely\n return nft.metadata?.image_data ? PASS : [0, MaxPossibleImageScore]\n } else {\n return scoreImage(nft.metadata?.image)\n }\n}\n\nexport const scoreImage = (image: unknown): ScaledScore => {\n const score: ScaledScore = [0, MaxPossibleImageScore]\n if (!image || typeof image !== 'string' || !isValidUrl(image)) return score\n incrementTotal(score)\n if (!isSecure(image)) return score\n incrementTotal(score)\n if (!isWeb3(image)) return score\n incrementTotal(score)\n return score\n}\n","import { URL } from '@xylabs/url'\n\nexport const web3Protocols = ['ipfs:', 'ar:']\n\nexport const toUrl = (url?: string | null): URL | undefined => {\n if (!url) return undefined\n try {\n return new URL(url)\n } catch (e) {\n return undefined\n }\n}\n\nexport const isValidUrl = (url?: string | null): boolean => toUrl(url) !== undefined\nexport const isWeb3 = (url?: string | null): boolean => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol)\nexport const isWeb2 = (url?: string | null): boolean => !isWeb3(url)\nexport const isSecure = (url?: string | null): boolean => isWeb3(url) || toUrl(url)?.protocol === 'https:'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oCAAkD;;;ACDlD,iBAAoB;AAEb,IAAM,gBAAgB,CAAC,SAAS,KAAK;AAErC,IAAM,QAAQ,CAAC,QAAyC;AAC7D,MAAI,CAAC;AAAK,WAAO;AACjB,MAAI;AACF,WAAO,IAAI,eAAI,GAAG;AAAA,EACpB,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACF;AAEO,IAAM,aAAa,CAAC,QAAiC,MAAM,GAAG,MAAM;AACpE,IAAM,SAAS,CAAC,QAAiC,cAAc,KAAK,CAAC,aAAa,aAAa,MAAM,GAAG,GAAG,QAAQ;AAEnH,IAAM,WAAW,CAAC,QAAiC,OAAO,GAAG,KAAK,MAAM,GAAG,GAAG,aAAa;;;ADXlG,IAAM,wBAAwB;AAEvB,IAAM,gBAAgB,CAAC,QAA2D;AAEvF,MAAI,CAAC,KAAK,UAAU,OAAO;AAEzB,WAAO,IAAI,UAAU,aAAa,qCAAO,CAAC,GAAG,qBAAqB;AAAA,EACpE,OAAO;AACL,WAAO,WAAW,IAAI,UAAU,KAAK;AAAA,EACvC;AACF;AAEO,IAAM,aAAa,CAAC,UAAgC;AACzD,QAAM,QAAqB,CAAC,GAAG,qBAAqB;AACpD,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,CAAC,WAAW,KAAK;AAAG,WAAO;AACtE,oDAAe,KAAK;AACpB,MAAI,CAAC,SAAS,KAAK;AAAG,WAAO;AAC7B,oDAAe,KAAK;AACpB,MAAI,CAAC,OAAO,KAAK;AAAG,WAAO;AAC3B,oDAAe,KAAK;AACpB,SAAO;AACT;","names":[]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// src/lib/rating/criteria/scoring/metadata/image.ts
|
|
2
|
-
import { incrementTotal, PASS } from "@xyo-network/crypto-nft-score-model";
|
|
3
|
-
|
|
4
|
-
// src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts
|
|
5
|
-
import { URL } from "@xylabs/url";
|
|
6
|
-
var web3Protocols = ["ipfs:", "ar:"];
|
|
7
|
-
var toUrl = (url) => {
|
|
8
|
-
if (!url)
|
|
9
|
-
return void 0;
|
|
10
|
-
try {
|
|
11
|
-
return new URL(url);
|
|
12
|
-
} catch (e) {
|
|
13
|
-
return void 0;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var isValidUrl = (url) => toUrl(url) !== void 0;
|
|
17
|
-
var isWeb3 = (url) => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol);
|
|
18
|
-
var isSecure = (url) => isWeb3(url) || toUrl(url)?.protocol === "https:";
|
|
19
|
-
|
|
20
|
-
// src/lib/rating/criteria/scoring/metadata/image.ts
|
|
21
|
-
var MaxPossibleImageScore = 3;
|
|
22
|
-
var scoreNftImage = (nft) => {
|
|
23
|
-
if (!nft?.metadata?.image) {
|
|
24
|
-
return nft.metadata?.image_data ? PASS : [0, MaxPossibleImageScore];
|
|
25
|
-
} else {
|
|
26
|
-
return scoreImage(nft.metadata?.image);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var scoreImage = (image) => {
|
|
30
|
-
const score = [0, MaxPossibleImageScore];
|
|
31
|
-
if (!image || typeof image !== "string" || !isValidUrl(image))
|
|
32
|
-
return score;
|
|
33
|
-
incrementTotal(score);
|
|
34
|
-
if (!isSecure(image))
|
|
35
|
-
return score;
|
|
36
|
-
incrementTotal(score);
|
|
37
|
-
if (!isWeb3(image))
|
|
38
|
-
return score;
|
|
39
|
-
incrementTotal(score);
|
|
40
|
-
return score;
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
scoreImage,
|
|
44
|
-
scoreNftImage
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=image.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/lib/rating/criteria/scoring/metadata/image.ts","../../../../../../../src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts"],"sourcesContent":["import { NftInfoFields, OpenSeaNftInfoFields } from '@xyo-network/crypto-nft-payload-plugin'\nimport { incrementTotal, PASS, ScaledScore } from '@xyo-network/crypto-nft-score-model'\n\nimport { isSecure, isValidUrl, isWeb3 } from './lib'\n\nconst MaxPossibleImageScore = 3\n\nexport const scoreNftImage = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {\n // If there's no image data\n if (!nft?.metadata?.image) {\n // but there is image data, skip this scoring criteria, otherwise fail it completely\n return nft.metadata?.image_data ? PASS : [0, MaxPossibleImageScore]\n } else {\n return scoreImage(nft.metadata?.image)\n }\n}\n\nexport const scoreImage = (image: unknown): ScaledScore => {\n const score: ScaledScore = [0, MaxPossibleImageScore]\n if (!image || typeof image !== 'string' || !isValidUrl(image)) return score\n incrementTotal(score)\n if (!isSecure(image)) return score\n incrementTotal(score)\n if (!isWeb3(image)) return score\n incrementTotal(score)\n return score\n}\n","import { URL } from '@xylabs/url'\n\nexport const web3Protocols = ['ipfs:', 'ar:']\n\nexport const toUrl = (url?: string | null): URL | undefined => {\n if (!url) return undefined\n try {\n return new URL(url)\n } catch (e) {\n return undefined\n }\n}\n\nexport const isValidUrl = (url?: string | null): boolean => toUrl(url) !== undefined\nexport const isWeb3 = (url?: string | null): boolean => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol)\nexport const isWeb2 = (url?: string | null): boolean => !isWeb3(url)\nexport const isSecure = (url?: string | null): boolean => isWeb3(url) || toUrl(url)?.protocol === 'https:'\n"],"mappings":";AACA,SAAS,gBAAgB,YAAyB;;;ACDlD,SAAS,WAAW;AAEb,IAAM,gBAAgB,CAAC,SAAS,KAAK;AAErC,IAAM,QAAQ,CAAC,QAAyC;AAC7D,MAAI,CAAC;AAAK,WAAO;AACjB,MAAI;AACF,WAAO,IAAI,IAAI,GAAG;AAAA,EACpB,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACF;AAEO,IAAM,aAAa,CAAC,QAAiC,MAAM,GAAG,MAAM;AACpE,IAAM,SAAS,CAAC,QAAiC,cAAc,KAAK,CAAC,aAAa,aAAa,MAAM,GAAG,GAAG,QAAQ;AAEnH,IAAM,WAAW,CAAC,QAAiC,OAAO,GAAG,KAAK,MAAM,GAAG,GAAG,aAAa;;;ADXlG,IAAM,wBAAwB;AAEvB,IAAM,gBAAgB,CAAC,QAA2D;AAEvF,MAAI,CAAC,KAAK,UAAU,OAAO;AAEzB,WAAO,IAAI,UAAU,aAAa,OAAO,CAAC,GAAG,qBAAqB;AAAA,EACpE,OAAO;AACL,WAAO,WAAW,IAAI,UAAU,KAAK;AAAA,EACvC;AACF;AAEO,IAAM,aAAa,CAAC,UAAgC;AACzD,QAAM,QAAqB,CAAC,GAAG,qBAAqB;AACpD,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,CAAC,WAAW,KAAK;AAAG,WAAO;AACtE,iBAAe,KAAK;AACpB,MAAI,CAAC,SAAS,KAAK;AAAG,WAAO;AAC7B,iBAAe,KAAK;AACpB,MAAI,CAAC,OAAO,KAAK;AAAG,WAAO;AAC3B,iBAAe,KAAK;AACpB,SAAO;AACT;","names":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/lib/rating/criteria/scoring/metadata/imageData.ts
|
|
21
|
-
var imageData_exports = {};
|
|
22
|
-
__export(imageData_exports, {
|
|
23
|
-
scoreImageData: () => scoreImageData,
|
|
24
|
-
scoreNftImageData: () => scoreNftImageData
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(imageData_exports);
|
|
27
|
-
var import_crypto_nft_score_model = require("@xyo-network/crypto-nft-score-model");
|
|
28
|
-
var import_svg_parser = require("svg-parser");
|
|
29
|
-
var MaxPossibleImageDataScore = 1;
|
|
30
|
-
var isValidImageData = (image_data) => {
|
|
31
|
-
if (!image_data.startsWith("<svg"))
|
|
32
|
-
return false;
|
|
33
|
-
try {
|
|
34
|
-
(0, import_svg_parser.parse)(image_data);
|
|
35
|
-
return true;
|
|
36
|
-
} catch (error) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var scoreNftImageData = (nft) => {
|
|
41
|
-
if (!nft?.metadata?.image_data) {
|
|
42
|
-
return nft.metadata?.image ? import_crypto_nft_score_model.PASS : [0, MaxPossibleImageDataScore];
|
|
43
|
-
} else {
|
|
44
|
-
return scoreImageData(nft.metadata?.image_data);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
var scoreImageData = (image_data) => {
|
|
48
|
-
return !image_data || typeof image_data !== "string" || !isValidImageData(image_data) ? [0, MaxPossibleImageDataScore] : [MaxPossibleImageDataScore, MaxPossibleImageDataScore];
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=imageData.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/lib/rating/criteria/scoring/metadata/imageData.ts"],"sourcesContent":["import { NftInfoFields, OpenSeaNftInfoFields } from '@xyo-network/crypto-nft-payload-plugin'\nimport { PASS, ScaledScore } from '@xyo-network/crypto-nft-score-model'\nimport { parse } from 'svg-parser'\n\nconst MaxPossibleImageDataScore = 1\n\n// NOTE: There is probably a deeper check we can do\n// here, but this is a good start\nconst isValidImageData = (image_data: string): boolean => {\n // If it doesn't start with an svg tag, it's not an svg\n if (!image_data.startsWith('<svg')) return false\n try {\n // If it can't be parsed, it's not an svg\n parse(image_data)\n return true\n } catch (error) {\n return false\n }\n}\n\nexport const scoreNftImageData = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {\n // If there's no image data\n if (!nft?.metadata?.image_data) {\n // but there is an image, skip this scoring criteria, otherwise fail it completely\n return nft.metadata?.image ? PASS : [0, MaxPossibleImageDataScore]\n } else {\n return scoreImageData(nft.metadata?.image_data)\n }\n}\n\nexport const scoreImageData = (image_data: unknown): ScaledScore => {\n return !image_data || typeof image_data !== 'string' || !isValidImageData(image_data)\n ? [0, MaxPossibleImageDataScore]\n : [MaxPossibleImageDataScore, MaxPossibleImageDataScore]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oCAAkC;AAClC,wBAAsB;AAEtB,IAAM,4BAA4B;AAIlC,IAAM,mBAAmB,CAAC,eAAgC;AAExD,MAAI,CAAC,WAAW,WAAW,MAAM;AAAG,WAAO;AAC3C,MAAI;AAEF,iCAAM,UAAU;AAChB,WAAO;AAAA,EACT,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEO,IAAM,oBAAoB,CAAC,QAA2D;AAE3F,MAAI,CAAC,KAAK,UAAU,YAAY;AAE9B,WAAO,IAAI,UAAU,QAAQ,qCAAO,CAAC,GAAG,yBAAyB;AAAA,EACnE,OAAO;AACL,WAAO,eAAe,IAAI,UAAU,UAAU;AAAA,EAChD;AACF;AAEO,IAAM,iBAAiB,CAAC,eAAqC;AAClE,SAAO,CAAC,cAAc,OAAO,eAAe,YAAY,CAAC,iBAAiB,UAAU,IAChF,CAAC,GAAG,yBAAyB,IAC7B,CAAC,2BAA2B,yBAAyB;AAC3D;","names":[]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// src/lib/rating/criteria/scoring/metadata/imageData.ts
|
|
2
|
-
import { PASS } from "@xyo-network/crypto-nft-score-model";
|
|
3
|
-
import { parse } from "svg-parser";
|
|
4
|
-
var MaxPossibleImageDataScore = 1;
|
|
5
|
-
var isValidImageData = (image_data) => {
|
|
6
|
-
if (!image_data.startsWith("<svg"))
|
|
7
|
-
return false;
|
|
8
|
-
try {
|
|
9
|
-
parse(image_data);
|
|
10
|
-
return true;
|
|
11
|
-
} catch (error) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var scoreNftImageData = (nft) => {
|
|
16
|
-
if (!nft?.metadata?.image_data) {
|
|
17
|
-
return nft.metadata?.image ? PASS : [0, MaxPossibleImageDataScore];
|
|
18
|
-
} else {
|
|
19
|
-
return scoreImageData(nft.metadata?.image_data);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
var scoreImageData = (image_data) => {
|
|
23
|
-
return !image_data || typeof image_data !== "string" || !isValidImageData(image_data) ? [0, MaxPossibleImageDataScore] : [MaxPossibleImageDataScore, MaxPossibleImageDataScore];
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
scoreImageData,
|
|
27
|
-
scoreNftImageData
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=imageData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/lib/rating/criteria/scoring/metadata/imageData.ts"],"sourcesContent":["import { NftInfoFields, OpenSeaNftInfoFields } from '@xyo-network/crypto-nft-payload-plugin'\nimport { PASS, ScaledScore } from '@xyo-network/crypto-nft-score-model'\nimport { parse } from 'svg-parser'\n\nconst MaxPossibleImageDataScore = 1\n\n// NOTE: There is probably a deeper check we can do\n// here, but this is a good start\nconst isValidImageData = (image_data: string): boolean => {\n // If it doesn't start with an svg tag, it's not an svg\n if (!image_data.startsWith('<svg')) return false\n try {\n // If it can't be parsed, it's not an svg\n parse(image_data)\n return true\n } catch (error) {\n return false\n }\n}\n\nexport const scoreNftImageData = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {\n // If there's no image data\n if (!nft?.metadata?.image_data) {\n // but there is an image, skip this scoring criteria, otherwise fail it completely\n return nft.metadata?.image ? PASS : [0, MaxPossibleImageDataScore]\n } else {\n return scoreImageData(nft.metadata?.image_data)\n }\n}\n\nexport const scoreImageData = (image_data: unknown): ScaledScore => {\n return !image_data || typeof image_data !== 'string' || !isValidImageData(image_data)\n ? [0, MaxPossibleImageDataScore]\n : [MaxPossibleImageDataScore, MaxPossibleImageDataScore]\n}\n"],"mappings":";AACA,SAAS,YAAyB;AAClC,SAAS,aAAa;AAEtB,IAAM,4BAA4B;AAIlC,IAAM,mBAAmB,CAAC,eAAgC;AAExD,MAAI,CAAC,WAAW,WAAW,MAAM;AAAG,WAAO;AAC3C,MAAI;AAEF,UAAM,UAAU;AAChB,WAAO;AAAA,EACT,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEO,IAAM,oBAAoB,CAAC,QAA2D;AAE3F,MAAI,CAAC,KAAK,UAAU,YAAY;AAE9B,WAAO,IAAI,UAAU,QAAQ,OAAO,CAAC,GAAG,yBAAyB;AAAA,EACnE,OAAO;AACL,WAAO,eAAe,IAAI,UAAU,UAAU;AAAA,EAChD;AACF;AAEO,IAAM,iBAAiB,CAAC,eAAqC;AAClE,SAAO,CAAC,cAAc,OAAO,eAAe,YAAY,CAAC,iBAAiB,UAAU,IAChF,CAAC,GAAG,yBAAyB,IAC7B,CAAC,2BAA2B,yBAAyB;AAC3D;","names":[]}
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/lib/rating/criteria/scoring/metadata/index.ts
|
|
21
|
-
var metadata_exports = {};
|
|
22
|
-
__export(metadata_exports, {
|
|
23
|
-
evaluateAttribute: () => evaluateAttribute,
|
|
24
|
-
evaluateAttributes: () => evaluateAttributes,
|
|
25
|
-
evaluateNftAttributes: () => evaluateNftAttributes,
|
|
26
|
-
scoreAnimationUrl: () => scoreAnimationUrl,
|
|
27
|
-
scoreBackgroundColor: () => scoreBackgroundColor,
|
|
28
|
-
scoreDescription: () => scoreDescription,
|
|
29
|
-
scoreExternalUrl: () => scoreExternalUrl,
|
|
30
|
-
scoreImage: () => scoreImage,
|
|
31
|
-
scoreImageData: () => scoreImageData,
|
|
32
|
-
scoreName: () => scoreName,
|
|
33
|
-
scoreNftAnimationUrl: () => scoreNftAnimationUrl,
|
|
34
|
-
scoreNftBackgroundColor: () => scoreNftBackgroundColor,
|
|
35
|
-
scoreNftDescription: () => scoreNftDescription,
|
|
36
|
-
scoreNftExternalUrl: () => scoreNftExternalUrl,
|
|
37
|
-
scoreNftImage: () => scoreNftImage,
|
|
38
|
-
scoreNftImageData: () => scoreNftImageData,
|
|
39
|
-
scoreNftName: () => scoreNftName,
|
|
40
|
-
scoreNftYoutubeUrl: () => scoreNftYoutubeUrl,
|
|
41
|
-
scoreYoutubeUrl: () => scoreYoutubeUrl
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(metadata_exports);
|
|
44
|
-
|
|
45
|
-
// src/lib/rating/criteria/scoring/metadata/animationUrl.ts
|
|
46
|
-
var import_crypto_nft_score_model = require("@xyo-network/crypto-nft-score-model");
|
|
47
|
-
|
|
48
|
-
// src/lib/rating/criteria/scoring/metadata/lib/urlHelpers.ts
|
|
49
|
-
var import_url = require("@xylabs/url");
|
|
50
|
-
var web3Protocols = ["ipfs:", "ar:"];
|
|
51
|
-
var toUrl = (url) => {
|
|
52
|
-
if (!url)
|
|
53
|
-
return void 0;
|
|
54
|
-
try {
|
|
55
|
-
return new import_url.URL(url);
|
|
56
|
-
} catch (e) {
|
|
57
|
-
return void 0;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var isValidUrl = (url) => toUrl(url) !== void 0;
|
|
61
|
-
var isWeb3 = (url) => web3Protocols.some((protocol) => protocol === toUrl(url)?.protocol);
|
|
62
|
-
var isSecure = (url) => isWeb3(url) || toUrl(url)?.protocol === "https:";
|
|
63
|
-
|
|
64
|
-
// src/lib/rating/criteria/scoring/metadata/animationUrl.ts
|
|
65
|
-
var scoreNftAnimationUrl = (nft) => {
|
|
66
|
-
return scoreAnimationUrl(nft.metadata?.animation_url);
|
|
67
|
-
};
|
|
68
|
-
var scoreAnimationUrl = (animation_url) => {
|
|
69
|
-
const score = [0, 0];
|
|
70
|
-
if (animation_url === void 0 || animation_url === null)
|
|
71
|
-
return import_crypto_nft_score_model.PASS;
|
|
72
|
-
(0, import_crypto_nft_score_model.incrementPossible)(score);
|
|
73
|
-
if (typeof animation_url !== "string")
|
|
74
|
-
return score;
|
|
75
|
-
(0, import_crypto_nft_score_model.incrementTotalAndPossible)(score);
|
|
76
|
-
if (!isValidUrl(animation_url))
|
|
77
|
-
return score;
|
|
78
|
-
(0, import_crypto_nft_score_model.incrementTotalAndPossible)(score);
|
|
79
|
-
if (!isSecure(animation_url))
|
|
80
|
-
return score;
|
|
81
|
-
(0, import_crypto_nft_score_model.incrementTotalAndPossible)(score);
|
|
82
|
-
if (!isWeb3(animation_url))
|
|
83
|
-
return score;
|
|
84
|
-
return (0, import_crypto_nft_score_model.incrementTotal)(score);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
// src/lib/rating/criteria/scoring/metadata/attributes/evaluateAttributes.ts
|
|
88
|
-
var import_crypto_nft_score_model2 = require("@xyo-network/crypto-nft-score-model");
|
|
89
|
-
var isDate = (value) => {
|
|
90
|
-
if (isNumber(value)) {
|
|
91
|
-
try {
|
|
92
|
-
new Date(value);
|
|
93
|
-
return true;
|
|
94
|
-
} catch (error) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return false;
|
|
99
|
-
};
|
|
100
|
-
var isNumber = (value) => typeof value === "number";
|
|
101
|
-
var isPercentage = (value) => isNumber(value) && value >= 0 && value <= 100;
|
|
102
|
-
var isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
103
|
-
var isNonEmptyStringOrNumber = (value) => value === "number" || isNonEmptyString(value);
|
|
104
|
-
var evaluateNftAttributes = (nft) => !nft?.metadata?.attributes ? [0, 1] : evaluateAttributes(nft?.metadata?.attributes);
|
|
105
|
-
var evaluateAttributes = (attributes) => {
|
|
106
|
-
if (!attributes || !Array.isArray(attributes) || attributes.length === 0)
|
|
107
|
-
return [0, 1];
|
|
108
|
-
const score = [0, 0];
|
|
109
|
-
for (const attribute of attributes) {
|
|
110
|
-
const [attributeTotal, attributePossible] = evaluateAttribute(attribute);
|
|
111
|
-
(0, import_crypto_nft_score_model2.incrementTotalAndPossible)(score, attributeTotal, attributePossible);
|
|
112
|
-
}
|
|
113
|
-
return [1, 1];
|
|
114
|
-
};
|
|
115
|
-
var evaluateAttribute = (attribute) => {
|
|
116
|
-
const score = [0, 1];
|
|
117
|
-
const max_value = attribute?.max_value;
|
|
118
|
-
const trait_type = attribute?.trait_type;
|
|
119
|
-
const value = attribute?.value;
|
|
120
|
-
if (!attribute || typeof attribute !== "object" || !isNonEmptyString(trait_type) || !isNonEmptyStringOrNumber(value))
|
|
121
|
-
return score;
|
|
122
|
-
(0, import_crypto_nft_score_model2.incrementTotal)(score);
|
|
123
|
-
(0, import_crypto_nft_score_model2.incrementPossible)(score);
|
|
124
|
-
if (validDisplayType(attribute))
|
|
125
|
-
(0, import_crypto_nft_score_model2.incrementTotal)(score);
|
|
126
|
-
if (max_value !== void 0) {
|
|
127
|
-
(0, import_crypto_nft_score_model2.incrementPossible)(score);
|
|
128
|
-
if (isNumber(max_value) && isNumber(value) && value <= max_value)
|
|
129
|
-
(0, import_crypto_nft_score_model2.incrementTotal)(score);
|
|
130
|
-
}
|
|
131
|
-
return score;
|
|
132
|
-
};
|
|
133
|
-
var validDisplayType = (attribute) => {
|
|
134
|
-
switch (attribute?.display_type) {
|
|
135
|
-
case "number":
|
|
136
|
-
case "boost_number": {
|
|
137
|
-
if (isNumber(attribute?.value))
|
|
138
|
-
return true;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
case "boost_percentage": {
|
|
142
|
-
if (isPercentage(attribute?.value))
|
|
143
|
-
return true;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case "date": {
|
|
147
|
-
if (isDate(attribute?.value))
|
|
148
|
-
return true;
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
case "string":
|
|
152
|
-
case void 0: {
|
|
153
|
-
if (isNonEmptyString(attribute?.value))
|
|
154
|
-
return true;
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
default: {
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return false;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
// src/lib/rating/criteria/scoring/metadata/backgroundColor.ts
|
|
165
|
-
var import_crypto_nft_score_model3 = require("@xyo-network/crypto-nft-score-model");
|
|
166
|
-
var isHexColor = /^[0-9A-F]{6}$/i;
|
|
167
|
-
var scoreNftBackgroundColor = (nft) => {
|
|
168
|
-
return scoreBackgroundColor(nft.metadata?.background_color);
|
|
169
|
-
};
|
|
170
|
-
var scoreBackgroundColor = (background_color) => {
|
|
171
|
-
const score = [0, 0];
|
|
172
|
-
if (background_color === void 0 || background_color === null)
|
|
173
|
-
return import_crypto_nft_score_model3.PASS;
|
|
174
|
-
(0, import_crypto_nft_score_model3.incrementPossible)(score);
|
|
175
|
-
if (typeof background_color !== "string")
|
|
176
|
-
return score;
|
|
177
|
-
(0, import_crypto_nft_score_model3.incrementTotalAndPossible)(score);
|
|
178
|
-
if (!background_color.toUpperCase().match(isHexColor))
|
|
179
|
-
return score;
|
|
180
|
-
return (0, import_crypto_nft_score_model3.incrementTotal)(score);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
// src/lib/rating/criteria/scoring/metadata/description.ts
|
|
184
|
-
var import_crypto_nft_score_model4 = require("@xyo-network/crypto-nft-score-model");
|
|
185
|
-
var scoreNftDescription = (nft) => {
|
|
186
|
-
return scoreDescription(nft.metadata?.description);
|
|
187
|
-
};
|
|
188
|
-
var scoreDescription = (description) => {
|
|
189
|
-
const score = [0, 1];
|
|
190
|
-
if (!description || typeof description !== "string")
|
|
191
|
-
return score;
|
|
192
|
-
return (0, import_crypto_nft_score_model4.incrementTotal)(score);
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
// src/lib/rating/criteria/scoring/metadata/externalUrl.ts
|
|
196
|
-
var import_crypto_nft_score_model5 = require("@xyo-network/crypto-nft-score-model");
|
|
197
|
-
var scoreNftExternalUrl = (nft) => {
|
|
198
|
-
return scoreExternalUrl(nft?.metadata?.external_url);
|
|
199
|
-
};
|
|
200
|
-
var scoreExternalUrl = (external_url) => {
|
|
201
|
-
const score = [0, 2];
|
|
202
|
-
if (external_url === void 0 || external_url === null || typeof external_url !== "string" || !isValidUrl(external_url))
|
|
203
|
-
return score;
|
|
204
|
-
(0, import_crypto_nft_score_model5.incrementTotal)(score);
|
|
205
|
-
if (!isSecure(external_url))
|
|
206
|
-
return score;
|
|
207
|
-
return (0, import_crypto_nft_score_model5.incrementTotal)(score);
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
// src/lib/rating/criteria/scoring/metadata/image.ts
|
|
211
|
-
var import_crypto_nft_score_model6 = require("@xyo-network/crypto-nft-score-model");
|
|
212
|
-
var MaxPossibleImageScore = 3;
|
|
213
|
-
var scoreNftImage = (nft) => {
|
|
214
|
-
if (!nft?.metadata?.image) {
|
|
215
|
-
return nft.metadata?.image_data ? import_crypto_nft_score_model6.PASS : [0, MaxPossibleImageScore];
|
|
216
|
-
} else {
|
|
217
|
-
return scoreImage(nft.metadata?.image);
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
var scoreImage = (image) => {
|
|
221
|
-
const score = [0, MaxPossibleImageScore];
|
|
222
|
-
if (!image || typeof image !== "string" || !isValidUrl(image))
|
|
223
|
-
return score;
|
|
224
|
-
(0, import_crypto_nft_score_model6.incrementTotal)(score);
|
|
225
|
-
if (!isSecure(image))
|
|
226
|
-
return score;
|
|
227
|
-
(0, import_crypto_nft_score_model6.incrementTotal)(score);
|
|
228
|
-
if (!isWeb3(image))
|
|
229
|
-
return score;
|
|
230
|
-
(0, import_crypto_nft_score_model6.incrementTotal)(score);
|
|
231
|
-
return score;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
// src/lib/rating/criteria/scoring/metadata/imageData.ts
|
|
235
|
-
var import_crypto_nft_score_model7 = require("@xyo-network/crypto-nft-score-model");
|
|
236
|
-
var import_svg_parser = require("svg-parser");
|
|
237
|
-
var MaxPossibleImageDataScore = 1;
|
|
238
|
-
var isValidImageData = (image_data) => {
|
|
239
|
-
if (!image_data.startsWith("<svg"))
|
|
240
|
-
return false;
|
|
241
|
-
try {
|
|
242
|
-
(0, import_svg_parser.parse)(image_data);
|
|
243
|
-
return true;
|
|
244
|
-
} catch (error) {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var scoreNftImageData = (nft) => {
|
|
249
|
-
if (!nft?.metadata?.image_data) {
|
|
250
|
-
return nft.metadata?.image ? import_crypto_nft_score_model7.PASS : [0, MaxPossibleImageDataScore];
|
|
251
|
-
} else {
|
|
252
|
-
return scoreImageData(nft.metadata?.image_data);
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
var scoreImageData = (image_data) => {
|
|
256
|
-
return !image_data || typeof image_data !== "string" || !isValidImageData(image_data) ? [0, MaxPossibleImageDataScore] : [MaxPossibleImageDataScore, MaxPossibleImageDataScore];
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
// src/lib/rating/criteria/scoring/metadata/name.ts
|
|
260
|
-
var import_crypto_nft_score_model8 = require("@xyo-network/crypto-nft-score-model");
|
|
261
|
-
var scoreNftName = (nft) => {
|
|
262
|
-
return scoreName(nft.metadata?.name);
|
|
263
|
-
};
|
|
264
|
-
var scoreName = (name) => {
|
|
265
|
-
const score = [0, 1];
|
|
266
|
-
if (!name || typeof name !== "string")
|
|
267
|
-
return score;
|
|
268
|
-
return (0, import_crypto_nft_score_model8.incrementTotal)(score);
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
// src/lib/rating/criteria/scoring/metadata/youtubeUrl.ts
|
|
272
|
-
var import_crypto_nft_score_model9 = require("@xyo-network/crypto-nft-score-model");
|
|
273
|
-
var scoreNftYoutubeUrl = (nft) => {
|
|
274
|
-
return scoreYoutubeUrl(nft?.metadata?.youtube_url);
|
|
275
|
-
};
|
|
276
|
-
var scoreYoutubeUrl = (youtube_url) => {
|
|
277
|
-
if (youtube_url === void 0 || youtube_url === null)
|
|
278
|
-
return import_crypto_nft_score_model9.PASS;
|
|
279
|
-
const score = [0, 2];
|
|
280
|
-
if (typeof youtube_url !== "string" || !isValidUrl(youtube_url))
|
|
281
|
-
return score;
|
|
282
|
-
(0, import_crypto_nft_score_model9.incrementTotal)(score);
|
|
283
|
-
if (!isSecure(youtube_url))
|
|
284
|
-
return score;
|
|
285
|
-
return (0, import_crypto_nft_score_model9.incrementTotal)(score);
|
|
286
|
-
};
|
|
287
|
-
//# sourceMappingURL=index.cjs.map
|