diff --git a/bfx-report-ui b/bfx-report-ui index 5525aea9..8dfdab80 160000 --- a/bfx-report-ui +++ b/bfx-report-ui @@ -1 +1 @@ -Subproject commit 5525aea9c9e349cf14bf7ce4e1aeab8296de80b8 +Subproject commit 8dfdab804b0b78740ec304d60820a2d6c69bd3b8 diff --git a/package-lock.json b/package-lock.json index 49a55c05..aae41fc2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bitfinex/bfx-reports-framework", - "version": "5.2.0", + "version": "5.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@bitfinex/bfx-reports-framework", - "version": "5.2.0", + "version": "5.2.1", "license": "Apache-2.0", "dependencies": { "@bitfinex/bfx-facs-db-better-sqlite": "git+https://github.com/bitfinexcom/bfx-facs-db-better-sqlite.git", @@ -234,8 +234,8 @@ } }, "node_modules/@bitfinex/bfx-report": { - "version": "5.2.0", - "resolved": "git+ssh://git@github.com/bitfinexcom/bfx-report.git#77b84149109290ce8b076d5eac145fe4b0039173", + "version": "5.2.1", + "resolved": "git+ssh://git@github.com/bitfinexcom/bfx-report.git#c07b646d9493660c18a554448f2831cb4718d5bf", "license": "Apache-2.0", "dependencies": { "@bitfinex/bfx-facs-deflate": "git+https://github.com/bitfinexcom/bfx-facs-deflate.git", diff --git a/package.json b/package.json index 97d0bbe0..934a4406 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitfinex/bfx-reports-framework", - "version": "5.2.0", + "version": "5.2.1", "description": "Bitfinex reports framework", "main": "worker.js", "engines": { diff --git a/workers/loc.api/errors/index.js b/workers/loc.api/errors/index.js index 07abb655..0a42b738 100644 --- a/workers/loc.api/errors/index.js +++ b/workers/loc.api/errors/index.js @@ -71,8 +71,8 @@ class ObjectMappingError extends BaseError { } class CurrencyConversionDataFindingError extends BaseError { - constructor (message = 'ERR_DATA_IS_NOT_FOUND_TO_CONVERT_CURRENCY') { - super(message) + constructor (data, message = 'ERR_DATA_IS_NOT_FOUND_TO_CONVERT_CURRENCY') { + super({ data, message }) } } diff --git a/workers/loc.api/sync/currency.converter/index.js b/workers/loc.api/sync/currency.converter/index.js index 0ae43616..3c671e1f 100644 --- a/workers/loc.api/sync/currency.converter/index.js +++ b/workers/loc.api/sync/currency.converter/index.js @@ -348,17 +348,25 @@ class CurrencyConverter { if (typeof symbol !== 'string') { return '' } - if (symbol.length < 8) { + if (symbol.length < 6) { return symbol } + + const hasFlag = ( + symbol.startsWith('t') || + symbol.startsWith('f') + ) + const flag = hasFlag + ? symbol[0] + : 't' + if ( - symbol[0] !== 't' && - symbol[0] !== 'f' + symbol.length === 7 && + hasFlag ) { return symbol } - const flag = symbol[0] const [firstSymb, lastSymb] = splitSymbolPairs(symbol) const _firstSymb = this._getConvertingSymb(firstSymb) const _lastSymb = this._getConvertingSymb(lastSymb) @@ -1031,7 +1039,9 @@ class CurrencyConverter { ) if (!Number.isFinite(price)) { - throw new CurrencyConversionDataFindingError() + throw new CurrencyConversionDataFindingError( + { symbol: reqSymb, mts } + ) } return price @@ -1082,7 +1092,9 @@ class CurrencyConverter { ) } - throw new CurrencyConversionDataFindingError() + throw new CurrencyConversionDataFindingError( + { symbol: reqSymb, mts: end } + ) } async convertManyByCandles (data, convSchema) {