emblem-vault-sdk 1.7.0 → 1.7.2

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
@@ -684293,7 +684293,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
684293
684293
  Object.defineProperty(exports, "__esModule", { value: true });
684294
684294
  const bignumber_1 = require("@ethersproject/bignumber");
684295
684295
  const utils_1 = require("./utils");
684296
- const SDK_VERSION = '1.7.0';
684296
+ const SDK_VERSION = '1.7.2';
684297
684297
  class EmblemVaultSDK {
684298
684298
  constructor(apiKey, baseUrl) {
684299
684299
  this.apiKey = apiKey;
@@ -684750,6 +684750,12 @@ function generateTemplate(record) {
684750
684750
  else if (recordName == "Embels") {
684751
684751
  allowed = true;
684752
684752
  }
684753
+ else if (_this.vaultCollectionType && _this.vaultCollectionType == "protocol") {
684754
+ allowed = data && data[0].coin == _this.collectionChain;
684755
+ }
684756
+ else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection") {
684757
+ allowed = data && data[0].coin == _this.collectionChain && data[0].project == _this.name;
684758
+ }
684753
684759
  else { // XCP
684754
684760
  allowed = data[0].project == _this.name && data[0].balance == 1;
684755
684761
  }
@@ -684793,6 +684799,9 @@ function generateTemplate(record) {
684793
684799
  else if (recordName == "Embels") {
684794
684800
  allowedName = true;
684795
684801
  }
684802
+ else if (recordName == "BitcoinOrdinals" || recordName == "BitcoinPunks" || recordName == "filthyFiat" || recordName == "Megapunks" || recordName == "TwelveFold" || recordName == "Bitcoin DeGods" || recordName == "Bitcoin Frogs" || recordName == "Ordinal Maxi Biz" || recordName == "NodeMonkes" || recordName == "Bitmap" || recordName == "Ordinal Punks" || recordName == "Bitcoin Rocks" || recordName == "OnChainMonkey (OCM) Dimentions") {
684803
+ allowedName = true;
684804
+ }
684796
684805
  else { // XCP
684797
684806
  let curatedItemFound = exports.NFT_DATA[asset];
684798
684807
  allowedName = asset && curatedItemFound ? true : false;
@@ -685032,9 +685041,9 @@ function checkContentType(url) {
685032
685041
  fetch(url, { method: 'HEAD' })
685033
685042
  .then(response => {
685034
685043
  if (!response.ok) {
685035
- throw new Error('Network response was not ok');
685044
+ returnVal.valid = false;
685036
685045
  }
685037
- if (response.status === 200) {
685046
+ else if (response.status === 200) {
685038
685047
  const contentType = response.headers.get('content-type');
685039
685048
  let extension = getFileExtensionFromMimeType(contentType);
685040
685049
  returnVal.valid = true;
@@ -685042,11 +685051,8 @@ function checkContentType(url) {
685042
685051
  returnVal.extension = extension;
685043
685052
  returnVal.embed = !isValidDirect(extension);
685044
685053
  console.log('Content-Type:', contentType);
685045
- resolve(returnVal);
685046
- }
685047
- else {
685048
- resolve(returnVal);
685049
685054
  }
685055
+ resolve(returnVal);
685050
685056
  })
685051
685057
  .catch(error => {
685052
685058
  console.error('Error while fetching URL:', error);
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  const bignumber_1 = require("@ethersproject/bignumber");
36
36
  const utils_1 = require("./utils");
37
- const SDK_VERSION = '1.7.0';
37
+ const SDK_VERSION = '1.7.2';
38
38
  class EmblemVaultSDK {
39
39
  constructor(apiKey, baseUrl) {
40
40
  this.apiKey = apiKey;
package/dist/utils.js CHANGED
@@ -250,6 +250,12 @@ function generateTemplate(record) {
250
250
  else if (recordName == "Embels") {
251
251
  allowed = true;
252
252
  }
253
+ else if (_this.vaultCollectionType && _this.vaultCollectionType == "protocol") {
254
+ allowed = data && data[0].coin == _this.collectionChain;
255
+ }
256
+ else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection") {
257
+ allowed = data && data[0].coin == _this.collectionChain && data[0].project == _this.name;
258
+ }
253
259
  else { // XCP
254
260
  allowed = data[0].project == _this.name && data[0].balance == 1;
255
261
  }
@@ -293,6 +299,9 @@ function generateTemplate(record) {
293
299
  else if (recordName == "Embels") {
294
300
  allowedName = true;
295
301
  }
302
+ else if (recordName == "BitcoinOrdinals" || recordName == "BitcoinPunks" || recordName == "filthyFiat" || recordName == "Megapunks" || recordName == "TwelveFold" || recordName == "Bitcoin DeGods" || recordName == "Bitcoin Frogs" || recordName == "Ordinal Maxi Biz" || recordName == "NodeMonkes" || recordName == "Bitmap" || recordName == "Ordinal Punks" || recordName == "Bitcoin Rocks" || recordName == "OnChainMonkey (OCM) Dimentions") {
303
+ allowedName = true;
304
+ }
296
305
  else { // XCP
297
306
  let curatedItemFound = exports.NFT_DATA[asset];
298
307
  allowedName = asset && curatedItemFound ? true : false;
@@ -532,9 +541,9 @@ function checkContentType(url) {
532
541
  fetch(url, { method: 'HEAD' })
533
542
  .then(response => {
534
543
  if (!response.ok) {
535
- throw new Error('Network response was not ok');
544
+ returnVal.valid = false;
536
545
  }
537
- if (response.status === 200) {
546
+ else if (response.status === 200) {
538
547
  const contentType = response.headers.get('content-type');
539
548
  let extension = getFileExtensionFromMimeType(contentType);
540
549
  returnVal.valid = true;
@@ -542,11 +551,8 @@ function checkContentType(url) {
542
551
  returnVal.extension = extension;
543
552
  returnVal.embed = !isValidDirect(extension);
544
553
  console.log('Content-Type:', contentType);
545
- resolve(returnVal);
546
- }
547
- else {
548
- resolve(returnVal);
549
554
  }
555
+ resolve(returnVal);
550
556
  })
551
557
  .catch(error => {
552
558
  console.error('Error while fetching URL:', error);
package/docs/bundle.js CHANGED
@@ -684293,7 +684293,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
684293
684293
  Object.defineProperty(exports, "__esModule", { value: true });
684294
684294
  const bignumber_1 = require("@ethersproject/bignumber");
684295
684295
  const utils_1 = require("./utils");
684296
- const SDK_VERSION = '1.7.0';
684296
+ const SDK_VERSION = '1.7.2';
684297
684297
  class EmblemVaultSDK {
684298
684298
  constructor(apiKey, baseUrl) {
684299
684299
  this.apiKey = apiKey;
@@ -684750,6 +684750,12 @@ function generateTemplate(record) {
684750
684750
  else if (recordName == "Embels") {
684751
684751
  allowed = true;
684752
684752
  }
684753
+ else if (_this.vaultCollectionType && _this.vaultCollectionType == "protocol") {
684754
+ allowed = data && data[0].coin == _this.collectionChain;
684755
+ }
684756
+ else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection") {
684757
+ allowed = data && data[0].coin == _this.collectionChain && data[0].project == _this.name;
684758
+ }
684753
684759
  else { // XCP
684754
684760
  allowed = data[0].project == _this.name && data[0].balance == 1;
684755
684761
  }
@@ -684793,6 +684799,9 @@ function generateTemplate(record) {
684793
684799
  else if (recordName == "Embels") {
684794
684800
  allowedName = true;
684795
684801
  }
684802
+ else if (recordName == "BitcoinOrdinals" || recordName == "BitcoinPunks" || recordName == "filthyFiat" || recordName == "Megapunks" || recordName == "TwelveFold" || recordName == "Bitcoin DeGods" || recordName == "Bitcoin Frogs" || recordName == "Ordinal Maxi Biz" || recordName == "NodeMonkes" || recordName == "Bitmap" || recordName == "Ordinal Punks" || recordName == "Bitcoin Rocks" || recordName == "OnChainMonkey (OCM) Dimentions") {
684803
+ allowedName = true;
684804
+ }
684796
684805
  else { // XCP
684797
684806
  let curatedItemFound = exports.NFT_DATA[asset];
684798
684807
  allowedName = asset && curatedItemFound ? true : false;
@@ -685032,9 +685041,9 @@ function checkContentType(url) {
685032
685041
  fetch(url, { method: 'HEAD' })
685033
685042
  .then(response => {
685034
685043
  if (!response.ok) {
685035
- throw new Error('Network response was not ok');
685044
+ returnVal.valid = false;
685036
685045
  }
685037
- if (response.status === 200) {
685046
+ else if (response.status === 200) {
685038
685047
  const contentType = response.headers.get('content-type');
685039
685048
  let extension = getFileExtensionFromMimeType(contentType);
685040
685049
  returnVal.valid = true;
@@ -685042,11 +685051,8 @@ function checkContentType(url) {
685042
685051
  returnVal.extension = extension;
685043
685052
  returnVal.embed = !isValidDirect(extension);
685044
685053
  console.log('Content-Type:', contentType);
685045
- resolve(returnVal);
685046
- }
685047
- else {
685048
- resolve(returnVal);
685049
685054
  }
685055
+ resolve(returnVal);
685050
685056
  })
685051
685057
  .catch(error => {
685052
685058
  console.error('Error while fetching URL:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Emble Vault Software Development Kit",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/utils.ts CHANGED
@@ -222,6 +222,10 @@ export function generateTemplate(record: any) {
222
222
  allowed = data && record.nativeAssets.includes(data[0].coin) ? true: false
223
223
  } else if (recordName == "Embels"){
224
224
  allowed = true
225
+ } else if (_this.vaultCollectionType && _this.vaultCollectionType == "protocol") {
226
+ allowed = data && data[0].coin ==_this.collectionChain
227
+ } else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection" ) {
228
+ allowed = data && data[0].coin == _this.collectionChain && data[0].project == _this.name
225
229
  } else { // XCP
226
230
  allowed = data[0].project == _this.name && data[0].balance == 1;
227
231
  }
@@ -255,6 +259,8 @@ export function generateTemplate(record: any) {
255
259
  allowedName = asset? true: false
256
260
  } else if (recordName == "Embels"){
257
261
  allowedName = true
262
+ } else if (recordName == "BitcoinOrdinals" || recordName == "BitcoinPunks" || recordName == "filthyFiat" || recordName == "Megapunks" || recordName == "TwelveFold" || recordName == "Bitcoin DeGods" || recordName == "Bitcoin Frogs" || recordName == "Ordinal Maxi Biz" || recordName == "NodeMonkes" || recordName == "Bitmap" || recordName == "Ordinal Punks" || recordName == "Bitcoin Rocks" || recordName == "OnChainMonkey (OCM) Dimentions") {
263
+ allowedName = true
258
264
  } else { // XCP
259
265
  let curatedItemFound = NFT_DATA[asset];
260
266
  allowedName = asset && curatedItemFound ? true : false;
@@ -494,10 +500,9 @@ export function checkContentType(url: string) {
494
500
  fetch(url, { method: 'HEAD' })
495
501
  .then(response => {
496
502
  if (!response.ok) {
497
- throw new Error('Network response was not ok');
498
- }
499
-
500
- if (response.status === 200) {
503
+ returnVal.valid = false
504
+ }
505
+ else if (response.status === 200) {
501
506
  const contentType = response.headers.get('content-type');
502
507
  let extension = getFileExtensionFromMimeType(contentType)
503
508
  returnVal.valid = true
@@ -505,10 +510,8 @@ export function checkContentType(url: string) {
505
510
  returnVal.extension = extension
506
511
  returnVal.embed = !isValidDirect(extension)
507
512
  console.log('Content-Type:', contentType);
508
- resolve(returnVal);
509
- } else {
510
- resolve(returnVal);
511
- }
513
+ }
514
+ resolve(returnVal);
512
515
  })
513
516
  .catch(error => {
514
517
  console.error('Error while fetching URL:', error);