@haven-fi/solauto-sdk 1.0.602 → 1.0.603

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.
@@ -1 +1 @@
1
- {"version":3,"file":"rebalanceSwapManager.d.ts","sourceRoot":"","sources":["../../../src/services/rebalance/rebalanceSwapManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAkB,UAAU,EAAa,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAapD,qBAAa,oBAAoB;IAQ7B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,2BAA2B,CAAC;IAV/B,UAAU,EAAG,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,cAAc,CAAkB;gBAG9B,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,eAAe,EACvB,cAAc,CAAC,EAAE,qBAAqB,YAAA,EACtC,2BAA2B,CAAC,EAAE,MAAM,YAAA;IAK9C,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,kCAAkC;YA6B5B,mBAAmB;IAoCjC,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,mBAAmB;IAIrB,aAAa,CAAC,UAAU,EAAE,MAAM;IA6EhC,aAAa;;;;;;CAWpB"}
1
+ {"version":3,"file":"rebalanceSwapManager.d.ts","sourceRoot":"","sources":["../../../src/services/rebalance/rebalanceSwapManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAkB,UAAU,EAAa,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAapD,qBAAa,oBAAoB;IAQ7B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,2BAA2B,CAAC;IAV/B,UAAU,EAAG,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,cAAc,CAAkB;gBAG9B,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,eAAe,EACvB,cAAc,CAAC,EAAE,qBAAqB,YAAA,EACtC,2BAA2B,CAAC,EAAE,MAAM,YAAA;IAK9C,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,kCAAkC;YA6B5B,mBAAmB;IAoCjC,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,mBAAmB;IAIrB,aAAa,CAAC,UAAU,EAAE,MAAM;IAkFhC,aAAa;;;;;;CAWpB"}
@@ -100,13 +100,16 @@ class RebalanceSwapManager {
100
100
  ? this.bigIntWithIncrement(outputAmount, this.flRequirements.flFeeBps ?? 0)
101
101
  : outputAmount
102
102
  : inputAmount;
103
+ const inputMint = (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(input.mint);
104
+ const outputMint = (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(output.mint);
105
+ const swappingMeme = (0, utils_1.tokenInfo)(inputMint).isMeme || (0, utils_1.tokenInfo)(outputMint).isMeme;
103
106
  const swapInput = {
104
- inputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(input.mint),
105
- outputMint: (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(output.mint),
107
+ inputMint,
108
+ outputMint,
106
109
  exactIn,
107
110
  exactOut,
108
111
  amount: swapAmount,
109
- slippageBps: (0, utils_1.tokenInfo)((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(input.mint)).isMeme ? 300 : 50,
112
+ slippageBps: swappingMeme ? 300 : 50,
110
113
  };
111
114
  (0, utils_1.consoleLog)("Swap input:", swapInput);
112
115
  if (exactIn && (rebalanceToZero || this.values.repayingCloseToMaxLtv)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.602",
3
+ "version": "1.0.603",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -166,13 +166,18 @@ export class RebalanceSwapManager {
166
166
  )
167
167
  : outputAmount
168
168
  : inputAmount;
169
+
170
+ const inputMint = toWeb3JsPublicKey(input.mint);
171
+ const outputMint = toWeb3JsPublicKey(output.mint);
172
+ const swappingMeme =
173
+ tokenInfo(inputMint).isMeme || tokenInfo(outputMint).isMeme;
169
174
  const swapInput: SwapInput = {
170
- inputMint: toWeb3JsPublicKey(input.mint),
171
- outputMint: toWeb3JsPublicKey(output.mint),
175
+ inputMint,
176
+ outputMint,
172
177
  exactIn,
173
178
  exactOut,
174
179
  amount: swapAmount,
175
- slippageBps: tokenInfo(toWeb3JsPublicKey(input.mint)).isMeme ? 300 : 50,
180
+ slippageBps: swappingMeme ? 300 : 50,
176
181
  };
177
182
  consoleLog("Swap input:", swapInput);
178
183
 
@@ -13,7 +13,6 @@ import {
13
13
  solautoAction,
14
14
  SolautoSettingsParametersInpArgs,
15
15
  toBaseUnit,
16
- tokenInfo,
17
16
  TransactionItem,
18
17
  TransactionsManager,
19
18
  USDC,