diff --git a/README.md b/README.md index af4ae224f..5b994955c 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,11 @@ JSON: "PRICE_FEED_UPDATE_INTERVAL": 600, "USE_SECOND_NODE_FOR_MINFEE": false, "EXTERNAL_ASSETS": ["https://mempool.space/resources/pools.json"], - "STDOUT_LOG_MIN_PRIORITY": "debug" + "STDOUT_LOG_MIN_PRIORITY": "info" }, ``` -docker-compose overrides:: +docker-compose overrides: ``` MEMPOOL_NETWORK: "" MEMPOOL_BACKEND: "" diff --git a/docker/backend/start.sh b/docker/backend/start.sh index 019f16217..d26a93b08 100644 --- a/docker/backend/start.sh +++ b/docker/backend/start.sh @@ -17,7 +17,7 @@ __MEMPOOL_INDEXING_BLOCKS_AMOUNT__=${MEMPOOL_INDEXING_BLOCKS_AMOUNT:=1100} __MEMPOOL_PRICE_FEED_UPDATE_INTERVAL__=${MEMPOOL_PRICE_FEED_UPDATE_INTERVAL:=600} __MEMPOOL_USE_SECOND_NODE_FOR_MINFEE__=${MEMPOOL_USE_SECOND_NODE_FOR_MINFEE:=false} __MEMPOOL_EXTERNAL_ASSETS__=${MEMPOOL_EXTERNAL_ASSETS:=[\"https://mempool.space/resources/pools.json\"]} -__MEMPOOL_STDOUT_LOG_MIN_PRIORITY__=${MEMPOOL_STDOUT_LOG_MIN_PRIORITY:=debug} +__MEMPOOL_STDOUT_LOG_MIN_PRIORITY__=${MEMPOOL_STDOUT_LOG_MIN_PRIORITY:=info} # CORE_RPC __CORE_RPC_HOST__=${CORE_RPC_HOST:=127.0.0.1} diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 677d88d6e..4fe24ceb8 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -68,6 +68,7 @@ import { PushTransactionComponent } from './components/push-transaction/push-tra import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { AssetsFeaturedComponent } from './components/assets/assets-featured/assets-featured.component'; import { AssetGroupComponent } from './components/assets/asset-group/asset-group.component'; +import { AssetCirculationComponent } from './components/asset-circulation/asset-circulation.component'; import { MiningDashboardComponent } from './components/mining-dashboard/mining-dashboard.component'; import { DifficultyChartComponent } from './components/difficulty-chart/difficulty-chart.component'; @@ -120,6 +121,7 @@ import { DifficultyChartComponent } from './components/difficulty-chart/difficul AssetsNavComponent, AssetsFeaturedComponent, AssetGroupComponent, + AssetCirculationComponent, MiningDashboardComponent, DifficultyChartComponent, ], diff --git a/frontend/src/app/bitcoin.utils.ts b/frontend/src/app/bitcoin.utils.ts index 577249940..ff2d7a885 100644 --- a/frontend/src/app/bitcoin.utils.ts +++ b/frontend/src/app/bitcoin.utils.ts @@ -69,7 +69,7 @@ export function calcSegwitFeeGains(tx: Transaction) { export function moveDec(num: number, n: number) { let frac, int, neg, ref; if (n === 0) { - return num; + return num.toString(); } ref = ('' + num).split('.'), int = ref[0], frac = ref[1]; int || (int = '0'); diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index b9050d41e..b0a440b61 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -8,13 +8,10 @@ -
+
The Mempool Open Source Project
-

Building a mempool and blockchain explorer for the Bitcoin community, focusing on the transaction fee market and multi-layer ecosystem, without any advertising, altcoins, or third-party trackers.

+

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.

- -
-
@@ -31,31 +28,128 @@
+

+ +

Enterprise Sponsors 🚀

@@ -73,9 +167,6 @@
- - - Navigate to https://mempool.space/sponsor to sponsor
@@ -106,6 +197,10 @@ Citadel + + + NixOS + Electrum @@ -142,10 +237,6 @@ Marina - - - Satpile -
@@ -177,7 +268,7 @@
- +

Project Contributors

@@ -252,7 +343,7 @@ Third-party Licenses Terms of Service
- + diff --git a/frontend/src/app/components/about/about.component.scss b/frontend/src/app/components/about/about.component.scss index 4a14307cb..8b9466732 100644 --- a/frontend/src/app/components/about/about.component.scss +++ b/frontend/src/app/components/about/about.component.scss @@ -9,7 +9,7 @@ border-radius: 50%; margin: 25px; line-height: 32px; - } + } .intro { margin: 25px auto 30px; @@ -41,7 +41,7 @@ } .alliances, - .enterprise-sponsor, + .enterprise-sponsor, .community-integrations-sponsor, .maintainers { margin-top: 68px; @@ -58,7 +58,7 @@ .wrapper { margin: 20px auto; } - .btn-primary { + .btn-primary { max-width: 250px; margin: auto; height: 45px; @@ -68,7 +68,7 @@ .alliances { margin-bottom: 100px; - a { + a { &:nth-child(3) { position: relative; top: 10px; @@ -88,17 +88,17 @@ margin: 50px 30px 0px; } } - .liquid { + .liquid { top: 7px; position: relative; } - .copa { + .copa { height: auto; top: 23px; position: relative; width: 300px; } - .bisq { + .bisq { top: 3px; position: relative; } @@ -115,15 +115,15 @@ display: inline-block; &:hover { text-decoration: none; - img { + img, svg { transform: scale(1.1); } } - img, span{ + img, svg, span { display: block; transition: 150ms all; } - img { + img, svg { margin: 40px 29px 10px; } } diff --git a/frontend/src/app/components/asset-circulation/asset-circulation.component.html b/frontend/src/app/components/asset-circulation/asset-circulation.component.html new file mode 100644 index 000000000..1c6337721 --- /dev/null +++ b/frontend/src/app/components/asset-circulation/asset-circulation.component.html @@ -0,0 +1,3 @@ + + {{ circulating.amount }} {{ circulating.ticker }} + \ No newline at end of file diff --git a/frontend/src/app/components/asset-circulation/asset-circulation.component.scss b/frontend/src/app/components/asset-circulation/asset-circulation.component.scss new file mode 100644 index 000000000..5e43c829c --- /dev/null +++ b/frontend/src/app/components/asset-circulation/asset-circulation.component.scss @@ -0,0 +1,3 @@ +.ticker { + color: grey; +} diff --git a/frontend/src/app/components/asset-circulation/asset-circulation.component.ts b/frontend/src/app/components/asset-circulation/asset-circulation.component.ts new file mode 100644 index 000000000..d1a56abb0 --- /dev/null +++ b/frontend/src/app/components/asset-circulation/asset-circulation.component.ts @@ -0,0 +1,62 @@ +import { ChangeDetectionStrategy, Component, Inject, Input, LOCALE_ID, OnInit } from '@angular/core'; +import { combineLatest, Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { moveDec } from 'src/app/bitcoin.utils'; +import { AssetsService } from 'src/app/services/assets.service'; +import { ElectrsApiService } from 'src/app/services/electrs-api.service'; +import { formatNumber } from '@angular/common'; +import { environment } from 'src/environments/environment'; + +@Component({ + selector: 'app-asset-circulation', + templateUrl: './asset-circulation.component.html', + styleUrls: ['./asset-circulation.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class AssetCirculationComponent implements OnInit { + @Input() assetId: string; + + circulatingAmount$: Observable<{ amount: string, ticker: string}>; + + constructor( + private electrsApiService: ElectrsApiService, + private assetsService: AssetsService, + @Inject(LOCALE_ID) private locale: string, + ) { } + + ngOnInit(): void { + this.circulatingAmount$ = combineLatest([ + this.electrsApiService.getAsset$(this.assetId), + this.assetsService.getAssetsMinimalJson$] + ) + .pipe( + map(([asset, assetsMinimal]) => { + const assetData = assetsMinimal[asset.asset_id]; + if (!asset.chain_stats.has_blinded_issuances) { + if (asset.asset_id === environment.nativeAssetId) { + return { + amount: formatNumber(this.formatAmount(asset.chain_stats.peg_in_amount - asset.chain_stats.burned_amount + - asset.chain_stats.peg_out_amount, assetData[3]), this.locale, '1.2-2'), + ticker: assetData[1] + }; + } else { + return { + amount: formatNumber(this.formatAmount(asset.chain_stats.issued_amount + - asset.chain_stats.burned_amount, assetData[3]), this.locale, '1.2-2'), + ticker: assetData[1] + }; + } + } else { + return { + amount: $localize`:@@shared.confidential:Confidential`, + ticker: '', + }; + } + }), + ); + } + + formatAmount(value: number, precision = 0): number { + return parseFloat(moveDec(value, -precision)); + } +} diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html index 1914b5d08..516ad5ba6 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html @@ -21,10 +21,10 @@
-
- - {{ block.extras.pool.name}} -
+
+ + {{ block.extras.pool.name}} +
diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.scss b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.scss index a20b1cb35..5a9a7ea18 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.scss +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.scss @@ -129,4 +129,15 @@ position: relative; top: 15px; z-index: 101; -} \ No newline at end of file +} + +.animated { + transition: all 0.15s ease-in-out; +} +.show { + opacity: 1; +} +.hide { + opacity: 0; + pointer-events : none; +} diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts index a8d055602..7a0123a78 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts @@ -1,9 +1,10 @@ -import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef, Input } from '@angular/core'; +import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; import { StateService } from 'src/app/services/state.service'; -import { Router } from '@angular/router'; import { specialBlocks } from 'src/app/app.constants'; import { BlockExtended } from 'src/app/interfaces/node-api.interface'; +import { Location } from '@angular/common'; +import { config } from 'process'; @Component({ selector: 'app-blockchain-blocks', @@ -12,7 +13,6 @@ import { BlockExtended } from 'src/app/interfaces/node-api.interface'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class BlockchainBlocksComponent implements OnInit, OnDestroy { - @Input() showMiningInfo: boolean = false; specialBlocks = specialBlocks; network = ''; blocks: BlockExtended[] = []; @@ -32,6 +32,7 @@ export class BlockchainBlocksComponent implements OnInit, OnDestroy { arrowLeftPx = 30; blocksFilled = false; transition = '1s'; + showMiningInfo = false; gradientColors = { '': ['#9339f4', '#105fb0'], @@ -44,11 +45,22 @@ export class BlockchainBlocksComponent implements OnInit, OnDestroy { constructor( public stateService: StateService, - private router: Router, private cd: ChangeDetectorRef, - ) { } + private location: Location, + ) { + } + + enabledMiningInfoIfNeeded(url) { + this.showMiningInfo = url === '/mining'; + this.cd.markForCheck(); // Need to update the view asap + } ngOnInit() { + if (['', 'testnet', 'signet'].includes(this.stateService.network)) { + this.enabledMiningInfoIfNeeded(this.location.path()); + this.location.onUrlChange((url) => this.enabledMiningInfoIfNeeded(url)); + } + if (this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet') { this.feeRounding = '1.0-1'; } diff --git a/frontend/src/app/components/blockchain/blockchain.component.html b/frontend/src/app/components/blockchain/blockchain.component.html index 19ee5676d..c49d08c5a 100644 --- a/frontend/src/app/components/blockchain/blockchain.component.html +++ b/frontend/src/app/components/blockchain/blockchain.component.html @@ -1,8 +1,8 @@ -
+
- +
diff --git a/frontend/src/app/components/blockchain/blockchain.component.scss b/frontend/src/app/components/blockchain/blockchain.component.scss index a33fc58d2..6d415cd2a 100644 --- a/frontend/src/app/components/blockchain/blockchain.component.scss +++ b/frontend/src/app/components/blockchain/blockchain.component.scss @@ -59,14 +59,4 @@ width: 300px; left: -150px; top: 0px; -} - -.animate { - transition: all 1s ease-in-out; -} -.move-left { - transform: translate(-40%, 0); - @media (max-width: 767.98px) { - transform: translate(-85%, 0); - } -} +} \ No newline at end of file diff --git a/frontend/src/app/components/blockchain/blockchain.component.ts b/frontend/src/app/components/blockchain/blockchain.component.ts index b47eee833..5c00c5ef7 100644 --- a/frontend/src/app/components/blockchain/blockchain.component.ts +++ b/frontend/src/app/components/blockchain/blockchain.component.ts @@ -8,7 +8,6 @@ import { StateService } from 'src/app/services/state.service'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class BlockchainComponent implements OnInit { - showMiningInfo: boolean = false; network: string; constructor( diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html index b3cbd5fa1..a871f6141 100644 --- a/frontend/src/app/dashboard/dashboard.component.html +++ b/frontend/src/app/dashboard/dashboard.component.html @@ -16,58 +16,79 @@
- +
- +
-
-
Transaction Fees
-
-
- + +
+
Transaction Fees
+
+
+ +
-
-
- -
+
+ +
+
- +
- -
- -
-
+ + +
+ +
+
+
+ + +
- +
- + + + + + + + + +
+ + + + + {{ group.name }} +
@@ -158,6 +179,27 @@
+ + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/app/dashboard/dashboard.component.scss b/frontend/src/app/dashboard/dashboard.component.scss index 39ca2101a..6fb2ee125 100644 --- a/frontend/src/app/dashboard/dashboard.component.scss +++ b/frontend/src/app/dashboard/dashboard.component.scss @@ -283,3 +283,25 @@ margin-right: -2px; font-size: 10px; } + +.assetIcon { + width: 40px; + height: 40px; +} + +.asset-title { + text-align: left; + vertical-align: middle; +} + +.asset-icon { + width: 65px; + height: 65px; + vertical-align: middle; +} + +.circulating-amount { + text-align: right; + width: 100%; + vertical-align: middle; +} diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index 7a7e1fbf2..33fb5ea91 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, Component, Inject, LOCALE_ID, OnInit } from '@angular/core'; -import { combineLatest, merge, Observable, of, timer } from 'rxjs'; +import { combineLatest, merge, Observable, of } from 'rxjs'; import { filter, map, scan, share, switchMap, tap } from 'rxjs/operators'; import { BlockExtended, OptimizedMempoolStats } from '../interfaces/node-api.interface'; import { MempoolInfo, TransactionStripped } from '../interfaces/websocket.interface'; @@ -34,6 +34,7 @@ interface MempoolStatsData { }) export class DashboardComponent implements OnInit { collapseLevel: string; + featuredAssets$: Observable; network$: Observable; mempoolBlocksData$: Observable; mempoolInfoData$: Observable; @@ -124,6 +125,19 @@ export class DashboardComponent implements OnInit { }) ); + this.featuredAssets$ = this.apiService.listFeaturedAssets$() + .pipe( + map((featured) => { + const newArray = []; + for (const feature of featured) { + if (feature.ticker !== 'L-BTC' && feature.asset) { + newArray.push(feature); + } + } + return newArray.slice(0, 4); + }), + ); + this.blocks$ = this.stateService.blocks$ .pipe( tap(([block]) => { diff --git a/frontend/src/resources/profile/blockstream.svg b/frontend/src/resources/profile/blockstream.svg deleted file mode 100644 index 6dc32eab9..000000000 --- a/frontend/src/resources/profile/blockstream.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/resources/profile/exodus.svg b/frontend/src/resources/profile/exodus.svg deleted file mode 100644 index 082cba7a5..000000000 --- a/frontend/src/resources/profile/exodus.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - Exodus_logo - - - - - - - - diff --git a/frontend/src/resources/profile/foundry.svg b/frontend/src/resources/profile/foundry.svg deleted file mode 100644 index 3647e994a..000000000 --- a/frontend/src/resources/profile/foundry.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/frontend/src/resources/profile/gemini.svg b/frontend/src/resources/profile/gemini.svg deleted file mode 100644 index 6aeecf1b9..000000000 --- a/frontend/src/resources/profile/gemini.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/frontend/src/resources/profile/nix-bitcoin.png b/frontend/src/resources/profile/nix-bitcoin.png new file mode 100644 index 000000000..cd8d3e9d7 Binary files /dev/null and b/frontend/src/resources/profile/nix-bitcoin.png differ diff --git a/frontend/src/resources/profile/spiral.svg b/frontend/src/resources/profile/spiral.svg deleted file mode 100644 index c21f5d70c..000000000 --- a/frontend/src/resources/profile/spiral.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/frontend/src/resources/profile/unchained.svg b/frontend/src/resources/profile/unchained.svg deleted file mode 100644 index 2ab4bc9da..000000000 --- a/frontend/src/resources/profile/unchained.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - -