@haven-fi/solauto-sdk 1.0.189 → 1.0.190

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"marginfiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/marginfiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAa,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EACL,IAAI,EAKL,MAAM,iBAAiB,CAAC;AAczB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,GAAG,qBAAqB,CAU3E;AAED,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,GAAG,EACR,MAAM,EAAE;IACN,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB,EACD,IAAI,EAAE;IACJ,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB,EACD,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA+D3B;AAED,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CACR;IAAE,eAAe,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,EAAE,CAC/E,CAwDA;AAgED,wBAAsB,+BAA+B,CACnD,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,SAAS,EAC5B,UAAU,CAAC,EAAE,SAAS,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AS,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,EAAE,CAC/E,CAwDA;AAgED,wBAAsB,+BAA+B,CACnD,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,SAAS,EAC5B,UAAU,CAAC,EAAE,SAAS,EACtB,QAAQ,CAAC,EAAE,SAAS,EACpB,mBAAmB,CAAC,EAAE,mBAAmB,GACxC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CA6JpC;AA+DD,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyB3B"}
@@ -183,7 +183,8 @@ async function getMarginfiAccountPositionState(umi, marginfiAccountPk, supplyMin
183
183
  if (!supplyUsage) {
184
184
  supplyUsage = await getTokenUsage(umi, supplyBank, true, 0, livePositionUpdates?.supplyAdjustment);
185
185
  }
186
- if (constants_1.TOKEN_INFO[(0, umi_web3js_adapters_1.toWeb3JsPublicKey)(supplyBank.mint).toString()].isStableCoin && debtBank === null) {
186
+ if (constants_1.TOKEN_INFO[supplyBank.mint.toString()].isStableCoin &&
187
+ (debtBank === null || constants_1.TOKEN_INFO[debtBank.mint.toString()].isStableCoin)) {
187
188
  return undefined;
188
189
  }
189
190
  if (!debtUsage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.189",
3
+ "version": "1.0.190",
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",
@@ -343,7 +343,10 @@ export async function getMarginfiAccountPositionState(
343
343
  );
344
344
  }
345
345
 
346
- if (TOKEN_INFO[toWeb3JsPublicKey(supplyBank.mint).toString()].isStableCoin && debtBank === null) {
346
+ if (
347
+ TOKEN_INFO[supplyBank.mint.toString()].isStableCoin &&
348
+ (debtBank === null || TOKEN_INFO[debtBank.mint.toString()].isStableCoin)
349
+ ) {
347
350
  return undefined;
348
351
  }
349
352
 
@@ -18,7 +18,7 @@ import {
18
18
  } from "../../src/transactions/transactionsManager";
19
19
  import { PublicKey } from "@solana/web3.js";
20
20
  import { USDC_MINT } from "../../src/constants";
21
- import { buildHeliusApiUrl } from "../../src/utils";
21
+ import { buildHeliusApiUrl, getMarginfiAccountPositionState } from "../../src/utils";
22
22
 
23
23
  describe("Solauto Marginfi tests", async () => {
24
24
  // const signer = setupTest();
@@ -159,11 +159,13 @@ describe("Solauto Marginfi tests", async () => {
159
159
  // )
160
160
  // );
161
161
 
162
- await new TransactionsManager(
163
- client,
164
- undefined,
165
- !payForTransactions ? "only-simulate" : "normal",
166
- useJitoBundle
167
- ).clientSend(transactionItems);
162
+ // await new TransactionsManager(
163
+ // client,
164
+ // undefined,
165
+ // !payForTransactions ? "only-simulate" : "normal",
166
+ // useJitoBundle
167
+ // ).clientSend(transactionItems);
168
+
169
+ console.log(await getMarginfiAccountPositionState(client.umi, new PublicKey("8SZUhT1Jwiz1LKkeSsBwvwZyKH1UrzW3r8yiC6R3LLf7")));
168
170
  });
169
171
  });