@haven-fi/solauto-sdk 1.0.716 → 1.0.718

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":"transactionUtils.d.ts","sourceRoot":"","sources":["../../../src/services/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAKxE,OAAO,EAIL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAiBlC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AA4BjE,OAAO,EAAE,qBAAqB,EAAyB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AA0L/F,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAyF7B;AA+LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAuC5C;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,kBAAkB,EAAE,EACzB,KAAK,EAAE,KAAK,EACZ,oBAAoB,CAAC,EAAE,OAAO,EAC9B,kBAAkB,CAAC,EAAE,kBAAkB;;;;EAuHxC;AAED,wBAAgB,cAAc,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,8JAErE"}
1
+ {"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../../src/services/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAKxE,OAAO,EAIL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAiBlC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AA4BjE,OAAO,EACL,qBAAqB,EAErB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAkMrB,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAyF7B;AA+LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAuC5C;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,kBAAkB,EAAE,EACzB,KAAK,EAAE,KAAK,EACZ,oBAAoB,CAAC,EAAE,OAAO,EAC9B,kBAAkB,CAAC,EAAE,kBAAkB;;;;EAuHxC;AAED,wBAAgB,cAAc,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,8JAKrE"}
@@ -102,16 +102,20 @@ async function transactionChoresBefore(client, accountsGettingCreated, solautoAc
102
102
  const tokenAccount = (0, generated_1.isSolautoAction)("Withdraw", solautoAction)
103
103
  ? client.signerSupplyTa
104
104
  : client.signerDebtTa;
105
+ console.log("withdraw", (0, generated_1.isSolautoAction)("Withdraw", solautoAction));
106
+ console.log(tokenAccount);
107
+ console.log("already getting created", accountsGettingCreated.includes(tokenAccount.toString()));
105
108
  if (accountsGettingCreated.includes(tokenAccount.toString())) {
106
109
  continue;
107
110
  }
108
- if (!(0, utils_1.getSolanaAccountCreated)(client.umi, tokenAccount)) {
111
+ if (!(await (0, utils_1.getSolanaAccountCreated)(client.umi, tokenAccount))) {
109
112
  chores = chores.add((0, utils_1.createAssociatedTokenAccountUmiIx)(client.signer, (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(client.signer.publicKey), (0, generated_1.isSolautoAction)("Withdraw", solautoAction)
110
113
  ? client.pos.supplyMint
111
114
  : client.pos.debtMint));
112
115
  accountsGettingCreated.push(tokenAccount.toString());
113
116
  }
114
117
  }
118
+ console.log(chores.getInstructions().length);
115
119
  return chores;
116
120
  }
117
121
  async function rebalanceChoresBefore(client, tx, accountsGettingCreated) {
@@ -427,5 +431,6 @@ function getErrorInfo(umi, txs, error, simulationSuccessful, priorityFeeSetting)
427
431
  return errData;
428
432
  }
429
433
  function usePriorityFee(priorityFeeSetting) {
430
- return priorityFeeSetting !== undefined && priorityFeeSetting !== types_1.PriorityFeeSetting.None;
434
+ return (priorityFeeSetting !== undefined &&
435
+ priorityFeeSetting !== types_1.PriorityFeeSetting.None);
431
436
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.716",
3
+ "version": "1.0.718",
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",
@@ -56,7 +56,11 @@ import {
56
56
  getJupiterErrorFromCode,
57
57
  JUPITER_PROGRAM_ID,
58
58
  } from "../../jupiter-sdk";
59
- import { TransactionItemInputs, BundleSimulationError, PriorityFeeSetting } from "../../types";
59
+ import {
60
+ TransactionItemInputs,
61
+ BundleSimulationError,
62
+ PriorityFeeSetting,
63
+ } from "../../types";
60
64
  import { isMarginfiProgram } from "../../constants";
61
65
 
62
66
  interface wSolTokenUsage {
@@ -221,11 +225,18 @@ async function transactionChoresBefore(
221
225
  const tokenAccount = isSolautoAction("Withdraw", solautoAction)
222
226
  ? client.signerSupplyTa
223
227
  : client.signerDebtTa;
228
+
229
+ console.log("withdraw", isSolautoAction("Withdraw", solautoAction));
230
+ console.log(tokenAccount);
231
+ console.log(
232
+ "already getting created",
233
+ accountsGettingCreated.includes(tokenAccount.toString())
234
+ );
224
235
  if (accountsGettingCreated.includes(tokenAccount.toString())) {
225
236
  continue;
226
237
  }
227
238
 
228
- if (!getSolanaAccountCreated(client.umi, tokenAccount)) {
239
+ if (!(await getSolanaAccountCreated(client.umi, tokenAccount))) {
229
240
  chores = chores.add(
230
241
  createAssociatedTokenAccountUmiIx(
231
242
  client.signer,
@@ -239,6 +250,7 @@ async function transactionChoresBefore(
239
250
  }
240
251
  }
241
252
 
253
+ console.log(chores.getInstructions().length);
242
254
  return chores;
243
255
  }
244
256
 
@@ -729,5 +741,8 @@ export function getErrorInfo(
729
741
  }
730
742
 
731
743
  export function usePriorityFee(priorityFeeSetting?: PriorityFeeSetting) {
732
- return priorityFeeSetting !== undefined && priorityFeeSetting !== PriorityFeeSetting.None;
733
- }
744
+ return (
745
+ priorityFeeSetting !== undefined &&
746
+ priorityFeeSetting !== PriorityFeeSetting.None
747
+ );
748
+ }