From 8ac71f21d1d818a38628a7ef18adc48d4548e732 Mon Sep 17 00:00:00 2001 From: softsimon Date: Thu, 4 Apr 2024 21:48:16 +0900 Subject: [PATCH] Updating i18n for accelerator preview --- .../accelerate-fee-graph.component.ts | 4 +- .../accelerate-preview.component.html | 55 ++- .../block/block-preview.component.html | 4 +- .../app/components/block/block.component.html | 4 +- .../pool-ranking/pool-ranking.component.ts | 2 +- .../transaction/transaction.component.html | 4 +- .../src/app/interfaces/node-api.interface.ts | 1 + frontend/src/app/services/api.service.ts | 22 +- frontend/src/locale/messages.xlf | 318 +++++++++++++----- 9 files changed, 286 insertions(+), 128 deletions(-) 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 b5aebd35f..ebfa019a1 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: 'maximum', + label: $localize`maximum`, active: option.index === this.maxRateIndex, rateIndex: option.index, fee: option.fee, @@ -63,7 +63,7 @@ export class AccelerateFeeGraphComponent implements OnInit, OnChanges { rate: this.estimate.targetFeeRate, style: this.getStyle(this.estimate.targetFeeRate, maxRate, baseHeight), class: 'target', - label: 'next block', + label: $localize`:@@bdf0e930eb22431140a2eaeacd809cc5f8ebd38c:Next Block`.toLowerCase(), fee: this.estimate.nextBlockFee - this.estimate.txSummary.effectiveFee }); } 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 a848a645b..70d9ef3f3 100644 --- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html +++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html @@ -32,18 +32,16 @@
You are currently on the waitlist
-
Your transaction
+
Your transaction
- Plus {{ estimate.txSummary.ancestorCount - 1 }} unconfirmed ancestor{{ estimate.txSummary.ancestorCount > 2 ? 's' : ''}}. + Plus {{ estimate.txSummary.ancestorCount - 1 }} unconfirmed ancestor(s) - + @@ -52,9 +50,7 @@ - + @@ -69,13 +65,10 @@
-
How much more are you willing to pay?
+
How much more are you willing to pay?
- - 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. -
+ Choose the maximum extra transaction fee you're willing to pay to get into the next block.
@@ -99,9 +92,7 @@
- + @@ -109,7 +100,7 @@ - + @@ -179,7 +168,7 @@ @@ -203,9 +192,7 @@ - + @@ -224,7 +211,7 @@ @@ -233,7 +220,7 @@ @@ -245,7 +232,7 @@
- +
@@ -257,4 +244,6 @@

