[accelerator] handle temporarily unavailable state

This commit is contained in:
Mononaut 2024-07-06 10:48:37 +00:00
parent 1a2487b740
commit 0c200e090d
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
3 changed files with 6 additions and 0 deletions

View File

@ -195,4 +195,5 @@
right: 0;
font-size: 12px;
color: var(--red);
white-space: nowrap;
}

View File

@ -23,6 +23,7 @@ export type AccelerationEstimate = {
vsizeFee: number;
pools: number[];
availablePaymentMethods: {[method: string]: {min: number, max: number}};
unavailable?: boolean;
}
export type TxSummary = {
txid: string; // txid of the current transaction
@ -259,6 +260,9 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
this.quoteError = `not_enough_balance`;
}
}
if (this.estimate.unavailable) {
this.quoteError = `temporarily_unavailable`;
}
this.hasAncestors = this.estimate.txSummary.ancestorCount > 1;
this.etaInfo$ = this.etaService.getProjectedEtaObservable(this.estimate, this.miningStats);

View File

@ -4,6 +4,7 @@ import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
export const MempoolErrors = {
'bad_request': `Your request was not valid. Please try again.`,
'internal_server_error': `Something went wrong, please try again later`,
'temporarily_unavailable': `Acceleration temporarily unavailable`,
'acceleration_duplicated': `This transaction has already been accelerated.`,
'acceleration_outbid': `Your fee delta is too low.`,
'cannot_accelerate_tx': `Cannot accelerate this transaction.`,