@haven-fi/solauto-sdk 1.0.419 → 1.0.420

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.
@@ -171,14 +171,15 @@ class TransactionsManager {
171
171
  let newSet = new TransactionSet(this.txHandler, this.lookupTables, [
172
172
  item,
173
173
  ]);
174
- // for (let j = i; j >= 0; j--) {
175
- // if (await newSet.fitsWith(items[j])) {
176
- // newSet.prepend(items[j]);
177
- // i--;
178
- // } else {
179
- // break;
180
- // }
181
- // }
174
+ for (let j = i; j >= 0; j--) {
175
+ if (await newSet.fitsWith(items[j])) {
176
+ newSet.prepend(items[j]);
177
+ i--;
178
+ }
179
+ else {
180
+ break;
181
+ }
182
+ }
182
183
  transactionSets.unshift(newSet);
183
184
  }
184
185
  }
@@ -211,14 +211,15 @@ async function sendJitoBundledTransactions(umi, connection, signer, txs, txType,
211
211
  simulationResults = await simulateJitoBundle(umi, builtTxs);
212
212
  }
213
213
  if (txType !== "only-simulate") {
214
+ const signers = [...builtTxs].map((tx) => getRequiredSigners(tx.message));
215
+ if (Array.from(new Set(signers.flatMap(x => x).filter(x => x.publicKey))).length > 1) {
216
+ (0, generalUtils_1.consoleLog)("Signers:", signers);
217
+ throw new Error("Unexpected error 301. Please retry.");
218
+ }
214
219
  onAwaitingSign?.();
215
- console.log("Signers expected:");
216
- (0, generalUtils_1.consoleLog)([...builtTxs].map((tx) => getRequiredSigners(tx.message)));
217
220
  builtTxs = await umiToVersionedTransactions(umi, latestBlockhash, signer, txs, true, feeEstimates, simulationResults
218
221
  ? simulationResults.map((x) => x.unitsConsumed * 1.15)
219
222
  : undefined);
220
- console.log("Signers:");
221
- (0, generalUtils_1.consoleLog)([...builtTxs].map((tx) => getRequiredSigners(tx.message)));
222
223
  const serializedTxs = builtTxs.map((x) => x.serialize());
223
224
  if (serializedTxs.find((x) => x.length > 1232)) {
224
225
  throw new Error("A transaction is too large");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.419",
3
+ "version": "1.0.420",
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",
@@ -263,14 +263,14 @@ export class TransactionsManager {
263
263
  let newSet = new TransactionSet(this.txHandler, this.lookupTables, [
264
264
  item,
265
265
  ]);
266
- // for (let j = i; j >= 0; j--) {
267
- // if (await newSet.fitsWith(items[j])) {
268
- // newSet.prepend(items[j]);
269
- // i--;
270
- // } else {
271
- // break;
272
- // }
273
- // }
266
+ for (let j = i; j >= 0; j--) {
267
+ if (await newSet.fitsWith(items[j])) {
268
+ newSet.prepend(items[j]);
269
+ i--;
270
+ } else {
271
+ break;
272
+ }
273
+ }
274
274
  transactionSets.unshift(newSet);
275
275
  }
276
276
  }
@@ -345,10 +345,13 @@ export async function sendJitoBundledTransactions(
345
345
  }
346
346
 
347
347
  if (txType !== "only-simulate") {
348
- onAwaitingSign?.();
348
+ const signers = [...builtTxs].map((tx) => getRequiredSigners(tx.message));
349
+ if (Array.from(new Set(signers.flatMap(x => x).filter(x => x.publicKey))).length > 1) {
350
+ consoleLog("Signers:", signers);
351
+ throw new Error("Unexpected error 301. Please retry.");
352
+ }
349
353
 
350
- console.log("Signers expected:");
351
- consoleLog([...builtTxs].map((tx) => getRequiredSigners(tx.message)));
354
+ onAwaitingSign?.();
352
355
 
353
356
  builtTxs = await umiToVersionedTransactions(
354
357
  umi,
@@ -362,9 +365,6 @@ export async function sendJitoBundledTransactions(
362
365
  : undefined
363
366
  );
364
367
 
365
- console.log("Signers:");
366
- consoleLog([...builtTxs].map((tx) => getRequiredSigners(tx.message)));
367
-
368
368
  const serializedTxs = builtTxs.map((x) => x.serialize());
369
369
  if (serializedTxs.find((x) => x.length > 1232)) {
370
370
  throw new Error("A transaction is too large");