[accelerator] handle temporarily unavailable state
This commit is contained in:
parent
1a2487b740
commit
0c200e090d
@ -195,4 +195,5 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--red);
|
color: var(--red);
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
@ -23,6 +23,7 @@ export type AccelerationEstimate = {
|
|||||||
vsizeFee: number;
|
vsizeFee: number;
|
||||||
pools: number[];
|
pools: number[];
|
||||||
availablePaymentMethods: {[method: string]: {min: number, max: number}};
|
availablePaymentMethods: {[method: string]: {min: number, max: number}};
|
||||||
|
unavailable?: boolean;
|
||||||
}
|
}
|
||||||
export type TxSummary = {
|
export type TxSummary = {
|
||||||
txid: string; // txid of the current transaction
|
txid: string; // txid of the current transaction
|
||||||
@ -259,6 +260,9 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
|||||||
this.quoteError = `not_enough_balance`;
|
this.quoteError = `not_enough_balance`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.estimate.unavailable) {
|
||||||
|
this.quoteError = `temporarily_unavailable`;
|
||||||
|
}
|
||||||
this.hasAncestors = this.estimate.txSummary.ancestorCount > 1;
|
this.hasAncestors = this.estimate.txSummary.ancestorCount > 1;
|
||||||
this.etaInfo$ = this.etaService.getProjectedEtaObservable(this.estimate, this.miningStats);
|
this.etaInfo$ = this.etaService.getProjectedEtaObservable(this.estimate, this.miningStats);
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
|
|||||||
export const MempoolErrors = {
|
export const MempoolErrors = {
|
||||||
'bad_request': `Your request was not valid. Please try again.`,
|
'bad_request': `Your request was not valid. Please try again.`,
|
||||||
'internal_server_error': `Something went wrong, please try again later`,
|
'internal_server_error': `Something went wrong, please try again later`,
|
||||||
|
'temporarily_unavailable': `Acceleration temporarily unavailable`,
|
||||||
'acceleration_duplicated': `This transaction has already been accelerated.`,
|
'acceleration_duplicated': `This transaction has already been accelerated.`,
|
||||||
'acceleration_outbid': `Your fee delta is too low.`,
|
'acceleration_outbid': `Your fee delta is too low.`,
|
||||||
'cannot_accelerate_tx': `Cannot accelerate this transaction.`,
|
'cannot_accelerate_tx': `Cannot accelerate this transaction.`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user