emblem-vault-sdk 2.3.5 → 2.3.7

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/derive.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
package/dist/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,18 +45,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
35
45
  const bignumber_1 = require("@ethersproject/bignumber");
36
46
  const utils_1 = require("./utils");
37
47
  const derive_1 = require("./derive");
38
- const SDK_VERSION = '2.3.5';
48
+ const SDK_VERSION = '2.3.7';
39
49
  class EmblemVaultSDK {
40
- constructor(apiKey, baseUrl) {
50
+ constructor(apiKey, baseUrl, v3Url, sigUrl) {
41
51
  this.apiKey = apiKey;
42
52
  console.log('EmblemVaultSDK version:', SDK_VERSION);
43
53
  if (!apiKey) {
44
54
  throw new Error('API key is required');
45
55
  }
46
- this.v1Url = 'https://api2.emblemvault.io';
47
56
  this.baseUrl = baseUrl || 'https://v2.emblemvault.io';
48
- this.v3Url = 'https://v3.emblemvault.io';
49
- this.sigUrl = 'https://tor-us-signer-coval.vercel.app';
57
+ this.v3Url = v3Url || 'https://v3.emblemvault.io';
58
+ this.sigUrl = sigUrl || 'https://tor-us-signer-coval.vercel.app';
50
59
  }
51
60
  // Example method structure
52
61
  generateUploadUrl() {
package/dist/utils.js CHANGED
@@ -324,6 +324,7 @@ function generateTemplate(record) {
324
324
  * @param {function} - msgCallback should be a function that takes a string message
325
325
  */
326
326
  allowed: (data, _this, msgCallback = null) => {
327
+ var _a;
327
328
  if (recordName == "Embels") {
328
329
  return true;
329
330
  }
@@ -336,7 +337,7 @@ function generateTemplate(record) {
336
337
  let message = null;
337
338
  if (recordName == "Filthy Fiat") {
338
339
  data = _this.filterNativeBalances({ balances: data }, _this);
339
- allowed = data[0].project == recordName;
340
+ allowed = ((_a = data[0]) === null || _a === void 0 ? void 0 : _a.project) == recordName;
340
341
  }
341
342
  else if (recordName == "Cursed Ordinal") {
342
343
  if (data && data.length > 0) {
@@ -420,14 +421,14 @@ function generateTemplate(record) {
420
421
  if (recordName == "Bitcoin Punks") {
421
422
  firstAsset = _this.filterNativeBalances({ balances: data }, _this)[0];
422
423
  }
423
- const allowedChain = firstAsset.coin.toLowerCase() == _this.collectionChain.toLowerCase();
424
+ const allowedChain = (firstAsset === null || firstAsset === void 0 ? void 0 : firstAsset.coin.toLowerCase()) == _this.collectionChain.toLowerCase();
424
425
  if (!allowedChain) {
425
- message = `Found ${firstAsset.coin} asset, expected ${_this.collectionChain} asset.`;
426
+ message = `Found ${firstAsset === null || firstAsset === void 0 ? void 0 : firstAsset.coin} asset, expected ${_this.collectionChain} asset.`;
426
427
  }
427
- const allowedProject = firstAsset.project == recordName;
428
+ const allowedProject = (firstAsset === null || firstAsset === void 0 ? void 0 : firstAsset.project) == recordName;
428
429
  if (!allowedProject) {
429
430
  message = (message ? `${message} ` : '') +
430
- `Found asset from ${firstAsset.project} collection, expected asset from ${recordName} collection.`;
431
+ `Found asset from ${firstAsset === null || firstAsset === void 0 ? void 0 : firstAsset.project} collection, expected asset from ${recordName} collection.`;
431
432
  }
432
433
  allowed = allowedChain && allowedProject;
433
434
  }