impermax-sdk 2.1.305 → 2.1.306

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.
@@ -69,6 +69,7 @@ exports.IMPERMAX_VAULT_API = {
69
69
  [types_1.Networks.Linea]: {},
70
70
  };
71
71
  // :lendingPoolId/:tokenId
72
+ // TODO: Deprecated this and use NFTLP_UNIV3_API?
72
73
  exports.NFTLP_FEE_API = {
73
74
  [types_1.Networks.Ropsten]: {},
74
75
  [types_1.Networks.Mainnet]: {},
@@ -77,16 +77,15 @@ class OffchainAccountNftlpUniswapV3 extends offchainAccountNftlp_1.default {
77
77
  this.cache.newlyEarnedFees = {};
78
78
  if (tokenId in this.cache.newlyEarnedFees)
79
79
  return this.cache.newlyEarnedFees[tokenId];
80
- const network = this.getLendingPool().getLendingPool().getOffchain().network;
81
- const factory = this.getLendingPool().getLendingPool().getFactory();
80
+ const { network, chainId } = this.getLendingPool().getLendingPool().getOffchain();
82
81
  const lendingPoolId = this.getLendingPool().getLendingPool().getPairAddress();
83
- const api = private_api_1.NFTLP_FEE_API[network][factory];
82
+ const api = private_api_1.NFTLP_UNIV3_API[network];
84
83
  if (!api) {
85
84
  console.log(`Missing newly earned fees API for ${lendingPoolId} on ${network}?`);
86
85
  return { amountX: 0, amountY: 0 };
87
86
  }
88
87
  try {
89
- const positionFees = await fetch(api.concat(`fees/${lendingPoolId}/${tokenId}`)).then(i => i.json());
88
+ const positionFees = await fetch(api.concat(`${chainId}/fees/${lendingPoolId}/${tokenId}`)).then(i => i.json());
90
89
  this.cache.newlyEarnedFees[tokenId] = { amountX: Number(positionFees.newlyEarnedFees0), amountY: Number(positionFees.newlyEarnedFees1) };
91
90
  return this.cache.newlyEarnedFees[tokenId];
92
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.305",
3
+ "version": "2.1.306",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",