Fix a few lint errors

This commit is contained in:
Felipe Knorr Kuhn 2026-01-03 20:29:45 -08:00
parent 337b8b8631
commit b1d76a8e3f
No known key found for this signature in database
GPG key ID: 79619B52BB097C1A
121 changed files with 1347 additions and 1347 deletions

View file

@ -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';

View file

@ -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');

View file

@ -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');

View file

@ -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(() => {

View file

@ -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;
}
}

View file

@ -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'));

View file

@ -6,6 +6,6 @@ declare namespace Cypress {
waitForPageIdle(): Chainable<any>
mockMempoolSocket(): Chainable<any>
mockMempoolSocketV2(): Chainable<any>
changeNetwork(network: "testnet"|"testnet4"|"signet"|"liquid"|"mainnet"): Chainable<any>
changeNetwork(network: 'testnet'|'testnet4'|'signet'|'liquid'|'mainnet'): Chainable<any>
}
}

View file

@ -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);
});

View file

@ -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';

View file

@ -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);

View file

@ -3,7 +3,7 @@ import { Observable, timer, mergeMap, of } from 'rxjs';
export class AppPreloadingStrategy implements PreloadingStrategy {
preload(route: Route, load: Function): Observable<any> {
return route.data && route.data.preload
return route.data && route.data.preload
? timer(1500).pipe(mergeMap(() => load()))
: of(null);
}

View file

@ -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(

View file

@ -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;

View file

@ -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 {

View file

@ -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 = {

View file

@ -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')}<br>`;
}
}
}
tooltip += `<small>` + $localize`Around block: ${ticks[0].data[2]}` + `</small>`;
@ -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%',

View file

@ -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;

View file

@ -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`;
}

View file

@ -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();

View file

@ -16,7 +16,7 @@ export class AddressTransactionsWidgetComponent implements OnInit, OnChanges, On
@Input() addressInfo: Address;
@Input() addressSummary$: Observable<AddressTxSummary[]> | null;
@Input() isPubkey: boolean = false;
currencySubscription: Subscription;
currency: string;

View file

@ -122,7 +122,7 @@ export class AddressesTreemap implements OnChanges {
}
}
]
};
};
}
formatValue(sats: number): string {

View file

@ -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);

View file

@ -73,10 +73,10 @@ export class AssetsNavComponent implements OnInit {
return assets.array.slice(0, this.itemsPerPage);
}
})
)
);
}),
);
}
};
itemSelected() {
setTimeout(() => this.search());

View file

@ -31,7 +31,7 @@ export class BalanceWidgetComponent implements OnInit, OnChanges {
) { }
ngOnInit(): void {
}
ngOnChanges(changes: SimpleChanges): void {

View file

@ -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;

View file

@ -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<br>`;
else if (this.displayMode === 'fiat') tooltip += `${this.fiatCurrencyPipe.transform(tick.data, null, 'USD') }<br>`;
else tooltip += `${formatNumber(tick.data, this.locale, '1.0-2')}%<br>`;
if (this.displayMode === 'normal') {tooltip += `${formatNumber(tick.data, this.locale, '1.0-3')} BTC<br>`;}
else if (this.displayMode === 'fiat') {tooltip += `${this.fiatCurrencyPipe.transform(tick.data, null, 'USD') }<br>`;}
else {tooltip += `${formatNumber(tick.data, this.locale, '1.0-2')}%<br>`;}
}
if (this.displayMode === 'normal') tooltip += `<div style="margin-left: 2px">${formatNumber(data.reduce((acc, val) => acc + val.data, 0), this.locale, '1.0-3')} BTC</div>`;
else if (this.displayMode === 'fiat') tooltip += `<div style="margin-left: 2px">${this.fiatCurrencyPipe.transform(data.reduce((acc, val) => acc + val.data, 0), null, 'USD')}</div>`;
if (this.displayMode === 'normal') {tooltip += `<div style="margin-left: 2px">${formatNumber(data.reduce((acc, val) => acc + val.data, 0), this.locale, '1.0-3')} BTC</div>`;}
else if (this.displayMode === 'fiat') {tooltip += `<div style="margin-left: 2px">${this.fiatCurrencyPipe.transform(data.reduce((acc, val) => acc + val.data, 0), null, 'USD')}</div>`;}
if (['24h', '3d'].includes(this.zoomTimeSpan)) {
tooltip += `<small>` + $localize`At block ${'<b style="color: white; margin-left: 2px">' + data[0].axisValue}` + `</small>`;
} 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';

