@cityofzion/bs-neo-legacy 1.10.1 → 1.10.3

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.
@@ -257,10 +257,16 @@ class BSNeoLegacy {
257
257
  const balances = yield this.blockchainDataService.getBalance(account.address);
258
258
  const gasAmount = (_a = balances.find(({ token }) => (0, blockchain_service_1.normalizeHash)(token.hash) === this.GAS_ASSET.hash)) === null || _a === void 0 ? void 0 : _a.amount;
259
259
  const neoAmount = (_b = balances.find(({ token }) => (0, blockchain_service_1.normalizeHash)(token.hash) === this.NEO_ASSET.hash)) === null || _b === void 0 ? void 0 : _b.amount;
260
- const gasAmountNumber = Number(gasAmount) || 0;
261
- const neoAmountNumber = Number(neoAmount) || 0;
262
- if (gasAmountNumber < 0.1 && neoAmountNumber < 2)
260
+ let gasAmountNumber = Number(gasAmount) || 0;
261
+ let neoAmountNumber = Number(neoAmount) || 0;
262
+ const hasNotGasAmountEnough = gasAmountNumber < 0.1;
263
+ const hasNotNeoAmountEnough = neoAmountNumber < 2;
264
+ if (hasNotGasAmountEnough && hasNotNeoAmountEnough)
263
265
  throw new Error('Must have at least 0.1 GAS or 2 NEO');
266
+ if (hasNotGasAmountEnough)
267
+ gasAmountNumber = 0;
268
+ if (hasNotNeoAmountEnough)
269
+ neoAmountNumber = 0;
264
270
  return { gasAmountNumber, neoAmountNumber };
265
271
  });
266
272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-neo-legacy",
3
- "version": "1.10.1",
3
+ "version": "1.10.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Coz",
@@ -12,7 +12,7 @@
12
12
  "@cityofzion/dora-ts": "0.0.11",
13
13
  "@cityofzion/neon-js": "4.8.3",
14
14
  "@ledgerhq/hw-transport": "~6.30.5",
15
- "@cityofzion/blockchain-service": "1.15.3",
15
+ "@cityofzion/blockchain-service": "1.16.0",
16
16
  "@cityofzion/bs-asteroid-sdk": "0.9.0"
17
17
  },
18
18
  "devDependencies": {