-
\ No newline at end of file + + +If your tx is accelerated to ~{{ i | number : '1.0-0' }} sat/vB \ No newline at end of file diff --git a/frontend/src/app/components/block/block-preview.component.html b/frontend/src/app/components/block/block-preview.component.html index 02fe62774..2bb749e80 100644 --- a/frontend/src/app/components/block/block-preview.component.html +++ b/frontend/src/app/components/block/block-preview.component.html @@ -53,13 +53,13 @@ diff --git a/frontend/src/app/components/block/block.component.html b/frontend/src/app/components/block/block.component.html index 0020f56be..d2f84116c 100644 --- a/frontend/src/app/components/block/block.component.html +++ b/frontend/src/app/components/block/block.component.html @@ -182,13 +182,13 @@ diff --git a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts index 11ee6e506..17fcc7b4a 100644 --- a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts +++ b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts @@ -181,7 +181,7 @@ export class PoolRankingComponent implements OnInit { color: '#6b6b6b', }, value: totalShareOther, - name: 'Other' + (isMobile() ? `` : ` (${totalShareOther.toFixed(2)}%)`), + name: $localize`Other (${totalShareOther.toFixed(2) + '%'})`, label: { overflow: 'none', color: '#b1b1b1', diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index bcc8ff332..ae418ffd3 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -103,7 +103,7 @@
-

Accelerate

+

Accelerate

@@ -562,7 +562,7 @@
diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts index 8441acc14..6d28612f0 100644 --- a/frontend/src/app/interfaces/node-api.interface.ts +++ b/frontend/src/app/interfaces/node-api.interface.ts @@ -163,6 +163,7 @@ export interface PoolInfo { emptyBlocks: number; slug: string; poolUniqueId: number; + unique_id: number; } export interface PoolStat { pool: PoolInfo; diff --git a/frontend/src/app/services/api.service.ts b/frontend/src/app/services/api.service.ts index 9879255c1..145a8705e 100644 --- a/frontend/src/app/services/api.service.ts +++ b/frontend/src/app/services/api.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http'; import { CpfpInfo, OptimizedMempoolStats, AddressInformation, LiquidPegs, ITranslators, PoolStat, BlockExtended, TransactionStripped, RewardStats, AuditScore, BlockSizesAndWeights, RbfTree, BlockAudit, Acceleration, AccelerationHistoryParams, CurrentPegs, AuditStatus, FederationAddress, FederationUtxo, RecentPeg, PegsVolume, AccelerationInfo } from '../interfaces/node-api.interface'; -import { BehaviorSubject, Observable, catchError, filter, of, shareReplay, take, tap } from 'rxjs'; +import { BehaviorSubject, Observable, catchError, filter, map, of, shareReplay, take, tap } from 'rxjs'; import { StateService } from './state.service'; import { Transaction } from '../interfaces/electrs.interface'; import { Conversion } from './price.service'; @@ -246,11 +246,29 @@ export class ApiService { return this.httpClient.get( this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pools` + (interval !== undefined ? `/${interval}` : ''), { observe: 'response' } + ) + .pipe( + map((response) => { + response.body.pools.forEach((pool) => { + if (pool.poolUniqueId === 0) { + pool.name = $localize`:@@e5d8bb389c702588877f039d72178f219453a72d:Unknown`; + } + }); + return response; + }) ); } getPoolStats$(slug: string): Observable { - return this.httpClient.get(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${slug}`); + return this.httpClient.get(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${slug}`) + .pipe( + map((poolStats) => { + if (poolStats.pool.unique_id === 0) { + poolStats.pool.name = $localize`:@@e5d8bb389c702588877f039d72178f219453a72d:Unknown`; + } + return poolStats; + }) + ); } getPoolHashrate$(slug: string): Observable { diff --git a/frontend/src/locale/messages.xlf b/frontend/src/locale/messages.xlf index 51351b151..a866bdd34 100644 --- a/frontend/src/locale/messages.xlf +++ b/frontend/src/locale/messages.xlf @@ -406,39 +406,114 @@ sat shared.sat + + maximum + + src/app/components/accelerate-preview/accelerate-fee-graph.component.ts + 55 + + + + Next Block + + src/app/components/accelerate-preview/accelerate-fee-graph.component.ts + 66 + + + src/app/components/block/block.component.html + 12 + + + src/app/components/difficulty/difficulty-tooltip.component.html + 28 + + + src/app/components/mempool-block/mempool-block.component.ts + 87 + + + + Your transaction + + src/app/components/accelerate-preview/accelerate-preview.component.html + 35 + + accelerator.your-transaction + + + Plus unconfirmed ancestor(s) + + src/app/components/accelerate-preview/accelerate-preview.component.html + 39 + + accelerator.plus-unconfirmed-ancestors + + + Virtual size + + src/app/components/accelerate-preview/accelerate-preview.component.html + 44 + + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 59 + + + src/app/components/rbf-timeline/rbf-timeline-tooltip.component.html + 25 + + + src/app/components/transaction/transaction.component.html + 189 + + + src/app/components/transaction/transaction.component.html + 317 + + Transaction Virtual Size + transaction.vsize + + + In-band fees + + src/app/components/accelerate-preview/accelerate-preview.component.html + 53 + + accelerator.in-band-fees + sats src/app/components/accelerate-preview/accelerate-preview.component.html - 59 + 55 src/app/components/accelerate-preview/accelerate-preview.component.html - 84 + 77 src/app/components/accelerate-preview/accelerate-preview.component.html - 118 + 109 src/app/components/accelerate-preview/accelerate-preview.component.html - 138 + 127 src/app/components/accelerate-preview/accelerate-preview.component.html - 150 + 139 src/app/components/accelerate-preview/accelerate-preview.component.html - 167 + 156 src/app/components/accelerate-preview/accelerate-preview.component.html - 190 + 179 src/app/components/accelerate-preview/accelerate-preview.component.html - 213 + 200 src/app/components/calculator/calculator.component.html @@ -502,19 +577,35 @@ shared.sats + + How much more are you willing to pay? + + src/app/components/accelerate-preview/accelerate-preview.component.html + 68 + + accelerator.pay-how-much + + + Choose the maximum extra transaction fee you're willing to pay to get into the next block. + + src/app/components/accelerate-preview/accelerate-preview.component.html + 71 + + accelerator.transaction-fee-description + + + Next block market rate + + src/app/components/accelerate-preview/accelerate-preview.component.html + 95 + + accelerator.next-block-rate + sat/vB src/app/components/accelerate-preview/accelerate-preview.component.html - 108 - - - src/app/components/accelerate-preview/accelerate-preview.component.html - 173 - - - src/app/components/accelerate-preview/accelerate-preview.component.html - 198 + 99 src/app/shared/components/fee-rate/fee-rate.component.html @@ -527,6 +618,119 @@ sat/vB shared.sat-vbyte + + Estimated extra fee required + + src/app/components/accelerate-preview/accelerate-preview.component.html + 103 + + accelerator.estimated-extra-fee-required + + + Mempool Acceleratorâ„¢ fees + + src/app/components/accelerate-preview/accelerate-preview.component.html + 117 + + accelerator.mempool-accelerator-fees + + + Accelerator Service Fee + + src/app/components/accelerate-preview/accelerate-preview.component.html + 121 + + accelerator.service-fee + + + Transaction Size Surcharge + + src/app/components/accelerate-preview/accelerate-preview.component.html + 133 + + accelerator.tx-size-surcharge + + + Estimated acceleration cost + + src/app/components/accelerate-preview/accelerate-preview.component.html + 148 + + accelerator.estimated-cost + + + Maximum acceleration cost + + src/app/components/accelerate-preview/accelerate-preview.component.html + 171 + + accelerator.maximum-cost + + + Available balance + + src/app/components/accelerate-preview/accelerate-preview.component.html + 195 + + accelerator.available-balance + + + Sign In + + src/app/components/accelerate-preview/accelerate-preview.component.html + 214 + + + src/app/components/menu/menu.component.html + 21 + + + src/app/shared/components/global-footer/global-footer.component.html + 26 + + + src/app/shared/components/global-footer/global-footer.component.html + 31 + + shared.sign-in + + + Accelerate on mempool.space + + src/app/components/accelerate-preview/accelerate-preview.component.html + 223 + + accelerator.accelerate-on-mempoolspace + + + Accelerate + + src/app/components/accelerate-preview/accelerate-preview.component.html + 235 + + + src/app/components/transaction/transaction.component.html + 106 + + + src/app/components/transaction/transaction.component.html + 145 + + + src/app/components/transaction/transaction.component.html + 155 + + Accelerate button label + transaction.accelerate + + + If your tx is accelerated to ~ sat/vB + + src/app/components/accelerate-preview/accelerate-preview.component.html + 249 + + accelerator.accelerated-to-description + Acceleration Fees @@ -1937,27 +2141,6 @@ Effective transaction fee rate transaction.effective-fee-rate - - Virtual size - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 59 - - - src/app/components/rbf-timeline/rbf-timeline-tooltip.component.html - 25 - - - src/app/components/transaction/transaction.component.html - 189 - - - src/app/components/transaction/transaction.component.html - 317 - - Transaction Virtual Size - transaction.vsize - Weight @@ -2392,22 +2575,6 @@ Block reorg block.reorged - - Next Block - - src/app/components/block/block.component.html - 12 - - - src/app/components/difficulty/difficulty-tooltip.component.html - 28 - - - src/app/components/mempool-block/mempool-block.component.ts - 87 - - Next Block - Previous Block @@ -2479,6 +2646,14 @@ src/app/lightning/nodes-networks-chart/nodes-networks-chart.component.ts 323 + + src/app/services/api.service.ts + 254 + + + src/app/services/api.service.ts + 267 + unknown @@ -4147,22 +4322,6 @@ 328 - - Sign In - - src/app/components/menu/menu.component.html - 21 - - - src/app/shared/components/global-footer/global-footer.component.html - 26 - - - src/app/shared/components/global-footer/global-footer.component.html - 31 - - shared.sign-in - Reward stats @@ -4400,7 +4559,11 @@ - Other () + Other () + + src/app/components/pool-ranking/pool-ranking.component.ts + 184 + src/app/components/pool-ranking/pool-ranking.component.ts 203 @@ -5446,19 +5609,6 @@ Transaction ETA in several hours or more transaction.eta.in-several-hours - - Accelerate - - src/app/components/transaction/transaction.component.html - 145 - - - src/app/components/transaction/transaction.component.html - 155 - - Accelerate button label - transaction.accelerate - Type
- Virtual size - Virtual size
- In-band fees - In-band fees {{ estimate.txSummary.effectiveFee | number : '1.0-0' }} sats
- Next block market rate - Next block market rate {{ estimate.targetFeeRate | number : '1.0-0' }}
- Estimated extra fee required + Estimated extra fee required {{ math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee) | number }} @@ -123,13 +114,11 @@
- Mempool Acceleratorâ„¢ fees - Mempool Acceleratorâ„¢ fees
- Accelerator Service Fee + Accelerator Service Fee +{{ estimate.mempoolBaseFee | number }} @@ -141,7 +130,7 @@
- Transaction Size Surcharge + Transaction Size Surcharge +{{ estimate.vsizeFee | number }} @@ -156,7 +145,7 @@
- Estimated acceleration cost + Estimated acceleration cost @@ -170,7 +159,7 @@
- If your tx is accelerated to {{ estimate.targetFeeRate | number : '1.0-0' }} sat/vB +
- Maximum acceleration cost + Maximum acceleration cost @@ -195,7 +184,7 @@
- If your tx is accelerated to ~{{ ((estimate.txSummary.effectiveFee + userBid) / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB +
- Available balance - Available balance {{ estimate.userBalance | number }} - Login + Sign In
- Accelerate on mempool.space + Accelerate on mempool.space
Miner + [class]="!block?.extras.pool.name || block?.extras.pool.slug === 'unknown' ? 'badge-secondary' : 'badge-primary'"> {{ block?.extras.pool.name }} + [class]="!block?.extras.pool.name || block?.extras.pool.slug === 'unknown' ? 'badge-secondary' : 'badge-primary'"> {{ block?.extras.pool.name }} Miner + [class]="block.extras.pool.slug === 'unknown' ? 'badge-secondary' : 'badge-primary'"> {{ block.extras.pool.name }} + [class]="block.extras.pool.slug === 'unknown' ? 'badge-secondary' : 'badge-primary'"> {{ block.extras.pool.name }} Miner + [class]="pool.slug === 'unknown' ? 'badge-secondary' : 'badge-primary'"> {{ pool.name }}