@strkfarm/sdk 2.0.0-dev.15 → 2.0.0-dev.16

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.
@@ -91443,11 +91443,6 @@ spurious results.`);
91443
91443
  if (!this.pricer) {
91444
91444
  throw new Error("Pricer is not initialized");
91445
91445
  }
91446
- const CACHE_KEY = `positions_${blockNumber}_${this.config.poolId.shortString()}_${this.config.collateral.symbol}_${this.config.debt.symbol}`;
91447
- const cacheData = this.getCache(CACHE_KEY);
91448
- if (cacheData) {
91449
- return cacheData;
91450
- }
91451
91446
  const { contract, isV2 } = this.getVesuSingletonContract(config3, this.config.poolId);
91452
91447
  const output = await contract.call(isV2 ? "position" : "position_unsafe", [
91453
91448
  ...isV2 ? [] : [this.config.poolId.address],
@@ -91473,7 +91468,6 @@ spurious results.`);
91473
91468
  usdValue: debtAmount.multipliedBy(token2Price.price).toNumber(),
91474
91469
  remarks: "Debt"
91475
91470
  }];
91476
- this.setCache(CACHE_KEY, value, 6e4);
91477
91471
  return value.map((v) => ({ ...v, protocol: Protocols.VESU }));
91478
91472
  }
91479
91473
  async getCollateralization(config3, blockNumber = "latest") {
@@ -27407,11 +27407,6 @@ var VesuAdapter = class _VesuAdapter extends CacheClass {
27407
27407
  if (!this.pricer) {
27408
27408
  throw new Error("Pricer is not initialized");
27409
27409
  }
27410
- const CACHE_KEY = `positions_${blockNumber}_${this.config.poolId.shortString()}_${this.config.collateral.symbol}_${this.config.debt.symbol}`;
27411
- const cacheData = this.getCache(CACHE_KEY);
27412
- if (cacheData) {
27413
- return cacheData;
27414
- }
27415
27410
  const { contract, isV2 } = this.getVesuSingletonContract(config, this.config.poolId);
27416
27411
  const output = await contract.call(isV2 ? "position" : "position_unsafe", [
27417
27412
  ...isV2 ? [] : [this.config.poolId.address],
@@ -27437,7 +27432,6 @@ var VesuAdapter = class _VesuAdapter extends CacheClass {
27437
27432
  usdValue: debtAmount.multipliedBy(token2Price.price).toNumber(),
27438
27433
  remarks: "Debt"
27439
27434
  }];
27440
- this.setCache(CACHE_KEY, value, 6e4);
27441
27435
  return value.map((v) => ({ ...v, protocol: Protocols.VESU }));
27442
27436
  }
27443
27437
  async getCollateralization(config, blockNumber = "latest") {
package/dist/index.js CHANGED
@@ -27210,11 +27210,6 @@ var VesuAdapter = class _VesuAdapter extends CacheClass {
27210
27210
  if (!this.pricer) {
27211
27211
  throw new Error("Pricer is not initialized");
27212
27212
  }
27213
- const CACHE_KEY = `positions_${blockNumber}_${this.config.poolId.shortString()}_${this.config.collateral.symbol}_${this.config.debt.symbol}`;
27214
- const cacheData = this.getCache(CACHE_KEY);
27215
- if (cacheData) {
27216
- return cacheData;
27217
- }
27218
27213
  const { contract, isV2 } = this.getVesuSingletonContract(config, this.config.poolId);
27219
27214
  const output = await contract.call(isV2 ? "position" : "position_unsafe", [
27220
27215
  ...isV2 ? [] : [this.config.poolId.address],
@@ -27240,7 +27235,6 @@ var VesuAdapter = class _VesuAdapter extends CacheClass {
27240
27235
  usdValue: debtAmount.multipliedBy(token2Price.price).toNumber(),
27241
27236
  remarks: "Debt"
27242
27237
  }];
27243
- this.setCache(CACHE_KEY, value, 6e4);
27244
27238
  return value.map((v) => ({ ...v, protocol: Protocols.VESU }));
27245
27239
  }
27246
27240
  async getCollateralization(config, blockNumber = "latest") {
package/dist/index.mjs CHANGED
@@ -27065,11 +27065,6 @@ var VesuAdapter = class _VesuAdapter extends CacheClass {
27065
27065
  if (!this.pricer) {
27066
27066
  throw new Error("Pricer is not initialized");
27067
27067
  }
27068
- const CACHE_KEY = `positions_${blockNumber}_${this.config.poolId.shortString()}_${this.config.collateral.symbol}_${this.config.debt.symbol}`;
27069
- const cacheData = this.getCache(CACHE_KEY);
27070
- if (cacheData) {
27071
- return cacheData;
27072
- }
27073
27068
  const { contract, isV2 } = this.getVesuSingletonContract(config, this.config.poolId);
27074
27069
  const output = await contract.call(isV2 ? "position" : "position_unsafe", [
27075
27070
  ...isV2 ? [] : [this.config.poolId.address],
@@ -27095,7 +27090,6 @@ var VesuAdapter = class _VesuAdapter extends CacheClass {
27095
27090
  usdValue: debtAmount.multipliedBy(token2Price.price).toNumber(),
27096
27091
  remarks: "Debt"
27097
27092
  }];
27098
- this.setCache(CACHE_KEY, value, 6e4);
27099
27093
  return value.map((v) => ({ ...v, protocol: Protocols.VESU }));
27100
27094
  }
27101
27095
  async getCollateralization(config, blockNumber = "latest") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "2.0.0-dev.15",
3
+ "version": "2.0.0-dev.16",
4
4
  "description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
5
5
  "typings": "dist/index.d.ts",
6
6
  "types": "dist/index.d.ts",
@@ -628,11 +628,11 @@ export class VesuAdapter extends CacheClass {
628
628
  throw new Error('Pricer is not initialized');
629
629
  }
630
630
  // { '0': { collateral_shares: 0n, nominal_debt: 0n }, '1': 0n, '2': 0n }
631
- const CACHE_KEY = `positions_${blockNumber}_${this.config.poolId.shortString()}_${this.config.collateral.symbol}_${this.config.debt.symbol}`;
632
- const cacheData = this.getCache<VaultPosition[]>(CACHE_KEY);
633
- if (cacheData) {
634
- return cacheData;
635
- }
631
+ // const CACHE_KEY = `positions_${blockNumber}_${this.config.poolId.shortString()}_${this.config.collateral.symbol}_${this.config.debt.symbol}`;
632
+ // const cacheData = this.getCache<VaultPosition[]>(CACHE_KEY);
633
+ // if (cacheData) {
634
+ // return cacheData;
635
+ // }
636
636
 
637
637
  const { contract, isV2} = this.getVesuSingletonContract(config, this.config.poolId);
638
638
  const output: any = await contract
@@ -661,7 +661,7 @@ export class VesuAdapter extends CacheClass {
661
661
  usdValue: debtAmount.multipliedBy(token2Price.price).toNumber(),
662
662
  remarks: "Debt"
663
663
  }];
664
- this.setCache(CACHE_KEY, value, 60000); // ttl: 1min
664
+ // this.setCache(CACHE_KEY, value, 60000); // ttl: 1min
665
665
  return value.map(v => ({ ...v, protocol: Protocols.VESU }));
666
666
  }
667
667