@@ -132,10 +116,9 @@
= 7" [ngIfElse]="belowBlockLimit">
-
+
In several hours (or more)
-
- Accelerate
+ Accelerate
@@ -143,10 +126,9 @@
-
+
-
- Accelerate
+ Accelerate
diff --git a/frontend/src/app/components/transaction/transaction.component.scss b/frontend/src/app/components/transaction/transaction.component.scss
index 45357471a..2e076600e 100644
--- a/frontend/src/app/components/transaction/transaction.component.scss
+++ b/frontend/src/app/components/transaction/transaction.component.scss
@@ -130,7 +130,7 @@
}
.table {
- tr td {
+ tr td {
padding: 0.75rem 0.5rem;
@media (min-width: 576px) {
padding: 0.75rem 0.75rem;
@@ -138,7 +138,7 @@
&:last-child {
text-align: right;
@media (min-width: 850px) {
- text-align: left;
+ text-align: left;
}
}
.btn {
@@ -218,25 +218,52 @@
}
}
-.eta {
- display: flex;
- justify-content: end;
- flex-wrap: wrap;
- align-content: center;
- @media (min-width: 850px) {
- justify-content: space-between;
- }
-}
-
.link.accelerator {
cursor: pointer;
}
+.eta {
+ display: flex;
+ flex-wrap: wrap;
+ align-content: center;
+ @media (min-width: 850px) {
+ justify-content: left !important;
+ }
+}
+
.accelerate {
+ display: flex !important;
align-self: auto;
margin-top: 3px;
- margin-left: 10px;
- @media (min-width: 850px) {
- justify-self: start;
+ margin-left: auto;
+ background-color: #653b9c;
+ @media (max-width: 849px) {
+ margin-left: 5px;
}
-}
\ No newline at end of file
+}
+
+.etaDeepMempool {
+ display: flex !important;
+ justify-content: end;
+ flex-wrap: wrap;
+ align-content: center;
+ @media (max-width: 995px) {
+ justify-content: left !important;
+ }
+ @media (max-width: 849px) {
+ justify-content: right !important;
+ }
+}
+
+.accelerateDeepMempool {
+ align-self: auto;
+ margin-top: 3px;
+ margin-left: auto;
+ background-color: #653b9c;
+ @media (max-width: 995px) {
+ margin-left: 0px;
+ }
+ @media (max-width: 849px) {
+ margin-left: 5px;
+ }
+}
diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts
index c3e4cc25c..ac1452835 100644
--- a/frontend/src/app/components/transaction/transaction.component.ts
+++ b/frontend/src/app/components/transaction/transaction.component.ts
@@ -83,7 +83,6 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
blockConversion: Price;
tooltipPosition: { x: number, y: number };
isMobile: boolean;
- acceleratorAvailable: boolean = false;
featuresEnabled: boolean;
segwitEnabled: boolean;
@@ -93,6 +92,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
accelerateCtaType: 'alert' | 'button' = 'alert';
acceleratorAvailable: boolean = this.stateService.env.OFFICIAL_MEMPOOL_SPACE && this.stateService.env.ACCELERATOR && this.stateService.network === '';
showAccelerationSummary = false;
+ scrollIntoAccelPreview = false;
@ViewChild('graphContainer')
graphContainer: ElementRef;
@@ -504,12 +504,13 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.accelerateCtaType = 'button';
}
- onAccelerateClicked(): void {
+ onAccelerateClicked() {
if (!this.txId) {
return;
}
-
this.showAccelerationSummary = true && this.acceleratorAvailable;
+ this.scrollIntoAccelPreview = !this.scrollIntoAccelPreview;
+ return false;
}
handleLoadElectrsTransactionError(error: any): Observable
{
diff --git a/frontend/src/app/services/api.service.ts b/frontend/src/app/services/api.service.ts
index 2d9077a97..ea185b1ec 100644
--- a/frontend/src/app/services/api.service.ts
+++ b/frontend/src/app/services/api.service.ts
@@ -392,4 +392,8 @@ export class ApiService {
estimate$(txInput: string) {
return this.httpClient.post(`${SERVICES_API_PREFIX}/accelerator/estimate`, { txInput: txInput }, { observe: 'response' });
}
+
+ accelerate$(txInput: string, userBid: number) {
+ return this.httpClient.post(`${SERVICES_API_PREFIX}/accelerator/accelerate`, { txInput: txInput, userBid: userBid });
+ }
}
diff --git a/frontend/src/app/shared/components/mempool-error/mempool-error.component.html b/frontend/src/app/shared/components/mempool-error/mempool-error.component.html
new file mode 100644
index 000000000..020b147a9
--- /dev/null
+++ b/frontend/src/app/shared/components/mempool-error/mempool-error.component.html
@@ -0,0 +1,2 @@
+
+
diff --git a/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts b/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
new file mode 100644
index 000000000..19e057950
--- /dev/null
+++ b/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
@@ -0,0 +1,47 @@
+import { Component, Input, OnInit } from "@angular/core";
+import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
+
+const MempoolErrors = {
+ 'acceleration_duplicated': `This transaction has already been accelerated.`,
+ 'acceleration_outbid': `Your fee delta is too low.`,
+ 'cannot_accelerate_tx': `Cannot accelerate this transaction.`,
+ 'cannot_decode_raw_tx': `Cannot decode this raw transaction.`,
+ 'cannot_fetch_raw_tx': `Cannot find this transaction.`,
+ 'database_error': `Something went wrong. Please try again later.`,
+ 'high_sigop_tx': `This transaction cannot be accelerated.`,
+ 'invalid_acceleration_request': `This acceleration request is not valid.`,
+ 'invalid_tx_dependencies': `This transaction dependencies are not valid.`,
+ 'mempool_rejected_raw_tx': `Our mempool rejected this transaction`,
+ 'no_mining_pool_available': `No mining pool available at the moment`,
+ 'not_available': `You current subscription does not allow you to access this feature. Consider upgrading.`,
+ 'not_enough_balance': `Your account balance is too low. Please make a deposit.`,
+ 'not_verified': `You must verify your account to use this feature.`,
+ 'recommended_fees_not_available': `Recommended fees are not available right now.`,
+ 'too_many_relatives': `This transaction has too many relatives.`,
+ 'txid_not_in_mempool': `This transaction is not in the mempool.`,
+ 'waitlisted': `You are currently on the wait list. You will get notified once you are granted access.`,
+ 'not_whitelisted_by_any_pool': `You are not whitelisted by any mining pool`,
+} as { [error: string]: string };
+
+export function isMempoolError(error: string) {
+ return Object.keys(MempoolErrors).includes(error);
+}
+
+@Component({
+ selector: 'app-mempool-error',
+ templateUrl: './mempool-error.component.html'
+})
+export class MempoolErrorComponent implements OnInit {
+ @Input() error: string;
+ errorContent: SafeHtml;
+
+ constructor(private sanitizer: DomSanitizer) { }
+
+ ngOnInit(): void {
+ if (Object.keys(MempoolErrors).includes(this.error)) {
+ this.errorContent = this.sanitizer.bypassSecurityTrustHtml(MempoolErrors[this.error]);
+ } else {
+ this.errorContent = this.error;
+ }
+ }
+}
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 891f8f987..d77eea2cf 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -93,6 +93,8 @@ import { ToggleComponent } from './components/toggle/toggle.component';
import { GeolocationComponent } from '../shared/components/geolocation/geolocation.component';
import { TestnetAlertComponent } from './components/testnet-alert/testnet-alert.component';
import { GlobalFooterComponent } from './components/global-footer/global-footer.component';
+import { AcceleratePreviewComponent } from '../components/accelerate-preview/accelerate-preview.component';
+import { MempoolErrorComponent } from './components/mempool-error/mempool-error.component';
import { MempoolBlockOverviewComponent } from '../components/mempool-block-overview/mempool-block-overview.component';
import { ClockchainComponent } from '../components/clockchain/clockchain.component';
@@ -189,6 +191,7 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
GeolocationComponent,
TestnetAlertComponent,
GlobalFooterComponent,
+ AcceleratePreviewComponent,
CalculatorComponent,
BitcoinsatoshisPipe,
MempoolBlockOverviewComponent,
@@ -196,7 +199,8 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
ClockComponent,
ClockFaceComponent,
OnlyVsizeDirective,
- OnlyWeightDirective
+ OnlyWeightDirective,
+ MempoolErrorComponent,
],
imports: [
CommonModule,
@@ -310,6 +314,8 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
GeolocationComponent,
PreviewTitleComponent,
GlobalFooterComponent,
+ AcceleratePreviewComponent,
+ MempoolErrorComponent,
MempoolBlockOverviewComponent,
ClockchainComponent,