emblem-vault-sdk 1.1.1 → 1.1.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
@@ -684189,7 +684189,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
684189
684189
  };
684190
684190
  Object.defineProperty(exports, "__esModule", { value: true });
684191
684191
  const utils_1 = require("./utils");
684192
- const SDK_VERSION = '1.1.0';
684192
+ const SDK_VERSION = '1.1.2';
684193
684193
  class EmblemVaultSDK {
684194
684194
  constructor(apiKey, baseUrl) {
684195
684195
  this.apiKey = apiKey;
@@ -684644,7 +684644,7 @@ function generateTemplate(record) {
684644
684644
  }
684645
684645
  }
684646
684646
  else {
684647
- if (balance && balance[0].balance) {
684647
+ if (balance && balance.length > 0 && balance[0].balance) {
684648
684648
  balanceDescription = balance[0].balance;
684649
684649
  }
684650
684650
  else if (balance) {
@@ -684674,7 +684674,7 @@ function generateTemplate(record) {
684674
684674
  name: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : _this.loadTypes.includes('select') ? { type: "selection-provided" } : "Loading...",
684675
684675
  image: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : _this.loadTypes.includes('select') ? { type: "selection-provided" } : _this.loading(),
684676
684676
  description: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : null,
684677
- ownedImage: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : "",
684677
+ ownedImage: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : null,
684678
684678
  projectName: _this.loadTypes.includes('select') ? _this.name : null
684679
684679
  }
684680
684680
  };
@@ -684721,6 +684721,9 @@ function templateGuard(input) {
684721
684721
  errors.push(e.message);
684722
684722
  }
684723
684723
  }
684724
+ else if (value == "") {
684725
+ errors.push(`'${key}' is a required field`);
684726
+ }
684724
684727
  if (errors.length > 0) {
684725
684728
  throw new Error(errors.join(", "));
684726
684729
  }
package/docs/bundle.js CHANGED
@@ -684189,7 +684189,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
684189
684189
  };
684190
684190
  Object.defineProperty(exports, "__esModule", { value: true });
684191
684191
  const utils_1 = require("./utils");
684192
- const SDK_VERSION = '1.1.0';
684192
+ const SDK_VERSION = '1.1.2';
684193
684193
  class EmblemVaultSDK {
684194
684194
  constructor(apiKey, baseUrl) {
684195
684195
  this.apiKey = apiKey;
@@ -684644,7 +684644,7 @@ function generateTemplate(record) {
684644
684644
  }
684645
684645
  }
684646
684646
  else {
684647
- if (balance && balance[0].balance) {
684647
+ if (balance && balance.length > 0 && balance[0].balance) {
684648
684648
  balanceDescription = balance[0].balance;
684649
684649
  }
684650
684650
  else if (balance) {
@@ -684674,7 +684674,7 @@ function generateTemplate(record) {
684674
684674
  name: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : _this.loadTypes.includes('select') ? { type: "selection-provided" } : "Loading...",
684675
684675
  image: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : _this.loadTypes.includes('select') ? { type: "selection-provided" } : _this.loading(),
684676
684676
  description: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : null,
684677
- ownedImage: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : "",
684677
+ ownedImage: _this.loadTypes.includes('detailed') ? { type: "user-provided" } : null,
684678
684678
  projectName: _this.loadTypes.includes('select') ? _this.name : null
684679
684679
  }
684680
684680
  };
@@ -684721,6 +684721,9 @@ function templateGuard(input) {
684721
684721
  errors.push(e.message);
684722
684722
  }
684723
684723
  }
684724
+ else if (value == "") {
684725
+ errors.push(`'${key}' is a required field`);
684726
+ }
684724
684727
  if (errors.length > 0) {
684725
684728
  throw new Error(errors.join(", "));
684726
684729
  }
package/docs/index.html CHANGED
@@ -44,6 +44,7 @@
44
44
  }
45
45
 
46
46
  async function createVault() {
47
+ document.getElementById('vaultDetails').display = 'none';
47
48
  let vault = await sdk.createCuratedVault(window.template)
48
49
  window.vault = vault;
49
50
  console.log("--------- Vault Details ---------");
@@ -75,7 +76,7 @@
75
76
  window.contract = window.curatedContracts.find(contract => contract.name == metadata.targetContract.name)
76
77
  }
77
78
  window.address = window.contract.address(metadata.addresses)
78
- window.vaultBody = contract.generateVaultBody(metadata, metadata.values, contract, ()=>{})
79
+ window.vaultBody = contract.generateVaultBody(metadata, metadata.values? metadata.values: [], contract, ()=>{})
79
80
  document.getElementById('depositAddress').textContent = window.address;
80
81
  document.getElementById('tokenImage').src = window.vaultBody.image;
81
82
  document.getElementById('tokenName').textContent = window.vaultBody.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/utils.ts CHANGED
@@ -364,7 +364,7 @@ export function generateTemplate(record: any) {
364
364
  balanceDescription = '1';
365
365
  }
366
366
  } else {
367
- if (balance && balance[0].balance) {
367
+ if (balance && balance.length > 0 && balance[0].balance) {
368
368
  balanceDescription = balance[0].balance;
369
369
  } else if (balance) {
370
370
  balanceDescription = '1';
@@ -399,7 +399,7 @@ export function generateTemplate(record: any) {
399
399
  name: _this.loadTypes.includes('detailed') ? { type: "user-provided"}: _this.loadTypes.includes('select')? { type: "selection-provided"}: "Loading...",
400
400
  image: _this.loadTypes.includes('detailed') ? { type: "user-provided"}: _this.loadTypes.includes('select')? { type: "selection-provided"}: _this.loading(),
401
401
  description: _this.loadTypes.includes('detailed') ? { type: "user-provided"}: null,
402
- ownedImage: _this.loadTypes.includes('detailed') ? { type: "user-provided"}: "",
402
+ ownedImage: _this.loadTypes.includes('detailed') ? { type: "user-provided"}: null,
403
403
  projectName: _this.loadTypes.includes('select')? _this.name: null
404
404
  }
405
405
  }
@@ -441,6 +441,8 @@ export function templateGuard(input: { [x: string]: any; hasOwnProperty: (arg0:
441
441
  } catch (e: any) {
442
442
  errors.push(e.message);
443
443
  }
444
+ } else if (value == "") {
445
+ errors.push(`'${key}' is a required field`);
444
446
  }
445
447
  if (errors.length > 0) {
446
448
  throw new Error(errors.join(", "));