@haven-fi/solauto-sdk 1.0.19 → 1.0.21

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.
@@ -180,7 +180,7 @@ class TransactionsManager {
180
180
  const updateLookupTable = await this.client.updateLookupTable();
181
181
  if (updateLookupTable && updateLookupTable?.needsToBeIsolated) {
182
182
  this.updateStatus("update lookup table", TransactionStatus.Processing);
183
- await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum) => await (0, solanaUtils_1.sendSingleOptimizedTransaction)(this.client.umi, this.client.connection, updateLookupTable.updateLutTx, this.simulateOnly, attemptNum), 2, 150, this.errorsToThrow);
183
+ await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum) => await (0, solanaUtils_1.sendSingleOptimizedTransaction)(this.client.umi, this.client.connection, updateLookupTable.updateLutTx, this.simulateOnly, attemptNum), 3, 150, this.errorsToThrow);
184
184
  this.updateStatus("update lookup table", TransactionStatus.Successful);
185
185
  }
186
186
  for (const item of this.items) {
@@ -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,EAAE,eAAe,EAAa,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAK3E,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,CAGlB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAEnE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OA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gB,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"}
@@ -88,12 +88,6 @@ function retryWithExponentialBackoff(fn, retries = 5, delay = 150, errorsToThrow
88
88
  .then(resolve)
89
89
  .catch((error) => {
90
90
  attemptNum++;
91
- console.log(errorsToThrow?.length);
92
- if (errorsToThrow) {
93
- for (const e of errorsToThrow) {
94
- console.log(error instanceof e);
95
- }
96
- }
97
91
  if (errorsToThrow &&
98
92
  errorsToThrow.some((errorType) => error instanceof errorType)) {
99
93
  reject(error);
@@ -120,7 +120,7 @@ function assembleFinalTransaction(signer, tx, computeUnitPrice, computeUnitLimit
120
120
  exports.assembleFinalTransaction = assembleFinalTransaction;
121
121
  async function simulateTransaction(connection, transaction) {
122
122
  const simulationResult = await connection.simulateTransaction(transaction, {
123
- sigVerify: true,
123
+ sigVerify: false,
124
124
  });
125
125
  if (simulationResult.value.err) {
126
126
  simulationResult.value.logs?.forEach((x) => {
@@ -149,7 +149,7 @@ async function sendSingleOptimizedTransaction(umi, connection, tx, simulateOnly,
149
149
  console.log("Serialized transaction size: ", tx.getTransactionSize(umi));
150
150
  const feeEstimate = await getComputeUnitPriceEstimate(umi, tx, attemptNum);
151
151
  console.log("Compute unit price: ", feeEstimate);
152
- const simulationResult = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await simulateTransaction(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(await (await assembleFinalTransaction(umi.identity, tx, feeEstimate, 1400000).setLatestBlockhash(umi)).buildAndSign(umi))));
152
+ const simulationResult = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await simulateTransaction(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(await (await assembleFinalTransaction(umi.identity, tx, feeEstimate, 1400000).setLatestBlockhash(umi)).build(umi))));
153
153
  const computeUnitLimit = Math.round(simulationResult.value.unitsConsumed * 1.1);
154
154
  console.log("Compute unit limit: ", computeUnitLimit);
155
155
  if (!simulateOnly) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
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",
@@ -259,7 +259,7 @@ export class TransactionsManager {
259
259
  this.simulateOnly,
260
260
  attemptNum
261
261
  ),
262
- 2,
262
+ 3,
263
263
  150,
264
264
  this.errorsToThrow
265
265
  );
@@ -111,12 +111,6 @@ export function retryWithExponentialBackoff<T>(
111
111
  .catch((error: Error) => {
112
112
  attemptNum++;
113
113
 
114
- console.log(errorsToThrow?.length);
115
- if (errorsToThrow) {
116
- for (const e of errorsToThrow) {
117
- console.log(error instanceof e);
118
- }
119
- }
120
114
  if (
121
115
  errorsToThrow &&
122
116
  errorsToThrow.some((errorType) => error instanceof errorType)
@@ -230,7 +230,7 @@ async function simulateTransaction(
230
230
  transaction: VersionedTransaction
231
231
  ): Promise<RpcResponseAndContext<SimulatedTransactionResponse>> {
232
232
  const simulationResult = await connection.simulateTransaction(transaction, {
233
- sigVerify: true,
233
+ sigVerify: false,
234
234
  });
235
235
  if (simulationResult.value.err) {
236
236
  simulationResult.value.logs?.forEach((x: any) => {
@@ -287,7 +287,7 @@ export async function sendSingleOptimizedTransaction(
287
287
  feeEstimate,
288
288
  1_400_000
289
289
  ).setLatestBlockhash(umi)
290
- ).buildAndSign(umi)
290
+ ).build(umi)
291
291
  )
292
292
  )
293
293
  );
@@ -141,7 +141,7 @@ describe("Solauto Marginfi tests", async () => {
141
141
  transactionItems,
142
142
  undefined,
143
143
  !payForTransactions,
144
- useJitoBundle
144
+ useJitoBundle,
145
145
  ).send();
146
146
  });
147
147
  });