diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts
index 7a23e7556..5262a431a 100644
--- a/frontend/src/app/app-routing.module.ts
+++ b/frontend/src/app/app-routing.module.ts
@@ -53,6 +53,44 @@ let routes: Routes = [
},
]
},
+ {
+ path: 'testnet4',
+ children: [
+ {
+ path: '',
+ pathMatch: 'full',
+ loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
+ data: { preload: true },
+ },
+ {
+ path: '',
+ loadChildren: () => import('./master-page.module').then(m => m.MasterPageModule),
+ data: { preload: true },
+ },
+ {
+ path: 'wallet',
+ children: [],
+ component: AddressGroupComponent,
+ data: {
+ networkSpecific: true,
+ }
+ },
+ {
+ path: 'status',
+ data: { networks: ['bitcoin', 'liquid'] },
+ component: StatusViewComponent
+ },
+ {
+ path: '',
+ loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
+ data: { preload: true },
+ },
+ {
+ path: '**',
+ redirectTo: '/testnet4'
+ },
+ ]
+ },
{
path: 'signet',
children: [
diff --git a/frontend/src/app/app.constants.ts b/frontend/src/app/app.constants.ts
index bd81d02c0..aaa53b8ba 100644
--- a/frontend/src/app/app.constants.ts
+++ b/frontend/src/app/app.constants.ts
@@ -189,22 +189,22 @@ export const specialBlocks = {
'0': {
labelEvent: 'Genesis',
labelEventCompleted: 'The Genesis of Bitcoin',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'210000': {
labelEvent: 'Bitcoin\'s 1st Halving',
labelEventCompleted: 'Block Subsidy has halved to 25 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'420000': {
labelEvent: 'Bitcoin\'s 2nd Halving',
labelEventCompleted: 'Block Subsidy has halved to 12.5 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'630000': {
labelEvent: 'Bitcoin\'s 3rd Halving',
labelEventCompleted: 'Block Subsidy has halved to 6.25 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'709632': {
labelEvent: 'Taproot 🌱 activation',
@@ -214,62 +214,62 @@ export const specialBlocks = {
'840000': {
labelEvent: 'Bitcoin\'s 4th Halving',
labelEventCompleted: 'Block Subsidy has halved to 3.125 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'1050000': {
labelEvent: 'Bitcoin\'s 5th Halving',
labelEventCompleted: 'Block Subsidy has halved to 1.5625 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'1260000': {
labelEvent: 'Bitcoin\'s 6th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.78125 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'1470000': {
labelEvent: 'Bitcoin\'s 7th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.390625 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'1680000': {
labelEvent: 'Bitcoin\'s 8th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.1953125 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'1890000': {
labelEvent: 'Bitcoin\'s 9th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.09765625 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'2100000': {
labelEvent: 'Bitcoin\'s 10th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.04882812 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'2310000': {
labelEvent: 'Bitcoin\'s 11th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.02441406 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'2520000': {
labelEvent: 'Bitcoin\'s 12th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.01220703 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'2730000': {
labelEvent: 'Bitcoin\'s 13th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.00610351 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'2940000': {
labelEvent: 'Bitcoin\'s 14th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.00305175 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
},
'3150000': {
labelEvent: 'Bitcoin\'s 15th Halving',
labelEventCompleted: 'Block Subsidy has halved to 0.00152587 BTC per block',
- networks: ['mainnet', 'testnet'],
+ networks: ['mainnet', 'testnet', 'testnet4'],
}
};
diff --git a/frontend/src/app/bitcoin.utils.ts b/frontend/src/app/bitcoin.utils.ts
index d5b5122fa..b9f4f39e1 100644
--- a/frontend/src/app/bitcoin.utils.ts
+++ b/frontend/src/app/bitcoin.utils.ts
@@ -266,6 +266,11 @@ const featureActivation = {
segwit: 872730,
taproot: 2032291,
},
+ testnet4: {
+ rbf: 0,
+ segwit: 0,
+ taproot: 0,
+ },
signet: {
rbf: 0,
segwit: 0,
diff --git a/frontend/src/app/components/amount/amount.component.html b/frontend/src/app/components/amount/amount.component.html
index f157d17d6..b38cf4c41 100644
--- a/frontend/src/app/components/amount/amount.component.html
+++ b/frontend/src/app/components/amount/amount.component.html
@@ -43,5 +43,6 @@
L-
tL-
t
+ t
s
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 35499f162..1d0e284f8 100644
--- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts
+++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts
@@ -70,6 +70,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
liquid: ['var(--liquid)', 'var(--testnet-alt)'],
'liquidtestnet': ['var(--liquidtestnet)', 'var(--liquidtestnet-alt)'],
testnet: ['var(--testnet)', 'var(--testnet-alt)'],
+ testnet4: ['var(--testnet)', 'var(--testnet-alt)'],
signet: ['var(--signet)', 'var(--signet-alt)'],
};
diff --git a/frontend/src/app/components/clock/clock.component.ts b/frontend/src/app/components/clock/clock.component.ts
index 94ff3e810..90f24a753 100644
--- a/frontend/src/app/components/clock/clock.component.ts
+++ b/frontend/src/app/components/clock/clock.component.ts
@@ -36,6 +36,7 @@ export class ClockComponent implements OnInit {
liquid: ['#116761', '#183550'],
'liquidtestnet': ['#494a4a', '#272e46'],
testnet: ['#1d486f', '#183550'],
+ testnet4: ['#1d486f', '#183550'],
signet: ['#6f1d5d', '#471850'],
};
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 7d826ca87..7e39d9341 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
@@ -51,7 +51,8 @@
Mainnet
Signet
-
Testnet
+
Testnet3
+
Testnet4
Liquid
Liquid Testnet
diff --git a/frontend/src/app/components/master-page-preview/master-page-preview.component.html b/frontend/src/app/components/master-page-preview/master-page-preview.component.html
index 36e8eed10..49efce400 100644
--- a/frontend/src/app/components/master-page-preview/master-page-preview.component.html
+++ b/frontend/src/app/components/master-page-preview/master-page-preview.component.html
@@ -15,7 +15,8 @@
Signet
-
Testnet
+
Testnet3
+
Testnet4
Mainnet
Testnet
Mainnet
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 5da892f4a..6383e999b 100644
--- a/frontend/src/app/components/master-page/master-page.component.html
+++ b/frontend/src/app/components/master-page/master-page.component.html
@@ -58,14 +58,15 @@
-
+
Mainnet
Signet
-
Testnet
+
Testnet3
+
Testnet4
Liquid
Liquid Testnet
@@ -114,7 +115,7 @@
-
+
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 8f5e65f96..fe073564e 100644
--- a/frontend/src/app/components/search-form/search-form.component.ts
+++ b/frontend/src/app/components/search-form/search-form.component.ts
@@ -179,7 +179,7 @@ export class SearchFormComponent implements OnInit {
const lightningResults = result[1];
// Do not show date and timestamp results for liquid
- const isNetworkBitcoin = this.network === '' || this.network === 'testnet' || this.network === 'signet';
+ const isNetworkBitcoin = this.network === '' || this.network === 'testnet' || this.network === 'testnet4' || this.network === 'signet';
const matchesBlockHeight = this.regexBlockheight.test(searchText) && parseInt(searchText) <= this.stateService.latestBlockHeight;
const matchesDateTime = this.regexDate.test(searchText) && new Date(searchText).toString() !== 'Invalid Date' && new Date(searchText).getTime() <= Date.now() && isNetworkBitcoin;
diff --git a/frontend/src/app/components/svg-images/svg-images.component.html b/frontend/src/app/components/svg-images/svg-images.component.html
index 3fe3f56c8..395bbcc53 100644
--- a/frontend/src/app/components/svg-images/svg-images.component.html
+++ b/frontend/src/app/components/svg-images/svg-images.component.html
@@ -60,6 +60,9 @@
+
+
+
diff --git a/frontend/src/app/components/tracker/tracker.component.html b/frontend/src/app/components/tracker/tracker.component.html
index c75e6fec6..4a726f28e 100644
--- a/frontend/src/app/components/tracker/tracker.component.html
+++ b/frontend/src/app/components/tracker/tracker.component.html
@@ -5,7 +5,8 @@
Bitcoin Signet
-
Bitcoin Testnet
+
Bitcoin Testnet3
+
Bitcoin Testnet4
Liquid
Liquid Testnet
Bitcoin
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 9bbca05dd..30e85a6e7 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
@@ -91,6 +91,7 @@ export class TxBowtieGraphComponent implements OnInit, OnChanges {
'liquidtestnet': ['#d2d2d2', '#979797', '#d2d2d200'],
// testnet: ['#1d486f', '#183550'],
testnet: ['#4edf77', '#10a0af', '#4edf7700'],
+ testnet4: ['#4edf77', '#10a0af', '#4edf7700'],
// signet: ['#6f1d5d', '#471850'],
signet: ['#d24fc8', '#a84fd2', '#d24fc800'],
};
diff --git a/frontend/src/app/services/enterprise.service.ts b/frontend/src/app/services/enterprise.service.ts
index 5de57b059..4ea890f1f 100644
--- a/frontend/src/app/services/enterprise.service.ts
+++ b/frontend/src/app/services/enterprise.service.ts
@@ -41,6 +41,7 @@ export class EnterpriseService {
disableSubnetworks(): void {
this.stateService.env.TESTNET_ENABLED = false;
+ this.stateService.env.TESTNET4_ENABLED = false;
this.stateService.env.LIQUID_ENABLED = false;
this.stateService.env.LIQUID_TESTNET_ENABLED = false;
this.stateService.env.SIGNET_ENABLED = false;
diff --git a/frontend/src/app/services/mining.service.ts b/frontend/src/app/services/mining.service.ts
index 96723921e..952d13a78 100644
--- a/frontend/src/app/services/mining.service.ts
+++ b/frontend/src/app/services/mining.service.ts
@@ -58,7 +58,7 @@ export class MiningService {
// I think it's fine to hardcode this since we don't have x1000 hashrate jump everyday
// If we want to support the mining dashboard for testnet, we can hardcode it too
let selectedPower = 18;
- if (this.stateService.network === 'testnet') {
+ if (this.stateService.network === 'testnet' || this.stateService.network === 'testnet4') {
selectedPower = 12;
}
diff --git a/frontend/src/app/services/navigation.service.ts b/frontend/src/app/services/navigation.service.ts
index 2db3f6025..1a22c1371 100644
--- a/frontend/src/app/services/navigation.service.ts
+++ b/frontend/src/app/services/navigation.service.ts
@@ -9,6 +9,7 @@ const networkModules = {
subnets: [
{ name: 'mainnet', path: '' },
{ name: 'testnet', path: '/testnet' },
+ { name: 'testnet4', path: '/testnet4' },
{ name: 'signet', path: '/signet' },
],
},
@@ -68,7 +69,7 @@ export class NavigationService {
}
if (route.url?.length) {
path = [path, ...route.url.map(segment => segment.path).filter(path => {
- return path.length && !['testnet', 'signet'].includes(path);
+ return path.length && !['testnet', 'testnet4', 'signet'].includes(path);
})].join('/');
}
route = route.firstChild;
diff --git a/frontend/src/app/services/seo.service.ts b/frontend/src/app/services/seo.service.ts
index 008cdc9bc..1431a52d8 100644
--- a/frontend/src/app/services/seo.service.ts
+++ b/frontend/src/app/services/seo.service.ts
@@ -81,7 +81,9 @@ export class SeoService {
getTitle(): string {
if (this.network === 'testnet')
- return this.baseTitle + ' - Bitcoin Testnet';
+ return this.baseTitle + ' - Bitcoin Testnet3';
+ if (this.network === 'testnet4')
+ return this.baseTitle + ' - Bitcoin Testnet4';
if (this.network === 'signet')
return this.baseTitle + ' - Bitcoin Signet';
if (this.network === 'liquid')
@@ -92,7 +94,7 @@ export class SeoService {
}
getDescription(): string {
- if ( (this.network === 'testnet') || (this.network === 'signet') || (this.network === '') || (this.network == 'mainnet') )
+ if ( (this.network === 'testnet') || (this.network === 'testnet4') || (this.network === 'signet') || (this.network === '') || (this.network == 'mainnet') )
return this.baseDescription + ' See the real-time status of your transactions, browse network stats, and more.';
if ( (this.network === 'liquid') || (this.network === 'liquidtestnet') )
return this.baseDescription + ' See Liquid transactions & assets, get network info, and more.';
diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts
index b939574b5..1aa126471 100644
--- a/frontend/src/app/services/state.service.ts
+++ b/frontend/src/app/services/state.service.ts
@@ -40,6 +40,7 @@ export interface Customization {
export interface Env {
TESTNET_ENABLED: boolean;
+ TESTNET4_ENABLED: boolean;
SIGNET_ENABLED: boolean;
LIQUID_ENABLED: boolean;
LIQUID_TESTNET_ENABLED: boolean;
@@ -73,6 +74,7 @@ export interface Env {
const defaultEnv: Env = {
'TESTNET_ENABLED': false,
+ 'TESTNET4_ENABLED': false,
'SIGNET_ENABLED': false,
'LIQUID_ENABLED': false,
'LIQUID_TESTNET_ENABLED': false,
@@ -298,7 +300,7 @@ export class StateService {
// (?:preview\/)? optional "preview" prefix (non-capturing)
// (testnet|signet)/ network string (captured as networkMatches[1])
// ($|\/) network string must end or end with a slash
- const networkMatches = url.match(/^\/(?:[a-z]{2}(?:-[A-Z]{2})?\/)?(?:preview\/)?(testnet|signet)($|\/)/);
+ const networkMatches = url.match(/^\/(?:[a-z]{2}(?:-[A-Z]{2})?\/)?(?:preview\/)?(testnet4?|signet)($|\/)/);
switch (networkMatches && networkMatches[1]) {
case 'signet':
if (this.network !== 'signet') {
@@ -317,6 +319,12 @@ export class StateService {
}
}
return;
+ case 'testnet4':
+ if (this.network !== 'testnet4') {
+ this.network = 'testnet4';
+ this.networkChanged$.next('testnet4');
+ }
+ return;
default:
if (this.env.BASE_MODULE !== 'mempool') {
if (this.network !== this.env.BASE_MODULE) {
@@ -365,7 +373,7 @@ export class StateService {
}
isAnyTestnet(): boolean {
- return ['testnet', 'signet', 'liquidtestnet'].includes(this.network);
+ return ['testnet', 'testnet4', 'signet', 'liquidtestnet'].includes(this.network);
}
resetChainTip() {
diff --git a/frontend/src/app/shared/common.utils.ts b/frontend/src/app/shared/common.utils.ts
index be1e32c73..28e510e14 100644
--- a/frontend/src/app/shared/common.utils.ts
+++ b/frontend/src/app/shared/common.utils.ts
@@ -151,7 +151,7 @@ export function nextRoundNumber(num: number): number {
export function seoDescriptionNetwork(network: string): string {
if( network === 'liquidtestnet' || network === 'testnet' ) {
return ' Testnet';
- } else if( network === 'signet' || network === 'testnet' ) {
+ } else if( network === 'signet' || network === 'testnet' || network === 'testnet4') {
return ' ' + network.charAt(0).toUpperCase() + network.slice(1);
}
return '';
diff --git a/frontend/src/app/shared/components/btc/btc.component.html b/frontend/src/app/shared/components/btc/btc.component.html
index c13a8ff31..e002489f5 100644
--- a/frontend/src/app/shared/components/btc/btc.component.html
+++ b/frontend/src/app/shared/components/btc/btc.component.html
@@ -4,5 +4,6 @@
L-
tL-
t-
+
t-
s-{{ unit }}
\ No newline at end of file
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.html b/frontend/src/app/shared/components/global-footer/global-footer.component.html
index b1ce52e5e..cbe7dd330 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.html
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.html
@@ -62,10 +62,11 @@
More FAQs »
-
+
Networks
Mainnet Explorer
-
Testnet Explorer
+
Testnet3 Explorer
+
Testnet4 Explorer
Signet Explorer
Liquid Testnet Explorer
Liquid Explorer
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 5300ba107..48603ffbe 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 {
networkLink(network) {
const thisNetwork = network || 'mainnet';
- if( network === '' || network === 'mainnet' || network === 'testnet' || network === 'signet' ) {
+ if( network === '' || network === 'mainnet' || network === 'testnet' || network === 'testnet4' || network === 'signet' ) {
return (this.env.BASE_MODULE === 'mempool' ? '' : this.env.MEMPOOL_WEBSITE_URL + this.urlLanguage) + this.networkPaths[thisNetwork] || '/';
}
if( network === 'liquid' || network === 'liquidtestnet' ) {
diff --git a/frontend/src/app/shared/components/sats/sats.component.html b/frontend/src/app/shared/components/sats/sats.component.html
index 1b4ab9143..bdd718e9f 100644
--- a/frontend/src/app/shared/components/sats/sats.component.html
+++ b/frontend/src/app/shared/components/sats/sats.component.html
@@ -4,5 +4,6 @@
L-
tL-
t-
+
t-
s-sats
\ No newline at end of file
diff --git a/frontend/src/app/shared/regex.utils.ts b/frontend/src/app/shared/regex.utils.ts
index 422d538e0..187111a59 100644
--- a/frontend/src/app/shared/regex.utils.ts
+++ b/frontend/src/app/shared/regex.utils.ts
@@ -62,6 +62,20 @@ const ADDRESS_CHARS: {
+ `{20,100}`
+ `)`,
},
+ testnet4: {
+ base58: `[mn2]` // Starts with a single m, n, or 2 (P2PKH is m or n, 2 is P2SH)
+ + BASE58_CHARS
+ + `{33,34}`, // m|n is 34 length, 2 is 35 length (We match the first letter separately)
+ bech32: `(?:`
+ + `tb1` // Starts with tb1
+ + BECH32_CHARS_LW
+ + `{20,100}` // As per bech32, 6 char checksum is minimum
+ + `|`
+ + `TB1` // All upper case version
+ + BECH32_CHARS_UP
+ + `{20,100}`
+ + `)`,
+ },
signet: {
base58: `[mn2]`
+ BASE58_CHARS
@@ -128,7 +142,7 @@ const ADDRESS_CHARS: {
type RegexTypeNoAddrNoBlockHash = | `transaction` | `blockheight` | `date` | `timestamp`;
export type RegexType = `address` | `blockhash` | RegexTypeNoAddrNoBlockHash;
-export const NETWORKS = [`testnet`, `signet`, `liquid`, `liquidtestnet`, `mainnet`] as const;
+export const NETWORKS = [`testnet`, `testnet4`, `signet`, `liquid`, `liquidtestnet`, `mainnet`] as const;
export type Network = typeof NETWORKS[number]; // Turn const array into union type
export const ADDRESS_REGEXES: [RegExp, Network][] = NETWORKS
@@ -144,6 +158,8 @@ function isNetworkAvailable(network: Network, env: Env): boolean {
switch (network) {
case 'testnet':
return env.TESTNET_ENABLED === true;
+ case 'testnet4':
+ return env.TESTNET4_ENABLED === true;
case 'signet':
return env.SIGNET_ENABLED === true;
case 'liquid':
@@ -160,7 +176,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 (fromBaseModule === 'mempool') {
- return toNetwork !== 'mainnet' && toNetwork !== 'testnet' && toNetwork !== 'signet';
+ return toNetwork !== 'mainnet' && toNetwork !== 'testnet' && toNetwork !== 'testnet4' && toNetwork !== 'signet';
}
if (fromBaseModule === 'liquid') {
return toNetwork !== 'liquid' && toNetwork !== 'liquidtestnet';
@@ -175,7 +191,7 @@ export function getTargetUrl(toNetwork: Network, address: string, env: Env): str
targetUrl += '/address/';
targetUrl += address;
}
- if (toNetwork === 'mainnet' || toNetwork === 'testnet' || toNetwork === 'signet') {
+ if (toNetwork === 'mainnet' || toNetwork === 'testnet' || toNetwork === 'testnet4' || toNetwork === 'signet') {
targetUrl = env.MEMPOOL_WEBSITE_URL;
targetUrl += (toNetwork === 'mainnet' ? '' : `/${toNetwork}`);
targetUrl += '/address/';
@@ -209,6 +225,9 @@ export function getRegex(type: RegexType, network?: Network): RegExp {
case `testnet`:
leadingZeroes = 8; // Assumes at least 32 bits of difficulty
break;
+ case `testnet4`:
+ leadingZeroes = 8; // Assumes at least 32 bits of difficulty
+ break;
case `signet`:
leadingZeroes = 5;
break;
@@ -261,6 +280,15 @@ export function getRegex(type: RegexType, network?: Network): RegExp {
regex += `|`; // OR
regex += `(?:02|03)${HEX_CHARS}{64}`; // Compressed pubkey
break;
+ case `testnet4`:
+ regex += ADDRESS_CHARS.testnet.base58;
+ regex += `|`; // OR
+ regex += ADDRESS_CHARS.testnet.bech32;
+ regex += `|`; // OR
+ regex += `04${HEX_CHARS}{128}`; // Uncompressed pubkey
+ regex += `|`; // OR
+ regex += `(?:02|03)${HEX_CHARS}{64}`; // Compressed pubkey
+ break;
case `signet`:
regex += ADDRESS_CHARS.signet.base58;
regex += `|`; // OR