View file

@ -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)) {

View file

@ -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));

View file

@ -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;

View file

@ -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)',
};
}

View file

@ -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);
}

View file

@ -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),

View file

@ -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;
}

View file

@ -108,7 +108,7 @@ export class ClockComponent implements OnInit {
)`,
};
}
@HostListener('window:resize', ['$event'])
resizeCanvas(): void {
const windowWidth = this.limitWidth || window.innerWidth || 800;

View file

@ -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)

View file

@ -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;

View file

@ -48,7 +48,7 @@ export class DifficultyComponent implements OnInit {
@Input() showTitle = true;
@ViewChild('epochSvg') epochSvgElement: ElementRef<SVGElement>;
isLoadingWebSocket$: Observable<boolean>;
difficultyEpoch$: Observable<EpochProgress>;

View file

@ -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);
}
}

View file

@ -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();

View file

@ -44,7 +44,7 @@ export class FeesBoxComponent implements OnInit, OnDestroy {
);
this.themeSubscription = this.themeService.themeChanged$.subscribe(() => {
this.setFeeGradient();
})
});
}
setFeeGradient() {

View file

@ -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,

View file

@ -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)}<br>`;
} 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<br>`;
} 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) => {

View file

@ -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()],
},
});
}

View file

@ -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',
}
});
}

View file

@ -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};
})
)
);
}
}

View file

@ -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);
}
}

View file

@ -11,7 +11,7 @@ import { Observable, map } from 'rxjs';
export class ReservesRatioStatsComponent implements OnInit {
@Input() fullHistory$: Observable<any>;
@Input() emergencyUtxosStats$: Observable<any>;
unbackedMonths$: Observable<any>
unbackedMonths$: Observable<any>;
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,
};

View file

@ -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%';

View file

@ -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();

View file

@ -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);
}

View file

@ -467,7 +467,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
totalValue: totalValueTemp,
totalValueArray: totalValueArray.reverse(),
};
}
};
orderLevels() {
this.feeLevelsOrdered = [];

View file

@ -18,7 +18,7 @@ export class MenuComponent implements OnInit, OnDestroy {
@Input() navOpen: boolean = false;
@Output() loggedOut = new EventEmitter<boolean>();
@Output() menuToggled = new EventEmitter<boolean>();
userMenuGroups$: Observable<MenuGroup[]> | undefined;
user$: Observable<IUser | null>;
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$;

View file

@ -464,7 +464,7 @@ export class NgxDropdownMultiselectComponent implements OnInit,
this.model = this.model.slice();
this.fireModelChange();
}, 0)
}, 0);
}
updateNumSelected() {

View file

@ -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);

View file

@ -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)}<br>`;
} else if (tick.seriesIndex === 1) {
dominanceString = `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.0-2')}%`;
}
}
}
return `
<b style="color: white; margin-left: 18px">${ticks[0].axisValueLabel}</b><br>
<span>${hashrateString}</span>
@ -283,7 +283,7 @@ export class PoolComponent implements OnInit {
axisLabel: {
color: 'rgb(110, 112, 121)',
formatter: (val) => {
return `${val}%`
return `${val}%`;
}
},
splitLine: {

View file

@ -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);

View file

@ -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);

View file

@ -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;
});

View file

@ -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;

View file

@ -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);

View file

@ -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');

View file

@ -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;

View file

@ -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<any> {

View file

@ -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;

View file

@ -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) {

View file

@ -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()) {

View file

@ -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 = '<div>';
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 += `<div><b style="color: white; margin-left: 2px">${date}</b><br>`;
@ -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`;
}

View file

@ -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));
}

View file

@ -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();
}
}
}
}
}

View file

@ -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;

View file

@ -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);

File diff suppressed because it is too large Load diff

