Signet support in the frontend.

This commit is contained in:
softsimon
2021-02-20 23:12:22 +07:00
parent 279cba5d79
commit 563ae8540b
10 changed files with 110 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ export interface ILoadingIndicators { [name: string]: number; }
export interface Env {
TESTNET_ENABLED: boolean;
SIGNET_ENABLED: boolean;
LIQUID_ENABLED: boolean;
BISQ_ENABLED: boolean;
BISQ_SEPARATE_BACKEND: boolean;
@@ -30,6 +31,7 @@ export interface Env {
const defaultEnv: Env = {
'TESTNET_ENABLED': false,
'SIGNET_ENABLED': false,
'LIQUID_ENABLED': false,
'BISQ_ENABLED': false,
'BISQ_SEPARATE_BACKEND': false,
@@ -102,7 +104,7 @@ export class StateService {
}
setNetworkBasedonUrl(url: string) {
const networkMatches = url.match(/\/(bisq|testnet|liquid)/);
const networkMatches = url.match(/\/(bisq|testnet|liquid|signet)/);
switch (networkMatches && networkMatches[1]) {
case 'liquid':
if (this.network !== 'liquid') {
@@ -110,6 +112,12 @@ export class StateService {
this.networkChanged$.next('liquid');
}
return;
case 'signet':
if (this.network !== 'signet') {
this.network = 'signet';
this.networkChanged$.next('signet');
}
return;
case 'testnet':
if (this.network !== 'testnet') {
this.network = 'testnet';