@cityofzion/bs-neo3 1.7.0 → 1.7.1

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.
@@ -42,23 +42,23 @@ class FlamingoEDSNeo3 extends blockchain_service_1.CryptoCompareEDS {
42
42
  if (!BSNeo3Helper_1.BSNeo3Helper.isMainnet(__classPrivateFieldGet(this, _FlamingoEDSNeo3_network, "f")))
43
43
  throw new Error('Exchange is only available on mainnet');
44
44
  const { data } = yield __classPrivateFieldGet(this, _FlamingoEDSNeo3_axiosInstance, "f").get('/live-data/prices/latest');
45
- const prices = new Map();
45
+ const prices = [];
46
46
  const { tokens } = params;
47
- const neoSymbol = 'NEO';
47
+ const allTokens = BSNeo3Helper_1.BSNeo3Helper.getTokens(__classPrivateFieldGet(this, _FlamingoEDSNeo3_network, "f"));
48
+ const neoToken = tokens.find(({ symbol }) => symbol === 'NEO');
49
+ const bNeoToken = allTokens.find(({ symbol }) => symbol === 'bNEO');
50
+ if (neoToken)
51
+ data.forEach(item => {
52
+ if (BSNeo3Helper_1.BSNeo3Helper.normalizeHash(bNeoToken.hash) === BSNeo3Helper_1.BSNeo3Helper.normalizeHash(item.hash))
53
+ data.push(Object.assign(Object.assign({}, item), { symbol: neoToken.symbol, hash: neoToken.hash }));
54
+ });
48
55
  data.forEach(item => {
49
56
  const token = tokens.find(({ hash }) => BSNeo3Helper_1.BSNeo3Helper.normalizeHash(hash) === BSNeo3Helper_1.BSNeo3Helper.normalizeHash(item.hash));
50
57
  if (!token)
51
58
  return;
52
- const { symbol } = token;
53
- const usdPrice = item.usd_price;
54
- if (symbol === 'bNEO') {
55
- const neoToken = tokens.find(token => token.symbol === neoSymbol);
56
- if (neoToken)
57
- prices.set(neoSymbol, { usdPrice, token: neoToken });
58
- }
59
- prices.set(symbol, { usdPrice, token });
59
+ prices.push({ usdPrice: item.usd_price, token });
60
60
  });
61
- return [...prices.values()];
61
+ return prices;
62
62
  });
63
63
  }
64
64
  getTokenPriceHistory(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-neo3",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",