emblem-vault-sdk 1.4.0 → 1.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/dist/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.0';
684215
+ const SDK_VERSION = '1.4.1';
684216
684216
  class EmblemVaultSDK {
684217
684217
  constructor(apiKey, baseUrl) {
684218
684218
  this.apiKey = apiKey;
@@ -684243,10 +684243,11 @@ class EmblemVaultSDK {
684243
684243
  }
684244
684244
  // ** Curated **
684245
684245
  //
684246
- fetchCuratedContracts(hideUnMintable = false) {
684246
+ fetchCuratedContracts(hideUnMintable = false, overrideFunc = false) {
684247
684247
  return __awaiter(this, void 0, void 0, function* () {
684248
684248
  let url = `${this.baseUrl}/curated`;
684249
- let data = yield (0, utils_1.fetchData)(url, this.apiKey);
684249
+ // Fetch using URL or override function
684250
+ let data = typeof overrideFunc === 'function' ? yield overrideFunc() : yield (0, utils_1.fetchData)(url, this.apiKey);
684250
684251
  // Filter out collections that are not mintable
684251
684252
  data = hideUnMintable ? data.filter((collection) => collection.mintable) : data;
684252
684253
  // Sort the data by the name property in ascending order
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.0';
684215
+ const SDK_VERSION = '1.4.1';
684216
684216
  class EmblemVaultSDK {
684217
684217
  constructor(apiKey, baseUrl) {
684218
684218
  this.apiKey = apiKey;
@@ -684243,10 +684243,11 @@ class EmblemVaultSDK {
684243
684243
  }
684244
684244
  // ** Curated **
684245
684245
  //
684246
- fetchCuratedContracts(hideUnMintable = false) {
684246
+ fetchCuratedContracts(hideUnMintable = false, overrideFunc = false) {
684247
684247
  return __awaiter(this, void 0, void 0, function* () {
684248
684248
  let url = `${this.baseUrl}/curated`;
684249
- let data = yield (0, utils_1.fetchData)(url, this.apiKey);
684249
+ // Fetch using URL or override function
684250
+ let data = typeof overrideFunc === 'function' ? yield overrideFunc() : yield (0, utils_1.fetchData)(url, this.apiKey);
684250
684251
  // Filter out collections that are not mintable
684251
684252
  data = hideUnMintable ? data.filter((collection) => collection.mintable) : data;
684252
684253
  // Sort the data by the name property in ascending order
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -37,10 +37,10 @@ class EmblemVaultSDK {
37
37
 
38
38
  // ** Curated **
39
39
  //
40
- async fetchCuratedContracts(hideUnMintable: boolean = false): Promise<CuratedCollectionsResponse> {
40
+ async fetchCuratedContracts(hideUnMintable: boolean = false, overrideFunc: Function | boolean = false): Promise<CuratedCollectionsResponse> {
41
41
  let url = `${this.baseUrl}/curated`;
42
- let data = await fetchData(url, this.apiKey);
43
-
42
+ // Fetch using URL or override function
43
+ let data = typeof overrideFunc === 'function' ? await overrideFunc() : await fetchData(url, this.apiKey);
44
44
  // Filter out collections that are not mintable
45
45
  data = hideUnMintable? data.filter((collection: Collection) => collection.mintable): data;
46
46
 
@@ -50,7 +50,7 @@ class EmblemVaultSDK {
50
50
  .map((item: any) => {
51
51
  const template = generateTemplate(item);
52
52
  // Return a new object that combines the properties of the item and the template
53
- return { ...item, ...template };
53
+ return { ...item, ...template };
54
54
  });
55
55
  return data
56
56
  }