@haven-fi/solauto-sdk 1.0.28 → 1.0.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,3 @@
1
1
  export * from './accounts';
2
+ export * from './solauto';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./accounts"), exports);
18
+ __exportStar(require("./solauto"), exports);
@@ -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,EAOL,MAAM,iBAAiB,CAAC;AAUzB,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,wBAAwB,CAAC,EACvC,IAAI,EACJ,IAAI,GACL,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,qBAAqB,CAWxB;AAED,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,CAAC,MAAM,EAAE,M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AI,EAChB,QAAQ,EAAE,IAAI,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkC3B;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,CA6CA;AAoDD,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,CA4IpC;AA+DD,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA0B3B"}
@@ -25,7 +25,7 @@ function findMarginfiBankAccounts({ mint, bank, }) {
25
25
  }
26
26
  exports.findMarginfiBankAccounts = findMarginfiBankAccounts;
27
27
  async function getMaxLtvAndLiqThreshold(supplyBank, debtBank, supplyPrice) {
28
- if (!solautoConstants_1.PRICES[supplyBank.mint.toString()].price) {
28
+ if (!supplyPrice) {
29
29
  const [price] = await (0, generalUtils_1.getTokenPrices)([(0, umi_web3js_adapters_1.toWeb3JsPublicKey)(supplyBank.mint)]);
30
30
  supplyPrice = price;
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
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",
@@ -1 +1,2 @@
1
1
  export * from './accounts';
2
+ export * from './solauto';
@@ -5,8 +5,6 @@ import {
5
5
  Bank,
6
6
  getMarginfiAccountSize,
7
7
  MARGINFI_PROGRAM_ID,
8
- MarginfiAccount,
9
- safeFetchAllMarginfiAccount,
10
8
  safeFetchBank,
11
9
  safeFetchMarginfiAccount,
12
10
  } from "../marginfi-sdk";
@@ -49,7 +47,7 @@ export async function getMaxLtvAndLiqThreshold(
49
47
  debtBank: Bank,
50
48
  supplyPrice?: number
51
49
  ): Promise<[number, number]> {
52
- if (!PRICES[supplyBank.mint.toString()].price) {
50
+ if (!supplyPrice) {
53
51
  const [price] = await getTokenPrices([toWeb3JsPublicKey(supplyBank.mint)]);
54
52
  supplyPrice = price;
55
53
  }