@strkfarm/sdk 1.1.76 → 1.1.78

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.
@@ -52197,9 +52197,10 @@ ${JSON.stringify(data, null, 2)}`;
52197
52197
  }
52198
52198
 
52199
52199
  // src/modules/avnu.ts
52200
- var AvnuWrapper = class {
52200
+ var AvnuWrapper = class _AvnuWrapper {
52201
52201
  async getQuotes(fromToken, toToken, amountWei, taker, retry = 0, excludeSources = ["Haiko(Solvers)"]) {
52202
52202
  const MAX_RETRY = 5;
52203
+ logger2.verbose(`${_AvnuWrapper.name}: getQuotes => Getting quotes for ${fromToken} -> ${toToken}, amount: ${amountWei}, taker: ${taker}, retry: ${retry}`);
52203
52204
  const params = {
52204
52205
  sellTokenAddress: fromToken,
52205
52206
  buyTokenAddress: toToken,
@@ -83507,10 +83508,11 @@ spurious results.`);
83507
83508
  const CACHE_KEY = "xSTRKPrice";
83508
83509
  const existingCacheData = this.getCache(CACHE_KEY);
83509
83510
  if (existingCacheData) return existingCacheData;
83511
+ let AMOUNT = 100;
83510
83512
  const params = {
83511
83513
  sellTokenAddress: this.metadata.additionalInfo.secondaryToken.address.address,
83512
83514
  buyTokenAddress: this.metadata.additionalInfo.mainToken.address.address,
83513
- sellAmount: BigInt(new Web3Number("1", 18).toWei()),
83515
+ sellAmount: BigInt(new Web3Number(AMOUNT.toString(), 18).toWei()),
83514
83516
  takerAddress: this.address.address
83515
83517
  };
83516
83518
  logger2.verbose("getSecondaryTokenPriceRelativeToMain [1]", params);
