@haven-fi/solauto-sdk 1.0.717 → 1.0.719
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,
|
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;AAyLrB,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"}
|
@@ -92,8 +92,6 @@ async function transactionChoresBefore(client, accountsGettingCreated, solautoAc
|
|
92
92
|
chores = chores.add((0, utils_1.createAssociatedTokenAccountUmiIx)(client.signer, (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(client.signer.publicKey), spl_token_1.NATIVE_MINT));
|
93
93
|
accountsGettingCreated.push(wSolUsage.wSolTokenAccount.toString());
|
94
94
|
}
|
95
|
-
console.log(solautoActions);
|
96
|
-
console.log(accountsGettingCreated);
|
97
95
|
for (const solautoAction of solautoActions ?? []) {
|
98
96
|
if (!(0, generated_1.isSolautoAction)("Withdraw", solautoAction) &&
|
99
97
|
!(0, generated_1.isSolautoAction)("Borrow", solautoAction)) {
|
@@ -102,21 +100,16 @@ async function transactionChoresBefore(client, accountsGettingCreated, solautoAc
|
|
102
100
|
const tokenAccount = (0, generated_1.isSolautoAction)("Withdraw", solautoAction)
|
103
101
|
? client.signerSupplyTa
|
104
102
|
: 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()));
|
108
103
|
if (accountsGettingCreated.includes(tokenAccount.toString())) {
|
109
104
|
continue;
|
110
105
|
}
|
111
|
-
|
112
|
-
if (!(0, utils_1.getSolanaAccountCreated)(client.umi, tokenAccount)) {
|
106
|
+
if (!(await (0, utils_1.getSolanaAccountCreated)(client.umi, tokenAccount))) {
|
113
107
|
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
108
|
? client.pos.supplyMint
|
115
109
|
: client.pos.debtMint));
|
116
110
|
accountsGettingCreated.push(tokenAccount.toString());
|
117
111
|
}
|
118
112
|
}
|
119
|
-
console.log(chores.getInstructions().length);
|
120
113
|
return chores;
|
121
114
|
}
|
122
115
|
async function rebalanceChoresBefore(client, tx, accountsGettingCreated) {
|
@@ -432,5 +425,6 @@ function getErrorInfo(umi, txs, error, simulationSuccessful, priorityFeeSetting)
|
|
432
425
|
return errData;
|
433
426
|
}
|
434
427
|
function usePriorityFee(priorityFeeSetting) {
|
435
|
-
return priorityFeeSetting !== undefined &&
|
428
|
+
return (priorityFeeSetting !== undefined &&
|
429
|
+
priorityFeeSetting !== types_1.PriorityFeeSetting.None);
|
436
430
|
}
|
package/package.json
CHANGED
@@ -56,7 +56,11 @@ import {
|
|
56
56
|
getJupiterErrorFromCode,
|
57
57
|
JUPITER_PROGRAM_ID,
|
58
58
|
} from "../../jupiter-sdk";
|
59
|
-
import {
|
59
|
+
import {
|
60
|
+
TransactionItemInputs,
|
61
|
+
BundleSimulationError,
|
62
|
+
PriorityFeeSetting,
|
63
|
+
} from "../../types";
|
60
64
|
import { isMarginfiProgram } from "../../constants";
|
61
65
|
|
62
66
|
interface wSolTokenUsage {
|
@@ -208,8 +212,6 @@ async function transactionChoresBefore(
|
|
208
212
|
accountsGettingCreated.push(wSolUsage.wSolTokenAccount.toString());
|
209
213
|
}
|
210
214
|
|
211
|
-
console.log(solautoActions);
|
212
|
-
console.log(accountsGettingCreated);
|
213
215
|
for (const solautoAction of solautoActions ?? []) {
|
214
216
|
if (
|
215
217
|
!isSolautoAction("Withdraw", solautoAction) &&
|
@@ -221,16 +223,12 @@ async function transactionChoresBefore(
|
|
221
223
|
const tokenAccount = isSolautoAction("Withdraw", solautoAction)
|
222
224
|
? client.signerSupplyTa
|
223
225
|
: client.signerDebtTa;
|
224
|
-
|
225
|
-
console.log("withdraw", isSolautoAction("Withdraw", solautoAction));
|
226
|
-
console.log(tokenAccount);
|
227
|
-
console.log("already getting created", accountsGettingCreated.includes(tokenAccount.toString()))
|
226
|
+
|
228
227
|
if (accountsGettingCreated.includes(tokenAccount.toString())) {
|
229
228
|
continue;
|
230
229
|
}
|
231
230
|
|
232
|
-
|
233
|
-
if (!getSolanaAccountCreated(client.umi, tokenAccount)) {
|
231
|
+
if (!(await getSolanaAccountCreated(client.umi, tokenAccount))) {
|
234
232
|
chores = chores.add(
|
235
233
|
createAssociatedTokenAccountUmiIx(
|
236
234
|
client.signer,
|
@@ -244,7 +242,6 @@ async function transactionChoresBefore(
|
|
244
242
|
}
|
245
243
|
}
|
246
244
|
|
247
|
-
console.log(chores.getInstructions().length);
|
248
245
|
return chores;
|
249
246
|
}
|
250
247
|
|
@@ -735,5 +732,8 @@ export function getErrorInfo(
|
|
735
732
|
}
|
736
733
|
|
737
734
|
export function usePriorityFee(priorityFeeSetting?: PriorityFeeSetting) {
|
738
|
-
return
|
739
|
-
|
735
|
+
return (
|
736
|
+
priorityFeeSetting !== undefined &&
|
737
|
+
priorityFeeSetting !== PriorityFeeSetting.None
|
738
|
+
);
|
739
|
+
}
|