emblem-vault-sdk 1.7.0 → 1.7.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 +10 -7
- package/dist/index.js +1 -1
- package/dist/utils.js +9 -6
- package/docs/bundle.js +10 -7
- package/package.json +1 -1
- package/src/utils.ts +9 -8
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.
|
|
684296
|
+
const SDK_VERSION = '1.7.1';
|
|
684297
684297
|
class EmblemVaultSDK {
|
|
684298
684298
|
constructor(apiKey, baseUrl) {
|
|
684299
684299
|
this.apiKey = apiKey;
|
|
@@ -684750,6 +684750,9 @@ function generateTemplate(record) {
|
|
|
684750
684750
|
else if (recordName == "Embels") {
|
|
684751
684751
|
allowed = true;
|
|
684752
684752
|
}
|
|
684753
|
+
else if (recordName == "BitcoinOrdinals ") {
|
|
684754
|
+
allowed = data && data[0].coin == "ordinalsbtc";
|
|
684755
|
+
}
|
|
684753
684756
|
else { // XCP
|
|
684754
684757
|
allowed = data[0].project == _this.name && data[0].balance == 1;
|
|
684755
684758
|
}
|
|
@@ -684793,6 +684796,9 @@ function generateTemplate(record) {
|
|
|
684793
684796
|
else if (recordName == "Embels") {
|
|
684794
684797
|
allowedName = true;
|
|
684795
684798
|
}
|
|
684799
|
+
else if (recordName == "BitcoinOrdinals") {
|
|
684800
|
+
allowedName = true;
|
|
684801
|
+
}
|
|
684796
684802
|
else { // XCP
|
|
684797
684803
|
let curatedItemFound = exports.NFT_DATA[asset];
|
|
684798
684804
|
allowedName = asset && curatedItemFound ? true : false;
|
|
@@ -685032,9 +685038,9 @@ function checkContentType(url) {
|
|
|
685032
685038
|
fetch(url, { method: 'HEAD' })
|
|
685033
685039
|
.then(response => {
|
|
685034
685040
|
if (!response.ok) {
|
|
685035
|
-
|
|
685041
|
+
returnVal.valid = false;
|
|
685036
685042
|
}
|
|
685037
|
-
if (response.status === 200) {
|
|
685043
|
+
else if (response.status === 200) {
|
|
685038
685044
|
const contentType = response.headers.get('content-type');
|
|
685039
685045
|
let extension = getFileExtensionFromMimeType(contentType);
|
|
685040
685046
|
returnVal.valid = true;
|
|
@@ -685042,11 +685048,8 @@ function checkContentType(url) {
|
|
|
685042
685048
|
returnVal.extension = extension;
|
|
685043
685049
|
returnVal.embed = !isValidDirect(extension);
|
|
685044
685050
|
console.log('Content-Type:', contentType);
|
|
685045
|
-
resolve(returnVal);
|
|
685046
|
-
}
|
|
685047
|
-
else {
|
|
685048
|
-
resolve(returnVal);
|
|
685049
685051
|
}
|
|
685052
|
+
resolve(returnVal);
|
|
685050
685053
|
})
|
|
685051
685054
|
.catch(error => {
|
|
685052
685055
|
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.
|
|
37
|
+
const SDK_VERSION = '1.7.1';
|
|
38
38
|
class EmblemVaultSDK {
|
|
39
39
|
constructor(apiKey, baseUrl) {
|
|
40
40
|
this.apiKey = apiKey;
|
package/dist/utils.js
CHANGED
|
@@ -250,6 +250,9 @@ function generateTemplate(record) {
|
|
|
250
250
|
else if (recordName == "Embels") {
|
|
251
251
|
allowed = true;
|
|
252
252
|
}
|
|
253
|
+
else if (recordName == "BitcoinOrdinals ") {
|
|
254
|
+
allowed = data && data[0].coin == "ordinalsbtc";
|
|
255
|
+
}
|
|
253
256
|
else { // XCP
|
|
254
257
|
allowed = data[0].project == _this.name && data[0].balance == 1;
|
|
255
258
|
}
|
|
@@ -293,6 +296,9 @@ function generateTemplate(record) {
|
|
|
293
296
|
else if (recordName == "Embels") {
|
|
294
297
|
allowedName = true;
|
|
295
298
|
}
|
|
299
|
+
else if (recordName == "BitcoinOrdinals") {
|
|
300
|
+
allowedName = true;
|
|
301
|
+
}
|
|
296
302
|
else { // XCP
|
|
297
303
|
let curatedItemFound = exports.NFT_DATA[asset];
|
|
298
304
|
allowedName = asset && curatedItemFound ? true : false;
|
|
@@ -532,9 +538,9 @@ function checkContentType(url) {
|
|
|
532
538
|
fetch(url, { method: 'HEAD' })
|
|
533
539
|
.then(response => {
|
|
534
540
|
if (!response.ok) {
|
|
535
|
-
|
|
541
|
+
returnVal.valid = false;
|
|
536
542
|
}
|
|
537
|
-
if (response.status === 200) {
|
|
543
|
+
else if (response.status === 200) {
|
|
538
544
|
const contentType = response.headers.get('content-type');
|
|
539
545
|
let extension = getFileExtensionFromMimeType(contentType);
|
|
540
546
|
returnVal.valid = true;
|
|
@@ -542,11 +548,8 @@ function checkContentType(url) {
|
|
|
542
548
|
returnVal.extension = extension;
|
|
543
549
|
returnVal.embed = !isValidDirect(extension);
|
|
544
550
|
console.log('Content-Type:', contentType);
|
|
545
|
-
resolve(returnVal);
|
|
546
|
-
}
|
|
547
|
-
else {
|
|
548
|
-
resolve(returnVal);
|
|
549
551
|
}
|
|
552
|
+
resolve(returnVal);
|
|
550
553
|
})
|
|
551
554
|
.catch(error => {
|
|
552
555
|
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.
|
|
684296
|
+
const SDK_VERSION = '1.7.1';
|
|
684297
684297
|
class EmblemVaultSDK {
|
|
684298
684298
|
constructor(apiKey, baseUrl) {
|
|
684299
684299
|
this.apiKey = apiKey;
|
|
@@ -684750,6 +684750,9 @@ function generateTemplate(record) {
|
|
|
684750
684750
|
else if (recordName == "Embels") {
|
|
684751
684751
|
allowed = true;
|
|
684752
684752
|
}
|
|
684753
|
+
else if (recordName == "BitcoinOrdinals ") {
|
|
684754
|
+
allowed = data && data[0].coin == "ordinalsbtc";
|
|
684755
|
+
}
|
|
684753
684756
|
else { // XCP
|
|
684754
684757
|
allowed = data[0].project == _this.name && data[0].balance == 1;
|
|
684755
684758
|
}
|
|
@@ -684793,6 +684796,9 @@ function generateTemplate(record) {
|
|
|
684793
684796
|
else if (recordName == "Embels") {
|
|
684794
684797
|
allowedName = true;
|
|
684795
684798
|
}
|
|
684799
|
+
else if (recordName == "BitcoinOrdinals") {
|
|
684800
|
+
allowedName = true;
|
|
684801
|
+
}
|
|
684796
684802
|
else { // XCP
|
|
684797
684803
|
let curatedItemFound = exports.NFT_DATA[asset];
|
|
684798
684804
|
allowedName = asset && curatedItemFound ? true : false;
|
|
@@ -685032,9 +685038,9 @@ function checkContentType(url) {
|
|
|
685032
685038
|
fetch(url, { method: 'HEAD' })
|
|
685033
685039
|
.then(response => {
|
|
685034
685040
|
if (!response.ok) {
|
|
685035
|
-
|
|
685041
|
+
returnVal.valid = false;
|
|
685036
685042
|
}
|
|
685037
|
-
if (response.status === 200) {
|
|
685043
|
+
else if (response.status === 200) {
|
|
685038
685044
|
const contentType = response.headers.get('content-type');
|
|
685039
685045
|
let extension = getFileExtensionFromMimeType(contentType);
|
|
685040
685046
|
returnVal.valid = true;
|
|
@@ -685042,11 +685048,8 @@ function checkContentType(url) {
|
|
|
685042
685048
|
returnVal.extension = extension;
|
|
685043
685049
|
returnVal.embed = !isValidDirect(extension);
|
|
685044
685050
|
console.log('Content-Type:', contentType);
|
|
685045
|
-
resolve(returnVal);
|
|
685046
|
-
}
|
|
685047
|
-
else {
|
|
685048
|
-
resolve(returnVal);
|
|
685049
685051
|
}
|
|
685052
|
+
resolve(returnVal);
|
|
685050
685053
|
})
|
|
685051
685054
|
.catch(error => {
|
|
685052
685055
|
console.error('Error while fetching URL:', error);
|
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -222,6 +222,8 @@ 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 (recordName == "BitcoinOrdinals ") {
|
|
226
|
+
allowed = data && data[0].coin == "ordinalsbtc"
|
|
225
227
|
} else { // XCP
|
|
226
228
|
allowed = data[0].project == _this.name && data[0].balance == 1;
|
|
227
229
|
}
|
|
@@ -255,6 +257,8 @@ export function generateTemplate(record: any) {
|
|
|
255
257
|
allowedName = asset? true: false
|
|
256
258
|
} else if (recordName == "Embels"){
|
|
257
259
|
allowedName = true
|
|
260
|
+
} else if (recordName == "BitcoinOrdinals"){
|
|
261
|
+
allowedName = true
|
|
258
262
|
} else { // XCP
|
|
259
263
|
let curatedItemFound = NFT_DATA[asset];
|
|
260
264
|
allowedName = asset && curatedItemFound ? true : false;
|
|
@@ -494,10 +498,9 @@ export function checkContentType(url: string) {
|
|
|
494
498
|
fetch(url, { method: 'HEAD' })
|
|
495
499
|
.then(response => {
|
|
496
500
|
if (!response.ok) {
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
if (response.status === 200) {
|
|
501
|
+
returnVal.valid = false
|
|
502
|
+
}
|
|
503
|
+
else if (response.status === 200) {
|
|
501
504
|
const contentType = response.headers.get('content-type');
|
|
502
505
|
let extension = getFileExtensionFromMimeType(contentType)
|
|
503
506
|
returnVal.valid = true
|
|
@@ -505,10 +508,8 @@ export function checkContentType(url: string) {
|
|
|
505
508
|
returnVal.extension = extension
|
|
506
509
|
returnVal.embed = !isValidDirect(extension)
|
|
507
510
|
console.log('Content-Type:', contentType);
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
resolve(returnVal);
|
|
511
|
-
}
|
|
511
|
+
}
|
|
512
|
+
resolve(returnVal);
|
|
512
513
|
})
|
|
513
514
|
.catch(error => {
|
|
514
515
|
console.error('Error while fetching URL:', error);
|