@haven-fi/solauto-sdk 1.0.287 → 1.0.289
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;AAMzD,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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kBAA2C,EAC/D,aAAa,CAAC,EAAE,aAAa,YAAA,EAC7B,OAAO,GAAE,MAAU,EACnB,UAAU,GAAE,MAAY;YAQpB,uBAAuB;IAwCrC,OAAO,CAAC,YAAY;YA6CN,aAAa;IAoB3B,OAAO,CAAC,4BAA4B;IAgBpC,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;CAmD9B"}
|
@@ -231,10 +231,10 @@ class TransactionsManager {
|
|
231
231
|
}
|
232
232
|
}
|
233
233
|
}
|
234
|
-
getUpdatedPriorityFeeSetting(prevError) {
|
234
|
+
getUpdatedPriorityFeeSetting(prevError, attemptNum) {
|
235
235
|
if (prevError instanceof web3_js_1.TransactionExpiredBlockheightExceededError) {
|
236
236
|
const currIdx = types_1.priorityFeeSettingValues.indexOf(this.priorityFeeSetting);
|
237
|
-
return types_1.priorityFeeSettingValues[Math.min(types_1.priorityFeeSettingValues.length - 1, currIdx + 1)];
|
237
|
+
return types_1.priorityFeeSettingValues[Math.min(types_1.priorityFeeSettingValues.length - 1, currIdx + 1 + Math.floor(attemptNum / 3))];
|
238
238
|
}
|
239
239
|
return this.priorityFeeSetting;
|
240
240
|
}
|
@@ -245,7 +245,7 @@ class TransactionsManager {
|
|
245
245
|
}
|
246
246
|
async updateLut(tx, newLut) {
|
247
247
|
const updateLutTxName = `${newLut ? "create" : "update"} lookup table`;
|
248
|
-
await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum, prevError) => await this.sendTransaction(tx, updateLutTxName, attemptNum, this.getUpdatedPriorityFeeSetting(prevError)), 3, 150, this.errorsToThrow);
|
248
|
+
await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum, prevError) => await this.sendTransaction(tx, updateLutTxName, attemptNum, this.getUpdatedPriorityFeeSetting(prevError, attemptNum)), 3, 150, this.errorsToThrow);
|
249
249
|
}
|
250
250
|
async clientSend(transactions) {
|
251
251
|
const items = [...transactions];
|
@@ -324,7 +324,7 @@ class TransactionsManager {
|
|
324
324
|
}
|
325
325
|
else {
|
326
326
|
await this.debugAccounts(itemSet, tx);
|
327
|
-
await this.sendTransaction(tx, itemSet.name(), attemptNum, this.getUpdatedPriorityFeeSetting(prevError));
|
327
|
+
await this.sendTransaction(tx, itemSet.name(), attemptNum, this.getUpdatedPriorityFeeSetting(prevError, attemptNum));
|
328
328
|
}
|
329
329
|
}, this.retries, this.retryDelay, this.errorsToThrow).catch((e) => {
|
330
330
|
if (itemSet) {
|
package/package.json
CHANGED
@@ -331,11 +331,17 @@ export class TransactionsManager {
|
|
331
331
|
}
|
332
332
|
}
|
333
333
|
|
334
|
-
private getUpdatedPriorityFeeSetting(
|
334
|
+
private getUpdatedPriorityFeeSetting(
|
335
|
+
prevError: Error | undefined,
|
336
|
+
attemptNum: number
|
337
|
+
) {
|
335
338
|
if (prevError instanceof TransactionExpiredBlockheightExceededError) {
|
336
339
|
const currIdx = priorityFeeSettingValues.indexOf(this.priorityFeeSetting);
|
337
340
|
return priorityFeeSettingValues[
|
338
|
-
Math.min(
|
341
|
+
Math.min(
|
342
|
+
priorityFeeSettingValues.length - 1,
|
343
|
+
currIdx + 1 + Math.floor(attemptNum / 3)
|
344
|
+
)
|
339
345
|
];
|
340
346
|
}
|
341
347
|
return this.priorityFeeSetting;
|
@@ -355,7 +361,7 @@ export class TransactionsManager {
|
|
355
361
|
tx,
|
356
362
|
updateLutTxName,
|
357
363
|
attemptNum,
|
358
|
-
this.getUpdatedPriorityFeeSetting(prevError)
|
364
|
+
this.getUpdatedPriorityFeeSetting(prevError, attemptNum)
|
359
365
|
),
|
360
366
|
3,
|
361
367
|
150,
|
@@ -494,7 +500,7 @@ export class TransactionsManager {
|
|
494
500
|
tx,
|
495
501
|
itemSet.name(),
|
496
502
|
attemptNum,
|
497
|
-
this.getUpdatedPriorityFeeSetting(prevError)
|
503
|
+
this.getUpdatedPriorityFeeSetting(prevError, attemptNum)
|
498
504
|
);
|
499
505
|
}
|
500
506
|
},
|