@haven-fi/solauto-sdk 1.0.717 → 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;AAgM/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"}
@@ -108,8 +108,7 @@ async function transactionChoresBefore(client, accountsGettingCreated, solautoAc
108
108
  if (accountsGettingCreated.includes(tokenAccount.toString())) {
109
109
  continue;
110
110
  }
111
- console.log("exists", (0, utils_1.getSolanaAccountCreated)(client.umi, tokenAccount));
112
- if (!(0, utils_1.getSolanaAccountCreated)(client.umi, tokenAccount)) {
111
+ if (!(await (0, utils_1.getSolanaAccountCreated)(client.umi, tokenAccount))) {
113
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)
114
113
  ? client.pos.supplyMint
115
114
  : client.pos.debtMint));
@@ -432,5 +431,6 @@ function getErrorInfo(umi, txs, error, simulationSuccessful, priorityFeeSetting)
432
431
  return errData;
433
432
  }
434
433
  function usePriorityFee(priorityFeeSetting) {
435
- return priorityFeeSetting !== undefined && priorityFeeSetting !== types_1.PriorityFeeSetting.None;
434
+ return (priorityFeeSetting !== undefined &&
435
+ priorityFeeSetting !== types_1.PriorityFeeSetting.None);
436
436
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.717",
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,16 +225,18 @@ async function transactionChoresBefore(
221
225
  const tokenAccount = isSolautoAction("Withdraw", solautoAction)
222
226
  ? client.signerSupplyTa
223
227
  : client.signerDebtTa;
224
-
228
+
225
229
  console.log("withdraw", isSolautoAction("Withdraw", solautoAction));
226
230
  console.log(tokenAccount);
227
- console.log("already getting created", accountsGettingCreated.includes(tokenAccount.toString()))
231
+ console.log(
232
+ "already getting created",
233
+ accountsGettingCreated.includes(tokenAccount.toString())
234
+ );
228
235
  if (accountsGettingCreated.includes(tokenAccount.toString())) {
229
236
  continue;
230
237
  }
231
238
 
232
- console.log("exists", getSolanaAccountCreated(client.umi, tokenAccount))
233
- if (!getSolanaAccountCreated(client.umi, tokenAccount)) {
239
+ if (!(await getSolanaAccountCreated(client.umi, tokenAccount))) {
234
240
  chores = chores.add(
235
241
  createAssociatedTokenAccountUmiIx(
236
242
  client.signer,
@@ -735,5 +741,8 @@ export function getErrorInfo(
735
741
  }
736
742
 
737
743
  export function usePriorityFee(priorityFeeSetting?: PriorityFeeSetting) {
738
- return priorityFeeSetting !== undefined && priorityFeeSetting !== PriorityFeeSetting.None;
739
- }
744
+ return (
745
+ priorityFeeSetting !== undefined &&
746
+ priorityFeeSetting !== PriorityFeeSetting.None
747
+ );
748
+ }