From 00352d7e36a0c0fa7e050cddcfff7b97c71009b3 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 9 Dec 2021 22:04:23 +0900 Subject: [PATCH 01/60] Use "natural" intervals for x-axis in charts --- backend/src/api/statistics.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index 6cdfd72e7..8aad48e2b 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -267,7 +267,7 @@ class Statistics { } } - private getQueryForDays(div: number) { + private getQueryForDays(div: number, limit: number) { return `SELECT id, added, unconfirmed_transactions, tx_per_second, vbytes_per_second, @@ -308,7 +308,7 @@ class Statistics { vsize_1400, vsize_1600, vsize_1800, - vsize_2000 FROM statistics GROUP BY UNIX_TIMESTAMP(added) DIV ${div} ORDER BY id DESC LIMIT 480`; + vsize_2000 FROM statistics GROUP BY UNIX_TIMESTAMP(added) DIV ${div} ORDER BY id DESC LIMIT ${limit}`; } public async $get(id: number): Promise { @@ -341,7 +341,7 @@ class Statistics { public async $list24H(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(180); + const query = this.getQueryForDays(300, 288); // 5m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -354,7 +354,7 @@ class Statistics { public async $list1W(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(1260); + const query = this.getQueryForDays(1800, 336); // 30m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -367,7 +367,7 @@ class Statistics { public async $list1M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(5040); + const query = this.getQueryForDays(7200, 372); // 4h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -380,7 +380,7 @@ class Statistics { public async $list3M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(15120); + const query = this.getQueryForDays(21600, 372); // 6h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -393,7 +393,7 @@ class Statistics { public async $list6M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(30240); + const query = this.getQueryForDays(43200, 372); // 12h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -406,7 +406,7 @@ class Statistics { public async $list1Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(60480); + const query = this.getQueryForDays(86400, 365); // 1d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -419,7 +419,7 @@ class Statistics { public async $list2Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(120960); + const query = this.getQueryForDays(172800, 365); // 2d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -432,7 +432,7 @@ class Statistics { public async $list3Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(181440); + const query = this.getQueryForDays(259200, 365); // 3d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); From 2b3463519a561fa7461a9ef17efd07741409bebb Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 9 Dec 2021 22:29:40 +0900 Subject: [PATCH 02/60] Format date properly according to the chosen time scale --- .../incoming-transactions-graph.component.ts | 25 ++++++++++++++++++- .../mempool-graph/mempool-graph.component.ts | 25 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts index 622b8a296..b1c2399e1 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts @@ -123,7 +123,30 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { fontSize: 11, lineHeight: 12 }, - data: this.data.labels.map((value: any) => `${formatDate(value, 'M/d', this.locale)}\n${formatDate(value, 'H:mm', this.locale)}`), + data: this.data.labels.map((value: any) => { + switch (this.windowPreference) { + case "2h": + return `${formatDate(value, 'h:mm a', this.locale)}` + case "24h": + return `${formatDate(value, 'h a', this.locale)}` + case "1w": + return `${formatDate(value, 'EEE, MMM d', this.locale)}` + case "1m": + return `${formatDate(value, 'EEE, MMM d', this.locale)}` + case "3m": + return `${formatDate(value, 'MMM d', this.locale)}` + case "6m": + return `${formatDate(value, 'MMM d', this.locale)}` + case "1y": + return `${formatDate(value, 'MMM y', this.locale)}` + case "2y": + return `${formatDate(value, 'MMM y', this.locale)}` + case "3y": + return `${formatDate(value, 'MMM y', this.locale)}` + default: + return `${formatDate(value, 'M/d', this.locale)}\n${formatDate(value, 'H:mm', this.locale)}` + } + }), }, yAxis: { type: 'value', 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 3fd8912fd..ce4550759 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -320,7 +320,30 @@ export class MempoolGraphComponent implements OnInit, OnChanges { fontSize: 11, lineHeight: 12, }, - data: labels.map((value: any) => `${formatDate(value, 'M/d', this.locale)}\n${formatDate(value, 'H:mm', this.locale)}`), + data: labels.map((value: any) => { + switch (this.windowPreference) { + case "2h": + return `${formatDate(value, 'h:mm a', this.locale)}` + case "24h": + return `${formatDate(value, 'h a', this.locale)}` + case "1w": + return `${formatDate(value, 'EEE, MMM d', this.locale)}` + case "1m": + return `${formatDate(value, 'EEE, MMM d', this.locale)}` + case "3m": + return `${formatDate(value, 'MMM d', this.locale)}` + case "6m": + return `${formatDate(value, 'MMM d', this.locale)}` + case "1y": + return `${formatDate(value, 'MMM y', this.locale)}` + case "2y": + return `${formatDate(value, 'MMM y', this.locale)}` + case "3y": + return `${formatDate(value, 'MMM y', this.locale)}` + default: + return `${formatDate(value, 'M/d', this.locale)}\n${formatDate(value, 'H:mm', this.locale)}` + } + }), } ], yAxis: { From 833dd3ef9d94dad0e13b95b55ec33a44cf52011f Mon Sep 17 00:00:00 2001 From: softsimon Date: Fri, 10 Dec 2021 11:22:25 +0400 Subject: [PATCH 03/60] Extracting updated i18n strings --- frontend/src/locale/messages.xlf | 1920 +++++++++++++++--------------- 1 file changed, 972 insertions(+), 948 deletions(-) diff --git a/frontend/src/locale/messages.xlf b/frontend/src/locale/messages.xlf index cc3648909..fdaf8ec28 100644 --- a/frontend/src/locale/messages.xlf +++ b/frontend/src/locale/messages.xlf @@ -253,7 +253,7 @@ Registered assets src/app/assets/assets.component.html - 3,7 + 3,8 Registered assets page header @@ -325,7 +325,7 @@ Error loading assets data. src/app/assets/assets.component.html - 63,68 + 63,71 Asset data load error @@ -341,7 +341,7 @@ src/app/components/master-page/master-page.component.html - 58,60 + 58,61 @@ -495,7 +495,7 @@ src/app/components/transaction/transaction.component.html - 51,53 + 51,54 Transaction Timestamp transaction.timestamp @@ -532,7 +532,7 @@ Height src/app/bisq/bisq-blocks/bisq-blocks.component.html - 12,13 + 12,14 src/app/bisq/bisq-transactions/bisq-transactions.component.html @@ -544,7 +544,7 @@ src/app/dashboard/dashboard.component.html - 89,90 + 89,91 Bisq block height header @@ -552,11 +552,11 @@ Confirmed src/app/bisq/bisq-blocks/bisq-blocks.component.html - 13,14 + 13,15 src/app/bisq/bisq-transactions/bisq-transactions.component.html - 21,23 + 21,24 Bisq block confirmed time header @@ -576,7 +576,7 @@ src/app/components/latest-blocks/latest-blocks.component.html - 12,15 + 12,16 src/app/components/master-page/master-page.component.html @@ -608,11 +608,11 @@ src/app/components/master-page/master-page.component.html - 40,42 + 40,43 src/app/components/master-page/master-page.component.html - 48,50 + 48,51 @@ -638,8 +638,8 @@ 66,67 - src/app/components/api-docs/api-docs.component.html - 36,38 + src/app/components/docs/api-docs.component.html + 35,38 Bisq All Markets @@ -647,7 +647,7 @@ Bitcoin Markets src/app/bisq/bisq-dashboard/bisq-dashboard.component.html - 21,23 + 21,24 src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.html @@ -717,7 +717,7 @@ Latest Trades src/app/bisq/bisq-dashboard/bisq-dashboard.component.html - 52,55 + 52,56 src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.html @@ -753,11 +753,11 @@ src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.html - 101,107 + 101,108 src/app/dashboard/dashboard.component.html - 108,112 + 108,113 dashboard.view-all @@ -769,11 +769,11 @@ src/app/components/about/about.component.html - 223,227 + 235,239 - src/app/components/api-docs/api-docs.component.html - 893,895 + src/app/components/docs/api-docs.component.html + 874,876 src/app/dashboard/dashboard.component.html @@ -977,7 +977,7 @@ src/app/components/transactions-list/transactions-list.component.html - 198,199 + 211,213 @@ -1013,7 +1013,8 @@ shared.transaction - confirmation + confirmation src/app/bisq/bisq-transaction/bisq-transaction.component.html 20,21 @@ -1028,13 +1029,20 @@ src/app/components/transactions-list/transactions-list.component.html - 225,226 + 238,239 Transaction singular confirmation count shared.confirmation-count.singular - confirmations + confirmations src/app/bisq/bisq-transaction/bisq-transaction.component.html 21,22 @@ -1049,7 +1057,7 @@ src/app/components/transactions-list/transactions-list.component.html - 226,227 + 239,240 Transaction plural confirmation count shared.confirmation-count.plural @@ -1105,11 +1113,11 @@ src/app/components/transaction/transaction.component.html - 206,210 + 206,211 src/app/components/transaction/transaction.component.html - 318,323 + 318,324 transaction.details @@ -1301,7 +1309,7 @@ The Mempool Open Source Project src/app/components/about/about.component.html - 12 + 12,13 about.about-the-project @@ -1316,7 +1324,7 @@ Enterprise Sponsors 🚀 src/app/components/about/about.component.html - 35,37 + 35,38 about.sponsors.enterprise.withRocket @@ -1368,15 +1376,23 @@ Project Contributors src/app/components/about/about.component.html - 164,166 + 165,167 about.contributors + + Project Staff + + src/app/components/about/about.component.html + 177,179 + + about.project_staff + Project Maintainers src/app/components/about/about.component.html - 178,180 + 190,192 about.maintainers @@ -1384,7 +1400,7 @@ About src/app/components/about/about.component.ts - 36 + 37 src/app/components/bisq-master-page/bisq-master-page.component.html @@ -1432,7 +1448,7 @@ address.unconfidential - of transaction + of transaction src/app/components/address/address.component.html 57,58 @@ -1440,7 +1456,8 @@ X of X Address Transaction - of transactions + of transactions src/app/components/address/address.component.html 58,59 @@ -1456,7 +1473,8 @@ address.error.loading-address-data - The number of transactions on this address exceeds the Electrum server limit Consider viewing this address on the official Mempool website instead: + The number of transactions on this address exceeds the Electrum server limit Consider viewing this address on the official Mempool website instead: src/app/components/address/address.component.html 134,137 @@ -1479,7 +1497,7 @@ src/app/components/transactions-list/transactions-list.component.html - 234,236 + 247,249 src/app/dashboard/dashboard.component.html @@ -1494,873 +1512,6 @@ 78 - - API Service - - src/app/components/api-docs/api-docs.component.html - 4,7 - - api-docs.title - - - General - - src/app/components/api-docs/api-docs.component.html - 10,12 - - API Docs tab for General - api-docs.tab.general - - - Endpoint - - src/app/components/api-docs/api-docs.component.html - 20,21 - - - src/app/components/api-docs/api-docs.component.html - 46,47 - - - src/app/components/api-docs/api-docs.component.html - 63,64 - - - src/app/components/api-docs/api-docs.component.html - 80,81 - - - src/app/components/api-docs/api-docs.component.html - 97,98 - - - src/app/components/api-docs/api-docs.component.html - 114,115 - - - src/app/components/api-docs/api-docs.component.html - 131,132 - - - src/app/components/api-docs/api-docs.component.html - 148,149 - - - src/app/components/api-docs/api-docs.component.html - 165,166 - - - src/app/components/api-docs/api-docs.component.html - 191,192 - - - src/app/components/api-docs/api-docs.component.html - 216,217 - - - src/app/components/api-docs/api-docs.component.html - 233,234 - - - src/app/components/api-docs/api-docs.component.html - 250,251 - - - src/app/components/api-docs/api-docs.component.html - 267,268 - - - src/app/components/api-docs/api-docs.component.html - 284,285 - - - src/app/components/api-docs/api-docs.component.html - 310,311 - - - src/app/components/api-docs/api-docs.component.html - 343,344 - - - src/app/components/api-docs/api-docs.component.html - 369,370 - - - src/app/components/api-docs/api-docs.component.html - 386,387 - - - src/app/components/api-docs/api-docs.component.html - 403,404 - - - src/app/components/api-docs/api-docs.component.html - 437,438 - - - src/app/components/api-docs/api-docs.component.html - 454,455 - - - src/app/components/api-docs/api-docs.component.html - 471,472 - - - src/app/components/api-docs/api-docs.component.html - 488,489 - - - src/app/components/api-docs/api-docs.component.html - 505,506 - - - src/app/components/api-docs/api-docs.component.html - 522,523 - - - src/app/components/api-docs/api-docs.component.html - 539,540 - - - src/app/components/api-docs/api-docs.component.html - 556,557 - - - src/app/components/api-docs/api-docs.component.html - 581,582 - - - src/app/components/api-docs/api-docs.component.html - 598,599 - - - src/app/components/api-docs/api-docs.component.html - 624,625 - - - src/app/components/api-docs/api-docs.component.html - 641,642 - - - src/app/components/api-docs/api-docs.component.html - 658,659 - - - src/app/components/api-docs/api-docs.component.html - 684,685 - - - src/app/components/api-docs/api-docs.component.html - 717,718 - - - src/app/components/api-docs/api-docs.component.html - 734,735 - - - src/app/components/api-docs/api-docs.component.html - 751,752 - - - src/app/components/api-docs/api-docs.component.html - 768,769 - - - src/app/components/api-docs/api-docs.component.html - 785,786 - - - src/app/components/api-docs/api-docs.component.html - 802,803 - - - src/app/components/api-docs/api-docs.component.html - 819,820 - - - src/app/components/api-docs/api-docs.component.html - 837,838 - - - src/app/components/api-docs/api-docs.component.html - 854,857 - - - src/app/components/api-docs/api-docs.component.html - 874,876 - - Api docs endpoint - - - Description - - src/app/components/api-docs/api-docs.component.html - 24,25 - - - src/app/components/api-docs/api-docs.component.html - 50,51 - - - src/app/components/api-docs/api-docs.component.html - 67,68 - - - src/app/components/api-docs/api-docs.component.html - 84,85 - - - src/app/components/api-docs/api-docs.component.html - 101,102 - - - src/app/components/api-docs/api-docs.component.html - 118,119 - - - src/app/components/api-docs/api-docs.component.html - 135,136 - - - src/app/components/api-docs/api-docs.component.html - 152,153 - - - src/app/components/api-docs/api-docs.component.html - 169,170 - - - src/app/components/api-docs/api-docs.component.html - 195,196 - - - src/app/components/api-docs/api-docs.component.html - 220,221 - - - src/app/components/api-docs/api-docs.component.html - 237,238 - - - src/app/components/api-docs/api-docs.component.html - 254,255 - - - src/app/components/api-docs/api-docs.component.html - 271,272 - - - src/app/components/api-docs/api-docs.component.html - 288,289 - - - src/app/components/api-docs/api-docs.component.html - 314,315 - - - src/app/components/api-docs/api-docs.component.html - 330,331 - - - src/app/components/api-docs/api-docs.component.html - 347,348 - - - src/app/components/api-docs/api-docs.component.html - 373,374 - - - src/app/components/api-docs/api-docs.component.html - 390,391 - - - src/app/components/api-docs/api-docs.component.html - 407,408 - - - src/app/components/api-docs/api-docs.component.html - 423,424 - - - src/app/components/api-docs/api-docs.component.html - 441,442 - - - src/app/components/api-docs/api-docs.component.html - 458,459 - - - src/app/components/api-docs/api-docs.component.html - 475,476 - - - src/app/components/api-docs/api-docs.component.html - 492,493 - - - src/app/components/api-docs/api-docs.component.html - 509,510 - - - src/app/components/api-docs/api-docs.component.html - 526,527 - - - src/app/components/api-docs/api-docs.component.html - 543,544 - - - src/app/components/api-docs/api-docs.component.html - 560,561 - - - src/app/components/api-docs/api-docs.component.html - 585,586 - - - src/app/components/api-docs/api-docs.component.html - 602,603 - - - src/app/components/api-docs/api-docs.component.html - 628,629 - - - src/app/components/api-docs/api-docs.component.html - 645,646 - - - src/app/components/api-docs/api-docs.component.html - 662,663 - - - src/app/components/api-docs/api-docs.component.html - 688,689 - - - src/app/components/api-docs/api-docs.component.html - 704,705 - - - src/app/components/api-docs/api-docs.component.html - 721,722 - - - src/app/components/api-docs/api-docs.component.html - 738,739 - - - src/app/components/api-docs/api-docs.component.html - 755,756 - - - src/app/components/api-docs/api-docs.component.html - 772,773 - - - src/app/components/api-docs/api-docs.component.html - 789,790 - - - src/app/components/api-docs/api-docs.component.html - 806,807 - - - src/app/components/api-docs/api-docs.component.html - 823,824 - - - src/app/components/api-docs/api-docs.component.html - 841,842 - - - src/app/components/api-docs/api-docs.component.html - 858,859 - - - src/app/components/api-docs/api-docs.component.html - 878,879 - - - - Returns details about difficulty adjustment. - - src/app/components/api-docs/api-docs.component.html - 25,27 - - - - Provides list of available currencies for a given base currency. - - src/app/components/api-docs/api-docs.component.html - 51,53 - - - - Provides list of open offer prices for a single market. - - src/app/components/api-docs/api-docs.component.html - 68,70 - - - - Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart. - - src/app/components/api-docs/api-docs.component.html - 85,87 - - - - Provides list of available markets. - - src/app/components/api-docs/api-docs.component.html - 102,104 - - - - Provides list of open offer details for a single market. - - src/app/components/api-docs/api-docs.component.html - 119,121 - - - - Provides 24 hour price ticker for single market or all markets - - src/app/components/api-docs/api-docs.component.html - 136,138 - - - - Provides list of completed trades for a single market. - - src/app/components/api-docs/api-docs.component.html - 153,155 - - - - Provides periodic volume data in terms of base currency for one or all markets. - - src/app/components/api-docs/api-docs.component.html - 170,172 - - - - General - - src/app/components/api-docs/api-docs.component.html - 181,183 - - API Docs tab for BSQ - api-docs.tab.bsq - - - Returns statistics about all Bisq transactions. - - src/app/components/api-docs/api-docs.component.html - 196,198 - - - - Addresses - - src/app/components/api-docs/api-docs.component.html - 207,209 - - API Docs tab for Addresses - api-docs.tab.addresses - - - Returns details about an address. Available fields: address, chain_stats, and mempool_stats. chain,mempool_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum. - - src/app/components/api-docs/api-docs.component.html - 221,222 - - - - Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below). - - src/app/components/api-docs/api-docs.component.html - 238,239 - - - - Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query. - - src/app/components/api-docs/api-docs.component.html - 255,257 - - - - Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging). - - src/app/components/api-docs/api-docs.component.html - 272,274 - - - - Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof. - - src/app/components/api-docs/api-docs.component.html - 289,290 - - - - Assets - - src/app/components/api-docs/api-docs.component.html - 300,302 - - API Docs tab for Assets - api-docs.tab.assets - - - Returns information about a Liquid asset. - - src/app/components/api-docs/api-docs.component.html - 315,317 - - - - Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset. - - src/app/components/api-docs/api-docs.component.html - 331,333 - - - - Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units. - - src/app/components/api-docs/api-docs.component.html - 348,350 - - - - Blocks - - src/app/components/api-docs/api-docs.component.html - 359,361 - - - src/app/components/latest-blocks/latest-blocks.component.ts - 39 - - API Docs tab for Blocks - api-docs.tab.blocks - - - Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight,proof, and previousblockhash. - - src/app/components/api-docs/api-docs.component.html - 374,375 - - - - Returns the hex-encoded block header. - - src/app/components/api-docs/api-docs.component.html - 391,393 - - - - Returns the hash of the block currently at :height. - - src/app/components/api-docs/api-docs.component.html - 408,409 - - - - Returns the raw block representation in binary. - - src/app/components/api-docs/api-docs.component.html - 424,426 - - - - Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain). - - src/app/components/api-docs/api-docs.component.html - 442,443 - - - - Returns the height of the last block. - - src/app/components/api-docs/api-docs.component.html - 459,461 - - - - Returns the hash of the last block. - - src/app/components/api-docs/api-docs.component.html - 476,478 - - - - Returns the transaction at index :index within the specified block. - - src/app/components/api-docs/api-docs.component.html - 493,494 - - - - Returns a list of all txids in the block. - - src/app/components/api-docs/api-docs.component.html - 510,512 - - - - Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status. - - src/app/components/api-docs/api-docs.component.html - 527,528 - - - - Returns the 10 newest blocks starting at the tip or at :start_height if specified. - - src/app/components/api-docs/api-docs.component.html - 544,545 - - - src/app/components/api-docs/api-docs.component.html - 561,562 - - - - Fees - - src/app/components/api-docs/api-docs.component.html - 571,573 - - API Docs tab for Fees - api-docs.tab.fees - - - Returns current mempool as projected blocks. - - src/app/components/api-docs/api-docs.component.html - 586,588 - - API Docs for /api/v1/fees/mempool-blocks - api-docs.fees.mempool-blocks - - - Returns our currently suggested fees for new transactions. - - src/app/components/api-docs/api-docs.component.html - 603,605 - - API Docs for /api/v1/fees/recommended - api-docs.fees.recommended - - - Mempool - - src/app/components/api-docs/api-docs.component.html - 614,616 - - API Docs tab for Mempool - api-docs.tab.mempool - - - Returns current mempool backlog statistics. - - src/app/components/api-docs/api-docs.component.html - 629,631 - - API Docs for /api/mempool - api-docs.mempool.mempool - - - Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind. - - src/app/components/api-docs/api-docs.component.html - 646,648 - - API Docs for /api/mempool/txids - api-docs.mempool.txids - - - Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value. - - src/app/components/api-docs/api-docs.component.html - 663,664 - - API Docs for /api/mempool/recent - api-docs.mempool.recent - - - Transactions - - src/app/components/api-docs/api-docs.component.html - 674,678 - - API Docs tab for Transactions - api-docs.tab.transactions - - - Returns the ancestors and the best descendant fees for a transaction. - - src/app/components/api-docs/api-docs.component.html - 689,691 - - API Docs for /api/v1/fees/cpfp - api-docs.fees.cpfp - - - Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status. - - src/app/components/api-docs/api-docs.component.html - 705,706 - - - - Returns a transaction serialized as hex. - - src/app/components/api-docs/api-docs.component.html - 722,724 - - - - Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format. - - src/app/components/api-docs/api-docs.component.html - 739,740 - - - - Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format. - - src/app/components/api-docs/api-docs.component.html - 756,757 - - - - Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx). - - src/app/components/api-docs/api-docs.component.html - 773,774 - - - - Returns the spending status of all transaction outputs. - - src/app/components/api-docs/api-docs.component.html - 790,792 - - - - Returns a transaction as binary data. - - src/app/components/api-docs/api-docs.component.html - 807,809 - - - - Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional). - - src/app/components/api-docs/api-docs.component.html - 824,825 - - - - Returns :length of latest Bisq transactions, starting from :index. - - src/app/components/api-docs/api-docs.component.html - 842,844 - - - - Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success. - - src/app/components/api-docs/api-docs.component.html - 859,860 - - - - Websocket - - src/app/components/api-docs/api-docs.component.html - 870,874 - - API Docs tab for Websocket - api-docs.tab.websocket - - - Default push: action: 'want', data: ['blocks', ...] to express what you want pushed. Available: blocks, mempool-blocks, live-2h-chart, and stats.Push transactions related to address: 'track-address': '3PbJ...bF9B' to receive all new transactions containing that address as input or output. Returns an array of transactions. address-transactions for new mempool transactions, and block-transactions for new block confirmed transactions. - - src/app/components/api-docs/api-docs.component.html - 879,880 - - api-docs.websocket.websocket - - - Privacy Policy - - src/app/components/api-docs/api-docs.component.html - 895,900 - - - src/app/dashboard/dashboard.component.html - 152,154 - - Privacy Policy - shared.privacy-policy - - - API - - src/app/components/api-docs/api-docs.component.ts - 27 - - - src/app/components/bisq-master-page/bisq-master-page.component.html - 42,44 - - - src/app/components/liquid-master-page/liquid-master-page.component.html - 47,49 - - - src/app/components/master-page/master-page.component.html - 61,63 - - - - Code Example - - src/app/components/api-docs/code-template.component.html - 6,7 - - - src/app/components/api-docs/code-template.component.html - 13,14 - - - src/app/components/api-docs/code-template.component.html - 29,30 - - API Docs code example - - - Install Package - - src/app/components/api-docs/code-template.component.html - 23,24 - - API Docs install lib - - - Response - - src/app/components/api-docs/code-template.component.html - 36,37 - - API Docs API response - Asset @@ -2553,7 +1704,7 @@ Stats src/app/components/bisq-master-page/bisq-master-page.component.html - 39,41 + 39,42 src/app/components/master-page/master-page.component.html @@ -2561,6 +1712,18 @@ master-page.stats + + Docs + + src/app/components/bisq-master-page/bisq-master-page.component.html + 42,45 + + + src/app/components/liquid-master-page/liquid-master-page.component.html + 47,50 + + master-page.docs + Next Block @@ -2597,7 +1760,7 @@ Size src/app/components/block/block.component.html - 64,65 + 64,66 src/app/components/latest-blocks/latest-blocks.component.html @@ -2609,7 +1772,7 @@ src/app/components/mempool-graph/mempool-graph.component.ts - 264 + 256 src/app/dashboard/dashboard.component.html @@ -2621,7 +1784,7 @@ Weight src/app/components/block/block.component.html - 68,69 + 68,70 block.weight @@ -2697,7 +1860,7 @@ src/app/components/transactions-list/transactions-list.component.html - 218 + 231 src/app/dashboard/dashboard.component.html @@ -2755,7 +1918,7 @@ src/app/components/block/block.component.html - 102,105 + 102,106 Total subsidy and fees in a block block.subsidy-and-fees @@ -2825,7 +1988,7 @@ Error loading block data. src/app/components/block/block.component.html - 256,264 + 256,266 block.error.loading-block-data @@ -2843,6 +2006,864 @@ 15 + + API service + + src/app/components/docs/api-docs.component.html + 6,8 + + api-docs.title + + + General + + src/app/components/docs/api-docs.component.html + 9,12 + + API Docs tab for General + api-docs.tab.general + + + Endpoint + + src/app/components/docs/api-docs.component.html + 19,20 + + + src/app/components/docs/api-docs.component.html + 44,45 + + + src/app/components/docs/api-docs.component.html + 61,62 + + + src/app/components/docs/api-docs.component.html + 78,79 + + + src/app/components/docs/api-docs.component.html + 95,96 + + + src/app/components/docs/api-docs.component.html + 112,113 + + + src/app/components/docs/api-docs.component.html + 129,130 + + + src/app/components/docs/api-docs.component.html + 146,147 + + + src/app/components/docs/api-docs.component.html + 163,164 + + + src/app/components/docs/api-docs.component.html + 187,188 + + + src/app/components/docs/api-docs.component.html + 211,212 + + + src/app/components/docs/api-docs.component.html + 228,229 + + + src/app/components/docs/api-docs.component.html + 245,246 + + + src/app/components/docs/api-docs.component.html + 262,263 + + + src/app/components/docs/api-docs.component.html + 279,280 + + + src/app/components/docs/api-docs.component.html + 303,304 + + + src/app/components/docs/api-docs.component.html + 336,337 + + + src/app/components/docs/api-docs.component.html + 360,361 + + + src/app/components/docs/api-docs.component.html + 377,378 + + + src/app/components/docs/api-docs.component.html + 394,395 + + + src/app/components/docs/api-docs.component.html + 428,429 + + + src/app/components/docs/api-docs.component.html + 445,446 + + + src/app/components/docs/api-docs.component.html + 462,463 + + + src/app/components/docs/api-docs.component.html + 479,480 + + + src/app/components/docs/api-docs.component.html + 496,497 + + + src/app/components/docs/api-docs.component.html + 513,514 + + + src/app/components/docs/api-docs.component.html + 530,531 + + + src/app/components/docs/api-docs.component.html + 547,548 + + + src/app/components/docs/api-docs.component.html + 571,572 + + + src/app/components/docs/api-docs.component.html + 588,589 + + + src/app/components/docs/api-docs.component.html + 612,613 + + + src/app/components/docs/api-docs.component.html + 629,630 + + + src/app/components/docs/api-docs.component.html + 646,647 + + + src/app/components/docs/api-docs.component.html + 670,671 + + + src/app/components/docs/api-docs.component.html + 703,704 + + + src/app/components/docs/api-docs.component.html + 720,721 + + + src/app/components/docs/api-docs.component.html + 737,738 + + + src/app/components/docs/api-docs.component.html + 754,755 + + + src/app/components/docs/api-docs.component.html + 771,772 + + + src/app/components/docs/api-docs.component.html + 788,789 + + + src/app/components/docs/api-docs.component.html + 805,806 + + + src/app/components/docs/api-docs.component.html + 823,824 + + + src/app/components/docs/api-docs.component.html + 840,843 + + + src/app/components/docs/api-docs.component.html + 859,862 + + Api docs endpoint + + + Description + + src/app/components/docs/api-docs.component.html + 23,24 + + + src/app/components/docs/api-docs.component.html + 48,49 + + + src/app/components/docs/api-docs.component.html + 65,66 + + + src/app/components/docs/api-docs.component.html + 82,83 + + + src/app/components/docs/api-docs.component.html + 99,100 + + + src/app/components/docs/api-docs.component.html + 116,117 + + + src/app/components/docs/api-docs.component.html + 133,134 + + + src/app/components/docs/api-docs.component.html + 150,151 + + + src/app/components/docs/api-docs.component.html + 167,168 + + + src/app/components/docs/api-docs.component.html + 191,192 + + + src/app/components/docs/api-docs.component.html + 215,216 + + + src/app/components/docs/api-docs.component.html + 232,233 + + + src/app/components/docs/api-docs.component.html + 249,250 + + + src/app/components/docs/api-docs.component.html + 266,267 + + + src/app/components/docs/api-docs.component.html + 283,284 + + + src/app/components/docs/api-docs.component.html + 307,308 + + + src/app/components/docs/api-docs.component.html + 323,324 + + + src/app/components/docs/api-docs.component.html + 340,341 + + + src/app/components/docs/api-docs.component.html + 364,365 + + + src/app/components/docs/api-docs.component.html + 381,382 + + + src/app/components/docs/api-docs.component.html + 398,399 + + + src/app/components/docs/api-docs.component.html + 414,415 + + + src/app/components/docs/api-docs.component.html + 432,433 + + + src/app/components/docs/api-docs.component.html + 449,450 + + + src/app/components/docs/api-docs.component.html + 466,467 + + + src/app/components/docs/api-docs.component.html + 483,484 + + + src/app/components/docs/api-docs.component.html + 500,501 + + + src/app/components/docs/api-docs.component.html + 517,518 + + + src/app/components/docs/api-docs.component.html + 534,535 + + + src/app/components/docs/api-docs.component.html + 551,552 + + + src/app/components/docs/api-docs.component.html + 575,576 + + + src/app/components/docs/api-docs.component.html + 592,593 + + + src/app/components/docs/api-docs.component.html + 616,617 + + + src/app/components/docs/api-docs.component.html + 633,634 + + + src/app/components/docs/api-docs.component.html + 650,651 + + + src/app/components/docs/api-docs.component.html + 674,675 + + + src/app/components/docs/api-docs.component.html + 690,691 + + + src/app/components/docs/api-docs.component.html + 707,708 + + + src/app/components/docs/api-docs.component.html + 724,725 + + + src/app/components/docs/api-docs.component.html + 741,742 + + + src/app/components/docs/api-docs.component.html + 758,759 + + + src/app/components/docs/api-docs.component.html + 775,776 + + + src/app/components/docs/api-docs.component.html + 792,793 + + + src/app/components/docs/api-docs.component.html + 809,810 + + + src/app/components/docs/api-docs.component.html + 827,828 + + + src/app/components/docs/api-docs.component.html + 844,845 + + + src/app/components/docs/api-docs.component.html + 863,864 + + + + Returns details about difficulty adjustment. + + src/app/components/docs/api-docs.component.html + 24,26 + + + + Provides list of available currencies for a given base currency. + + src/app/components/docs/api-docs.component.html + 49,51 + + + + Provides list of open offer prices for a single market. + + src/app/components/docs/api-docs.component.html + 66,68 + + + + Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart. + + src/app/components/docs/api-docs.component.html + 83,85 + + + + Provides list of available markets. + + src/app/components/docs/api-docs.component.html + 100,102 + + + + Provides list of open offer details for a single market. + + src/app/components/docs/api-docs.component.html + 117,119 + + + + Provides 24 hour price ticker for single market or all markets + + src/app/components/docs/api-docs.component.html + 134,136 + + + + Provides list of completed trades for a single market. + + src/app/components/docs/api-docs.component.html + 151,153 + + + + Provides periodic volume data in terms of base currency for one or all markets. + + src/app/components/docs/api-docs.component.html + 168,170 + + + + General + + src/app/components/docs/api-docs.component.html + 178,181 + + API Docs tab for BSQ + api-docs.tab.bsq + + + Returns statistics about all Bisq transactions. + + src/app/components/docs/api-docs.component.html + 192,194 + + + + Addresses + + src/app/components/docs/api-docs.component.html + 202,206 + + API Docs tab for Addresses + api-docs.tab.addresses + + + Returns details about an address. Available fields: address, chain_stats, and mempool_stats. chain,mempool_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum. + + src/app/components/docs/api-docs.component.html + 216,217 + + + + Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below). + + src/app/components/docs/api-docs.component.html + 233,234 + + + + Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query. + + src/app/components/docs/api-docs.component.html + 250,252 + + + + Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging). + + src/app/components/docs/api-docs.component.html + 267,269 + + + + Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof. + + src/app/components/docs/api-docs.component.html + 284,285 + + + + Assets + + src/app/components/docs/api-docs.component.html + 294,298 + + API Docs tab for Assets + api-docs.tab.assets + + + Returns information about a Liquid asset. + + src/app/components/docs/api-docs.component.html + 308,310 + + + + Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset. + + src/app/components/docs/api-docs.component.html + 324,326 + + + + Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units. + + src/app/components/docs/api-docs.component.html + 341,343 + + + + Blocks + + src/app/components/docs/api-docs.component.html + 351,355 + + + src/app/components/latest-blocks/latest-blocks.component.ts + 39 + + API Docs tab for Blocks + api-docs.tab.blocks + + + Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight,proof, and previousblockhash. + + src/app/components/docs/api-docs.component.html + 365,366 + + + + Returns the hex-encoded block header. + + src/app/components/docs/api-docs.component.html + 382,384 + + + + Returns the hash of the block currently at :height. + + src/app/components/docs/api-docs.component.html + 399,400 + + + + Returns the raw block representation in binary. + + src/app/components/docs/api-docs.component.html + 415,417 + + + + Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain). + + src/app/components/docs/api-docs.component.html + 433,434 + + + + Returns the height of the last block. + + src/app/components/docs/api-docs.component.html + 450,452 + + + + Returns the hash of the last block. + + src/app/components/docs/api-docs.component.html + 467,469 + + + + Returns the transaction at index :index within the specified block. + + src/app/components/docs/api-docs.component.html + 484,485 + + + + Returns a list of all txids in the block. + + src/app/components/docs/api-docs.component.html + 501,503 + + + + Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status. + + src/app/components/docs/api-docs.component.html + 518,519 + + + + Returns the 10 newest blocks starting at the tip or at :start_height if specified. + + src/app/components/docs/api-docs.component.html + 535,536 + + + src/app/components/docs/api-docs.component.html + 552,553 + + + + Fees + + src/app/components/docs/api-docs.component.html + 562,565 + + API Docs tab for Fees + api-docs.tab.fees + + + Returns current mempool as projected blocks. + + src/app/components/docs/api-docs.component.html + 576,578 + + API Docs for /api/v1/fees/mempool-blocks + api-docs.fees.mempool-blocks + + + Returns our currently suggested fees for new transactions. + + src/app/components/docs/api-docs.component.html + 593,595 + + API Docs for /api/v1/fees/recommended + api-docs.fees.recommended + + + Mempool + + src/app/components/docs/api-docs.component.html + 603,607 + + API Docs tab for Mempool + api-docs.tab.mempool + + + Returns current mempool backlog statistics. + + src/app/components/docs/api-docs.component.html + 617,619 + + API Docs for /api/mempool + api-docs.mempool.mempool + + + Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind. + + src/app/components/docs/api-docs.component.html + 634,636 + + API Docs for /api/mempool/txids + api-docs.mempool.txids + + + Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value. + + src/app/components/docs/api-docs.component.html + 651,652 + + API Docs for /api/mempool/recent + api-docs.mempool.recent + + + Transactions + + src/app/components/docs/api-docs.component.html + 661,664 + + API Docs tab for Transactions + api-docs.tab.transactions + + + Returns the ancestors and the best descendant fees for a transaction. + + src/app/components/docs/api-docs.component.html + 675,677 + + API Docs for /api/v1/fees/cpfp + api-docs.fees.cpfp + + + Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status. + + src/app/components/docs/api-docs.component.html + 691,692 + + + + Returns a transaction serialized as hex. + + src/app/components/docs/api-docs.component.html + 708,710 + + + + Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format. + + src/app/components/docs/api-docs.component.html + 725,726 + + + + Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format. + + src/app/components/docs/api-docs.component.html + 742,743 + + + + Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx). + + src/app/components/docs/api-docs.component.html + 759,760 + + + + Returns the spending status of all transaction outputs. + + src/app/components/docs/api-docs.component.html + 776,778 + + + + Returns a transaction as binary data. + + src/app/components/docs/api-docs.component.html + 793,795 + + + + Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional). + + src/app/components/docs/api-docs.component.html + 810,811 + + + + Returns :length of latest Bisq transactions, starting from :index. + + src/app/components/docs/api-docs.component.html + 828,830 + + + + Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success. + + src/app/components/docs/api-docs.component.html + 845,846 + + + + Default push: action: 'want', data: ['blocks', ...] to express what you want pushed. Available: blocks, mempool-blocks, live-2h-chart, and stats.Push transactions related to address: 'track-address': '3PbJ...bF9B' to receive all new transactions containing that address as input or output. Returns an array of transactions. address-transactions for new mempool transactions, and block-transactions for new block confirmed transactions. + + src/app/components/docs/api-docs.component.html + 864,865 + + api-docs.websocket.websocket + + + Privacy Policy + + src/app/components/docs/api-docs.component.html + 876,881 + + + src/app/dashboard/dashboard.component.html + 152,154 + + Privacy Policy + shared.privacy-policy + + + API + + src/app/components/docs/api-docs.component.ts + 28 + + + + Code Example + + src/app/components/docs/code-template.component.html + 6,7 + + + src/app/components/docs/code-template.component.html + 13,14 + + + src/app/components/docs/code-template.component.html + 29,30 + + API Docs code example + + + Install Package + + src/app/components/docs/code-template.component.html + 23,24 + + API Docs install lib + + + Response + + src/app/components/docs/code-template.component.html + 36,37 + + API Docs API response + + + Documentation + + src/app/components/docs/docs.component.html + 4 + + + src/app/components/master-page/master-page.component.html + 61,64 + + documentation.title + Low priority @@ -2895,7 +2916,7 @@ src/app/dashboard/dashboard.component.html - 219,221 + 219,222 dashboard.backend-is-synchronizing @@ -2903,7 +2924,7 @@ vB/s src/app/components/footer/footer.component.html - 11,15 + 11,16 src/app/dashboard/dashboard.component.html @@ -2916,7 +2937,7 @@ Unconfirmed src/app/components/footer/footer.component.html - 16,17 + 16,18 src/app/dashboard/dashboard.component.html @@ -2935,7 +2956,8 @@ dashboard.mempool-size - blocks + blocks src/app/components/footer/footer.component.html 22,23 @@ -2951,7 +2973,9 @@ shared.blocks - block + block src/app/components/footer/footer.component.html 23,24 @@ -3043,14 +3067,14 @@ Range src/app/components/mempool-graph/mempool-graph.component.ts - 263 + 255 Sum src/app/components/mempool-graph/mempool-graph.component.ts - 265 + 257 @@ -3184,7 +3208,7 @@ Invert src/app/components/statistics/statistics.component.html - 73 + 62 statistics.component-invert.title @@ -3192,7 +3216,7 @@ Transaction vBytes per second (vB/s) src/app/components/statistics/statistics.component.html - 98 + 87 statistics.transaction-vbytes-per-second @@ -3405,7 +3429,7 @@ src/app/components/transactions-list/transactions-list.component.html - 229,233 + 242,246 Transaction unconfirmed state transaction.unconfirmed @@ -3432,7 +3456,7 @@ ETA src/app/components/transaction/transaction.component.html - 109,111 + 110,111 Transaction ETA transaction.eta @@ -3528,7 +3552,7 @@ Waiting for it to appear in the mempool... src/app/components/transaction/transaction.component.html - 368,372 + 368,373 transaction.error.waiting-for-it-to-appear @@ -3536,7 +3560,7 @@ Fee src/app/components/transaction/transaction.component.html - 387,388 + 388 Transaction fee transaction.fee @@ -3563,7 +3587,7 @@ Coinbase src/app/components/transactions-list/transactions-list.component.html - 44 + 51 transactions-list.coinbase @@ -3571,7 +3595,7 @@ (Newly Generated Coins) src/app/components/transactions-list/transactions-list.component.html - 44 + 51 transactions-list.newly-generated-coins @@ -3579,7 +3603,7 @@ Peg-in src/app/components/transactions-list/transactions-list.component.html - 46,48 + 53,55 transactions-list.peg-in @@ -3587,7 +3611,7 @@ ScriptSig (ASM) src/app/components/transactions-list/transactions-list.component.html - 79,81 + 86,88 ScriptSig (ASM) transactions-list.scriptsig.asm @@ -3596,7 +3620,7 @@ ScriptSig (HEX) src/app/components/transactions-list/transactions-list.component.html - 83,85 + 90,93 ScriptSig (HEX) transactions-list.scriptsig.hex @@ -3605,7 +3629,7 @@ Witness src/app/components/transactions-list/transactions-list.component.html - 88,89 + 95,97 transactions-list.witness @@ -3613,7 +3637,7 @@ P2SH redeem script src/app/components/transactions-list/transactions-list.component.html - 92,93 + 99,100 transactions-list.p2sh-redeem-script @@ -3621,7 +3645,7 @@ P2WSH witness script src/app/components/transactions-list/transactions-list.component.html - 96,97 + 103,104 transactions-list.p2wsh-witness-script @@ -3629,7 +3653,7 @@ nSequence src/app/components/transactions-list/transactions-list.component.html - 100,101 + 107,109 transactions-list.nsequence @@ -3637,7 +3661,7 @@ Previous output script src/app/components/transactions-list/transactions-list.component.html - 105,106 + 112,113 transactions-list.previous-output-script @@ -3645,7 +3669,7 @@ Previous output type src/app/components/transactions-list/transactions-list.component.html - 109,110 + 116,117 transactions-list.previous-output-type @@ -3653,19 +3677,19 @@ Load all src/app/components/transactions-list/transactions-list.component.html - 120,123 + 127,130 src/app/components/transactions-list/transactions-list.component.html - 208,211 + 221,224 transactions-list.load-all - Peg-out to + Peg-out to src/app/components/transactions-list/transactions-list.component.html - 139,140 + 146,147 transactions-list.peg-out-to @@ -3673,7 +3697,7 @@ ScriptPubKey (ASM) src/app/components/transactions-list/transactions-list.component.html - 186,188 + 199,201 ScriptPubKey (ASM) transactions-list.scriptpubkey.asm @@ -3682,7 +3706,7 @@ ScriptPubKey (HEX) src/app/components/transactions-list/transactions-list.component.html - 190,192 + 203,206 ScriptPubKey (HEX) transactions-list.scriptpubkey.hex @@ -3691,7 +3715,7 @@ data src/app/components/transactions-list/transactions-list.component.html - 194,195 + 207,209 transactions-list.vout.scriptpubkey-type.data @@ -3699,7 +3723,7 @@ sat src/app/components/transactions-list/transactions-list.component.html - 218 + 231,232 sat shared.sat @@ -3848,7 +3872,7 @@ TXs src/app/dashboard/dashboard.component.html - 91,93 + 92,93 src/app/dashboard/dashboard.component.html @@ -3868,7 +3892,7 @@ USD src/app/dashboard/dashboard.component.html - 120,121 + 121,122 dashboard.latest-transactions.USD @@ -3876,7 +3900,7 @@ Fee src/app/dashboard/dashboard.component.html - 121,124 + 122,124 dashboard.latest-transactions.fee @@ -3892,7 +3916,7 @@ Collapse src/app/dashboard/dashboard.component.html - 143,147 + 143,149 dashboard.collapse @@ -3927,7 +3951,7 @@ L-BTC in circulation src/app/dashboard/dashboard.component.html - 207,208 + 207,209 dashboard.lbtc-pegs-in-circulation @@ -3943,7 +3967,7 @@ Difficulty Adjustment src/app/dashboard/dashboard.component.html - 231,234 + 231,235 dashboard.difficulty-adjustment From cbd187d06fde9ba74d8c47bd8eef763b043afc37 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 00:04:20 +0900 Subject: [PATCH 04/60] Use `time` for xAxis type and fix the mempool tooltip accordingly --- backend/src/api/statistics.ts | 6 +-- .../mempool-graph/mempool-graph.component.ts | 42 ++++--------------- .../src/app/interfaces/node-api.interface.ts | 2 +- 3 files changed, 13 insertions(+), 37 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index 8aad48e2b..ee6052cdf 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -268,7 +268,7 @@ class Statistics { } private getQueryForDays(div: number, limit: number) { - return `SELECT id, added, unconfirmed_transactions, + return `SELECT id, UNIX_TIMESTAMP(added) as added, unconfirmed_transactions, tx_per_second, vbytes_per_second, vsize_1, @@ -314,7 +314,7 @@ class Statistics { public async $get(id: number): Promise { try { const connection = await DB.pool.getConnection(); - const query = `SELECT * FROM statistics WHERE id = ?`; + const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics WHERE id = ?`; const [rows] = await connection.query(query, [id]); connection.release(); if (rows[0]) { @@ -328,7 +328,7 @@ class Statistics { public async $list2H(): Promise { try { const connection = await DB.pool.getConnection(); - const query = `SELECT * FROM statistics ORDER BY id DESC LIMIT 120`; + const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY id DESC LIMIT 120`; const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); 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 ce4550759..77aa5f97f 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -97,13 +97,13 @@ export class MempoolGraphComponent implements OnInit, OnChanges { } generateArray(mempoolStats: OptimizedMempoolStats[]) { - const finalArray: number[][] = []; - let feesArray: number[] = []; + const finalArray: number[][][] = []; + let feesArray: number[][] = []; let limitFeesTemplate = this.template === 'advanced' ? 26 : 20; for (let index = limitFeesTemplate; index > -1; index--) { feesArray = []; mempoolStats.forEach((stats) => { - feesArray.push(stats.vsizes[index] ? stats.vsizes[index] : 0); + feesArray.push([stats.added * 1000, stats.vsizes[index] ? stats.vsizes[index] : 0]); }); finalArray.push(feesArray); } @@ -192,8 +192,8 @@ export class MempoolGraphComponent implements OnInit, OnChanges { let progressPercentageText = ''; const items = this.inverted ? [...params].reverse() : params; items.map((item: any, index: number) => { - totalParcial += item.value; - const progressPercentage = (item.value / totalValue) * 100; + totalParcial += item.value[1]; + const progressPercentage = (item.value[1] / totalValue) * 100; const progressPercentageSum = (totalValueArray[index] / totalValue) * 100; let activeItemClass = ''; let hoverActive = 0; @@ -233,7 +233,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { - ${this.vbytesPipe.transform(item.value, 2, 'vB', 'MvB', false)} + ${this.vbytesPipe.transform(item.value[1], 2, 'vB', 'MvB', false)} @@ -257,7 +257,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { const titleSum = $localize`Sum`; return `
- ${params[0].axisValue} + ${params[0].axisValueLabel} ${this.vbytesPipe.transform(totalValue, 2, 'vB', 'MvB', false)} @@ -312,7 +312,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { }, xAxis: [ { - type: 'category', + type: 'time', boundaryGap: false, axisLine: { onZero: true }, axisLabel: { @@ -320,30 +320,6 @@ export class MempoolGraphComponent implements OnInit, OnChanges { fontSize: 11, lineHeight: 12, }, - data: labels.map((value: any) => { - switch (this.windowPreference) { - case "2h": - return `${formatDate(value, 'h:mm a', this.locale)}` - case "24h": - return `${formatDate(value, 'h a', this.locale)}` - case "1w": - return `${formatDate(value, 'EEE, MMM d', this.locale)}` - case "1m": - return `${formatDate(value, 'EEE, MMM d', this.locale)}` - case "3m": - return `${formatDate(value, 'MMM d', this.locale)}` - case "6m": - return `${formatDate(value, 'MMM d', this.locale)}` - case "1y": - return `${formatDate(value, 'MMM y', this.locale)}` - case "2y": - return `${formatDate(value, 'MMM y', this.locale)}` - case "3y": - return `${formatDate(value, 'MMM y', this.locale)}` - default: - return `${formatDate(value, 'M/d', this.locale)}\n${formatDate(value, 'H:mm', this.locale)}` - } - }), } ], yAxis: { @@ -369,7 +345,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { const totalValueArray = []; const valuesInverted = this.inverted ? values : [...values].reverse(); for (const item of valuesInverted) { - totalValueTemp += item.value; + totalValueTemp += item.value[1]; totalValueArray.push(totalValueTemp); } return { diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts index 550f712d9..2cdff2b99 100644 --- a/frontend/src/app/interfaces/node-api.interface.ts +++ b/frontend/src/app/interfaces/node-api.interface.ts @@ -1,6 +1,6 @@ export interface OptimizedMempoolStats { id: number; - added: string; + added: number; unconfirmed_transactions: number; tx_per_second: number; vbytes_per_second: number; From 37722fe165869777e87dc2c56e15d51881386d0d Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 00:24:10 +0900 Subject: [PATCH 05/60] Remove dead code FeeDistributionGraphComponent --- frontend/src/app/app.module.ts | 2 - .../fee-distribution-graph.component.html | 9 -- .../fee-distribution-graph.component.ts | 83 ------------------- .../mempool-block.component.html | 3 - 4 files changed, 97 deletions(-) delete mode 100644 frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html delete mode 100644 frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index bb6383421..e599293a6 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -32,7 +32,6 @@ import { BlockchainComponent } from './components/blockchain/blockchain.componen import { FooterComponent } from './components/footer/footer.component'; import { AudioService } from './services/audio.service'; import { MempoolBlockComponent } from './components/mempool-block/mempool-block.component'; -import { FeeDistributionGraphComponent } from './components/fee-distribution-graph/fee-distribution-graph.component'; import { IncomingTransactionsGraphComponent } from './components/incoming-transactions-graph/incoming-transactions-graph.component'; import { TimeSpanComponent } from './components/time-span/time-span.component'; import { SeoService } from './services/seo.service'; @@ -83,7 +82,6 @@ import { PushTransactionComponent } from './components/push-transaction/push-tra MempoolBlocksComponent, FooterComponent, MempoolBlockComponent, - FeeDistributionGraphComponent, IncomingTransactionsGraphComponent, MempoolGraphComponent, LbtcPegsGraphComponent, diff --git a/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html b/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html deleted file mode 100644 index 3465bde35..000000000 --- a/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html +++ /dev/null @@ -1,9 +0,0 @@ -
-
-
- - -
-
-
-
diff --git a/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts b/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts deleted file mode 100644 index 8c90036fd..000000000 --- a/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { OnChanges } from '@angular/core'; -import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; - -@Component({ - selector: 'app-fee-distribution-graph', - templateUrl: './fee-distribution-graph.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class FeeDistributionGraphComponent implements OnInit, OnChanges { - @Input() data: any; - @Input() height: number | string = 210; - @Input() top: number | string = 20; - @Input() right: number | string = 22; - @Input() left: number | string = 30; - - mempoolVsizeFeesOptions: any; - mempoolVsizeFeesInitOptions = { - renderer: 'svg' - }; - - constructor() { } - - ngOnInit() { - this.mountChart(); - } - - ngOnChanges() { - this.mountChart(); - } - - mountChart() { - this.mempoolVsizeFeesOptions = { - grid: { - height: '210', - right: '20', - top: '22', - left: '30', - }, - xAxis: { - type: 'category', - boundaryGap: false, - }, - yAxis: { - type: 'value', - splitLine: { - lineStyle: { - type: 'dotted', - color: '#ffffff66', - opacity: 0.25, - } - } - }, - series: [{ - data: this.data, - type: 'line', - label: { - show: true, - position: 'top', - color: '#ffffff', - textShadowBlur: 0, - formatter: (label: any) => { - return Math.floor(label.data); - }, - }, - smooth: true, - lineStyle: { - color: '#D81B60', - width: 4, - }, - itemStyle: { - color: '#b71c1c', - borderWidth: 10, - borderMiterLimit: 10, - opacity: 1, - }, - areaStyle: { - color: '#D81B60', - opacity: 1, - } - }] - }; - } -} diff --git a/frontend/src/app/components/mempool-block/mempool-block.component.html b/frontend/src/app/components/mempool-block/mempool-block.component.html index d59b3c477..48baa3c23 100644 --- a/frontend/src/app/components/mempool-block/mempool-block.component.html +++ b/frontend/src/app/components/mempool-block/mempool-block.component.html @@ -40,9 +40,6 @@
-
- -
From 41f3f0ab462797b9c2b7593bd32f5f50582d9d30 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 10:38:13 +0900 Subject: [PATCH 06/60] Fix graph data for incoming transaction graphs --- frontend/src/app/components/statistics/statistics.component.ts | 2 +- frontend/src/app/dashboard/dashboard.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/statistics/statistics.component.ts b/frontend/src/app/components/statistics/statistics.component.ts index fb386304d..84513fd3f 100644 --- a/frontend/src/app/components/statistics/statistics.component.ts +++ b/frontend/src/app/components/statistics/statistics.component.ts @@ -134,7 +134,7 @@ export class StatisticsComponent implements OnInit { this.mempoolTransactionsWeightPerSecondData = { labels: labels, - series: [mempoolStats.map((stats) => stats.vbytes_per_second)], + series: [mempoolStats.map((stats) => [stats.added * 1000, stats.vbytes_per_second])], }; } diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index ea843ec29..a4c6e51c5 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -286,7 +286,7 @@ export class DashboardComponent implements OnInit { return { labels: labels, - series: [mempoolStats.map((stats) => stats.vbytes_per_second)], + series: [mempoolStats.map((stats) => [stats.added * 1000, stats.vbytes_per_second])], }; } From 5e729373bbd384d890f3bb273da7c0986863063d Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 15:26:02 +0900 Subject: [PATCH 07/60] Use date interval so we leave mysql handle the number of days in a month etc --- backend/src/api/statistics.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index ee6052cdf..b6738b296 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -267,7 +267,7 @@ class Statistics { } } - private getQueryForDays(div: number, limit: number) { + private getQueryForDays(div: number, interval: string) { return `SELECT id, UNIX_TIMESTAMP(added) as added, unconfirmed_transactions, tx_per_second, vbytes_per_second, @@ -308,7 +308,11 @@ class Statistics { vsize_1400, vsize_1600, vsize_1800, - vsize_2000 FROM statistics GROUP BY UNIX_TIMESTAMP(added) DIV ${div} ORDER BY id DESC LIMIT ${limit}`; + vsize_2000 \ + FROM statistics \ + WHERE added BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() \ + GROUP BY UNIX_TIMESTAMP(added) DIV ${div} \ + ORDER BY id DESC;`; } public async $get(id: number): Promise { @@ -341,7 +345,7 @@ class Statistics { public async $list24H(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(300, 288); // 5m interval + const query = this.getQueryForDays(300, '1 DAY'); // 5m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -354,7 +358,8 @@ class Statistics { public async $list1W(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(1800, 336); // 30m interval + const query = this.getQueryForDays(1800, '1 WEEK'); // 30m interval + await connection.query({ sql: "SET time_zone = '+9:00';", timeout: this.queryTimeout }); const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -367,7 +372,7 @@ class Statistics { public async $list1M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(7200, 372); // 4h interval + const query = this.getQueryForDays(7200, '1 MONTH'); // 2h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -380,7 +385,7 @@ class Statistics { public async $list3M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(21600, 372); // 6h interval + const query = this.getQueryForDays(21600, '3 MONTH'); // 6h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -393,7 +398,7 @@ class Statistics { public async $list6M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(43200, 372); // 12h interval + const query = this.getQueryForDays(43200, '6 MONTH'); // 12h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -406,7 +411,7 @@ class Statistics { public async $list1Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(86400, 365); // 1d interval + const query = this.getQueryForDays(86400, '1 YEAR'); // 1d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -419,7 +424,7 @@ class Statistics { public async $list2Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(172800, 365); // 2d interval + const query = this.getQueryForDays(172800, "2 YEAR"); // 2d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -432,7 +437,7 @@ class Statistics { public async $list3Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(259200, 365); // 3d interval + const query = this.getQueryForDays(259200, "3 YEAR"); // 3d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); From 2b0d543ce742c4853b9b2c6e473d2ac3a8c7b986 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 15:26:14 +0900 Subject: [PATCH 08/60] Delete unused code --- frontend/src/app/dashboard/dashboard.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index a4c6e51c5..7cc6a2aec 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -254,7 +254,6 @@ export class DashboardComponent implements OnInit { ); }), map((mempoolStats) => { - const data = this.handleNewMempoolData(mempoolStats.concat([])); return { mempool: mempoolStats, weightPerSecond: this.handleNewMempoolData(mempoolStats.concat([])), From 9e8a741d9712c5efd8372f0340b05a48a52a601c Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 15:26:59 +0900 Subject: [PATCH 09/60] Apply proper datetime format according to choosen time scale and force 2h windowPreference in the dashboard --- .../incoming-transactions-graph.component.ts | 60 ++++++++++--------- .../mempool-graph/mempool-graph.component.ts | 35 +++++++++-- .../app/dashboard/dashboard.component.html | 2 + 3 files changed, 65 insertions(+), 32 deletions(-) diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts index b1c2399e1..cb441bac4 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts @@ -25,6 +25,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { @Input() top: number | string = '20'; @Input() left: number | string = '0'; @Input() template: ('widget' | 'advanced') = 'widget'; + @Input() windowPreferenceOverride: string; isLoading = true; mempoolStatsChartOption: EChartsOption = {}; @@ -46,7 +47,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { if (!this.data) { return; } - this.windowPreference = this.storageService.getValue('graphWindowPreference'); + this.windowPreference = this.windowPreferenceOverride ? this.windowPreferenceOverride : this.storageService.getValue('graphWindowPreference'); this.mountChart(); } @@ -102,14 +103,41 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { type: 'line', }, formatter: (params: any) => { + // Todo - Refactor + let axisValueLabel: string = ""; + switch (this.windowPreference) { + case "2h": + axisValueLabel = `${formatDate(params[0].axisValue, 'h:mm a', this.locale)}`; + break; + case "24h": + axisValueLabel = `${formatDate(params[0].axisValue, 'EEE HH:mm', this.locale)}` + break; + case "1w": + axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:mm', this.locale)}` + break; + case "1m": + case "3m": + case "6m": + axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:00', this.locale)}` + break; + case "1y": + case "2y": + case "3y": + axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d y', this.locale)}` + break; + default: + axisValueLabel = `${formatDate(params[0].axisValue, 'M/d', this.locale)}\n${formatDate(params[0].axisValue, 'H:mm', this.locale)}` + break; + } + const colorSpan = (color: string) => ``; - let itemFormatted = '
' + params[0].axisValue + '
'; + let itemFormatted = '
' + axisValueLabel + '
'; params.map((item: any, index: number) => { if (index < 26) { itemFormatted += `
${colorSpan(item.color)}
-
${item.value} vB/s
+
${item.value[1]} vB/s
`; } }); @@ -117,36 +145,12 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { } }, xAxis: { - type: 'category', + type: 'time', axisLabel: { align: 'center', fontSize: 11, lineHeight: 12 }, - data: this.data.labels.map((value: any) => { - switch (this.windowPreference) { - case "2h": - return `${formatDate(value, 'h:mm a', this.locale)}` - case "24h": - return `${formatDate(value, 'h a', this.locale)}` - case "1w": - return `${formatDate(value, 'EEE, MMM d', this.locale)}` - case "1m": - return `${formatDate(value, 'EEE, MMM d', this.locale)}` - case "3m": - return `${formatDate(value, 'MMM d', this.locale)}` - case "6m": - return `${formatDate(value, 'MMM d', this.locale)}` - case "1y": - return `${formatDate(value, 'MMM y', this.locale)}` - case "2y": - return `${formatDate(value, 'MMM y', this.locale)}` - case "3y": - return `${formatDate(value, 'MMM y', this.locale)}` - default: - return `${formatDate(value, 'M/d', this.locale)}\n${formatDate(value, 'H:mm', this.locale)}` - } - }), }, yAxis: { type: 'value', 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 77aa5f97f..fb02cd1f2 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit, Input, Inject, LOCALE_ID, ChangeDetectionStrategy, OnChanges } from '@angular/core'; -import { formatDate } from '@angular/common'; import { VbytesPipe } from 'src/app/shared/pipes/bytes-pipe/vbytes.pipe'; -import { formatNumber } from "@angular/common"; +import { formatDate, formatNumber } from "@angular/common"; import { OptimizedMempoolStats } from 'src/app/interfaces/node-api.interface'; import { StateService } from 'src/app/services/state.service'; @@ -32,6 +31,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { @Input() left: number | string = 75; @Input() template: ('widget' | 'advanced') = 'widget'; @Input() showZoom = true; + @Input() windowPreferenceOverride: string; isLoading = true; mempoolVsizeFeesData: any; @@ -62,7 +62,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { if (!this.data) { return; } - this.windowPreference = this.storageService.getValue('graphWindowPreference'); + this.windowPreference = this.windowPreferenceOverride ? this.windowPreferenceOverride : this.storageService.getValue('graphWindowPreference'); this.mempoolVsizeFeesData = this.handleNewMempoolData(this.data.concat([])); this.mountFeeChart(); } @@ -186,6 +186,33 @@ export class MempoolGraphComponent implements OnInit, OnChanges { type: 'line', }, formatter: (params: any) => { + // Todo - Refactor + let axisValueLabel: string = ""; + switch (this.windowPreference) { + case "2h": + axisValueLabel = `${formatDate(params[0].axisValue, 'h:mm a', this.locale)}`; + break; + case "24h": + axisValueLabel = `${formatDate(params[0].axisValue, 'EEE HH:mm', this.locale)}` + break; + case "1w": + axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:mm', this.locale)}` + break; + case "1m": + case "3m": + case "6m": + axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:00', this.locale)}` + break; + case "1y": + case "2y": + case "3y": + axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d y', this.locale)}` + break; + default: + axisValueLabel = `${formatDate(params[0].axisValue, 'M/d', this.locale)}\n${formatDate(params[0].axisValue, 'H:mm', this.locale)}` + break; + } + const { totalValue, totalValueArray } = this.getTotalValues(params); const itemFormatted = []; let totalParcial = 0; @@ -257,7 +284,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { const titleSum = $localize`Sum`; return `
- ${params[0].axisValueLabel} + ${axisValueLabel} ${this.vbytesPipe.transform(totalValue, 2, 'vB', 'MvB', false)} diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html index 530c365a0..36c018761 100644 --- a/frontend/src/app/dashboard/dashboard.component.html +++ b/frontend/src/app/dashboard/dashboard.component.html @@ -54,6 +54,7 @@ [limitFee]="150" [limitFilterFee]="1" [data]="mempoolStats.value?.mempool" + [windowPreferenceOverride]="'2h'" >
@@ -73,6 +74,7 @@
From 7e7dbdbaf26ee3f229ef0db06a66485f84bbe754 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 15:43:20 +0900 Subject: [PATCH 10/60] Remove test code --- backend/src/api/statistics.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index b6738b296..b917baec3 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -359,7 +359,6 @@ class Statistics { try { const connection = await DB.pool.getConnection(); const query = this.getQueryForDays(1800, '1 WEEK'); // 30m interval - await connection.query({ sql: "SET time_zone = '+9:00';", timeout: this.queryTimeout }); const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); From 11577842a275305b26a38e6d1b6901565f5859e1 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 17:10:55 +0900 Subject: [PATCH 11/60] Refactor tooltip formatting into common file and switch to native js localization --- .../incoming-transactions-graph.component.ts | 30 ++--------------- .../mempool-graph/mempool-graph.component.ts | 32 ++----------------- frontend/src/app/shared/graphs.utils.ts | 28 ++++++++++++++++ frontend/src/styles.scss | 2 +- 4 files changed, 34 insertions(+), 58 deletions(-) create mode 100644 frontend/src/app/shared/graphs.utils.ts diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts index cb441bac4..a618a2b07 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts @@ -1,8 +1,8 @@ import { Component, Input, Inject, LOCALE_ID, ChangeDetectionStrategy, OnInit } from '@angular/core'; -import { formatDate } from '@angular/common'; import { EChartsOption } from 'echarts'; import { OnChanges } from '@angular/core'; import { StorageService } from 'src/app/services/storage.service'; +import { formatterXAxis } from 'src/app/shared/graphs.utils'; @Component({ selector: 'app-incoming-transactions-graph', @@ -103,33 +103,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { type: 'line', }, formatter: (params: any) => { - // Todo - Refactor - let axisValueLabel: string = ""; - switch (this.windowPreference) { - case "2h": - axisValueLabel = `${formatDate(params[0].axisValue, 'h:mm a', this.locale)}`; - break; - case "24h": - axisValueLabel = `${formatDate(params[0].axisValue, 'EEE HH:mm', this.locale)}` - break; - case "1w": - axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:mm', this.locale)}` - break; - case "1m": - case "3m": - case "6m": - axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:00', this.locale)}` - break; - case "1y": - case "2y": - case "3y": - axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d y', this.locale)}` - break; - default: - axisValueLabel = `${formatDate(params[0].axisValue, 'M/d', this.locale)}\n${formatDate(params[0].axisValue, 'H:mm', this.locale)}` - break; - } - + const axisValueLabel: string = formatterXAxis(this.locale, this.windowPreference, params[0].axisValue); const colorSpan = (color: string) => ``; let itemFormatted = '
' + axisValueLabel + '
'; params.map((item: any, index: number) => { 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 fb02cd1f2..e6aec74c2 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -1,12 +1,12 @@ import { Component, OnInit, Input, Inject, LOCALE_ID, ChangeDetectionStrategy, OnChanges } from '@angular/core'; import { VbytesPipe } from 'src/app/shared/pipes/bytes-pipe/vbytes.pipe'; -import { formatDate, formatNumber } from "@angular/common"; - +import { formatNumber } from "@angular/common"; import { OptimizedMempoolStats } from 'src/app/interfaces/node-api.interface'; import { StateService } from 'src/app/services/state.service'; import { StorageService } from 'src/app/services/storage.service'; import { EChartsOption } from 'echarts'; import { feeLevels, chartColors } from 'src/app/app.constants'; +import { formatterXAxis } from 'src/app/shared/graphs.utils'; @Component({ selector: 'app-mempool-graph', @@ -186,33 +186,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { type: 'line', }, formatter: (params: any) => { - // Todo - Refactor - let axisValueLabel: string = ""; - switch (this.windowPreference) { - case "2h": - axisValueLabel = `${formatDate(params[0].axisValue, 'h:mm a', this.locale)}`; - break; - case "24h": - axisValueLabel = `${formatDate(params[0].axisValue, 'EEE HH:mm', this.locale)}` - break; - case "1w": - axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:mm', this.locale)}` - break; - case "1m": - case "3m": - case "6m": - axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d HH:00', this.locale)}` - break; - case "1y": - case "2y": - case "3y": - axisValueLabel = `${formatDate(params[0].axisValue, 'MMM d y', this.locale)}` - break; - default: - axisValueLabel = `${formatDate(params[0].axisValue, 'M/d', this.locale)}\n${formatDate(params[0].axisValue, 'H:mm', this.locale)}` - break; - } - + const axisValueLabel: string = formatterXAxis(this.locale, this.windowPreference, params[0].axisValue); const { totalValue, totalValueArray } = this.getTotalValues(params); const itemFormatted = []; let totalParcial = 0; diff --git a/frontend/src/app/shared/graphs.utils.ts b/frontend/src/app/shared/graphs.utils.ts new file mode 100644 index 000000000..9f5a5d79a --- /dev/null +++ b/frontend/src/app/shared/graphs.utils.ts @@ -0,0 +1,28 @@ +export const formatterXAxis = ( + locale: string, + windowPreference: string, + value: string +) => { + + if(value.length === 0){ + return null; + } + + const date = new Date(value); + switch (windowPreference) { + case '2h': + return date.toLocaleTimeString(locale, { hour: 'numeric', minute: 'numeric' }); + case '24h': + return date.toLocaleTimeString(locale, { weekday: 'short', hour: 'numeric', minute: 'numeric' }); + case '1w': + return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }); + case '1m': + case '3m': + case '6m': + return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric' }); + case '1y': + case '2y': + case '3y': + return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' }); + } +}; \ No newline at end of file diff --git a/frontend/src/styles.scss b/frontend/src/styles.scss index afc16ec52..e870f32e8 100644 --- a/frontend/src/styles.scss +++ b/frontend/src/styles.scss @@ -555,7 +555,7 @@ html:lang(ru) .card-title { } .tx-wrapper-tooltip-chart-advanced { - width: 115px; + width: 140px; .indicator-container { .indicator { margin-right: 5px; From 6e4985602eba2859ddc782a8ecee52867e5bd8dd Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 17:27:52 +0900 Subject: [PATCH 12/60] Increase the number of data to be as close as possible from prod while keeping rounded intervals --- backend/src/api/statistics.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index b917baec3..8ca0eba8f 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -345,7 +345,7 @@ class Statistics { public async $list24H(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(300, '1 DAY'); // 5m interval + const query = this.getQueryForDays(120, '1 DAY'); // 2m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -358,7 +358,7 @@ class Statistics { public async $list1W(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(1800, '1 WEEK'); // 30m interval + const query = this.getQueryForDays(1200, '1 WEEK'); // 20m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -371,7 +371,7 @@ class Statistics { public async $list1M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(7200, '1 MONTH'); // 2h interval + const query = this.getQueryForDays(3600, '1 MONTH'); // 1h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -384,7 +384,7 @@ class Statistics { public async $list3M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(21600, '3 MONTH'); // 6h interval + const query = this.getQueryForDays(14400, '3 MONTH'); // 4h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -397,7 +397,7 @@ class Statistics { public async $list6M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(43200, '6 MONTH'); // 12h interval + const query = this.getQueryForDays(28800, '6 MONTH'); // 8h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -410,7 +410,7 @@ class Statistics { public async $list1Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(86400, '1 YEAR'); // 1d interval + const query = this.getQueryForDays(54000, '1 YEAR'); // 15h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -423,7 +423,7 @@ class Statistics { public async $list2Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(172800, "2 YEAR"); // 2d interval + const query = this.getQueryForDays(86400, "2 YEAR"); // 1d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -436,7 +436,7 @@ class Statistics { public async $list3Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(259200, "3 YEAR"); // 3d interval + const query = this.getQueryForDays(172800, "3 YEAR"); // 2d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); From c9f5002dc2b659aaf1157e6026a39594093f3a8b Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sat, 11 Dec 2021 19:15:20 +0900 Subject: [PATCH 13/60] Use avg() mysql value for timespan between [24h, 6m] --- backend/src/api/statistics.ts | 59 ++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index 8ca0eba8f..fcd28d40e 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -267,6 +267,55 @@ class Statistics { } } + private getQueryForDaysAvg(div: number, interval: string) { + return `SELECT id, UNIX_TIMESTAMP(added) as added, + CAST(avg(unconfirmed_transactions) as FLOAT) as unconfirmed_transactions, + CAST(avg(tx_per_second) as FLOAT) as tx_per_second, + CAST(avg(vbytes_per_second) as FLOAT) as vbytes_per_second, + CAST(avg(vsize_1) as FLOAT) as vsize_1, + CAST(avg(vsize_2) as FLOAT) as vsize_2, + CAST(avg(vsize_3) as FLOAT) as vsize_3, + CAST(avg(vsize_4) as FLOAT) as vsize_4, + CAST(avg(vsize_5) as FLOAT) as vsize_5, + CAST(avg(vsize_6) as FLOAT) as vsize_6, + CAST(avg(vsize_8) as FLOAT) as vsize_8, + CAST(avg(vsize_10) as FLOAT) as vsize_10, + CAST(avg(vsize_12) as FLOAT) as vsize_12, + CAST(avg(vsize_15) as FLOAT) as vsize_15, + CAST(avg(vsize_20) as FLOAT) as vsize_20, + CAST(avg(vsize_30) as FLOAT) as vsize_30, + CAST(avg(vsize_40) as FLOAT) as vsize_40, + CAST(avg(vsize_50) as FLOAT) as vsize_50, + CAST(avg(vsize_60) as FLOAT) as vsize_60, + CAST(avg(vsize_70) as FLOAT) as vsize_70, + CAST(avg(vsize_80) as FLOAT) as vsize_80, + CAST(avg(vsize_90) as FLOAT) as vsize_90, + CAST(avg(vsize_100) as FLOAT) as vsize_100, + CAST(avg(vsize_125) as FLOAT) as vsize_125, + CAST(avg(vsize_150) as FLOAT) as vsize_150, + CAST(avg(vsize_175) as FLOAT) as vsize_175, + CAST(avg(vsize_200) as FLOAT) as vsize_200, + CAST(avg(vsize_250) as FLOAT) as vsize_250, + CAST(avg(vsize_300) as FLOAT) as vsize_300, + CAST(avg(vsize_350) as FLOAT) as vsize_350, + CAST(avg(vsize_400) as FLOAT) as vsize_400, + CAST(avg(vsize_500) as FLOAT) as vsize_500, + CAST(avg(vsize_600) as FLOAT) as vsize_600, + CAST(avg(vsize_700) as FLOAT) as vsize_700, + CAST(avg(vsize_800) as FLOAT) as vsize_800, + CAST(avg(vsize_900) as FLOAT) as vsize_900, + CAST(avg(vsize_1000) as FLOAT) as vsize_1000, + CAST(avg(vsize_1200) as FLOAT) as vsize_1200, + CAST(avg(vsize_1400) as FLOAT) as vsize_1400, + CAST(avg(vsize_1600) as FLOAT) as vsize_1600, + CAST(avg(vsize_1800) as FLOAT) as vsize_1800, + CAST(avg(vsize_2000) as FLOAT) as vsize_2000 \ + FROM statistics \ + WHERE added BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() \ + GROUP BY UNIX_TIMESTAMP(added) DIV ${div} \ + ORDER BY id DESC;`; + } + private getQueryForDays(div: number, interval: string) { return `SELECT id, UNIX_TIMESTAMP(added) as added, unconfirmed_transactions, tx_per_second, @@ -345,7 +394,7 @@ class Statistics { public async $list24H(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(120, '1 DAY'); // 2m interval + const query = this.getQueryForDaysAvg(120, '1 DAY'); // 2m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -358,7 +407,7 @@ class Statistics { public async $list1W(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(1200, '1 WEEK'); // 20m interval + const query = this.getQueryForDaysAvg(1200, '1 WEEK'); // 20m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -371,7 +420,7 @@ class Statistics { public async $list1M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(3600, '1 MONTH'); // 1h interval + const query = this.getQueryForDaysAvg(3600, '1 MONTH'); // 1h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -384,7 +433,7 @@ class Statistics { public async $list3M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(14400, '3 MONTH'); // 4h interval + const query = this.getQueryForDaysAvg(14400, '3 MONTH'); // 4h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -397,7 +446,7 @@ class Statistics { public async $list6M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(28800, '6 MONTH'); // 8h interval + const query = this.getQueryForDaysAvg(28800, '6 MONTH'); // 8h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); From dc5ced416dc7cf1950d03084f9da09177d413cef Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 12 Dec 2021 04:10:44 +0900 Subject: [PATCH 14/60] Add Blockstream as Enterprise Sponsor --- .../app/components/about/about.component.html | 4 ++ .../src/resources/profile/blockstream.svg | 43 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 frontend/src/resources/profile/blockstream.svg diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index 1728c93e9..32afde14f 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -54,6 +54,10 @@ Unchained + + + Blockstream + diff --git a/frontend/src/resources/profile/blockstream.svg b/frontend/src/resources/profile/blockstream.svg new file mode 100644 index 000000000..6dc32eab9 --- /dev/null +++ b/frontend/src/resources/profile/blockstream.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From aee319ed518f3673c5cf2e0a6f4f691ddec8a08a Mon Sep 17 00:00:00 2001 From: nymkappa Date: Mon, 13 Dec 2021 11:56:24 +0900 Subject: [PATCH 15/60] Initialize graphWindowPreference in localstorage properly --- frontend/src/app/services/storage.service.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/src/app/services/storage.service.ts b/frontend/src/app/services/storage.service.ts index c7595b404..7494784f6 100644 --- a/frontend/src/app/services/storage.service.ts +++ b/frontend/src/app/services/storage.service.ts @@ -1,9 +1,25 @@ import { Injectable } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; @Injectable({ providedIn: 'root' }) export class StorageService { + constructor(private router: Router, private route: ActivatedRoute) { + let graphWindowPreference: string = this.getValue('graphWindowPreference'); + if (graphWindowPreference === null) { // First visit to mempool.space + if (this.router.url.includes("graphs")) { + this.setValue('graphWindowPreference', this.route.snapshot.fragment ? this.route.snapshot.fragment : "2h"); + } else { + this.setValue('graphWindowPreference', "2h"); + } + } else if (this.router.url.includes("graphs")) { // Visit a different graphs#fragment from last visit + if (this.route.snapshot.fragment !== null && graphWindowPreference !== this.route.snapshot.fragment) { + this.setValue('graphWindowPreference', this.route.snapshot.fragment); + } + } + } + getValue(key: string): string { try { return localStorage.getItem(key); From cf0af20947fa6869e7839c745f8b403250eb1a75 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Mon, 13 Dec 2021 14:27:05 +0900 Subject: [PATCH 16/60] Hide xaxis label overlapping - Show current day/month/year below the chart for self better self containing overview --- .../incoming-transactions-graph.component.ts | 31 +++++++++++++------ .../mempool-graph/mempool-graph.component.ts | 12 +++++-- frontend/src/app/shared/graphs.utils.ts | 22 +++++++++++++ 3 files changed, 53 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts index a618a2b07..2f4404249 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts @@ -2,7 +2,7 @@ import { Component, Input, Inject, LOCALE_ID, ChangeDetectionStrategy, OnInit } import { EChartsOption } from 'echarts'; import { OnChanges } from '@angular/core'; import { StorageService } from 'src/app/services/storage.service'; -import { formatterXAxis } from 'src/app/shared/graphs.utils'; +import { formatterXAxis, formatterXAxisLabel } from 'src/app/shared/graphs.utils'; @Component({ selector: 'app-incoming-transactions-graph', @@ -78,6 +78,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { type: 'slider', brushSelect: false, realtime: true, + bottom: 0, selectedDataBackground: { lineStyle: { color: '#fff', @@ -86,7 +87,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { areaStyle: { opacity: 0, } - } + }, }], tooltip: { trigger: 'axis', @@ -118,14 +119,24 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { return `
${itemFormatted}
`; } }, - xAxis: { - type: 'time', - axisLabel: { - align: 'center', - fontSize: 11, - lineHeight: 12 - }, - }, + xAxis: [ + { + name: formatterXAxisLabel(this.locale, this.windowPreference), + nameLocation: 'middle', + nameTextStyle: { + padding: [20, 0, 0, 0], + }, + type: 'time', + axisLabel: { + margin: 20, + align: 'center', + fontSize: 11, + lineHeight: 12, + hideOverlap: true, + padding: [0, 5], + }, + } + ], yAxis: { type: 'value', axisLabel: { 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 e6aec74c2..75175c1a5 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -6,7 +6,7 @@ import { StateService } from 'src/app/services/state.service'; import { StorageService } from 'src/app/services/storage.service'; import { EChartsOption } from 'echarts'; import { feeLevels, chartColors } from 'src/app/app.constants'; -import { formatterXAxis } from 'src/app/shared/graphs.utils'; +import { formatterXAxis, formatterXAxisLabel } from 'src/app/shared/graphs.utils'; @Component({ selector: 'app-mempool-graph', @@ -113,7 +113,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { mountFeeChart() { this.orderLevels(); - const { labels, series } = this.mempoolVsizeFeesData; + const { series } = this.mempoolVsizeFeesData; const seriesGraph = []; const newColors = []; @@ -313,13 +313,21 @@ export class MempoolGraphComponent implements OnInit, OnChanges { }, xAxis: [ { + name: formatterXAxisLabel(this.locale, this.windowPreference), + nameLocation: 'middle', + nameTextStyle: { + padding: [20, 0, 0, 0], + }, type: 'time', boundaryGap: false, axisLine: { onZero: true }, axisLabel: { + margin: 20, align: 'center', fontSize: 11, lineHeight: 12, + hideOverlap: true, + padding: [0, 5], }, } ], diff --git a/frontend/src/app/shared/graphs.utils.ts b/frontend/src/app/shared/graphs.utils.ts index 9f5a5d79a..0380fa964 100644 --- a/frontend/src/app/shared/graphs.utils.ts +++ b/frontend/src/app/shared/graphs.utils.ts @@ -25,4 +25,26 @@ export const formatterXAxis = ( case '3y': return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' }); } +}; + +export const formatterXAxisLabel = ( + locale: string, + windowPreference: string, +) => { + const date = new Date(); + switch (windowPreference) { + case '2h': + case '24h': + return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' }); + case '1w': + return date.toLocaleDateString(locale, { year: 'numeric', month: 'long' }); + case '1m': + case '3m': + case '6m': + return date.toLocaleDateString(locale, { year: 'numeric' }); + case '1y': + case '2y': + case '3y': + return null; + } }; \ No newline at end of file From 92d745168c58ac626fd3b7cdda4ba742e6583c50 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Mon, 13 Dec 2021 14:31:34 +0900 Subject: [PATCH 17/60] Doubled the data points for 1W and 3Y to improve resolution --- backend/src/api/statistics.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index fcd28d40e..2613ca676 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -407,7 +407,7 @@ class Statistics { public async $list1W(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDaysAvg(1200, '1 WEEK'); // 20m interval + const query = this.getQueryForDaysAvg(600, '1 WEEK'); // 10m interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -485,7 +485,7 @@ class Statistics { public async $list3Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(172800, "3 YEAR"); // 2d interval + const query = this.getQueryForDays(86400, "3 YEAR"); // 1d interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); From 28d3f190ff23cf0a7a9f2c784f468e8ec48dfa3c Mon Sep 17 00:00:00 2001 From: nymkappa Date: Tue, 14 Dec 2021 16:33:17 +0900 Subject: [PATCH 18/60] Update graph tick intervals - Hide label in zoom component - Show hour on 1y graphs --- backend/src/api/statistics.ts | 4 ++-- .../incoming-transactions-graph.component.ts | 1 + .../app/components/mempool-graph/mempool-graph.component.ts | 1 + frontend/src/app/shared/graphs.utils.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index 2613ca676..d1784f937 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -446,7 +446,7 @@ class Statistics { public async $list6M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDaysAvg(28800, '6 MONTH'); // 8h interval + const query = this.getQueryForDaysAvg(21600, '6 MONTH'); // 6h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -459,7 +459,7 @@ class Statistics { public async $list1Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(54000, '1 YEAR'); // 15h interval + const query = this.getQueryForDays(43200, '1 YEAR'); // 12h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts index 2f4404249..4f982a269 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts @@ -74,6 +74,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { maxSpan: 100, minSpan: 10, }, { + showDetail: false, show: (this.template === 'advanced') ? true : false, type: 'slider', brushSelect: false, 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 75175c1a5..35dacbe26 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -289,6 +289,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { maxSpan: 100, minSpan: 10, }, { + showDetail: false, show: (this.template === 'advanced' && this.showZoom) ? true : false, type: 'slider', brushSelect: false, diff --git a/frontend/src/app/shared/graphs.utils.ts b/frontend/src/app/shared/graphs.utils.ts index 0380fa964..51f3b3f3f 100644 --- a/frontend/src/app/shared/graphs.utils.ts +++ b/frontend/src/app/shared/graphs.utils.ts @@ -19,8 +19,8 @@ export const formatterXAxis = ( case '1m': case '3m': case '6m': - return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric' }); case '1y': + return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric' }); case '2y': case '3y': return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' }); From f4b7bbc91cc98c544e4d2271b86d9a13162b0734 Mon Sep 17 00:00:00 2001 From: wiz Date: Tue, 14 Dec 2021 18:25:48 +0900 Subject: [PATCH 19/60] Tweak the graph x-axis label date formatting for better i18n --- frontend/src/app/shared/graphs.utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/shared/graphs.utils.ts b/frontend/src/app/shared/graphs.utils.ts index 51f3b3f3f..e0ffe841e 100644 --- a/frontend/src/app/shared/graphs.utils.ts +++ b/frontend/src/app/shared/graphs.utils.ts @@ -15,12 +15,11 @@ export const formatterXAxis = ( case '24h': return date.toLocaleTimeString(locale, { weekday: 'short', hour: 'numeric', minute: 'numeric' }); case '1w': - return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }); case '1m': case '3m': case '6m': case '1y': - return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric' }); + return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }); case '2y': case '3y': return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' }); @@ -47,4 +46,4 @@ export const formatterXAxisLabel = ( case '3y': return null; } -}; \ No newline at end of file +}; From b41e32915f2bda9e40986d2a5845c65912bce62b Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 15 Dec 2021 01:15:16 +0400 Subject: [PATCH 20/60] Fixing broken RBF alert fixes #516 --- .../transaction/transaction.component.html | 2 -- .../transaction/transaction.component.scss | 22 +++++-------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 1085f6335..818f7891b 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -20,8 +20,6 @@ - -
- +
diff --git a/frontend/src/app/components/transaction/transaction.component.scss b/frontend/src/app/components/transaction/transaction.component.scss index d7d9fb5df..c1ebd29a2 100644 --- a/frontend/src/app/components/transaction/transaction.component.scss +++ b/frontend/src/app/components/transaction/transaction.component.scss @@ -127,7 +127,6 @@ } } - .title { h2 { line-height: 1; @@ -137,7 +136,14 @@ } .btn-outline-info { - margin-top: -10px; + margin-top: 5px; + @media (min-width: 768px){ + margin-top: 0px; + } +} + +.details-button { + margin-top: -5px; @media (min-width: 768px){ display: inline-block; margin-top: 0px; From 4bc141cd67dfe47afb5d702ab256bb868d5fc390 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Tue, 14 Dec 2021 23:14:55 -0800 Subject: [PATCH 22/60] Add fixture for RBF transactions --- frontend/cypress/fixtures/mainnet_rbf.json | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 frontend/cypress/fixtures/mainnet_rbf.json diff --git a/frontend/cypress/fixtures/mainnet_rbf.json b/frontend/cypress/fixtures/mainnet_rbf.json new file mode 100644 index 000000000..50dbbb2df --- /dev/null +++ b/frontend/cypress/fixtures/mainnet_rbf.json @@ -0,0 +1,52 @@ +{ + "rbfTransaction": { + "txid": "8913ec7ba0ede285dbd120e46f6d61a28f2903c10814a6f6c4f97d0edf3e1f46", + "version": 2, + "locktime": 632699, + "vin": [ + { + "txid": "02238126a63ea2669c5f378012180ef8b54402a949316f9b2f1352c51730a086", + "vout": 0, + "prevout": { + "scriptpubkey": "a914f8e495456956c833e5e8c69b9a9dc041aa14c72f87", + "scriptpubkey_asm": "OP_HASH160 OP_PUSHBYTES_20 f8e495456956c833e5e8c69b9a9dc041aa14c72f OP_EQUAL", + "scriptpubkey_type": "p2sh", + "scriptpubkey_address": "3QP3LMD8veT5GtWV83Nosif2Bhr73857VB", + "value": 25000000 + }, + "scriptsig": "22002043288fbbc0fc5efa86c229dbb7d88ab78d57957c65b5d5ceaece70838976ad1b", + "scriptsig_asm": "OP_PUSHBYTES_34 002043288fbbc0fc5efa86c229dbb7d88ab78d57957c65b5d5ceaece70838976ad1b", + "witness": [ + "", + "3044022009e2d3a8e645f65bc89c8492cd9c08e6fb02609fd402214884a754a1970145340220575bb325429def59f3a3f1e22d9740a3feecbe97438ff3bb5796b2c46b3c477f01", + "3044022039c34372882da8fc1c1243bd72b5e7e5e6870301ef56bdebb87bc647fb50f9b5022071a704ee77d742f78b10e45be675d4c45a5f31e884139e75c975144fde70e41701", + "522102346eb7133f11e0dc279bc592d5ac948a91676372a6144c9ae2085625d7fbf70421021b9508a458f9d59be4eb8cc87ad582c3b494106fb1d4ec22801569be0700eb7b52ae" + ], + "is_coinbase": false, + "sequence": 4294967293, + "inner_redeemscript_asm": "OP_0 OP_PUSHBYTES_32 43288fbbc0fc5efa86c229dbb7d88ab78d57957c65b5d5ceaece70838976ad1b", + "inner_witnessscript_asm": "OP_PUSHNUM_2 OP_PUSHBYTES_33 02346eb7133f11e0dc279bc592d5ac948a91676372a6144c9ae2085625d7fbf704 OP_PUSHBYTES_33 021b9508a458f9d59be4eb8cc87ad582c3b494106fb1d4ec22801569be0700eb7b OP_PUSHNUM_2 OP_CHECKMULTISIG" + } + ], + "vout": [ + { + "scriptpubkey": "a914fd4e5e59dd5cf2dc48eaedf1a2a1650ca1ce9d7f87", + "scriptpubkey_asm": "OP_HASH160 OP_PUSHBYTES_20 fd4e5e59dd5cf2dc48eaedf1a2a1650ca1ce9d7f OP_EQUAL", + "scriptpubkey_type": "p2sh", + "scriptpubkey_address": "3QnNmDhZS7toHA7bhhbTPBdtpLJoeecq5c", + "value": 13986350 + }, + { + "scriptpubkey": "76a914edc93d0446deec1c2d514f3a490f050096e74e0e88ac", + "scriptpubkey_asm": "OP_DUP OP_HASH160 OP_PUSHBYTES_20 edc93d0446deec1c2d514f3a490f050096e74e0e OP_EQUALVERIFY OP_CHECKSIG", + "scriptpubkey_type": "p2pkh", + "scriptpubkey_address": "1NgJDkTUqJxxCAAZrrsC87kWag5kphrRtM", + "value": 11000000 + } + ], + "size": 372, + "weight": 828, + "fee": 1.5, + "status": { "confirmed": false } + } +} \ No newline at end of file From bc7bbf5fe5522eeb3aa8551b0c7f23927297687d Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Tue, 14 Dec 2021 23:15:33 -0800 Subject: [PATCH 23/60] Fix formatting --- frontend/cypress/support/websocket.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/cypress/support/websocket.ts b/frontend/cypress/support/websocket.ts index 03f4a54f1..6df66e56e 100644 --- a/frontend/cypress/support/websocket.ts +++ b/frontend/cypress/support/websocket.ts @@ -31,19 +31,19 @@ export const mockWebSocket = () => { cy.on('window:before:load', (win) => { const winWebSocket = win.WebSocket; cy.stub(win, 'WebSocket').callsFake((url) => { - console.log(url); + console.log(url); if ((new URL(url).pathname.indexOf('/sockjs-node/') !== 0)) { const { server, websocket } = createMock(url); win.mockServer = server; win.mockServer.on('connection', (socket) => { win.mockSocket = socket; - win.mockSocket.send('{"action":"init"}'); + win.mockSocket.send('{"action":"init"}'); }); - win.mockServer.on('message', (message) => { - console.log(message); - }); + win.mockServer.on('message', (message) => { + console.log(message); + }); return websocket; } else { @@ -89,4 +89,4 @@ export const dropWebSocket = (() => { win.mockServer.simulate("error"); }); return cy.wait(500); -}); \ No newline at end of file +}); From 0af5d733c4bdda47e4a527d9cbb4bd50e4f34be0 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Tue, 14 Dec 2021 23:16:13 -0800 Subject: [PATCH 24/60] Small refactor to support mocking RBF txs --- frontend/cypress/support/websocket.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/cypress/support/websocket.ts b/frontend/cypress/support/websocket.ts index 6df66e56e..4a411eeb2 100644 --- a/frontend/cypress/support/websocket.ts +++ b/frontend/cypress/support/websocket.ts @@ -68,7 +68,13 @@ export const emitMempoolInfo = ({ //TODO: Use network specific mocks case "signet": case "testnet": + case "mainnet": default: + break; + } + + switch (params.command) { + case "init": { win.mockSocket.send('{"action":"init"}'); win.mockSocket.send('{"action":"want","data":["blocks","stats","mempool-blocks","live-2h-chart"]}'); win.mockSocket.send('{"conversions":{"USD":32365.338815782445}}'); @@ -78,6 +84,16 @@ export const emitMempoolInfo = ({ cy.readFile('cypress/fixtures/mainnet_mempoolInfo.json', 'ascii').then((fixture) => { win.mockSocket.send(JSON.stringify(fixture)); }); + break; + } + case "rbfTransaction": { + cy.readFile('cypress/fixtures/mainnet_rbf.json', 'ascii').then((fixture) => { + win.mockSocket.send(JSON.stringify(fixture)); + }); + break; + } + default: + break; } }); cy.waitForSkeletonGone(); From 47103d85d3c3404260b9ce38fa04b53fcb707ae7 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Tue, 14 Dec 2021 23:19:10 -0800 Subject: [PATCH 25/60] Update mocked ws tests to use the new syntax --- frontend/cypress/integration/mainnet/mainnet.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/integration/mainnet/mainnet.spec.ts b/frontend/cypress/integration/mainnet/mainnet.spec.ts index 679ba59de..c64c825e1 100644 --- a/frontend/cypress/integration/mainnet/mainnet.spec.ts +++ b/frontend/cypress/integration/mainnet/mainnet.spec.ts @@ -56,7 +56,7 @@ describe('Mainnet', () => { cy.get('.badge', {timeout: 25000}).should('not.exist'); emitMempoolInfo({ 'params': { - loaded: true + command: 'init' } }); cy.get(':nth-child(1) > #bitcoin-block-0').should('not.exist'); @@ -283,7 +283,7 @@ describe('Mainnet', () => { emitMempoolInfo({ 'params': { - loaded: true + command: 'init' } }); From 96a2c8ab4e88948fad836dcac738a724d85a62d5 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Tue, 14 Dec 2021 23:21:40 -0800 Subject: [PATCH 26/60] Add methods to detect overlapping components --- .../integration/mainnet/mainnet.spec.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/frontend/cypress/integration/mainnet/mainnet.spec.ts b/frontend/cypress/integration/mainnet/mainnet.spec.ts index c64c825e1..825405ccc 100644 --- a/frontend/cypress/integration/mainnet/mainnet.spec.ts +++ b/frontend/cypress/integration/mainnet/mainnet.spec.ts @@ -2,6 +2,36 @@ import { emitMempoolInfo, dropWebSocket } from "../../support/websocket"; const baseModule = Cypress.env("BASE_MODULE"); + +//Credit: https://github.com/bahmutov/cypress-examples/blob/6cedb17f83a3bb03ded13cf1d6a3f0656ca2cdf5/docs/recipes/overlapping-elements.md + +/** + * Returns true if two DOM rectangles are overlapping + * @param {DOMRect} rect1 the bounding client rectangle of the first element + * @param {DOMRect} rect2 the bounding client rectangle of the second element + * @returns {boolean} +*/ +const areOverlapping = (rect1, rect2) => { + // if one rectangle is on the left side of the other + if (rect1.right < rect2.left || rect2.right < rect1.left) { + return false + } + + // if one rectangle is above the other + if (rect1.bottom < rect2.top || rect2.bottom < rect1.top) { + return false + } + + // the rectangles must overlap + return true +} + +/** + * Returns the bounding rectangle of the first DOM + * element in the given jQuery object. + */ +const getRectangle = ($el) => $el[0].getBoundingClientRect(); + describe('Mainnet', () => { beforeEach(() => { //cy.intercept('/sockjs-node/info*').as('socket'); From 7f045ae5b93ddb4e2a44e62c62122affd592b538 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Tue, 14 Dec 2021 23:21:59 -0800 Subject: [PATCH 27/60] Add tests to detect layout issues in RBF transactions --- .../integration/mainnet/mainnet.spec.ts | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/frontend/cypress/integration/mainnet/mainnet.spec.ts b/frontend/cypress/integration/mainnet/mainnet.spec.ts index 825405ccc..461f5c0a8 100644 --- a/frontend/cypress/integration/mainnet/mainnet.spec.ts +++ b/frontend/cypress/integration/mainnet/mainnet.spec.ts @@ -458,6 +458,78 @@ describe('Mainnet', () => { cy.get('.pagination-container ul.pagination').first().children().should('have.length', 7); }); }); + + describe('RBF transactions', () => { + it('shows RBF transactions properly (mobile)', () => { + cy.viewport('iphone-xr'); + cy.mockMempoolSocket(); + cy.visit('/tx/f81a08699b62b2070ad8fe0f2a076f8bea0386a2fdcd8124caee42cbc564a0d5'); + + cy.waitForSkeletonGone(); + + emitMempoolInfo({ + 'params': { + command: 'init' + } + }); + + cy.get('#mempool-block-0'); + + emitMempoolInfo({ + 'params': { + command: 'rbfTransaction' + } + }); + + cy.get('.alert-mempool').should('be.visible'); + cy.get('.alert-mempool').invoke('css', 'width').then((alertWidth) => { + cy.get('.container-xl > :nth-child(3)').invoke('css', 'width').should('equal', alertWidth); + }); + + cy.get('.btn-success').then(getRectangle).then((rectA) => { + cy.get('.alert-mempool').then(getRectangle).then((rectB) => { + expect(areOverlapping(rectA, rectB), 'Confirmations box and RBF alert are overlapping').to.be.false; + }); + }); + }); + + it('shows RBF transactions properly (desktop)', () => { + cy.viewport('macbook-16'); + cy.mockMempoolSocket(); + cy.visit('/tx/f81a08699b62b2070ad8fe0f2a076f8bea0386a2fdcd8124caee42cbc564a0d5'); + + cy.waitForSkeletonGone(); + + emitMempoolInfo({ + 'params': { + command: 'init' + } + }); + + cy.get('#mempool-block-0'); + + emitMempoolInfo({ + 'params': { + command: 'rbfTransaction' + } + }); + + cy.get('.alert-mempool').should('be.visible'); + + const alertLocator = '.alert-mempool'; + const tableLocator = '.container-xl > :nth-child(3)'; + + cy.get(tableLocator).invoke('css', 'width').then((firstWidth) => { + cy.get(alertLocator).invoke('css', 'width').should('equal', firstWidth); + }); + + cy.get('.btn-success').then(getRectangle).then((rectA) => { + cy.get('.alert-mempool').then(getRectangle).then((rectB) => { + expect(areOverlapping(rectA, rectB), 'Confirmations box and RBF alert are overlapping').to.be.false; + }); + }); + }); + }); } else { it.skip(`Tests cannot be run on the selected BASE_MODULE ${baseModule}`); } From 24d4b643e50996bc7ad326952ffd20c66bc9ebbb Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Wed, 15 Dec 2021 00:02:21 -0800 Subject: [PATCH 28/60] Add failing test for Liquid unconfidential address layout issue --- frontend/cypress/integration/liquid/liquid.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/cypress/integration/liquid/liquid.spec.ts b/frontend/cypress/integration/liquid/liquid.spec.ts index 0c9a71f85..89e579a50 100644 --- a/frontend/cypress/integration/liquid/liquid.spec.ts +++ b/frontend/cypress/integration/liquid/liquid.spec.ts @@ -62,6 +62,18 @@ describe('Liquid', () => { }); }); + it('renders unconfidential addresses correctly on mobile', () => { + cy.viewport('iphone-6'); + cy.visit(`${basePath}/address/ex1qqmmjdwrlg59c8q4l75sj6wedjx57tj5grt8pat`); + cy.waitForSkeletonGone(); + //TODO: Add proper IDs for these selectors + const firstRowSelector = '.container-xl > :nth-child(3) > div > :nth-child(1) > .table > tbody'; + const thirdRowSelector = '.container-xl > :nth-child(3) > div > :nth-child(3)'; + cy.get(firstRowSelector).invoke('css', 'width').then((firstRowWidth) => { + cy.get(thirdRowSelector).invoke('css', 'width').should('equal', firstRowWidth); + }); + }); + describe('peg in/peg out', () => { it('loads peg in addresses', () => { cy.visit(`${basePath}/tx/fe764f7bedfc2a37b29d9c8aef67d64a57d253a6b11c5a55555cfd5826483a58`); From 40f1949654a441f4467fed6b3827f6ca40644532 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Wed, 15 Dec 2021 13:17:37 -0500 Subject: [PATCH 29/60] Create skeleton layout for desktop docs nav This includes switching to a 2-column layout (1 for nav and 1 for content) and moving footer links to docs component so floats can be cleared properly. --- .../components/docs/api-docs.component.html | 1670 ++++++++--------- .../components/docs/api-docs.component.scss | 20 + .../app/components/docs/docs.component.html | 8 + .../app/components/docs/docs.component.scss | 4 + 4 files changed, 867 insertions(+), 835 deletions(-) diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index d683676b5..a09705b47 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -3,852 +3,860 @@
-

Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} API service.

+
+

Placeholder.

+
-
-

General

- +
- - - GET Difficulty Adjustment - - -
+

Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} API service.

+ +
+

General

+ + + + + GET Difficulty Adjustment + + +
+ +
+
Description
+
Returns details about difficulty adjustment.
+
+ +
+
+
+ +
+
+ +
+

Markets

+ + + + + GET Market Currencies + +
Description
-
Returns details about difficulty adjustment.
+
Provides list of available currencies for a given base currency.
- -
- - + + + - -
- -
-

Markets

- - - - - GET Market Currencies - - - -
-
Description
-
Provides list of available currencies for a given base currency.
-
- -
-
- - - - GET Market Depth - - - -
-
Description
-
Provides list of open offer prices for a single market.
-
- -
-
- - - - GET Market HLOC - - - -
-
Description
-
Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart.
-
- -
-
- - - - GET Markets - - - -
-
Description
-
Provides list of available markets.
-
- -
-
- - - - GET Market Offers - - - -
-
Description
-
Provides list of open offer details for a single market.
-
- -
-
- - - - GET Market Ticker - - - -
-
Description
-
Provides 24 hour price ticker for single market or all markets
-
- -
-
- - - - GET Market Trades - - - -
-
Description
-
Provides list of completed trades for a single market.
-
- -
-
- - - - GET Market Volumes - - - -
-
Description
-
Provides periodic volume data in terms of base currency for one or all markets.
-
- -
-
- -
-
- -
-

General

- - - - - GET Stats - - - -
-
Description
-
Returns statistics about all Bisq transactions.
-
- -
-
- -
-
- -
-

Addresses

- - - - - GET Address - - - -
-
Description
-
Returns details about an address. Available fields: address, chain_stats, and mempool_stats. {{ '{' }}chain,mempool{{ '}' }}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.
-
- -
-
- - - - GET Address Transactions - - - -
-
Description
-
Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below).
-
- -
-
- - - - GET Address Transactions Chain - - - -
-
Description
-
Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
-
- -
-
- - - - GET Address Transactions Mempool - - - -
-
Description
-
Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
-
- -
-
- - - - GET Address UTXO - - - -
-
Description
-
Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof.
-
- -
-
- -
-
- -
-

Assets

- - - - - GET Assets - - - -
-
Description
-
Returns information about a Liquid asset.
-
- -
-
- - - - GET Asset Transactions - - - -
-
Description
-
Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset.
-
- -
-
- - - - GET Asset Supply - - - -
-
Description
-
Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units.
-
- -
-
- -
-
- -
-

Blocks

- - - - - GET Block - - - -
-
Description
-
Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight, proof, and previousblockhash.
-
- -
-
- - - - GET Block Header - - - -
-
Description
-
Returns the hex-encoded block header.
-
- -
-
- - - - GET Block Height - - - -
-
Description
-
Returns the hash of the block currently at :height.
-
- -
-
- - - - GET Block Raw - - - -
-
Description
-
Returns the raw block representation in binary.
-
- -
-
- - - - GET Block Status - - -
Get Block Status
- -
-
Description
-
Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain).
-
- -
-
- - - - GET Block Tip Height - - - -
-
Description
-
Returns the height of the last block.
-
- -
-
- - - - GET Block Tip Hash - - - -
-
Description
-
Returns the hash of the last block.
-
- -
-
- - - - GET Block Transaction ID - - - -
-
Description
-
Returns the transaction at index :index within the specified block.
-
- -
-
- - - - GET Block Transaction IDs - - - -
-
Description
-
Returns a list of all txids in the block.
-
- -
-
- - - - GET Block Transactions - - - -
-
Description
-
Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status.
-
- -
-
- - - - GET Blocks - - - -
-
Description
-
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
-
- -
-
- - - - GET Blocks - - - -
-
Description
-
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
-
- -
-
- -
-
- -
-

Fees

- - - - - GET Mempool Blocks Fees - - - -
-
Description
-
Returns current mempool as projected blocks.
-
- -
-
- - - - GET Recommended Fees - - - -
-
Description
-
Returns our currently suggested fees for new transactions.
-
- -
-
- -
-
- -
-

Mempool

- - - - - GET Mempool - - - -
-
Description
-
Returns current mempool backlog statistics.
-
- -
-
- - - - GET Mempool Transactions IDs - - - -
-
Description
-
Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.
-
- -
-
- - - - GET Mempool Recent - - - -
-
Description
-
Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value.
-
- -
-
- -
-
- -
-

Transactions

- - - - - GET Children Pay for Parent - - - -
-
Description
-
Returns the ancestors and the best descendant fees for a transaction.
-
- -
-
- - - - GET Transaction - - - -
-
Description
-
Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
-
- -
-
- - - - GET Transaction Hex - - -
-
Endpoint
- GET {{ baseNetworkUrl }}/api/tx/:txid/hex + + + GET Market Depth + + + -
-
Description
-
Returns a transaction serialized as hex.
-
- -
-
+
+
Description
+
Provides list of open offer prices for a single market.
+
+ + + - - - GET Transaction Merkleblock Proof - - - -
-
Description
-
Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
-
- -
-
+ + + GET Market HLOC + + + +
+
Description
+
Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart.
+
+ +
+
- - - GET Transaction Merkle Proof - - - -
-
Description
-
Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.
-
- -
-
+ + + GET Markets + + + +
+
Description
+
Provides list of available markets.
+
+ +
+
- - - GET Transaction Outspend - - - -
-
Description
-
Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx).
-
- -
-
+ + + GET Market Offers + + + +
+
Description
+
Provides list of open offer details for a single market.
+
+ +
+
- - - GET Transaction Outspends - - - -
-
Description
-
Returns the spending status of all transaction outputs.
-
- -
-
+ + + GET Market Ticker + + + +
+
Description
+
Provides 24 hour price ticker for single market or all markets
+
+ +
+
- - - GET Transaction Raw - - - -
-
Description
-
Returns a transaction as binary data.
-
- -
-
+ + + GET Market Trades + + + +
+
Description
+
Provides list of completed trades for a single market.
+
+ +
+
- - - GET Transaction Status - - - -
-
Description
-
Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).
-
- -
-
+ + + GET Market Volumes + + + +
+
Description
+
Provides periodic volume data in terms of base currency for one or all markets.
+
+ +
+
- - - GET Transactions - - -
Get Mempool Txids
- -
-
Description
-
Returns :length of latest Bisq transactions, starting from :index.
-
- -
-
+ +
- - - POST Transaction - - -
-
Endpoint
-
POST /api/tx
-
-
-
Description
-
Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
-
- -
-
+
+

General

+ - + + + GET Stats + + + +
+
Description
+
Returns statistics about all Bisq transactions.
+
+ +
+
+ + +
+ +
+

Addresses

+ + + + + GET Address + + + +
+
Description
+
Returns details about an address. Available fields: address, chain_stats, and mempool_stats. {{ '{' }}chain,mempool{{ '}' }}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.
+
+ +
+
+ + + + GET Address Transactions + + + +
+
Description
+
Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below).
+
+ +
+
+ + + + GET Address Transactions Chain + + + +
+
Description
+
Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
+
+ +
+
+ + + + GET Address Transactions Mempool + + + +
+
Description
+
Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
+
+ +
+
+ + + + GET Address UTXO + + + +
+
Description
+
Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof.
+
+ +
+
+ +
+
+ +
+

Assets

+ + + + + GET Assets + + + +
+
Description
+
Returns information about a Liquid asset.
+
+ +
+
+ + + + GET Asset Transactions + + + +
+
Description
+
Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset.
+
+ +
+
+ + + + GET Asset Supply + + + +
+
Description
+
Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units.
+
+ +
+
+ +
+
+ +
+

Blocks

+ + + + + GET Block + + + +
+
Description
+
Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight, proof, and previousblockhash.
+
+ +
+
+ + + + GET Block Header + + + +
+
Description
+
Returns the hex-encoded block header.
+
+ +
+
+ + + + GET Block Height + + + +
+
Description
+
Returns the hash of the block currently at :height.
+
+ +
+
+ + + + GET Block Raw + + + +
+
Description
+
Returns the raw block representation in binary.
+
+ +
+
+ + + + GET Block Status + + +
Get Block Status
+ +
+
Description
+
Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain).
+
+ +
+
+ + + + GET Block Tip Height + + + +
+
Description
+
Returns the height of the last block.
+
+ +
+
+ + + + GET Block Tip Hash + + + +
+
Description
+
Returns the hash of the last block.
+
+ +
+
+ + + + GET Block Transaction ID + + + +
+
Description
+
Returns the transaction at index :index within the specified block.
+
+ +
+
+ + + + GET Block Transaction IDs + + + +
+
Description
+
Returns a list of all txids in the block.
+
+ +
+
+ + + + GET Block Transactions + + + +
+
Description
+
Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status.
+
+ +
+
+ + + + GET Blocks + + + +
+
Description
+
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
+
+ +
+
+ + + + GET Blocks + + + +
+
Description
+
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
+
+ +
+
+ +
+
+ +
+

Fees

+ + + + + GET Mempool Blocks Fees + + + +
+
Description
+
Returns current mempool as projected blocks.
+
+ +
+
+ + + + GET Recommended Fees + + + +
+
Description
+
Returns our currently suggested fees for new transactions.
+
+ +
+
+ +
+
+ +
+

Mempool

+ + + + + GET Mempool + + + +
+
Description
+
Returns current mempool backlog statistics.
+
+ +
+
+ + + + GET Mempool Transactions IDs + + + +
+
Description
+
Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.
+
+ +
+
+ + + + GET Mempool Recent + + + +
+
Description
+
Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value.
+
+ +
+
+ +
+
+ +
+

Transactions

+ + + + + GET Children Pay for Parent + + + +
+
Description
+
Returns the ancestors and the best descendant fees for a transaction.
+
+ +
+
+ + + + GET Transaction + + + +
+
Description
+
Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
+
+ +
+
+ + + + GET Transaction Hex + + + +
+
Description
+
Returns a transaction serialized as hex.
+
+ +
+
+ + + + GET Transaction Merkleblock Proof + + + +
+
Description
+
Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
+
+ +
+
+ + + + GET Transaction Merkle Proof + + + +
+
Description
+
Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.
+
+ +
+
+ + + + GET Transaction Outspend + + + +
+
Description
+
Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx).
+
+ +
+
+ + + + GET Transaction Outspends + + + +
+
Description
+
Returns the spending status of all transaction outputs.
+
+ +
+
+ + + + GET Transaction Raw + + + +
+
Description
+
Returns a transaction as binary data.
+
+ +
+
+ + + + GET Transaction Status + + + +
+
Description
+
Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).
+
+ +
+
+ + + + GET Transactions + + +
Get Mempool Txids
+ +
+
Description
+
Returns :length of latest Bisq transactions, starting from :index.
+
+ +
+
+ + + + POST Transaction + + +
+
Endpoint
+
POST /api/tx
+
+
+
Description
+
Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
+
+ +
+
+ +
+ +
@@ -868,13 +876,5 @@
-
- - - diff --git a/frontend/src/app/components/docs/api-docs.component.scss b/frontend/src/app/components/docs/api-docs.component.scss index e9d2cf52e..077bc3dc2 100644 --- a/frontend/src/app/components/docs/api-docs.component.scss +++ b/frontend/src/app/components/docs/api-docs.component.scss @@ -72,6 +72,26 @@ li.nav-item { padding: 15px; } +.doc-nav-desktop { + width: 25%; + float: left; +} + +.doc-content { + width: 75%; + float: right; +} + +@media (max-width: 992px){ + .doc-nav-desktop { + display: none; + } + + .doc-content { + width: 100%; + } +} + #restAPI .api-category { margin: 30px 0; } diff --git a/frontend/src/app/components/docs/docs.component.html b/frontend/src/app/components/docs/docs.component.html index f67ed8e32..8dc4a9e72 100644 --- a/frontend/src/app/components/docs/docs.component.html +++ b/frontend/src/app/components/docs/docs.component.html @@ -27,5 +27,13 @@
+
+ + + diff --git a/frontend/src/app/components/docs/docs.component.scss b/frontend/src/app/components/docs/docs.component.scss index 404782585..0f4b879eb 100644 --- a/frontend/src/app/components/docs/docs.component.scss +++ b/frontend/src/app/components/docs/docs.component.scss @@ -2,3 +2,7 @@ text-align: left; padding-top: 10px; } + +#footer { + clear: both; +} From 43a1af45091f293512b8f26ce32fb4539bb88bcd Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 15 Dec 2021 23:53:12 +0400 Subject: [PATCH 30/60] Revert "Remove dead code FeeDistributionGraphComponent" This reverts commit 37722fe165869777e87dc2c56e15d51881386d0d. --- frontend/src/app/app.module.ts | 2 + .../fee-distribution-graph.component.html | 9 ++ .../fee-distribution-graph.component.ts | 83 +++++++++++++++++++ .../mempool-block.component.html | 3 + 4 files changed, 97 insertions(+) create mode 100644 frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html create mode 100644 frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 21b00bb4b..0b7c072f6 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -32,6 +32,7 @@ import { BlockchainComponent } from './components/blockchain/blockchain.componen import { FooterComponent } from './components/footer/footer.component'; import { AudioService } from './services/audio.service'; import { MempoolBlockComponent } from './components/mempool-block/mempool-block.component'; +import { FeeDistributionGraphComponent } from './components/fee-distribution-graph/fee-distribution-graph.component'; import { IncomingTransactionsGraphComponent } from './components/incoming-transactions-graph/incoming-transactions-graph.component'; import { TimeSpanComponent } from './components/time-span/time-span.component'; import { SeoService } from './services/seo.service'; @@ -83,6 +84,7 @@ import { PushTransactionComponent } from './components/push-transaction/push-tra MempoolBlocksComponent, FooterComponent, MempoolBlockComponent, + FeeDistributionGraphComponent, IncomingTransactionsGraphComponent, MempoolGraphComponent, LbtcPegsGraphComponent, diff --git a/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html b/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html new file mode 100644 index 000000000..3465bde35 --- /dev/null +++ b/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.html @@ -0,0 +1,9 @@ +
+
+
+ + +
+
+
+
diff --git a/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts b/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts new file mode 100644 index 000000000..8c90036fd --- /dev/null +++ b/frontend/src/app/components/fee-distribution-graph/fee-distribution-graph.component.ts @@ -0,0 +1,83 @@ +import { OnChanges } from '@angular/core'; +import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; + +@Component({ + selector: 'app-fee-distribution-graph', + templateUrl: './fee-distribution-graph.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class FeeDistributionGraphComponent implements OnInit, OnChanges { + @Input() data: any; + @Input() height: number | string = 210; + @Input() top: number | string = 20; + @Input() right: number | string = 22; + @Input() left: number | string = 30; + + mempoolVsizeFeesOptions: any; + mempoolVsizeFeesInitOptions = { + renderer: 'svg' + }; + + constructor() { } + + ngOnInit() { + this.mountChart(); + } + + ngOnChanges() { + this.mountChart(); + } + + mountChart() { + this.mempoolVsizeFeesOptions = { + grid: { + height: '210', + right: '20', + top: '22', + left: '30', + }, + xAxis: { + type: 'category', + boundaryGap: false, + }, + yAxis: { + type: 'value', + splitLine: { + lineStyle: { + type: 'dotted', + color: '#ffffff66', + opacity: 0.25, + } + } + }, + series: [{ + data: this.data, + type: 'line', + label: { + show: true, + position: 'top', + color: '#ffffff', + textShadowBlur: 0, + formatter: (label: any) => { + return Math.floor(label.data); + }, + }, + smooth: true, + lineStyle: { + color: '#D81B60', + width: 4, + }, + itemStyle: { + color: '#b71c1c', + borderWidth: 10, + borderMiterLimit: 10, + opacity: 1, + }, + areaStyle: { + color: '#D81B60', + opacity: 1, + } + }] + }; + } +} diff --git a/frontend/src/app/components/mempool-block/mempool-block.component.html b/frontend/src/app/components/mempool-block/mempool-block.component.html index 48baa3c23..d59b3c477 100644 --- a/frontend/src/app/components/mempool-block/mempool-block.component.html +++ b/frontend/src/app/components/mempool-block/mempool-block.component.html @@ -40,6 +40,9 @@ +
+ +
From 7a19da560e6d782e7910b9ceeefb9e3d1b0f0e16 Mon Sep 17 00:00:00 2001 From: softsimon Date: Thu, 16 Dec 2021 04:49:24 +0400 Subject: [PATCH 31/60] UX: Fixing overflowing unconfidential Liquid address fixes #1013 --- frontend/src/app/components/address/address.component.html | 5 ++++- .../src/app/components/clipboard/clipboard.component.scss | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/address/address.component.html b/frontend/src/app/components/address/address.component.html index 9d02cf124..c61680ff4 100644 --- a/frontend/src/app/components/address/address.component.html +++ b/frontend/src/app/components/address/address.component.html @@ -21,7 +21,10 @@ Unconfidential - {{ addressInfo.unconfidential }} + + {{ addressInfo.unconfidential | shortenString : 14 }} + {{ addressInfo.unconfidential }} + diff --git a/frontend/src/app/components/clipboard/clipboard.component.scss b/frontend/src/app/components/clipboard/clipboard.component.scss index e69de29bb..9483fef52 100644 --- a/frontend/src/app/components/clipboard/clipboard.component.scss +++ b/frontend/src/app/components/clipboard/clipboard.component.scss @@ -0,0 +1,3 @@ +.btn-link { + padding: 0.25rem 0 0.1rem 0.5rem; +} From 815fb62e7dffdf7fe3ad2d9284de7059161d4160 Mon Sep 17 00:00:00 2001 From: softsimon Date: Thu, 16 Dec 2021 04:53:27 +0400 Subject: [PATCH 32/60] Correcting minor interface typing error --- backend/src/api/bitcoin/bitcoin-api.interface.ts | 2 +- frontend/src/app/interfaces/node-api.interface.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/api/bitcoin/bitcoin-api.interface.ts b/backend/src/api/bitcoin/bitcoin-api.interface.ts index ad603835a..e2b9158bb 100644 --- a/backend/src/api/bitcoin/bitcoin-api.interface.ts +++ b/backend/src/api/bitcoin/bitcoin-api.interface.ts @@ -108,7 +108,7 @@ export namespace IBitcoinApi { scriptPubKey: string; // (string) The hex-encoded scriptPubKey generated by the address isscript: boolean; // (boolean) If the key is a script iswitness: boolean; // (boolean) If the address is a witness - witness_version?: boolean; // (numeric, optional) The version number of the witness program + witness_version?: number; // (numeric, optional) The version number of the witness program witness_program: string; // (string, optional) The hex value of the witness program confidential_key?: string; // (string) Elements only unconfidential?: string; // (string) Elements only diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts index 2cdff2b99..04091b0ad 100644 --- a/frontend/src/app/interfaces/node-api.interface.ts +++ b/frontend/src/app/interfaces/node-api.interface.ts @@ -42,7 +42,7 @@ export interface AddressInformation { scriptPubKey: string; // (string) The hex-encoded scriptPubKey generated by the address isscript: boolean; // (boolean) If the key is a script iswitness: boolean; // (boolean) If the address is a witness - witness_version?: boolean; // (numeric, optional) The version number of the witness program + witness_version?: number; // (numeric, optional) The version number of the witness program witness_program: string; // (string, optional) The hex value of the witness program confidential_key?: string; // (string) Elements only unconfidential?: string; // (string) Elements only From 3ae46e6ba18790fe20b75dbcbf3f16d6e9fbc479 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Wed, 15 Dec 2021 21:31:00 -0500 Subject: [PATCH 33/60] Make desktop docs-nav sticky on scroll --- .../src/app/components/docs/api-docs.component.html | 4 ++-- .../src/app/components/docs/api-docs.component.scss | 9 +++++++++ .../src/app/components/docs/api-docs.component.ts | 11 +++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index a09705b47..6fe7110ae 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -3,8 +3,8 @@
-
-

Placeholder.

+
+ Placeholder.
diff --git a/frontend/src/app/components/docs/api-docs.component.scss b/frontend/src/app/components/docs/api-docs.component.scss index 077bc3dc2..8049ef9aa 100644 --- a/frontend/src/app/components/docs/api-docs.component.scss +++ b/frontend/src/app/components/docs/api-docs.component.scss @@ -74,9 +74,18 @@ li.nav-item { .doc-nav-desktop { width: 25%; +} + +.doc-nav-desktop.relative { float: left; } +.doc-nav-desktop.fixed { + float: unset; + position: fixed; + top: 20px; +} + .doc-content { width: 75%; float: right; diff --git a/frontend/src/app/components/docs/api-docs.component.ts b/frontend/src/app/components/docs/api-docs.component.ts index a38ded836..724ecdc3f 100644 --- a/frontend/src/app/components/docs/api-docs.component.ts +++ b/frontend/src/app/components/docs/api-docs.component.ts @@ -17,6 +17,7 @@ export class ApiDocsComponent implements OnInit { code: any; baseNetworkUrl = ''; @Input() restTabActivated: Boolean; + docsNavPosition = "relative"; constructor( private stateService: StateService, @@ -35,6 +36,16 @@ export class ApiDocsComponent implements OnInit { }) ); + //to toggle fixed menu for desktop navigation + let that = this; + window.addEventListener('scroll', function() { + if( window.pageYOffset > 182 ) { + that.docsNavPosition = "fixed"; + } else { + that.docsNavPosition = "relative"; + } + }); + if (document.location.port !== '') { this.hostname = `${this.hostname}:${document.location.port}`; } From 1a8fd23b05b44de8dc68c1273c5dec2c7c44b862 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Wed, 15 Dec 2021 22:55:29 -0500 Subject: [PATCH 34/60] Add links and styling to fixed desktop docs nav --- .../components/docs/api-docs.component.html | 66 ++++++++++++++++++- .../components/docs/api-docs.component.scss | 38 ++++++++++- 2 files changed, 101 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index 6fe7110ae..40aed1cd9 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -4,7 +4,71 @@
diff --git a/frontend/src/app/components/docs/api-docs.component.scss b/frontend/src/app/components/docs/api-docs.component.scss index 8049ef9aa..089e8d2cf 100644 --- a/frontend/src/app/components/docs/api-docs.component.scss +++ b/frontend/src/app/components/docs/api-docs.component.scss @@ -73,27 +73,61 @@ li.nav-item { } .doc-nav-desktop { - width: 25%; + width: 300px; } .doc-nav-desktop.relative { float: left; + overflow: hidden; } .doc-nav-desktop.fixed { float: unset; position: fixed; top: 20px; + overflow-y: auto; + height: calc(100vh - 50px); + scrollbar-color: #2d3348 #11131f; + scrollbar-width: thin; +} +::-webkit-scrollbar { + width: 3px; +} +::-webkit-scrollbar-track { + background: #11131f; +} +::-webkit-scrollbar-thumb { + background-color: #2d3348; + border-radius: 5px; + border: none; +} + +.doc-nav-desktop p { + color: #4a68b9; + font-weight: 700; + margin: 10px 0; + margin: 15px 0 10px 0; +} +.doc-nav-desktop p:first-child { + margin-top: 0 +} + +.doc-nav-desktop a { + color: #fff; + text-decoration: none; + display: block; + margin: 5px 0; } .doc-content { - width: 75%; + width: calc(100% - 330px); float: right; } @media (max-width: 992px){ .doc-nav-desktop { display: none; + height: auto; } .doc-content { From 010381aac460b8947cb048b163f27874c39e7733 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Thu, 16 Dec 2021 08:46:51 -0500 Subject: [PATCH 35/60] Convert accordions to plain html --- .../components/docs/api-docs.component.html | 1322 +++++++---------- 1 file changed, 564 insertions(+), 758 deletions(-) diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index 40aed1cd9..5f7d725e8 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -76,849 +76,655 @@

Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} API service.

-

General

- + +

General

- - - GET Difficulty Adjustment - - -
- -
-
Description
-
Returns details about difficulty adjustment.
-
- -
-
-
+
+ GET Difficulty Adjustment +
+ +
+
Description
+
Returns details about difficulty adjustment.
+
+ +
+
-
+

Markets

- - - - GET Market Currencies - - - -
-
Description
-
Provides list of available currencies for a given base currency.
-
- -
-
+
+ GET Market Currencies + +
+
Description
+
Provides list of available currencies for a given base currency.
+
+ +
- - - GET Market Depth - - - -
-
Description
-
Provides list of open offer prices for a single market.
-
- -
-
+
+ GET Market Depth + +
+
Description
+
Provides list of open offer prices for a single market.
+
+ +
- - - GET Market HLOC - - - -
-
Description
-
Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart.
-
- -
-
+
+ GET Market HLOC + +
+
Description
+
Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart.
+
+ +
- - - GET Markets - - - -
-
Description
-
Provides list of available markets.
-
- -
-
+
+ GET Markets + +
+
Description
+
Provides list of available markets.
+
+ +
- - - GET Market Offers - - - -
-
Description
-
Provides list of open offer details for a single market.
-
- -
-
+
+ GET Market Offers + +
+
Description
+
Provides list of open offer details for a single market.
+
+ +
- - - GET Market Ticker - - - -
-
Description
-
Provides 24 hour price ticker for single market or all markets
-
- -
-
+
+ GET Market Ticker + +
+
Description
+
Provides 24 hour price ticker for single market or all markets
+
+ +
- - - GET Market Trades - - - -
-
Description
-
Provides list of completed trades for a single market.
-
- -
-
+
+ GET Market Trades + +
+
Description
+
Provides list of completed trades for a single market.
+
+ +
- - - GET Market Volumes - - - -
-
Description
-
Provides periodic volume data in terms of base currency for one or all markets.
-
- -
-
+
+ GET Market Volumes + +
+
Description
+
Provides periodic volume data in terms of base currency for one or all markets.
+
+ +
-
-

General

- + +

General

- - - GET Stats - - - -
-
Description
-
Returns statistics about all Bisq transactions.
-
- -
-
+
+ GET Stats + +
+
Description
+
Returns statistics about all Bisq transactions.
+
+ +
-
+

Addresses

- - - - GET Address - - - -
-
Description
-
Returns details about an address. Available fields: address, chain_stats, and mempool_stats. {{ '{' }}chain,mempool{{ '}' }}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.
-
- -
-
+
+ GET Address + +
+
Description
+
Returns details about an address. Available fields: address, chain_stats, and mempool_stats. {{ '{' }}chain,mempool{{ '}' }}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.
+
+ +
- - - GET Address Transactions - - - -
-
Description
-
Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below).
-
- -
-
+
+ GET Address Transactions + +
+
Description
+
Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below).
+
+ +
- - - GET Address Transactions Chain - - - -
-
Description
-
Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
-
- -
-
+
+ GET Address Transactions Chain + +
+
Description
+
Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
+
+ +
- - - GET Address Transactions Mempool - - - -
-
Description
-
Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
-
- -
-
+
+ GET Address Transactions Mempool + +
+
Description
+
Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
+
+ +
- - - GET Address UTXO - - - -
-
Description
-
Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof.
-
- -
-
+
+ GET Address UTXO + +
+
Description
+
Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof.
+
+ +
-
+

Assets

- - - - GET Assets - - - -
-
Description
-
Returns information about a Liquid asset.
-
- -
-
+
+ GET Assets + +
+
Description
+
Returns information about a Liquid asset.
+
+ +
- - - GET Asset Transactions - - - -
-
Description
-
Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset.
-
- -
-
+
+ GET Asset Transactions + +
+
Description
+
Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset.
+
+ +
- - - GET Asset Supply - - - -
-
Description
-
Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units.
-
- -
-
+
+ GET Asset Supply + +
+
Description
+
Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units.
+
+ +
-
+

Blocks

- - - - GET Block - - - -
-
Description
-
Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight, proof, and previousblockhash.
-
- -
-
+
+ GET Block + +
+
Description
+
Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight, proof, and previousblockhash.
+
+ +
- - - GET Block Header - - - -
-
Description
-
Returns the hex-encoded block header.
-
- -
-
+
+ GET Block Header + +
+
Description
+
Returns the hex-encoded block header.
+
+ +
- - - GET Block Height - - - -
-
Description
-
Returns the hash of the block currently at :height.
-
- -
-
+
+ GET Block Height + +
+
Description
+
Returns the hash of the block currently at :height.
+
+ +
- - - GET Block Raw - - - -
-
Description
-
Returns the raw block representation in binary.
-
- -
-
+
+ GET Block Raw + +
+
Description
+
Returns the raw block representation in binary.
+
+ +
- - - GET Block Status - - -
Get Block Status
- -
-
Description
-
Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain).
-
- -
-
+
+ GET Block Status +
Get Block Status
+ +
+
Description
+
Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain).
+
+ +
- - - GET Block Tip Height - - - -
-
Description
-
Returns the height of the last block.
-
- -
-
+
+ GET Block Tip Height + +
+
Description
+
Returns the height of the last block.
+
+ +
- - - GET Block Tip Hash - - - -
-
Description
-
Returns the hash of the last block.
-
- -
-
+
+ GET Block Tip Hash + +
+
Description
+
Returns the hash of the last block.
+
+ +
- - - GET Block Transaction ID - - - -
-
Description
-
Returns the transaction at index :index within the specified block.
-
- -
-
+
+ GET Block Transaction ID + +
+
Description
+
Returns the transaction at index :index within the specified block.
+
+ +
- - - GET Block Transaction IDs - - - -
-
Description
-
Returns a list of all txids in the block.
-
- -
-
+
+ GET Block Transaction IDs + +
+
Description
+
Returns a list of all txids in the block.
+
+ +
- - - GET Block Transactions - - - -
-
Description
-
Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status.
-
- -
-
+
+ GET Block Transactions + +
+
Description
+
Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status.
+
+ +
- - - GET Blocks - - - -
-
Description
-
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
-
- -
-
+
+ GET Blocks + +
+
Description
+
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
+
+ +
- - - GET Blocks - - - -
-
Description
-
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
-
- -
-
+
+ GET Blocks + +
+
Description
+
Returns the 10 newest blocks starting at the tip or at :start_height if specified.
+
+ +
-
+

Fees

- - - - GET Mempool Blocks Fees - - - -
-
Description
-
Returns current mempool as projected blocks.
-
- -
-
+
+ GET Mempool Blocks Fees + +
+
Description
+
Returns current mempool as projected blocks.
+
+ +
- - - GET Recommended Fees - - - -
-
Description
-
Returns our currently suggested fees for new transactions.
-
- -
-
+
+ GET Recommended Fees + +
+
Description
+
Returns our currently suggested fees for new transactions.
+
+ +
-
+

Mempool

- - - - GET Mempool - - - -
-
Description
-
Returns current mempool backlog statistics.
-
- -
-
+
+ GET Mempool + +
+
Description
+
Returns current mempool backlog statistics.
+
+ +
- - - GET Mempool Transactions IDs - - - -
-
Description
-
Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.
-
- -
-
+
+ GET Mempool Transactions IDs + +
+
Description
+
Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.
+
+ +
- - - GET Mempool Recent - - - -
-
Description
-
Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value.
-
- -
-
+
+ GET Mempool Recent + +
+
Description
+
Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value.
+
+ +
-
+

Transactions

- - - - GET Children Pay for Parent - - - -
-
Description
-
Returns the ancestors and the best descendant fees for a transaction.
-
- -
-
+
+ GET Children Pay for Parent + +
+
Description
+
Returns the ancestors and the best descendant fees for a transaction.
+
+ +
- - - GET Transaction - - - -
-
Description
-
Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
-
- -
-
+
+ GET Transaction + +
+
Description
+
Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
+
+ +
- - - GET Transaction Hex - - - -
-
Description
-
Returns a transaction serialized as hex.
-
- -
-
+
+ GET Transaction Hex + +
+
Description
+
Returns a transaction serialized as hex.
+
+ +
- - - GET Transaction Merkleblock Proof - - - -
-
Description
-
Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
-
- -
-
+
+ GET Transaction Merkleblock Proof + +
+
Description
+
Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
+
+ +
- - - GET Transaction Merkle Proof - - - -
-
Description
-
Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.
-
- -
-
+
+ GET Transaction Merkle Proof + +
+
Description
+
Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.
+
+ +
- - - GET Transaction Outspend - - - -
-
Description
-
Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx).
-
- -
-
+
+ GET Transaction Outspend + +
+
Description
+
Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx).
+
+ +
- - - GET Transaction Outspends - - - -
-
Description
-
Returns the spending status of all transaction outputs.
-
- -
-
+
+ GET Transaction Outspends + +
+
Description
+
Returns the spending status of all transaction outputs.
+
+ +
- - - GET Transaction Raw - - - -
-
Description
-
Returns a transaction as binary data.
-
- -
-
+
+ GET Transaction Raw + +
+
Description
+
Returns a transaction as binary data.
+
+ +
- - - GET Transaction Status - - - -
-
Description
-
Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).
-
- -
-
+
+ GET Transaction Status + +
+
Description
+
Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).
+
+ +
- - - GET Transactions - - -
Get Mempool Txids
- -
-
Description
-
Returns :length of latest Bisq transactions, starting from :index.
-
- -
-
+
+ GET Transactions +
Get Mempool Txids
+ +
+
Description
+
Returns :length of latest Bisq transactions, starting from :index.
+
+ +
- - - POST Transaction - - -
-
Endpoint
-
POST /api/tx
-
-
-
Description
-
Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
-
- -
-
- -
+
+ POST Transaction +
+
Endpoint
+
POST /api/tx
+
+
+
Description
+
Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
+
+ +
From f8a54784d0e278d57965b4fef769a607e5c76ba8 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:28:57 -0500 Subject: [PATCH 36/60] Improve styling + switch section headings for tags --- .../components/docs/api-docs.component.html | 112 ++++++++---------- .../components/docs/api-docs.component.scss | 50 ++++++-- 2 files changed, 90 insertions(+), 72 deletions(-) diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index 5f7d725e8..9fc8feef2 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -76,11 +76,9 @@

Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} API service.

- -

General

- GET Difficulty Adjustment + GET Difficulty Adjustment General
Endpoint
@@ -97,11 +95,9 @@
- -

Markets

- GET Market Currencies + GET Market Currencies Markets
Endpoint
GET {{ baseNetworkUrl }}/api/currencies @@ -114,7 +110,7 @@
- GET Market Depth + GET Market Depth Markets
- GET Market HLOC + GET Market HLOC Markets
- GET Markets + GET Markets Markets
Endpoint
GET {{ baseNetworkUrl }}/api/markets @@ -153,7 +149,7 @@
- GET Market Offers + GET Market Offers Markets
- GET Market Ticker + GET Market Ticker Markets
- GET Market Trades + GET Market Trades Markets
- GET Market Volumes + GET Market Volumes Markets
- -

General

- GET Stats + GET Stats General
Endpoint
GET {{ baseNetworkUrl }}/api/stats @@ -226,11 +220,9 @@
- -

Addresses

- GET Address + GET Address Addresses
Endpoint
GET {{ baseNetworkUrl }}/api/address/:address @@ -243,7 +235,7 @@
- GET Address Transactions + GET Address Transactions Addresses
- GET Address Transactions Chain + GET Address Transactions Chain Addresses
- GET Address Transactions Mempool + GET Address Transactions Mempool Addresses
- GET Address UTXO + GET Address UTXO Addresses
- -

Assets

- GET Assets + GET Assets Assets
Endpoint
GET /liquid/api/asset/:asset_id @@ -314,7 +304,7 @@
- GET Asset Supply + GET Asset Supply Assets
Endpoint
GET /liquid/api/asset/:asset_id/supply[/decimal] @@ -341,11 +331,9 @@
- -

Blocks

- GET Block + GET Block Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/block/:hash @@ -358,7 +346,7 @@
- GET Block Header + GET Block Header Blocks
- GET Block Height + GET Block Height Blocks
- GET Block Status + GET Block Status Blocks
Get Block Status
Endpoint
@@ -410,7 +398,7 @@
- GET Block Tip Height + GET Block Tip Height Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/blocks/tip/height @@ -423,7 +411,7 @@
- GET Block Tip Hash + GET Block Tip Hash Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/blocks/tip/hash @@ -436,7 +424,7 @@
- GET Block Transaction ID + GET Block Transaction ID Blocks
- GET Block Transaction IDs + GET Block Transaction IDs Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/block/:hash/txids @@ -462,7 +450,7 @@
- GET Block Transactions + GET Block Transactions Blocks
- GET Blocks + GET Blocks Blocks
- GET Blocks + GET Blocks Blocks
- -

Fees

- GET Mempool Blocks Fees + GET Mempool Blocks Fees Fees
- GET Recommended Fees + GET Recommended Fees Fees
Endpoint
GET {{ baseNetworkUrl }}/api/v1/fees/recommended @@ -535,11 +521,9 @@
- -

Mempool

- GET Mempool + GET Mempool Fees
Endpoint
GET {{ baseNetworkUrl }}/api/mempool @@ -552,7 +536,7 @@
- GET Mempool Transactions IDs + GET Mempool Transactions IDs Fees
Endpoint
GET {{ baseNetworkUrl }}/api/mempool/txids @@ -565,7 +549,7 @@
- GET Mempool Recent + GET Mempool Recent Fees
Endpoint
GET {{ baseNetworkUrl }}/api/mempool/recent @@ -581,10 +565,8 @@
-

Transactions

-
- GET Children Pay for Parent + GET Children Pay for Parent Transactions
Endpoint
GET {{ baseNetworkUrl }}/api/v1/cpfp/:txid @@ -597,7 +579,7 @@
- GET Transaction + GET Transaction Transactions @@ -605,11 +587,11 @@
Description
Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
- +
- GET Transaction Hex + GET Transaction Hex Transactions
Endpoint
GET {{ baseNetworkUrl }}/api/tx/:txid/hex @@ -622,7 +604,7 @@
- GET Transaction Merkleblock Proof + GET Transaction Merkleblock Proof Transactions
- GET Transaction Merkle Proof + GET Transaction Merkle Proof Transactions
- GET Transaction Outspend + GET Transaction Outspend Transactions
- GET Transaction Outspends + GET Transaction Outspends Transactions
- GET Transaction Raw + GET Transaction Raw Transactions
Endpoint
GET {{ baseNetworkUrl }}/api/tx/:txid/raw @@ -687,7 +669,7 @@
- GET Transaction Status + GET Transaction Status Transactions
Endpoint
GET {{ baseNetworkUrl }}/api/tx/:txid/status @@ -700,7 +682,7 @@
- GET Transactions + GET Transactions Transactions
Get Mempool Txids
Endpoint
@@ -714,7 +696,7 @@
- POST Transaction + POST Transaction Transactions
Endpoint
POST /api/tx
diff --git a/frontend/src/app/components/docs/api-docs.component.scss b/frontend/src/app/components/docs/api-docs.component.scss index 089e8d2cf..98222e8f8 100644 --- a/frontend/src/app/components/docs/api-docs.component.scss +++ b/frontend/src/app/components/docs/api-docs.component.scss @@ -124,6 +124,37 @@ li.nav-item { float: right; } +.endpoint-container .section-header { + display: block; + background-color: #2d3348; + color: #1bd8f4; + padding: 1rem 1.3rem 1rem 1.3rem; + font-weight: bold; + border-radius: 0.25rem; + margin: 40px 0 20px 0; + font-size: 24px; + position: relative; +} +.endpoint-container .section-header:first-child { + margin-top: 20px; +} +.endpoint-container .section-header:hover { + text-decoration: none; +} + +.endpoint-container .section-header span { + color: #fff; + background-color: #653b9c; + font-size: 12px; + text-transform: uppercase; + font-weight: 400; + padding: 8px 10px; + letter-spacing: 1px; + border-radius: 0.25rem; + font-family: monospace; + float: right; +} + @media (max-width: 992px){ .doc-nav-desktop { display: none; @@ -133,12 +164,17 @@ li.nav-item { .doc-content { width: 100%; } + + .endpoint-container .section-header { + margin: 40px 0 70px 0; + } + + .endpoint-container .section-header span { + float: none; + position: absolute; + top: unset; + left: 0; + bottom: -50px; + } } -#restAPI .api-category { - margin: 30px 0; -} - -.api-category h4 { - margin-bottom: 15px; -} From 89fede9e4886dab24177ce8be434ddbad180faf1 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:37:50 -0500 Subject: [PATCH 37/60] Fix inconsistencies in api-docs markup --- .../components/docs/api-docs.component.html | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index 9fc8feef2..d51c4eea5 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -79,17 +79,15 @@
GET Difficulty Adjustment General -
- -
-
Description
-
Returns details about difficulty adjustment.
-
- + +
+
Description
+
Returns details about difficulty adjustment.
+
+
@@ -374,6 +372,7 @@
GET Block Raw Blocks
@@ -385,7 +384,6 @@
GET Block Status Blocks -
Get Block Status
Endpoint
GET {{ baseNetworkUrl }}/api/block/:hash/status @@ -581,6 +579,7 @@
GET Transaction Transactions
@@ -683,7 +682,6 @@
GET Transactions Transactions -
Get Mempool Txids
Endpoint
GET {{ baseNetworkUrl }}/api/txs/:index/:length From 5d8c97035114b6e19f8271824008c934f7eb8fe1 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Thu, 16 Dec 2021 11:30:03 -0500 Subject: [PATCH 38/60] Update anchor links and add on-page links --- .../components/docs/api-docs.component.html | 276 +++++++++--------- 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index d51c4eea5..f196b2fc1 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -6,68 +6,68 @@

General

- GET Difficulty Adjustment + GET Difficulty Adjustment

Markets

- GET Market Currencies - GET Market Depth - GET Market HLOC - GET Markets - GET Market Offers - GET Market Ticker - GET Market Trades - GET Market Volumes + GET Market Currencies + GET Market Depth + GET Market HLOC + GET Markets + GET Market Offers + GET Market Ticker + GET Market Trades + GET Market Volumes

General

- GET Stats + GET Stats

Addresses

- GET Address - GET Address Transactions - GET Address Transactions Chain - GET Address Transactions Mempool - GET Address UTXO + GET Address + GET Address Transactions + GET Address Transactions Chain + GET Address Transactions Mempool + GET Address UTXO

Assets

- GET Assets - GET Asset Transactions - GET Asset Supply + GET Assets + GET Asset Transactions + GET Asset Supply

Blocks

- GET Block - GET Block Header - GET Block Height - GET Block Raw - GET Block Status - GET Block Tip Height - GET Block Tip Hash - GET Block Transaction ID - GET Block Transaction IDs - GET Block Transactions - GET Blocks - GET Blocks + GET Block + GET Block Header + GET Block Height + GET Block Raw + GET Block Status + GET Block Tip Height + GET Block Tip Hash + GET Block Transaction ID + GET Block Transaction IDs + GET Block Transactions + GET Blocks + GET Blocks

Fees

- GET Mempool Blocks Fees - GET Recommended Fees + GET Mempool Blocks Fees + GET Recommended Fees

Mempool

- GET Mempool - GET Mempool Transaction IDs - GET Mempool Recent + GET Mempool + GET Mempool Transaction IDs + GET Mempool Recent

Transactions

- GET Children Pay for Parent - GET Transaction - GET Transaction Hex - GET Transaction Merkleblock Proof - GET Transaction Merkle Proof - GET Transaction Outspend - GET Transaction Outspends - GET Transaction Raw - GET Transaction Status - GET Transactions - POST Transaction + GET Children Pay for Parent + GET Transaction + GET Transaction Hex + GET Transaction Merkleblock Proof + GET Transaction Merkle Proof + GET Transaction Outspend + GET Transaction Outspends + GET Transaction Raw + GET Transaction Status + GET Transactions + POST Transaction
@@ -77,8 +77,8 @@
-
- GET Difficulty Adjustment General +
+ GET Difficulty Adjustment General
Endpoint
GET {{ baseNetworkUrl }}/api/v1/difficulty-adjustment @@ -94,8 +94,8 @@
-
- GET Market Currencies Markets +
+ GET Market Currencies Markets
Endpoint
GET {{ baseNetworkUrl }}/api/currencies @@ -107,8 +107,8 @@
-
- GET Market Depth Markets +
+ GET Market Depth Markets -
- GET Market HLOC Markets +
+ GET Market HLOC Markets -
- GET Markets Markets +
+ GET Markets Markets
Endpoint
GET {{ baseNetworkUrl }}/api/markets @@ -146,8 +146,8 @@
-
- GET Market Offers Markets +
+ GET Market Offers Markets -
- GET Market Ticker Markets +
+ GET Market Ticker Markets -
- GET Market Trades Markets +
+ GET Market Trades Markets -
- GET Market Volumes Markets +
+ GET Market Volumes Markets
Endpoint
GET {{ baseNetworkUrl }}/api/volumes?basecurrency=[:basecurrency] @@ -202,8 +202,8 @@
-
- GET Stats General +
+ GET Stats General
Endpoint
GET {{ baseNetworkUrl }}/api/stats @@ -219,8 +219,8 @@
-
- GET Address Addresses +
+ GET Address Addresses
Endpoint
GET {{ baseNetworkUrl }}/api/address/:address @@ -232,8 +232,8 @@
-
- GET Address Transactions Addresses +
+ GET Address Transactions Addresses -
- GET Address Transactions Chain Addresses +
+ GET Address Transactions Chain Addresses -
- GET Address Transactions Mempool Addresses +
+ GET Address Transactions Mempool Addresses -
- GET Address UTXO Addresses +
+ GET Address UTXO Addresses
Endpoint
GET {{ baseNetworkUrl }}/api/address/:address/utxo @@ -288,8 +288,8 @@
-
- GET Assets Assets +
+ GET Assets Assets
Endpoint
GET /liquid/api/asset/:asset_id @@ -301,8 +301,8 @@
-
- GET Asset Transactions Assets + -
- GET Asset Supply Assets +
+ GET Asset Supply Assets
Endpoint
GET /liquid/api/asset/:asset_id/supply[/decimal] @@ -330,8 +330,8 @@
-
- GET Block Blocks +
+ GET Block Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/block/:hash @@ -343,8 +343,8 @@
-
- GET Block Header Blocks +
+ GET Block Header Blocks -
- GET Block Height Blocks +
+ GET Block Height Blocks -
- GET Block Raw Blocks +
+ GET Block Raw Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/block/:hash/raw @@ -382,8 +382,8 @@
-
- GET Block Status Blocks +
+ GET Block Status Blocks -
- GET Block Tip Height Blocks +
+ GET Block Tip Height Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/blocks/tip/height @@ -408,8 +408,8 @@
-
- GET Block Tip Hash Blocks +
+ GET Block Tip Hash Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/blocks/tip/hash @@ -421,8 +421,8 @@
-
- GET Block Transaction ID Blocks +
+ GET Block Transaction ID Blocks -
- GET Block Transaction IDs Blocks +
+ GET Block Transaction IDs Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/block/:hash/txids @@ -447,8 +447,8 @@
-
- GET Block Transactions Blocks +
+ GET Block Transactions Blocks -
- GET Blocks Blocks +
+ GET Blocks Blocks -
- GET Blocks Blocks +
+ GET Blocks Blocks
Endpoint
GET {{ baseNetworkUrl }}/api/blocks/:index/:length @@ -490,8 +490,8 @@
-
- GET Mempool Blocks Fees Fees +
+ GET Mempool Blocks Fees Fees -
- GET Recommended Fees Fees +