@cityofzion/bs-multichain 1.0.3 → 1.0.5

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.
@@ -171,7 +171,11 @@ class Neo3NeoXBridgeOrchestrator {
171
171
  __classPrivateFieldSet(this, _Neo3NeoXBridgeOrchestrator_instances, { value: constants.bridgeFee }, "a", _Neo3NeoXBridgeOrchestrator_bridgeFee_set);
172
172
  const bridgeMaxAmountBn = blockchain_service_1.BSBigNumberHelper.fromNumber(constants.bridgeMaxAmount);
173
173
  const tokenBalanceAmountBn = blockchain_service_1.BSBigNumberHelper.fromNumber((_a = tokenToUseBalance === null || tokenToUseBalance === void 0 ? void 0 : tokenToUseBalance.amount) !== null && _a !== void 0 ? _a : 0);
174
- const max = Math.max(0, Math.min(bridgeMaxAmountBn.toNumber(), tokenBalanceAmountBn.minus(constants.bridgeFee).toNumber()));
174
+ const isFeeToken = blockchain_service_1.BSTokenHelper.predicateByHash(this.fromService.feeToken)(__classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_tokenToUse_get).value);
175
+ const maxTokenBalanceAmountBn = isFeeToken
176
+ ? tokenBalanceAmountBn.minus(constants.bridgeFee)
177
+ : tokenBalanceAmountBn;
178
+ const max = Math.max(0, Math.min(bridgeMaxAmountBn.toNumber(), maxTokenBalanceAmountBn.toNumber()));
175
179
  __classPrivateFieldSet(this, _Neo3NeoXBridgeOrchestrator_instances, { value: blockchain_service_1.BSBigNumberHelper.format(max, { decimals: __classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_tokenToUse_get).value.decimals }) }, "a", _Neo3NeoXBridgeOrchestrator_amountToUseMax_set);
176
180
  }
177
181
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-multichain",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -28,8 +28,8 @@
28
28
  "@typescript-eslint/eslint-plugin": "~8.12.2",
29
29
  "@typescript-eslint/parser": "~8.12.2",
30
30
  "@cityofzion/bs-neo3": "1.15.4",
31
+ "@cityofzion/bs-neo-legacy": "1.12.8",
31
32
  "@cityofzion/bs-ethereum": "2.12.8",
32
- "@cityofzion/bs-neo-legacy": "1.12.7",
33
33
  "@cityofzion/bs-neox": "1.2.5"
34
34
  },
35
35
  "scripts": {