emblem-vault-sdk 2.2.0 → 2.3.0

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
@@ -711421,7 +711421,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
711421
711421
  const bignumber_1 = require("@ethersproject/bignumber");
711422
711422
  const utils_1 = require("./utils");
711423
711423
  const derive_1 = require("./derive");
711424
- const SDK_VERSION = '2.2.0';
711424
+ const SDK_VERSION = '2.3.0';
711425
711425
  class EmblemVaultSDK {
711426
711426
  constructor(apiKey, baseUrl) {
711427
711427
  this.apiKey = apiKey;
@@ -712399,9 +712399,11 @@ function generateTemplate(record) {
712399
712399
  }
712400
712400
  }
712401
712401
  else if (recordName == "COVAL Timelock") {
712402
+ let possibleBalances = [5000, 50000, 500000];
712402
712403
  let covalAssets = data.filter((item) => item.name == "Circuits of Value");
712403
712404
  let covalTotalBalance = covalAssets.reduce((acc, item) => acc + item.balance, 0);
712404
- allowed = covalTotalBalance == 5000 || covalTotalBalance == 50000 || covalTotalBalance == 500000;
712405
+ allowed = possibleBalances.includes(covalTotalBalance) || false;
712406
+ message = !allowed ? `Load vault with 5000, 50000, or 500000 Circuits of Value` : message;
712405
712407
  }
712406
712408
  else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection") {
712407
712409
  if (recordName == "Bitcoin Punks") {
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
35
35
  const bignumber_1 = require("@ethersproject/bignumber");
36
36
  const utils_1 = require("./utils");
37
37
  const derive_1 = require("./derive");
38
- const SDK_VERSION = '2.2.0';
38
+ const SDK_VERSION = '2.3.0';
39
39
  class EmblemVaultSDK {
40
40
  constructor(apiKey, baseUrl) {
41
41
  this.apiKey = apiKey;
package/dist/utils.js CHANGED
@@ -348,9 +348,11 @@ function generateTemplate(record) {
348
348
  }
349
349
  }
350
350
  else if (recordName == "COVAL Timelock") {
351
+ let possibleBalances = [5000, 50000, 500000];
351
352
  let covalAssets = data.filter((item) => item.name == "Circuits of Value");
352
353
  let covalTotalBalance = covalAssets.reduce((acc, item) => acc + item.balance, 0);
353
- allowed = covalTotalBalance == 5000 || covalTotalBalance == 50000 || covalTotalBalance == 500000;
354
+ allowed = possibleBalances.includes(covalTotalBalance) || false;
355
+ message = !allowed ? `Load vault with 5000, 50000, or 500000 Circuits of Value` : message;
354
356
  }
355
357
  else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection") {
356
358
  if (recordName == "Bitcoin Punks") {
package/docs/bundle.js CHANGED
@@ -711421,7 +711421,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
711421
711421
  const bignumber_1 = require("@ethersproject/bignumber");
711422
711422
  const utils_1 = require("./utils");
711423
711423
  const derive_1 = require("./derive");
711424
- const SDK_VERSION = '2.2.0';
711424
+ const SDK_VERSION = '2.3.0';
711425
711425
  class EmblemVaultSDK {
711426
711426
  constructor(apiKey, baseUrl) {
711427
711427
  this.apiKey = apiKey;
@@ -712399,9 +712399,11 @@ function generateTemplate(record) {
712399
712399
  }
712400
712400
  }
712401
712401
  else if (recordName == "COVAL Timelock") {
712402
+ let possibleBalances = [5000, 50000, 500000];
712402
712403
  let covalAssets = data.filter((item) => item.name == "Circuits of Value");
712403
712404
  let covalTotalBalance = covalAssets.reduce((acc, item) => acc + item.balance, 0);
712404
- allowed = covalTotalBalance == 5000 || covalTotalBalance == 50000 || covalTotalBalance == 500000;
712405
+ allowed = possibleBalances.includes(covalTotalBalance) || false;
712406
+ message = !allowed ? `Load vault with 5000, 50000, or 500000 Circuits of Value` : message;
712405
712407
  }
712406
712408
  else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection") {
712407
712409
  if (recordName == "Bitcoin Punks") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Emblem Vault Software Development Kit",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/utils.ts CHANGED
@@ -312,9 +312,11 @@ export function generateTemplate(record: any) {
312
312
  message = `Found ${firstAsset.coin} asset, expected ${_this.collectionChain} asset.`
313
313
  }
314
314
  } else if (recordName == "COVAL Timelock") {
315
+ let possibleBalances = [5000, 50000, 500000]
315
316
  let covalAssets = data.filter((item: { name: string; }) => item.name == "Circuits of Value")
316
317
  let covalTotalBalance = covalAssets.reduce((acc: number, item: { balance: number; }) => acc + item.balance, 0)
317
- allowed = covalTotalBalance == 5000 || covalTotalBalance == 50000 || covalTotalBalance == 500000
318
+ allowed = possibleBalances.includes(covalTotalBalance) || false
319
+ message = !allowed ? `Load vault with 5000, 50000, or 500000 Circuits of Value` : message
318
320
  } else if (_this.vaultCollectionType && _this.vaultCollectionType == "collection") {
319
321
  if (recordName == "Bitcoin Punks") {
320
322
  firstAsset = _this.filterNativeBalances({balances: data}, _this)[0]