impermax-sdk 2.1.409 → 2.1.410

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.
@@ -19,7 +19,7 @@ const LlamaChains = {
19
19
  [types_1.Networks.Base]: "base",
20
20
  [types_1.Networks.Mantle]: "mantle",
21
21
  [types_1.Networks.Scroll]: "scroll",
22
- [types_1.Networks.Optimism]: "op mainnet",
22
+ [types_1.Networks.Optimism]: "optimism",
23
23
  [types_1.Networks.Real]: "re.al",
24
24
  [types_1.Networks.Blast]: "blast",
25
25
  [types_1.Networks.Sonic]: "sonic",
@@ -85,7 +85,10 @@ class OffchainAPRHelper {
85
85
  // contracts exists on diff chains
86
86
  this.llamaAllPools = filteredPools.reduce((acc, i) => {
87
87
  const pool = i.pool_old.split("-")[0];
88
- const llamaChain = i.chain;
88
+ // OP is outdated, report to llama
89
+ let llamaChain = i.chain.toLowerCase();
90
+ if (llamaChain === 'op mainnet')
91
+ llamaChain = 'optimism';
89
92
  const llamaId = pool.concat("-", llamaChain).toLowerCase();
90
93
  acc[llamaId] = i;
91
94
  return acc;
@@ -120,12 +123,18 @@ class OffchainAPRHelper {
120
123
  const impermaxTvlChart = response.tvl;
121
124
  // Get the chain tvls
122
125
  this.chainTvls = Object.entries(currentChainTvls).reduce((acc, [chain, tvl]) => {
123
- acc[chain.toLowerCase()] = tvl;
126
+ let llamaChain = chain.toLowerCase();
127
+ if (llamaChain === 'op mainnet')
128
+ llamaChain = 'optimism';
129
+ acc[llamaChain.toLowerCase()] = tvl;
124
130
  return acc;
125
131
  }, {});
126
132
  // Get the chain tvls day data to build charts
127
133
  this.chainTvlCharts = Object.entries(chainTvlCharts).reduce((acc, [chain, dayData]) => {
128
- acc[chain.toLowerCase()] = dayData.tvl;
134
+ let llamaChain = chain.toLowerCase();
135
+ if (llamaChain === 'op mainnet')
136
+ llamaChain = 'optimism';
137
+ acc[llamaChain.toLowerCase()] = dayData.tvl;
129
138
  return acc;
130
139
  }, {});
131
140
  this.impermaxTvlChart = impermaxTvlChart;
@@ -145,7 +154,9 @@ class OffchainAPRHelper {
145
154
  const impermaxPools = response.data.filter((i) => i.project === "impermax-v2" || i.project === "impermax-v3");
146
155
  this.chainsTotalSupplied = impermaxPools.reduce((acc, pool) => {
147
156
  // OP is outdated, report to llama
148
- const chain = pool.chain.toLowerCase() === "optimism" ? "op mainnet" : pool.chain.toLowerCase();
157
+ let chain = pool.chain.toLowerCase();
158
+ if (chain === 'op mainnet')
159
+ chain = 'optimism';
149
160
  acc[chain] = (acc[chain] || 0) + pool.totalSupplyUsd;
150
161
  return acc;
151
162
  }, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.409",
3
+ "version": "2.1.410",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",