@haven-fi/solauto-sdk 1.0.256 → 1.0.257
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;
|
|
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;AAO7D,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,EA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,CACrB,YAAY,EAAE,eAAe,EAAE,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IA4DzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,0BAA0B,CAAC;YA+BxB,qBAAqB;YAiDrB,cAAc;YAyBd,eAAe;CAkD9B"}
|
|
@@ -12,6 +12,7 @@ const transactionUtils_1 = require("./transactionUtils");
|
|
|
12
12
|
const types_1 = require("../types");
|
|
13
13
|
const web3_js_1 = require("@solana/web3.js");
|
|
14
14
|
// import { sendJitoBundledTransactions } from "../utils/jitoUtils";
|
|
15
|
+
const CHORES_TX_NAME = "account chores";
|
|
15
16
|
class TransactionTooLargeError extends Error {
|
|
16
17
|
constructor(message) {
|
|
17
18
|
super(message);
|
|
@@ -111,9 +112,12 @@ class TransactionSet {
|
|
|
111
112
|
return Array.from(new Set(this.items.map((x) => x.lookupTableAddresses).flat()));
|
|
112
113
|
}
|
|
113
114
|
name() {
|
|
114
|
-
|
|
115
|
+
let names = this.items
|
|
115
116
|
.filter((x) => x.tx && x.name !== undefined)
|
|
116
117
|
.map((x) => x.name.toLowerCase());
|
|
118
|
+
if (names.length > 1) {
|
|
119
|
+
names = names.filter(x => x !== CHORES_TX_NAME);
|
|
120
|
+
}
|
|
117
121
|
if (names.length >= 3) {
|
|
118
122
|
return [names.slice(0, -1).join(", "), names[names.length - 1]].join(", and ");
|
|
119
123
|
}
|
|
@@ -260,13 +264,13 @@ class TransactionsManager {
|
|
|
260
264
|
choresBefore.prepend(updateLookupTable.tx);
|
|
261
265
|
}
|
|
262
266
|
if (choresBefore.getInstructions().length > 0) {
|
|
263
|
-
const chore = new TransactionItem(async () => ({ tx: choresBefore }),
|
|
267
|
+
const chore = new TransactionItem(async () => ({ tx: choresBefore }), CHORES_TX_NAME);
|
|
264
268
|
await chore.initialize();
|
|
265
269
|
items.unshift(chore);
|
|
266
270
|
this.txHandler.log("Chores before: ", choresBefore.getInstructions().length);
|
|
267
271
|
}
|
|
268
272
|
if (choresAfter.getInstructions().length > 0) {
|
|
269
|
-
const chore = new TransactionItem(async () => ({ tx: choresAfter }));
|
|
273
|
+
const chore = new TransactionItem(async () => ({ tx: choresAfter }), CHORES_TX_NAME);
|
|
270
274
|
await chore.initialize();
|
|
271
275
|
items.push(chore);
|
|
272
276
|
this.txHandler.log("Chores after: ", choresAfter.getInstructions().length);
|
package/package.json
CHANGED
|
@@ -26,6 +26,8 @@ import { TransactionExpiredBlockheightExceededError } from "@solana/web3.js";
|
|
|
26
26
|
import { toWeb3JsPublicKey } from "@metaplex-foundation/umi-web3js-adapters";
|
|
27
27
|
// import { sendJitoBundledTransactions } from "../utils/jitoUtils";
|
|
28
28
|
|
|
29
|
+
const CHORES_TX_NAME = "account chores";
|
|
30
|
+
|
|
29
31
|
export class TransactionTooLargeError extends Error {
|
|
30
32
|
constructor(message: string) {
|
|
31
33
|
super(message);
|
|
@@ -171,9 +173,12 @@ class TransactionSet {
|
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
name(): string {
|
|
174
|
-
|
|
176
|
+
let names = this.items
|
|
175
177
|
.filter((x) => x.tx && x.name !== undefined)
|
|
176
178
|
.map((x) => x.name!.toLowerCase());
|
|
179
|
+
if (names.length > 1) {
|
|
180
|
+
names = names.filter(x => x !== CHORES_TX_NAME);
|
|
181
|
+
}
|
|
177
182
|
if (names.length >= 3) {
|
|
178
183
|
return [names.slice(0, -1).join(", "), names[names.length - 1]].join(
|
|
179
184
|
", and "
|
|
@@ -387,7 +392,10 @@ export class TransactionsManager {
|
|
|
387
392
|
choresBefore.prepend(updateLookupTable.tx);
|
|
388
393
|
}
|
|
389
394
|
if (choresBefore.getInstructions().length > 0) {
|
|
390
|
-
const chore = new TransactionItem(
|
|
395
|
+
const chore = new TransactionItem(
|
|
396
|
+
async () => ({ tx: choresBefore }),
|
|
397
|
+
CHORES_TX_NAME
|
|
398
|
+
);
|
|
391
399
|
await chore.initialize();
|
|
392
400
|
items.unshift(chore);
|
|
393
401
|
this.txHandler.log(
|
|
@@ -396,7 +404,7 @@ export class TransactionsManager {
|
|
|
396
404
|
);
|
|
397
405
|
}
|
|
398
406
|
if (choresAfter.getInstructions().length > 0) {
|
|
399
|
-
const chore = new TransactionItem(async () => ({ tx: choresAfter }));
|
|
407
|
+
const chore = new TransactionItem(async () => ({ tx: choresAfter }), CHORES_TX_NAME);
|
|
400
408
|
await chore.initialize();
|
|
401
409
|
items.push(chore);
|
|
402
410
|
this.txHandler.log(
|