@haven-fi/solauto-sdk 1.0.220 → 1.0.221

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAInB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAuBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAyCzD,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAO7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAqLjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAoH7B;AAkLD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,aAAa,oBA2CzE;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsH5C;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsC5C;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG;;;;EAwC9D"}
1
+ {"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAInB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAuBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAwCzD,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAO7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAqLjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAkH7B;AAkLD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,aAAa,oBA2CzE;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsH5C;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsC5C;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG;;;;EAwC9D"}
@@ -128,8 +128,6 @@ async function rebalanceChoresBefore(client, tx, accountsGettingCreated) {
128
128
  .some((t) => t.keys.some((k) => (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(k.pubkey).equals(key)));
129
129
  const checkReferralSupplyTa = client.referredBySupplyTa() && usesAccount(client.referredBySupplyTa());
130
130
  const checkReferralDebtTa = client.referredByDebtTa() && usesAccount(client.referredByDebtTa());
131
- const checkSolautoFeesSupplyTa = usesAccount(client.solautoFeesSupplyTa);
132
- const checkSolautoFeesDebtTa = usesAccount(client.solautoFeesDebtTa);
133
131
  const checkIntermediaryMfiAccount = client.lendingPlatform === generated_1.LendingPlatform.Marginfi &&
134
132
  usesAccount(client.intermediaryMarginfiAccountPk);
135
133
  const checkSignerSupplyTa = usesAccount(client.signerSupplyTa);
@@ -1 +1 @@
1
- {"version":3,"file":"generalUtils.d.ts","sourceRoot":"","sources":["../../src/utils/generalUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,eAAe,EAEf,GAAG,EACH,SAAS,IAAI,YAAY,EAC1B,MAAM,0BAA0B,CAAC;AAKlC,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI/C;AACD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAO1C;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,SAAS,GACZ,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAEnE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAU1E;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAwD5E;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,GACzC,MAAM,GAAG,SAAS,CAKpB;AAED,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,GAAG,IAA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E,KAAK,KAAK,CAAC,CAAC;AAEjE,wBAAgB,2BAA2B,CAAC,CAAC,EAC3C,EAAE,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,EACtC,OAAO,GAAE,MAAU,EACnB,KAAK,GAAE,MAAY,EACnB,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,CAAC,CAAC,CA8BZ"}
@@ -64,10 +64,8 @@ async function fetchTokenPrices(mints) {
64
64
  const prices = await retryWithExponentialBackoff(async () => {
65
65
  let resp = await getReq();
66
66
  let status = resp.status;
67
- while (status !== 200) {
68
- await new Promise((resolve) => setTimeout(resolve, 1000));
69
- resp = await getReq();
70
- status = resp.status;
67
+ if (status !== 200) {
68
+ throw new Error(JSON.stringify(resp));
71
69
  }
72
70
  const json = await resp.json();
73
71
  const prices = json.parsed.map((x) => {
@@ -1 +1 @@
1
- {"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../../src/utils/solanaUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,UAAU,EACV,SAAS,EAIT,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAElE,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,UAErD;AAED,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,UAE3D;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,GACb,CAAC,UAAU,EAAE,GAAG,CAAC,CAInB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,sBAAsB,GACzB,kBAAkB,CAMpB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAA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,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,kBAAkB,CAKpB;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,GAAG,EACR,oBAAoB,EAAE,MAAM,EAAE,GAC7B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAkBpC;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,kBAAkB,EACtB,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,CAAC,EAAE,MAAM,sBA4D1B;AAmBD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,kBAAkB,EACtB,eAAe,EAAE,kBAAkB,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsB7B;AAED,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,kBAAkB,EACtB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,GAAE,kBAA+C,EAChE,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAmEjC"}
@@ -180,6 +180,7 @@ async function sendSingleOptimizedTransaction(umi, connection, tx, txType, attem
180
180
  send: {
181
181
  skipPreflight: true,
182
182
  commitment: "confirmed",
183
+ maxRetries: 0
183
184
  },
184
185
  confirm: { commitment: "confirmed" },
185
186
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.220",
3
+ "version": "1.0.221",
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",
@@ -58,7 +58,6 @@ import {
58
58
  positionStateWithLatestPrices,
59
59
  } from "../utils/solauto/generalUtils";
60
60
  import {
61
- getReferralState,
62
61
  getTokenAccount,
63
62
  getTokenAccountData,
64
63
  } from "../utils/accountUtils";
@@ -278,8 +277,6 @@ export async function rebalanceChoresBefore(
278
277
  client.referredBySupplyTa() && usesAccount(client.referredBySupplyTa()!);
279
278
  const checkReferralDebtTa =
280
279
  client.referredByDebtTa() && usesAccount(client.referredByDebtTa()!);
281
- const checkSolautoFeesSupplyTa = usesAccount(client.solautoFeesSupplyTa);
282
- const checkSolautoFeesDebtTa = usesAccount(client.solautoFeesDebtTa);
283
280
  const checkIntermediaryMfiAccount =
284
281
  client.lendingPlatform === LendingPlatform.Marginfi &&
285
282
  usesAccount(
@@ -82,10 +82,8 @@ export async function fetchTokenPrices(mints: PublicKey[]): Promise<number[]> {
82
82
  async () => {
83
83
  let resp = await getReq();
84
84
  let status = resp.status;
85
- while (status !== 200) {
86
- await new Promise((resolve) => setTimeout(resolve, 1000));
87
- resp = await getReq();
88
- status = resp.status;
85
+ if (status !== 200) {
86
+ throw new Error(JSON.stringify(resp));
89
87
  }
90
88
 
91
89
  const json = await resp.json();
@@ -339,6 +339,7 @@ export async function sendSingleOptimizedTransaction(
339
339
  send: {
340
340
  skipPreflight: true,
341
341
  commitment: "confirmed",
342
+ maxRetries: 0
342
343
  },
343
344
  confirm: { commitment: "confirmed" },
344
345
  });
@@ -25,8 +25,8 @@ import { buildHeliusApiUrl } from "../../src/utils";
25
25
  import { PriorityFeeSetting } from "../../src/types";
26
26
 
27
27
  describe("Solauto Marginfi tests", async () => {
28
- const signer = setupTest();
29
- // const signer = setupTest("solauto-manager");
28
+ // const signer = setupTest();
29
+ const signer = setupTest("solauto-manager");
30
30
 
31
31
  const payForTransactions = true;
32
32
  const useJitoBundle = false;
@@ -128,7 +128,7 @@ describe("Solauto Marginfi tests", async () => {
128
128
  transactionItems.push(
129
129
  new TransactionItem(
130
130
  async (attemptNum) =>
131
- await buildSolautoRebalanceTransaction(client, 7000, attemptNum),
131
+ await buildSolautoRebalanceTransaction(client, undefined, attemptNum),
132
132
  "rebalance"
133
133
  )
134
134
  );
@@ -165,6 +165,6 @@ describe("Solauto Marginfi tests", async () => {
165
165
  undefined,
166
166
  !payForTransactions ? "only-simulate" : "normal",
167
167
  useJitoBundle,
168
- ).clientSend(transactionItems, PriorityFeeSetting.High);
168
+ ).clientSend(transactionItems, PriorityFeeSetting.Default);
169
169
  });
170
170
  });