@cityofzion/bs-multichain 1.0.11 → 1.0.13

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.
@@ -174,7 +174,7 @@ class Neo3NeoXBridgeOrchestrator {
174
174
  const maxTokenBalanceAmountBn = isFeeToken
175
175
  ? tokenBalanceAmountBn.minus(constants.bridgeFee)
176
176
  : tokenBalanceAmountBn;
177
- const max = Math.max(0, Math.min(bridgeMaxAmountBn.toNumber(), maxTokenBalanceAmountBn.toNumber()));
177
+ const max = blockchain_service_1.BSBigNumber.max(0, blockchain_service_1.BSBigNumber.min(bridgeMaxAmountBn, maxTokenBalanceAmountBn));
178
178
  __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);
179
179
  }
180
180
  catch (error) {
@@ -206,7 +206,7 @@ _SimpleSwapApi_tickersBySimpleSwapBlockchain = new WeakMap(), _SimpleSwapApi_axi
206
206
  return explorer;
207
207
  }, _SimpleSwapApi_getTokenFromCurrency = function _SimpleSwapApi_getTokenFromCurrency(currency, options) {
208
208
  var _a;
209
- const { network: simpleSwapBlockchain, ticker } = currency;
209
+ const { network: simpleSwapBlockchain, ticker, precision } = currency;
210
210
  let { name } = currency;
211
211
  let symbol = ticker;
212
212
  if (!ticker || !simpleSwapBlockchain || !currency.image || !name || !currency.validationAddress)
@@ -215,7 +215,7 @@ _SimpleSwapApi_tickersBySimpleSwapBlockchain = new WeakMap(), _SimpleSwapApi_axi
215
215
  const chainsByServiceNameEntry = chainsByServiceNameEntries.find(([_serviceName, chains]) => chains.includes(simpleSwapBlockchain));
216
216
  let blockchain;
217
217
  let blockchainService;
218
- let decimals;
218
+ let decimals = precision !== null && precision !== void 0 ? precision : undefined;
219
219
  let hash = (_a = currency.contractAddress) !== null && _a !== void 0 ? _a : undefined;
220
220
  const lowerCaseSymbol = symbol.toLowerCase();
221
221
  const tickers = __classPrivateFieldGet(this, _SimpleSwapApi_tickersBySimpleSwapBlockchain, "f")[simpleSwapBlockchain];
@@ -29,6 +29,7 @@ export type TSimpleSwapApiCurrencyResponse = {
29
29
  contractAddress: string | null;
30
30
  addressExplorer: string | null;
31
31
  txExplorer: string | null;
32
+ precision: number | null;
32
33
  };
33
34
  export type TSimpleSwapApiGetCurrenciesResponse = {
34
35
  result: TSimpleSwapApiCurrencyResponse[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-multichain",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "axios": "~1.8.2",
14
14
  "lodash": "~4.17.21",
15
- "@cityofzion/blockchain-service": "1.21.1"
15
+ "@cityofzion/blockchain-service": "1.21.2"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/jest": "29.5.3",
@@ -27,10 +27,10 @@
27
27
  "@types/node": "~22.8.6",
28
28
  "@typescript-eslint/eslint-plugin": "~8.12.2",
29
29
  "@typescript-eslint/parser": "~8.12.2",
30
- "@cityofzion/bs-ethereum": "2.13.2",
31
- "@cityofzion/bs-neo3": "1.16.2",
32
- "@cityofzion/bs-neox": "1.3.3",
33
- "@cityofzion/bs-neo-legacy": "1.13.3"
30
+ "@cityofzion/bs-neo3": "1.16.3",
31
+ "@cityofzion/bs-ethereum": "2.13.3",
32
+ "@cityofzion/bs-neo-legacy": "1.13.4",
33
+ "@cityofzion/bs-neox": "1.3.4"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsc --project tsconfig.build.json",