emblem-vault-sdk 1.4.1 → 1.4.3
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/bundle.js +8 -3
- package/dist/curated/metadata.json +684176 -0
- package/dist/index.js +109 -18
- package/dist/utils.js +514 -0
- package/docs/bundle.js +8 -3
- package/docs/index.html +1 -1
- package/package.json +2 -2
- package/readme.md +1 -0
- package/script/version.js +1 -1
- package/src/index.ts +7 -2
- package/tsconfig.json +1 -1
package/docs/bundle.js
CHANGED
|
@@ -684212,7 +684212,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
684212
684212
|
};
|
|
684213
684213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
684214
684214
|
const utils_1 = require("./utils");
|
|
684215
|
-
const SDK_VERSION = '1.4.
|
|
684215
|
+
const SDK_VERSION = '1.4.2';
|
|
684216
684216
|
class EmblemVaultSDK {
|
|
684217
684217
|
constructor(apiKey, baseUrl) {
|
|
684218
684218
|
this.apiKey = apiKey;
|
|
@@ -684243,7 +684243,7 @@ class EmblemVaultSDK {
|
|
|
684243
684243
|
}
|
|
684244
684244
|
// ** Curated **
|
|
684245
684245
|
//
|
|
684246
|
-
|
|
684246
|
+
fetchCuratedContractsz(hideUnMintable = false, overrideFunc = false) {
|
|
684247
684247
|
return __awaiter(this, void 0, void 0, function* () {
|
|
684248
684248
|
let url = `${this.baseUrl}/curated`;
|
|
684249
684249
|
// Fetch using URL or override function
|
|
@@ -684255,8 +684255,13 @@ class EmblemVaultSDK {
|
|
|
684255
684255
|
// Map over the sorted data and generate a template for each item
|
|
684256
684256
|
.map((item) => {
|
|
684257
684257
|
const template = (0, utils_1.generateTemplate)(item);
|
|
684258
|
+
Object.keys(template).forEach(key => {
|
|
684259
|
+
if (key != 'id' && key != 'created_at' && key != 'contracts' && key != 'imageHandler' && key != 'placeholderImages' && key != 'loadingImages')
|
|
684260
|
+
item[key] = template[key];
|
|
684261
|
+
});
|
|
684258
684262
|
// Return a new object that combines the properties of the item and the template
|
|
684259
|
-
return
|
|
684263
|
+
// return { ...item, ...template };
|
|
684264
|
+
return item;
|
|
684260
684265
|
});
|
|
684261
684266
|
return data;
|
|
684262
684267
|
});
|
package/docs/index.html
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
function generateDropdown(curatedContracts) {
|
|
27
27
|
const selectElement = function () { return document.getElementById('contractSelect') }
|
|
28
28
|
let hide = document.getElementById('hideNotMintableCheckbox').checked
|
|
29
|
-
while (selectElement().firstChild) {
|
|
29
|
+
while (selectElement().firstChild) {
|
|
30
30
|
selectElement().removeChild(selectElement().firstChild);
|
|
31
31
|
}
|
|
32
32
|
const defaultOptionElement = document.createElement('option');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emblem-vault-sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"test:all": "npm run test:node && npm run test:browser",
|
|
14
14
|
"build": "tsc && npm run postbuild",
|
|
15
15
|
"postbuild": "node ./script/version.js",
|
|
16
|
-
"bundle": "npm run build && browserify
|
|
16
|
+
"bundle": "npm run build && browserify dist/index.js -o dist/bundle.js && cp dist/bundle.js docs/bundle.js",
|
|
17
17
|
"watch": "onchange 'src/*.ts' -- npm run bundle"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [],
|
package/readme.md
CHANGED
|
@@ -11,6 +11,7 @@ npm i emblem-vault-sdk
|
|
|
11
11
|
## Getting Started
|
|
12
12
|
```
|
|
13
13
|
const EmblemVaultSDK = require('emblem-vault-sdk');
|
|
14
|
+
// import EmblemVaultSDK from 'emblem-vault-sdk'
|
|
14
15
|
const apiKey = 'YOUR_API_KEY'; // replace with your actual API key
|
|
15
16
|
|
|
16
17
|
const sdk = new EmblemVaultSDK(apiKey);
|
package/script/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const packageJson = require('../package.json');
|
|
3
3
|
|
|
4
|
-
const sdkFile = './
|
|
4
|
+
const sdkFile = './dist/index.js'; // Adjust the path as necessary
|
|
5
5
|
let sdkCode = fs.readFileSync(sdkFile, 'utf8');
|
|
6
6
|
sdkCode = sdkCode.replace('__SDK_VERSION__', packageJson.version);
|
|
7
7
|
|
package/src/index.ts
CHANGED
|
@@ -37,7 +37,7 @@ class EmblemVaultSDK {
|
|
|
37
37
|
|
|
38
38
|
// ** Curated **
|
|
39
39
|
//
|
|
40
|
-
async
|
|
40
|
+
async fetchCuratedContractsz(hideUnMintable: boolean = false, overrideFunc: Function | boolean = false): Promise<CuratedCollectionsResponse> {
|
|
41
41
|
let url = `${this.baseUrl}/curated`;
|
|
42
42
|
// Fetch using URL or override function
|
|
43
43
|
let data = typeof overrideFunc === 'function' ? await overrideFunc() : await fetchData(url, this.apiKey);
|
|
@@ -49,8 +49,13 @@ class EmblemVaultSDK {
|
|
|
49
49
|
// Map over the sorted data and generate a template for each item
|
|
50
50
|
.map((item: any) => {
|
|
51
51
|
const template = generateTemplate(item);
|
|
52
|
+
Object.keys(template).forEach(key => {
|
|
53
|
+
if (key != 'id' && key != 'created_at' && key != 'contracts' && key != 'imageHandler' && key != 'placeholderImages' && key != 'loadingImages' )
|
|
54
|
+
item[key] = template[key];
|
|
55
|
+
});
|
|
52
56
|
// Return a new object that combines the properties of the item and the template
|
|
53
|
-
return { ...item, ...template };
|
|
57
|
+
// return { ...item, ...template };
|
|
58
|
+
return item;
|
|
54
59
|
});
|
|
55
60
|
return data
|
|
56
61
|
}
|
package/tsconfig.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"strict": true, /* Enable all strict type-checking options. */
|
|
8
8
|
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
9
9
|
"resolveJsonModule": true, /* Include this to allow importing of .json files. */
|
|
10
|
-
"outDir": "./
|
|
10
|
+
"outDir": "./dist" /* Redirect output structure to the directory. */
|
|
11
11
|
},
|
|
12
12
|
"exclude": ["**/*.test.ts"]
|
|
13
13
|
}
|