@haven-fi/solauto-sdk 1.0.246 → 1.0.248

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":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAK7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAMjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IARtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;gBAG3B,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAKV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;AAgFD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;I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AAC;IACtB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAVpB,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,YAAY,CAAe;gBAGzB,SAAS,EAAE,aAAa,GAAG,oBAAoB,EAC/C,cAAc,CAAC,GAAE,CAAC,QAAQ,EAAE,0BAA0B,KAAK,IAAI,aAAA,EAC/D,MAAM,CAAC,EAAE,kBAAkB,YAAA,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,aAAa,CAAC,EAAE,aAAa,YAAA,EAC7B,OAAO,GAAE,MAAU,EACnB,UAAU,GAAE,MAAY;YAQpB,uBAAuB;IAwCrC,OAAO,CAAC,YAAY;YA8CN,aAAa;IAoB3B,OAAO,CAAC,4BAA4B;IAUpC,OAAO,CAAC,mBAAmB;YAMb,SAAS;IAgBV,UAAU,CACrB,YAAY,EAAE,eAAe,EAAE,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IA4EzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,0BAA0B,CAAC;YA+BxB,qBAAqB;YAiDrB,cAAc;YAyBd,eAAe;CAkD9B"}
@@ -253,17 +253,13 @@ class TransactionsManager {
253
253
  await item.initialize();
254
254
  }
255
255
  const txAccounts = items.flatMap((x) => x.tx.getInstructions().flatMap((x) => x.keys.map((x) => x.pubkey)));
256
- console.log(Array.from(new Set(txAccounts)).map(x => x.toString()));
257
- const newAccountsUsage = Array.from(new Set(txAccounts)).reduce((count, pk) => {
256
+ const newAccountsUsage = txAccounts.reduce((count, pk) => {
258
257
  return updateLookupTable.accountsToAdd.find((x) => x.equals((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(pk)))
259
258
  ? count + 1
260
259
  : count;
261
260
  }, 0);
262
- console.log(updateLookupTable.accountsToAdd.map(x => x.toString()));
263
261
  isolatedLutTx = newAccountsUsage > 1;
264
- console.log(newAccountsUsage);
265
262
  }
266
- console.log(isolatedLutTx);
267
263
  if (updateLookupTable && isolatedLutTx) {
268
264
  await this.updateLut(updateLookupTable.tx);
269
265
  }
@@ -280,7 +276,7 @@ class TransactionsManager {
280
276
  choresBefore.prepend(updateLookupTable.tx);
281
277
  }
282
278
  if (choresBefore.getInstructions().length > 0) {
283
- const chore = new TransactionItem(async () => ({ tx: choresBefore }));
279
+ const chore = new TransactionItem(async () => ({ tx: choresBefore }), "account chores");
284
280
  await chore.initialize();
285
281
  items.unshift(chore);
286
282
  this.txHandler.log("Chores before: ", choresBefore.getInstructions().length);
@@ -308,8 +304,10 @@ class TransactionsManager {
308
304
  await item.initialize();
309
305
  }
310
306
  }
307
+ this.txHandler.log("Transaction items:", items.length);
311
308
  const itemSets = await this.assembleTransactionSets(items);
312
309
  this.updateStatusForSets(itemSets);
310
+ this.txHandler.log("Initial item sets:", itemSets.length);
313
311
  if (this.txType === "only-simulate" && itemSets.length > 1) {
314
312
  this.txHandler.log("Only simulate and more than 1 transaction. Skipping...");
315
313
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.246",
3
+ "version": "1.0.248",
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",
@@ -374,19 +374,15 @@ export class TransactionsManager {
374
374
  const txAccounts = items.flatMap((x) =>
375
375
  x.tx!.getInstructions().flatMap((x) => x.keys.map((x) => x.pubkey))
376
376
  );
377
- console.log(Array.from(new Set(txAccounts)).map(x => x.toString()));
378
- const newAccountsUsage = Array.from(new Set(txAccounts)).reduce((count, pk) => {
377
+ const newAccountsUsage = txAccounts.reduce((count, pk) => {
379
378
  return updateLookupTable.accountsToAdd.find((x) =>
380
379
  x.equals(toWeb3JsPublicKey(pk))
381
380
  )
382
381
  ? count + 1
383
382
  : count;
384
383
  }, 0);
385
- console.log(updateLookupTable.accountsToAdd.map(x => x.toString()));
386
384
  isolatedLutTx = newAccountsUsage > 1;
387
- console.log(newAccountsUsage);
388
385
  }
389
- console.log(isolatedLutTx);
390
386
  if (updateLookupTable && isolatedLutTx) {
391
387
  await this.updateLut(updateLookupTable.tx);
392
388
  }
@@ -410,7 +406,7 @@ export class TransactionsManager {
410
406
  choresBefore.prepend(updateLookupTable.tx);
411
407
  }
412
408
  if (choresBefore.getInstructions().length > 0) {
413
- const chore = new TransactionItem(async () => ({ tx: choresBefore }));
409
+ const chore = new TransactionItem(async () => ({ tx: choresBefore }), "account chores");
414
410
  await chore.initialize();
415
411
  items.unshift(chore);
416
412
  this.txHandler.log(
@@ -452,8 +448,10 @@ export class TransactionsManager {
452
448
  }
453
449
  }
454
450
 
451
+ this.txHandler.log("Transaction items:", items.length);
455
452
  const itemSets = await this.assembleTransactionSets(items);
456
453
  this.updateStatusForSets(itemSets);
454
+ this.txHandler.log("Initial item sets:", itemSets.length);
457
455
 
458
456
  if (this.txType === "only-simulate" && itemSets.length > 1) {
459
457
  this.txHandler.log(