Endpoint
diff --git a/frontend/src/app/components/docs/api-docs.component.ts b/frontend/src/app/components/docs/api-docs.component.ts
index 02cca44b2..b46590a89 100644
--- a/frontend/src/app/components/docs/api-docs.component.ts
+++ b/frontend/src/app/components/docs/api-docs.component.ts
@@ -3663,7 +3663,7 @@ export class ApiDocsComponent implements OnInit {
};
this.network$.subscribe((network) => {
- this.active = (network === 'liquid') ? 2 : 0;
+ this.active = (network === 'liquid' || network === 'liquidtestnet') ? 2 : 0;
});
}
@@ -3679,7 +3679,7 @@ export class ApiDocsComponent implements OnInit {
if (network === 'signet') {
curlResponse = code.codeSampleSignet.curl;
}
- if (network === 'liquid') {
+ if (network === 'liquid' || network === 'liquidtestnet') {
curlResponse = code.codeSampleLiquid.curl;
}
if (network === 'bisq') {
diff --git a/frontend/src/app/components/docs/code-template.component.ts b/frontend/src/app/components/docs/code-template.component.ts
index 0c46c7a9d..fdd496726 100644
--- a/frontend/src/app/components/docs/code-template.component.ts
+++ b/frontend/src/app/components/docs/code-template.component.ts
@@ -26,7 +26,7 @@ export class CodeTemplateComponent implements OnInit {
if (this.network === 'bisq') {
npmLink = `https://github.com/mempool/mempool.js/tree/main/npm-bisq-js`;
}
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
npmLink = `https://github.com/mempool/mempool.js/tree/main/npm-liquid-js`;
}
return npmLink;
@@ -37,7 +37,7 @@ export class CodeTemplateComponent implements OnInit {
if (this.network === 'bisq') {
npmLink = `https://www.npmjs.org/package/@mempool/bisq.js`;
}
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
npmLink = `https://www.npmjs.org/package/@mempool/liquid.js`;
}
return npmLink;
@@ -50,7 +50,7 @@ export class CodeTemplateComponent implements OnInit {
} else {
codeText = codeText.replace('%{0}', 'bitcoin');
}
- if(['', 'main', 'liquid', 'bisq'].includes(this.network)) {
+ if(['', 'main', 'liquid', 'bisq', 'liquidtestnet'].includes(this.network)) {
codeText = codeText.replace('mempoolJS();', `mempoolJS({
hostname: '${document.location.hostname}'
});`);
@@ -119,7 +119,7 @@ export class CodeTemplateComponent implements OnInit {
if (this.network === 'signet') {
codeText = this.replaceJSPlaceholder(codeText, code.codeSampleSignet.esModule);
}
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
codeText = this.replaceJSPlaceholder(codeText, code.codeSampleLiquid.esModule);
}
if (this.network === 'bisq') {
@@ -157,7 +157,7 @@ init();`;
if (this.network === 'signet') {
codeText = this.replaceJSPlaceholder(codeText, code.codeSampleSignet.esModule);
}
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
codeText = this.replaceJSPlaceholder(codeText, code.codeSampleLiquid.esModule);
}
if (this.network === 'bisq') {
@@ -237,7 +237,7 @@ yarn add @mempool/liquid.js`;
if (this.network === 'signet') {
return this.replaceCurlPlaceholder(code.codeTemplate.curl, code.codeSampleSignet);
}
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
return this.replaceCurlPlaceholder(code.codeTemplate.curl, code.codeSampleLiquid);
}
if (this.network === 'bisq') {
@@ -259,7 +259,7 @@ yarn add @mempool/liquid.js`;
if (this.network === 'signet') {
return code.codeSampleSignet.response;
}
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
return code.codeSampleLiquid.response;
}
if (this.network === 'bisq') {
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 f86ff0b4c..1612c666e 100644
--- a/frontend/src/app/components/fees-box/fees-box.component.ts
+++ b/frontend/src/app/components/fees-box/fees-box.component.ts
@@ -26,7 +26,7 @@ export class FeesBoxComponent implements OnInit {
) { }
ngOnInit(): void {
- this.defaultFee = this.stateService.network === 'liquid' ? 0.1 : 1;
+ this.defaultFee = this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet' ? 0.1 : 1;
this.isLoadingWebSocket$ = this.stateService.isLoadingWebSocket$;
this.feeEstimations$ = this.stateService.mempoolBlocks$
diff --git a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html
index f6e02beed..8329fa2fd 100644
--- a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html
+++ b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html
@@ -1,3 +1,4 @@
+
-
+
-
+
@@ -41,7 +43,7 @@
-->
-
+
@@ -60,3 +62,4 @@
+
\ No newline at end of file
diff --git a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.scss b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.scss
index 0d09d84b4..fefa1dd95 100644
--- a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.scss
+++ b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.scss
@@ -102,6 +102,10 @@ nav {
background-color: #116761;
}
+.liquidtestnet.active {
+ background-color: #494a4a;
+}
+
.testnet.active {
background-color: #1d486f;
}
diff --git a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.ts b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.ts
index 4d495c34e..f71e63e46 100644
--- a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.ts
+++ b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.ts
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Env, StateService } from '../../services/state.service';
-import { Observable} from 'rxjs';
+import { merge, Observable, of} from 'rxjs';
@Component({
selector: 'app-liquid-master-page',
@@ -13,6 +13,7 @@ export class LiquidMasterPageComponent implements OnInit {
navCollapsed = false;
isMobile = window.innerWidth <= 767.98;
officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE;
+ network$: Observable;
constructor(
private stateService: StateService,
@@ -21,6 +22,7 @@ export class LiquidMasterPageComponent implements OnInit {
ngOnInit() {
this.env = this.stateService.env;
this.connectionState$ = this.stateService.connectionState$;
+ this.network$ = merge(of(''), this.stateService.networkChanged$);
}
collapse(): void {
diff --git a/frontend/src/app/components/master-page/master-page.component.html b/frontend/src/app/components/master-page/master-page.component.html
index 19865c715..056a76434 100644
--- a/frontend/src/app/components/master-page/master-page.component.html
+++ b/frontend/src/app/components/master-page/master-page.component.html
@@ -11,7 +11,7 @@
-
@@ -54,8 +56,8 @@
-
-
+
+
diff --git a/frontend/src/app/components/master-page/master-page.component.scss b/frontend/src/app/components/master-page/master-page.component.scss
index d7eefd025..c2a57432d 100644
--- a/frontend/src/app/components/master-page/master-page.component.scss
+++ b/frontend/src/app/components/master-page/master-page.component.scss
@@ -110,6 +110,10 @@ nav {
background-color: #116761;
}
+.liquidtestnet.active {
+ background-color: #494a4a;
+}
+
.testnet.active {
background-color: #1d486f;
}
diff --git a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html
index ca3a7270f..23846128d 100644
--- a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html
+++ b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html
@@ -19,7 +19,7 @@
{{ i }} transactions
-
+
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 4e2f3f7bf..07df153f9 100644
--- a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts
+++ b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts
@@ -55,7 +55,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
) { }
ngOnInit() {
- if (this.stateService.network === 'liquid') {
+ if (this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet') {
this.feeRounding = '1.0-1';
}
this.mempoolEmptyBlocks.forEach((b) => {
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 35dacbe26..6baa96596 100644
--- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
+++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
@@ -371,7 +371,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
this.feeLimitIndex = i;
}
if (feeLevels[i] <= this.limitFee) {
- if (this.stateService.network === 'liquid') {
+ if (this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet') {
this.feeLevelsOrdered.push(`${(feeLevels[i] / 10).toFixed(1)} - ${(feeLevels[i + 1] / 10).toFixed(1)}`);
} else {
this.feeLevelsOrdered.push(`${feeLevels[i]} - ${feeLevels[i + 1]}`);
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 e560076e7..b9cb1ee9c 100644
--- a/frontend/src/app/components/search-form/search-form.component.ts
+++ b/frontend/src/app/components/search-form/search-form.component.ts
@@ -7,11 +7,13 @@ import { Observable, of, Subject, merge } from 'rxjs';
import { debounceTime, distinctUntilChanged, switchMap, filter, catchError, map } from 'rxjs/operators';
import { ElectrsApiService } from 'src/app/services/electrs-api.service';
import { NgbTypeahead } from '@ng-bootstrap/ng-bootstrap';
+import { RelativeUrlPipe } from 'src/app/shared/pipes/relative-url/relative-url.pipe';
@Component({
selector: 'app-search-form',
templateUrl: './search-form.component.html',
styleUrls: ['./search-form.component.scss'],
+ providers: [RelativeUrlPipe],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SearchFormComponent implements OnInit {
@@ -38,6 +40,7 @@ export class SearchFormComponent implements OnInit {
private assetsService: AssetsService,
private stateService: StateService,
private electrsApiService: ElectrsApiService,
+ private relativeUrlPipe: RelativeUrlPipe,
) { }
ngOnInit() {
@@ -48,7 +51,7 @@ export class SearchFormComponent implements OnInit {
searchText: ['', Validators.required],
});
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
this.assetsService.getAssetsMinimalJson$
.subscribe((assets) => {
this.assets = assets;
@@ -101,7 +104,7 @@ export class SearchFormComponent implements OnInit {
this.navigate('/block/', searchText);
} else if (this.regexTransaction.test(searchText)) {
const matches = this.regexTransaction.exec(searchText);
- if (this.network === 'liquid') {
+ if (this.network === 'liquid' || this.network === 'liquidtestnet') {
if (this.assets[matches[1]]) {
this.navigate('/asset/', matches[1]);
}
@@ -125,7 +128,7 @@ export class SearchFormComponent implements OnInit {
}
navigate(url: string, searchText: string, extras?: any) {
- this.router.navigate([(this.network && this.stateService.env.BASE_MODULE === 'mempool' ? '/' + this.network : '') + url, searchText], extras);
+ this.router.navigate([this.relativeUrlPipe.transform(url), searchText], extras);
this.searchTriggered.emit();
this.searchForm.setValue({
searchText: '',
diff --git a/frontend/src/app/components/sponsor/sponsor.component.html b/frontend/src/app/components/sponsor/sponsor.component.html
index e5ec2310a..001ea1272 100644
--- a/frontend/src/app/components/sponsor/sponsor.component.html
+++ b/frontend/src/app/components/sponsor/sponsor.component.html
@@ -117,7 +117,7 @@
-
+