@@ -83529,7 +83531,7 @@ spurious results.`);
83529
83531
  Web3Number.fromWei(firstQuote.buyAmount.toString(), 18).toFixed(
83530
83532
  6
83531
83533
  )
83532
- );
83534
+ ) / AMOUNT;
83533
83535
  logger2.verbose("getSecondaryTokenPriceRelativeToMain [2]", price);
83534
83536
  this.setCache(CACHE_KEY, price);
83535
83537
  return price;
@@ -463,9 +463,10 @@ function getTrovesEndpoint() {
463
463
  }
464
464
 
465
465
  // src/modules/avnu.ts
466
- var AvnuWrapper = class {
466
+ var AvnuWrapper = class _AvnuWrapper {
467
467
  async getQuotes(fromToken, toToken, amountWei, taker, retry = 0, excludeSources = ["Haiko(Solvers)"]) {
468
468
  const MAX_RETRY = 5;
469
+ logger.verbose(`${_AvnuWrapper.name}: getQuotes => Getting quotes for ${fromToken} -> ${toToken}, amount: ${amountWei}, taker: ${taker}, retry: ${retry}`);
469
470
  const params = {
470
471
  sellTokenAddress: fromToken,
471
472
  buyTokenAddress: toToken,
@@ -19472,10 +19473,11 @@ var SenseiVault = class extends BaseStrategy {
19472
19473
  const CACHE_KEY = "xSTRKPrice";
19473
19474
  const existingCacheData = this.getCache(CACHE_KEY);
19474
19475
  if (existingCacheData) return existingCacheData;
19476
+ let AMOUNT = 100;
19475
19477
  const params = {
19476
19478
  sellTokenAddress: this.metadata.additionalInfo.secondaryToken.address.address,
19477
19479
  buyTokenAddress: this.metadata.additionalInfo.mainToken.address.address,
19478
- sellAmount: BigInt(new Web3Number("1", 18).toWei()),
19480
+ sellAmount: BigInt(new Web3Number(AMOUNT.toString(), 18).toWei()),
19479
19481
  takerAddress: this.address.address
19480
19482
  };
19481
19483
  logger.verbose("getSecondaryTokenPriceRelativeToMain [1]", params);
@@ -19494,7 +19496,7 @@ var SenseiVault = class extends BaseStrategy {
19494
19496
  Web3Number.fromWei(firstQuote.buyAmount.toString(), 18).toFixed(
19495
19497
  6
19496
19498
  )
19497
- );
19499
+ ) / AMOUNT;
19498
19500
  logger.verbose("getSecondaryTokenPriceRelativeToMain [2]", price);
19499
19501
  this.setCache(CACHE_KEY, price);
19500
19502
  return price;
package/dist/index.js CHANGED
@@ -611,9 +611,10 @@ function getTrovesEndpoint() {
611
611
  }
612
612
 
613
613
  // src/modules/avnu.ts
614
- var AvnuWrapper = class {
614
+ var AvnuWrapper = class _AvnuWrapper {
615
615
  async getQuotes(fromToken, toToken, amountWei, taker, retry = 0, excludeSources = ["Haiko(Solvers)"]) {
616
616
  const MAX_RETRY = 5;
617
+ logger.verbose(`${_AvnuWrapper.name}: getQuotes => Getting quotes for ${fromToken} -> ${toToken}, amount: ${amountWei}, taker: ${taker}, retry: ${retry}`);
617
618
  const params = {
618
619
  sellTokenAddress: fromToken,
619
620
  buyTokenAddress: toToken,
@@ -19473,10 +19474,11 @@ var SenseiVault = class extends BaseStrategy {
19473
19474
  const CACHE_KEY = "xSTRKPrice";
19474
19475
  const existingCacheData = this.getCache(CACHE_KEY);
19475
19476
  if (existingCacheData) return existingCacheData;
19477
+ let AMOUNT = 100;
19476
19478
  const params = {
19477
19479
  sellTokenAddress: this.metadata.additionalInfo.secondaryToken.address.address,
19478
19480
  buyTokenAddress: this.metadata.additionalInfo.mainToken.address.address,
19479
- sellAmount: BigInt(new Web3Number("1", 18).toWei()),
19481
+ sellAmount: BigInt(new Web3Number(AMOUNT.toString(), 18).toWei()),
19480
19482
  takerAddress: this.address.address
19481
19483
  };
19482
19484
  logger.verbose("getSecondaryTokenPriceRelativeToMain [1]", params);
@@ -19495,7 +19497,7 @@ var SenseiVault = class extends BaseStrategy {
19495
19497
  Web3Number.fromWei(firstQuote.buyAmount.toString(), 18).toFixed(
19496
19498
  6
19497
19499
  )
19498
- );
19500
+ ) / AMOUNT;
19499
19501
  logger.verbose("getSecondaryTokenPriceRelativeToMain [2]", price);
19500
19502
  this.setCache(CACHE_KEY, price);
19501
19503
  return price;
package/dist/index.mjs CHANGED
@@ -504,9 +504,10 @@ function getTrovesEndpoint() {
504
504
  }
505
505
 
506
506
  // src/modules/avnu.ts
507
- var AvnuWrapper = class {
507
+ var AvnuWrapper = class _AvnuWrapper {
508
508
  async getQuotes(fromToken, toToken, amountWei, taker, retry = 0, excludeSources = ["Haiko(Solvers)"]) {
509
509
  const MAX_RETRY = 5;
510
+ logger.verbose(`${_AvnuWrapper.name}: getQuotes => Getting quotes for ${fromToken} -> ${toToken}, amount: ${amountWei}, taker: ${taker}, retry: ${retry}`);
510
511
  const params = {
511
512
  sellTokenAddress: fromToken,
512
513
  buyTokenAddress: toToken,
@@ -19370,10 +19371,11 @@ var SenseiVault = class extends BaseStrategy {
19370
19371
  const CACHE_KEY = "xSTRKPrice";
19371
19372
  const existingCacheData = this.getCache(CACHE_KEY);
19372
19373
  if (existingCacheData) return existingCacheData;
19374
+ let AMOUNT = 100;
19373
19375
  const params = {
19374
19376
  sellTokenAddress: this.metadata.additionalInfo.secondaryToken.address.address,
19375
19377
  buyTokenAddress: this.metadata.additionalInfo.mainToken.address.address,
19376
- sellAmount: BigInt(new Web3Number("1", 18).toWei()),
19378
+ sellAmount: BigInt(new Web3Number(AMOUNT.toString(), 18).toWei()),
19377
19379
  takerAddress: this.address.address
19378
19380
  };
19379
19381
  logger.verbose("getSecondaryTokenPriceRelativeToMain [1]", params);
@@ -19392,7 +19394,7 @@ var SenseiVault = class extends BaseStrategy {
19392
19394
  Web3Number.fromWei(firstQuote.buyAmount.toString(), 18).toFixed(
19393
19395
  6
19394
19396
  )
19395
- );
19397
+ ) / AMOUNT;
19396
19398
  logger.verbose("getSecondaryTokenPriceRelativeToMain [2]", price);
19397
19399
  this.setCache(CACHE_KEY, price);
19398
19400
  return price;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.1.76",
3
+ "version": "1.1.78",
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",
@@ -37,7 +37,7 @@ export class AvnuWrapper {
37
37
  excludeSources = ['Haiko(Solvers)']
38
38
  ): Promise<Quote> {
39
39
  const MAX_RETRY = 5;
40
- // logger.verbose(`${AvnuWrapper.name}: getQuotes => Getting quotes for ${fromToken} -> ${toToken}, amount: ${amountWei}, taker: ${taker}, retry: ${retry}`);
40
+ logger.verbose(`${AvnuWrapper.name}: getQuotes => Getting quotes for ${fromToken} -> ${toToken}, amount: ${amountWei}, taker: ${taker}, retry: ${retry}`);
41
41
  const params: any = {
42
42
  sellTokenAddress: fromToken,
43
43
  buyTokenAddress: toToken,
@@ -208,10 +208,11 @@ export class SenseiVault extends BaseStrategy<
208
208
  const existingCacheData = this.getCache<number>(CACHE_KEY);
209
209
  if (existingCacheData) return existingCacheData;
210
210
 
211
+ let AMOUNT = 100;
211
212
  const params: QuoteRequest = {
212
213
  sellTokenAddress: this.metadata.additionalInfo.secondaryToken.address.address,
213
214
  buyTokenAddress: this.metadata.additionalInfo.mainToken.address.address,
214
- sellAmount: BigInt(new Web3Number('1', 18).toWei()),
215
+ sellAmount: BigInt(new Web3Number(AMOUNT.toString(), 18).toWei()),
215
216
  takerAddress: this.address.address,
216
217
  };
217
218
  logger.verbose('getSecondaryTokenPriceRelativeToMain [1]', params);
@@ -231,7 +232,7 @@ export class SenseiVault extends BaseStrategy<
231
232
  Web3Number.fromWei(firstQuote.buyAmount.toString(), 18).toFixed(
232
233
  6,
233
234
  ),
234
- );
235
+ ) / AMOUNT;
235
236
  logger.verbose('getSecondaryTokenPriceRelativeToMain [2]', price);
236
237
  this.setCache(CACHE_KEY, price); // cache for 1 min
237
238
  return price;