From b1d76a8e3f99a38b7ebb597c9e292cdf959fbbab Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Sat, 3 Jan 2026 20:29:45 -0800 Subject: [PATCH] Fix a few lint errors --- frontend/cypress.config.ts | 2 +- frontend/cypress/e2e/liquid/liquid.spec.ts | 2 +- .../e2e/liquidtestnet/liquidtestnet.spec.ts | 4 +- frontend/cypress/e2e/mainnet/mainnet.spec.ts | 10 +- frontend/cypress/support/PageIdleDetector.ts | 16 +- frontend/cypress/support/commands.ts | 60 +- frontend/cypress/support/index.d.ts | 2 +- frontend/cypress/support/websocket.ts | 12 +- frontend/src/app/app-routing.module.ts | 2 +- frontend/src/app/app.constants.ts | 78 +- frontend/src/app/app.preloading-strategy.ts | 2 +- .../app/components/about/about.component.ts | 4 +- .../accelerate-checkout.component.ts | 8 +- .../accelerate-fee-graph.component.ts | 6 +- .../acceleration-timeline.component.ts | 2 +- .../acceleration-fees-graph.component.ts | 6 +- .../acceleration-stats.component.ts | 2 +- .../address-graph/address-graph.component.ts | 4 +- .../address-group/address-group.component.ts | 2 +- .../address-transactions-widget.component.ts | 2 +- .../addresses-treemap.component.ts | 2 +- .../src/app/components/app/app.component.ts | 2 +- .../assets/assets-nav/assets-nav.component.ts | 4 +- .../balance-widget.component.ts | 2 +- .../block-fee-rates-graph.component.ts | 2 +- .../block-fees-subsidy-graph.component.ts | 18 +- .../block-filters/block-filters.component.ts | 2 +- .../components/block-overview-graph/utils.ts | 4 +- .../block-overview-tooltip.component.ts | 2 +- .../blockchain-blocks.component.ts | 10 +- .../blockchain/blockchain.component.ts | 6 +- .../blocks-list/blocks-list.component.ts | 4 +- .../calculator/calculator.component.ts | 4 +- .../app/components/clock/clock.component.ts | 2 +- .../custom-dashboard.component.ts | 4 +- .../difficulty-tooltip.component.ts | 4 +- .../difficulty/difficulty.component.ts | 2 +- .../app/components/faucet/faucet.component.ts | 4 +- .../fee-distribution-graph.component.ts | 2 +- .../components/fees-box/fees-box.component.ts | 2 +- .../app/components/footer/footer.component.ts | 6 +- .../hashrate-chart.component.ts | 6 +- .../hashrate-chart-pools.component.ts | 4 +- .../incoming-transactions-graph.component.ts | 4 +- .../federation-addresses-stats.component.ts | 4 +- .../federation-utxos-list.component.ts | 8 +- .../reserves-ratio-stats.component.ts | 8 +- .../reserves-ratio.component.ts | 6 +- .../master-page/master-page.component.ts | 4 +- .../mempool-blocks.component.ts | 2 +- .../mempool-graph/mempool-graph.component.ts | 2 +- .../src/app/components/menu/menu.component.ts | 4 +- .../ngx-bootstrap-multiselect.component.ts | 2 +- .../off-click.directive.ts | 4 +- .../src/app/components/pool/pool.component.ts | 6 +- .../push-transaction.component.ts | 4 +- .../rbf-timeline/rbf-timeline.component.ts | 2 +- .../search-form/search-form.component.ts | 8 +- .../app/components/start/start.component.ts | 4 +- .../statistics/statistics.component.ts | 2 +- .../timezone-selector.component.ts | 2 +- .../tracker/tracker-bar.component.ts | 6 +- .../components/tracker/tracker.component.ts | 4 +- .../transaction/liquid-ublinding.ts | 2 +- .../transaction/transaction.component.ts | 14 +- .../transactions-list.component.ts | 8 +- .../treasuries-graph.component.ts | 10 +- .../twitter-widget.component.ts | 2 +- .../tx-bowtie-graph-tooltip.component.ts | 4 +- .../tx-bowtie-graph.component.ts | 2 +- .../src/app/dashboard/dashboard.component.ts | 20 +- .../src/app/docs/api-docs/api-docs-data.ts | 1886 ++++++++--------- .../app/docs/api-docs/api-docs.component.ts | 56 +- .../code-template/code-template.component.ts | 16 +- frontend/src/app/docs/docs/docs.component.ts | 10 +- .../src/app/interfaces/node-api.interface.ts | 22 +- .../src/app/interfaces/services.interface.ts | 2 +- .../lightning/channel/channel.component.ts | 2 +- .../closing-type/closing-type.component.ts | 2 +- .../channels-list/channels-list.component.ts | 2 +- .../app/lightning/group/group.component.ts | 2 +- .../app/lightning/lightning-api.service.ts | 2 +- .../src/app/lightning/node/liquidity-ad.ts | 2 +- .../lightning/node/node-preview.component.ts | 2 +- .../nodes-channels/node-channels.component.ts | 2 +- .../nodes-per-country.component.ts | 2 +- .../nodes-per-isp/nodes-per-isp.component.ts | 2 +- .../oldest-nodes/oldest-nodes.component.ts | 2 +- .../top-nodes-per-capacity.component.ts | 4 +- .../top-nodes-per-channels.component.ts | 10 +- .../app/liquid/liquid-master-page.module.ts | 2 +- frontend/src/app/master-page.module.ts | 2 +- frontend/src/app/services/api.service.ts | 6 +- frontend/src/app/services/assets.service.ts | 6 +- frontend/src/app/services/cache.service.ts | 4 +- frontend/src/app/services/eta.service.ts | 2 +- .../app/services/http-cache.interceptor.ts | 2 +- .../src/app/services/opengraph.service.ts | 12 +- frontend/src/app/services/ord-api.service.ts | 2 +- frontend/src/app/services/price.service.ts | 6 +- frontend/src/app/services/seo.service.ts | 12 +- .../src/app/services/services-api.service.ts | 4 +- frontend/src/app/services/state.service.ts | 4 +- frontend/src/app/shared/common.utils.ts | 20 +- .../shared/components/asm/asm.component.ts | 2 +- .../shared/components/btc/btc.component.ts | 4 +- .../geolocation/geolocation.component.ts | 2 +- .../global-footer/global-footer.component.ts | 2 +- .../mempool-error/mempool-error.component.ts | 2 +- .../components/toggle/toggle.component.ts | 2 +- frontend/src/app/shared/i18n/dates.ts | 4 +- .../src/app/shared/ord/inscription.utils.ts | 10 +- .../app/shared/pipes/bytes-pipe/bytes.pipe.ts | 2 +- .../pipes/fee-rounding/fee-rounding.pipe.ts | 6 +- .../app/shared/pipes/fiat-shortener.pipe.ts | 2 +- .../shared/pipes/math-ceil/math-ceil.pipe.ts | 2 +- .../pipes/relative-url/relative-url.pipe.ts | 2 +- frontend/src/app/shared/regex.utils.ts | 8 +- frontend/src/app/shared/script.utils.ts | 8 +- frontend/src/app/shared/sha256.ts | 6 +- frontend/src/app/shared/transaction.utils.ts | 46 +- 121 files changed, 1347 insertions(+), 1347 deletions(-) diff --git a/frontend/cypress.config.ts b/frontend/cypress.config.ts index 4bdbd257d..2e0507379 100644 --- a/frontend/cypress.config.ts +++ b/frontend/cypress.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ const fs = require('fs'); const CONFIG_FILE = 'mempool-frontend-config.json'; if (fs.existsSync(CONFIG_FILE)) { - let contents = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8')); + const contents = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8')); config.env.BASE_MODULE = contents.BASE_MODULE ? contents.BASE_MODULE : 'mempool'; } else { config.env.BASE_MODULE = 'mempool'; diff --git a/frontend/cypress/e2e/liquid/liquid.spec.ts b/frontend/cypress/e2e/liquid/liquid.spec.ts index 2da3c41f5..20f983844 100644 --- a/frontend/cypress/e2e/liquid/liquid.spec.ts +++ b/frontend/cypress/e2e/liquid/liquid.spec.ts @@ -58,7 +58,7 @@ describe('Liquid', () => { }); it('loads the graphs page - mobile', () => { - cy.visit(`${basePath}`) + cy.visit(`${basePath}`); cy.waitForSkeletonGone(); cy.get('#btn-graphs').click().then(() => { cy.viewport('iphone-6'); diff --git a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts index b5038f89b..aef6dc51d 100644 --- a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts +++ b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts @@ -40,7 +40,7 @@ describe('Liquid Testnet', () => { }); it('loads the blocks page', () => { - cy.visit(`${basePath}`) + cy.visit(`${basePath}`); cy.get('#btn-blocks'); cy.waitForSkeletonGone(); }); @@ -58,7 +58,7 @@ describe('Liquid Testnet', () => { }); it('loads the graphs page - mobile', () => { - cy.visit(`${basePath}`) + cy.visit(`${basePath}`); cy.waitForSkeletonGone(); cy.viewport('iphone-6'); cy.get('.tv-only').should('not.exist'); diff --git a/frontend/cypress/e2e/mainnet/mainnet.spec.ts b/frontend/cypress/e2e/mainnet/mainnet.spec.ts index a664f333c..a04803ca0 100644 --- a/frontend/cypress/e2e/mainnet/mainnet.spec.ts +++ b/frontend/cypress/e2e/mainnet/mainnet.spec.ts @@ -14,17 +14,17 @@ const baseModule = Cypress.env('BASE_MODULE'); 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 + return false; } // if one rectangle is above the other if (rect1.bottom < rect2.top || rect2.bottom < rect1.top) { - return false + return false; } // the rectangles must overlap - return true -} + return true; +}; /** * Returns the bounding rectangle of the first DOM @@ -134,7 +134,7 @@ describe('Mainnet', () => { cy.get('.search-box-container > .form-control').type('A').then(() => { cy.wait('@search-1wizSA'); - cy.get('app-search-results button.dropdown-item').should('have.length', 1) + cy.get('app-search-results button.dropdown-item').should('have.length', 1); }); cy.get('app-search-results button.dropdown-item.active').click().then(() => { diff --git a/frontend/cypress/support/PageIdleDetector.ts b/frontend/cypress/support/PageIdleDetector.ts index ba0cd222f..44a83a73a 100644 --- a/frontend/cypress/support/PageIdleDetector.ts +++ b/frontend/cypress/support/PageIdleDetector.ts @@ -1,6 +1,6 @@ // source: chrisp_68 @ https://stackoverflow.com/questions/50525143/how-do-you-reliably-wait-for-page-idle-in-cypress-io-test export class PageIdleDetector -{ +{ defaultOptions: object = { timeout: 60000 }; public WaitForPageToBeIdle(): void @@ -15,7 +15,7 @@ export class PageIdleDetector { cy.document(options).should((myDocument: any) => { - expect(myDocument.readyState, "WaitForPageToLoad").to.be.oneOf(["interactive", "complete"]); + expect(myDocument.readyState, 'WaitForPageToLoad').to.be.oneOf(['interactive', 'complete']); }); } @@ -23,9 +23,9 @@ export class PageIdleDetector { cy.window(options).should((myWindow: any) => { - if (!!myWindow.angular) + if (myWindow.angular) { - expect(this.NumberOfPendingAngularRequests(myWindow), "WaitForAngularRequestsToComplete").to.have.length(0); + expect(this.NumberOfPendingAngularRequests(myWindow), 'WaitForAngularRequestsToComplete').to.have.length(0); } }); } @@ -34,16 +34,16 @@ export class PageIdleDetector { cy.window(options).should((myWindow: any) => { - if (!!myWindow.angular) + if (myWindow.angular) { - expect(this.AngularRootScopePhase(myWindow), "WaitForAngularDigestCycleToComplete").to.be.null; + expect(this.AngularRootScopePhase(myWindow), 'WaitForAngularDigestCycleToComplete').to.be.null; } }); } public WaitForAnimationsToStop(options: object = this.defaultOptions): void { - cy.get(":animated", options).should("not.exist"); + cy.get(':animated', options).should('not.exist'); } private getInjector(myWindow: any) @@ -58,6 +58,6 @@ export class PageIdleDetector private AngularRootScopePhase(myWindow: any) { - return this.getInjector(myWindow).get("$rootScope").$$phase; + return this.getInjector(myWindow).get('$rootScope').$$phase; } } diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 2ce198241..99bc5c4d2 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -52,18 +52,18 @@ const codes = { ArrowUp: 38, ArrowRight: 39, ArrowDown: 40 -} +}; Cypress.Commands.add('waitForSkeletonGone', () => { cy.waitUntil(() => { return Cypress.$('.skeleton-loader').length === 0; - }, { verbose: true, description: "waitForSkeletonGone", errorMsg: "skeleton loaders never went away", timeout: 15000, interval: 50 }); + }, { verbose: true, description: 'waitForSkeletonGone', errorMsg: 'skeleton loaders never went away', timeout: 15000, interval: 50 }); }); Cypress.Commands.add( - "waitForPageIdle", + 'waitForPageIdle', () => { - console.warn("Waiting for page idle state"); + console.warn('Waiting for page idle state'); const pageIdleDetector = new PageIdleDetector(); pageIdleDetector.WaitForPageToBeIdle(); } @@ -77,7 +77,7 @@ Cypress.Commands.add('mockMempoolSocketV2', () => { mockWebSocketV2(); }); -Cypress.Commands.add('changeNetwork', (network: "testnet" | "testnet4" | "signet" | "liquid" | "mainnet") => { +Cypress.Commands.add('changeNetwork', (network: 'testnet' | 'testnet4' | 'signet' | 'liquid' | 'mainnet') => { cy.get('.dropdown-toggle').click().then(() => { cy.get(`a.${network}`).click().then(() => { cy.waitForPageIdle(); @@ -88,60 +88,60 @@ Cypress.Commands.add('changeNetwork', (network: "testnet" | "testnet4" | "signet // https://github.com/bahmutov/cypress-arrows/blob/8f0303842a343550fbeaf01528d01d1ff213b70c/src/index.js function keydownCommand($el, key) { - const message = `sending the "${key}" keydown event` + const message = `sending the "${key}" keydown event`; const log = Cypress.log({ name: `keydown: ${key}`, message: message, consoleProps: function () { return { Subject: $el - } + }; } - }) + }); - const e = $el.createEvent('KeyboardEvent') + const e = $el.createEvent('KeyboardEvent'); Object.defineProperty(e, 'key', { get: function () { - return key + return key; } - }) + }); Object.defineProperty(e, 'keyCode', { get: function () { - return this.keyCodeVal + return this.keyCodeVal; } - }) + }); Object.defineProperty(e, 'which', { get: function () { - return this.keyCodeVal + return this.keyCodeVal; } - }) - var metaKey = false + }); + const metaKey = false; Object.defineProperty(e, 'metaKey', { get: function () { - return metaKey + return metaKey; } - }) + }); Object.defineProperty(e, 'shiftKey', { get: function () { - return false + return false; } - }) - e.keyCodeVal = codes[key] + }); + e.keyCodeVal = codes[key]; e.initKeyboardEvent('keydown', true, true, - $el.defaultView, false, false, false, false, e.keyCodeVal, e.keyCodeVal) + $el.defaultView, false, false, false, false, e.keyCodeVal, e.keyCodeVal); - $el.dispatchEvent(e) - log.snapshot().end() - return $el + $el.dispatchEvent(e); + log.snapshot().end(); + return $el; } -Cypress.Commands.add('keydown', { prevSubject: "dom" }, keydownCommand) -Cypress.Commands.add('left', { prevSubject: "dom" }, $el => keydownCommand($el, 'ArrowLeft')) -Cypress.Commands.add('right', { prevSubject: "dom" }, $el => keydownCommand($el, 'ArrowRight')) -Cypress.Commands.add('up', { prevSubject: "dom" }, $el => keydownCommand($el, 'ArrowUp')) -Cypress.Commands.add('down', { prevSubject: "dom" }, $el => keydownCommand($el, 'ArrowDown')) +Cypress.Commands.add('keydown', { prevSubject: 'dom' }, keydownCommand); +Cypress.Commands.add('left', { prevSubject: 'dom' }, $el => keydownCommand($el, 'ArrowLeft')); +Cypress.Commands.add('right', { prevSubject: 'dom' }, $el => keydownCommand($el, 'ArrowRight')); +Cypress.Commands.add('up', { prevSubject: 'dom' }, $el => keydownCommand($el, 'ArrowUp')); +Cypress.Commands.add('down', { prevSubject: 'dom' }, $el => keydownCommand($el, 'ArrowDown')); diff --git a/frontend/cypress/support/index.d.ts b/frontend/cypress/support/index.d.ts index 21ffe6a2d..122ce5ed5 100644 --- a/frontend/cypress/support/index.d.ts +++ b/frontend/cypress/support/index.d.ts @@ -6,6 +6,6 @@ declare namespace Cypress { waitForPageIdle(): Chainable mockMempoolSocket(): Chainable mockMempoolSocketV2(): Chainable - changeNetwork(network: "testnet"|"testnet4"|"signet"|"liquid"|"mainnet"): Chainable + changeNetwork(network: 'testnet'|'testnet4'|'signet'|'liquid'|'mainnet'): Chainable } } \ No newline at end of file diff --git a/frontend/cypress/support/websocket.ts b/frontend/cypress/support/websocket.ts index b067cc6e8..7bdaff725 100644 --- a/frontend/cypress/support/websocket.ts +++ b/frontend/cypress/support/websocket.ts @@ -124,15 +124,15 @@ export const emitMempoolInfo = ({ //TODO: Refactor to take into account different parameterized mocking scenarios switch (params.network) { //TODO: Use network specific mocks - case "signet": - case "testnet": - case "mainnet": + case 'signet': + case 'testnet': + case 'mainnet': default: break; } switch (params.command) { - case "init": { + case 'init': { win.mockSocket.send('{"conversions":{"USD":32365.338815782445}}'); cy.readFile('cypress/fixtures/mainnet_live2hchart.json', 'utf-8').then((fixture) => { win.mockSocket.send(JSON.stringify(fixture)); @@ -142,7 +142,7 @@ export const emitMempoolInfo = ({ }); break; } - case "rbfTransaction": { + case 'rbfTransaction': { cy.readFile('cypress/fixtures/mainnet_rbf.json', 'utf-8').then((fixture) => { win.mockSocket.send(JSON.stringify(fixture)); }); @@ -164,7 +164,7 @@ export const emitMempoolInfo = ({ export const dropWebSocket = (() => { cy.window().then((win) => { - win.mockServer.simulate("error"); + win.mockServer.simulate('error'); }); return cy.wait(500); }); diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 5f69b55cf..8caba9582 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { AppPreloadingStrategy } from '@app/app.preloading-strategy' +import { AppPreloadingStrategy } from '@app/app.preloading-strategy'; import { BlockViewComponent } from '@components/block-view/block-view.component'; import { EightBlocksComponent } from '@components/eight-blocks/eight-blocks.component'; import { MempoolBlockViewComponent } from '@components/mempool-block-view/mempool-block-view.component'; diff --git a/frontend/src/app/app.constants.ts b/frontend/src/app/app.constants.ts index 2b6661fcc..730da5a81 100644 --- a/frontend/src/app/app.constants.ts +++ b/frontend/src/app/app.constants.ts @@ -83,45 +83,45 @@ export const contrastMempoolFeeColors = [ ]; export const chartColors = [ - "#A81524", - "#D81B60", - "#8E24AA", - "#5E35B1", - "#3949AB", - "#1E88E5", - "#039BE5", - "#00ACC1", - "#00897B", - "#43A047", - "#7CB342", - "#C0CA33", - "#FDD835", - "#FFB300", - "#FB8C00", - "#F4511E", - "#6D4C41", - "#757575", - "#546E7A", - "#b71c1c", - "#880E4F", - "#4A148C", - "#311B92", - "#1A237E", - "#0D47A1", - "#01579B", - "#006064", - "#004D40", - "#1B5E20", - "#33691E", - "#827717", - "#F57F17", - "#FF6F00", - "#E65100", - "#BF360C", - "#3E2723", - "#212121", - "#263238", - "#801313", + '#A81524', + '#D81B60', + '#8E24AA', + '#5E35B1', + '#3949AB', + '#1E88E5', + '#039BE5', + '#00ACC1', + '#00897B', + '#43A047', + '#7CB342', + '#C0CA33', + '#FDD835', + '#FFB300', + '#FB8C00', + '#F4511E', + '#6D4C41', + '#757575', + '#546E7A', + '#b71c1c', + '#880E4F', + '#4A148C', + '#311B92', + '#1A237E', + '#0D47A1', + '#01579B', + '#006064', + '#004D40', + '#1B5E20', + '#33691E', + '#827717', + '#F57F17', + '#FF6F00', + '#E65100', + '#BF360C', + '#3E2723', + '#212121', + '#263238', + '#801313', ]; export const originalChartColors = chartColors.slice(1); diff --git a/frontend/src/app/app.preloading-strategy.ts b/frontend/src/app/app.preloading-strategy.ts index f62d072da..dc8c56232 100644 --- a/frontend/src/app/app.preloading-strategy.ts +++ b/frontend/src/app/app.preloading-strategy.ts @@ -3,7 +3,7 @@ import { Observable, timer, mergeMap, of } from 'rxjs'; export class AppPreloadingStrategy implements PreloadingStrategy { preload(route: Route, load: Function): Observable { - return route.data && route.data.preload + return route.data && route.data.preload ? timer(1500).pipe(mergeMap(() => load())) : of(null); } diff --git a/frontend/src/app/components/about/about.component.ts b/frontend/src/app/components/about/about.component.ts index 01d496c04..8b5a21bd2 100644 --- a/frontend/src/app/components/about/about.component.ts +++ b/frontend/src/app/components/about/about.component.ts @@ -58,11 +58,11 @@ export class AboutComponent implements OnInit { if (scrollToSponsors && !profiles?.whales?.length && !profiles?.chads?.length) { return; } else { - this.goToAnchor(scrollToSponsors) + this.goToAnchor(scrollToSponsors); } }), share(), - ) + ); this.translators$ = this.apiService.getTranslators$() .pipe( diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 0240fe00c..1b9bdb14d 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -591,7 +591,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { if (this.processing) { return; } - + this.processing = true; if (this.googlePay) { @@ -709,7 +709,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { if (this.processing) { return; } - + this.processing = true; const costUSD = this.cost / 100_000_000 * this.conversions.USD; @@ -722,11 +722,11 @@ export class AccelerateCheckout implements OnInit, OnDestroy { return; } this.loadingCardOnFile = false; - + try { this.isCheckoutLocked += 2; this.isTokenizing += 2; - + const nameParts = cardOnFile.card.name.split(' '); const assumedGivenName = nameParts[0]; const assumedFamilyName = nameParts.length > 1 ? nameParts[1] : undefined; diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts index ebad9c1e4..e0d0d1a2b 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts @@ -93,8 +93,8 @@ export class AccelerateFeeGraphComponent implements OnInit, AfterViewInit, OnCha active: option.index === this.maxRateIndex, rateIndex: option.index, fee: option.fee, - }) - }) + }); + }); bars.reverse(); @@ -121,7 +121,7 @@ export class AccelerateFeeGraphComponent implements OnInit, AfterViewInit, OnCha return { height: `${height}px`, bottom: base ? `${base}px` : '0', - } + }; } onClick(event, bar): void { diff --git a/frontend/src/app/components/acceleration-timeline/acceleration-timeline.component.ts b/frontend/src/app/components/acceleration-timeline/acceleration-timeline.component.ts index 31f8706bc..139b37206 100644 --- a/frontend/src/app/components/acceleration-timeline/acceleration-timeline.component.ts +++ b/frontend/src/app/components/acceleration-timeline/acceleration-timeline.component.ts @@ -52,7 +52,7 @@ export class AccelerationTimelineComponent implements OnInit, OnChanges { this.firstSeenToAccelerated = Math.max(0, this.acceleratedAt - this.transactionTime); this.acceleratedToMined = Math.max(0, this.tx.status.block_time - this.acceleratedAt); } - + onHover(event, status: string): void { if (status === 'seen') { this.hoverInfo = { diff --git a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts index e8a1e3ee2..2ce1d2002 100644 --- a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts +++ b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts @@ -187,7 +187,7 @@ export class AccelerationFeesGraphComponent implements OnInit, OnChanges, OnDest } } else if (tick && tick.seriesName === 'Accelerated') { tooltip += `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.0-0')}
`; - } + } } tooltip += `` + $localize`Around block: ${ticks[0].data[2]}` + ``; @@ -287,7 +287,7 @@ export class AccelerationFeesGraphComponent implements OnInit, OnChanges, OnDest { name: 'Total bid boost', data: data.map(h => { - return [h.timestamp * 1000, h.sumBidBoost, h.avgHeight] + return [h.timestamp * 1000, h.sumBidBoost, h.avgHeight]; }), type: 'line', symbol: 'none', @@ -300,7 +300,7 @@ export class AccelerationFeesGraphComponent implements OnInit, OnChanges, OnDest name: 'Accelerated', yAxisIndex: 1, data: data.map(h => { - return [h.timestamp * 1000, h.count, h.avgHeight] + return [h.timestamp * 1000, h.count, h.avgHeight]; }), type: 'bar', barWidth: '90%', diff --git a/frontend/src/app/components/acceleration/acceleration-stats/acceleration-stats.component.ts b/frontend/src/app/components/acceleration/acceleration-stats/acceleration-stats.component.ts index f964fcc6b..c1a48ea20 100644 --- a/frontend/src/app/components/acceleration/acceleration-stats/acceleration-stats.component.ts +++ b/frontend/src/app/components/acceleration/acceleration-stats/acceleration-stats.component.ts @@ -44,7 +44,7 @@ export class AccelerationStatsComponent implements OnInit, OnChanges { break; case '1y': this.blocksInPeriod = 30.5 * 144 * 365; - break; + break; case 'all': this.blocksInPeriod = Infinity; break; diff --git a/frontend/src/app/components/address-graph/address-graph.component.ts b/frontend/src/app/components/address-graph/address-graph.component.ts index 0af7e2937..c117e8fc0 100644 --- a/frontend/src/app/components/address-graph/address-graph.component.ts +++ b/frontend/src/app/components/address-graph/address-graph.component.ts @@ -131,7 +131,7 @@ export class AddressGraphComponent implements OnChanges, OnDestroy { } }), map(() => [redraw, extendedSummary, conversions]) - ) + ); } else { return of([redraw, addressSummary, conversions]); } @@ -324,7 +324,7 @@ export class AddressGraphComponent implements OnChanges, OnDestroy { show: this.showYAxis, color: 'rgb(110, 112, 121)', formatter: (val): string => { - let valSpan = maxValue - (this.period === 'all' ? 0 : minValue); + const valSpan = maxValue - (this.period === 'all' ? 0 : minValue); if (valSpan > 100_000_000_000) { return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 0, undefined, true)} BTC`; } diff --git a/frontend/src/app/components/address-group/address-group.component.ts b/frontend/src/app/components/address-group/address-group.component.ts index c810ed339..13f42a056 100644 --- a/frontend/src/app/components/address-group/address-group.component.ts +++ b/frontend/src/app/components/address-group/address-group.component.ts @@ -63,7 +63,7 @@ export class AddressGroupComponent implements OnInit, OnDestroy { this.addresses = {}; this.addressInfo = {}; this.balance = 0; - + this.addressStrings = params.get('addresses').split(',').map(address => { if (/^[A-Z]{2,5}1[AC-HJ-NP-Z02-9]{8,100}|04[a-fA-F0-9]{128}|(02|03)[a-fA-F0-9]{64}$/.test(address)) { return address.toLowerCase(); diff --git a/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.ts b/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.ts index 01bcad565..5705a7a81 100644 --- a/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.ts +++ b/frontend/src/app/components/address-transactions-widget/address-transactions-widget.component.ts @@ -16,7 +16,7 @@ export class AddressTransactionsWidgetComponent implements OnInit, OnChanges, On @Input() addressInfo: Address; @Input() addressSummary$: Observable | null; @Input() isPubkey: boolean = false; - + currencySubscription: Subscription; currency: string; diff --git a/frontend/src/app/components/addresses-treemap/addresses-treemap.component.ts b/frontend/src/app/components/addresses-treemap/addresses-treemap.component.ts index ccc58e9c2..0ae1c9bcb 100644 --- a/frontend/src/app/components/addresses-treemap/addresses-treemap.component.ts +++ b/frontend/src/app/components/addresses-treemap/addresses-treemap.component.ts @@ -122,7 +122,7 @@ export class AddressesTreemap implements OnChanges { } } ] - }; + }; } formatValue(sats: number): string { diff --git a/frontend/src/app/components/app/app.component.ts b/frontend/src/app/components/app/app.component.ts index d0384b322..d6fd9a2b0 100644 --- a/frontend/src/app/components/app/app.component.ts +++ b/frontend/src/app/components/app/app.component.ts @@ -46,7 +46,7 @@ export class AppComponent implements OnInit { return; } // prevent arrow key horizontal scrolling - if(["ArrowLeft","ArrowRight"].indexOf(event.code) > -1) { + if(['ArrowLeft','ArrowRight'].indexOf(event.code) > -1) { event.preventDefault(); } this.stateService.keyNavigation$.next(event); diff --git a/frontend/src/app/components/assets/assets-nav/assets-nav.component.ts b/frontend/src/app/components/assets/assets-nav/assets-nav.component.ts index 90bcea9ad..bc5c40f3f 100644 --- a/frontend/src/app/components/assets/assets-nav/assets-nav.component.ts +++ b/frontend/src/app/components/assets/assets-nav/assets-nav.component.ts @@ -73,10 +73,10 @@ export class AssetsNavComponent implements OnInit { return assets.array.slice(0, this.itemsPerPage); } }) - ) + ); }), ); - } + }; itemSelected() { setTimeout(() => this.search()); diff --git a/frontend/src/app/components/balance-widget/balance-widget.component.ts b/frontend/src/app/components/balance-widget/balance-widget.component.ts index 82ebde8ee..c9ac28d59 100644 --- a/frontend/src/app/components/balance-widget/balance-widget.component.ts +++ b/frontend/src/app/components/balance-widget/balance-widget.component.ts @@ -31,7 +31,7 @@ export class BalanceWidgetComponent implements OnInit, OnChanges { ) { } ngOnInit(): void { - + } ngOnChanges(changes: SimpleChanges): void { diff --git a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts index 85dfb9b8a..8394ce608 100644 --- a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts +++ b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts @@ -165,7 +165,7 @@ export class BlockFeeRatesGraphComponent implements OnInit { } if (this.widget) { - let maResolution = 30; + const maResolution = 30; const medianMa = []; for (let i = maResolution - 1; i < seriesData['Median'].length; ++i) { let avg = 0; diff --git a/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts b/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts index 2c03f999e..ec3c98262 100644 --- a/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts +++ b/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts @@ -112,7 +112,7 @@ export class BlockFeesSubsidyGraphComponent implements OnInit { blockSubsidyFiat: response.body.filter(val => val['USD'] > 0).map(val => this.subsidyAt(val.avgHeight) / 100_000_000 * val['USD']), blockSubsidyPercent: response.body.map(val => this.subsidyAt(val.avgHeight) / (val.avgFees + this.subsidyAt(val.avgHeight)) * 100), }; - + this.prepareChartOptions(); this.isLoading = false; }), @@ -176,12 +176,12 @@ export class BlockFeesSubsidyGraphComponent implements OnInit { for (let i = data.length - 1; i >= 0; i--) { const tick = data[i]; tooltip += `${tick.marker} ${tick.seriesName.split(' ')[0]}: `; - if (this.displayMode === 'normal') tooltip += `${formatNumber(tick.data, this.locale, '1.0-3')} BTC
`; - else if (this.displayMode === 'fiat') tooltip += `${this.fiatCurrencyPipe.transform(tick.data, null, 'USD') }
`; - else tooltip += `${formatNumber(tick.data, this.locale, '1.0-2')}%
`; + if (this.displayMode === 'normal') {tooltip += `${formatNumber(tick.data, this.locale, '1.0-3')} BTC
`;} + else if (this.displayMode === 'fiat') {tooltip += `${this.fiatCurrencyPipe.transform(tick.data, null, 'USD') }
`;} + else {tooltip += `${formatNumber(tick.data, this.locale, '1.0-2')}%
`;} } - if (this.displayMode === 'normal') tooltip += `
${formatNumber(data.reduce((acc, val) => acc + val.data, 0), this.locale, '1.0-3')} BTC
`; - else if (this.displayMode === 'fiat') tooltip += `
${this.fiatCurrencyPipe.transform(data.reduce((acc, val) => acc + val.data, 0), null, 'USD')}
`; + if (this.displayMode === 'normal') {tooltip += `
${formatNumber(data.reduce((acc, val) => acc + val.data, 0), this.locale, '1.0-3')} BTC
`;} + else if (this.displayMode === 'fiat') {tooltip += `
${this.fiatCurrencyPipe.transform(data.reduce((acc, val) => acc + val.data, 0), null, 'USD')}
`;} if (['24h', '3d'].includes(this.zoomTimeSpan)) { tooltip += `` + $localize`At block ${'' + data[0].axisValue}` + ``; } else { @@ -410,7 +410,7 @@ export class BlockFeesSubsidyGraphComponent implements OnInit { mode = 'normal'; } - if (this.displayMode === mode) return; + if (this.displayMode === mode) {return;} const isActivation = params.selected[params.name]; @@ -486,7 +486,7 @@ export class BlockFeesSubsidyGraphComponent implements OnInit { tap((response) => { const startIndex = option.dataZoom[0].startValue; const endIndex = option.dataZoom[0].endValue; - + // Update series with more granular data const lengthBefore = this.data.timestamp.length; this.data.timestamp.splice(startIndex, endIndex - startIndex, ...response.body.map(val => val.timestamp * 1000)); @@ -537,7 +537,7 @@ export class BlockFeesSubsidyGraphComponent implements OnInit { } getTimeRangeFromTimespan(from: number, to: number): string { - const timespan = to - from; + const timespan = to - from; switch (true) { case timespan >= 3600 * 24 * 365 * 4: return 'all'; case timespan >= 3600 * 24 * 365 * 3: return '4y'; diff --git a/frontend/src/app/components/block-filters/block-filters.component.ts b/frontend/src/app/components/block-filters/block-filters.component.ts index 143ce4fd0..d71e01ab9 100644 --- a/frontend/src/app/components/block-filters/block-filters.component.ts +++ b/frontend/src/app/components/block-filters/block-filters.component.ts @@ -93,7 +93,7 @@ export class BlockFiltersComponent implements OnInit, OnChanges, OnDestroy { this.onFilterChanged.emit({ mode: this.filterMode, filters: this.activeFilters, gradient: this.gradientMode }); this.stateService.activeGoggles$.next({ mode: this.filterMode, filters: [...this.activeFilters], gradient: this.gradientMode }); } - + getBooleanFlags(): bigint | null { let flags = 0n; for (const key of Object.keys(this.filterFlags)) { diff --git a/frontend/src/app/components/block-overview-graph/utils.ts b/frontend/src/app/components/block-overview-graph/utils.ts index 47677c4f1..05fb9931f 100644 --- a/frontend/src/app/components/block-overview-graph/utils.ts +++ b/frontend/src/app/components/block-overview-graph/utils.ts @@ -67,7 +67,7 @@ const defaultColors: { [key: string]: ColorPalette } = { marginal: [], baseLevel: (tx: TxView, rate: number) => feeLevels.findIndex((feeLvl) => Math.max(0, rate) < feeLvl) - 1 }, -} +}; for (const key in defaultColors) { const base = defaultColors[key].base; defaultColors[key].audit = base.map((color) => darken(desaturate(color, 0.3), 0.9)); @@ -98,7 +98,7 @@ const contrastColors: { [key: string]: ColorPalette } = { marginal: [], baseLevel: (tx: TxView, rate: number) => feeLevels.findIndex((feeLvl) => Math.max(0, rate) < feeLvl) - 1 }, -} +}; for (const key in contrastColors) { const base = contrastColors[key].base; contrastColors[key].audit = base.map((color) => darken(desaturate(color, 0.3), 0.9)); diff --git a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts index e76d6be97..08f7bc7d8 100644 --- a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts +++ b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts @@ -72,7 +72,7 @@ export class BlockOverviewTooltipComponent implements OnChanges { this.hasEffectiveRate = this.tx.acc || !(Math.abs((this.fee / this.vsize) - this.effectiveRate) <= 0.1 && Math.abs((this.fee / Math.ceil(this.vsize)) - this.effectiveRate) <= 0.1) || (txFlags && (txFlags & (TransactionFlags.cpfp_child | TransactionFlags.cpfp_parent)) > 0n); this.filters = this.tx.flags ? toFilters(txFlags).filter(f => f.tooltip) : []; - this.activeFilters = {} + this.activeFilters = {}; for (const filter of this.filters) { if (this.filterFlags && (this.filterFlags & BigInt(filter.flag))) { this.activeFilters[filter.key] = true; diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts index be63af042..e6b75d408 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts @@ -30,7 +30,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy { @Input() spotlight: number = 0; @Input() showPools: boolean = true; @Input() getHref?: (index, block) => string = (index, block) => `/block/${block.id}`; - + specialBlocks = specialBlocks; network = ''; blocks: BlockchainBlock[] = []; @@ -174,7 +174,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy { } else { this.moveArrowToPosition(true, false); } - }) + }); } else { this.blockPageSubscription = this.cacheService.loadedBlocks$.subscribe((block) => { if (block.height <= this.height && block.height > this.height - this.count) { @@ -363,7 +363,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy { convertStyleForLoadingBlock(style) { return { ...style, - background: "var(--secondary)", + background: 'var(--secondary)', }; } @@ -372,7 +372,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy { return { left: addLeft + (this.blockOffset * index) + 'px', - background: "var(--secondary)", + background: 'var(--secondary)', }; } @@ -388,7 +388,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy { return { left: addLeft + this.blockOffset * this.emptyBlocks.indexOf(block) + 'px', - background: "var(--secondary)", + background: 'var(--secondary)', }; } diff --git a/frontend/src/app/components/blockchain/blockchain.component.ts b/frontend/src/app/components/blockchain/blockchain.component.ts index 757bfee7f..8ac128844 100644 --- a/frontend/src/app/components/blockchain/blockchain.component.ts +++ b/frontend/src/app/components/blockchain/blockchain.component.ts @@ -33,7 +33,7 @@ export class BlockchainComponent implements OnInit, OnDestroy, OnChanges { dividerOffset: number | null = null; mempoolOffset: number | null = null; positionStyle = { - transform: "translateX(1280px)", + transform: 'translateX(1280px)', }; blockDisplayToggleStyle = {}; @@ -91,8 +91,8 @@ export class BlockchainComponent implements OnInit, OnDestroy, OnChanges { } toggleBlockDisplayMode(): void { - if (this.blockDisplayMode === 'size') this.blockDisplayMode = 'fees'; - else this.blockDisplayMode = 'size'; + if (this.blockDisplayMode === 'size') {this.blockDisplayMode = 'fees';} + else {this.blockDisplayMode = 'size';} this.StorageService.setValue('block-display-mode-preference', this.blockDisplayMode); this.stateService.blockDisplayMode$.next(this.blockDisplayMode); } diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.ts b/frontend/src/app/components/blocks-list/blocks-list.component.ts index 43469d179..be9660081 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.ts +++ b/frontend/src/app/components/blocks-list/blocks-list.component.ts @@ -67,7 +67,7 @@ export class BlocksList implements OnInit { if (!this.widget) { this.websocketService.want(['blocks']); - + this.seoService.setTitle($localize`:@@8a7b4bd44c0ac71b2e72de0398b303257f7d2f54:Blocks`); this.ogService.setManualOgImage('recent-blocks.jpg'); if( this.stateService.network==='liquid'||this.stateService.network==='liquidtestnet' ) { @@ -110,7 +110,7 @@ export class BlocksList implements OnInit { this.skeletonLines = this.widget === true ? [...Array(6).keys()] : [...Array(15).keys()]; this.paginationMaxSize = window.matchMedia('(max-width: 670px)').matches ? 3 : 5; - + this.blocks$ = combineLatest([ this.fromHeightSubject.pipe( filter(fromBlockHeight => fromBlockHeight !== this.lastBlockHeightFetched), diff --git a/frontend/src/app/components/calculator/calculator.component.ts b/frontend/src/app/components/calculator/calculator.component.ts index 1beadeed5..94732f86e 100644 --- a/frontend/src/app/components/calculator/calculator.component.ts +++ b/frontend/src/app/components/calculator/calculator.component.ts @@ -41,7 +41,7 @@ export class CalculatorComponent implements OnInit { let currency; this.price$ = this.currency$.pipe( switchMap((result) => { - currency = result; + currency = result; return this.stateService.conversions$.asObservable(); }), map((conversions) => { @@ -124,7 +124,7 @@ export class CalculatorComponent implements OnInit { countDecimals(numberString: string): number { const decimalPos = numberString.indexOf('.'); - if (decimalPos === -1) return 0; + if (decimalPos === -1) {return 0;} return numberString.length - decimalPos - 1; } diff --git a/frontend/src/app/components/clock/clock.component.ts b/frontend/src/app/components/clock/clock.component.ts index 8b7db9f5f..592e5bd64 100644 --- a/frontend/src/app/components/clock/clock.component.ts +++ b/frontend/src/app/components/clock/clock.component.ts @@ -108,7 +108,7 @@ export class ClockComponent implements OnInit { )`, }; } - + @HostListener('window:resize', ['$event']) resizeCanvas(): void { const windowWidth = this.limitWidth || window.innerWidth || 800; diff --git a/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts b/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts index ba955c21c..587763a59 100644 --- a/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts +++ b/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts @@ -286,7 +286,7 @@ export class CustomDashboardComponent implements OnInit, OnDestroy, AfterViewIni getArrayFromNumber(num: number): number[] { return Array.from({ length: num }, (_, i) => i + 1); } - + setFilter(index): void { const selected = this.goggleCycle[index]; this.stateService.activeGoggles$.next(selected); @@ -296,7 +296,7 @@ export class CustomDashboardComponent implements OnInit, OnDestroy, AfterViewIni if (this.stateService.env.customize && this.stateService.env.customize.dashboard.widgets.some(w => w.props?.address)) { let addressString = this.stateService.env.customize.dashboard.widgets.find(w => w.props?.address).props.address; addressString = (/^[A-Z]{2,5}1[AC-HJ-NP-Z02-9]{8,100}|04[a-fA-F0-9]{128}|(02|03)[a-fA-F0-9]{64}$/.test(addressString)) ? addressString.toLowerCase() : addressString; - + this.addressSubscription = ( addressString.match(/04[a-fA-F0-9]{128}|(02|03)[a-fA-F0-9]{64}/) ? this.electrsApiService.getPubKeyAddress$(addressString) diff --git a/frontend/src/app/components/difficulty/difficulty-tooltip.component.ts b/frontend/src/app/components/difficulty/difficulty-tooltip.component.ts index 9ad44a629..f889c68e1 100644 --- a/frontend/src/app/components/difficulty/difficulty-tooltip.component.ts +++ b/frontend/src/app/components/difficulty/difficulty-tooltip.component.ts @@ -26,7 +26,7 @@ const EPOCH_BLOCK_LENGTH = 2016; // Bitcoin mainnet }) export class DifficultyTooltipComponent implements OnChanges { @Input() status: string | void; - @Input() progress: EpochProgress | void = null; + @Input() progress: EpochProgress | void = null; @Input() cursorPosition: { x: number, y: number }; mined: number; @@ -49,7 +49,7 @@ export class DifficultyTooltipComponent implements OnChanges { ngOnChanges(changes): void { if (changes.cursorPosition && changes.cursorPosition.currentValue) { let x = changes.cursorPosition.currentValue.x; - let y = changes.cursorPosition.currentValue.y - 50; + const y = changes.cursorPosition.currentValue.y - 50; if (this.tooltipElement) { const elementBounds = this.tooltipElement.nativeElement.getBoundingClientRect(); x -= elementBounds.width / 2; diff --git a/frontend/src/app/components/difficulty/difficulty.component.ts b/frontend/src/app/components/difficulty/difficulty.component.ts index 229b9194b..74347d6f0 100644 --- a/frontend/src/app/components/difficulty/difficulty.component.ts +++ b/frontend/src/app/components/difficulty/difficulty.component.ts @@ -48,7 +48,7 @@ export class DifficultyComponent implements OnInit { @Input() showTitle = true; @ViewChild('epochSvg') epochSvgElement: ElementRef; - + isLoadingWebSocket$: Observable; difficultyEpoch$: Observable; diff --git a/frontend/src/app/components/faucet/faucet.component.ts b/frontend/src/app/components/faucet/faucet.component.ts index 6b4881176..25a239330 100644 --- a/frontend/src/app/components/faucet/faucet.component.ts +++ b/frontend/src/app/components/faucet/faucet.component.ts @@ -174,12 +174,12 @@ export class FaucetComponent implements OnInit, OnDestroy { get amount() { return this.faucetForm.get('satoshis')!; } get invalidAmount() { const amount = this.faucetForm.get('satoshis')!; - return amount?.invalid && (amount.dirty || amount.touched) + return amount?.invalid && (amount.dirty || amount.touched); } get address() { return this.faucetForm.get('address')!; } get invalidAddress() { const address = this.faucetForm.get('address')!; - return address?.invalid && (address.dirty || address.touched) + return address?.invalid && (address.dirty || address.touched); } } 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 index 1bc5aaa1d..34d2c6d66 100644 --- 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 @@ -145,7 +145,7 @@ export class FeeDistributionGraphComponent implements OnInit, OnChanges, OnDestr const unitValue = this.weightMode ? value / 4 : value; const selectedPowerOfTen = selectPowerOfTen(unitValue); const scaledValue = unitValue / selectedPowerOfTen.divider; - let newVal = ''; + const newVal = ''; switch (true) { case scaledValue >= 100: return Math.round(scaledValue).toString(); diff --git a/frontend/src/app/components/fees-box/fees-box.component.ts b/frontend/src/app/components/fees-box/fees-box.component.ts index a1c8e7698..1a2d5c8cf 100644 --- a/frontend/src/app/components/fees-box/fees-box.component.ts +++ b/frontend/src/app/components/fees-box/fees-box.component.ts @@ -44,7 +44,7 @@ export class FeesBoxComponent implements OnInit, OnDestroy { ); this.themeSubscription = this.themeService.themeChanged$.subscribe(() => { this.setFeeGradient(); - }) + }); } setFeeGradient() { diff --git a/frontend/src/app/components/footer/footer.component.ts b/frontend/src/app/components/footer/footer.component.ts index 1df81bc62..191726da4 100644 --- a/frontend/src/app/components/footer/footer.component.ts +++ b/frontend/src/app/components/footer/footer.component.ts @@ -50,7 +50,7 @@ export class FooterComponent implements OnInit { .pipe( map(([mempoolInfo, vbytesPerSecond]) => { const percent = Math.round((Math.min(vbytesPerSecond, this.vBytesPerSecondLimit) / this.vBytesPerSecondLimit) * 100); - + let progressColor = '#7CB342'; if (vbytesPerSecond > 1667) { progressColor = '#FDD835'; @@ -67,7 +67,7 @@ export class FooterComponent implements OnInit { if (vbytesPerSecond > 3500) { progressColor = '#D81B60'; } - + const mempoolSizePercentage = (mempoolInfo.usage / mempoolInfo.maxmempool * 100); let mempoolSizeProgress = 'bg-danger'; if (mempoolSizePercentage <= 50) { @@ -75,7 +75,7 @@ export class FooterComponent implements OnInit { } else if (mempoolSizePercentage <= 75) { mempoolSizeProgress = 'bg-warning'; } - + return { memPoolInfo: mempoolInfo, vBytesPerSecond: vbytesPerSecond, diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts index d72800aa2..ca3a42bd2 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -164,7 +164,7 @@ export class HashrateChartComponent implements OnInit { diffIndex++; } - let maResolution = 15; + const maResolution = 15; const hashrateMa = []; for (let i = maResolution - 1; i < data.hashrates.length; ++i) { let avg = 0; @@ -258,7 +258,7 @@ export class HashrateChartComponent implements OnInit { if (tick.seriesIndex === 0) { // Hashrate hashrateString = `${tick.marker} ${tick.seriesName}: ${this.amountShortenerPipe.transform(tick.data[1], 3, 'H/s', false, true)}
`; } else if (tick.seriesIndex === 1) { // Difficulty - let difficulty = tick.data[1]; + const difficulty = tick.data[1]; if (difficulty === null) { difficultyString = `${tick.marker} ${tick.seriesName}: No data
`; } else { @@ -361,7 +361,7 @@ export class HashrateChartComponent implements OnInit { return value.min; } const selectedPowerOfTen: any = selectPowerOfTen(firstYAxisMin); - const newMin = Math.floor(firstYAxisMin / selectedPowerOfTen.divider / 10) + const newMin = Math.floor(firstYAxisMin / selectedPowerOfTen.divider / 10); return 600 / 2 ** 32 * newMin * selectedPowerOfTen.divider * 10; }, max: (value) => { diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts index f7bc7607b..53dc0e54d 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts @@ -110,7 +110,7 @@ export class HashrateChartPoolsComponent implements OnInit { map((response) => { return { blockCount: parseInt(response.headers.get('x-total-count'), 10), - } + }; }), retryWhen((errors) => errors.pipe( delay(60000) @@ -178,7 +178,7 @@ export class HashrateChartPoolsComponent implements OnInit { }, icon: 'roundRect', itemStyle: { - color: poolsColor[name.replace(/[^a-zA-Z0-9]/g, "").toLowerCase()], + color: poolsColor[name.replace(/[^a-zA-Z0-9]/g, '').toLowerCase()], }, }); } 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 1aff1fb1c..eaf588527 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 @@ -76,7 +76,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On rendered() { if (!this.data) { - return; + return; } } @@ -161,7 +161,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On symbol: 'none', lineStyle: { width: 2, - color: "white", + color: 'white', } }); } diff --git a/frontend/src/app/components/liquid-reserves-audit/federation-addresses-stats/federation-addresses-stats.component.ts b/frontend/src/app/components/liquid-reserves-audit/federation-addresses-stats/federation-addresses-stats.component.ts index 9e88c3ce3..ab7ec7ad7 100644 --- a/frontend/src/app/components/liquid-reserves-audit/federation-addresses-stats/federation-addresses-stats.component.ts +++ b/frontend/src/app/components/liquid-reserves-audit/federation-addresses-stats/federation-addresses-stats.component.ts @@ -24,9 +24,9 @@ export class FederationAddressesStatsComponent implements OnInit { if (address_count === undefined || utxo_count === undefined) { return undefined; } - return { address_count, utxo_count} + return { address_count, utxo_count}; }) - ) + ); } } diff --git a/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.ts b/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.ts index 25440b942..baa26def4 100644 --- a/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.ts +++ b/frontend/src/app/components/liquid-reserves-audit/federation-utxos-list/federation-utxos-list.component.ts @@ -36,7 +36,7 @@ export class FederationUtxosListComponent implements OnInit { isLoad: boolean = true; private destroy$ = new Subject(); - + constructor( private apiService: ApiService, public stateService: StateService, @@ -125,7 +125,7 @@ export class FederationUtxosListComponent implements OnInit { const distanceToGreen = Math.abs(4032 - value); const green = '#3bcc49'; const red = '#dc3545'; - + if (value < 0) { return red; } else if (value >= 4032) { @@ -135,11 +135,11 @@ export class FederationUtxosListComponent implements OnInit { const r = parseInt(red.slice(1, 3), 16); const g = parseInt(green.slice(1, 3), 16); const b = parseInt(red.slice(5, 7), 16); - + const newR = Math.floor(r + (g - r) * scaleFactor); const newG = Math.floor(g - (g - r) * scaleFactor); const newB = b; - + return '#' + this.componentToHex(newR) + this.componentToHex(newG) + this.componentToHex(newB); } } diff --git a/frontend/src/app/components/liquid-reserves-audit/reserves-ratio-stats/reserves-ratio-stats.component.ts b/frontend/src/app/components/liquid-reserves-audit/reserves-ratio-stats/reserves-ratio-stats.component.ts index 0c59e7174..a6449def1 100644 --- a/frontend/src/app/components/liquid-reserves-audit/reserves-ratio-stats/reserves-ratio-stats.component.ts +++ b/frontend/src/app/components/liquid-reserves-audit/reserves-ratio-stats/reserves-ratio-stats.component.ts @@ -11,7 +11,7 @@ import { Observable, map } from 'rxjs'; export class ReservesRatioStatsComponent implements OnInit { @Input() fullHistory$: Observable; @Input() emergencyUtxosStats$: Observable; - unbackedMonths$: Observable + unbackedMonths$: Observable; constructor() { } @@ -24,13 +24,13 @@ export class ReservesRatioStatsComponent implements OnInit { map((fullHistory) => { if (fullHistory.liquidPegs.series.length !== fullHistory.liquidReserves.series.length) { return { - historyComplete: false, + historyComplete: false, total: null }; } // Only check the last 3 years let ratioSeries = fullHistory.liquidReserves.series.map((value: number, index: number) => value / fullHistory.liquidPegs.series[index]); - ratioSeries = ratioSeries.slice(Math.max(ratioSeries.length - 36, 0)); + ratioSeries = ratioSeries.slice(Math.max(ratioSeries.length - 36, 0)); let total = 0; let avg = 0; for (let i = 0; i < ratioSeries.length; i++) { @@ -41,7 +41,7 @@ export class ReservesRatioStatsComponent implements OnInit { } avg = avg / ratioSeries.length; return { - historyComplete: true, + historyComplete: true, total: total, avg: avg, }; diff --git a/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.ts b/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.ts index 554521c16..95dd66caf 100644 --- a/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.ts +++ b/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.ts @@ -103,9 +103,9 @@ export class ReservesRatioComponent implements OnInit, OnChanges { } }, axisLabel: { - color: 'inherit', - fontFamily: 'inherit', - fontSize: axisFontSize, + color: 'inherit', + fontFamily: 'inherit', + fontSize: axisFontSize, formatter: function (value) { if (value === 0.999) { return hideMinAxisLabels ? '' : '99.9%'; diff --git a/frontend/src/app/components/master-page/master-page.component.ts b/frontend/src/app/components/master-page/master-page.component.ts index 12fbc295d..268853356 100644 --- a/frontend/src/app/components/master-page/master-page.component.ts +++ b/frontend/src/app/components/master-page/master-page.component.ts @@ -34,7 +34,7 @@ export class MasterPageComponent implements OnInit, OnDestroy { servicesEnabled = false; menuOpen = false; isDropdownVisible: boolean; - + enterpriseInfo: any; enterpriseInfo$: Subscription; @@ -71,7 +71,7 @@ export class MasterPageComponent implements OnInit, OnDestroy { this.enterpriseInfo$ = this.enterpriseService.info$.subscribe(info => { this.enterpriseInfo = info; }); - + this.servicesEnabled = this.officialMempoolSpace && this.stateService.env.ACCELERATOR === true && this.stateService.network === ''; this.refreshAuth(); diff --git a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts index 8617a4bb1..e4eeaf8a2 100644 --- a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts +++ b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts @@ -452,7 +452,7 @@ export class MempoolBlocksComponent implements OnInit, OnChanges, OnDestroy { } else { const estimatedPosition = this.etaService.mempoolPositionFromFees(this.txFeePerVSize, this.mempoolBlocks); this.rightPosition = estimatedPosition.block * (this.blockWidth + this.blockPadding) - + ((estimatedPosition.vsize / this.stateService.blockVSize) * this.blockWidth) + + ((estimatedPosition.vsize / this.stateService.blockVSize) * this.blockWidth); } this.rightPosition = Math.min(this.maxArrowPosition, this.rightPosition); } 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 68c5fb9f9..b1db6b96b 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -467,7 +467,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { totalValue: totalValueTemp, totalValueArray: totalValueArray.reverse(), }; - } + }; orderLevels() { this.feeLevelsOrdered = []; diff --git a/frontend/src/app/components/menu/menu.component.ts b/frontend/src/app/components/menu/menu.component.ts index dadf15ecc..1e7142943 100644 --- a/frontend/src/app/components/menu/menu.component.ts +++ b/frontend/src/app/components/menu/menu.component.ts @@ -18,7 +18,7 @@ export class MenuComponent implements OnInit, OnDestroy { @Input() navOpen: boolean = false; @Output() loggedOut = new EventEmitter(); @Output() menuToggled = new EventEmitter(); - + userMenuGroups$: Observable | undefined; user$: Observable; userAuth: any | undefined; @@ -34,7 +34,7 @@ export class MenuComponent implements OnInit, OnDestroy { ngOnInit(): void { this.userAuth = this.storageService.getAuth(); - + if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) { this.userMenuGroups$ = this.servicesApiServices.getUserMenuGroups$(); this.user$ = this.servicesApiServices.userSubject$; diff --git a/frontend/src/app/components/ngx-bootstrap-multiselect/ngx-bootstrap-multiselect.component.ts b/frontend/src/app/components/ngx-bootstrap-multiselect/ngx-bootstrap-multiselect.component.ts index 766813247..41d00d043 100644 --- a/frontend/src/app/components/ngx-bootstrap-multiselect/ngx-bootstrap-multiselect.component.ts +++ b/frontend/src/app/components/ngx-bootstrap-multiselect/ngx-bootstrap-multiselect.component.ts @@ -464,7 +464,7 @@ export class NgxDropdownMultiselectComponent implements OnInit, this.model = this.model.slice(); this.fireModelChange(); - }, 0) + }, 0); } updateNumSelected() { diff --git a/frontend/src/app/components/ngx-bootstrap-multiselect/off-click.directive.ts b/frontend/src/app/components/ngx-bootstrap-multiselect/off-click.directive.ts index bbb18a312..bf1124c18 100644 --- a/frontend/src/app/components/ngx-bootstrap-multiselect/off-click.directive.ts +++ b/frontend/src/app/components/ngx-bootstrap-multiselect/off-click.directive.ts @@ -14,7 +14,7 @@ export class OffClickDirective { private _clickEvent: MouseEvent; private _touchEvent: TouchEvent; - @HostListener('click', ['$event']) + @HostListener('click', ['$event']) public onClick(event: MouseEvent): void { this._clickEvent = event; } @@ -24,7 +24,7 @@ export class OffClickDirective { this._touchEvent = event; } - @HostListener('document:click', ['$event']) + @HostListener('document:click', ['$event']) public onDocumentClick(event: MouseEvent): void { if (event !== this._clickEvent) { this.onOffClick.emit(event); diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts index 7035d7c0f..65f82b160 100644 --- a/frontend/src/app/components/pool/pool.component.ts +++ b/frontend/src/app/components/pool/pool.component.ts @@ -222,9 +222,9 @@ export class PoolComponent implements OnInit { hashrateString = `${tick.marker} ${tick.seriesName}: ${this.amountShortenerPipe.transform(tick.data[1], 3, 'H/s', false, true)}
`; } else if (tick.seriesIndex === 1) { dominanceString = `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.0-2')}%`; - } + } } - + return ` ${ticks[0].axisValueLabel}
${hashrateString} @@ -283,7 +283,7 @@ export class PoolComponent implements OnInit { axisLabel: { color: 'rgb(110, 112, 121)', formatter: (val) => { - return `${val}%` + return `${val}%`; } }, splitLine: { diff --git a/frontend/src/app/components/push-transaction/push-transaction.component.ts b/frontend/src/app/components/push-transaction/push-transaction.component.ts index 05ab8bd30..d716ee47c 100644 --- a/frontend/src/app/components/push-transaction/push-transaction.component.ts +++ b/frontend/src/app/components/push-transaction/push-transaction.component.ts @@ -134,7 +134,7 @@ export class PushTransactionComponent implements OnInit { this.isLoadingPackage = false; this.packageMessage = result['package_msg']; - for (let wtxid in result['tx-results']) { + for (const wtxid in result['tx-results']) { this.results.push(result['tx-results'][wtxid]); } @@ -178,7 +178,7 @@ export class PushTransactionComponent implements OnInit { return false; } const rawCheck = this.base64UrlToU8Array(fragmentParams.get('c')); - + // check checksum const hashTx = await crypto.subtle.digest('SHA-256', rawTx); diff --git a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts index 909d57549..ec1b1a6ed 100644 --- a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts +++ b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts @@ -59,7 +59,7 @@ export class RbfTimelineComponent implements OnInit, OnChanges { // converts a tree of RBF events into a format that can be more easily rendered in HTML buildTimelines(tree: RbfTree): TimelineCell[][] { - if (!tree) return []; + if (!tree) {return [];} this.flagFullRbf(tree); const split = this.splitTimelines(tree); diff --git a/frontend/src/app/components/search-form/search-form.component.ts b/frontend/src/app/components/search-form/search-form.component.ts index 4e3656df3..5f2896b66 100644 --- a/frontend/src/app/components/search-form/search-form.component.ts +++ b/frontend/src/app/components/search-form/search-form.component.ts @@ -199,8 +199,8 @@ export class SearchFormComponent implements OnInit { const publicKey = matchesAddress && searchText.startsWith('0'); const otherNetworks = findOtherNetworks(searchText, this.network as any || 'mainnet', this.env); const liquidAsset = this.assets ? (this.assets[searchText] || []) : []; - const pools = this.pools.filter(pool => pool["name"].toLowerCase().includes(searchText.toLowerCase())).slice(0, 10); - + const pools = this.pools.filter(pool => pool['name'].toLowerCase().includes(searchText.toLowerCase())).slice(0, 10); + if (matchesDateTime && searchText.indexOf('/') !== -1) { searchText = searchText.replace(/\//g, '-'); } @@ -338,8 +338,8 @@ export class SearchFormComponent implements OnInit { })) // Sort: active pools first, then alphabetically .sort((a, b) => { - if (a.active && !b.active) return -1; - if (!a.active && b.active) return 1; + if (a.active && !b.active) {return -1;} + if (!a.active && b.active) {return 1;} return a.slug < b.slug ? -1 : 1; }); diff --git a/frontend/src/app/components/start/start.component.ts b/frontend/src/app/components/start/start.component.ts index 0bc0fd212..347a826dd 100644 --- a/frontend/src/app/components/start/start.component.ts +++ b/frontend/src/app/components/start/start.component.ts @@ -165,7 +165,7 @@ export class StartComponent implements OnInit, AfterViewChecked, OnDestroy { if (reset) { this.resetScroll(); this.stateService.resetScroll$.next(false); - } + } }); } @@ -311,7 +311,7 @@ export class StartComponent implements OnInit, AfterViewChecked, OnDestroy { updateVelocity(x: number) { const now = performance.now(); - let dt = now - this.lastUpdate; + const dt = now - this.lastUpdate; if (dt > 0) { this.lastUpdate = now; const velocity = (x - this.lastMouseX) / dt; diff --git a/frontend/src/app/components/statistics/statistics.component.ts b/frontend/src/app/components/statistics/statistics.component.ts index b63b9191c..af486970e 100644 --- a/frontend/src/app/components/statistics/statistics.component.ts +++ b/frontend/src/app/components/statistics/statistics.component.ts @@ -209,7 +209,7 @@ export class StatisticsComponent implements OnInit { } }); } - + onOutlierToggleChange(e): void { this.outlierCappingEnabled = e.target.checked; this.storageService.setValue('cap-outliers', e.target.checked); diff --git a/frontend/src/app/components/timezone-selector/timezone-selector.component.ts b/frontend/src/app/components/timezone-selector/timezone-selector.component.ts index 4aeae09bb..fee05bd69 100644 --- a/frontend/src/app/components/timezone-selector/timezone-selector.component.ts +++ b/frontend/src/app/components/timezone-selector/timezone-selector.component.ts @@ -42,7 +42,7 @@ export class TimezoneSelectorComponent implements OnInit { setLocalTimezone() { const offset = new Date().getTimezoneOffset(); - const sign = offset <= 0 ? "+" : "-"; + const sign = offset <= 0 ? '+' : '-'; const absOffset = Math.abs(offset); const hours = String(Math.floor(absOffset / 60)); const minutes = String(absOffset % 60).padStart(2, '0'); diff --git a/frontend/src/app/components/tracker/tracker-bar.component.ts b/frontend/src/app/components/tracker/tracker-bar.component.ts index 4aa3f4e99..64200ec09 100644 --- a/frontend/src/app/components/tracker/tracker-bar.component.ts +++ b/frontend/src/app/components/tracker/tracker-bar.component.ts @@ -13,7 +13,7 @@ export class TrackerBarComponent implements OnInit, OnChanges { @Input() stage: TrackerStage = 'waiting'; transitionsEnabled: boolean = false; - + stages = { waiting: { state: 'blank', @@ -41,7 +41,7 @@ export class TrackerBarComponent implements OnInit, OnChanges { this.setStage(); setTimeout(() => { this.transitionsEnabled = true; - }, 100) + }, 100); } ngOnChanges(changes: SimpleChanges): void { @@ -52,7 +52,7 @@ export class TrackerBarComponent implements OnInit, OnChanges { setStage() { let matched = 0; - for (let stage of this.stageOrder) { + for (const stage of this.stageOrder) { if (stage === this.stage) { this.stages[stage].state = 'current'; matched = 1; diff --git a/frontend/src/app/components/tracker/tracker.component.ts b/frontend/src/app/components/tracker/tracker.component.ts index 3c7ac3911..1356ac5b5 100644 --- a/frontend/src/app/components/tracker/tracker.component.ts +++ b/frontend/src/app/components/tracker/tracker.component.ts @@ -642,7 +642,7 @@ export class TrackerComponent implements OnInit, OnDestroy { }), tap(eta => { if (this.replaced) { - this.trackerStage = 'replaced' + this.trackerStage = 'replaced'; } else if (eta?.blocks === 0) { this.trackerStage = 'next'; } else if (eta?.blocks < 3){ @@ -651,7 +651,7 @@ export class TrackerComponent implements OnInit, OnDestroy { this.trackerStage = 'pending'; } }) - ) + ); } handleLoadElectrsTransactionError(error: any): Observable { diff --git a/frontend/src/app/components/transaction/liquid-ublinding.ts b/frontend/src/app/components/transaction/liquid-ublinding.ts index 259b06a0b..e6aac46f5 100644 --- a/frontend/src/app/components/transaction/liquid-ublinding.ts +++ b/frontend/src/app/components/transaction/liquid-ublinding.ts @@ -68,7 +68,7 @@ export class LiquidUnblinding { tx._unblinded = { matched, total: this.commitments.size }; this.deduceBlinded(tx); if (matched < this.commitments.size) { - throw new Error(`Invalid blinding data.`) + throw new Error(`Invalid blinding data.`); } tx._deduced = false; // invalidate cache so deduction is attempted again return tx; diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 7b471a391..86856910a 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -174,7 +174,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { setTimeout(() => { this.applyFragment(); }, 0); } } - + @ViewChild('accelerate') set accelerateAnchor(element: ElementRef | null | undefined) { if (element) { @@ -483,7 +483,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { catchError(() => { return of({ audit: null }); }) - ) + ); } else { return this.apiService.getBlockTxAudit$(hash, txid).pipe( retry({ count: 3, delay: 2000 }), @@ -491,7 +491,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { catchError(() => { return of({ audit: null }); }) - ) + ); } } else { const audit = isCoinbase ? { coinbase: true } : null; @@ -906,7 +906,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.accelerationCanceled = true; this.setIsAccelerated(firstCpfp); } - + if (this.notAcceleratedOnLoad === null) { this.notAcceleratedOnLoad = !this.isAcceleration; } @@ -923,11 +923,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { } setIsAccelerated(initialState: boolean = false) { - this.isAcceleration = + this.isAcceleration = ( - (this.tx.acceleration && (!this.tx.status.confirmed || this.waitingForAccelerationInfo)) || + (this.tx.acceleration && (!this.tx.status.confirmed || this.waitingForAccelerationInfo)) || (this.accelerationInfo && this.pool && this.accelerationInfo.pools.some(pool => (pool === this.pool.id))) - ) && + ) && !this.accelerationCanceled; if (this.isAcceleration) { if (initialState) { diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts index 1c2935f62..1a0d4b729 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.ts +++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts @@ -225,7 +225,7 @@ export class TransactionsListComponent implements OnInit, OnChanges, OnDestroy { setTimeout(() => { const assetBoxElements = document.getElementsByClassName('assetBox'); if (assetBoxElements && assetBoxElements[0]) { - assetBoxElements[0].scrollIntoView({block: "center"}); + assetBoxElements[0].scrollIntoView({block: 'center'}); } }, 10); } @@ -422,8 +422,8 @@ export class TransactionsListComponent implements OnInit, OnChanges, OnDestroy { const similarity = checkedCompareAddressStrings(address, compareAddr.scriptpubkey_address, addressType as AddressType, this.stateService.network); if (similarity?.status === 'comparable' && similarity.score > adjustedThreshold) { // Get or create group numbers for both addresses - let group1 = similarityGroups.get(address); - let group2 = similarityGroups.get(compareAddr.scriptpubkey_address); + const group1 = similarityGroups.get(address); + const group2 = similarityGroups.get(compareAddr.scriptpubkey_address); let group: number; if (group1 !== undefined && group2 !== undefined) { @@ -537,7 +537,7 @@ export class TransactionsListComponent implements OnInit, OnChanges, OnDestroy { this.electrsApiService.getTransaction$(tx.txid) .subscribe((newTx) => { tx['@vinLoaded'] = true; - let temp = tx.vin; + const temp = tx.vin; tx.vin = newTx.vin; tx.fee = newTx.fee; for (const [index, vin] of temp.entries()) { diff --git a/frontend/src/app/components/treasuries/treasuries-graph/treasuries-graph.component.ts b/frontend/src/app/components/treasuries/treasuries-graph/treasuries-graph.component.ts index a040a85b8..f62bbd2f0 100644 --- a/frontend/src/app/components/treasuries/treasuries-graph/treasuries-graph.component.ts +++ b/frontend/src/app/components/treasuries/treasuries-graph/treasuries-graph.component.ts @@ -119,7 +119,7 @@ export class TreasuriesGraphComponent implements OnInit, OnChanges, OnDestroy { this.walletData = {}; this.treasuries.forEach(treasury => { - if (!walletSummaries[treasury.wallet] || !walletSummaries[treasury.wallet].length) return; + if (!walletSummaries[treasury.wallet] || !walletSummaries[treasury.wallet].length) {return;} const total = this.walletStats[treasury.wallet] ? this.walletStats[treasury.wallet].balance : walletSummaries[treasury.wallet].reduce((acc, tx) => acc + tx.value, 0); @@ -267,8 +267,8 @@ export class TreasuriesGraphComponent implements OnInit, OnChanges, OnDestroy { const tooltipTime = data[0].data[0]; let tooltip = '
'; - const date = new Date(tooltipTime).toLocaleTimeString(this.locale, { - year: 'numeric', month: 'short', day: 'numeric' + const date = new Date(tooltipTime).toLocaleTimeString(this.locale, { + year: 'numeric', month: 'short', day: 'numeric' }); tooltip += `
${date}
`; @@ -304,7 +304,7 @@ export class TreasuriesGraphComponent implements OnInit, OnChanges, OnDestroy { if (mostRecentPoint) { // Extract balance from the point - const balance = Array.isArray(mostRecentPoint) ? mostRecentPoint[1] : + const balance = Array.isArray(mostRecentPoint) ? mostRecentPoint[1] : (mostRecentPoint && typeof mostRecentPoint === 'object' && 'value' in mostRecentPoint ? mostRecentPoint.value[1] : null); if (balance !== null && !isNaN(balance)) { @@ -339,7 +339,7 @@ export class TreasuriesGraphComponent implements OnInit, OnChanges, OnDestroy { show: this.showYAxis, color: 'rgb(110, 112, 121)', formatter: (val): string => { - let valSpan = maxValue - (this.period === 'all' ? 0 : minValue); + const valSpan = maxValue - (this.period === 'all' ? 0 : minValue); if (valSpan > 100_000_000_000) { return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 0, undefined, true)} BTC`; } diff --git a/frontend/src/app/components/twitter-widget/twitter-widget.component.ts b/frontend/src/app/components/twitter-widget/twitter-widget.component.ts index 361fb49fa..502d67b96 100644 --- a/frontend/src/app/components/twitter-widget/twitter-widget.component.ts +++ b/frontend/src/app/components/twitter-widget/twitter-widget.component.ts @@ -38,7 +38,7 @@ export class TwitterWidgetComponent implements OnChanges { if (!this.handle) { return; } - let url = `/api/v1/services/x/${this.handle}`; + const url = `/api/v1/services/x/${this.handle}`; this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.sanitizer.sanitize(SecurityContext.URL, url)); } diff --git a/frontend/src/app/components/tx-bowtie-graph-tooltip/tx-bowtie-graph-tooltip.component.ts b/frontend/src/app/components/tx-bowtie-graph-tooltip/tx-bowtie-graph-tooltip.component.ts index cf3daa61c..5eadb222d 100644 --- a/frontend/src/app/components/tx-bowtie-graph-tooltip/tx-bowtie-graph-tooltip.component.ts +++ b/frontend/src/app/components/tx-bowtie-graph-tooltip/tx-bowtie-graph-tooltip.component.ts @@ -108,7 +108,7 @@ export class TxBowtieGraphTooltipComponent implements OnChanges { } fetchPrices(changes: any) { - if (!this.currency || !this.viewFiat) return; + if (!this.currency || !this.viewFiat) {return;} if (this.isConnector) { // If the tooltip is on a connector, we fetch prices at the time of the input / output if (['input', 'output'].includes(changes.line.currentValue.type) && changes.line.currentValue?.status?.block_time && !this.blockConversions?.[changes.line.currentValue?.status.block_time]) { this.priceService.getBlockPrice$(changes.line.currentValue?.status.block_time, true, this.currency).pipe( @@ -122,7 +122,7 @@ export class TxBowtieGraphTooltipComponent implements OnChanges { tap((price) => this.blockConversions[changes.line.currentValue.timestamp] = price), ).subscribe(); } - } + } } } diff --git a/frontend/src/app/components/tx-bowtie-graph/tx-bowtie-graph.component.ts b/frontend/src/app/components/tx-bowtie-graph/tx-bowtie-graph.component.ts index aa5fe80a2..946d463cf 100644 --- a/frontend/src/app/components/tx-bowtie-graph/tx-bowtie-graph.component.ts +++ b/frontend/src/app/components/tx-bowtie-graph/tx-bowtie-graph.component.ts @@ -239,7 +239,7 @@ export class TxBowtieGraphComponent implements OnInit, OnChanges { } calcTotalValue(tx: Transaction): number { - let totalOutput = this.tx.vout.reduce((acc, v) => (this.getOutputValue(v) || 0) + acc, 0); + const totalOutput = this.tx.vout.reduce((acc, v) => (this.getOutputValue(v) || 0) + acc, 0); // simple sum of outputs + fee for bitcoin if (!this.isLiquid) { return this.tx.fee ? totalOutput + this.tx.fee : totalOutput; diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index 2e57e6f81..18bcf9cf0 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -315,21 +315,21 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { switchMap(_ => this.apiService.recentPegsList$()), share() ); - + this.pegsVolume$ = this.auditUpdated$.pipe( filter(auditUpdated => auditUpdated === true), throttleTime(40000), switchMap(_ => this.apiService.pegsVolume$()), share() ); - + this.federationAddresses$ = this.auditUpdated$.pipe( filter(auditUpdated => auditUpdated === true), throttleTime(40000), switchMap(_ => this.apiService.federationAddresses$()), share() ); - + this.federationAddressesNumber$ = this.auditUpdated$.pipe( filter(auditUpdated => auditUpdated === true), throttleTime(40000), @@ -337,7 +337,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { map(count => count.address_count), share() ); - + this.federationUtxosNumber$ = this.auditUpdated$.pipe( filter(auditUpdated => auditUpdated === true), throttleTime(40000), @@ -359,7 +359,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { switchMap(_ => this.apiService.emergencySpentUtxosStats$()), share() ); - + this.liquidPegsMonth$ = interval(60 * 60 * 1000) .pipe( startWith(0), @@ -375,7 +375,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { }), share(), ); - + this.liquidReservesMonth$ = interval(60 * 60 * 1000).pipe( startWith(0), switchMap(() => this.apiService.listLiquidReservesMonth$()), @@ -389,12 +389,12 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { }), share() ); - + this.fullHistory$ = combineLatest([this.liquidPegsMonth$, this.currentPeg$, this.liquidReservesMonth$, this.currentReserves$]) .pipe( map(([liquidPegs, currentPeg, liquidReserves, currentReserves]) => { liquidPegs.series[liquidPegs.series.length - 1] = parseFloat(currentPeg.amount) / 100000000; - + if (liquidPegs.series.length === liquidReserves?.series.length) { liquidReserves.series[liquidReserves.series.length - 1] = parseFloat(currentReserves?.amount) / 100000000; } else if (liquidPegs.series.length === liquidReserves?.series.length + 1) { @@ -406,7 +406,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { labels: [] }; } - + return { liquidPegs, liquidReserves @@ -438,7 +438,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { getArrayFromNumber(num: number): number[] { return Array.from({ length: num }, (_, i) => i + 1); } - + setFilter(index): void { const selected = this.goggleCycle[index]; this.stateService.activeGoggles$.next(selected); diff --git a/frontend/src/app/docs/api-docs/api-docs-data.ts b/frontend/src/app/docs/api-docs/api-docs-data.ts index fd365c43e..0b19fc348 100644 --- a/frontend/src/app/docs/api-docs/api-docs-data.ts +++ b/frontend/src/app/docs/api-docs/api-docs-data.ts @@ -1,7 +1,7 @@ -const bitcoinNetworks = ["", "testnet", "testnet4", "signet"]; -const liquidNetworks = ["liquid", "liquidtestnet"]; -const lightningNetworks = ["", "testnet", "signet"]; -const miningTimeIntervals = "24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y"; +const bitcoinNetworks = ['', 'testnet', 'testnet4', 'signet']; +const liquidNetworks = ['liquid', 'liquidtestnet']; +const lightningNetworks = ['', 'testnet', 'signet']; +const miningTimeIntervals = '24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y'; const emptyCodeSample = { esModule: [], @@ -10,24 +10,24 @@ const emptyCodeSample = { response: `` }; -const showJsExamplesDefault = { "": true, "testnet": true, "signet": true, "liquid": true, "liquidtestnet": false }; -const showJsExamplesDefaultFalse = { "": false, "testnet": false, "signet": false, "liquid": false, "liquidtestnet": false }; +const showJsExamplesDefault = { '': true, 'testnet': true, 'signet': true, 'liquid': true, 'liquidtestnet': false }; +const showJsExamplesDefaultFalse = { '': false, 'testnet': false, 'signet': false, 'liquid': false, 'liquidtestnet': false }; export const wsApiDocsData = [ { - type: "category", - category: "general", - fragment: "general", - title: "General", + type: 'category', + category: 'general', + fragment: 'general', + title: 'General', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "general", - fragment: "live-data", - title: "Live Data", + type: 'endpoint', + category: 'general', + fragment: 'live-data', + title: 'Live Data', description: { - default: "Subscribe to live data. Available: blocks, mempool-block, live-2h-chart, and stats." + default: 'Subscribe to live data. Available: blocks, mempool-block, live-2h-chart, and stats.' }, payload: '{ "action": "want", "data": ["mempool-blocks", "stats"] }', showConditions: bitcoinNetworks.concat(liquidNetworks), @@ -300,19 +300,19 @@ export const wsApiDocsData = [ } }, { - type: "category", - category: "addresses", - fragment: "addresses", - title: "Addresses", + type: 'category', + category: 'addresses', + fragment: 'addresses', + title: 'Addresses', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "addresses", - fragment: "track-address", - title: "Track Address", + type: 'endpoint', + category: 'addresses', + fragment: 'track-address', + title: 'Track Address', description: { - default: "Subscribe to a single address to receive live updates on new transactions having that address in input or output. address-transactions field contains new mempool transactions, and block-transactions contains new confirmed transactions." + default: 'Subscribe to a single address to receive live updates on new transactions having that address in input or output. address-transactions field contains new mempool transactions, and block-transactions contains new confirmed transactions.' }, payload: '{ "track-address": "bc1qeldw4mqns26wew8swgpkt3fs364w3ehs046w2f" }', showConditions: bitcoinNetworks.concat(liquidNetworks), @@ -697,12 +697,12 @@ export const wsApiDocsData = [ } }, { - type: "endpoint", - category: "addresses", - fragment: "track-addresses", - title: "Track Addresses", + type: 'endpoint', + category: 'addresses', + fragment: 'track-addresses', + title: 'Track Addresses', description: { - default: "Subscribe to multiple addresses to receive live updates on new transactions having these addresses in input or output. Limits on the maximum number of tracked addresses apply. For higher tracking limits, consider upgrading to an enterprise sponsorship." + default: 'Subscribe to multiple addresses to receive live updates on new transactions having these addresses in input or output. Limits on the maximum number of tracked addresses apply. For higher tracking limits, consider upgrading to an enterprise sponsorship.' }, payload: `{ "track-addresses": [ @@ -1122,19 +1122,19 @@ export const wsApiDocsData = [ } }, { - type: "category", - category: "transactions", - fragment: "transactions", - title: "Transactions", + type: 'category', + category: 'transactions', + fragment: 'transactions', + title: 'Transactions', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "transactions", - fragment: "track-tx", - title: "Track Transaction", + type: 'endpoint', + category: 'transactions', + fragment: 'track-tx', + title: 'Track Transaction', description: { - default: "Subscribe to a transaction to receive live updates on its confirmation status and position in the mempool." + default: 'Subscribe to a transaction to receive live updates on its confirmation status and position in the mempool.' }, payload: '{ "track-tx": "8a4666c6d22ce74fa47e1c4fdb09af556a234cc6a606539a75caf66ba44a2d07" }', showConditions: bitcoinNetworks.concat(liquidNetworks), @@ -1291,12 +1291,12 @@ export const wsApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - fragment: "track-txs", - title: "Track Transactions", + type: 'endpoint', + category: 'transactions', + fragment: 'track-txs', + title: 'Track Transactions', description: { - default: "Subscribe to multiple transactions to receive live updates on their status and position in the mempool. Limits on the maximum number of tracked addresses apply. For higher tracking limits, consider upgrading to an enterprise sponsorship." + default: 'Subscribe to multiple transactions to receive live updates on their status and position in the mempool. Limits on the maximum number of tracked addresses apply. For higher tracking limits, consider upgrading to an enterprise sponsorship.' }, payload: `{ "track-txs": [ @@ -1477,19 +1477,19 @@ export const wsApiDocsData = [ } }, { - type: "category", - category: "mempool", - fragment: "mempool", - title: "Mempool", + type: 'category', + category: 'mempool', + fragment: 'mempool', + title: 'Mempool', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "mempool", - fragment: "track-mempool", - title: "Track Mempool", + type: 'endpoint', + category: 'mempool', + fragment: 'track-mempool', + title: 'Track Mempool', description: { - default: "Subscribe to new mempool events, such as new transactions entering the mempool. Available fields: added, removed, mined, replaced.
Because this is potentially a lot of data, consider using the track-mempool-txids endpoint described below instead, or upgrade to an enterprise sponsorship." + default: 'Subscribe to new mempool events, such as new transactions entering the mempool. Available fields: added, removed, mined, replaced.
Because this is potentially a lot of data, consider using the track-mempool-txids endpoint described below instead, or upgrade to an enterprise sponsorship.' }, payload: '{ "track-mempool": true }', showConditions: bitcoinNetworks.concat(liquidNetworks), @@ -1818,12 +1818,12 @@ export const wsApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - fragment: "track-mempool-txids", - title: "Track Mempool Txids", + type: 'endpoint', + category: 'mempool', + fragment: 'track-mempool-txids', + title: 'Track Mempool Txids', description: { - default: "Low-bandwith substitute to the above command track-mempool: subscribe to new mempool events, such as new transactions entering the mempool, but only transaction IDs are returned to save bandwith. Available fields: added, removed, mined, replaced." + default: 'Low-bandwith substitute to the above command track-mempool: subscribe to new mempool events, such as new transactions entering the mempool, but only transaction IDs are returned to save bandwith. Available fields: added, removed, mined, replaced.' }, payload: '{ "track-mempool-txids": true }', showConditions: bitcoinNetworks.concat(liquidNetworks), @@ -1924,12 +1924,12 @@ export const wsApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - fragment: "track-mempool-block", - title: "Track Mempool Block", + type: 'endpoint', + category: 'mempool', + fragment: 'track-mempool-block', + title: 'Track Mempool Block', description: { - default: "Subscribe to live mempool projected block template, index 0 being the first mempool block.
A full set of stripped transactions in that block is returned when the subscription starts, and deltas (removed and added transactions) are then sent every time the mempool changes." + default: 'Subscribe to live mempool projected block template, index 0 being the first mempool block.
A full set of stripped transactions in that block is returned when the subscription starts, and deltas (removed and added transactions) are then sent every time the mempool changes.' }, payload: '{ "track-mempool-block": 0 }', showConditions: bitcoinNetworks.concat(liquidNetworks), @@ -2062,12 +2062,12 @@ export const wsApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - fragment: "track-rbf", - title: "Track Mempool RBF Transactions", + type: 'endpoint', + category: 'mempool', + fragment: 'track-rbf', + title: 'Track Mempool RBF Transactions', description: { - default: "Subscribe to new RBF events." + default: 'Subscribe to new RBF events.' }, payload: '{ "track-rbf": "all" }', showConditions: bitcoinNetworks, @@ -2255,12 +2255,12 @@ export const wsApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - fragment: "track-full-rbf", - title: "Track Mempool Full RBF Transactions", + type: 'endpoint', + category: 'mempool', + fragment: 'track-full-rbf', + title: 'Track Mempool Full RBF Transactions', description: { - default: "Subscribe to new Full RBF events." + default: 'Subscribe to new Full RBF events.' }, payload: '{ "track-rbf": "fullRbf" }', showConditions: bitcoinNetworks, @@ -2452,22 +2452,22 @@ export const wsApiDocsData = [ export const restApiDocsData = [ { - type: "category", - category: "general", - fragment: "general", - title: "General", + type: 'category', + category: 'general', + fragment: 'general', + title: 'General', showConditions: bitcoinNetworks, }, { - type: "endpoint", - category: "general", - httpRequestMethod: "GET", - fragment: "get-difficulty-adjustment", - title: "GET Difficulty Adjustment", + type: 'endpoint', + category: 'general', + httpRequestMethod: 'GET', + fragment: 'get-difficulty-adjustment', + title: 'GET Difficulty Adjustment', description: { - default: "Returns details about difficulty adjustment." + default: 'Returns details about difficulty adjustment.' }, - urlString: "/v1/difficulty-adjustment", + urlString: '/v1/difficulty-adjustment', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -2560,16 +2560,16 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "general", - httpRequestMethod: "GET", - fragment: "get-price", - title: "GET Price", + type: 'endpoint', + category: 'general', + httpRequestMethod: 'GET', + fragment: 'get-price', + title: 'GET Price', description: { - default: "Returns bitcoin latest price denominated in main currencies." + default: 'Returns bitcoin latest price denominated in main currencies.' }, - urlString: "/v1/prices", - showConditions: [""], + urlString: '/v1/prices', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -2601,16 +2601,16 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "general", - httpRequestMethod: "GET", - fragment: "get-historical-price", - title: "GET Historical Price", + type: 'endpoint', + category: 'general', + httpRequestMethod: 'GET', + fragment: 'get-historical-price', + title: 'GET Historical Price', description: { - default: "Returns bitcoin historical price denominated in main currencies. Available query parameters: currency, timestamp. If no parameter is provided, the full price history for all currencies is returned." + default: 'Returns bitcoin historical price denominated in main currencies. Available query parameters: currency, timestamp. If no parameter is provided, the full price history for all currencies is returned.' }, - urlString: "/v1/historical-price?currency=EUR×tamp=1500000000", - showConditions: [""], + urlString: '/v1/historical-price?currency=EUR×tamp=1500000000', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -2650,22 +2650,22 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "addresses", - fragment: "addresses", - title: "Addresses", + type: 'category', + category: 'addresses', + fragment: 'addresses', + title: 'Addresses', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "addresses", - httpRequestMethod: "GET", - fragment: "get-address", - title: "GET Address", + type: 'endpoint', + category: 'addresses', + httpRequestMethod: 'GET', + fragment: 'get-address', + title: 'GET Address', description: { - default: "Returns details about an address. Available fields: address, chain_stats, and mempool_stats. chain_stats and mempool_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum." + default: 'Returns details about an address. Available fields: address, chain_stats, and mempool_stats. chain_stats and mempool_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.' }, - urlString: "/address/:address", + urlString: '/address/:address', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -2794,15 +2794,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "addresses", - httpRequestMethod: "GET", - fragment: "get-address-transactions", - title: "GET Address Transactions", + type: 'endpoint', + category: 'addresses', + httpRequestMethod: 'GET', + fragment: 'get-address-transactions', + title: 'GET Address Transactions', description: { - default: "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 an after_txid query parameter." + default: '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 an after_txid query parameter.' }, - urlString: "/address/:address/txs", + urlString: '/address/:address/txs', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -2947,15 +2947,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "addresses", - httpRequestMethod: "GET", - fragment: "get-address-transactions-chain", - title: "GET Address Transactions Chain", + type: 'endpoint', + category: 'addresses', + httpRequestMethod: 'GET', + fragment: 'get-address-transactions-chain', + title: 'GET Address Transactions Chain', description: { - default: "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." + default: '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.' }, - urlString: "/address/:address/txs/chain", + urlString: '/address/:address/txs/chain', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -3100,15 +3100,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "addresses", - httpRequestMethod: "GET", - fragment: "get-address-transactions-mempool", - title: "GET Address Transactions Mempool", + type: 'endpoint', + category: 'addresses', + httpRequestMethod: 'GET', + fragment: 'get-address-transactions-mempool', + title: 'GET Address Transactions Mempool', description: { - default: "Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging)." + default: 'Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).' }, - urlString: "/address/:address/txs/mempool", + urlString: '/address/:address/txs/mempool', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -3225,16 +3225,16 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "addresses", - httpRequestMethod: "GET", - fragment: "get-address-utxo", - title: "GET Address UTXO", + type: 'endpoint', + category: 'addresses', + httpRequestMethod: 'GET', + fragment: 'get-address-utxo', + title: 'GET Address UTXO', description: { - default: "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).", - liquid: "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.", + default: '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).', + liquid: '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.', }, - urlString: "/address/:address/utxo", + urlString: '/address/:address/utxo', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -3357,15 +3357,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "addresses", - httpRequestMethod: "GET", - fragment: "get-address-validate", - title: "GET Address Validation", + type: 'endpoint', + category: 'addresses', + httpRequestMethod: 'GET', + fragment: 'get-address-validate', + title: 'GET Address Validation', description: { - default: "Returns whether an address is valid or not. Available fields: isvalid (boolean), address (string), scriptPubKey (string), isscript (boolean), iswitness (boolean), witness_version (numeric, optional), and witness_program (string, optional).", + default: 'Returns whether an address is valid or not. Available fields: isvalid (boolean), address (string), scriptPubKey (string), isscript (boolean), iswitness (boolean), witness_version (numeric, optional), and witness_program (string, optional).', }, - urlString: "/v1/validate-address/:address", + urlString: '/v1/validate-address/:address', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -3415,22 +3415,22 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "assets", - fragment: "assets", - title: "Assets", + type: 'category', + category: 'assets', + fragment: 'assets', + title: 'Assets', showConditions: liquidNetworks }, { - type: "endpoint", - category: "assets", - httpRequestMethod: "GET", - fragment: "get-asset", - title: "GET Asset", + type: 'endpoint', + category: 'assets', + httpRequestMethod: 'GET', + fragment: 'get-asset', + title: 'GET Asset', description: { - default: "Returns information about a Liquid asset." + default: 'Returns information about a Liquid asset.' }, - urlString: "/asset/:asset_id", + urlString: '/asset/:asset_id', showConditions: liquidNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -3522,15 +3522,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "assets", - httpRequestMethod: "GET", - fragment: "get-asset-transactions", - title: "GET Asset Transactions", + type: 'endpoint', + category: 'assets', + httpRequestMethod: 'GET', + fragment: 'get-asset-transactions', + title: 'GET Asset Transactions', description: { - default: "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." + default: '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.' }, - urlString: "/asset/:asset_id/txs[/mempool|/chain]", + urlString: '/asset/:asset_id/txs[/mempool|/chain]', showConditions: liquidNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -3608,15 +3608,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "assets", - httpRequestMethod: "GET", - fragment: "get-asset-supply", - title: "GET Asset Supply", + type: 'endpoint', + category: 'assets', + httpRequestMethod: 'GET', + fragment: 'get-asset-supply', + title: 'GET Asset Supply', description: { - default: "Get the current total supply of the specified asset. For the native asset (LBTC), 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." + default: 'Get the current total supply of the specified asset. For the native asset (LBTC), 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.' }, - urlString: "/asset/:asset_id/supply[/decimal]", + urlString: '/asset/:asset_id/supply[/decimal]', showConditions: liquidNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -3658,15 +3658,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "assets", - httpRequestMethod: "GET", - fragment: "get-asset-icons", - title: "GET Asset Icons", + type: 'endpoint', + category: 'assets', + httpRequestMethod: 'GET', + fragment: 'get-asset-icons', + title: 'GET Asset Icons', description: { - default: "Get all the Asset IDs that have icons." + default: 'Get all the Asset IDs that have icons.' }, - urlString: "/v1/assets/icons", + urlString: '/v1/assets/icons', showConditions: liquidNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -3699,15 +3699,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "assets", - httpRequestMethod: "GET", - fragment: "get-asset-icon", - title: "GET Asset Icon", + type: 'endpoint', + category: 'assets', + httpRequestMethod: 'GET', + fragment: 'get-asset-icon', + title: 'GET Asset Icon', description: { - default: "Get the icon of the specified asset." + default: 'Get the icon of the specified asset.' }, - urlString: "/v1/asset/:asset_id/icon", + urlString: '/v1/asset/:asset_id/icon', showConditions: liquidNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -3733,23 +3733,23 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "blocks", - fragment: "blocks", - title: "Blocks", + type: 'category', + category: 'blocks', + fragment: 'blocks', + title: 'Blocks', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { options: { electrsOnly: true }, - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block", - title: "GET Block", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block', + title: 'GET Block', description: { - default: "Returns details about a block.", + default: 'Returns details about a block.', }, - urlString: "/block/:hash", + urlString: '/block/:hash', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -3875,15 +3875,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-v1", - title: "GET Block (v1)", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-v1', + title: 'GET Block (v1)', description: { - default: "Returns details about a block using Mempool's Node.js backend.", + default: 'Returns details about a block using Mempool\'s Node.js backend.', }, - urlString: "/v1/block/:hash", + urlString: '/v1/block/:hash', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4160,15 +4160,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-header", - title: "GET Block Header", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-header', + title: 'GET Block Header', description: { - default: "Returns the hex-encoded block header." + default: 'Returns the hex-encoded block header.' }, - urlString: "/block/:hash/header", + urlString: '/block/:hash/header', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4225,15 +4225,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-height", - title: "GET Block Height", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-height', + title: 'GET Block Height', description: { - default: "Returns the hash of the block currently at :height." + default: 'Returns the hash of the block currently at :height.' }, - urlString: "/block-height/:height", + urlString: '/block-height/:height', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4287,15 +4287,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-timestamp", - title: "GET Block Timestamp", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-timestamp', + title: 'GET Block Timestamp', description: { - default: "Returns the height and the hash of the block closest to the given :timestamp." + default: 'Returns the height and the hash of the block closest to the given :timestamp.' }, - urlString: "/v1/mining/blocks/timestamp/:timestamp", + urlString: '/v1/mining/blocks/timestamp/:timestamp', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -4341,15 +4341,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-raw", - title: "GET Block Raw", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-raw', + title: 'GET Block Raw', description: { - default: "Returns the raw block representation in binary." + default: 'Returns the raw block representation in binary.' }, - urlString: "/block/:hash/raw", + urlString: '/block/:hash/raw', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4406,15 +4406,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-status", - title: "GET Block Status", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-status', + title: 'GET Block Status', description: { - default: "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)." + default: '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).' }, - urlString: "/block/:hash/status", + urlString: '/block/:hash/status', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4491,15 +4491,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-tip-height", - title: "GET Block Tip Height", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-tip-height', + title: 'GET Block Tip Height', description: { - default: "Returns the height of the last block." + default: 'Returns the height of the last block.' }, - urlString: "/blocks/tip/height", + urlString: '/blocks/tip/height', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4554,15 +4554,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-tip-hash", - title: "GET Block Tip Hash", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-tip-hash', + title: 'GET Block Tip Hash', description: { - default: "Returns the hash of the last block." + default: 'Returns the hash of the last block.' }, - urlString: "/blocks/tip/hash", + urlString: '/blocks/tip/hash', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4617,15 +4617,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-transaction-id", - title: "GET Block Transaction ID", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-transaction-id', + title: 'GET Block Transaction ID', description: { - default: "Returns the transaction at index :index within the specified block." + default: 'Returns the transaction at index :index within the specified block.' }, - urlString: "/block/:hash/txid/:index", + urlString: '/block/:hash/txid/:index', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4682,15 +4682,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-transaction-ids", - title: "GET Block Transaction IDs", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-transaction-ids', + title: 'GET Block Transaction IDs', description: { - default: "Returns a list of all txids in the block." + default: 'Returns a list of all txids in the block.' }, - urlString: "/block/:hash/txids", + urlString: '/block/:hash/txids', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4776,15 +4776,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-block-transactions", - title: "GET Block Transactions", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-block-transactions', + title: 'GET Block Transactions', description: { - default: "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." + default: '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.' }, - urlString: "/block/:hash/txs[/:start_index]", + urlString: '/block/:hash/txs[/:start_index]', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -4932,15 +4932,15 @@ export const restApiDocsData = [ }, { options: { electrsOnly: true }, - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-blocks", - title: "GET Blocks", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-blocks', + title: 'GET Blocks', description: { - default: "Returns details on the past 10 blocks. If :startHeight is specified, the 10 blocks before (and including) :startHeight are returned." + default: 'Returns details on the past 10 blocks. If :startHeight is specified, the 10 blocks before (and including) :startHeight are returned.' }, - urlString: "/blocks[/:startHeight]", + urlString: '/blocks[/:startHeight]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -5081,15 +5081,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-blocks-v1", - title: "GET Blocks (v1)", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-blocks-v1', + title: 'GET Blocks (v1)', description: { - default: "Returns details on the past 15 blocks from Mempool's Node.js backend. Includes fee and mining details in an extras field. If :startHeight is specified, the past 15 blocks before (and including) :startHeight are returned." + default: 'Returns details on the past 15 blocks from Mempool\'s Node.js backend. Includes fee and mining details in an extras field. If :startHeight is specified, the past 15 blocks before (and including) :startHeight are returned.' }, - urlString: "/v1/blocks[/:startHeight]", + urlString: '/v1/blocks[/:startHeight]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -5305,15 +5305,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-blocks-bulk", - title: "GET Blocks (Bulk)", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-blocks-bulk', + title: 'GET Blocks (Bulk)', description: { - default: "

Returns details on the range of blocks between :minHeight and :maxHeight, inclusive, up to 10 blocks. If :maxHeight is not specified, it defaults to the current tip.

To return data for more than 10 blocks, consider becoming an enterprise sponsor.

" + default: '

Returns details on the range of blocks between :minHeight and :maxHeight, inclusive, up to 10 blocks. If :maxHeight is not specified, it defaults to the current tip.

To return data for more than 10 blocks, consider becoming an enterprise sponsor.

' }, - urlString: "/v1/blocks-bulk/:minHeight[/:maxHeight]", + urlString: '/v1/blocks-bulk/:minHeight[/:maxHeight]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -5517,15 +5517,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-blocks", - title: "GET Blocks", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-blocks', + title: 'GET Blocks', description: { - default: "Returns details on the past 10 blocks with fee and mining details in an extras field. If :startHeight is specified, the past 10 blocks before (and including) :startHeight are returned." + default: 'Returns details on the past 10 blocks with fee and mining details in an extras field. If :startHeight is specified, the past 10 blocks before (and including) :startHeight are returned.' }, - urlString: "/blocks[/:startHeight]", + urlString: '/blocks[/:startHeight]', showConditions: liquidNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -5617,15 +5617,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "blocks", - httpRequestMethod: "GET", - fragment: "get-blocks-v1", - title: "GET Blocks (v1)", + type: 'endpoint', + category: 'blocks', + httpRequestMethod: 'GET', + fragment: 'get-blocks-v1', + title: 'GET Blocks (v1)', description: { - default: "Returns details on the past 15 blocks from Mempool's Node.js backend. If :startHeight is specified, the past 15 blocks before (and including) :startHeight are returned." + default: 'Returns details on the past 15 blocks from Mempool\'s Node.js backend. If :startHeight is specified, the past 15 blocks before (and including) :startHeight are returned.' }, - urlString: "/v1/blocks[/:startHeight]", + urlString: '/v1/blocks[/:startHeight]', showConditions: liquidNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -5716,22 +5716,22 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "mining", - fragment: "mining", - title: "Mining", + type: 'category', + category: 'mining', + fragment: 'mining', + title: 'Mining', showConditions: bitcoinNetworks }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-mining-pools", - title: "GET Mining Pools", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-mining-pools', + title: 'GET Mining Pools', description: { - default: "Returns a list of all known mining pools ordered by blocks found over the specified trailing :timePeriod.

Leave :timePeriod unspecified to get all available data, or specify one of the following values: " + miningTimeIntervals + "." + default: 'Returns a list of all known mining pools ordered by blocks found over the specified trailing :timePeriod.

Leave :timePeriod unspecified to get all available data, or specify one of the following values: ' + miningTimeIntervals + '.' }, - urlString: "/v1/mining/pools[/:timePeriod]", + urlString: '/v1/mining/pools[/:timePeriod]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -5821,15 +5821,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-mining-pool", - title: "GET Mining Pool", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-mining-pool', + title: 'GET Mining Pool', description: { - default: "

Returns details about the mining pool specified by :slug.

" + default: '

Returns details about the mining pool specified by :slug.

' }, - urlString: "/v1/mining/pool/:slug", + urlString: '/v1/mining/pool/:slug', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -5913,15 +5913,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-mining-pool-hashrates", - title: "GET Mining Pool Hashrates", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-mining-pool-hashrates', + title: 'GET Mining Pool Hashrates', description: { - default: "

Returns average hashrates (and share of total hashrate) of mining pools active in the specified trailing :timePeriod, in descending order of hashrate.

Leave :timePeriod unspecified to get all available data, or specify any of the following time periods: " + miningTimeIntervals.substr(52) + ".

" + default: '

Returns average hashrates (and share of total hashrate) of mining pools active in the specified trailing :timePeriod, in descending order of hashrate.

Leave :timePeriod unspecified to get all available data, or specify any of the following time periods: ' + miningTimeIntervals.substr(52) + '.

' }, - urlString: "/v1/mining/hashrate/pools/[:timePeriod]", + urlString: '/v1/mining/hashrate/pools/[:timePeriod]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6019,15 +6019,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-mining-pool-hashrate", - title: "GET Mining Pool Hashrate", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-mining-pool-hashrate', + title: 'GET Mining Pool Hashrate', description: { - default: "Returns all known hashrate data for the mining pool specified by :slug. Hashrate values are weekly averages." + default: 'Returns all known hashrate data for the mining pool specified by :slug. Hashrate values are weekly averages.' }, - urlString: "/v1/mining/pool/:slug/hashrate", + urlString: '/v1/mining/pool/:slug/hashrate', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6139,15 +6139,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-mining-pool-blocks", - title: "GET Mining Pool Blocks", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-mining-pool-blocks', + title: 'GET Mining Pool Blocks', description: { - default: "Returns past 10 blocks mined by the specified mining pool (:slug) before the specified :blockHeight. If no :blockHeight is specified, the mining pool's 10 most recent blocks are returned." + default: 'Returns past 10 blocks mined by the specified mining pool (:slug) before the specified :blockHeight. If no :blockHeight is specified, the mining pool\'s 10 most recent blocks are returned.' }, - urlString: "/v1/mining/pool/:slug/blocks/[:blockHeight]", + urlString: '/v1/mining/pool/:slug/blocks/[:blockHeight]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6348,15 +6348,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-hashrate", - title: "GET Hashrate", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-hashrate', + title: 'GET Hashrate', description: { - default: "

Returns network-wide hashrate and difficulty figures over the specified trailing :timePeriod:

  • Current (real-time) hashrate
  • Current (real-time) difficulty
  • Historical daily average hashrates
  • Historical difficulty

Valid values for :timePeriod are " + miningTimeIntervals.substr(52) + ". If no time interval is specified, all available data is returned.

Be sure that INDEXING_BLOCKS_AMOUNT is set properly in your backend config so that enough blocks are indexed to properly serve your request.

" + default: '

Returns network-wide hashrate and difficulty figures over the specified trailing :timePeriod:

  • Current (real-time) hashrate
  • Current (real-time) difficulty
  • Historical daily average hashrates
  • Historical difficulty

Valid values for :timePeriod are ' + miningTimeIntervals.substr(52) + '. If no time interval is specified, all available data is returned.

Be sure that INDEXING_BLOCKS_AMOUNT is set properly in your backend config so that enough blocks are indexed to properly serve your request.

' }, - urlString: "/v1/mining/hashrate/[:timePeriod]", + urlString: '/v1/mining/hashrate/[:timePeriod]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6467,15 +6467,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-difficulty-adjustments", - title: "GET Difficulty Adjustments", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-difficulty-adjustments', + title: 'GET Difficulty Adjustments', description: { - default: "

Returns the record of difficulty adjustments over the specified trailing :interval:

  • Block timestamp
  • Block height
  • Difficulty
  • Difficulty change

If no time interval is specified, all available data is returned." + default: '

Returns the record of difficulty adjustments over the specified trailing :interval:

  • Block timestamp
  • Block height
  • Difficulty
  • Difficulty change

If no time interval is specified, all available data is returned.' }, - urlString: "/v1/mining/difficulty-adjustments/[:interval]", + urlString: '/v1/mining/difficulty-adjustments/[:interval]', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6561,15 +6561,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-reward-stats", - title: "GET Reward Stats", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-reward-stats', + title: 'GET Reward Stats', description: { - default: "Returns block reward and total transactions confirmed for the past :blockCount blocks." + default: 'Returns block reward and total transactions confirmed for the past :blockCount blocks.' }, - urlString: "/v1/mining/reward-stats/:blockCount", + urlString: '/v1/mining/reward-stats/:blockCount', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6621,15 +6621,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-block-fees", - title: "GET Block Fees", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-block-fees', + title: 'GET Block Fees', description: { - default: "

Returns average total fees for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: " + miningTimeIntervals + ".

For 24h and 3d time periods, every block is included and fee amounts are exact (not averages). For the 1w time period, fees may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, fees are averages.

" + default: '

Returns average total fees for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: ' + miningTimeIntervals + '.

For 24h and 3d time periods, every block is included and fee amounts are exact (not averages). For the 1w time period, fees may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, fees are averages.

' }, - urlString: "/v1/mining/blocks/fees/:timePeriod", + urlString: '/v1/mining/blocks/fees/:timePeriod', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6719,15 +6719,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-block-rewards", - title: "GET Block Rewards", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-block-rewards', + title: 'GET Block Rewards', description: { - default: "

Returns average block rewards for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: " + miningTimeIntervals + ".

For 24h and 3d time periods, every block is included and block rewards are exact (not averages). For the 1w time period, block rewards may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, block rewards are averages.

" + default: '

Returns average block rewards for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: ' + miningTimeIntervals + '.

For 24h and 3d time periods, every block is included and block rewards are exact (not averages). For the 1w time period, block rewards may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, block rewards are averages.

' }, - urlString: "/v1/mining/blocks/rewards/:timePeriod", + urlString: '/v1/mining/blocks/rewards/:timePeriod', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6812,15 +6812,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-block-feerates", - title: "GET Block Feerates", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-block-feerates', + title: 'GET Block Feerates', description: { - default: "Returns average feerate percentiles for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: " + miningTimeIntervals + ".

For 24h and 3d time periods, every block is included and percentiles are exact (not averages). For the 1w time period, percentiles may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, percentiles are averages." + default: 'Returns average feerate percentiles for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: ' + miningTimeIntervals + '.

For 24h and 3d time periods, every block is included and percentiles are exact (not averages). For the 1w time period, percentiles may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, percentiles are averages.' }, - urlString: "/v1/mining/blocks/fee-rates/:timePeriod", + urlString: '/v1/mining/blocks/fee-rates/:timePeriod', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -6938,15 +6938,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-sizes-weights", - title: "GET Block Sizes and Weights", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-sizes-weights', + title: 'GET Block Sizes and Weights', description: { - default: "

Returns average size (bytes) and average weight (weight units) for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: " + miningTimeIntervals + ".

For 24h and 3d time periods, every block is included and figures are exact (not averages). For the 1w time period, figures may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, figures are averages.

" + default: '

Returns average size (bytes) and average weight (weight units) for blocks in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: ' + miningTimeIntervals + '.

For 24h and 3d time periods, every block is included and figures are exact (not averages). For the 1w time period, figures may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, figures are averages.

' }, - urlString: "/v1/mining/blocks/sizes-weights/:timePeriod", + urlString: '/v1/mining/blocks/sizes-weights/:timePeriod', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -7081,15 +7081,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-block-predictions", - title: "GET Block Predictions", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-block-predictions', + title: 'GET Block Predictions', description: { - default: "

Returns average block health in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: " + miningTimeIntervals + ".

For 24h and 3d time periods, every block is included and figures are exact (not averages). For the 1w time period, figures may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, figures are averages.

" + default: '

Returns average block health in the specified :timePeriod, ordered oldest to newest. :timePeriod can be any of the following: ' + miningTimeIntervals + '.

For 24h and 3d time periods, every block is included and figures are exact (not averages). For the 1w time period, figures may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, figures are averages.

' }, - urlString: ["/v1/mining/blocks/predictions/:timePeriod"], + urlString: ['/v1/mining/blocks/predictions/:timePeriod'], showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -7189,15 +7189,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-block-audit-score", - title: "GET Block Audit Score", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-block-audit-score', + title: 'GET Block Audit Score', description: { - default: "Returns the block audit score for the specified :blockHash. Available fields: hash, matchRate, expectedFees, and expectedWeight." + default: 'Returns the block audit score for the specified :blockHash. Available fields: hash, matchRate, expectedFees, and expectedWeight.' }, - urlString: ["/v1/mining/blocks/audit/score/:blockHash"], + urlString: ['/v1/mining/blocks/audit/score/:blockHash'], showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -7246,15 +7246,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-blocks-audit-scores", - title: "GET Blocks Audit Scores", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-blocks-audit-scores', + title: 'GET Blocks Audit Scores', description: { - default: "Returns blocks audit score for the past 16 blocks. If :startHeight is specified, the past 15 blocks before (and including) :startHeight are returned. Available fields: hash, matchRate, expectedFees, and expectedWeight." + default: 'Returns blocks audit score for the past 16 blocks. If :startHeight is specified, the past 15 blocks before (and including) :startHeight are returned. Available fields: hash, matchRate, expectedFees, and expectedWeight.' }, - urlString: ["/v1/mining/blocks/audit/scores/:startHeight"], + urlString: ['/v1/mining/blocks/audit/scores/:startHeight'], showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -7330,15 +7330,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mining", - httpRequestMethod: "GET", - fragment: "get-block-audit-summary", - title: "GET Block Audit Summary", + type: 'endpoint', + category: 'mining', + httpRequestMethod: 'GET', + fragment: 'get-block-audit-summary', + title: 'GET Block Audit Summary', description: { - default: "Returns the block audit summary for the specified :blockHash. Available fields: height, id, timestamp, template, missingTxs, addedTxs, freshTxs, sigopTxs, fullrbfTxs, acceleratedTxs, matchRate, expectedFees, and expectedWeight." + default: 'Returns the block audit summary for the specified :blockHash. Available fields: height, id, timestamp, template, missingTxs, addedTxs, freshTxs, sigopTxs, fullrbfTxs, acceleratedTxs, matchRate, expectedFees, and expectedWeight.' }, - urlString: ["/v1/block/:blockHash/audit-summary"], + urlString: ['/v1/block/:blockHash/audit-summary'], showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -7478,22 +7478,22 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "fees", - fragment: "fees", - title: "Fees", + type: 'category', + category: 'fees', + fragment: 'fees', + title: 'Fees', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "fees", - httpRequestMethod: "GET", - fragment: "get-mempool-blocks-fees", - title: "GET Mempool Blocks Fees", + type: 'endpoint', + category: 'fees', + httpRequestMethod: 'GET', + fragment: 'get-mempool-blocks-fees', + title: 'GET Mempool Blocks Fees', description: { - default: "Returns current mempool as projected blocks." + default: 'Returns current mempool as projected blocks.' }, - urlString: "/v1/fees/mempool-blocks", + urlString: '/v1/fees/mempool-blocks', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -7638,15 +7638,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "fees", - httpRequestMethod: "GET", - fragment: "get-recommended-fees", - title: "GET Recommended Fees", + type: 'endpoint', + category: 'fees', + httpRequestMethod: 'GET', + fragment: 'get-recommended-fees', + title: 'GET Recommended Fees', description: { - default: "Returns our currently suggested fees for new transactions." + default: 'Returns our currently suggested fees for new transactions.' }, - urlString: "/v1/fees/recommended", + urlString: '/v1/fees/recommended', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -7731,15 +7731,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "fees", - httpRequestMethod: "GET", - fragment: "get-recommended-fees-precise", - title: "GET Recommended Fees (Precise)", + type: 'endpoint', + category: 'fees', + httpRequestMethod: 'GET', + fragment: 'get-recommended-fees-precise', + title: 'GET Recommended Fees (Precise)', description: { - default: "Returns our currently-suggested feerates with up to 3 decimal places, including sub-sat feerates down to 0.1 s/vb." + default: 'Returns our currently-suggested feerates with up to 3 decimal places, including sub-sat feerates down to 0.1 s/vb.' }, - urlString: "/v1/fees/precise", + urlString: '/v1/fees/precise', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -7813,22 +7813,22 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "mempool", - fragment: "mempool", - title: "Mempool", + type: 'category', + category: 'mempool', + fragment: 'mempool', + title: 'Mempool', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "mempool", - httpRequestMethod: "GET", - fragment: "get-mempool", - title: "GET Mempool", + type: 'endpoint', + category: 'mempool', + httpRequestMethod: 'GET', + fragment: 'get-mempool', + title: 'GET Mempool', description: { - default: "Returns current mempool backlog statistics." + default: 'Returns current mempool backlog statistics.' }, - urlString: "/mempool", + urlString: '/mempool', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -7923,15 +7923,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - httpRequestMethod: "GET", - fragment: "get-mempool-transaction-ids", - title: "GET Mempool Transaction IDs", + type: 'endpoint', + category: 'mempool', + httpRequestMethod: 'GET', + fragment: 'get-mempool-transaction-ids', + title: 'GET Mempool Transaction IDs', description: { - default: "Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind." + default: 'Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.' }, - urlString: "/mempool/txids", + urlString: '/mempool/txids', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -8009,15 +8009,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - httpRequestMethod: "GET", - fragment: "get-mempool-recent", - title: "GET Mempool Recent", + type: 'endpoint', + category: 'mempool', + httpRequestMethod: 'GET', + fragment: 'get-mempool-recent', + title: 'GET Mempool Recent', description: { - default: "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." + default: '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.' }, - urlString: "/mempool/recent", + urlString: '/mempool/recent', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -8115,15 +8115,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - httpRequestMethod: "GET", - fragment: "get-mempool-rbf", - title: "GET Mempool RBF Transactions", + type: 'endpoint', + category: 'mempool', + httpRequestMethod: 'GET', + fragment: 'get-mempool-rbf', + title: 'GET Mempool RBF Transactions', description: { - default: "Returns the list of mempool transactions that are part of a RBF chain." + default: 'Returns the list of mempool transactions that are part of a RBF chain.' }, - urlString: "/v1/replacements", + urlString: '/v1/replacements', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -8245,15 +8245,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "mempool", - httpRequestMethod: "GET", - fragment: "get-mempool-fullrbf", - title: "GET Mempool Full RBF Transactions", + type: 'endpoint', + category: 'mempool', + httpRequestMethod: 'GET', + fragment: 'get-mempool-fullrbf', + title: 'GET Mempool Full RBF Transactions', description: { - default: "Returns the list of mempool transactions that are part of a Full-RBF chain." + default: 'Returns the list of mempool transactions that are part of a Full-RBF chain.' }, - urlString: "/v1/fullrbf/replacements", + urlString: '/v1/fullrbf/replacements', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -8374,22 +8374,22 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "transactions", - fragment: "transactions", - title: "Transactions", + type: 'category', + category: 'transactions', + fragment: 'transactions', + title: 'Transactions', showConditions: bitcoinNetworks.concat(liquidNetworks) }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-cpfp", - title: "GET Children Pay for Parent", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-cpfp', + title: 'GET Children Pay for Parent', description: { - default: "Returns the ancestors and the best descendant fees for a transaction." + default: 'Returns the ancestors and the best descendant fees for a transaction.' }, - urlString: "/v1/cpfp", + urlString: '/v1/cpfp', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -8446,15 +8446,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction", - title: "GET Transaction", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction', + title: 'GET Transaction', description: { - default: "Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status." + default: 'Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.' }, - urlString: "/tx/:txid", + urlString: '/tx/:txid', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -8586,15 +8586,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-hex", - title: "GET Transaction Hex", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-hex', + title: 'GET Transaction Hex', description: { - default: "Returns a transaction serialized as hex." + default: 'Returns a transaction serialized as hex.' }, - urlString: "/tx/:txid/hex", + urlString: '/tx/:txid/hex', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -8651,15 +8651,15 @@ export const restApiDocsData = [ }, }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-merkleblock-proof", - title: "GET Transaction Merkleblock Proof", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-merkleblock-proof', + title: 'GET Transaction Merkleblock Proof', description: { - default: "Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format." + default: 'Returns a merkle inclusion proof for the transaction using bitcoind\'s merkleblock format.' }, - urlString: "/tx/:txid/merkleblock-proof", + urlString: '/tx/:txid/merkleblock-proof', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefault, codeExample: { @@ -8706,15 +8706,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-merkle-proof", - title: "GET Transaction Merkle Proof", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-merkle-proof', + title: 'GET Transaction Merkle Proof', description: { - default: "Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format." + default: 'Returns a merkle inclusion proof for the transaction using Electrum\'s blockchain.transaction.get_merkle format.' }, - urlString: "/tx/:txid/merkle-proof", + urlString: '/tx/:txid/merkle-proof', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -8823,15 +8823,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-outspend", - title: "GET Transaction Outspend", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-outspend', + title: 'GET Transaction Outspend', description: { - default: "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)." + default: '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).' }, - urlString: "/tx/:txid/outspend/:vout", + urlString: '/tx/:txid/outspend/:vout', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -8944,15 +8944,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-outspends", - title: "GET Transaction Outspends", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-outspends', + title: 'GET Transaction Outspends', description: { - default: "Returns the spending status of all transaction outputs." + default: 'Returns the spending status of all transaction outputs.' }, - urlString: "/tx/:txid/outspends", + urlString: '/tx/:txid/outspends', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -9080,15 +9080,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-raw", - title: "GET Transaction Raw", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-raw', + title: 'GET Transaction Raw', description: { - default: "Returns a transaction as binary data." + default: 'Returns a transaction as binary data.' }, - urlString: "/tx/:txid/raw", + urlString: '/tx/:txid/raw', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -9145,15 +9145,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-rbf-timeline", - title: "GET Transaction RBF Timeline", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-rbf-timeline', + title: 'GET Transaction RBF Timeline', description: { - default: "Returns the RBF tree timeline of a transaction." + default: 'Returns the RBF tree timeline of a transaction.' }, - urlString: "v1/tx/:txId/rbf", + urlString: 'v1/tx/:txId/rbf', showConditions: bitcoinNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -9286,15 +9286,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-status", - title: "GET Transaction Status", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-status', + title: 'GET Transaction Status', description: { - default: "Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional)." + default: 'Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).' }, - urlString: "/tx/:txid/status", + urlString: '/tx/:txid/status', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -9373,15 +9373,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "GET", - fragment: "get-transaction-times", - title: "GET Transaction Times", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'GET', + fragment: 'get-transaction-times', + title: 'GET Transaction Times', description: { - default: "Returns the timestamps when a list of unconfirmed transactions was initially observed in the mempool. If a transaction is not found in the mempool or has been mined, the timestamp will be 0." + default: 'Returns the timestamps when a list of unconfirmed transactions was initially observed in the mempool. If a transaction is not found in the mempool or has been mined, the timestamp will be 0.' }, - urlString: "/v1/transaction-times", + urlString: '/v1/transaction-times', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -9415,15 +9415,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "transactions", - httpRequestMethod: "POST", - fragment: "post-transaction", - title: "POST Transaction", + type: 'endpoint', + category: 'transactions', + httpRequestMethod: 'POST', + fragment: 'post-transaction', + title: 'POST Transaction', description: { - default: "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." + default: '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.' }, - urlString: "/api/tx", + urlString: '/api/tx', showConditions: bitcoinNetworks.concat(liquidNetworks), showJsExamples: showJsExamplesDefault, codeExample: { @@ -9482,22 +9482,22 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "lightning", - fragment: "lightning", - title: "Lightning", + type: 'category', + category: 'lightning', + fragment: 'lightning', + title: 'Lightning', showConditions: lightningNetworks }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-lightning-network-stats", - title: "GET Network Stats", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-lightning-network-stats', + title: 'GET Network Stats', description: { - default: "

Returns network-wide stats such as total number of channels and nodes, total capacity, and average/median fee figures.

Pass one of the following for :interval: latest, 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y.

" + default: '

Returns network-wide stats such as total number of channels and nodes, total capacity, and average/median fee figures.

Pass one of the following for :interval: latest, 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y.

' }, - urlString: "/v1/lightning/statistics/:interval", + urlString: '/v1/lightning/statistics/:interval', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -9585,15 +9585,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-lightning-nodes-channels", - title: "GET Nodes/Channels", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-lightning-nodes-channels', + title: 'GET Nodes/Channels', description: { - default: "

Returns Lightning nodes and channels that match a full-text, case-insensitive search :query across node aliases, node pubkeys, channel IDs, and short channel IDs.

" + default: '

Returns Lightning nodes and channels that match a full-text, case-insensitive search :query across node aliases, node pubkeys, channel IDs, and short channel IDs.

' }, - urlString: "/v1/lightning/search?searchText=:query", + urlString: '/v1/lightning/search?searchText=:query', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -9670,15 +9670,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-lightning-nodes-country", - title: "GET Nodes in Country", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-lightning-nodes-country', + title: 'GET Nodes in Country', description: { - default: "

Returns a list of Lightning nodes running on clearnet in the requested :country, where :country is an ISO Alpha-2 country code.

" + default: '

Returns a list of Lightning nodes running on clearnet in the requested :country, where :country is an ISO Alpha-2 country code.

' }, - urlString: "/v1/lightning/nodes/country/:country", + urlString: '/v1/lightning/nodes/country/:country', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -9892,15 +9892,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-country-node-stats", - title: "GET Node Stats Per Country", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-country-node-stats', + title: 'GET Node Stats Per Country', description: { - default: "

Returns aggregate capacity and number of clearnet nodes per country. Capacity figures are in satoshis.

" + default: '

Returns aggregate capacity and number of clearnet nodes per country. Capacity figures are in satoshis.

' }, - urlString: "/v1/lightning/nodes/countries", + urlString: '/v1/lightning/nodes/countries', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -10036,15 +10036,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-isp-nodes", - title: "GET ISP Nodes", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-isp-nodes', + title: 'GET ISP Nodes', description: { - default: "

Returns a list of nodes hosted by a specified :isp, where :isp is an ISP's ASN.

" + default: '

Returns a list of nodes hosted by a specified :isp, where :isp is an ISP\'s ASN.

' }, - urlString: "/v1/lightning/nodes/isp/:isp", + urlString: '/v1/lightning/nodes/isp/:isp', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -10155,15 +10155,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-isp-node-stats", - title: "GET Node Stats Per ISP", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-isp-node-stats', + title: 'GET Node Stats Per ISP', description: { - default: "

Returns aggregate capacity, number of nodes, and number of channels per ISP. Capacity figures are in satoshis.

" + default: '

Returns aggregate capacity, number of nodes, and number of channels per ISP. Capacity figures are in satoshis.

' }, - urlString: "/v1/lightning/nodes/isp-ranking", + urlString: '/v1/lightning/nodes/isp-ranking', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -10267,15 +10267,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-top-100-nodes", - title: "GET Top 100 Nodes", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-top-100-nodes', + title: 'GET Top 100 Nodes', description: { - default: "

Returns two lists of the top 100 nodes: one ordered by liquidity (aggregate channel capacity) and the other ordered by connectivity (number of open channels).

" + default: '

Returns two lists of the top 100 nodes: one ordered by liquidity (aggregate channel capacity) and the other ordered by connectivity (number of open channels).

' }, - urlString: "/v1/lightning/nodes/rankings", + urlString: '/v1/lightning/nodes/rankings', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -10390,15 +10390,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-top-100-nodes-liquidity", - title: "GET Top 100 Nodes by Liquidity", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-top-100-nodes-liquidity', + title: 'GET Top 100 Nodes by Liquidity', description: { - default: "

Returns a list of the top 100 nodes by liquidity (aggregate channel capacity).

" + default: '

Returns a list of the top 100 nodes by liquidity (aggregate channel capacity).

' }, - urlString: "/v1/lightning/nodes/rankings/liquidity", + urlString: '/v1/lightning/nodes/rankings/liquidity', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -10587,15 +10587,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-top-100-nodes-connectivity", - title: "GET Top 100 Nodes by Connectivity", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-top-100-nodes-connectivity', + title: 'GET Top 100 Nodes by Connectivity', description: { - default: "

Returns a list of the top 100 nodes by connectivity (number of open channels).

" + default: '

Returns a list of the top 100 nodes by connectivity (number of open channels).

' }, - urlString: "/v1/lightning/nodes/rankings/connectivity", + urlString: '/v1/lightning/nodes/rankings/connectivity', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -10783,15 +10783,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-top-100-oldest-nodes", - title: "GET Top 100 Oldest Nodes", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-top-100-oldest-nodes', + title: 'GET Top 100 Oldest Nodes', description: { - default: "

Returns a list of the top 100 oldest nodes.

" + default: '

Returns a list of the top 100 oldest nodes.

' }, - urlString: "/v1/lightning/nodes/rankings/age", + urlString: '/v1/lightning/nodes/rankings/age', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -10970,15 +10970,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-node-stats", - title: "GET Node Stats", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-node-stats', + title: 'GET Node Stats', description: { - default: "

Returns details about a node with the given :pubKey.

" + default: '

Returns details about a node with the given :pubKey.

' }, - urlString: "/v1/lightning/nodes/:pubKey", + urlString: '/v1/lightning/nodes/:pubKey', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -11134,15 +11134,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-historical-node-stats", - title: "GET Historical Node Stats", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-historical-node-stats', + title: 'GET Historical Node Stats', description: { - default: "

Returns historical stats for a node with the given :pubKey.

" + default: '

Returns historical stats for a node with the given :pubKey.

' }, - urlString: "/v1/lightning/nodes/:pubKey/statistics", + urlString: '/v1/lightning/nodes/:pubKey/statistics', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -11232,15 +11232,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-channel", - title: "GET Channel", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-channel', + title: 'GET Channel', description: { - default: "

Returns info about a Lightning channel with the given :channelId.

" + default: '

Returns info about a Lightning channel with the given :channelId.

' }, - urlString: "/v1/lightning/channels/:channelId", + urlString: '/v1/lightning/channels/:channelId', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -11397,15 +11397,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-channels-from-txid", - title: "GET Channels from TXID", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-channels-from-txid', + title: 'GET Channels from TXID', description: { - default: "

Returns channels that correspond to the given :txid (multiple transaction IDs can be specified).

" + default: '

Returns channels that correspond to the given :txid (multiple transaction IDs can be specified).

' }, - urlString: "/v1/lightning/channels/txids?txId[]=:txid", + urlString: '/v1/lightning/channels/txids?txId[]=:txid', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -11598,15 +11598,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-channels-from-pubkey", - title: "GET Channels from Node Pubkey", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-channels-from-pubkey', + title: 'GET Channels from Node Pubkey', description: { - default: "

Returns a list of a node's channels given its :pubKey. Ten channels are returned at a time. Use :index for paging. :channelStatus can be open, active, or closed.

" + default: '

Returns a list of a node\'s channels given its :pubKey. Ten channels are returned at a time. Use :index for paging. :channelStatus can be open, active, or closed.

' }, - urlString: "/v1/lightning/channels?public_key=:pubKey&status=:channelStatus", + urlString: '/v1/lightning/channels?public_key=:pubKey&status=:channelStatus', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -11734,15 +11734,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-channel-geodata", - title: "GET Channel Geodata", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-channel-geodata', + title: 'GET Channel Geodata', description: { - default: "

Returns a list of channels with corresponding node geodata.

" + default: '

Returns a list of channels with corresponding node geodata.

' }, - urlString: "/v1/lightning/channels-geo", + urlString: '/v1/lightning/channels-geo', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -11842,15 +11842,15 @@ export const restApiDocsData = [ } }, { - type: "endpoint", - category: "lightning", - httpRequestMethod: "GET", - fragment: "get-channel-geodata-node", - title: "GET Channel Geodata for Node", + type: 'endpoint', + category: 'lightning', + httpRequestMethod: 'GET', + fragment: 'get-channel-geodata-node', + title: 'GET Channel Geodata for Node', description: { - default: "

Returns a list of channels with corresponding geodata for a node with the given :pubKey.

" + default: '

Returns a list of channels with corresponding geodata for a node with the given :pubKey.

' }, - urlString: "/v1/lightning/channels-geo/:pubKey", + urlString: '/v1/lightning/channels-geo/:pubKey', showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { @@ -11950,25 +11950,25 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "accelerator-public", - fragment: "accelerator-public", - title: "Accelerator (Public)", - showConditions: [""], + type: 'category', + category: 'accelerator-public', + fragment: 'accelerator-public', + title: 'Accelerator (Public)', + showConditions: [''], options: { officialOnly: true }, }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-public", - httpRequestMethod: "POST", - fragment: "accelerator-estimate", - title: "POST Calculate Estimated Costs", + type: 'endpoint', + category: 'accelerator-public', + httpRequestMethod: 'POST', + fragment: 'accelerator-estimate', + title: 'POST Calculate Estimated Costs', description: { - default: "

Returns estimated costs to accelerate a transaction. Optionally set the X-Mempool-Auth header to get customized estimation.

" + default: '

Returns estimated costs to accelerate a transaction. Optionally set the X-Mempool-Auth header to get customized estimation.

' }, - urlString: "/v1/services/accelerator/estimate", - showConditions: [""], + urlString: '/v1/services/accelerator/estimate', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -11980,8 +11980,8 @@ export const restApiDocsData = [ codeSampleMainnet: { esModule: [], commonJS: [], - curl: ["txInput=ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29"], - headers: "X-Mempool-Auth: stacksats", + curl: ['txInput=ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29'], + headers: 'X-Mempool-Auth: stacksats', response: `{ "txSummary": { "txid": "ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29", @@ -12034,16 +12034,16 @@ export const restApiDocsData = [ }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-public", - httpRequestMethod: "POST", - fragment: "accelerator-get-invoice", - title: "POST Generate Acceleration Invoice", + type: 'endpoint', + category: 'accelerator-public', + httpRequestMethod: 'POST', + fragment: 'accelerator-get-invoice', + title: 'POST Generate Acceleration Invoice', description: { - default: "

Request a LN invoice to accelerate a transaction.

" + default: '

Request a LN invoice to accelerate a transaction.

' }, - urlString: "/v1/services/payments/bitcoin", - showConditions: [""], + urlString: '/v1/services/payments/bitcoin', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12055,8 +12055,8 @@ export const restApiDocsData = [ codeSampleMainnet: { esModule: [], commonJS: [], - curl: ["product=ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29&amount=12500"], - headers: "", + curl: ['product=ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29&amount=12500'], + headers: '', response: `[ { "btcpayInvoiceId": "4Ww53d7VgSa596jmCFufe7", @@ -12074,16 +12074,16 @@ export const restApiDocsData = [ }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-public", - httpRequestMethod: "GET", - fragment: "accelerator-pending", - title: "GET Pending Accelerations", + type: 'endpoint', + category: 'accelerator-public', + httpRequestMethod: 'GET', + fragment: 'accelerator-pending', + title: 'GET Pending Accelerations', description: { - default: "

Returns all transactions currently being accelerated.

" + default: '

Returns all transactions currently being accelerated.

' }, - urlString: "/v1/services/accelerator/accelerations", - showConditions: [""], + urlString: '/v1/services/accelerator/accelerations', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12125,11 +12125,11 @@ export const restApiDocsData = [ }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-public", - httpRequestMethod: "GET", - fragment: "accelerator-public-history", - title: "GET Acceleration History", + type: 'endpoint', + category: 'accelerator-public', + httpRequestMethod: 'GET', + fragment: 'accelerator-public-history', + title: 'GET Acceleration History', description: { default: `

Returns all past accelerated transactions. Filters can be applied:

` }, - urlString: "/v1/services/accelerator/accelerations/history", - showConditions: [""], + urlString: '/v1/services/accelerator/accelerations/history', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12184,25 +12184,25 @@ export const restApiDocsData = [ } }, { - type: "category", - category: "accelerator-private", - fragment: "accelerator-private", - title: "Accelerator (Authenticated)", - showConditions: [""], + type: 'category', + category: 'accelerator-private', + fragment: 'accelerator-private', + title: 'Accelerator (Authenticated)', + showConditions: [''], options: { officialOnly: true }, }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-private", - httpRequestMethod: "GET", - fragment: "accelerator-top-up-history", - title: "GET Top Up History", + type: 'endpoint', + category: 'accelerator-private', + httpRequestMethod: 'GET', + fragment: 'accelerator-top-up-history', + title: 'GET Top Up History', description: { - default: "

Returns a list of top ups the user has made as prepayment for the accelerator service.

" + default: '

Returns a list of top ups the user has made as prepayment for the accelerator service.

' }, - urlString: "/v1/services/accelerator/top-up-history", - showConditions: [""], + urlString: '/v1/services/accelerator/top-up-history', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12215,7 +12215,7 @@ export const restApiDocsData = [ esModule: [], commonJS: [], curl: [], - headers: "X-Mempool-Auth: stacksats", + headers: 'X-Mempool-Auth: stacksats', response: `[ { "type": "Bitcoin", @@ -12241,16 +12241,16 @@ export const restApiDocsData = [ }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-private", - httpRequestMethod: "GET", - fragment: "accelerator-balance", - title: "GET Available Balance", + type: 'endpoint', + category: 'accelerator-private', + httpRequestMethod: 'GET', + fragment: 'accelerator-balance', + title: 'GET Available Balance', description: { - default: "

Returns the user's currently available balance, currently locked funds, and total fees paid so far.

" + default: '

Returns the user\'s currently available balance, currently locked funds, and total fees paid so far.

' }, - urlString: "/v1/services/accelerator/balance", - showConditions: [""], + urlString: '/v1/services/accelerator/balance', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12263,7 +12263,7 @@ export const restApiDocsData = [ esModule: [], commonJS: [], curl: [], - headers: "X-Mempool-Auth: stacksats", + headers: 'X-Mempool-Auth: stacksats', response: `{ "balance": 99900000, "hold": 101829, @@ -12275,16 +12275,16 @@ export const restApiDocsData = [ }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-private", - httpRequestMethod: "POST", - fragment: "accelerator-accelerate", - title: "POST Accelerate A Transaction (Pro)", + type: 'endpoint', + category: 'accelerator-private', + httpRequestMethod: 'POST', + fragment: 'accelerator-accelerate', + title: 'POST Accelerate A Transaction (Pro)', description: { - default: "

Sends a request to accelerate a transaction.

" + default: '

Sends a request to accelerate a transaction.

' }, - urlString: "/v1/services/accelerator/accelerate", - showConditions: [""], + urlString: '/v1/services/accelerator/accelerate', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12296,8 +12296,8 @@ export const restApiDocsData = [ codeSampleMainnet: { esModule: [], commonJS: [], - curl: ["txInput=ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29&userBid=21000000"], - headers: "X-Mempool-Auth: stacksats", + curl: ['txInput=ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29&userBid=21000000'], + headers: 'X-Mempool-Auth: stacksats', response: `HTTP/1.1 200 OK`, }, } @@ -12305,16 +12305,16 @@ export const restApiDocsData = [ }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-private", - httpRequestMethod: "GET", - fragment: "accelerator-history", - title: "GET Acceleration History", + type: 'endpoint', + category: 'accelerator-private', + httpRequestMethod: 'GET', + fragment: 'accelerator-history', + title: 'GET Acceleration History', description: { - default: "

Returns the user's past acceleration requests.

Pass one of the following for :status (required): all, requested, accelerating, mined, completed, failed.
Pass true in :details to get a detailed history of the acceleration request.

" + default: '

Returns the user\'s past acceleration requests.

Pass one of the following for :status (required): all, requested, accelerating, mined, completed, failed.
Pass true in :details to get a detailed history of the acceleration request.

' }, - urlString: "/v1/services/accelerator/history?status=:status&details=:details", - showConditions: [""], + urlString: '/v1/services/accelerator/history?status=:status&details=:details', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12327,7 +12327,7 @@ export const restApiDocsData = [ esModule: [], commonJS: [], curl: [], - headers: "X-Mempool-Auth: stacksats", + headers: 'X-Mempool-Auth: stacksats', response: `[ { "id": 89, @@ -12423,16 +12423,16 @@ export const restApiDocsData = [ }, { options: { officialOnly: true }, - type: "endpoint", - category: "accelerator-private", - httpRequestMethod: "POST", - fragment: "accelerator-cancel", - title: "POST Cancel Acceleration (Pro)", + type: 'endpoint', + category: 'accelerator-private', + httpRequestMethod: 'POST', + fragment: 'accelerator-cancel', + title: 'POST Cancel Acceleration (Pro)', description: { - default: "

Sends a request to cancel an acceleration in the accelerating status.
You can retrieve eligible acceleration id using the history endpoint GET /api/v1/services/accelerator/history?status=accelerating." + default: '

Sends a request to cancel an acceleration in the accelerating status.
You can retrieve eligible acceleration id using the history endpoint GET /api/v1/services/accelerator/history?status=accelerating.' }, - urlString: "/v1/services/accelerator/cancel", - showConditions: [""], + urlString: '/v1/services/accelerator/cancel', + showConditions: [''], showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -12444,8 +12444,8 @@ export const restApiDocsData = [ codeSampleMainnet: { esModule: [], commonJS: [], - curl: ["id=42"], - headers: "X-Mempool-Auth: stacksats", + curl: ['id=42'], + headers: 'X-Mempool-Auth: stacksats', response: `HTTP/1.1 200 OK`, }, } @@ -12455,272 +12455,272 @@ export const restApiDocsData = [ export const faqData = [ { - type: "category", - category: "basics", - fragment: "basics", - title: "Basics", + type: 'category', + category: 'basics', + fragment: 'basics', + title: 'Basics', showConditions: bitcoinNetworks }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-is-a-mempool", - title: "What is a mempool?", + fragment: 'what-is-a-mempool', + title: 'What is a mempool?', }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-is-a-mempool-explorer", - title: "What is a mempool explorer?", + fragment: 'what-is-a-mempool-explorer', + title: 'What is a mempool explorer?', }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-is-a-blockchain", - title: "What is a blockchain?", + fragment: 'what-is-a-blockchain', + title: 'What is a blockchain?', }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-is-a-block-explorer", - title: "What is a block explorer?", + fragment: 'what-is-a-block-explorer', + title: 'What is a block explorer?', }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-is-mining", - title: "What is mining?", + fragment: 'what-is-mining', + title: 'What is mining?', }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-are-mining-pools", - title: "What are mining pools?", + fragment: 'what-are-mining-pools', + title: 'What are mining pools?', }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-are-vb-wu", - title: "What are virtual bytes (vB) and weight units (WU)?", + fragment: 'what-are-vb-wu', + title: 'What are virtual bytes (vB) and weight units (WU)?', }, { - type: "endpoint", - category: "basics", + type: 'endpoint', + category: 'basics', showConditions: bitcoinNetworks, - fragment: "what-is-svb", - title: "What is sat/vB?", + fragment: 'what-is-svb', + title: 'What is sat/vB?', }, { - type: "category", - category: "help", - fragment: "help-stuck-transaction", - title: "Help! My transaction is stuck", + type: 'category', + category: 'help', + fragment: 'help-stuck-transaction', + title: 'Help! My transaction is stuck', showConditions: bitcoinNetworks }, { - type: "endpoint", - category: "help", + type: 'endpoint', + category: 'help', showConditions: bitcoinNetworks, - fragment: "why-is-transaction-stuck-in-mempool", - title: "Why isn't my transaction confirming?", + fragment: 'why-is-transaction-stuck-in-mempool', + title: 'Why isn\'t my transaction confirming?', }, { - type: "endpoint", - category: "help", + type: 'endpoint', + category: 'help', showConditions: bitcoinNetworks, - fragment: "how-to-get-transaction-confirmed-quickly", - title: "How can I get my transaction confirmed more quickly?", + fragment: 'how-to-get-transaction-confirmed-quickly', + title: 'How can I get my transaction confirmed more quickly?', }, { - type: "endpoint", - category: "help", + type: 'endpoint', + category: 'help', showConditions: bitcoinNetworks, - fragment: "how-prevent-stuck-transaction", - title: "How can I prevent a transaction from getting stuck in the future?", + fragment: 'how-prevent-stuck-transaction', + title: 'How can I prevent a transaction from getting stuck in the future?', }, { - type: "category", - category: "using", - fragment: "using-this-website", - title: "Using this website", + type: 'category', + category: 'using', + fragment: 'using-this-website', + title: 'Using this website', showConditions: bitcoinNetworks }, { - type: "endpoint", - category: "how-to", + type: 'endpoint', + category: 'how-to', showConditions: bitcoinNetworks, - fragment: "looking-up-transactions", - title: "How can I look up a transaction?", + fragment: 'looking-up-transactions', + title: 'How can I look up a transaction?', }, { - type: "endpoint", - category: "how-to", + type: 'endpoint', + category: 'how-to', showConditions: bitcoinNetworks, - fragment: "looking-up-addresses", - title: "How can I look up an address?", + fragment: 'looking-up-addresses', + title: 'How can I look up an address?', }, { - type: "endpoint", - category: "how-to", + type: 'endpoint', + category: 'how-to', showConditions: bitcoinNetworks, - fragment: "looking-up-blocks", - title: "How can I look up a block?", + fragment: 'looking-up-blocks', + title: 'How can I look up a block?', }, { - type: "endpoint", - category: "how-to", + type: 'endpoint', + category: 'how-to', showConditions: bitcoinNetworks, - fragment: "looking-up-fee-estimates", - title: "How can I look up fee estimates?", + fragment: 'looking-up-fee-estimates', + title: 'How can I look up fee estimates?', }, { - type: "endpoint", - category: "how-to", + type: 'endpoint', + category: 'how-to', showConditions: bitcoinNetworks, - fragment: "looking-up-historical-trends", - title: "How can I explore historical trends?", + fragment: 'looking-up-historical-trends', + title: 'How can I explore historical trends?', }, { - type: "category", - category: "advanced", - fragment: "advanced", - title: "Advanced", + type: 'category', + category: 'advanced', + fragment: 'advanced', + title: 'Advanced', showConditions: bitcoinNetworks }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "what-is-full-mempool", - title: "What does it mean for the mempool to be \"full\"?", + fragment: 'what-is-full-mempool', + title: 'What does it mean for the mempool to be "full"?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "how-big-is-mempool-used-by-mempool-space", - title: "How big is the mempool used by mempool.space?", + fragment: 'how-big-is-mempool-used-by-mempool-space', + title: 'How big is the mempool used by mempool.space?', options: { officialOnly: true }, }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "what-is-memory-usage", - title: "What is memory usage?", + fragment: 'what-is-memory-usage', + title: 'What is memory usage?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "why-empty-blocks", - title: "Why are there empty blocks?", + fragment: 'why-empty-blocks', + title: 'Why are there empty blocks?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "why-block-timestamps-dont-always-increase", - title: "Why don't block timestamps always increase?", + fragment: 'why-block-timestamps-dont-always-increase', + title: 'Why don\'t block timestamps always increase?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "why-dont-fee-ranges-match", - title: "Why doesn't the fee range shown for a block match the feerates of transactions within the block?", + fragment: 'why-dont-fee-ranges-match', + title: 'Why doesn\'t the fee range shown for a block match the feerates of transactions within the block?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, options: { auditOnly: true }, - fragment: "how-do-block-audits-work", - title: "How do block audits work?", + fragment: 'how-do-block-audits-work', + title: 'How do block audits work?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, options: { auditOnly: true }, - fragment: "what-is-block-health", - title: "What is block health?", + fragment: 'what-is-block-health', + title: 'What is block health?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "how-do-mempool-goggles-work", - title: "How do Mempool Goggles™ work?", + fragment: 'how-do-mempool-goggles-work', + title: 'How do Mempool Goggles™ work?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "what-are-sigops", - title: "What are sigops?", + fragment: 'what-are-sigops', + title: 'What are sigops?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "what-is-adjusted-vsize", - title: "What is adjusted vsize?", + fragment: 'what-is-adjusted-vsize', + title: 'What is adjusted vsize?', }, { - type: "endpoint", - category: "advanced", + type: 'endpoint', + category: 'advanced', showConditions: bitcoinNetworks, - fragment: "why-do-the-projected-block-fee-ranges-overlap", - title: "Why do the projected block fee ranges overlap?", + fragment: 'why-do-the-projected-block-fee-ranges-overlap', + title: 'Why do the projected block fee ranges overlap?', }, { - type: "category", - category: "self-hosting", - fragment: "self-hosting", - title: "Self-Hosting", + type: 'category', + category: 'self-hosting', + fragment: 'self-hosting', + title: 'Self-Hosting', showConditions: bitcoinNetworks }, { - type: "endpoint", - category: "self-hosting", + type: 'endpoint', + category: 'self-hosting', showConditions: bitcoinNetworks, - fragment: "who-runs-this-website", - title: "Who runs this website?", + fragment: 'who-runs-this-website', + title: 'Who runs this website?', }, { - type: "endpoint", - category: "self-hosting", + type: 'endpoint', + category: 'self-hosting', showConditions: bitcoinNetworks, - fragment: "host-my-own-instance-raspberry-pi", - title: "How can I host my own instance on a Raspberry Pi?", + fragment: 'host-my-own-instance-raspberry-pi', + title: 'How can I host my own instance on a Raspberry Pi?', }, { - type: "endpoint", - category: "self-hosting", + type: 'endpoint', + category: 'self-hosting', showConditions: bitcoinNetworks, - fragment: "host-my-own-instance-server", - title: "How can I host a Mempool instance on my own server?", + fragment: 'host-my-own-instance-server', + title: 'How can I host a Mempool instance on my own server?', }, { - type: "endpoint", - category: "self-hosting", + type: 'endpoint', + category: 'self-hosting', showConditions: bitcoinNetworks, - fragment: "install-mempool-with-docker", - title: "Can I install Mempool using Docker?", + fragment: 'install-mempool-with-docker', + title: 'Can I install Mempool using Docker?', }, { - type: "endpoint", - category: "self-hosting", + type: 'endpoint', + category: 'self-hosting', showConditions: bitcoinNetworks, - fragment: "address-lookup-issues", - title: "Why do I get an error for certain address lookups on my Mempool instance?", + fragment: 'address-lookup-issues', + title: 'Why do I get an error for certain address lookups on my Mempool instance?', } ]; diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts index cd084ee4f..3e2bfae8e 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.ts +++ b/frontend/src/app/docs/api-docs/api-docs.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, Input, QueryList, AfterViewInit, ViewChildren } from import { Env, StateService } from '@app/services/state.service'; import { Observable, merge, of, Subject, Subscription } from 'rxjs'; import { tap, takeUntil } from 'rxjs/operators'; -import { ActivatedRoute } from "@angular/router"; +import { ActivatedRoute } from '@angular/router'; import { faqData, restApiDocsData, wsApiDocsData } from '@app/docs/api-docs/api-docs-data'; import { FaqTemplateDirective } from '@app/docs/faq-template/faq-template.component'; @@ -23,7 +23,7 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { code: any; baseNetworkUrl = ''; @Input() whichTab: string; - desktopDocsNavPosition = "relative"; + desktopDocsNavPosition = 'relative'; faq: any[]; restDocs: any[]; wsDocs: any; @@ -49,7 +49,7 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { if (this.faqTemplates) { this.faqTemplates.forEach((x) => this.dict[x.type] = x.template); } - this.desktopDocsNavPosition = ( window.pageYOffset > 115 ) ? "fixed" : "relative"; + this.desktopDocsNavPosition = ( window.pageYOffset > 115 ) ? 'fixed' : 'relative'; this.mobileViewport = window.innerWidth <= 992; } @@ -59,7 +59,7 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { if( this.route.snapshot.fragment ) { this.openEndpointContainer( this.route.snapshot.fragment ); if (document.getElementById( this.route.snapshot.fragment )) { - let vOffset = ( window.innerWidth <= 992 ) ? 100 : 60; + const vOffset = ( window.innerWidth <= 992 ) ? 100 : 60; window.scrollTo({ top: document.getElementById( this.route.snapshot.fragment ).offsetTop - vOffset }); @@ -102,19 +102,19 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { this.network$.pipe(takeUntil(this.destroy$)).subscribe((network) => { this.active = (network === 'liquid' || network === 'liquidtestnet') ? 2 : 0; switch( network ) { - case "": + case '': this.electrsPort = 50002; break; - case "mainnet": + case 'mainnet': this.electrsPort = 50002; break; - case "testnet": + case 'testnet': this.electrsPort = 60002; break; - case "testnet4": + case 'testnet4': this.electrsPort = 40002; break; - case "signet": + case 'signet': this.electrsPort = 60602; break; - case "liquid": + case 'liquid': this.electrsPort = 51002; break; - case "liquidtestnet": + case 'liquidtestnet': this.electrsPort = 51302; break; } }); @@ -132,39 +132,39 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { } onDocScroll() { - this.desktopDocsNavPosition = ( window.pageYOffset > 115 ) ? "fixed" : "relative"; + this.desktopDocsNavPosition = ( window.pageYOffset > 115 ) ? 'fixed' : 'relative'; } anchorLinkClick( e ) { - let targetId = e.fragment; - let vOffset = ( window.innerWidth <= 992 ) ? 100 : 60; + const targetId = e.fragment; + const vOffset = ( window.innerWidth <= 992 ) ? 100 : 60; window.scrollTo({ top: document.getElementById( targetId ).offsetTop - vOffset }); - window.history.pushState({}, null, document.location.href.split("#")[0] + "#" + targetId); + window.history.pushState({}, null, document.location.href.split('#')[0] + '#' + targetId); this.openEndpointContainer( targetId ); } openEndpointContainer( targetId ) { let tabHeaderHeight = 0; - if (document.getElementById( targetId + "-tab-header" )) { - tabHeaderHeight = document.getElementById( targetId + "-tab-header" ).scrollHeight; + if (document.getElementById( targetId + '-tab-header' )) { + tabHeaderHeight = document.getElementById( targetId + '-tab-header' ).scrollHeight; } if( ( window.innerWidth <= 992 ) && ( ( this.whichTab === 'rest' ) || ( this.whichTab === 'faq' ) || ( this.whichTab === 'websocket' ) ) && targetId ) { - const endpointContainerEl = document.querySelector( "#" + targetId ); - const endpointContentEl = document.querySelector( "#" + targetId + " .endpoint-content" ); + const endpointContainerEl = document.querySelector( '#' + targetId ); + const endpointContentEl = document.querySelector( '#' + targetId + ' .endpoint-content' ); const endPointContentElHeight = endpointContentEl.clientHeight; - if( endpointContentEl.classList.contains( "open" ) ) { - endpointContainerEl.style.height = "auto"; - endpointContentEl.style.top = "-10000px"; - endpointContentEl.style.opacity = "0"; - endpointContentEl.classList.remove( "open" ); + if( endpointContentEl.classList.contains( 'open' ) ) { + endpointContainerEl.style.height = 'auto'; + endpointContentEl.style.top = '-10000px'; + endpointContentEl.style.opacity = '0'; + endpointContentEl.classList.remove( 'open' ); } else { - endpointContainerEl.style.height = endPointContentElHeight + tabHeaderHeight + 28 + "px"; - endpointContentEl.style.top = tabHeaderHeight + 28 + "px"; - endpointContentEl.style.opacity = "1"; - endpointContentEl.classList.add( "open" ); + endpointContainerEl.style.height = endPointContentElHeight + tabHeaderHeight + 28 + 'px'; + endpointContentEl.style.top = tabHeaderHeight + 28 + 'px'; + endpointContentEl.style.opacity = '1'; + endpointContentEl.classList.add( 'open' ); } } } diff --git a/frontend/src/app/docs/code-template/code-template.component.ts b/frontend/src/app/docs/code-template/code-template.component.ts index 2c227d3e8..bfbfc115a 100644 --- a/frontend/src/app/docs/code-template/code-template.component.ts +++ b/frontend/src/app/docs/code-template/code-template.component.ts @@ -25,12 +25,12 @@ export class CodeTemplateComponent implements OnInit { } adjustContainerHeight( event ) { - if( ( window.innerWidth <= 992 ) && ( this.method !== "websocket" ) ) { - const urlObj = new URL( window.location + "" ); + if( ( window.innerWidth <= 992 ) && ( this.method !== 'websocket' ) ) { + const urlObj = new URL( window.location + '' ); const endpointContainerEl = document.querySelector( urlObj.hash ); - const endpointContentEl = document.querySelector( urlObj.hash + " .endpoint-content" ); + const endpointContentEl = document.querySelector( urlObj.hash + ' .endpoint-content' ); window.setTimeout( function() { - endpointContainerEl.style.height = endpointContentEl.clientHeight + 90 + "px"; + endpointContainerEl.style.height = endpointContentEl.clientHeight + 90 + 'px'; }, 550); } } @@ -260,7 +260,7 @@ yarn add @mempool/liquid.js`; } wrapPythonTemplate(code: any) { - return ( ( this.network === 'testnet' || this.network === 'testnet4' || this.network === 'signet' ) ? ( code.codeTemplate.python.replace( "wss://mempool.space/api/v1/ws", "wss://mempool.space/" + this.network + "/api/v1/ws" ) ) : code.codeTemplate.python ); + return ( ( this.network === 'testnet' || this.network === 'testnet4' || this.network === 'signet' ) ? ( code.codeTemplate.python.replace( 'wss://mempool.space/api/v1/ws', 'wss://mempool.space/' + this.network + '/api/v1/ws' ) ) : code.codeTemplate.python ); } replaceJSPlaceholder(text: string, code: any) { @@ -274,8 +274,8 @@ yarn add @mempool/liquid.js`; replaceCurlPlaceholder(curlText: any, code: any) { let text = curlText; - text = text.replace( "[[hostname]]", this.hostname ); - text = text.replace( "[[baseNetworkUrl]]", this.baseNetworkUrl ); + text = text.replace( '[[hostname]]', this.hostname ); + text = text.replace( '[[baseNetworkUrl]]', this.baseNetworkUrl ); for (let index = 0; index < code.curl.length; index++) { const textReplace = code.curl[index]; const indexNumber = index + 1; @@ -283,7 +283,7 @@ yarn add @mempool/liquid.js`; } const headersString = code.headers ? ` -H "${code.headers}"` : ``; - + if (this.env.BASE_MODULE === 'mempool') { if (this.network === 'main' || this.network === '' || this.network === this.env.ROOT_NETWORK) { if (this.method === 'POST') { diff --git a/frontend/src/app/docs/docs/docs.component.ts b/frontend/src/app/docs/docs/docs.component.ts index 35b01be0e..d60252863 100644 --- a/frontend/src/app/docs/docs/docs.component.ts +++ b/frontend/src/app/docs/docs/docs.component.ts @@ -35,19 +35,19 @@ export class DocsComponent implements OnInit { this.showFaqTab = ( this.env.BASE_MODULE === 'mempool' ) ? true : false; this.showElectrsTab = this.stateService.env.OFFICIAL_MEMPOOL_SPACE; - document.querySelector( "html" ).style.scrollBehavior = "smooth"; + document.querySelector( 'html' ).style.scrollBehavior = 'smooth'; } ngDoCheck(): void { const url = this.route.snapshot.url; - if (url[0].path === "faq" ) { + if (url[0].path === 'faq' ) { this.activeTab = 0; this.seoService.setTitle($localize`:@@meta.title.docs.faq:FAQ`); this.seoService.setDescription($localize`:@@meta.description.docs.faq:Get answers to common questions like: What is a mempool? Why isn't my transaction confirming? How can I run my own instance of The Mempool Open Source Project? And more.`); this.ogService.setManualOgImage('faq.jpg'); - } else if( url[1].path === "rest" ) { + } else if( url[1].path === 'rest' ) { this.activeTab = 1; this.seoService.setTitle($localize`:@@meta.title.docs.rest:REST API`); if (this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet' ) { @@ -55,7 +55,7 @@ export class DocsComponent implements OnInit { } else { this.seoService.setDescription($localize`:@@meta.description.docs.rest-bitcoin:Documentation for the mempool.space REST API service: get info on addresses, transactions, blocks, fees, mining, the Lightning network, and more.`); } - } else if( url[1].path === "websocket" ) { + } else if( url[1].path === 'websocket' ) { this.activeTab = 2; this.seoService.setTitle($localize`:@@meta.title.docs.websocket:WebSocket API`); if( this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet' ) { @@ -71,6 +71,6 @@ export class DocsComponent implements OnInit { } ngOnDestroy(): void { - document.querySelector( "html" ).style.scrollBehavior = "auto"; + document.querySelector( 'html' ).style.scrollBehavior = 'auto'; } } diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts index eacd9df4b..ac449fbf3 100644 --- a/frontend/src/app/interfaces/node-api.interface.ts +++ b/frontend/src/app/interfaces/node-api.interface.ts @@ -1,4 +1,4 @@ -import { AddressTxSummary, Block, ChainStats } from "./electrs.interface"; +import { AddressTxSummary, Block, ChainStats } from './electrs.interface'; export interface OptimizedMempoolStats { added: number; @@ -91,7 +91,7 @@ export interface PegsVolume { number: number; } -export interface FederationAddress { +export interface FederationAddress { bitcoinaddress: string; balance: string; } @@ -334,13 +334,13 @@ export interface INodesRanking { export interface INodesStatisticsEntry { added: string; - avg_base_fee_mtokens: number; + avg_base_fee_mtokens: number; avg_capacity: number; avg_fee_rate: number; channel_count: number; clearnet_nodes: number; clearnet_tor_nodes: number; - id: number; + id: number; med_base_fee_mtokens: number; med_capacity: number; med_fee_rate: number; @@ -458,26 +458,26 @@ export interface TestMempoolAcceptResult { vsize?: number, fees?: { base: number, - "effective-feerate": number, - "effective-includes": string[], + 'effective-feerate': number, + 'effective-includes': string[], }, ['reject-reason']?: string, } export interface SubmitPackageResult { package_msg: string; - "tx-results": { [wtxid: string]: TxResult }; - "replaced-transactions"?: string[]; + 'tx-results': { [wtxid: string]: TxResult }; + 'replaced-transactions'?: string[]; } export interface TxResult { txid: string; - "other-wtxid"?: string; + 'other-wtxid'?: string; vsize?: number; fees?: { base: number; - "effective-feerate"?: number; - "effective-includes"?: string[]; + 'effective-feerate'?: number; + 'effective-includes'?: string[]; }; error?: string; } diff --git a/frontend/src/app/interfaces/services.interface.ts b/frontend/src/app/interfaces/services.interface.ts index f0ec6de7b..6085db749 100644 --- a/frontend/src/app/interfaces/services.interface.ts +++ b/frontend/src/app/interfaces/services.interface.ts @@ -10,5 +10,5 @@ export type MenuItem = { export type MenuGroup = { title: string; i18n: string; - items: MenuItem[]; + items: MenuItem[]; } diff --git a/frontend/src/app/lightning/channel/channel.component.ts b/frontend/src/app/lightning/channel/channel.component.ts index 19254a5e1..064206a6e 100644 --- a/frontend/src/app/lightning/channel/channel.component.ts +++ b/frontend/src/app/lightning/channel/channel.component.ts @@ -84,7 +84,7 @@ export class ChannelComponent implements OnInit { } showCloseBoxes(channel: IChannel): boolean { - return !!(channel.node_left.funding_balance || channel.node_left.closing_balance + return !!(channel.node_left.funding_balance || channel.node_left.closing_balance || channel.node_right.funding_balance || channel.node_right.closing_balance); } diff --git a/frontend/src/app/lightning/channel/closing-type/closing-type.component.ts b/frontend/src/app/lightning/channel/closing-type/closing-type.component.ts index 541011469..43243143d 100644 --- a/frontend/src/app/lightning/channel/closing-type/closing-type.component.ts +++ b/frontend/src/app/lightning/channel/closing-type/closing-type.component.ts @@ -17,7 +17,7 @@ export class ClosingTypeComponent implements OnChanges { getLabelFromType(type: number): { label: string; class: string } { switch (type) { - case 1: return { + case 1: return { label: $localize`Mutually closed`, class: 'success', }; diff --git a/frontend/src/app/lightning/channels-list/channels-list.component.ts b/frontend/src/app/lightning/channels-list/channels-list.component.ts index a7a083278..93333a48b 100644 --- a/frontend/src/app/lightning/channels-list/channels-list.component.ts +++ b/frontend/src/app/lightning/channels-list/channels-list.component.ts @@ -33,7 +33,7 @@ export class ChannelsListComponent implements OnInit, OnChanges { constructor( private lightningApiService: LightningApiService, private formBuilder: UntypedFormBuilder, - ) { + ) { this.channelStatusForm = this.formBuilder.group({ status: [this.defaultStatus], }); diff --git a/frontend/src/app/lightning/group/group.component.ts b/frontend/src/app/lightning/group/group.component.ts index fdc689c11..34a3e9e2c 100644 --- a/frontend/src/app/lightning/group/group.component.ts +++ b/frontend/src/app/lightning/group/group.component.ts @@ -89,7 +89,7 @@ export class GroupComponent implements OnInit { const sumLiquidity = nodes.reduce((partialSum, a) => partialSum + parseInt(a.capacity, 10), 0); const sumChannels = nodes.reduce((partialSum, a) => partialSum + a.opened_channel_count, 0); - + return { nodes: nodes, sumLiquidity: sumLiquidity, diff --git a/frontend/src/app/lightning/lightning-api.service.ts b/frontend/src/app/lightning/lightning-api.service.ts index 14276dc12..c4411630c 100644 --- a/frontend/src/app/lightning/lightning-api.service.ts +++ b/frontend/src/app/lightning/lightning-api.service.ts @@ -10,7 +10,7 @@ import { IChannel, INodesRanking, IOldestNodes, ITopNodesPerCapacity, ITopNodesP export class LightningApiService { private apiBaseUrl: string; // base URL is protocol, hostname, and port private apiBasePath = ''; // network path is /testnet, etc. or '' for mainnet - + private requestCache = new Map, expiry: number }>; constructor( diff --git a/frontend/src/app/lightning/node/liquidity-ad.ts b/frontend/src/app/lightning/node/liquidity-ad.ts index 4b0e04b0b..373bd5c22 100644 --- a/frontend/src/app/lightning/node/liquidity-ad.ts +++ b/frontend/src/app/lightning/node/liquidity-ad.ts @@ -18,7 +18,7 @@ export function parseLiquidityAdHex(compact_lease: string): ILiquidityAd | false channel_fee_max_rate: parseInt(compact_lease.slice(8, 12), 16), lease_fee_base_sat: parseInt(compact_lease.slice(12, 20), 16), channel_fee_max_base: compact_lease.length > 20 ? parseInt(compact_lease.slice(20), 16) : 0, - } + }; if (Object.values(liquidityAd).reduce((valid: boolean, value: number): boolean => (valid && !isNaN(value) && value >= 0), true)) { liquidityAd.compact_lease = compact_lease; return liquidityAd; diff --git a/frontend/src/app/lightning/node/node-preview.component.ts b/frontend/src/app/lightning/node/node-preview.component.ts index 63aecc4ae..4eeadcd76 100644 --- a/frontend/src/app/lightning/node/node-preview.component.ts +++ b/frontend/src/app/lightning/node/node-preview.component.ts @@ -73,7 +73,7 @@ export class NodePreviewComponent implements OnInit { label: label, socket: node.public_key + '@' + socket, }); - socketTypesMap[label] = true + socketTypesMap[label] = true; } node.socketsObject = socketsObject; this.socketTypes = Object.keys(socketTypesMap); diff --git a/frontend/src/app/lightning/nodes-channels/node-channels.component.ts b/frontend/src/app/lightning/nodes-channels/node-channels.component.ts index 90876e7f8..bbadac34e 100644 --- a/frontend/src/app/lightning/nodes-channels/node-channels.component.ts +++ b/frontend/src/app/lightning/nodes-channels/node-channels.component.ts @@ -127,7 +127,7 @@ export class NodeChannels implements OnChanges { } } ] - }; + }; } onChartInit(ec: any): void { diff --git a/frontend/src/app/lightning/nodes-per-country/nodes-per-country.component.ts b/frontend/src/app/lightning/nodes-per-country/nodes-per-country.component.ts index 213c02408..7cd8a4b9d 100644 --- a/frontend/src/app/lightning/nodes-per-country/nodes-per-country.component.ts +++ b/frontend/src/app/lightning/nodes-per-country/nodes-per-country.component.ts @@ -97,7 +97,7 @@ export class NodesPerCountry implements OnInit { }; }), tap(() => { - this.isLoading = false + this.isLoading = false; this.cd.markForCheck(); }), share() diff --git a/frontend/src/app/lightning/nodes-per-isp/nodes-per-isp.component.ts b/frontend/src/app/lightning/nodes-per-isp/nodes-per-isp.component.ts index ad8851942..66cf306ad 100644 --- a/frontend/src/app/lightning/nodes-per-isp/nodes-per-isp.component.ts +++ b/frontend/src/app/lightning/nodes-per-isp/nodes-per-isp.component.ts @@ -77,7 +77,7 @@ export class NodesPerISP implements OnInit { } } topCountry.flag = getFlagEmoji(topCountry.iso); - + return { nodes: response.nodes, sumLiquidity: sumLiquidity, diff --git a/frontend/src/app/lightning/nodes-ranking/oldest-nodes/oldest-nodes.component.ts b/frontend/src/app/lightning/nodes-ranking/oldest-nodes/oldest-nodes.component.ts index b5cbf0a41..e2b913304 100644 --- a/frontend/src/app/lightning/nodes-ranking/oldest-nodes/oldest-nodes.component.ts +++ b/frontend/src/app/lightning/nodes-ranking/oldest-nodes/oldest-nodes.component.ts @@ -14,7 +14,7 @@ import { LightningApiService } from '@app/lightning/lightning-api.service'; }) export class OldestNodes implements OnInit { @Input() widget: boolean = false; - + oldestNodes$: Observable; skeletonRows: number[] = []; diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts index 6fb1a45a1..7fc1007e6 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts @@ -61,7 +61,7 @@ export class TopNodesPerCapacity implements OnInit { totalCapacity: statistics.latest.total_capacity, totalChannels: statistics.latest.channel_count, } - } + }; }) ); } else { @@ -76,7 +76,7 @@ export class TopNodesPerCapacity implements OnInit { statistics: { totalCapacity: statistics.latest.total_capacity, } - } + }; }) ); } diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts index 532cbc50f..ca9fb07e7 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts @@ -17,11 +17,11 @@ export class TopNodesPerChannels implements OnInit { @Input() nodes$: Observable; @Input() statistics$: Observable; @Input() widget: boolean = false; - + topNodesPerChannels$: Observable<{ nodes: ITopNodesPerChannels[]; statistics: { totalChannels: number; totalCapacity?: number; } }>; skeletonRows: number[] = []; currency$: Observable; - + constructor( private apiService: LightningApiService, private stateService: StateService, @@ -30,7 +30,7 @@ export class TopNodesPerChannels implements OnInit { ngOnInit(): void { this.currency$ = this.stateService.fiatCurrency$; - + for (let i = 1; i <= (this.widget ? 6 : 100); ++i) { this.skeletonRows.push(i); } @@ -59,7 +59,7 @@ export class TopNodesPerChannels implements OnInit { totalChannels: statistics.latest.channel_count, totalCapacity: statistics.latest.total_capacity, } - } + }; }) ); } else { @@ -82,7 +82,7 @@ export class TopNodesPerChannels implements OnInit { statistics: { totalChannels: statistics.latest.channel_count, } - } + }; }) ); } diff --git a/frontend/src/app/liquid/liquid-master-page.module.ts b/frontend/src/app/liquid/liquid-master-page.module.ts index d90643b4d..44d660508 100644 --- a/frontend/src/app/liquid/liquid-master-page.module.ts +++ b/frontend/src/app/liquid/liquid-master-page.module.ts @@ -11,7 +11,7 @@ import { PushTransactionComponent } from '@components/push-transaction/push-tran import { BlocksList } from '@components/blocks-list/blocks-list.component'; import { AssetGroupComponent } from '@components/assets/asset-group/asset-group.component'; import { AssetsComponent } from '@components/assets/assets.component'; -import { AssetsFeaturedComponent } from '@components/assets/assets-featured/assets-featured.component' +import { AssetsFeaturedComponent } from '@components/assets/assets-featured/assets-featured.component'; import { AssetComponent } from '@components/asset/asset.component'; import { AssetsNavComponent } from '@components/assets/assets-nav/assets-nav.component'; import { RecentPegsListComponent } from '@components/liquid-reserves-audit/recent-pegs-list/recent-pegs-list.component'; diff --git a/frontend/src/app/master-page.module.ts b/frontend/src/app/master-page.module.ts index c0297b971..291a3e7ba 100644 --- a/frontend/src/app/master-page.module.ts +++ b/frontend/src/app/master-page.module.ts @@ -144,7 +144,7 @@ if (window['__env']?.OFFICIAL_MEMPOOL_SPACE) { data: { networks: ['bitcoin'] }, component: FaucetComponent, }] - }) + }); } } diff --git a/frontend/src/app/services/api.service.ts b/frontend/src/app/services/api.service.ts index 78626ff23..702e3d014 100644 --- a/frontend/src/app/services/api.service.ts +++ b/frontend/src/app/services/api.service.ts @@ -237,7 +237,7 @@ export class ApiService { } listFeaturedAssets$(network: string = 'liquid'): Observable { - if (network === 'liquid') return this.httpClient.get(this.apiBaseUrl + '/api/v1/assets/featured'); + if (network === 'liquid') {return this.httpClient.get(this.apiBaseUrl + '/api/v1/assets/featured');} return of([]); } @@ -286,7 +286,7 @@ export class ApiService { return response; }) ); - } + } getPoolStats$(slug: string): Observable { return this.httpClient.get(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${slug}`) @@ -440,7 +440,7 @@ export class ApiService { } lightningSearch$(searchText: string): Observable<{ nodes: any[], channels: any[] }> { - let params = new HttpParams().set('searchText', searchText); + const params = new HttpParams().set('searchText', searchText); // Don't request the backend if searchText is less than 3 characters if (searchText.length < 3) { return of({ nodes: [], channels: [] }); diff --git a/frontend/src/app/services/assets.service.ts b/frontend/src/app/services/assets.service.ts index 1e8d5346a..42afa9627 100644 --- a/frontend/src/app/services/assets.service.ts +++ b/frontend/src/app/services/assets.service.ts @@ -30,7 +30,7 @@ export class AssetsService { switchMap(() => this.httpClient.get(`${apiBaseUrl}/resources/assets${this.stateService.network === 'liquidtestnet' ? '-testnet' : ''}.json`)), map((rawAssets) => { const assets: AssetExtended[] = Object.values(rawAssets); - + if (this.stateService.network === 'liquid') { // @ts-ignore assets.push({ @@ -46,7 +46,7 @@ export class AssetsService { asset_id: this.nativeAssetId, }); } - + return { objects: rawAssets, array: assets.sort((a: any, b: any) => a.name.localeCompare(b.name)), @@ -60,7 +60,7 @@ export class AssetsService { map((assetsMinimal) => { if (this.stateService.network === 'liquidtestnet') { // Hard coding the Liquid Testnet native asset - assetsMinimal['144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49'] = [null, "tLBTC", "Test Liquid Bitcoin", 8]; + assetsMinimal['144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49'] = [null, 'tLBTC', 'Test Liquid Bitcoin', 8]; } return assetsMinimal; }), diff --git a/frontend/src/app/services/cache.service.ts b/frontend/src/app/services/cache.service.ts index 246008043..6e23164e0 100644 --- a/frontend/src/app/services/cache.service.ts +++ b/frontend/src/app/services/cache.service.ts @@ -50,7 +50,7 @@ export class CacheService { this.txCache[tx.txid] = tx; }); } - + getTxFromCache(txid) { if (this.txCache && this.txCache[txid]) { return this.txCache[txid]; @@ -78,7 +78,7 @@ export class CacheService { try { result = await firstValueFrom(this.apiService.getBlocks$(maxHeight)); } catch (e) { - console.log("failed to load blocks: ", e.message); + console.log('failed to load blocks: ', e.message); } if (result && result.length) { result.forEach(block => { diff --git a/frontend/src/app/services/eta.service.ts b/frontend/src/app/services/eta.service.ts index 8a2e2dc24..d097a6a89 100644 --- a/frontend/src/app/services/eta.service.ts +++ b/frontend/src/app/services/eta.service.ts @@ -269,7 +269,7 @@ export class EtaService { relatives.push(cpfpInfo.bestDescendant); } - if (!!relatives.length) { + if (relatives.length) { const totalWeight = tx.weight + relatives.reduce((prev, val) => prev + val.weight, 0); const totalFees = tx.fee + relatives.reduce((prev, val) => prev + val.fee, 0); diff --git a/frontend/src/app/services/http-cache.interceptor.ts b/frontend/src/app/services/http-cache.interceptor.ts index da683325e..eaae84053 100644 --- a/frontend/src/app/services/http-cache.interceptor.ts +++ b/frontend/src/app/services/http-cache.interceptor.ts @@ -39,7 +39,7 @@ export class HttpCacheInterceptor implements HttpInterceptor { .pipe( tap((event: HttpEvent) => { if (!this.isBrowser && event instanceof HttpResponse) { - let keyId = request.url.split('/').slice(3).join('/'); + const keyId = request.url.split('/').slice(3).join('/'); const headers = {}; for (const k of event.headers.keys()) { headers[k] = event.headers.getAll(k); diff --git a/frontend/src/app/services/opengraph.service.ts b/frontend/src/app/services/opengraph.service.ts index 47b9d87d4..aba487dfc 100644 --- a/frontend/src/app/services/opengraph.service.ts +++ b/frontend/src/app/services/opengraph.service.ts @@ -25,13 +25,13 @@ export class OpenGraphService { private activatedRoute: ActivatedRoute, ) { // save og:image tag from original template - const initialOgImageTag = metaService.getTag("property='og:image'"); + const initialOgImageTag = metaService.getTag('property=\'og:image\''); this.defaultImageUrl = initialOgImageTag?.content || 'https://mempool.space/resources/previews/mempool-space-preview.jpg'; this.router.events.pipe( filter(event => event instanceof NavigationEnd), map(() => this.activatedRoute), map(route => { - while (route.firstChild) route = route.firstChild; + while (route.firstChild) {route = route.firstChild;} return route; }), filter(route => route.outlet === 'primary'), @@ -120,10 +120,10 @@ export class OpenGraphService { this.previewLoadingEvents = {}; this.previewLoadingCount = 0; this.sessionId++; - this.metaService.removeTag("property='og:preview:loading'"); - this.metaService.removeTag("property='og:preview:ready'"); - this.metaService.removeTag("property='og:preview:fail'"); - this.metaService.removeTag("property='og:meta:ready'"); + this.metaService.removeTag('property=\'og:preview:loading\''); + this.metaService.removeTag('property=\'og:preview:ready\''); + this.metaService.removeTag('property=\'og:preview:fail\''); + this.metaService.removeTag('property=\'og:meta:ready\''); } loadPage(path) { diff --git a/frontend/src/app/services/ord-api.service.ts b/frontend/src/app/services/ord-api.service.ts index ae0076906..1a26cd52a 100644 --- a/frontend/src/app/services/ord-api.service.ts +++ b/frontend/src/app/services/ord-api.service.ts @@ -85,7 +85,7 @@ export class OrdApiService { while (true) { const pointer = getNextInscriptionMark(raw, startPosition); - if (pointer === -1) break; + if (pointer === -1) {break;} const inscription = extractInscriptionData(raw, pointer); if (inscription) { diff --git a/frontend/src/app/services/price.service.ts b/frontend/src/app/services/price.service.ts index f4a1717a9..1f729bf4b 100644 --- a/frontend/src/app/services/price.service.ts +++ b/frontend/src/app/services/price.service.ts @@ -211,7 +211,7 @@ export class PriceService { }; for (const price of conversion.prices) { historicalPrice.prices[price.time] = this.stateService.env.ADDITIONAL_CURRENCIES ? { - USD: price.USD, EUR: price.EUR, GBP: price.GBP, CAD: price.CAD, CHF: price.CHF, AUD: price.AUD, + USD: price.USD, EUR: price.EUR, GBP: price.GBP, CAD: price.CAD, CHF: price.CHF, AUD: price.AUD, JPY: price.JPY, BGN: price.BGN, BRL: price.BRL, CNY: price.CNY, CZK: price.CZK, DKK: price.DKK, HKD: price.HKD, HRK: price.HRK, HUF: price.HUF, IDR: price.IDR, ILS: price.ILS, INR: price.INR, ISK: price.ISK, KRW: price.KRW, MXN: price.MXN, MYR: price.MYR, NOK: price.NOK, NZD: price.NZD, @@ -276,7 +276,7 @@ export class PriceService { }; for (const price of conversion.prices) { historicalPrice.prices[price.time] = this.stateService.env.ADDITIONAL_CURRENCIES ? { - USD: price.USD, EUR: price.EUR, GBP: price.GBP, CAD: price.CAD, CHF: price.CHF, AUD: price.AUD, + USD: price.USD, EUR: price.EUR, GBP: price.GBP, CAD: price.CAD, CHF: price.CHF, AUD: price.AUD, JPY: price.JPY, BGN: price.BGN, BRL: price.BRL, CNY: price.CNY, CZK: price.CZK, DKK: price.DKK, HKD: price.HKD, HRK: price.HRK, HUF: price.HUF, IDR: price.IDR, ILS: price.ILS, INR: price.INR, ISK: price.ISK, KRW: price.KRW, MXN: price.MXN, MYR: price.MYR, NOK: price.NOK, NZD: price.NZD, @@ -286,7 +286,7 @@ export class PriceService { USD: price.USD, EUR: price.EUR, GBP: price.GBP, CAD: price.CAD, CHF: price.CHF, AUD: price.AUD, JPY: price.JPY }; } - + const priceTimestamps = Object.keys(historicalPrice.prices).map(Number); priceTimestamps.push(Number.MAX_SAFE_INTEGER); priceTimestamps.sort((a, b) => b - a); diff --git a/frontend/src/app/services/seo.service.ts b/frontend/src/app/services/seo.service.ts index e5ede4db3..55ea1bf9c 100644 --- a/frontend/src/app/services/seo.service.ts +++ b/frontend/src/app/services/seo.service.ts @@ -37,7 +37,7 @@ export class SeoService { filter(event => event instanceof NavigationEnd), map(() => this.activatedRoute), map(route => { - while (route.firstChild) route = route.firstChild; + while (route.firstChild) {route = route.firstChild;} return route; }), filter(route => route.outlet === 'primary'), @@ -88,15 +88,15 @@ export class SeoService { getTitle(): string { if (this.network === 'testnet') - return this.baseTitle + ' - Bitcoin Testnet3'; + {return this.baseTitle + ' - Bitcoin Testnet3';} if (this.network === 'testnet4') - return this.baseTitle + ' - Bitcoin Testnet4'; + {return this.baseTitle + ' - Bitcoin Testnet4';} if (this.network === 'signet') - return this.baseTitle + ' - Bitcoin Signet'; + {return this.baseTitle + ' - Bitcoin Signet';} if (this.network === 'liquid') - return this.baseTitle + ' - Liquid Network'; + {return this.baseTitle + ' - Liquid Network';} if (this.network === 'liquidtestnet') - return this.baseTitle + ' - Liquid Testnet'; + {return this.baseTitle + ' - Liquid Testnet';} return this.baseTitle + ' - ' + (this.network ? this.ucfirst(this.network) : 'Bitcoin') + ' Explorer'; } diff --git a/frontend/src/app/services/services-api.service.ts b/frontend/src/app/services/services-api.service.ts index d85698e42..2814501f0 100644 --- a/frontend/src/app/services/services-api.service.ts +++ b/frontend/src/app/services/services-api.service.ts @@ -54,7 +54,7 @@ export class ServicesApiServices { if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) { this.getServicesBackendInfo$().subscribe(version => { this.stateService.servicesBackendInfo$.next(version); - }) + }); } this.getUserInfo$().subscribe(); @@ -82,7 +82,7 @@ export class ServicesApiServices { return of(null); }), share(), - ) + ); } /** diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index f4bed10af..93195fc6f 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -367,7 +367,7 @@ export class StateService { this.hideAudit.subscribe((hide) => { this.storageService.setValue('audit-preference', hide ? 'hide' : 'show'); }); - + const fiatPreference = this.storageService.getValue('fiat-preference'); this.fiatCurrency$ = new BehaviorSubject(fiatPreference || 'USD'); @@ -513,7 +513,7 @@ export class StateService { focusSearchInputDesktop() { if (!hasTouchScreen()) { this.searchFocus$.next(true); - } + } } private testIsProdDomain(prodDomains: string[]): boolean { diff --git a/frontend/src/app/shared/common.utils.ts b/frontend/src/app/shared/common.utils.ts index 9b53600c1..d88e358cc 100644 --- a/frontend/src/app/shared/common.utils.ts +++ b/frontend/src/app/shared/common.utils.ts @@ -1,6 +1,6 @@ -import { MempoolBlockDelta, MempoolBlockDeltaCompressed, MempoolDeltaChange, TransactionCompressed } from "../interfaces/websocket.interface"; -import { TransactionStripped } from "@interfaces/node-api.interface"; -import { AmountShortenerPipe } from "@app/shared/pipes/amount-shortener.pipe"; +import { MempoolBlockDelta, MempoolBlockDeltaCompressed, MempoolDeltaChange, TransactionCompressed } from '../interfaces/websocket.interface'; +import { TransactionStripped } from '@interfaces/node-api.interface'; +import { AmountShortenerPipe } from '@app/shared/pipes/amount-shortener.pipe'; import { Router, ActivatedRoute } from '@angular/router'; const amountShortenerPipe = new AmountShortenerPipe(); @@ -230,7 +230,7 @@ export function handleDemoRedirect(route: ActivatedRoute, router: Router) { const index = path.indexOf(params.next); if (index >= 0) { const nextPath = path[(index + 1) % path.length]; - setTimeout(() => { window.location.replace(`${params.next}?next=${nextPath}`) }, 15000); + setTimeout(() => { window.location.replace(`${params.next}?next=${nextPath}`); }, 15000); } } } @@ -239,9 +239,9 @@ export function handleDemoRedirect(route: ActivatedRoute, router: Router) { // https://stackoverflow.com/a/60467595 export function md5(inputString): string { - var hc="0123456789abcdef"; - function rh(n) {var j,s="";for(j=0;j<=3;j++) s+=hc.charAt((n>>(j*8+4))&0x0F)+hc.charAt((n>>(j*8))&0x0F);return s;} - function ad(x,y) {var l=(x&0xFFFF)+(y&0xFFFF);var m=(x>>16)+(y>>16)+(l>>16);return (m<<16)|(l&0xFFFF);} + const hc='0123456789abcdef'; + function rh(n) {let j,s='';for(j=0;j<=3;j++) {s+=hc.charAt((n>>(j*8+4))&0x0F)+hc.charAt((n>>(j*8))&0x0F);}return s;} + function ad(x,y) {const l=(x&0xFFFF)+(y&0xFFFF);const m=(x>>16)+(y>>16)+(l>>16);return (m<<16)|(l&0xFFFF);} function rl(n,c) {return (n<>>(32-c));} function cm(q,a,b,x,s,t) {return ad(rl(ad(ad(a,q),ad(x,t)),s),b);} function ff(a,b,c,d,x,s,t) {return cm((b&c)|((~b)&d),a,b,x,s,t);} @@ -249,11 +249,11 @@ export function md5(inputString): string { function hh(a,b,c,d,x,s,t) {return cm(b^c^d,a,b,x,s,t);} function ii(a,b,c,d,x,s,t) {return cm(c^(b|(~d)),a,b,x,s,t);} function sb(x) { - var i;var nblk=((x.length+8)>>6)+1;var blks=new Array(nblk*16);for(i=0;i>2]|=x.charCodeAt(i)<<((i%4)*8); + let i;const nblk=((x.length+8)>>6)+1;const blks=new Array(nblk*16);for(i=0;i>2]|=x.charCodeAt(i)<<((i%4)*8);} blks[i>>2]|=0x80<<((i%4)*8);blks[nblk*16-2]=x.length*8;return blks; } - var i,x=sb(""+inputString),a=1732584193,b=-271733879,c=-1732584194,d=271733878,olda,oldb,oldc,oldd; + let i,x=sb(''+inputString),a=1732584193,b=-271733879,c=-1732584194,d=271733878,olda,oldb,oldc,oldd; for(i=0;i this.crop) { - let croppedInstruction = instructions[i]; + const croppedInstruction = instructions[i]; instructions = instructions.slice(0, i); // add cropped instruction let remainingChars = this.crop - chars; diff --git a/frontend/src/app/shared/components/btc/btc.component.ts b/frontend/src/app/shared/components/btc/btc.component.ts index e2c4ceb0d..038502b67 100644 --- a/frontend/src/app/shared/components/btc/btc.component.ts +++ b/frontend/src/app/shared/components/btc/btc.component.ts @@ -36,10 +36,10 @@ export class BtcComponent implements OnInit, OnChanges { ngOnChanges(changes: SimpleChanges): void { if (this.satoshis >= 1_000_000) { this.value = (this.satoshis / 100_000_000); - this.unit = 'BTC' + this.unit = 'BTC'; } else { this.value = Math.round(this.satoshis); - this.unit = 'sats' + this.unit = 'sats'; } } } diff --git a/frontend/src/app/shared/components/geolocation/geolocation.component.ts b/frontend/src/app/shared/components/geolocation/geolocation.component.ts index 2c8e3b8d3..04e31d0a4 100644 --- a/frontend/src/app/shared/components/geolocation/geolocation.component.ts +++ b/frontend/src/app/shared/components/geolocation/geolocation.component.ts @@ -67,7 +67,7 @@ export class GeolocationComponent implements OnChanges { } } } - + if (this.type === 'node') { const city = this.data.city ? this.data.city : ''; diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.ts b/frontend/src/app/shared/components/global-footer/global-footer.component.ts index 80729f463..f5f0e3252 100644 --- a/frontend/src/app/shared/components/global-footer/global-footer.component.ts +++ b/frontend/src/app/shared/components/global-footer/global-footer.component.ts @@ -76,7 +76,7 @@ export class GlobalFooterComponent implements OnInit, OnDestroy, OnChanges { this.urlSubscription = this.route.url.subscribe((url) => { this.user = this.storageService.getAuth(); this.cd.markForCheck(); - }) + }); } ngOnChanges(changes: SimpleChanges): void { diff --git a/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts b/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts index f857b9837..af07aa2d8 100644 --- a/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts +++ b/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts @@ -21,7 +21,7 @@ export const MempoolErrors = { 'recommended_fees_not_available': `Recommended fees are not available right now.`, 'too_many_relatives': `This transaction has too many relatives.`, 'txid_not_in_mempool': `This transaction is not in the mempool.`, - 'waitlisted': `You are currently on the wait list. You will get notified once you are granted access.`, + 'waitlisted': `You are currently on the wait list. You will get notified once you are granted access.`, 'not_whitelisted_by_any_pool': `You are not whitelisted by any mining pool`, 'unauthorized': `You are not authorized to do this`, 'faucet_too_soon': `You cannot request any more coins right now. Try again later.`, diff --git a/frontend/src/app/shared/components/toggle/toggle.component.ts b/frontend/src/app/shared/components/toggle/toggle.component.ts index 38caaf655..35d54192c 100644 --- a/frontend/src/app/shared/components/toggle/toggle.component.ts +++ b/frontend/src/app/shared/components/toggle/toggle.component.ts @@ -20,7 +20,7 @@ export class ToggleComponent implements AfterViewInit { ngAfterViewInit(): void { this.animate = true; - setTimeout(() => { this.cd.markForCheck()}); + setTimeout(() => { this.cd.markForCheck();}); } onToggleStatusChanged(e): void { diff --git a/frontend/src/app/shared/i18n/dates.ts b/frontend/src/app/shared/i18n/dates.ts index 188adedf1..09bb8105e 100644 --- a/frontend/src/app/shared/i18n/dates.ts +++ b/frontend/src/app/shared/i18n/dates.ts @@ -14,5 +14,5 @@ export const dates = (counter: number) => { i18nMinutes: $localize`:@@date-base.minutes:${counter}:DATE: minutes`, i18nSecond: $localize`:@@date-base.second:${counter}:DATE: second`, i18nSeconds: $localize`:@@date-base.seconds:${counter}:DATE: seconds`, - } -} \ No newline at end of file + }; +}; \ No newline at end of file diff --git a/frontend/src/app/shared/ord/inscription.utils.ts b/frontend/src/app/shared/ord/inscription.utils.ts index 08ecc316a..13e19ade5 100644 --- a/frontend/src/app/shared/ord/inscription.utils.ts +++ b/frontend/src/app/shared/ord/inscription.utils.ts @@ -75,7 +75,7 @@ export const knownFields = { // delegate, with a tag of 11, see delegate docs: https://docs.ordinals.com/inscriptions/delegate.html delegate: 0xb -} +}; /** * Retrieves the value for a given field from an array of field objects. @@ -171,7 +171,7 @@ export function readBytes(raw: Uint8Array, pointer: number, n: number): [Uint8Ar */ export function readPushdata(raw: Uint8Array, pointer: number): [Uint8Array, number] { - let [opcodeSlice, newPointer] = readBytes(raw, pointer, 1); + const [opcodeSlice, newPointer] = readBytes(raw, pointer, 1); const opcode = opcodeSlice[0]; // Handle the special case of OP_0 (0x00) which pushes an empty array (interpreted as zero) @@ -209,8 +209,8 @@ export function readPushdata(raw: Uint8Array, pointer: number): [Uint8Array, num throw new Error(`Invalid push opcode ${opcode} at position ${pointer}`); } - let [dataSizeArray, nextPointer] = readBytes(raw, newPointer, numBytes); - let dataSize = littleEndianBytesToNumber(dataSizeArray); + const [dataSizeArray, nextPointer] = readBytes(raw, newPointer, numBytes); + const dataSize = littleEndianBytesToNumber(dataSizeArray); return readBytes(raw, nextPointer, dataSize); } @@ -393,7 +393,7 @@ export function extractInscriptionData(raw: Uint8Array, pointer: number): Inscri } const combinedLengthOfAllArrays = data.reduce((acc, curr) => acc + curr.length, 0); - let combinedData = new Uint8Array(combinedLengthOfAllArrays); + const combinedData = new Uint8Array(combinedLengthOfAllArrays); // Copy all segments from data into combinedData, forming a single contiguous Uint8Array let idx = 0; diff --git a/frontend/src/app/shared/pipes/bytes-pipe/bytes.pipe.ts b/frontend/src/app/shared/pipes/bytes-pipe/bytes.pipe.ts index 3ff8acfcf..cc9e02358 100644 --- a/frontend/src/app/shared/pipes/bytes-pipe/bytes.pipe.ts +++ b/frontend/src/app/shared/pipes/bytes-pipe/bytes.pipe.ts @@ -34,7 +34,7 @@ export class BytesPipe implements PipeTransform { unit = BytesPipe.formats[unit].prev!; } - let numberFormat = sigfigs == null ? + const numberFormat = sigfigs == null ? (number) => toDecimal(number, decimal).toString() : (number) => toSigFigs(number, sigfigs); diff --git a/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.ts b/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.ts index 1e7a51e9b..2ff8d1cda 100644 --- a/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.ts +++ b/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.ts @@ -1,8 +1,8 @@ -import { formatNumber } from "@angular/common"; -import { Inject, LOCALE_ID, Pipe, PipeTransform } from "@angular/core"; +import { formatNumber } from '@angular/common'; +import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: "feeRounding", + name: 'feeRounding', standalone: false, }) export class FeeRoundingPipe implements PipeTransform { diff --git a/frontend/src/app/shared/pipes/fiat-shortener.pipe.ts b/frontend/src/app/shared/pipes/fiat-shortener.pipe.ts index 48ef3b455..024e4404c 100644 --- a/frontend/src/app/shared/pipes/fiat-shortener.pipe.ts +++ b/frontend/src/app/shared/pipes/fiat-shortener.pipe.ts @@ -42,7 +42,7 @@ export class FiatShortenerPipe implements PipeTransform { let result = item ? (num / item.value).toFixed(digits).replace(rx, '$1') : '0'; result = new Intl.NumberFormat(this.locale, { style: 'currency', currency, maximumFractionDigits: 0 }).format(item ? num / item.value : 0); - + return result + item.symbol; } } diff --git a/frontend/src/app/shared/pipes/math-ceil/math-ceil.pipe.ts b/frontend/src/app/shared/pipes/math-ceil/math-ceil.pipe.ts index 02f711eb1..379209289 100644 --- a/frontend/src/app/shared/pipes/math-ceil/math-ceil.pipe.ts +++ b/frontend/src/app/shared/pipes/math-ceil/math-ceil.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ +@Pipe({ name: 'ceil', standalone: false, }) diff --git a/frontend/src/app/shared/pipes/relative-url/relative-url.pipe.ts b/frontend/src/app/shared/pipes/relative-url/relative-url.pipe.ts index e927a73d6..73614b128 100644 --- a/frontend/src/app/shared/pipes/relative-url/relative-url.pipe.ts +++ b/frontend/src/app/shared/pipes/relative-url/relative-url.pipe.ts @@ -13,7 +13,7 @@ export class RelativeUrlPipe implements PipeTransform { transform(value: string, swapNetwork?: string): string { let network = swapNetwork || this.stateService.network; - if (network === 'mainnet' || network === this.stateService.env.ROOT_NETWORK) { + if (network === 'mainnet' || network === this.stateService.env.ROOT_NETWORK) { network = ''; } if (this.stateService.env.BASE_MODULE === 'liquid' && network === 'liquidtestnet') { diff --git a/frontend/src/app/shared/regex.utils.ts b/frontend/src/app/shared/regex.utils.ts index 00d4ec2f9..5e8a3aebc 100644 --- a/frontend/src/app/shared/regex.utils.ts +++ b/frontend/src/app/shared/regex.utils.ts @@ -97,7 +97,7 @@ const ADDRESS_CHARS: { + `|` + `[V][TJ]` // Confidential P2PKH or P2SH starts with VT or VJ + BASE58_CHARS - + `{78}`, + + `{78}`, bech32: `(?:` + `(?:` // bech32 liquid starts with ex1 (unconfidential) or lq1 (confidential) + `ex1` @@ -138,7 +138,7 @@ const ADDRESS_CHARS: { + `{6,100}` + `)`, }, -} +}; type RegexTypeNoAddrNoBlockHash = | `transaction` | `blockheight` | `date` | `timestamp`; export type RegexType = `address` | `blockhash` | RegexTypeNoAddrNoBlockHash; @@ -146,7 +146,7 @@ export const NETWORKS = [`mainnet`, `testnet4`, `testnet`, `signet`, `liquid`, ` export type Network = typeof NETWORKS[number]; // Turn const array into union type export const ADDRESS_REGEXES: [RegExp, Network][] = NETWORKS - .map(network => [getRegex('address', network), network]) + .map(network => [getRegex('address', network), network]); export function findOtherNetworks(address: string, skipNetwork: Network, env: Env): { network: Network, address: string, isNetworkAvailable: boolean }[] { return ADDRESS_REGEXES @@ -174,7 +174,7 @@ function isNetworkAvailable(network: Network, env: Env): boolean { } export function needBaseModuleChange(fromBaseModule: 'mempool' | 'liquid', toNetwork: Network): boolean { - if (!toNetwork) return false; // No target network means no change needed + if (!toNetwork) {return false;} // No target network means no change needed if (fromBaseModule === 'mempool') { return toNetwork !== 'mainnet' && toNetwork !== 'testnet' && toNetwork !== 'testnet4' && toNetwork !== 'signet'; } diff --git a/frontend/src/app/shared/script.utils.ts b/frontend/src/app/shared/script.utils.ts index 287b30efb..5b86c4d64 100644 --- a/frontend/src/app/shared/script.utils.ts +++ b/frontend/src/app/shared/script.utils.ts @@ -1,6 +1,6 @@ -import { Vin } from "../interfaces/electrs.interface"; -import { AddressType, detectAddressType } from "./address-utils"; -import { ParsedTaproot } from "./transaction.utils"; +import { Vin } from '../interfaces/electrs.interface'; +import { AddressType, detectAddressType } from './address-utils'; +import { ParsedTaproot } from './transaction.utils'; const opcodes = { OP_FALSE: 0, @@ -530,7 +530,7 @@ export function isPoint(pointHex: string): boolean { } // Function modified slightly from noble-curves - + // Now we know that pointHex is a 33 or 65 byte hex string. const isCompressed = pointHex.length === 66; diff --git a/frontend/src/app/shared/sha256.ts b/frontend/src/app/shared/sha256.ts index 08aa0f995..020bb2d16 100644 --- a/frontend/src/app/shared/sha256.ts +++ b/frontend/src/app/shared/sha256.ts @@ -152,7 +152,7 @@ export class Hash { // instance must be reset to use it again. update(data: Uint8Array, dataLength: number = data.length): this { if (this.finished) { - throw new Error("SHA256: can't update because hash was finished."); + throw new Error('SHA256: can\'t update because hash was finished.'); } let dataPos = 0; this.bytesHashed += dataLength; @@ -353,7 +353,7 @@ function fillBuffer(buffer: Uint8Array, hmac: HMAC, info: Uint8Array | undefined const num = counter[0]; if (num === 0) { - throw new Error("hkdf: cannot expand more"); + throw new Error('hkdf: cannot expand more'); } // Prepare HMAC instance for new data with old key. @@ -425,7 +425,7 @@ export function pbkdf2(password: Uint8Array, salt: Uint8Array, iterations: numbe const dk = new Uint8Array(dkLen); for (let i = 0; i * len < dkLen; i++) { - let c = i + 1; + const c = i + 1; ctr[0] = (c >>> 24) & 0xff; ctr[1] = (c >>> 16) & 0xff; ctr[2] = (c >>> 8) & 0xff; diff --git a/frontend/src/app/shared/transaction.utils.ts b/frontend/src/app/shared/transaction.utils.ts index 24ac39344..9c238d491 100644 --- a/frontend/src/app/shared/transaction.utils.ts +++ b/frontend/src/app/shared/transaction.utils.ts @@ -303,7 +303,7 @@ export function processInputSignatures(vin: Vin): SigInfo[] { return signatures; } -/* +/* * returns the number of missing signatures, the number of bytes to add to the transaction * and whether these should benefit from witness discounting * - Add a DER sig in scriptsig/witness: 71 bytes signature + 1 push or witness size byte = 72 bytes @@ -1125,7 +1125,7 @@ function convertScriptSigAsm(hex: string): string { * the script item if it is a script spend. */ function witnessToP2TRScript(witness: string[]): string | null { - if (witness.length < 2) return null; + if (witness.length < 2) {return null;} // Note: see BIP341 for parsing details of witness stack // If there are at least two witness elements, and the first byte of the @@ -1135,7 +1135,7 @@ function witnessToP2TRScript(witness: string[]): string | null { // If there are at least two witness elements left, script path spending is used. // Call the second-to-last stack element s, the script. // (Note: this phrasing from BIP341 assumes we've *removed* the annex from the stack) - if (hasAnnex && witness.length < 3) return null; + if (hasAnnex && witness.length < 3) {return null;} const positionOfScript = hasAnnex ? witness.length - 3 : witness.length - 2; return witness[positionOfScript]; } @@ -1188,7 +1188,7 @@ function fromBuffer(buffer: Uint8Array, network: string, inputs?: PsbtKeyValueMa block_time: null, } } as Transaction; - + [tx.version, offset] = readInt32(buffer, offset); let marker, flag; @@ -1250,7 +1250,7 @@ function fromBuffer(buffer: Uint8Array, network: string, inputs?: PsbtKeyValueMa if (offset !== buffer.length) { throw new Error('Transaction has unexpected data'); } - + // Optionally add data from PSBT: prevouts, redeem/witness scripts and signatures if (inputs) { for (let i = 0; i < tx.vin.length; i++) { @@ -1311,7 +1311,7 @@ function fromBuffer(buffer: Uint8Array, network: string, inputs?: PsbtKeyValueMa if (groups.redeemScript && !finalizedScriptSig) { const redeemScript = groups.redeemScript.value; if (redeemScript.length > 520) { - throw new Error("Redeem script must be <= 520 bytes"); + throw new Error('Redeem script must be <= 520 bytes'); } let pushOpcode; if (redeemScript.length < 0x4c) { @@ -1336,7 +1336,7 @@ function fromBuffer(buffer: Uint8Array, network: string, inputs?: PsbtKeyValueMa const scriptpubkey_type = vin.prevout?.scriptpubkey_type; if (scriptpubkey_type === 'multisig' && !finalizedScriptSig) { if (signature.length > 74) { - throw new Error("Signature must be <= 74 bytes"); + throw new Error('Signature must be <= 74 bytes'); } const pushOpcode = new Uint8Array([signature.length]); vin.scriptsig = uint8ArrayToHexString(pushOpcode) + uint8ArrayToHexString(signature) + (vin.scriptsig || ''); @@ -1351,7 +1351,7 @@ function fromBuffer(buffer: Uint8Array, network: string, inputs?: PsbtKeyValueMa } else { if (!finalizedScriptSig) { if (signature.length > 74) { - throw new Error("Signature must be <= 74 bytes"); + throw new Error('Signature must be <= 74 bytes'); } const pushOpcode = new Uint8Array([signature.length]); vin.scriptsig = uint8ArrayToHexString(pushOpcode) + uint8ArrayToHexString(signature) + (vin.scriptsig || ''); @@ -1419,7 +1419,7 @@ function fromBuffer(buffer: Uint8Array, network: string, inputs?: PsbtKeyValueMa } } } - } + } } // Calculate final size, weight, and txid @@ -1483,7 +1483,7 @@ function decodePsbt(psbtBuffer: Uint8Array): { rawTx: Uint8Array; inputs: PsbtKe const expectedMagic = [0x70, 0x73, 0x62, 0x74]; for (let i = 0; i < expectedMagic.length; i++) { if (psbtBuffer[offset + i] !== expectedMagic[i]) { - throw new Error("Invalid PSBT magic bytes"); + throw new Error('Invalid PSBT magic bytes'); } } offset += expectedMagic.length; @@ -1491,7 +1491,7 @@ function decodePsbt(psbtBuffer: Uint8Array): { rawTx: Uint8Array; inputs: PsbtKe const separator = psbtBuffer[offset]; offset += 1; if (separator !== 0xff) { - throw new Error("Invalid PSBT separator"); + throw new Error('Invalid PSBT separator'); } // GLOBAL MAP @@ -1517,7 +1517,7 @@ function decodePsbt(psbtBuffer: Uint8Array): { rawTx: Uint8Array; inputs: PsbtKe } if (!rawTx) { - throw new Error("Unsigned transaction not found in PSBT"); + throw new Error('Unsigned transaction not found in PSBT'); } const readMaps = (count: number, startOffset: number): { map: PsbtKeyValueMap[]; offset: number } => { @@ -1840,24 +1840,24 @@ export function taprootAddressToOutputKey(address: string): { outputKey: string, // base58 encoding function base58Encode(data: Uint8Array): string { - const BASE58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - let hexString = Array.from(data) + const hexString = Array.from(data) .map(byte => byte.toString(16).padStart(2, '0')) .join(''); - - let num = BigInt("0x" + hexString); - let encoded = ""; + let num = BigInt('0x' + hexString); + + let encoded = ''; while (num > 0) { const remainder = Number(num % 58n); num = num / 58n; encoded = BASE58_ALPHABET[remainder] + encoded; } - for (let byte of data) { + for (const byte of data) { if (byte === 0) { - encoded = "1" + encoded; + encoded = '1' + encoded; } else { break; } @@ -1868,7 +1868,7 @@ function base58Encode(data: Uint8Array): string { // bech32 encoding / decoding // Adapted from https://github.com/bitcoinjs/bech32/blob/5ceb0e3d4625561a459c85643ca6947739b2d83c/src/index.ts -const BECH32_ALPHABET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"; +const BECH32_ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'; type Bech32Encoding = 'bech32' | 'bech32m'; function bech32Encode(prefix: string, words: number[], encoding: Bech32Encoding = 'bech32'): string { @@ -1968,7 +1968,7 @@ function convertBits(data, fromBits, toBits, pad) { for (let i = 0; i < data.length; ++i) { const value = data[i]; - if (value < 0 || value >> fromBits) throw new Error('Invalid value'); + if (value < 0 || value >> fromBits) {throw new Error('Invalid value');} acc = (acc << fromBits) | value; bits += fromBits; while (bits >= toBits) { @@ -2098,13 +2098,13 @@ function readVarInt(buffer: Uint8Array, offset: number): [number, number] { const [bigValue, nextOffset] = readInt64(buffer, newOffset); if (bigValue > Number.MAX_SAFE_INTEGER) { - throw new Error("VarInt exceeds safe integer range"); + throw new Error('VarInt exceeds safe integer range'); } const numValue = Number(bigValue); return [numValue, nextOffset]; } else { - throw new Error("Invalid VarInt prefix"); + throw new Error('Invalid VarInt prefix'); } }