- ETA
+ ETA
= 7" [ngIfElse]="belowBlockLimit">
-
- In several hours (or more)
- Accelerate
+
+ In several hours (or more)
+
+ Accelerate
+
@@ -109,9 +144,11 @@
-
-
- Accelerate
+
+
+
+ Accelerate
+
diff --git a/frontend/src/app/components/transaction/transaction.component.scss b/frontend/src/app/components/transaction/transaction.component.scss
index 5bef401d7..45357471a 100644
--- a/frontend/src/app/components/transaction/transaction.component.scss
+++ b/frontend/src/app/components/transaction/transaction.component.scss
@@ -228,11 +228,15 @@
}
}
+.link.accelerator {
+ cursor: pointer;
+}
+
.accelerate {
align-self: auto;
margin-top: 3px;
+ margin-left: 10px;
@media (min-width: 850px) {
justify-self: start;
- margin-left: 0px;
}
}
\ No newline at end of file
diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts
index f1f3850e4..db200e9b1 100644
--- a/frontend/src/app/components/transaction/transaction.component.ts
+++ b/frontend/src/app/components/transaction/transaction.component.ts
@@ -19,6 +19,7 @@ import { WebsocketService } from '../../services/websocket.service';
import { AudioService } from '../../services/audio.service';
import { ApiService } from '../../services/api.service';
import { SeoService } from '../../services/seo.service';
+import { StorageService } from '../../services/storage.service';
import { BlockExtended, CpfpInfo, RbfTree, MempoolPosition, DifficultyAdjustment } from '../../interfaces/node-api.interface';
import { LiquidUnblinding } from './liquid-ublinding';
import { RelativeUrlPipe } from '../../shared/pipes/relative-url/relative-url.pipe';
@@ -88,6 +89,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
rbfEnabled: boolean;
taprootEnabled: boolean;
hasEffectiveFeeRate: boolean;
+ accelerateCtaType: 'alert' | 'button' = 'alert';
+ acceleratorAvailable: boolean = this.stateService.env.OFFICIAL_MEMPOOL_SPACE && this.stateService.env.ACCELERATOR && this.stateService.network === '';
+ showAccelerationSummary = false;
@ViewChild('graphContainer')
graphContainer: ElementRef;
@@ -104,14 +108,20 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
private apiService: ApiService,
private seoService: SeoService,
private priceService: PriceService,
+ private storageService: StorageService
) {}
ngOnInit() {
this.websocketService.want(['blocks', 'mempool-blocks']);
this.stateService.networkChanged$.subscribe(
- (network) => (this.network = network)
+ (network) => {
+ this.network = network;
+ this.acceleratorAvailable = this.stateService.env.OFFICIAL_MEMPOOL_SPACE && this.stateService.env.ACCELERATOR && this.stateService.network === '';
+ }
);
+ this.accelerateCtaType = (this.storageService.getValue('accel-cta-type') as 'alert' | 'button') ?? 'alert';
+
this.setFlowEnabled();
this.flowPrefSubscription = this.stateService.hideFlow.subscribe((hide) => {
this.hideFlow = !!hide;
@@ -486,6 +496,19 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.setGraphSize();
}
+ dismissAccelAlert(): void {
+ this.storageService.setValue('accel-cta-type', 'button');
+ this.accelerateCtaType = 'button';
+ }
+
+ onAccelerateClicked(): void {
+ if (!this.txId) {
+ return;
+ }
+
+ this.showAccelerationSummary = true && this.acceleratorAvailable;
+ }
+
handleLoadElectrsTransactionError(error: any): Observable {
if (error.status === 404 && /^[a-fA-F0-9]{64}$/.test(this.txId)) {
this.websocketService.startMultiTrackTransaction(this.txId);
diff --git a/frontend/src/app/services/api.service.ts b/frontend/src/app/services/api.service.ts
index cd1109da1..2d9077a97 100644
--- a/frontend/src/app/services/api.service.ts
+++ b/frontend/src/app/services/api.service.ts
@@ -388,4 +388,8 @@ export class ApiService {
getServicesBackendInfo$(): Observable {
return this.httpClient.get(`${SERVICES_API_PREFIX}/version`);
}
+
+ estimate$(txInput: string) {
+ return this.httpClient.post(`${SERVICES_API_PREFIX}/accelerator/estimate`, { txInput: txInput }, { observe: 'response' });
+ }
}
diff --git a/frontend/src/app/shared/components/confirmations/confirmations.component.html b/frontend/src/app/shared/components/confirmations/confirmations.component.html
index db3f1f38a..4ad3cb33a 100644
--- a/frontend/src/app/shared/components/confirmations/confirmations.component.html
+++ b/frontend/src/app/shared/components/confirmations/confirmations.component.html
@@ -1,19 +1,19 @@
-
+
{{ i }} confirmation
{{ i }} confirmations
- Confirmed
+ Confirmed
- Replaced
+ Replaced
- Removed
+ Removed
- Unconfirmed
+ Unconfirmed
\ No newline at end of file
diff --git a/frontend/src/app/shared/components/confirmations/confirmations.component.scss b/frontend/src/app/shared/components/confirmations/confirmations.component.scss
index e69de29bb..c8af7dd76 100644
--- a/frontend/src/app/shared/components/confirmations/confirmations.component.scss
+++ b/frontend/src/app/shared/components/confirmations/confirmations.component.scss
@@ -0,0 +1,4 @@
+.no-cursor {
+ cursor: default !important;
+ pointer-events: none;
+}
\ No newline at end of file
From f295392dcab8c2b8c7beef54503c8cb5790e9578 Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Tue, 15 Aug 2023 20:54:03 +0900
Subject: [PATCH 072/671] Record purging rate in statistics
---
backend/src/api/database-migration.ts | 7 ++++++-
backend/src/api/statistics/statistics-api.ts | 10 ++++++++--
backend/src/api/statistics/statistics.ts | 4 ++++
backend/src/mempool.interfaces.ts | 2 ++
4 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/backend/src/api/database-migration.ts b/backend/src/api/database-migration.ts
index b7dc39493..89ef7a7be 100644
--- a/backend/src/api/database-migration.ts
+++ b/backend/src/api/database-migration.ts
@@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository';
import { RowDataPacket } from 'mysql2';
class DatabaseMigration {
- private static currentVersion = 65;
+ private static currentVersion = 66;
private queryTimeout = 3600_000;
private statisticsAddedIndexed = false;
private uniqueLogs: string[] = [];
@@ -553,6 +553,11 @@ class DatabaseMigration {
await this.$executeQuery('ALTER TABLE `blocks_audits` ADD accelerated_txs JSON DEFAULT "[]"');
await this.updateToSchemaVersion(65);
}
+
+ if (databaseSchemaVersion < 66) {
+ await this.$executeQuery('ALTER TABLE `statistics` ADD min_fee FLOAT UNSIGNED DEFAULT NULL');
+ await this.updateToSchemaVersion(66);
+ }
}
/**
diff --git a/backend/src/api/statistics/statistics-api.ts b/backend/src/api/statistics/statistics-api.ts
index 9df12d704..d76b77a37 100644
--- a/backend/src/api/statistics/statistics-api.ts
+++ b/backend/src/api/statistics/statistics-api.ts
@@ -15,6 +15,7 @@ class StatisticsApi {
mempool_byte_weight,
fee_data,
total_fee,
+ min_fee,
vsize_1,
vsize_2,
vsize_3,
@@ -54,7 +55,7 @@ class StatisticsApi {
vsize_1800,
vsize_2000
)
- VALUES (NOW(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ VALUES (NOW(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)`;
const [result]: any = await DB.query(query);
return result.insertId;
@@ -73,6 +74,7 @@ class StatisticsApi {
mempool_byte_weight,
fee_data,
total_fee,
+ min_fee,
vsize_1,
vsize_2,
vsize_3,
@@ -112,7 +114,7 @@ class StatisticsApi {
vsize_1800,
vsize_2000
)
- VALUES (${statistics.added}, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
+ VALUES (${statistics.added}, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`;
const params: (string | number)[] = [
@@ -122,6 +124,7 @@ class StatisticsApi {
statistics.mempool_byte_weight,
statistics.fee_data,
statistics.total_fee,
+ statistics.min_fee,
statistics.vsize_1,
statistics.vsize_2,
statistics.vsize_3,
@@ -172,6 +175,7 @@ class StatisticsApi {
return `SELECT
UNIX_TIMESTAMP(added) as added,
CAST(avg(vbytes_per_second) as DOUBLE) as vbytes_per_second,
+ CAST(avg(min_fee) as DOUBLE) as min_fee,
CAST(avg(vsize_1) as DOUBLE) as vsize_1,
CAST(avg(vsize_2) as DOUBLE) as vsize_2,
CAST(avg(vsize_3) as DOUBLE) as vsize_3,
@@ -220,6 +224,7 @@ class StatisticsApi {
return `SELECT
UNIX_TIMESTAMP(added) as added,
CAST(avg(vbytes_per_second) as DOUBLE) as vbytes_per_second,
+ CAST(avg(min_fee) as DOUBLE) as min_fee,
vsize_1,
vsize_2,
vsize_3,
@@ -404,6 +409,7 @@ class StatisticsApi {
vbytes_per_second: s.vbytes_per_second,
mempool_byte_weight: s.mempool_byte_weight,
total_fee: s.total_fee,
+ min_fee: s.min_fee,
vsizes: [
s.vsize_1,
s.vsize_2,
diff --git a/backend/src/api/statistics/statistics.ts b/backend/src/api/statistics/statistics.ts
index 27554f36d..494777aad 100644
--- a/backend/src/api/statistics/statistics.ts
+++ b/backend/src/api/statistics/statistics.ts
@@ -89,6 +89,9 @@ class Statistics {
}
});
+ // get minFee and convert to sats/vb
+ const minFee = memPool.getMempoolInfo().mempoolminfee * 100000;
+
try {
const insertId = await statisticsApi.$create({
added: 'NOW()',
@@ -98,6 +101,7 @@ class Statistics {
mempool_byte_weight: totalWeight,
total_fee: totalFee,
fee_data: '',
+ min_fee: minFee,
vsize_1: weightVsizeFees['1'] || 0,
vsize_2: weightVsizeFees['2'] || 0,
vsize_3: weightVsizeFees['3'] || 0,
diff --git a/backend/src/mempool.interfaces.ts b/backend/src/mempool.interfaces.ts
index c08846191..db04ded43 100644
--- a/backend/src/mempool.interfaces.ts
+++ b/backend/src/mempool.interfaces.ts
@@ -299,6 +299,7 @@ export interface Statistic {
total_fee: number;
mempool_byte_weight: number;
fee_data: string;
+ min_fee: number;
vsize_1: number;
vsize_2: number;
@@ -345,6 +346,7 @@ export interface OptimizedStatistic {
vbytes_per_second: number;
total_fee: number;
mempool_byte_weight: number;
+ min_fee: number;
vsizes: number[];
}
From c1b2f1f2c7d575b65ca679aa55577f9e373df7a2 Mon Sep 17 00:00:00 2001
From: wiz
Date: Fri, 25 Aug 2023 23:24:51 +0900
Subject: [PATCH 073/671] ops: Disable tor in prod install script
---
production/install | 71 +++++++++++++++++++++++++++-------------------
1 file changed, 42 insertions(+), 29 deletions(-)
diff --git a/production/install b/production/install
index 67e2f7d78..13449a904 100755
--- a/production/install
+++ b/production/install
@@ -1857,22 +1857,22 @@ ln -s "${MEMPOOL_HOME}/mempool" "${NGINX_ETC_FOLDER}/mempool"
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_USER__!${NGINX_USER}!" "${NGINX_CONFIGURATION}"
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_ETC_FOLDER__!${NGINX_ETC_FOLDER}!" "${NGINX_CONFIGURATION}"
-if [ "${TOR_INSTALL}" = ON ];then
- echo "[*] Read tor v3 onion hostnames"
-
- NGINX_MEMPOOL_ONION=$(cat "${TOR_RESOURCES}/mempool/hostname")
- osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}"
-
- if [ "${ELEMENTS_LIQUID_ENABLE}" = "ON" ];then
- NGINX_LIQUID_ONION=$(cat "${TOR_RESOURCES}/liquid/hostname")
- osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}"
- fi
-
- if [ "${BISQ_MAINNET_ENABLE}" = "ON" ];then
- NGINX_BISQ_ONION=$(cat "${TOR_RESOURCES}/bisq/hostname")
- osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}"
- fi
-fi
+#if [ "${TOR_INSTALL}" = ON ];then
+# echo "[*] Read tor v3 onion hostnames"
+#
+# NGINX_MEMPOOL_ONION=$(cat "${TOR_RESOURCES}/mempool/hostname")
+# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}"
+#
+# if [ "${ELEMENTS_LIQUID_ENABLE}" = "ON" ];then
+# NGINX_LIQUID_ONION=$(cat "${TOR_RESOURCES}/liquid/hostname")
+# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}"
+# fi
+#
+# if [ "${BISQ_MAINNET_ENABLE}" = "ON" ];then
+# NGINX_BISQ_ONION=$(cat "${TOR_RESOURCES}/bisq/hostname")
+# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}"
+# fi
+#fi
##### OS systemd
@@ -1896,13 +1896,26 @@ echo "[*] Updating system startup configuration"
case $OS in
FreeBSD)
- echo 'nginx_enable="YES"' >> /etc/rc.conf
- echo 'bitcoin_enable="YES"' >> /etc/rc.conf
- echo 'tor_enable="YES"' >> /etc/rc.conf
- echo 'postfix_enable="YES"' >> /etc/rc.conf
- echo 'mysql_enable="YES"' >> /etc/rc.conf
- echo 'mysql_dbdir="/mysql"' >> /etc/rc.conf
- echo 'tor_enable="YES"' >> /etc/rc.conf
+ cat >> /etc/rc.conf <
Date: Fri, 25 Aug 2023 23:29:03 +0900
Subject: [PATCH 074/671] ops: Increase FreeBSD bitcoin node shutdown timeout
to 600
---
production/freebsd/rc.d/bitcoin | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/production/freebsd/rc.d/bitcoin b/production/freebsd/rc.d/bitcoin
index 76c217589..c22fbbabc 100644
--- a/production/freebsd/rc.d/bitcoin
+++ b/production/freebsd/rc.d/bitcoin
@@ -48,7 +48,7 @@ load_rc_config ${name}
: ${bitcoin_syslog_facility:="local0"}
: ${bitcoin_syslog_priority:="info"}
: ${bitcoin_syslog_tag:="bitcoin"}
-: ${bitcoin_kill_after:="300"}
+: ${bitcoin_kill_after:="600"}
: ${bitcoinlimits_args:="-e -U ${bitcoin_user}"}
# set up dependant variables
From 0fde6dd908864b741fa0adb82e6fb007a462a1a1 Mon Sep 17 00:00:00 2001
From: wiz
Date: Fri, 25 Aug 2023 23:34:50 +0900
Subject: [PATCH 075/671] ops: Bump prod NodeJS version to v20.5.1
---
production/install | 8 +++-----
production/mempool-start-all | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/production/install b/production/install
index 13449a904..7ab1e657b 100755
--- a/production/install
+++ b/production/install
@@ -1045,11 +1045,9 @@ osSudo "${ROOT_USER}" crontab -u "${MEMPOOL_USER}" "${MEMPOOL_HOME}/${MEMPOOL_RE
echo "[*] Installing nvm.sh from GitHub"
osSudo "${MEMPOOL_USER}" sh -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh'
-echo "[*] Building NodeJS v20.4.0 via nvm.sh"
-osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v20.4.0 --shared-zlib'
-echo "[*] Building NodeJS v18.16.1 via nvm.sh"
-osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v18.16.1 --shared-zlib'
-osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm alias default 18.16.1'
+echo "[*] Building NodeJS v20.5.1 via nvm.sh"
+osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v20.5.1 --shared-zlib'
+osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm alias default 20.5.1'
####################
# Tor installation #
diff --git a/production/mempool-start-all b/production/mempool-start-all
index 7efbf7dd6..5b4f85577 100755
--- a/production/mempool-start-all
+++ b/production/mempool-start-all
@@ -1,7 +1,7 @@
#!/usr/bin/env zsh
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
-nvm use v20.4.0
+nvm use v20.5.1
# start all mempool backends that exist
for site in mainnet mainnet-lightning testnet testnet-lightning signet signet-lightning bisq liquid liquidtestnet;do
From dc44f1b618cf364a1eeddbb6c298cf1fca9ed47c Mon Sep 17 00:00:00 2001
From: wiz
Date: Sat, 26 Aug 2023 04:40:12 +0900
Subject: [PATCH 076/671] ops: Fix WebGL for unfurler
---
unfurler/puppeteer.config.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unfurler/puppeteer.config.json b/unfurler/puppeteer.config.json
index 4d525755e..583ce7148 100644
--- a/unfurler/puppeteer.config.json
+++ b/unfurler/puppeteer.config.json
@@ -42,6 +42,6 @@
"--use-mock-keychain",
"--ignore-gpu-blacklist",
"--ignore-gpu-blocklist",
- "--use-gl=egl"
+ "--use-angle=default"
]
}
From d42a3f74ec895f5b5921a2669b0daf55196d6964 Mon Sep 17 00:00:00 2001
From: hunicus <93150691+hunicus@users.noreply.github.com>
Date: Sat, 26 Aug 2023 14:18:55 +0900
Subject: [PATCH 077/671] Add description to index html and seo service
---
frontend/src/app/services/seo.service.ts | 6 ++++++
frontend/src/index.bisq.html | 18 +++++++++---------
frontend/src/index.liquid.html | 17 +++++++++--------
frontend/src/index.mempool.html | 17 +++++++++--------
4 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/frontend/src/app/services/seo.service.ts b/frontend/src/app/services/seo.service.ts
index 4fc25be52..37387e6bf 100644
--- a/frontend/src/app/services/seo.service.ts
+++ b/frontend/src/app/services/seo.service.ts
@@ -52,6 +52,12 @@ export class SeoService {
this.resetTitle();
}
+ setDescription(newDescription: string): void {
+ this.metaService.updateTag({ name: 'description', content: newDescription});
+ this.metaService.updateTag({ name: 'twitter:description', content: newDescription});
+ this.metaService.updateTag({ property: 'og:description', content: newDescription});
+ }
+
getTitle(): string {
if (this.network === 'testnet')
return this.baseTitle + ' - Bitcoin Testnet';
diff --git a/frontend/src/index.bisq.html b/frontend/src/index.bisq.html
index 6d3bcb130..614c06bd4 100644
--- a/frontend/src/index.bisq.html
+++ b/frontend/src/index.bisq.html
@@ -7,18 +7,18 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/frontend/src/index.liquid.html b/frontend/src/index.liquid.html
index ce57e5873..37e4241a0 100644
--- a/frontend/src/index.liquid.html
+++ b/frontend/src/index.liquid.html
@@ -7,18 +7,19 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/frontend/src/index.mempool.html b/frontend/src/index.mempool.html
index ec026b63b..e0816f6b3 100644
--- a/frontend/src/index.mempool.html
+++ b/frontend/src/index.mempool.html
@@ -7,18 +7,19 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
From fcecbe49677144328c743ba86b6d3fbd95305cc8 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sat, 26 Aug 2023 09:52:55 +0200
Subject: [PATCH 078/671] [tx] integrated accelerator
---
.../accelerate-preview.component.html | 231 ++++++++++++++++++
.../accelerate-preview.component.scss | 20 ++
.../accelerate-preview.component.ts | 163 +++++++++++-
.../transaction/transaction.component.html | 32 +--
.../transaction/transaction.component.scss | 59 +++--
.../transaction/transaction.component.ts | 7 +-
frontend/src/app/services/api.service.ts | 4 +
.../mempool-error.component.html | 2 +
.../mempool-error/mempool-error.component.ts | 47 ++++
frontend/src/app/shared/shared.module.ts | 8 +-
10 files changed, 519 insertions(+), 54 deletions(-)
create mode 100644 frontend/src/app/shared/components/mempool-error/mempool-error.component.html
create mode 100644 frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
index e69de29bb..e2c6e3c22 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
@@ -0,0 +1,231 @@
+
+
+
+ Transaction has now been submitted to mining pools for acceleration. You can track the progress
here .
+
+
+
+
+
+
+ 1">
+
+
+ This transactions is part of a CPFP tree. Fee rates (in sats/vb) are provided for your information. Change in the CPFP tree will lead to different fee rates values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Next block market price
+
+
+ {{ estimate.targetFeeRate | number : '1.0-0' }} sat/vB
+
+
+
+
+ Currently estimated fee to get into next block
+
+
+
+ {{ estimate.nextBlockFee| number }} sats
+
+
+
+
+
+
+
+
+ Fees paid in-band
+
+
+ ~ {{ (estimate.txSummary.effectiveFee / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB
+
+
+
+
+ What you already paid when you made the transaction
+
+
+
+ {{ estimate.txSummary.effectiveFee | number }} sats
+
+
+
+
+
+
+
+
+ Extra fee required
+
+
+ {{ math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee) | number }} sats
+
+
+
+
+
+ Difference between the next block fee and your tx fee
+
+
+
+
+
+
+
+
How much more are you willing to pay at most to get into the next block?
+
+
+
+ The maximum extra transaction fee you're willing to pay to get into the next block. If the next block market price becomes too expensive for you, we will automatically cancel your acceleration request. Final charged fee may be smaller based on the fee market.
+
+
+
+
+
+
Acceleration summary
+
+
+
+
+
+
+
+ Your maximum tx fees
+
+
+ ~{{ ((estimate.txSummary.effectiveFee + userBid) / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB
+
+
+
+
+ The maximum extra transaction fee you're willing to pay
+
+
+
+ {{ userBid | number }} sats
+
+
+
+
+
+
+
+
+ Mempool Accelerator™ fee
+
+
+ +{{ estimate.mempoolBaseFee + estimate.vsizeFee | number }} sats
+
+
+
+
+
+ mempool.space fee
+
+
+
+ {{ estimate.mempoolBaseFee | number }} sats
+
+
+
+
+
+
+ Transaction vsize fee
+
+
+
+ {{ estimate.vsizeFee | number }} sats
+
+
+
+
+
+
+
+
+ Estimated acceleration cost
+
+
+
+ {{ estimate.cost + estimate.mempoolBaseFee + estimate.vsizeFee | number }} satss
+
+
+
+
+
+
+ Cost if your tx is accelerated using {{ estimate.targetFeeRate | number : '1.0-0' }} sat/vB
+
+
+
+
+
+
+ Maximum acceleration cost
+
+
+ {{ maxCost | number }} satss
+
+
+
+
+
+
+
+ Cost if your tx is accelerated using ~{{ ((estimate.txSummary.effectiveFee + userBid) / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB
+
+
+
+
+
+
+ Available balance
+
+
+ {{ estimate.userBalance | number }} satss
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
index e69de29bb..b6981b8a7 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
@@ -0,0 +1,20 @@
+.fee-card {
+ padding: 15px;
+ background-color: #1d1f31;
+}
+
+.btn-border {
+ border: solid 1px black;
+ background-color: #0c4a87;
+}
+
+.feerate.active {
+ background-color: #105fb0 !important;
+ opacity: 1;
+ border: 1px solid white !important;
+}
+
+.estimateDisabled {
+ opacity: 0.5;
+ pointer-events: none;
+}
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
index dc8b9b5df..bea0efb88 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
@@ -1,24 +1,169 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
+import { ApiService } from '../../services/api.service';
+import { Subscription, catchError, of, tap } from 'rxjs';
+
+export type AccelerationEstimate = {
+ txSummary: TxSummary;
+ nextBlockFee: number;
+ targetFeeRate: number;
+ userBalance: number;
+ enoughBalance: boolean;
+ cost: number;
+ mempoolBaseFee: number;
+ vsizeFee: number;
+}
+export type TxSummary = {
+ txid: string; // txid of the current transaction
+ effectiveVsize: number; // Total vsize of the dependency tree
+ effectiveFee: number; // Total fee of the dependency tree in sats
+ ancestorCount: number; // Number of ancestors
+}
+
+export const DEFAULT_BID_RATIO = 5;
+export const MIN_BID_RATIO = 2;
+export const MAX_BID_RATIO = 20;
@Component({
- selector: 'app-accelerator-preview',
+ selector: 'app-accelerate-preview',
templateUrl: 'accelerate-preview.component.html',
styleUrls: ['accelerate-preview.component.scss']
})
+export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges {
+ @Input() txid: string | undefined;
+ @Input() scrollEvent: boolean;
+
+ math = Math;
+ error = '';
+ showSuccess = false;
+ estimateSubscription: Subscription;
+ accelerationSubscription: Subscription;
+ estimate: any;
+ minExtraCost = 0;
+ minBidAllowed = 0;
+ maxBidAllowed = 0;
+ defaultBid = 0;
+ maxCost = 0;
+ userBid = 0;
+ selectFeeRateIndex = 2;
-export class AcceleratePreviewComponent implements OnInit {
constructor(
private apiService: ApiService
) { }
+ ngOnDestroy(): void {
+ if (this.estimateSubscription) {
+ this.estimateSubscription.unsubscribe();
+ }
+ }
+
+ ngOnChanges(changes: SimpleChanges): void {
+ if (changes.scrollEvent) {
+ this.scrollToPreview('acceleratePreviewAnchor', 'center');
+ }
+ }
+
ngOnInit() {
- this.apiService.estimate$(this.txId).subscribe((estimate) => {
- console.log(estimate.body);
- document.getElementById('acceleratePreviewAnchor').scrollIntoView({
+ this.estimateSubscription = this.apiService.estimate$(this.txid).pipe(
+ tap((response) => {
+ if (response.status === 204) {
+ this.estimate = undefined;
+ this.error = `cannot_accelerate_tx`;
+ this.scrollToPreviewWithTimeout('mempoolError', 'center');
+ this.estimateSubscription.unsubscribe();
+ } else {
+ this.estimate = response.body;
+ if (!this.estimate) {
+ this.error = `cannot_accelerate_tx`;
+ this.scrollToPreviewWithTimeout('mempoolError', 'center');
+ this.estimateSubscription.unsubscribe();
+ }
+
+ if (this.estimate.userBalance <= 0) {
+ this.error = `not_enough_balance`;
+ this.scrollToPreviewWithTimeout('mempoolError', 'center');
+ }
+
+ // Make min extra fee at least 50% of the current tx fee
+ this.minExtraCost = Math.max(this.estimate.cost, this.estimate.txSummary.effectiveFee / 2);
+ this.minExtraCost = Math.round(this.minExtraCost);
+
+ this.minBidAllowed = this.minExtraCost * MIN_BID_RATIO;
+ this.maxBidAllowed = this.minExtraCost * MAX_BID_RATIO;
+ this.defaultBid = this.minExtraCost * DEFAULT_BID_RATIO;
+
+ this.userBid = this.defaultBid;
+ if (this.userBid < this.minBidAllowed) {
+ this.userBid = this.minBidAllowed;
+ } else if (this.userBid > this.maxBidAllowed) {
+ this.userBid = this.maxBidAllowed;
+ }
+ this.maxCost = this.userBid + this.estimate.mempoolBaseFee + this.estimate.vsizeFee;
+
+ if (!this.error) {
+ this.scrollToPreview('acceleratePreviewAnchor', 'center');
+ }
+ }
+ }),
+ catchError((response) => {
+ this.estimate = undefined;
+ this.error = response.error;
+ this.scrollToPreviewWithTimeout('mempoolError', 'center');
+ this.estimateSubscription.unsubscribe();
+ return of(null);
+ })
+ ).subscribe();
+ }
+
+ /**
+ * User changed his bid
+ */
+ setUserBid(multiplier: number, index: number) {
+ if (this.estimate) {
+ this.selectFeeRateIndex = index;
+ this.userBid = Math.max(0, this.minExtraCost * multiplier);
+ this.maxCost = this.userBid + this.estimate.mempoolBaseFee + this.estimate.vsizeFee;
+ }
+ }
+
+ /**
+ * Scroll to element id with or without setTimeout
+ */
+ scrollToPreviewWithTimeout(id: string, position: ScrollLogicalPosition) {
+ setTimeout(() => {
+ this.scrollToPreview(id, position);
+ }, 100);
+ }
+ scrollToPreview(id: string, position: ScrollLogicalPosition) {
+ const acceleratePreviewAnchor = document.getElementById(id);
+ if (acceleratePreviewAnchor) {
+ acceleratePreviewAnchor.scrollIntoView({
behavior: 'smooth',
- inline: 'center',
- block: 'center',
+ inline: position,
+ block: position,
});
- })
+ }
+}
+
+ /**
+ * Send acceleration request
+ */
+ accelerate() {
+ if (this.accelerationSubscription) {
+ this.accelerationSubscription.unsubscribe();
+ }
+ this.accelerationSubscription = this.apiService.accelerate$(
+ this.txid,
+ this.userBid
+ ).subscribe({
+ next: () => {
+ this.showSuccess = true;
+ this.scrollToPreviewWithTimeout('successAlert', 'center');
+ this.estimateSubscription.unsubscribe();
+ },
+ error: (response) => {
+ this.error = response.error;
+ this.scrollToPreviewWithTimeout('mempoolError', 'center');
+ }
+ });
}
}
\ No newline at end of file
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index 36c7ab9f3..f7dd45d3b 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -6,7 +6,7 @@
-
+
Accelerate this transaction using the Mempool Accelerator ™
×
@@ -78,33 +78,17 @@
+
Accelerate
-
-
-
@@ -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,
From 1fe08d1234d6cfcdbbe22d1aabfc9048e58a3ce9 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sat, 26 Aug 2023 10:05:04 +0200
Subject: [PATCH 079/671] [accelerator] fix overflow in tx page integrated
accel
---
.../accelerate-preview/accelerate-preview.component.html | 4 ++--
.../accelerate-preview/accelerate-preview.component.scss | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
index e2c6e3c22..5afdc07f9 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
@@ -24,7 +24,7 @@
-
+
@@ -110,7 +110,7 @@
Acceleration summary
-
+
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
index b6981b8a7..e6c717369 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
@@ -18,3 +18,10 @@
opacity: 0.5;
pointer-events: none;
}
+
+.table-accelerator {
+ table-layout: fixed;
+ & tr {
+ text-wrap: wrap;
+ }
+}
\ No newline at end of file
From 726bd51abb9b26da9e3de74525df04fc9cb3780c Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sat, 26 Aug 2023 11:27:45 +0200
Subject: [PATCH 080/671] [debug] update versioning print
---
frontend/src/app/interfaces/websocket.interface.ts | 2 +-
.../components/global-footer/global-footer.component.html | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/frontend/src/app/interfaces/websocket.interface.ts b/frontend/src/app/interfaces/websocket.interface.ts
index 43ab1e5f4..1d0414de7 100644
--- a/frontend/src/app/interfaces/websocket.interface.ts
+++ b/frontend/src/app/interfaces/websocket.interface.ts
@@ -95,7 +95,7 @@ export interface TransactionStripped {
}
export interface IBackendInfo {
- hostname: string;
+ hostname?: string;
gitCommit: string;
version: string;
}
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.html b/frontend/src/app/shared/components/global-footer/global-footer.component.html
index 73b4d0975..b12874832 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.html
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.html
@@ -91,9 +91,11 @@
From a3d61fa52546b1406a8e932648c8c91b73055f5e Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sat, 26 Aug 2023 15:07:05 +0200
Subject: [PATCH 081/671] [accelerator] show payment preview when not logged in
---
.../accelerate-preview.component.html | 2 +-
.../accelerate-preview.component.ts | 15 ++++++++++++---
frontend/src/app/services/api.service.ts | 12 +++---------
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
index 5afdc07f9..c546d3859 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
@@ -219,7 +219,7 @@
-
+
Accelerate
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
index bea0efb88..b4c7af704 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
import { ApiService } from '../../services/api.service';
import { Subscription, catchError, of, tap } from 'rxjs';
+import { StorageService } from '../../services/storage.service';
export type AccelerationEstimate = {
txSummary: TxSummary;
@@ -47,7 +48,8 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
selectFeeRateIndex = 2;
constructor(
- private apiService: ApiService
+ private apiService: ApiService,
+ private storageService: StorageService
) { }
ngOnDestroy(): void {
@@ -79,8 +81,10 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
}
if (this.estimate.userBalance <= 0) {
- this.error = `not_enough_balance`;
- this.scrollToPreviewWithTimeout('mempoolError', 'center');
+ if (this.isLoggedIn()) {
+ this.error = `not_enough_balance`;
+ this.scrollToPreviewWithTimeout('mempoolError', 'center');
+ }
}
// Make min extra fee at least 50% of the current tx fee
@@ -166,4 +170,9 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
}
});
}
+
+ isLoggedIn() {
+ const auth = this.storageService.getAuth();
+ return auth !== null;
+ }
}
\ No newline at end of file
diff --git a/frontend/src/app/services/api.service.ts b/frontend/src/app/services/api.service.ts
index ea185b1ec..744474f9d 100644
--- a/frontend/src/app/services/api.service.ts
+++ b/frontend/src/app/services/api.service.ts
@@ -357,9 +357,7 @@ export class ApiService {
return of(null);
}
- return this.httpClient.get
(`${SERVICES_API_PREFIX}/account/menu`, {
- headers: { 'Authorization': auth.token }
- });
+ return this.httpClient.get(`${SERVICES_API_PREFIX}/account/menu`);
}
getUserInfo$(): Observable {
@@ -368,9 +366,7 @@ export class ApiService {
return of(null);
}
- return this.httpClient.get(`${SERVICES_API_PREFIX}/account`, {
- headers: { 'Authorization': auth.token }
- });
+ return this.httpClient.get(`${SERVICES_API_PREFIX}/account`);
}
logout$(): Observable {
@@ -380,9 +376,7 @@ export class ApiService {
}
localStorage.removeItem('auth');
- return this.httpClient.post(`${SERVICES_API_PREFIX}/auth/logout`, {
- headers: { 'Authorization': auth.token }
- });
+ return this.httpClient.post(`${SERVICES_API_PREFIX}/auth/logout`, {});
}
getServicesBackendInfo$(): Observable {
From 528877f43f1f1a8fc3f74a96e97f042cf9469617 Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Sun, 27 Aug 2023 00:30:33 +0900
Subject: [PATCH 082/671] Send cpfp/effective fee rate changes to subscribed ws
clients
---
backend/src/api/mempool-blocks.ts | 13 ++++
backend/src/api/websocket-handler.ts | 16 ++++-
backend/src/mempool.interfaces.ts | 1 +
.../transaction/transaction.component.ts | 64 +++++++++++--------
.../src/app/interfaces/electrs.interface.ts | 2 +-
.../src/app/interfaces/node-api.interface.ts | 2 +-
frontend/src/app/services/state.service.ts | 4 +-
7 files changed, 68 insertions(+), 34 deletions(-)
diff --git a/backend/src/api/mempool-blocks.ts b/backend/src/api/mempool-blocks.ts
index 1de4bbee7..15f9b6cf7 100644
--- a/backend/src/api/mempool-blocks.ts
+++ b/backend/src/api/mempool-blocks.ts
@@ -451,6 +451,7 @@ class MempoolBlocks {
private processBlockTemplates(mempool: { [txid: string]: MempoolTransactionExtended }, blocks: string[][], blockWeights: number[] | null, rates: [string, number][], clusters: string[][], accelerations, accelerationPool, saveResults): MempoolBlockWithTransactions[] {
for (const [txid, rate] of rates) {
if (txid in mempool) {
+ mempool[txid].cpfpDirty = (rate !== mempool[txid].effectiveFeePerVsize);
mempool[txid].effectiveFeePerVsize = rate;
mempool[txid].cpfpChecked = false;
}
@@ -494,6 +495,9 @@ class MempoolBlocks {
}
}
});
+ if (mempoolTx.ancestors?.length !== ancestors.length || mempoolTx.descendants?.length !== descendants.length) {
+ mempoolTx.cpfpDirty = true;
+ }
Object.assign(mempoolTx, {ancestors, descendants, bestDescendant: null, cpfpChecked: true});
}
}
@@ -531,12 +535,21 @@ class MempoolBlocks {
const acceleration = accelerations[txid];
if (isAccelerated[txid] || (acceleration && (!accelerationPool || acceleration.pools.includes(accelerationPool)))) {
+ if (!mempoolTx.acceleration) {
+ mempoolTx.cpfpDirty = true;
+ }
mempoolTx.acceleration = true;
for (const ancestor of mempoolTx.ancestors || []) {
+ if (!mempool[ancestor.txid].acceleration) {
+ mempool[ancestor.txid].cpfpDirty = true;
+ }
mempool[ancestor.txid].acceleration = true;
isAccelerated[ancestor.txid] = true;
}
} else {
+ if (mempoolTx.acceleration) {
+ mempoolTx.cpfpDirty = true;
+ }
delete mempoolTx.acceleration;
}
diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts
index 9cb24df10..41cb6b99c 100644
--- a/backend/src/api/websocket-handler.ts
+++ b/backend/src/api/websocket-handler.ts
@@ -586,13 +586,25 @@ class WebsocketHandler {
const mempoolTx = newMempool[trackTxid];
if (mempoolTx && mempoolTx.position) {
- response['txPosition'] = JSON.stringify({
+ const positionData = {
txid: trackTxid,
position: {
...mempoolTx.position,
accelerated: mempoolTx.acceleration || undefined,
}
- });
+ };
+ if (mempoolTx.cpfpDirty) {
+ positionData['cpfp'] = {
+ ancestors: mempoolTx.ancestors,
+ bestDescendant: mempoolTx.bestDescendant || null,
+ descendants: mempoolTx.descendants || null,
+ effectiveFeePerVsize: mempoolTx.effectiveFeePerVsize || null,
+ sigops: mempoolTx.sigops,
+ adjustedVsize: mempoolTx.adjustedVsize,
+ acceleration: mempoolTx.acceleration
+ };
+ }
+ response['txPosition'] = JSON.stringify(positionData);
}
}
diff --git a/backend/src/mempool.interfaces.ts b/backend/src/mempool.interfaces.ts
index c08846191..b013f2f26 100644
--- a/backend/src/mempool.interfaces.ts
+++ b/backend/src/mempool.interfaces.ts
@@ -104,6 +104,7 @@ export interface MempoolTransactionExtended extends TransactionExtended {
adjustedFeePerVsize: number;
inputs?: number[];
lastBoosted?: number;
+ cpfpDirty?: boolean;
}
export interface AuditTransaction {
diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts
index f1f3850e4..216079535 100644
--- a/frontend/src/app/components/transaction/transaction.component.ts
+++ b/frontend/src/app/components/transaction/transaction.component.ts
@@ -161,34 +161,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
})
)
.subscribe((cpfpInfo) => {
- if (!cpfpInfo || !this.tx) {
- this.cpfpInfo = null;
- this.hasEffectiveFeeRate = false;
- return;
- }
- // merge ancestors/descendants
- const relatives = [...(cpfpInfo.ancestors || []), ...(cpfpInfo.descendants || [])];
- if (cpfpInfo.bestDescendant && !cpfpInfo.descendants?.length) {
- relatives.push(cpfpInfo.bestDescendant);
- }
- const hasRelatives = !!relatives.length;
- if (!cpfpInfo.effectiveFeePerVsize && hasRelatives) {
- let totalWeight =
- this.tx.weight +
- relatives.reduce((prev, val) => prev + val.weight, 0);
- let totalFees =
- this.tx.fee +
- relatives.reduce((prev, val) => prev + val.fee, 0);
- this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
- } else {
- this.tx.effectiveFeePerVsize = cpfpInfo.effectiveFeePerVsize;
- }
- if (cpfpInfo.acceleration) {
- this.tx.acceleration = cpfpInfo.acceleration;
- }
-
- this.cpfpInfo = cpfpInfo;
- this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && (Math.abs(this.tx.effectiveFeePerVsize - this.tx.feePerVsize) > 0.01));
+ this.setCpfpInfo(cpfpInfo);
});
this.fetchRbfSubscription = this.fetchRbfHistory$
@@ -259,6 +232,10 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
mempoolPosition: this.mempoolPosition
});
this.txInBlockIndex = this.mempoolPosition.block;
+
+ if (txPosition.cpfp !== undefined) {
+ this.setCpfpInfo(txPosition.cpfp);
+ }
}
} else {
this.mempoolPosition = null;
@@ -507,6 +484,37 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
});
}
+ setCpfpInfo(cpfpInfo: CpfpInfo): void {
+ if (!cpfpInfo || !this.tx) {
+ this.cpfpInfo = null;
+ this.hasEffectiveFeeRate = false;
+ return;
+ }
+ // merge ancestors/descendants
+ const relatives = [...(cpfpInfo.ancestors || []), ...(cpfpInfo.descendants || [])];
+ if (cpfpInfo.bestDescendant && !cpfpInfo.descendants?.length) {
+ relatives.push(cpfpInfo.bestDescendant);
+ }
+ const hasRelatives = !!relatives.length;
+ if (!cpfpInfo.effectiveFeePerVsize && hasRelatives) {
+ const totalWeight =
+ this.tx.weight +
+ relatives.reduce((prev, val) => prev + val.weight, 0);
+ const totalFees =
+ this.tx.fee +
+ relatives.reduce((prev, val) => prev + val.fee, 0);
+ this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
+ } else {
+ this.tx.effectiveFeePerVsize = cpfpInfo.effectiveFeePerVsize;
+ }
+ if (cpfpInfo.acceleration) {
+ this.tx.acceleration = cpfpInfo.acceleration;
+ }
+
+ this.cpfpInfo = cpfpInfo;
+ this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && (Math.abs(this.tx.effectiveFeePerVsize - this.tx.feePerVsize) > 0.01));
+ }
+
setFeatures(): void {
if (this.tx) {
this.segwitEnabled = !this.tx.status.confirmed || isFeatureActive(this.stateService.network, this.tx.status.block_height, 'segwit');
diff --git a/frontend/src/app/interfaces/electrs.interface.ts b/frontend/src/app/interfaces/electrs.interface.ts
index 5c15b0ae4..2d604a9de 100644
--- a/frontend/src/app/interfaces/electrs.interface.ts
+++ b/frontend/src/app/interfaces/electrs.interface.ts
@@ -19,7 +19,7 @@ export interface Transaction {
ancestors?: Ancestor[];
bestDescendant?: BestDescendant | null;
cpfpChecked?: boolean;
- acceleration?: number;
+ acceleration?: boolean;
deleteAfter?: number;
_unblinded?: any;
_deduced?: boolean;
diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts
index fbf86aeb4..a9f069b56 100644
--- a/frontend/src/app/interfaces/node-api.interface.ts
+++ b/frontend/src/app/interfaces/node-api.interface.ts
@@ -27,7 +27,7 @@ export interface CpfpInfo {
effectiveFeePerVsize?: number;
sigops?: number;
adjustedVsize?: number;
- acceleration?: number;
+ acceleration?: boolean;
}
export interface RbfInfo {
diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts
index 91e4d7475..23bca052c 100644
--- a/frontend/src/app/services/state.service.ts
+++ b/frontend/src/app/services/state.service.ts
@@ -2,7 +2,7 @@ import { Inject, Injectable, PLATFORM_ID, LOCALE_ID } from '@angular/core';
import { ReplaySubject, BehaviorSubject, Subject, fromEvent, Observable, merge } from 'rxjs';
import { Transaction } from '../interfaces/electrs.interface';
import { IBackendInfo, MempoolBlock, MempoolBlockDelta, MempoolInfo, Recommendedfees, ReplacedTransaction, ReplacementInfo, TransactionStripped } from '../interfaces/websocket.interface';
-import { BlockExtended, DifficultyAdjustment, MempoolPosition, OptimizedMempoolStats, RbfTree } from '../interfaces/node-api.interface';
+import { BlockExtended, CpfpInfo, DifficultyAdjustment, MempoolPosition, OptimizedMempoolStats, RbfTree } from '../interfaces/node-api.interface';
import { Router, NavigationStart } from '@angular/router';
import { isPlatformBrowser } from '@angular/common';
import { filter, map, scan, shareReplay } from 'rxjs/operators';
@@ -113,7 +113,7 @@ export class StateService {
utxoSpent$ = new Subject();
difficultyAdjustment$ = new ReplaySubject(1);
mempoolTransactions$ = new Subject();
- mempoolTxPosition$ = new Subject<{ txid: string, position: MempoolPosition}>();
+ mempoolTxPosition$ = new Subject<{ txid: string, position: MempoolPosition, cpfp: CpfpInfo | null}>();
blockTransactions$ = new Subject();
isLoadingWebSocket$ = new ReplaySubject(1);
isLoadingMempool$ = new BehaviorSubject(true);
From 5f4add3e22c43256776a31fd6a45a01ffc469cff Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sun, 27 Aug 2023 09:07:47 +0200
Subject: [PATCH 083/671] [tx] fix css when accel not available
---
.../app/components/transaction/transaction.component.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index f7dd45d3b..141c536ee 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -6,7 +6,7 @@
-
+
Accelerate this transaction using the Mempool Accelerator ™
×
@@ -116,9 +116,9 @@
= 7" [ngIfElse]="belowBlockLimit">
-
+
In several hours (or more)
- Accelerate
+ Accelerate
@@ -128,7 +128,7 @@
- Accelerate
+ Accelerate
From 78ea9cbd16aefb433eff3014723b4369327f45a3 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sun, 27 Aug 2023 12:52:58 +0200
Subject: [PATCH 084/671] [ui] polish x1
---
.../master-page/master-page.component.html | 4 +--
.../master-page/master-page.component.ts | 19 ++++++++++++--
.../src/app/components/menu/menu.component.ts | 25 +++++++++++--------
3 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/frontend/src/app/components/master-page/master-page.component.html b/frontend/src/app/components/master-page/master-page.component.html
index b24442f23..74a95daf5 100644
--- a/frontend/src/app/components/master-page/master-page.component.html
+++ b/frontend/src/app/components/master-page/master-page.component.html
@@ -77,12 +77,12 @@
-
+
-
+
diff --git a/frontend/src/app/components/master-page/master-page.component.ts b/frontend/src/app/components/master-page/master-page.component.ts
index 06ec1784e..49bed7a5d 100644
--- a/frontend/src/app/components/master-page/master-page.component.ts
+++ b/frontend/src/app/components/master-page/master-page.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit, Input, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
import { Env, StateService } from '../../services/state.service';
import { Observable, merge, of } from 'rxjs';
import { LanguageService } from '../../services/language.service';
@@ -31,9 +32,10 @@ export class MasterPageComponent implements OnInit {
userAuth: any | undefined;
user: any = undefined;
servicesEnabled = false;
+ menuOpen = false;
@ViewChild(MenuComponent)
- private menuComponent!: MenuComponent;
+ public menuComponent!: MenuComponent;
constructor(
public stateService: StateService,
@@ -42,6 +44,7 @@ export class MasterPageComponent implements OnInit {
private navigationService: NavigationService,
private storageService: StorageService,
private apiService: ApiService,
+ private router: Router,
) { }
ngOnInit(): void {
@@ -65,14 +68,21 @@ export class MasterPageComponent implements OnInit {
this.servicesEnabled = this.officialMempoolSpace && this.stateService.env.ACCELERATOR === true && this.stateService.network === '';
this.refreshAuth();
+
+ const isServicesPage = this.router.url.includes('/services/');
+ this.menuOpen = isServicesPage && !this.isSmallScreen();
}
collapse(): void {
this.navCollapsed = !this.navCollapsed;
}
+ isSmallScreen() {
+ return window.innerWidth <= 767.98;
+ }
+
onResize(): void {
- this.isMobile = window.innerWidth <= 767.98;
+ this.isMobile = this.isSmallScreen();
}
brandClick(e): void {
@@ -90,7 +100,12 @@ export class MasterPageComponent implements OnInit {
hamburgerClick(event): void {
if (this.menuComponent) {
this.menuComponent.hamburgerClick();
+ this.menuOpen = this.menuComponent.navOpen;
event.stopPropagation();
}
}
+
+ menuToggled(isOpen: boolean): void {
+ this.menuOpen = isOpen;
+ }
}
diff --git a/frontend/src/app/components/menu/menu.component.ts b/frontend/src/app/components/menu/menu.component.ts
index a560a1b49..e6ba848bc 100644
--- a/frontend/src/app/components/menu/menu.component.ts
+++ b/frontend/src/app/components/menu/menu.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, Output, EventEmitter, HostListener } from '@angular/core';
+import { Component, OnInit, Input, Output, EventEmitter, HostListener } from '@angular/core';
import { Observable } from 'rxjs';
import { ApiService } from '../../services/api.service';
import { MenuGroup } from '../../interfaces/services.interface';
@@ -13,9 +13,10 @@ import { StateService } from '../../services/state.service';
})
export class MenuComponent implements OnInit {
+ @Input() navOpen: boolean = false;
@Output() loggedOut = new EventEmitter();
-
- navOpen: boolean = false;
+ @Output() menuToggled = new EventEmitter();
+
userMenuGroups$: Observable | undefined;
userAuth: any | undefined;
isServicesPage = false;
@@ -34,17 +35,20 @@ export class MenuComponent implements OnInit {
}
this.isServicesPage = this.router.url.includes('/services/');
- this.navOpen = this.isServicesPage && !this.isSmallScreen();
-
this.router.events.subscribe((event) => {
if (event instanceof NavigationStart) {
if (!this.isServicesPage) {
- this.navOpen = false;
+ this.toggleMenu(false);
}
}
});
}
+ toggleMenu(toggled: boolean) {
+ this.navOpen = toggled;
+ this.menuToggled.emit(toggled);
+ }
+
isSmallScreen() {
return window.innerWidth <= 767.98;
}
@@ -61,13 +65,13 @@ export class MenuComponent implements OnInit {
onLinkClick(link) {
if (!this.isServicesPage || this.isSmallScreen()) {
- this.navOpen = false;
+ this.toggleMenu(false);
}
this.router.navigateByUrl(link);
}
hamburgerClick() {
- this.navOpen = !this.navOpen;
+ this.toggleMenu(!this.navOpen);
this.stateService.menuOpen$.next(this.navOpen);
}
@@ -78,7 +82,7 @@ export class MenuComponent implements OnInit {
if (!cssClasses.indexOf) { // Click on chart or non html thingy, close the menu
if (!this.isServicesPage || isServicesPageOnMobile) {
- this.navOpen = false;
+ this.toggleMenu(false);
}
return;
}
@@ -86,8 +90,7 @@ export class MenuComponent implements OnInit {
const isHamburger = cssClasses.indexOf('profile_image') !== -1;
const isMenu = cssClasses.indexOf('menu-click') !== -1;
if (!isHamburger && !isMenu && (!this.isServicesPage || isServicesPageOnMobile)) {
- this.navOpen = false;
- return;
+ this.toggleMenu(false);
}
}
}
From 8ba4a7b4218459bfca33d6ee8b99258c1179682b Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sun, 27 Aug 2023 19:17:03 +0200
Subject: [PATCH 085/671] [ui] polish x2
---
.../app/components/master-page/master-page.component.scss | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/frontend/src/app/components/master-page/master-page.component.scss b/frontend/src/app/components/master-page/master-page.component.scss
index 9477ca792..f0fec0536 100644
--- a/frontend/src/app/components/master-page/master-page.component.scss
+++ b/frontend/src/app/components/master-page/master-page.component.scss
@@ -234,3 +234,8 @@ nav {
height: 35px;
border-radius: 5px;
}
+
+main {
+ transition: 0.2s;
+ transition-property: max-width;
+}
\ No newline at end of file
From 7fd8790750b151d37566ef6b0f91fd5837c93cf0 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Mon, 28 Aug 2023 09:29:13 +0200
Subject: [PATCH 086/671] [auth] fix blinking profile picture
---
.../app/components/master-page/master-page.component.ts | 3 +--
frontend/src/app/components/menu/menu.component.ts | 5 +++++
.../components/global-footer/global-footer.component.ts | 9 +--------
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/frontend/src/app/components/master-page/master-page.component.ts b/frontend/src/app/components/master-page/master-page.component.ts
index 49bed7a5d..a92f77cf9 100644
--- a/frontend/src/app/components/master-page/master-page.component.ts
+++ b/frontend/src/app/components/master-page/master-page.component.ts
@@ -29,7 +29,6 @@ export class MasterPageComponent implements OnInit {
networkPaths: { [network: string]: string };
networkPaths$: Observable>;
footerVisible = true;
- userAuth: any | undefined;
user: any = undefined;
servicesEnabled = false;
menuOpen = false;
@@ -94,7 +93,7 @@ export class MasterPageComponent implements OnInit {
}
refreshAuth(): void {
- this.apiService.getUserInfo$().subscribe(user => this.user = user);
+ this.user = this.storageService.getAuth()?.user ?? null;
}
hamburgerClick(event): void {
diff --git a/frontend/src/app/components/menu/menu.component.ts b/frontend/src/app/components/menu/menu.component.ts
index e6ba848bc..2fb5c34d1 100644
--- a/frontend/src/app/components/menu/menu.component.ts
+++ b/frontend/src/app/components/menu/menu.component.ts
@@ -30,6 +30,11 @@ export class MenuComponent implements OnInit {
ngOnInit(): void {
this.userAuth = this.storageService.getAuth();
+ if (this.userAuth && this.userAuth.user && !this.userAuth.user.imageMd5) {
+ this.logout();
+ return;
+ }
+
if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) {
this.userMenuGroups$ = this.apiService.getUserMenuGroups$();
}
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.ts b/frontend/src/app/shared/components/global-footer/global-footer.component.ts
index 75d989ff7..e76a5de0d 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.ts
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.ts
@@ -28,7 +28,6 @@ export class GlobalFooterComponent implements OnInit {
networkPaths: { [network: string]: string };
currentNetwork = '';
loggedIn = false;
- username = null;
urlSubscription: Subscription;
isServicesPage = false;
@@ -64,13 +63,7 @@ export class GlobalFooterComponent implements OnInit {
});
this.urlSubscription = this.route.url.subscribe((url) => {
- this.loggedIn = JSON.parse(this.storageService.getValue('auth')) !== null;
- const auth = JSON.parse(this.storageService.getValue('auth'));
- if (auth?.user?.username) {
- this.username = auth.user.username;
- } else {
- this.username = null;
- }
+ this.loggedIn = this.storageService.getAuth() !== null;
this.cd.markForCheck();
})
}
From 4abc4e96a889e7a92d9c0c5f96127b153df58251 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Mon, 28 Aug 2023 09:34:50 +0200
Subject: [PATCH 087/671] [typo] satss -> sats
---
.../accelerate-preview/accelerate-preview.component.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
index c546d3859..c2bcbb7bf 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
@@ -173,7 +173,7 @@
- {{ estimate.cost + estimate.mempoolBaseFee + estimate.vsizeFee | number }} satss
+ {{ estimate.cost + estimate.mempoolBaseFee + estimate.vsizeFee | number }} sats
@@ -190,7 +190,7 @@
Maximum acceleration cost
- {{ maxCost | number }} satss
+ {{ maxCost | number }} sats
@@ -208,7 +208,7 @@
Available balance
- {{ estimate.userBalance | number }} satss
+ {{ estimate.userBalance | number }} sats
From d787ef99c4001ed788b7cd26903512da28f8573c Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Mon, 28 Aug 2023 10:24:44 +0200
Subject: [PATCH 088/671] [typo] the Mempool Accelerator -> Mempool Accelerator
---
.../src/app/components/transaction/transaction.component.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index 141c536ee..8c8de7137 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -7,7 +7,7 @@
-
Accelerate this transaction using the Mempool Accelerator ™
+
Accelerate this transaction using Mempool Accelerator ™
×
From c7b89f31dde20a1a0da6ce591296a8cd36da2ccf Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Mon, 28 Aug 2023 17:42:32 +0900
Subject: [PATCH 089/671] Fix bad blockchain offset after services -> dash
---
frontend/src/app/components/menu/menu.component.ts | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/frontend/src/app/components/menu/menu.component.ts b/frontend/src/app/components/menu/menu.component.ts
index 2fb5c34d1..faeca3d24 100644
--- a/frontend/src/app/components/menu/menu.component.ts
+++ b/frontend/src/app/components/menu/menu.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, Input, Output, EventEmitter, HostListener } from '@angular/core';
+import { Component, OnInit, Input, Output, EventEmitter, HostListener, OnDestroy } from '@angular/core';
import { Observable } from 'rxjs';
import { ApiService } from '../../services/api.service';
import { MenuGroup } from '../../interfaces/services.interface';
@@ -12,7 +12,7 @@ import { StateService } from '../../services/state.service';
styleUrls: ['./menu.component.scss']
})
-export class MenuComponent implements OnInit {
+export class MenuComponent implements OnInit, OnDestroy {
@Input() navOpen: boolean = false;
@Output() loggedOut = new EventEmitter();
@Output() menuToggled = new EventEmitter();
@@ -98,4 +98,8 @@ export class MenuComponent implements OnInit {
this.toggleMenu(false);
}
}
+
+ ngOnDestroy(): void {
+ this.stateService.menuOpen$.next(false);
+ }
}
From 7a765cecd967a0627817663dc06ae02accb4305a Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Mon, 28 Aug 2023 15:41:45 +0200
Subject: [PATCH 090/671] [footer] only show cta if official
---
.../components/global-footer/global-footer.component.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.html b/frontend/src/app/shared/components/global-footer/global-footer.component.html
index b12874832..ea3f70479 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.html
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.html
@@ -21,12 +21,12 @@
-
-
From 3060aecddb74630a600acfac8f3779baf9560a60 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Mon, 28 Aug 2023 15:57:06 +0200
Subject: [PATCH 091/671] [status badge] reposition a bit higher
---
.../src/app/components/master-page/master-page.component.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/app/components/master-page/master-page.component.scss b/frontend/src/app/components/master-page/master-page.component.scss
index f0fec0536..b82d973de 100644
--- a/frontend/src/app/components/master-page/master-page.component.scss
+++ b/frontend/src/app/components/master-page/master-page.component.scss
@@ -109,7 +109,7 @@ nav {
.connection-badge {
position: absolute;
- top: 22px;
+ top: 12px;
width: 100%;
}
From bbd1f088d14dae9c1fc6a8aa53e1549a4f525eb7 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Mon, 28 Aug 2023 16:20:30 +0200
Subject: [PATCH 092/671] [footer] only show cta if official && ACCELERATOR
---
.../components/global-footer/global-footer.component.html | 4 ++--
.../components/global-footer/global-footer.component.ts | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.html b/frontend/src/app/shared/components/global-footer/global-footer.component.html
index ea3f70479..34d47379e 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.html
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.html
@@ -21,12 +21,12 @@
-
-
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.ts b/frontend/src/app/shared/components/global-footer/global-footer.component.ts
index e76a5de0d..2e3f98e2d 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.ts
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.ts
@@ -30,6 +30,7 @@ export class GlobalFooterComponent implements OnInit {
loggedIn = false;
urlSubscription: Subscription;
isServicesPage = false;
+ servicesEnabled = false;
constructor(
public stateService: StateService,
@@ -44,6 +45,7 @@ export class GlobalFooterComponent implements OnInit {
) {}
ngOnInit(): void {
+ this.servicesEnabled = this.officialMempoolSpace && this.stateService.env.ACCELERATOR === true && this.stateService.network === '';
this.isServicesPage = this.router.url.includes('/services/');
this.env = this.stateService.env;
From 7ae4b451e4dc2ac8c2d65d5d67ca06e4e5babd1c Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 29 Aug 2023 09:31:18 +0200
Subject: [PATCH 093/671] [auth] remove auto logout when imageMd5 no in
localstorage
---
frontend/src/app/components/menu/menu.component.ts | 4 ----
1 file changed, 4 deletions(-)
diff --git a/frontend/src/app/components/menu/menu.component.ts b/frontend/src/app/components/menu/menu.component.ts
index faeca3d24..28ba0a1ad 100644
--- a/frontend/src/app/components/menu/menu.component.ts
+++ b/frontend/src/app/components/menu/menu.component.ts
@@ -30,10 +30,6 @@ export class MenuComponent implements OnInit, OnDestroy {
ngOnInit(): void {
this.userAuth = this.storageService.getAuth();
- if (this.userAuth && this.userAuth.user && !this.userAuth.user.imageMd5) {
- this.logout();
- return;
- }
if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) {
this.userMenuGroups$ = this.apiService.getUserMenuGroups$();
From 7c11f0a3dab8adf65b18e6ed24cc8870d0d3606f Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 29 Aug 2023 10:50:13 +0200
Subject: [PATCH 094/671] [tx] fix eta css
---
.../src/app/components/transaction/transaction.component.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index 8c8de7137..ce5d703fb 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -126,7 +126,7 @@
-
+
Accelerate
From c2c4047ffd7ef3fcbdbb6fa645959966aa80566d Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 29 Aug 2023 14:19:02 +0200
Subject: [PATCH 095/671] [css] fix spacing at the top
---
frontend/src/app/components/about/about.component.scss | 1 +
frontend/src/styles.scss | 4 ----
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/frontend/src/app/components/about/about.component.scss b/frontend/src/app/components/about/about.component.scss
index 2a5710ca1..f1b4d6e2b 100644
--- a/frontend/src/app/components/about/about.component.scss
+++ b/frontend/src/app/components/about/about.component.scss
@@ -22,6 +22,7 @@
.intro {
margin: 25px auto 30px;
+ margin-top: 49px;
width: 250px;
display: flex;
flex-direction: column;
diff --git a/frontend/src/styles.scss b/frontend/src/styles.scss
index 078b6b30a..7c0ee160c 100644
--- a/frontend/src/styles.scss
+++ b/frontend/src/styles.scss
@@ -62,10 +62,6 @@ body {
position: relative;
}
-main {
- margin-top: 24px;
-}
-
.full-height {
@media (max-width: 767.98px) {
min-height: 100vh;
From 91fbd0864b458fe622fd9d37eff9590eb5b41ef8 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 29 Aug 2023 14:34:56 +0200
Subject: [PATCH 096/671] [css] fix footer position
---
.../src/app/components/master-page/master-page.component.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/frontend/src/app/components/master-page/master-page.component.html b/frontend/src/app/components/master-page/master-page.component.html
index 74a95daf5..8863b335f 100644
--- a/frontend/src/app/components/master-page/master-page.component.html
+++ b/frontend/src/app/components/master-page/master-page.component.html
@@ -79,13 +79,14 @@
-
From c44276027ce013feaa3e9d37190170b06cb760bf Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 29 Aug 2023 15:51:17 +0200
Subject: [PATCH 097/671] [auto scroll] fix documention anchor scrolling
---
frontend/src/app/docs/api-docs/api-docs.component.scss | 2 +-
frontend/src/app/docs/api-docs/api-docs.component.ts | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/frontend/src/app/docs/api-docs/api-docs.component.scss b/frontend/src/app/docs/api-docs/api-docs.component.scss
index 8e4c0c7a9..b90b843d9 100644
--- a/frontend/src/app/docs/api-docs/api-docs.component.scss
+++ b/frontend/src/app/docs/api-docs/api-docs.component.scss
@@ -155,7 +155,7 @@ ul.no-bull.block-audit code{
#doc-nav-desktop.fixed {
float: unset;
position: fixed;
- top: 20px;
+ top: 80px;
overflow-y: auto;
height: calc(100vh - 50px);
scrollbar-color: #2d3348 #11131f;
diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts
index 62a0fadba..b0ae5967d 100644
--- a/frontend/src/app/docs/api-docs/api-docs.component.ts
+++ b/frontend/src/app/docs/api-docs/api-docs.component.ts
@@ -43,7 +43,7 @@ export class ApiDocsComponent implements OnInit, AfterViewInit {
if (this.faqTemplates) {
this.faqTemplates.forEach((x) => this.dict[x.type] = x.template);
}
- this.desktopDocsNavPosition = ( window.pageYOffset > 182 ) ? "fixed" : "relative";
+ this.desktopDocsNavPosition = ( window.pageYOffset > 115 ) ? "fixed" : "relative";
this.mobileViewport = window.innerWidth <= 992;
}
@@ -113,7 +113,7 @@ export class ApiDocsComponent implements OnInit, AfterViewInit {
}
onDocScroll() {
- this.desktopDocsNavPosition = ( window.pageYOffset > 182 ) ? "fixed" : "relative";
+ this.desktopDocsNavPosition = ( window.pageYOffset > 115 ) ? "fixed" : "relative";
}
anchorLinkClick( event: any ) {
From c753a8e92af5ec56599fa50c592c9430e1c3f8cc Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Tue, 29 Aug 2023 21:20:36 +0900
Subject: [PATCH 098/671] Accelerator fee diagram concept
---
.../accelerate-fee-graph.component.html | 21 +
.../accelerate-fee-graph.component.scss | 147 +++++++
.../accelerate-fee-graph.component.ts | 96 ++++
.../accelerate-preview.component.html | 413 +++++++++---------
.../accelerate-preview.component.scss | 7 +
.../accelerate-preview.component.ts | 31 +-
.../transaction/transaction.component.html | 2 +-
frontend/src/app/shared/shared.module.ts | 3 +
8 files changed, 511 insertions(+), 209 deletions(-)
create mode 100644 frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.html
create mode 100644 frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
create mode 100644 frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.html b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.html
new file mode 100644
index 000000000..727f833bc
--- /dev/null
+++ b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+ {{ bar.label }}
+
+
+
+
+
+
{{ bar.class === 'tx' ? '' : '+' }} {{ bar.fee | number }} sat
+
+
+
+
+
+
+
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
new file mode 100644
index 000000000..84d530e34
--- /dev/null
+++ b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
@@ -0,0 +1,147 @@
+.fee-graph {
+ height: 100%;
+ width: 20%;
+ min-width: 100px;
+ max-width: 150px;
+ max-height: 100vh;
+ margin-left: 4em;
+ margin-right: 1.5em;
+ padding-bottom: 63px;
+
+ .column {
+ width: 100%;
+ height: 100%;
+ position: relative;
+ background: #181b2d;
+
+ .bar {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .fill {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ opacity: 0.75;
+ pointer-events: none;
+ }
+
+ .fee {
+ position: absolute;
+ opacity: 0;
+ pointer-events: none;
+ }
+
+ .line {
+ position: absolute;
+ right: 0;
+ top: 0;
+ left: -4.5em;
+ border-top: dashed white 1.5px;
+
+ .fee-rate {
+ width: 100%;
+ position: absolute;
+ left: 0;
+ right: 0.2em;
+ font-size: 0.8em;
+ display: flex;
+ flex-direction: row-reverse;
+ justify-content: space-between;
+ margin: 0;
+
+ .label {
+ margin-right: .2em;
+ }
+
+ .rate .symbol {
+ color: white;
+ }
+ }
+ }
+
+ &.tx {
+ .fill {
+ background: #105fb0;
+ }
+ .line {
+ .fee-rate {
+ top: 0;
+ }
+ }
+ .fee {
+ opacity: 1;
+ z-index: 11;
+ }
+ }
+
+ &.target {
+ .fill {
+ background: #3bcc49;
+ }
+ .fee {
+ opacity: 1;
+ z-index: 11;
+ }
+ .line .fee-rate {
+ bottom: 2px;
+ }
+ }
+
+ &.max {
+ cursor: pointer;
+ .line .fee-rate {
+ .label {
+ opacity: 0;
+ }
+ bottom: 2px;
+ }
+ &.active, &:hover {
+ .fill {
+ background: #653b9c;
+ }
+ .line {
+ .fee-rate .label {
+ opacity: 1;
+ }
+ }
+ }
+ }
+
+ &:hover {
+ .fill {
+ z-index: 10;
+ }
+ .line {
+ z-index: 11;
+ }
+ .fee {
+ opacity: 1;
+ z-index: 12;
+ }
+ }
+ }
+
+ &:hover > .bar:not(:hover) {
+ &.target, &.max {
+ .fee {
+ opacity: 0;
+ }
+ .line .fee-rate .label {
+ opacity: 0;
+ }
+ }
+ }
+ }
+
+ .vsize {
+ text-align: center;
+ }
+}
\ No newline at end of file
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts
new file mode 100644
index 000000000..98b47bea0
--- /dev/null
+++ b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts
@@ -0,0 +1,96 @@
+import { Component, OnInit, Input, Output, OnChanges, EventEmitter, HostListener, Inject, LOCALE_ID } from '@angular/core';
+import { StateService } from '../../services/state.service';
+import { Outspend, Transaction, Vin, Vout } from '../../interfaces/electrs.interface';
+import { Router } from '@angular/router';
+import { ReplaySubject, merge, Subscription, of } from 'rxjs';
+import { tap, switchMap } from 'rxjs/operators';
+import { ApiService } from '../../services/api.service';
+import { AccelerationEstimate, RateOption } from './accelerate-preview.component';
+
+interface GraphBar {
+ rate: number;
+ style: any;
+ class: 'tx' | 'target' | 'max';
+ label: string;
+ active?: boolean;
+ rateIndex?: number;
+ fee?: number;
+}
+
+@Component({
+ selector: 'app-accelerate-fee-graph',
+ templateUrl: './accelerate-fee-graph.component.html',
+ styleUrls: ['./accelerate-fee-graph.component.scss'],
+})
+export class AccelerateFeeGraphComponent implements OnInit, OnChanges {
+ @Input() tx: Transaction;
+ @Input() estimate: AccelerationEstimate;
+ @Input() maxRateOptions: RateOption[] = [];
+ @Input() maxRateIndex: number = 0;
+ @Output() setUserBid = new EventEmitter<{ fee: number, index: number }>();
+
+ bars: GraphBar[] = [];
+ tooltipPosition = { x: 0, y: 0 };
+
+ ngOnInit(): void {
+ this.initGraph();
+ }
+
+ ngOnChanges(): void {
+ this.initGraph();
+ }
+
+ initGraph(): void {
+ if (!this.tx || !this.estimate) {
+ return;
+ }
+ const maxRate = Math.max(...this.maxRateOptions.map(option => option.rate));
+ const baseRate = this.estimate.txSummary.effectiveFee / this.estimate.txSummary.effectiveVsize;
+ const baseHeight = baseRate / maxRate;
+ const bars: GraphBar[] = this.maxRateOptions.slice().reverse().map(option => {
+ return {
+ rate: option.rate,
+ style: this.getStyle(option.rate, maxRate, baseHeight),
+ class: 'max',
+ label: 'max',
+ active: option.index === this.maxRateIndex,
+ rateIndex: option.index,
+ fee: option.fee,
+ }
+ });
+ bars.push({
+ rate: this.estimate.targetFeeRate,
+ style: this.getStyle(this.estimate.targetFeeRate, maxRate, baseHeight),
+ class: 'target',
+ label: 'expected',
+ fee: this.estimate.nextBlockFee - this.estimate.txSummary.effectiveFee
+ });
+ bars.push({
+ rate: baseRate,
+ style: this.getStyle(baseRate, maxRate, 0),
+ class: 'tx',
+ label: 'paid',
+ fee: this.estimate.txSummary.effectiveFee,
+ });
+ this.bars = bars;
+ }
+
+ getStyle(rate, maxRate, base) {
+ const top = (rate / maxRate);
+ return {
+ height: `${(top - base) * 100}%`,
+ bottom: base ? `${base * 100}%` : '0',
+ }
+ }
+
+ onClick(event, bar): void {
+ if (bar.rateIndex != null) {
+ this.setUserBid.emit({ fee: bar.fee, index: bar.rateIndex });
+ }
+ }
+
+ @HostListener('pointermove', ['$event'])
+ onPointerMove(event) {
+ this.tooltipPosition = { x: event.offsetX, y: event.offsetY };
+ }
+}
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
index c2bcbb7bf..ad96eb671 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
@@ -20,212 +20,223 @@
-
-
-
-
-
-
-
-
-
- Next block market price
-
-
- {{ estimate.targetFeeRate | number : '1.0-0' }} sat/vB
-
-
-
-
- Currently estimated fee to get into next block
-
-
-
- {{ estimate.nextBlockFee| number }} sats
-
-
-
-
-
-
-
-
- Fees paid in-band
-
-
- ~ {{ (estimate.txSummary.effectiveFee / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB
-
-
-
-
- What you already paid when you made the transaction
-
-
-
- {{ estimate.txSummary.effectiveFee | number }} sats
-
-
-
-
-
-
-
-
- Extra fee required
-
-
- {{ math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee) | number }} sats
-
-
-
-
-
- Difference between the next block fee and your tx fee
-
-
-
-
-
-
+
+
-
How much more are you willing to pay at most to get into the next block?
-
-
-
- The maximum extra transaction fee you're willing to pay to get into the next block. If the next block market price becomes too expensive for you, we will automatically cancel your acceleration request. Final charged fee may be smaller based on the fee market.
-
-
-
-
-
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
index 84d530e34..6137b53ee 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
+++ b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
@@ -1,9 +1,8 @@
.fee-graph {
height: 100%;
- width: 20%;
- min-width: 100px;
- max-width: 150px;
- max-height: 100vh;
+ min-width: 120px;
+ width: 120px;
+ max-height: 90vh;
margin-left: 4em;
margin-right: 1.5em;
padding-bottom: 63px;
@@ -20,6 +19,7 @@
left: 0;
right: 0;
display: flex;
+ flex-direction: column;
justify-content: center;
align-items: center;
@@ -34,11 +34,18 @@
}
.fee {
- position: absolute;
+ font-size: 0.9em;
opacity: 0;
pointer-events: none;
}
+ .spacer {
+ width: 100%;
+ height: 1px;
+ flex-grow: 1;
+ pointer-events: none;
+ }
+
.line {
position: absolute;
right: 0;
@@ -69,7 +76,7 @@
&.tx {
.fill {
- background: #105fb0;
+ background: #3bcc49;
}
.line {
.fee-rate {
@@ -77,6 +84,7 @@
}
}
.fee {
+ position: absolute;
opacity: 1;
z-index: 11;
}
@@ -84,9 +92,10 @@
&.target {
.fill {
- background: #3bcc49;
+ background: #653b9c;
}
.fee {
+ position: absolute;
opacity: 1;
z-index: 11;
}
@@ -105,7 +114,7 @@
}
&.active, &:hover {
.fill {
- background: #653b9c;
+ background: #105fb0;
}
.line {
.fee-rate .label {
@@ -138,10 +147,11 @@
opacity: 0;
}
}
+ &.max {
+ .fill {
+ background: none;
+ }
+ }
}
}
-
- .vsize {
- text-align: center;
- }
}
\ No newline at end of file
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts
index 98b47bea0..4d746a0d9 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts
+++ b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.ts
@@ -52,7 +52,7 @@ export class AccelerateFeeGraphComponent implements OnInit, OnChanges {
rate: option.rate,
style: this.getStyle(option.rate, maxRate, baseHeight),
class: 'max',
- label: 'max',
+ label: 'maximum',
active: option.index === this.maxRateIndex,
rateIndex: option.index,
fee: option.fee,
@@ -62,14 +62,14 @@ export class AccelerateFeeGraphComponent implements OnInit, OnChanges {
rate: this.estimate.targetFeeRate,
style: this.getStyle(this.estimate.targetFeeRate, maxRate, baseHeight),
class: 'target',
- label: 'expected',
+ label: 'next block',
fee: this.estimate.nextBlockFee - this.estimate.txSummary.effectiveFee
});
bars.push({
rate: baseRate,
style: this.getStyle(baseRate, maxRate, 0),
class: 'tx',
- label: 'paid',
+ label: '',
fee: this.estimate.txSummary.effectiveFee,
});
this.bars = bars;
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
index ad96eb671..8fc77dae4 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
@@ -12,14 +12,6 @@
- 1">
-
-
- This transactions is part of a CPFP tree. Fee rates (in sats/vb) are provided for your information. Change in the CPFP tree will lead to different fee rates values.
-
-
-
-
-
+
Your transaction
+
+
+ Plus {{ estimate.txSummary.ancestorCount - 1 }} unconfirmed ancestor{{ estimate.txSummary.ancestorCount > 2 ? 's' : ''}}.
+
-
-
-
- Next block market price
+
+
+ Virtual size
-
- {{ estimate.targetFeeRate | number : '1.0-0' }} sat/vB
+
+
+
+
+ Size in vbytes of this transaction and its unconfirmed ancestors
-
- Currently estimated fee to get into next block
+
+ In-band fees
-
-
- {{ estimate.nextBlockFee| number }} sats
-
-
+
+ {{ estimate.txSummary.effectiveFee | number : '1.0-0' }} sats
-
-
-
-
- Fees paid in-band
-
-
- ~ {{ (estimate.txSummary.effectiveFee / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB
-
-
-
-
- What you already paid when you made the transaction
-
-
-
- {{ estimate.txSummary.effectiveFee | number }} sats
-
-
-
-
-
-
-
-
- Extra fee required
-
-
- {{ math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee) | number }} sats
-
-
-
-
-
- Difference between the next block fee and your tx fee
+
+
+ Fees already paid by this transaction and its unconfirmed ancestors
-
-
How much more are you willing to pay at most to get into the next block?
+
+
How much more are you willing to pay?
- The maximum extra transaction fee you're willing to pay to get into the next block. If the next block market price becomes too expensive for you, we will automatically cancel your acceleration request. Final charged fee may be smaller based on the fee market.
+ Choose the maximum extra transaction fee you're willing to pay to get into the next block.
+ If the estimated next block rate rises beyond this limit, we will automatically cancel your acceleration request.
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
index 1c356a80b..6bcc5e958 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges, HostListener } from '@angular/core';
+import { Router } from '@angular/router';
import { ApiService } from '../../services/api.service';
import { Subscription, catchError, of, tap } from 'rxjs';
import { StorageService } from '../../services/storage.service';
@@ -62,7 +63,8 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
constructor(
private apiService: ApiService,
- private storageService: StorageService
+ private storageService: StorageService,
+ private router: Router,
) { }
ngOnDestroy(): void {
@@ -73,7 +75,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
ngOnChanges(changes: SimpleChanges): void {
if (changes.scrollEvent) {
- this.scrollToPreview('acceleratePreviewAnchor', 'center');
+ this.scrollToPreview('acceleratePreviewAnchor', 'start');
}
}
@@ -126,7 +128,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
this.maxCost = this.userBid + this.estimate.mempoolBaseFee + this.estimate.vsizeFee;
if (!this.error) {
- this.scrollToPreview('acceleratePreviewAnchor', 'center');
+ this.scrollToPreview('acceleratePreviewAnchor', 'start');
}
}
}),
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index 006870864..9b810d598 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -80,7 +80,7 @@
-
+
Accelerate
@@ -135,7 +135,7 @@
-
+
Features
diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts
index 505c4686d..1f6aec5e2 100644
--- a/frontend/src/app/components/transaction/transaction.component.ts
+++ b/frontend/src/app/components/transaction/transaction.component.ts
@@ -619,10 +619,14 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
// simulate normal anchor fragment behavior
applyFragment(): void {
const anchor = Array.from(this.fragmentParams.entries()).find(([frag, value]) => value === '');
- if (anchor) {
- const anchorElement = document.getElementById(anchor[0]);
- if (anchorElement) {
- anchorElement.scrollIntoView();
+ if (anchor?.length) {
+ if (anchor[0] === 'accelerate') {
+ setTimeout(this.onAccelerateClicked.bind(this), 100);
+ } else {
+ const anchorElement = document.getElementById(anchor[0]);
+ if (anchorElement) {
+ anchorElement.scrollIntoView();
+ }
}
}
}
From 0e1a9d861938c5d8be5061945d56fee653140b46 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sun, 3 Sep 2023 16:05:12 +0300
Subject: [PATCH 115/671] [accelerator] blinking cta, polish accel preview
---
.../accelerate-fee-graph.component.scss | 1 -
.../accelerate-preview.component.html | 10 +++----
.../accelerate-preview.component.scss | 23 ++++++++++++++-
.../transaction/transaction.component.html | 7 +++--
.../transaction/transaction.component.scss | 29 +++++++++++++++++--
5 files changed, 59 insertions(+), 11 deletions(-)
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
index 6137b53ee..69534cbad 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
+++ b/frontend/src/app/components/accelerate-preview/accelerate-fee-graph.component.scss
@@ -2,7 +2,6 @@
height: 100%;
min-width: 120px;
width: 120px;
- max-height: 90vh;
margin-left: 4em;
margin-right: 1.5em;
padding-bottom: 63px;
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
index 9bb66eda1..18bc8672b 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html
@@ -75,7 +75,7 @@
{{ option.fee | number }} sats
- ~
+ ~
@@ -88,12 +88,12 @@
-
+
Estimated cost
-
-
+
+
Maximum cost
-
+
diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
index 433c05520..814b37e7a 100644
--- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
+++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.scss
@@ -28,7 +28,10 @@
.feerate.active {
background-color: #105fb0 !important;
opacity: 1;
- border: 1px solid white !important;
+ border: 1px solid #007fff !important;
+}
+.feerate:focus {
+ box-shadow: none !important;
}
.estimateDisabled {
@@ -41,6 +44,24 @@
margin-top: 0.5em;
}
+.tab {
+ &:first-child {
+ margin-right: 1px;
+ }
+ border: solid 1px black;
+ border-bottom: none;
+ background-color: #323655;
+ border-top-left-radius: 10px !important;
+ border-top-right-radius: 10px !important;
+}
+.tab.active {
+ background-color: #5d659d !important;
+ opacity: 1;
+}
+.tab:focus {
+ box-shadow: none !important;
+}
+
.table-accelerator {
tr {
text-wrap: wrap;
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index 006870864..81bbec1aa 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -6,8 +6,11 @@
-
-
Accelerate this transaction using Mempool Accelerator ™
+
+
+
Accelerate
+
this transaction using Mempool Accelerator ™
+
×
diff --git a/frontend/src/app/components/transaction/transaction.component.scss b/frontend/src/app/components/transaction/transaction.component.scss
index 2e076600e..38c4d7755 100644
--- a/frontend/src/app/components/transaction/transaction.component.scss
+++ b/frontend/src/app/components/transaction/transaction.component.scss
@@ -218,8 +218,33 @@
}
}
-.link.accelerator {
- cursor: pointer;
+.alert-purple {
+ background-color: #5c3a88;
+ width: 100%;
+}
+
+// Blinking block
+@keyframes shadowyBackground {
+ 0% {
+ box-shadow: 0px 0px 20px rgba(#eba814, 1);
+ }
+ 50% {
+ box-shadow: 0px 0px 20px rgba(#eba814, .3);
+ }
+ 100% {
+ box-shadow: 0px 0px 20px rgba(#ffae00, 1);
+ }
+}
+
+.blink-bg {
+ color: #fff;
+ background: repeating-linear-gradient(#daad0a 0%, #daad0a 5%, #987805 100%) !important;
+ animation: shadowyBackground 1s infinite;
+ box-shadow: 0px 0px 20px rgba(#eba814, 1);
+ transition: 100ms all ease-in;
+ margin-right: 8px;
+ font-size: 16px;
+ border: 1px solid gold;
}
.eta {
From d630e7217a7a9823ae2d5a94e0c959c879dc85c1 Mon Sep 17 00:00:00 2001
From: hunicus <93150691+hunicus@users.noreply.github.com>
Date: Wed, 6 Sep 2023 01:42:19 +0900
Subject: [PATCH 116/671] Make enterprise links not relative
---
frontend/src/app/docs/api-docs/api-docs-data.ts | 2 +-
frontend/src/app/docs/api-docs/api-docs.component.html | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/frontend/src/app/docs/api-docs/api-docs-data.ts b/frontend/src/app/docs/api-docs/api-docs-data.ts
index 3a857fe6a..ce0b7eaef 100644
--- a/frontend/src/app/docs/api-docs/api-docs-data.ts
+++ b/frontend/src/app/docs/api-docs/api-docs-data.ts
@@ -2922,7 +2922,7 @@ export const restApiDocsData = [
fragment: "get-blocks-bulk",
title: "GET Blocks (Bulk)",
description: {
- default: "
Returns details on the range of blocks between :minHeight and :maxHeight, inclusive, up to 10 blocks. If :maxHeight is not specified, it defaults to the current tip.
To return data for more than 10 blocks, consider becoming an enterprise sponsor .
"
+ default: "
Returns details on the range of blocks between :minHeight and :maxHeight, inclusive, up to 10 blocks. If :maxHeight is not specified, it defaults to the current tip.
To return data for more than 10 blocks, consider becoming an enterprise sponsor .
"
},
urlString: "/v1/blocks-bulk/:minHeight[/:maxHeight]",
showConditions: bitcoinNetworks,
diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html
index 40a7ae486..1e95b27ed 100644
--- a/frontend/src/app/docs/api-docs/api-docs.component.html
+++ b/frontend/src/app/docs/api-docs/api-docs.component.html
@@ -40,7 +40,7 @@
Below is a reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} REST API service .
-
Note that we enforce rate limits. If you exceed these limits, you will get an HTTP 429 error. If you repeatedly exceed the limits, you may be banned from accessing the service altogether. Consider an enterprise sponsorship if you need higher API limits.
+
Note that we enforce rate limits. If you exceed these limits, you will get an HTTP 429 error. If you repeatedly exceed the limits, you may be banned from accessing the service altogether. Consider an enterprise sponsorship if you need higher API limits.
-1 )">{{ item.title }}
@@ -123,7 +123,7 @@
{{electrsPort}}
SSL
Enabled
-
Electrum RPC interface for Bitcoin Signet is publicly available . Electrum RPC interface for all other networks is available to sponsors only—whitelisting is required.
+
Electrum RPC interface for Bitcoin Signet is publicly available . Electrum RPC interface for all other networks is available to sponsors only—whitelisting is required.
@@ -280,7 +280,7 @@
- You can manually install Mempool on your own server, but this requires advanced sysadmin skills since you will be manually configuring everything. You could also use our Docker images .
In any case, we only provide support for manual deployments to enterprise sponsors .
+ You can manually install Mempool on your own server, but this requires advanced sysadmin skills since you will be manually configuring everything. You could also use our Docker images .
In any case, we only provide support for manual deployments to enterprise sponsors .
For casual users, we strongly suggest installing Mempool using one of the 1-click install methods .
From 71d4aa9ddd2a91274ebe31d30329df0b5cc6aee8 Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Wed, 6 Sep 2023 08:19:41 +0900
Subject: [PATCH 117/671] Add mempool count line to graph
---
backend/src/api/statistics/statistics-api.ts | 2 +
.../mempool-graph/mempool-graph.component.ts | 98 ++++++++++++++++---
.../statistics/statistics.component.html | 10 +-
.../statistics/statistics.component.ts | 2 +
.../src/app/interfaces/node-api.interface.ts | 1 +
5 files changed, 100 insertions(+), 13 deletions(-)
diff --git a/backend/src/api/statistics/statistics-api.ts b/backend/src/api/statistics/statistics-api.ts
index 9df12d704..ecc0222c1 100644
--- a/backend/src/api/statistics/statistics-api.ts
+++ b/backend/src/api/statistics/statistics-api.ts
@@ -171,6 +171,7 @@ class StatisticsApi {
private getQueryForDaysAvg(div: number, interval: string) {
return `SELECT
UNIX_TIMESTAMP(added) as added,
+ CAST(avg(unconfirmed_transactions) as DOUBLE) as unconfirmed_transactions,
CAST(avg(vbytes_per_second) as DOUBLE) as vbytes_per_second,
CAST(avg(vsize_1) as DOUBLE) as vsize_1,
CAST(avg(vsize_2) as DOUBLE) as vsize_2,
@@ -401,6 +402,7 @@ class StatisticsApi {
return statistic.map((s) => {
return {
added: s.added,
+ count: s.unconfirmed_transactions,
vbytes_per_second: s.vbytes_per_second,
mempool_byte_weight: s.mempool_byte_weight,
total_fee: s.total_fee,
diff --git a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
index 6c9795c89..d31044be9 100644
--- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
+++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit, Input, Inject, LOCALE_ID, ChangeDetectionStrategy, OnChanges } from '@angular/core';
import { VbytesPipe } from '../../shared/pipes/bytes-pipe/vbytes.pipe';
import { WuBytesPipe } from '../../shared/pipes/bytes-pipe/wubytes.pipe';
+import { AmountShortenerPipe } from '../../shared/pipes/amount-shortener.pipe';
import { formatNumber } from '@angular/common';
import { OptimizedMempoolStats } from '../../interfaces/node-api.interface';
import { StateService } from '../../services/state.service';
@@ -26,6 +27,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
@Input() data: any[];
@Input() filterSize = 100000;
@Input() limitFilterFee = 1;
+ @Input() hideCount: boolean = false;
@Input() height: number | string = 200;
@Input() top: number | string = 20;
@Input() right: number | string = 10;
@@ -50,10 +52,13 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
inverted: boolean;
chartInstance: any = undefined;
weightMode: boolean = false;
+ isWidget: boolean = false;
+ showCount: boolean = true;
constructor(
private vbytesPipe: VbytesPipe,
private wubytesPipe: WuBytesPipe,
+ private amountShortenerPipe: AmountShortenerPipe,
private stateService: StateService,
private storageService: StorageService,
@Inject(LOCALE_ID) private locale: string,
@@ -62,12 +67,16 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
ngOnInit(): void {
this.isLoading = true;
this.inverted = this.storageService.getValue('inverted-graph') === 'true';
+ this.isWidget = this.template === 'widget';
+ this.showCount = !this.isWidget && !this.hideCount;
}
- ngOnChanges() {
+ ngOnChanges(changes) {
if (!this.data) {
return;
}
+ this.isWidget = this.template === 'widget';
+ this.showCount = !this.isWidget && !this.hideCount;
this.windowPreference = this.windowPreferenceOverride ? this.windowPreferenceOverride : this.storageService.getValue('graphWindowPreference');
this.mempoolVsizeFeesData = this.handleNewMempoolData(this.data.concat([]));
this.mountFeeChart();
@@ -96,10 +105,12 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
mempoolStats.reverse();
const labels = mempoolStats.map(stats => stats.added);
const finalArrayVByte = this.generateArray(mempoolStats);
+ const finalArrayCount = this.generateCountArray(mempoolStats);
return {
labels: labels,
- series: finalArrayVByte
+ series: finalArrayVByte,
+ countSeries: finalArrayCount,
};
}
@@ -124,9 +135,13 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
return finalArray;
}
+ generateCountArray(mempoolStats: OptimizedMempoolStats[]) {
+ return mempoolStats.map(stats => [stats.added * 1000, stats.count]);
+ }
+
mountFeeChart() {
this.orderLevels();
- const { series } = this.mempoolVsizeFeesData;
+ const { series, countSeries } = this.mempoolVsizeFeesData;
const seriesGraph = [];
const newColors = [];
@@ -178,6 +193,29 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
});
}
}
+ if (this.showCount) {
+ newColors.push('white');
+ seriesGraph.push({
+ zlevel: 1,
+ yAxisIndex: 1,
+ name: 'count',
+ type: 'line',
+ stack: 'count',
+ smooth: false,
+ markPoint: false,
+ lineStyle: {
+ width: 2,
+ opacity: 1,
+ },
+ symbol: 'none',
+ silent: true,
+ areaStyle: {
+ color: null,
+ opacity: 0,
+ },
+ data: countSeries,
+ });
+ }
this.mempoolVsizeFeesOptions = {
series: this.inverted ? [...seriesGraph].reverse() : seriesGraph,
@@ -201,7 +239,11 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
label: {
formatter: (params: any) => {
if (params.axisDimension === 'y') {
- return this.vbytesPipe.transform(params.value, 2, 'vB', 'MvB', true)
+ if (params.axisIndex === 0) {
+ return this.vbytesPipe.transform(params.value, 2, 'vB', 'MvB', true);
+ } else {
+ return this.amountShortenerPipe.transform(params.value, 2, undefined, true);
+ }
} else {
return formatterXAxis(this.locale, this.windowPreference, params.value);
}
@@ -214,7 +256,11 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
const itemFormatted = [];
let totalParcial = 0;
let progressPercentageText = '';
- const items = this.inverted ? [...params].reverse() : params;
+ let countItem;
+ let items = this.inverted ? [...params].reverse() : params;
+ if (items[items.length - 1].seriesName === 'count') {
+ countItem = items.pop();
+ }
items.map((item: any, index: number) => {
totalParcial += item.value[1];
const progressPercentage = (item.value[1] / totalValue) * 100;
@@ -276,6 +322,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
`);
});
const classActive = (this.template === 'advanced') ? 'fees-wrapper-tooltip-chart-advanced' : '';
+ const titleCount = $localize`Count`;
const titleRange = $localize`Range`;
const titleSize = $localize`:@@7faaaa08f56427999f3be41df1093ce4089bbd75:Size`;
const titleSum = $localize`Sum`;
@@ -286,6 +333,25 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
${this.vbytesPipe.transform(totalValue, 2, 'vB', 'MvB', false)}
+ ` +
+ (this.showCount && countItem ? `
+
+
+
+
+
+
+ ${titleCount}
+
+
+
+ ${this.amountShortenerPipe.transform(countItem.value[1], 2, undefined, true)}
+
+
+
+
+ ` : '')
+ + `
@@ -305,12 +371,12 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
`;
}
},
- dataZoom: (this.template === 'widget' && this.isMobile()) ? null : [{
+ dataZoom: (this.isWidget && this.isMobile()) ? null : [{
type: 'inside',
realtime: true,
- zoomLock: (this.template === 'widget') ? true : false,
+ zoomLock: (this.isWidget) ? true : false,
zoomOnMouseWheel: (this.template === 'advanced') ? true : false,
- moveOnMouseMove: (this.template === 'widget') ? true : false,
+ moveOnMouseMove: (this.isWidget) ? true : false,
maxSpan: 100,
minSpan: 10,
}, {
@@ -339,7 +405,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
},
xAxis: [
{
- name: this.template === 'widget' ? '' : formatterXAxisLabel(this.locale, this.windowPreference),
+ name: this.isWidget ? '' : formatterXAxisLabel(this.locale, this.windowPreference),
nameLocation: 'middle',
nameTextStyle: {
padding: [20, 0, 0, 0],
@@ -357,7 +423,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
},
}
],
- yAxis: {
+ yAxis: [{
type: 'value',
axisLine: { onZero: false },
axisLabel: {
@@ -371,7 +437,17 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
opacity: 0.25,
}
}
- },
+ }, this.showCount ? {
+ type: 'value',
+ position: 'right',
+ axisLine: { onZero: false },
+ axisLabel: {
+ formatter: (value: number) => (`${this.amountShortenerPipe.transform(value, 2, undefined, true)}`),
+ },
+ splitLine: {
+ show: false,
+ }
+ } : null],
};
}
diff --git a/frontend/src/app/components/statistics/statistics.component.html b/frontend/src/app/components/statistics/statistics.component.html
index 29089e43d..02a26ed52 100644
--- a/frontend/src/app/components/statistics/statistics.component.html
+++ b/frontend/src/app/components/statistics/statistics.component.html
@@ -69,6 +69,12 @@
+
+
+ {{ titleCount }}
+
+
diff --git a/frontend/src/app/components/statistics/statistics.component.ts b/frontend/src/app/components/statistics/statistics.component.ts
index 69bf9ea8f..ba9068975 100644
--- a/frontend/src/app/components/statistics/statistics.component.ts
+++ b/frontend/src/app/components/statistics/statistics.component.ts
@@ -32,6 +32,7 @@ export class StatisticsComponent implements OnInit {
chartColors = chartColors;
filterSize = 100000;
filterFeeIndex = 1;
+ showCount = true;
maxFeeIndex: number;
dropDownOpen = false;
@@ -46,6 +47,7 @@ export class StatisticsComponent implements OnInit {
inverted: boolean;
feeLevelDropdownData = [];
timespan = '';
+ titleCount = $localize`Count`;
constructor(
@Inject(LOCALE_ID) private locale: string,
diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts
index a9f069b56..08de11a6a 100644
--- a/frontend/src/app/interfaces/node-api.interface.ts
+++ b/frontend/src/app/interfaces/node-api.interface.ts
@@ -2,6 +2,7 @@ import { Block, Transaction } from "./electrs.interface";
export interface OptimizedMempoolStats {
added: number;
+ count: number;
vbytes_per_second: number;
total_fee: number;
mempool_byte_weight: number;
From 9ed7e80c44359d33ebe41f6605ef12ba31ff391b Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 12 Sep 2023 14:15:29 +0200
Subject: [PATCH 118/671] fix typo post merge
---
.../src/app/components/transaction/transaction.component.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index ee9247aab..956d27aba 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -128,7 +128,7 @@
- Accelerate
+ Accelerate
From 0712195de4c6a01e83930baa5939c1af93ee444a Mon Sep 17 00:00:00 2001
From: orangesurf
Date: Tue, 12 Sep 2023 19:29:33 +0100
Subject: [PATCH 119/671] Add orangesurf contributor declaration
---
contributors/orangesurf.txt | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 contributors/orangesurf.txt
diff --git a/contributors/orangesurf.txt b/contributors/orangesurf.txt
new file mode 100644
index 000000000..c760a9125
--- /dev/null
+++ b/contributors/orangesurf.txt
@@ -0,0 +1,3 @@
+I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of September 12, 2023.
+
+Signed: orange surf
From a1b75c377296d52f55a23258b7299095cfe555fb Mon Sep 17 00:00:00 2001
From: orangesurf
Date: Tue, 12 Sep 2023 19:45:18 +0100
Subject: [PATCH 120/671] Update to reflect registered trademark
---
frontend/src/app/components/about/about.component.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html
index 6bff838aa..ad05b7d71 100644
--- a/frontend/src/app/components/about/about.component.html
+++ b/frontend/src/app/components/about/about.component.html
@@ -10,7 +10,7 @@
-
The Mempool Open Source Project ™
+
The Mempool Open Source Project ®
Our mempool and blockchain explorer for the Bitcoin community, focusing on the transaction fee market and multi-layer ecosystem, completely self-hosted without any trusted third-parties.
From 0ba4e98f52cc539cea112317b54f60c6388304f4 Mon Sep 17 00:00:00 2001
From: orangesurf
Date: Tue, 12 Sep 2023 19:55:00 +0100
Subject: [PATCH 121/671] Replace other instances of tm use for The Mempool
Open Source Project
---
frontend/src/app/components/about/about.component.ts | 2 +-
.../components/privacy-policy/privacy-policy.component.ts | 2 +-
.../trademark-policy/trademark-policy.component.ts | 2 +-
frontend/src/index.mempool.html | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/frontend/src/app/components/about/about.component.ts b/frontend/src/app/components/about/about.component.ts
index 3cda0dc20..8aa0422e8 100644
--- a/frontend/src/app/components/about/about.component.ts
+++ b/frontend/src/app/components/about/about.component.ts
@@ -43,7 +43,7 @@ export class AboutComponent implements OnInit {
ngOnInit() {
this.backendInfo$ = this.stateService.backendInfo$;
this.seoService.setTitle($localize`:@@004b222ff9ef9dd4771b777950ca1d0e4cd4348a:About`);
- this.seoService.setDescription($localize`:@@meta.description.about:Learn more about The Mempool Open Source Project™\: enterprise sponsors, individual sponsors, integrations, who contributes, FOSS licensing, and more.`);
+ this.seoService.setDescription($localize`:@@meta.description.about:Learn more about The Mempool Open Source Project®\: enterprise sponsors, individual sponsors, integrations, who contributes, FOSS licensing, and more.`);
this.websocketService.want(['blocks']);
this.profiles$ = this.apiService.getAboutPageProfiles$().pipe(
diff --git a/frontend/src/app/components/privacy-policy/privacy-policy.component.ts b/frontend/src/app/components/privacy-policy/privacy-policy.component.ts
index 7a44070eb..b98390731 100644
--- a/frontend/src/app/components/privacy-policy/privacy-policy.component.ts
+++ b/frontend/src/app/components/privacy-policy/privacy-policy.component.ts
@@ -17,6 +17,6 @@ export class PrivacyPolicyComponent {
ngOnInit(): void {
this.seoService.setTitle('Privacy Policy');
- this.seoService.setDescription('Trusted third parties are security holes, as are trusted first parties...you should only trust your own self-hosted instance of The Mempool Open Source Project™.');
+ this.seoService.setDescription('Trusted third parties are security holes, as are trusted first parties...you should only trust your own self-hosted instance of The Mempool Open Source Project®.');
}
}
diff --git a/frontend/src/app/components/trademark-policy/trademark-policy.component.ts b/frontend/src/app/components/trademark-policy/trademark-policy.component.ts
index 08f16264a..b8f53afcf 100644
--- a/frontend/src/app/components/trademark-policy/trademark-policy.component.ts
+++ b/frontend/src/app/components/trademark-policy/trademark-policy.component.ts
@@ -17,6 +17,6 @@ export class TrademarkPolicyComponent {
ngOnInit(): void {
this.seoService.setTitle('Trademark Policy');
- this.seoService.setDescription('An overview of the trademarks registered by Mempool Space K.K. and The Mempool Open Source Project™ and what we consider to be lawful usage of those trademarks.');
+ this.seoService.setDescription('An overview of the trademarks registered by Mempool Space K.K. and The Mempool Open Source Project® and what we consider to be lawful usage of those trademarks.');
}
}
diff --git a/frontend/src/index.mempool.html b/frontend/src/index.mempool.html
index 03edc08ef..def14434e 100644
--- a/frontend/src/index.mempool.html
+++ b/frontend/src/index.mempool.html
@@ -7,17 +7,17 @@
-
+
-
+
-
+
From e3fffd8fb22d38b27aab7592fe5bf2b47cb2be57 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Wed, 13 Sep 2023 09:21:31 +0200
Subject: [PATCH 122/671] [UI] fix menu scroll issue
---
frontend/src/app/components/menu/menu.component.scss | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/frontend/src/app/components/menu/menu.component.scss b/frontend/src/app/components/menu/menu.component.scss
index f1f39b1de..a27048981 100644
--- a/frontend/src/app/components/menu/menu.component.scss
+++ b/frontend/src/app/components/menu/menu.component.scss
@@ -9,11 +9,14 @@
margin-left: -250px;
box-shadow: 5px 0px 30px 0px #000;
padding-bottom: 20px;
+ @media (max-width: 613px) {
+ top: 105px;
+ }
}
.scrollable {
overflow-x: hidden;
- overflow-y: scroll;
+ overflow-y: auto;
}
.sidenav.open {
From a0004382771b784e865d29fadc5e0143f1f8ccd2 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Wed, 13 Sep 2023 09:30:11 +0200
Subject: [PATCH 123/671] [UI] menu username ellipsis
---
frontend/src/app/components/menu/menu.component.html | 2 +-
frontend/src/app/components/menu/menu.component.scss | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/frontend/src/app/components/menu/menu.component.html b/frontend/src/app/components/menu/menu.component.html
index e89ace64a..1c247a94b 100644
--- a/frontend/src/app/components/menu/menu.component.html
+++ b/frontend/src/app/components/menu/menu.component.html
@@ -3,7 +3,7 @@