impermax-sdk 1.2.139 → 1.2.140

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.
@@ -74,7 +74,9 @@ class OffchainAPRHelper {
74
74
  // contracts exists on diff chains
75
75
  this.llamaAllPools = filteredPools.reduce((acc, i) => {
76
76
  const pool = i.pool_old.split("-")[0];
77
- const llamaChain = i.chain;
77
+ let llamaChain = i.chain.toLowerCase();
78
+ if (llamaChain === 'op mainnet')
79
+ llamaChain = 'optimism';
78
80
  const llamaId = pool.concat("-", llamaChain).toLowerCase();
79
81
  acc[llamaId] = i;
80
82
  return acc;
@@ -96,12 +98,17 @@ class OffchainAPRHelper {
96
98
  const protocolTvlChart = response.tvl;
97
99
  // Get the chain tvls
98
100
  this.chainTvls = Object.entries(currentChainTvls).reduce((acc, [chain, tvl]) => {
99
- acc[chain.toLowerCase()] = tvl;
101
+ let llamaChain = chain.toLowerCase();
102
+ if (llamaChain === 'op mainnet')
103
+ llamaChain = 'optimism';
104
+ acc[llamaChain.toLowerCase()] = tvl;
100
105
  return acc;
101
106
  }, {});
102
- // Get the chain tvls day data to build charts
103
107
  this.chainTvlCharts = Object.entries(chainTvlCharts).reduce((acc, [chain, dayData]) => {
104
- acc[chain.toLowerCase()] = dayData.tvl;
108
+ let llamaChain = chain.toLowerCase();
109
+ if (llamaChain === 'op mainnet')
110
+ llamaChain = 'optimism';
111
+ acc[llamaChain.toLowerCase()] = dayData.tvl;
105
112
  return acc;
106
113
  }, {});
107
114
  this.protocolTvlChart = protocolTvlChart;
@@ -120,7 +127,9 @@ class OffchainAPRHelper {
120
127
  const impermaxPools = response.data.filter((i) => i.project === "impermax-v2" || i.project === "impermax-v3");
121
128
  this.chainsTotalSupplied = impermaxPools.reduce((acc, pool) => {
122
129
  // OP is outdated, report to llama
123
- const chain = pool.chain.toLowerCase() === "optimism" ? "op mainnet" : pool.chain.toLowerCase();
130
+ let chain = pool.chain.toLowerCase();
131
+ if (chain === 'op mainnet')
132
+ chain = 'optimism';
124
133
  acc[chain] = (acc[chain] || 0) + pool.totalSupplyUsd;
125
134
  return acc;
126
135
  }, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "1.2.139",
3
+ "version": "1.2.140",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",