@@ -537,21 +551,23 @@
@if (eta.blocks >= 7) {
-
+
In several hours (or more)
- @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button') {
+ @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !showAccelerationSummary) {
Accelerate
}
} @else if (network === 'liquid' || network === 'liquidtestnet') {
} @else {
-
+
- @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button') {
- Accelerate
+ @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !showAccelerationSummary) {
+ Accelerate
}
+
+
}
diff --git a/frontend/src/app/components/transaction/transaction.component.scss b/frontend/src/app/components/transaction/transaction.component.scss
index 80caa6003..b43c63c2c 100644
--- a/frontend/src/app/components/transaction/transaction.component.scss
+++ b/frontend/src/app/components/transaction/transaction.component.scss
@@ -300,7 +300,6 @@
.accelerateDeepMempool {
align-self: auto;
- margin-top: 3px;
margin-left: auto;
background-color: var(--tertiary);
@media (max-width: 995px) {
diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts
index c3421969b..3bc40ea93 100644
--- a/frontend/src/app/components/transaction/transaction.component.ts
+++ b/frontend/src/app/components/transaction/transaction.component.ts
@@ -139,7 +139,10 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
acceleratorAvailable: boolean = this.stateService.env.ACCELERATOR && this.stateService.network === '';
showAccelerationSummary = false;
showAccelerationDetails = false;
+ hasAccelerationDetails = false;
+ accelerationFlowCompleted = false;
scrollIntoAccelPreview = false;
+ accelerationEligible = false;
auditEnabled: boolean = this.stateService.env.AUDIT && this.stateService.env.BASE_MODULE === 'mempool' && this.stateService.env.MINING_DASHBOARD === true;
@ViewChild('graphContainer')
@@ -169,6 +172,17 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
ngOnInit() {
this.enterpriseService.page();
+ const urlParams = new URLSearchParams(window.location.search);
+ if (urlParams.get('cash_request_id')) {
+ this.showAccelerationSummary = true;
+ }
+
+ if (!this.stateService.isLiquid) {
+ this.miningService.getMiningStats('1w').subscribe(stats => {
+ this.miningStats = stats;
+ });
+ }
+
this.websocketService.want(['blocks', 'mempool-blocks']);
this.stateService.networkChanged$.subscribe(
(network) => {
@@ -397,6 +411,24 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
} else if ((this.tx?.acceleration && txPosition.position.acceleratedBy)) {
this.tx.acceleratedBy = txPosition.position.acceleratedBy;
}
+
+ if (this.stateService.network === '') {
+ if (!this.mempoolPosition.accelerated) {
+ if (!this.accelerationFlowCompleted && !this.showAccelerationSummary) {
+ this.showAccelerationSummary = true;
+ this.miningService.getMiningStats('1w').subscribe(stats => {
+ this.miningStats = stats;
+ });
+ }
+ if (txPosition.position?.block > 0 && this.tx.weight < 4000) {
+ this.accelerationEligible = true;
+ }
+ } else if (this.showAccelerationSummary) {
+ setTimeout(() => {
+ this.closeAccelerator();
+ }, 2000);
+ }
+ }
}
} else {
this.mempoolPosition = null;
@@ -681,14 +713,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
return;
}
- this.miningService.getMiningStats('1w').subscribe(stats => {
- this.miningStats = stats;
- });
-
document.location.hash = '#accelerate';
this.enterpriseService.goal(8);
- this.showAccelerationSummary = true && this.acceleratorAvailable;
- this.scrollIntoAccelPreview = !this.scrollIntoAccelPreview;
+ this.accelerationFlowCompleted = false;
+ this.showAccelerationSummary = this.acceleratorAvailable;
+ this.scrollIntoAccelPreview = true;
return false;
}
@@ -765,8 +794,15 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
setIsAccelerated(initialState: boolean = false) {
this.isAcceleration = (this.tx.acceleration || (this.accelerationInfo && this.pool && this.accelerationInfo.pools.some(pool => (pool === this.pool.id))));
- if (this.isAcceleration && initialState) {
- this.showAccelerationSummary = false;
+ if (this.isAcceleration) {
+ if (initialState) {
+ this.accelerationFlowCompleted = true;
+ this.showAccelerationSummary = false;
+ } else if (this.showAccelerationSummary) {
+ setTimeout(() => {
+ this.closeAccelerator();
+ }, 2000);
+ }
}
if (this.isAcceleration) {
// this immediately returns cached stats if we fetched them recently
@@ -835,7 +871,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.rbfReplaces = [];
this.filters = [];
this.showCpfpDetails = false;
+ this.showAccelerationDetails = false;
this.accelerationInfo = null;
+ this.accelerationEligible = false;
this.txInBlockIndex = null;
this.mempoolPosition = null;
this.pool = null;
@@ -852,6 +890,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.stateService.markBlock$.next({});
}
+ closeAccelerator(): void {
+ this.accelerationFlowCompleted = true;
+ this.showAccelerationSummary = false;
+ }
+
roundToOneDecimal(cpfpTx: any): number {
return +(cpfpTx.fee / (cpfpTx.weight / 4)).toFixed(1);
}
@@ -897,6 +940,10 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
+ setHasAccelerationDetails(hasDetails: boolean): void {
+ this.hasAccelerationDetails = hasDetails;
+ }
+
@HostListener('window:resize', ['$event'])
setGraphSize(): void {
this.isMobile = window.innerWidth < 850;
@@ -911,6 +958,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
+ isLoggedIn(): boolean {
+ const auth = this.storageService.getAuth();
+ return auth !== null;
+ }
+
ngOnDestroy() {
this.subscription.unsubscribe();
this.fetchCpfpSubscription.unsubscribe();
diff --git a/frontend/src/app/components/transaction/transaction.module.ts b/frontend/src/app/components/transaction/transaction.module.ts
index 01404db56..b98c33e2a 100644
--- a/frontend/src/app/components/transaction/transaction.module.ts
+++ b/frontend/src/app/components/transaction/transaction.module.ts
@@ -5,8 +5,8 @@ import { TransactionComponent } from './transaction.component';
import { SharedModule } from '../../shared/shared.module';
import { TxBowtieModule } from '../tx-bowtie-graph/tx-bowtie.module';
import { GraphsModule } from '../../graphs/graphs.module';
-import { AcceleratePreviewComponent } from '../accelerate-preview/accelerate-preview.component';
-import { AccelerateFeeGraphComponent } from '../accelerate-preview/accelerate-fee-graph.component';
+import { AccelerateCheckout } from '../accelerate-checkout/accelerate-checkout.component';
+import { AccelerateFeeGraphComponent } from '../accelerate-checkout/accelerate-fee-graph.component';
const routes: Routes = [
{
@@ -43,7 +43,12 @@ export class TransactionRoutingModule { }
],
declarations: [
TransactionComponent,
- AcceleratePreviewComponent,
+ AccelerateCheckout,
+ AccelerateFeeGraphComponent,
+ ],
+ exports: [
+ TransactionComponent,
+ AccelerateCheckout,
AccelerateFeeGraphComponent,
]
})
diff --git a/frontend/src/app/services/eta.service.ts b/frontend/src/app/services/eta.service.ts
index 2e80fd31c..cc1436e4c 100644
--- a/frontend/src/app/services/eta.service.ts
+++ b/frontend/src/app/services/eta.service.ts
@@ -5,8 +5,8 @@ import { MempoolBlock } from '../interfaces/websocket.interface';
import { Transaction } from '../interfaces/electrs.interface';
import { MiningService, MiningStats } from './mining.service';
import { getUnacceleratedFeeRate } from '../shared/transaction.utils';
-import { AccelerationEstimate } from '../components/accelerate-preview/accelerate-preview.component';
-import { Observable, combineLatest, map, of } from 'rxjs';
+import { AccelerationEstimate } from '../components/accelerate-checkout/accelerate-checkout.component';
+import { Observable, combineLatest, map, of, share, shareReplay, tap } from 'rxjs';
export interface ETA {
now: number, // time at which calculation performed
@@ -61,7 +61,8 @@ export class EtaService {
{ block: 0, hashrateShare: acceleratingHashrateFraction },
], da).time,
};
- })
+ }),
+ shareReplay()
);
}
diff --git a/frontend/src/app/services/services-api.service.ts b/frontend/src/app/services/services-api.service.ts
index bdc6d18c2..0dc58b957 100644
--- a/frontend/src/app/services/services-api.service.ts
+++ b/frontend/src/app/services/services-api.service.ts
@@ -167,4 +167,20 @@ export class ServicesApiServices {
requestTestnet4Coins$(address: string, sats: number) {
return this.httpClient.get<{txid: string}>(`${SERVICES_API_PREFIX}/testnet4/faucet/request?address=${address}&sats=${sats}`, { responseType: 'json' });
}
+
+ generateBTCPayAcceleratorInvoice$(txid: string, sats: number): Observable {
+ const params = {
+ product: txid,
+ amount: sats,
+ };
+ return this.httpClient.post(`${SERVICES_API_PREFIX}/payments/bitcoin`, params);
+ }
+
+ retreiveInvoice$(invoiceId: string): Observable {
+ return this.httpClient.get(`${SERVICES_API_PREFIX}/payments/bitcoin/invoice?id=${invoiceId}`);
+ }
+
+ getPaymentStatus$(orderId: string): Observable {
+ return this.httpClient.get(`${SERVICES_API_PREFIX}/payments/bitcoin/check?order_id=${orderId}`);
+ }
}
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
index e60c7c524..1706be24d 100644
--- a/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
+++ b/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
@@ -29,6 +29,7 @@ const MempoolErrors = {
'faucet_address_not_allowed': `You cannot use this address`,
'faucet_below_minimum': `Requested amount is too small`,
'faucet_above_maximum': `Requested amount is too high`,
+ 'payment_method_not_allowed': `You are not allowed to use this payment method`,
} as { [error: string]: string };
export function isMempoolError(error: string) {
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 2f7bd4dc4..c060bbbd2 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -50,8 +50,6 @@ import { BlockOverviewGraphComponent } from '../components/block-overview-graph/
import { BlockOverviewTooltipComponent } from '../components/block-overview-tooltip/block-overview-tooltip.component';
import { BlockFiltersComponent } from '../components/block-filters/block-filters.component';
import { AddressGroupComponent } from '../components/address-group/address-group.component';
-import { TrackerComponent } from '../components/tracker/tracker.component';
-import { TrackerBarComponent } from '../components/tracker/tracker-bar.component';
import { SearchFormComponent } from '../components/search-form/search-form.component';
import { AddressLabelsComponent } from '../components/address-labels/address-labels.component';
import { FooterComponent } from '../components/footer/footer.component';
@@ -100,7 +98,6 @@ import { MempoolErrorComponent } from './components/mempool-error/mempool-error.
import { AccelerationsListComponent } from '../components/acceleration/accelerations-list/accelerations-list.component';
import { PendingStatsComponent } from '../components/acceleration/pending-stats/pending-stats.component';
import { AccelerationStatsComponent } from '../components/acceleration/acceleration-stats/acceleration-stats.component';
-import { AccelerateCheckout } from '../components/accelerate-checkout/accelerate-checkout.component';
import { BlockViewComponent } from '../components/block-view/block-view.component';
import { EightBlocksComponent } from '../components/eight-blocks/eight-blocks.component';
@@ -115,6 +112,7 @@ import { HttpErrorComponent } from '../shared/components/http-error/http-error.c
import { TwitterWidgetComponent } from '../components/twitter-widget/twitter-widget.component';
import { FaucetComponent } from '../components/faucet/faucet.component';
import { TwitterLogin } from '../components/twitter-login/twitter-login.component';
+import { BitcoinInvoiceComponent } from '../components/bitcoin-invoice/bitcoin-invoice.component';
import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-directives/weight-directives';
@@ -164,8 +162,6 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
BlockFiltersComponent,
TransactionsListComponent,
AddressGroupComponent,
- TrackerComponent,
- TrackerBarComponent,
SearchFormComponent,
AddressLabelsComponent,
FooterComponent,
@@ -224,12 +220,12 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
MempoolErrorComponent,
AccelerationsListComponent,
AccelerationStatsComponent,
- AccelerateCheckout,
PendingStatsComponent,
HttpErrorComponent,
TwitterWidgetComponent,
FaucetComponent,
TwitterLogin,
+ BitcoinInvoiceComponent,
],
imports: [
CommonModule,
@@ -305,8 +301,6 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
BlockFiltersComponent,
TransactionsListComponent,
AddressGroupComponent,
- TrackerComponent,
- TrackerBarComponent,
SearchFormComponent,
AddressLabelsComponent,
FooterComponent,
@@ -354,11 +348,11 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
MempoolErrorComponent,
AccelerationsListComponent,
AccelerationStatsComponent,
- AccelerateCheckout,
PendingStatsComponent,
HttpErrorComponent,
TwitterWidgetComponent,
TwitterLogin,
+ BitcoinInvoiceComponent,
MempoolBlockOverviewComponent,
ClockchainComponent,
diff --git a/frontend/src/resources/bitcoin-logo.png b/frontend/src/resources/bitcoin-logo.png
new file mode 100644
index 000000000..5d7962d2a
Binary files /dev/null and b/frontend/src/resources/bitcoin-logo.png differ
diff --git a/frontend/src/resources/btcpay.svg b/frontend/src/resources/btcpay.svg
new file mode 100644
index 000000000..5d8592b71
--- /dev/null
+++ b/frontend/src/resources/btcpay.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/resources/cash-app.svg b/frontend/src/resources/cash-app.svg
new file mode 100644
index 000000000..4dc645081
--- /dev/null
+++ b/frontend/src/resources/cash-app.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/resources/lightning-logo.png b/frontend/src/resources/lightning-logo.png
new file mode 100644
index 000000000..4507ae9ad
Binary files /dev/null and b/frontend/src/resources/lightning-logo.png differ
|