@haven-fi/solauto-sdk 1.0.272 → 1.0.274
Sign up to get free protection for your applications and to get access to all the features.
@@ -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;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,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;AAmFD,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;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,C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AAkC;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;IA+DzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,0BAA0B,CAAC;YA+BxB,qBAAqB;YAuDrB,cAAc;YAqCd,eAAe;CAoD9B"}
|
@@ -104,9 +104,11 @@ class TransactionSet {
|
|
104
104
|
const transactions = this.items
|
105
105
|
.filter((x) => x.tx && x.tx.getInstructions().length > 0)
|
106
106
|
.map((x) => x.tx);
|
107
|
+
const lutInputs = await this.lookupTables.getLutInputs(this.lutAddresses());
|
108
|
+
this.txHandler.log(lutInputs);
|
107
109
|
return (0, umi_1.transactionBuilder)()
|
108
110
|
.add(transactions)
|
109
|
-
.setAddressLookupTables(
|
111
|
+
.setAddressLookupTables(lutInputs);
|
110
112
|
}
|
111
113
|
lutAddresses() {
|
112
114
|
return Array.from(new Set(this.items.map((x) => x.lookupTableAddresses).flat()));
|
@@ -327,7 +329,7 @@ class TransactionsManager {
|
|
327
329
|
}
|
328
330
|
}, this.retries, this.retryDelay, this.errorsToThrow).catch((e) => {
|
329
331
|
if (itemSet) {
|
330
|
-
this.updateStatus(itemSet.name(), TransactionStatus.Failed, num);
|
332
|
+
this.updateStatus(itemSet.name(), TransactionStatus.Failed, num, undefined, undefined, e.message);
|
331
333
|
}
|
332
334
|
throw e;
|
333
335
|
});
|
@@ -341,11 +343,11 @@ class TransactionsManager {
|
|
341
343
|
]);
|
342
344
|
if (newItemSets.length > 1) {
|
343
345
|
itemSets.splice(currentIndex, itemSets.length - currentIndex, ...newItemSets);
|
344
|
-
const startOfQueuedStatuses = this.statuses.findIndex(x => x.status === TransactionStatus.Queued);
|
346
|
+
const startOfQueuedStatuses = this.statuses.findIndex((x) => x.status === TransactionStatus.Queued);
|
345
347
|
this.statuses.splice(startOfQueuedStatuses, this.statuses.length - startOfQueuedStatuses, ...newItemSets.map((x, i) => ({
|
346
348
|
name: x.name(),
|
347
349
|
attemptNum: i === 0 ? attemptNum : 0,
|
348
|
-
status: TransactionStatus.Queued,
|
350
|
+
status: i === 0 ? TransactionStatus.Processing : TransactionStatus.Queued,
|
349
351
|
})));
|
350
352
|
}
|
351
353
|
return newItemSets[0];
|
@@ -361,7 +363,9 @@ class TransactionsManager {
|
|
361
363
|
const errorString = `${errorDetails.errorName ?? "Unknown error"}: ${errorDetails.errorInfo ?? "unknown"}`;
|
362
364
|
this.updateStatus(txName, errorDetails.canBeIgnored
|
363
365
|
? TransactionStatus.Skipped
|
364
|
-
: TransactionStatus.Failed, attemptNum, undefined, undefined,
|
366
|
+
: TransactionStatus.Failed, attemptNum, undefined, undefined, errorDetails.errorName || errorDetails.errorInfo
|
367
|
+
? errorString
|
368
|
+
: e.message);
|
365
369
|
this.txHandler.log(errorString);
|
366
370
|
if (!errorDetails.canBeIgnored) {
|
367
371
|
throw e;
|
package/package.json
CHANGED
@@ -159,11 +159,11 @@ class TransactionSet {
|
|
159
159
|
.filter((x) => x.tx && x.tx.getInstructions().length > 0)
|
160
160
|
.map((x) => x.tx!);
|
161
161
|
|
162
|
+
const lutInputs = await this.lookupTables.getLutInputs(this.lutAddresses());
|
163
|
+
this.txHandler.log(lutInputs);
|
162
164
|
return transactionBuilder()
|
163
165
|
.add(transactions)
|
164
|
-
.setAddressLookupTables(
|
165
|
-
await this.lookupTables.getLutInputs(this.lutAddresses())
|
166
|
-
);
|
166
|
+
.setAddressLookupTables(lutInputs);
|
167
167
|
}
|
168
168
|
|
169
169
|
lutAddresses(): string[] {
|
@@ -501,9 +501,16 @@ export class TransactionsManager {
|
|
501
501
|
this.retries,
|
502
502
|
this.retryDelay,
|
503
503
|
this.errorsToThrow
|
504
|
-
).catch((e) => {
|
504
|
+
).catch((e: Error) => {
|
505
505
|
if (itemSet) {
|
506
|
-
this.updateStatus(
|
506
|
+
this.updateStatus(
|
507
|
+
itemSet.name(),
|
508
|
+
TransactionStatus.Failed,
|
509
|
+
num,
|
510
|
+
undefined,
|
511
|
+
undefined,
|
512
|
+
e.message
|
513
|
+
);
|
507
514
|
}
|
508
515
|
throw e;
|
509
516
|
});
|
@@ -528,14 +535,17 @@ export class TransactionsManager {
|
|
528
535
|
itemSets.length - currentIndex,
|
529
536
|
...newItemSets
|
530
537
|
);
|
531
|
-
const startOfQueuedStatuses = this.statuses.findIndex(
|
538
|
+
const startOfQueuedStatuses = this.statuses.findIndex(
|
539
|
+
(x) => x.status === TransactionStatus.Queued
|
540
|
+
);
|
532
541
|
this.statuses.splice(
|
533
542
|
startOfQueuedStatuses,
|
534
543
|
this.statuses.length - startOfQueuedStatuses,
|
535
544
|
...newItemSets.map((x, i) => ({
|
536
545
|
name: x.name(),
|
537
546
|
attemptNum: i === 0 ? attemptNum : 0,
|
538
|
-
status:
|
547
|
+
status:
|
548
|
+
i === 0 ? TransactionStatus.Processing : TransactionStatus.Queued,
|
539
549
|
}))
|
540
550
|
);
|
541
551
|
}
|
@@ -584,7 +594,9 @@ export class TransactionsManager {
|
|
584
594
|
attemptNum,
|
585
595
|
undefined,
|
586
596
|
undefined,
|
587
|
-
|
597
|
+
errorDetails.errorName || errorDetails.errorInfo
|
598
|
+
? errorString
|
599
|
+
: e.message
|
588
600
|
);
|
589
601
|
this.txHandler.log(errorString);
|
590
602
|
|