View file

@ -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<HTMLElement>( "#" + targetId );
const endpointContentEl = document.querySelector<HTMLElement>( "#" + targetId + " .endpoint-content" );
const endpointContainerEl = document.querySelector<HTMLElement>( '#' + targetId );
const endpointContentEl = document.querySelector<HTMLElement>( '#' + 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' );
}
}
}

View file

@ -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<HTMLElement>( urlObj.hash );
const endpointContentEl = document.querySelector<HTMLElement>( urlObj.hash + " .endpoint-content" );
const endpointContentEl = document.querySelector<HTMLElement>( 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') {

View file

@ -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<HTMLElement>( "html" ).style.scrollBehavior = "smooth";
document.querySelector<HTMLElement>( '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<HTMLElement>( "html" ).style.scrollBehavior = "auto";
document.querySelector<HTMLElement>( 'html' ).style.scrollBehavior = 'auto';
}
}

View file

@ -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;
}

View file

@ -10,5 +10,5 @@ export type MenuItem = {
export type MenuGroup = {
title: string;
i18n: string;
items: MenuItem[];
items: MenuItem[];
}

View file

@ -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);
}

View file

@ -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',
};

View file

@ -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],
});

View file

@ -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,

View file

@ -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<string, { subject: BehaviorSubject<any>, expiry: number }>;
constructor(

View file

@ -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;

View file

@ -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);

View file

@ -127,7 +127,7 @@ export class NodeChannels implements OnChanges {
}
}
]
};
};
}
onChartInit(ec: any): void {

View file

@ -97,7 +97,7 @@ export class NodesPerCountry implements OnInit {
};
}),
tap(() => {
this.isLoading = false
this.isLoading = false;
this.cd.markForCheck();
}),
share()

View file

@ -77,7 +77,7 @@ export class NodesPerISP implements OnInit {
}
}
topCountry.flag = getFlagEmoji(topCountry.iso);
return {
nodes: response.nodes,
sumLiquidity: sumLiquidity,

View file

@ -14,7 +14,7 @@ import { LightningApiService } from '@app/lightning/lightning-api.service';
})
export class OldestNodes implements OnInit {
@Input() widget: boolean = false;
oldestNodes$: Observable<IOldestNodes[]>;
skeletonRows: number[] = [];

View file

@ -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,
}
}
};
})
);
}

View file

@ -17,11 +17,11 @@ export class TopNodesPerChannels implements OnInit {
@Input() nodes$: Observable<INodesRanking>;
@Input() statistics$: Observable<INodesStatistics>;
@Input() widget: boolean = false;
topNodesPerChannels$: Observable<{ nodes: ITopNodesPerChannels[]; statistics: { totalChannels: number; totalCapacity?: number; } }>;
skeletonRows: number[] = [];
currency$: Observable<string>;
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,
}
}
};
})
);
}

View file

@ -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';

View file

@ -144,7 +144,7 @@ if (window['__env']?.OFFICIAL_MEMPOOL_SPACE) {
data: { networks: ['bitcoin'] },
component: FaucetComponent,
}]
})
});
}
}

View file

@ -237,7 +237,7 @@ export class ApiService {
}
listFeaturedAssets$(network: string = 'liquid'): Observable<any[]> {
if (network === 'liquid') return this.httpClient.get<any[]>(this.apiBaseUrl + '/api/v1/assets/featured');
if (network === 'liquid') {return this.httpClient.get<any[]>(this.apiBaseUrl + '/api/v1/assets/featured');}
return of([]);
}
@ -286,7 +286,7 @@ export class ApiService {
return response;
})
);
}
}
getPoolStats$(slug: string): Observable<PoolStat> {
return this.httpClient.get<PoolStat>(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: [] });

View file

@ -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;
}),

View file

@ -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 => {

View file

@ -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);

View file

@ -39,7 +39,7 @@ export class HttpCacheInterceptor implements HttpInterceptor {
.pipe(
tap((event: HttpEvent<any>) => {
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);

View file

@ -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) {

View file

@ -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) {

View file

@ -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);

Some files were not shown because too many files have changed in this diff Show more