diff --git a/frontend/src/app/docs/api-docs/api-docs-data.ts b/frontend/src/app/docs/api-docs/api-docs-data.ts
index f4b4dfe04..c337b7520 100644
--- a/frontend/src/app/docs/api-docs/api-docs-data.ts
+++ b/frontend/src/app/docs/api-docs/api-docs-data.ts
@@ -1,5 +1,6 @@
-const bitcoinNetworks = ["", "testnet", "signet"];
+const bitcoinNetworks = ["", "testnet", "testnet4", "signet"];
const liquidNetworks = ["liquid", "liquidtestnet"];
+const lightningNetworks = ["", "testnet", "signet"];
const miningTimeIntervals = "24h
, 3d
, 1w
, 1m
, 3m
, 6m
, 1y
, 2y
, 3y
";
const emptyCodeSample = {
@@ -6513,7 +6514,7 @@ export const restApiDocsData = [
category: "lightning",
fragment: "lightning",
title: "Lightning",
- showConditions: bitcoinNetworks
+ showConditions: lightningNetworks
},
{
type: "endpoint",
@@ -6525,7 +6526,7 @@ export const restApiDocsData = [
default: "
Returns network-wide stats such as total number of channels and nodes, total capacity, and average/median fee figures.
Pass one of the following for :interval
: latest
, 24h
, 3d
, 1w
, 1m
, 3m
, 6m
, 1y
, 2y
, 3y
.
Returns Lightning nodes and channels that match a full-text, case-insensitive search :query
across node aliases, node pubkeys, channel IDs, and short channel IDs.
Returns a list of Lightning nodes running on clearnet in the requested :country
, where :country
is an ISO Alpha-2 country code.
Returns aggregate capacity and number of clearnet nodes per country. Capacity figures are in satoshis.
" }, urlString: "/v1/lightning/nodes/countries", - showConditions: bitcoinNetworks, + showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -7072,7 +7073,7 @@ export const restApiDocsData = [ default: "Returns a list of nodes hosted by a specified :isp
, where :isp
is an ISP's ASN.
Returns aggregate capacity, number of nodes, and number of channels per ISP. Capacity figures are in satoshis.
" }, urlString: "/v1/lightning/nodes/isp-ranking", - showConditions: bitcoinNetworks, + showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -7303,7 +7304,7 @@ export const restApiDocsData = [ default: "Returns two lists of the top 100 nodes: one ordered by liquidity (aggregate channel capacity) and the other ordered by connectivity (number of open channels).
" }, urlString: "/v1/lightning/nodes/rankings", - showConditions: bitcoinNetworks, + showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -7426,7 +7427,7 @@ export const restApiDocsData = [ default: "Returns a list of the top 100 nodes by liquidity (aggregate channel capacity).
" }, urlString: "/v1/lightning/nodes/rankings/liquidity", - showConditions: bitcoinNetworks, + showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -7623,7 +7624,7 @@ export const restApiDocsData = [ default: "Returns a list of the top 100 nodes by connectivity (number of open channels).
" }, urlString: "/v1/lightning/nodes/rankings/connectivity", - showConditions: bitcoinNetworks, + showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -7819,7 +7820,7 @@ export const restApiDocsData = [ default: "Returns a list of the top 100 oldest nodes.
" }, urlString: "/v1/lightning/nodes/rankings/age", - showConditions: bitcoinNetworks, + showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -8006,7 +8007,7 @@ export const restApiDocsData = [ default: "Returns details about a node with the given :pubKey
.
Returns historical stats for a node with the given :pubKey
.
Returns info about a Lightning channel with the given :channelId
.
Returns channels that correspond to the given :txid
(multiple transaction IDs can be specified).
Returns a list of a node's channels given its :pubKey
. Ten channels are returned at a time. Use :index
for paging. :channelStatus
can be open
, active
, or closed
.
Returns a list of channels with corresponding node geodata.
" }, urlString: "/v1/lightning/channels-geo", - showConditions: bitcoinNetworks, + showConditions: lightningNetworks, showJsExamples: showJsExamplesDefaultFalse, codeExample: { default: { @@ -8878,7 +8879,7 @@ export const restApiDocsData = [ default: "Returns a list of channels with corresponding geodata for a node with the given :pubKey
.
{{electrsPort}}
SSL
Enabled
-Electrum RPC interface for Bitcoin Signet is publicly available. Electrum RPC interface for all other networks is available to sponsors only—whitelisting is required.
+Electrum RPC interface for Bitcoin Signet and Bitcoin Testnet4 is publicly available. Electrum RPC interface for all other networks is available to sponsors only—whitelisting is required.
diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts index dd2681ca8..76d9de8d0 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.ts +++ b/frontend/src/app/docs/api-docs/api-docs.component.ts @@ -102,6 +102,8 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { this.electrsPort = 50002; break; case "testnet": this.electrsPort = 60002; break; + case "testnet4": + this.electrsPort = 40002; break; case "signet": this.electrsPort = 60602; break; case "liquid": @@ -170,6 +172,9 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { if (network === 'testnet') { curlResponse = code.codeSampleTestnet.curl; } + if (network === 'testnet4') { + curlResponse = code.codeSampleTestnet.curl; + } if (network === 'signet') { curlResponse = code.codeSampleSignet.curl; } diff --git a/frontend/src/app/docs/code-template/code-template.component.ts b/frontend/src/app/docs/code-template/code-template.component.ts index 395f6a297..bd03f5b16 100644 --- a/frontend/src/app/docs/code-template/code-template.component.ts +++ b/frontend/src/app/docs/code-template/code-template.component.ts @@ -111,7 +111,10 @@ export class CodeTemplateComponent implements OnInit { codeText = this.replaceJSPlaceholder(codeText, code.codeSampleMainnet.esModule); } if (this.network === 'testnet') { - codeText = this.replaceJSPlaceholder(codeText, code.codeSampleTestnet.esModule); + codeText = this.replaceJSPlaceholder(codeText, code.codeSampleTestnet.esModule); + } + if (this.network === 'testnet4') { + codeText = this.replaceJSPlaceholder(codeText, code.codeSampleTestnet.esModule); } if (this.network === 'signet') { codeText = this.replaceJSPlaceholder(codeText, code.codeSampleSignet.esModule); @@ -144,7 +147,10 @@ init();`; codeText = this.replaceJSPlaceholder(codeText, code.codeSampleMainnet.esModule); } if (this.network === 'testnet') { - codeText = this.replaceJSPlaceholder(codeText, code.codeSampleTestnet.esModule); + codeText = this.replaceJSPlaceholder(codeText, code.codeSampleTestnet.esModule); + } + if (this.network === 'testnet4') { + codeText = this.replaceJSPlaceholder(codeText, code.codeSampleTestnet.esModule); } if (this.network === 'signet') { codeText = this.replaceJSPlaceholder(codeText, code.codeSampleSignet.esModule); @@ -212,6 +218,9 @@ yarn add @mempool/liquid.js`; if (this.network === 'testnet') { return this.replaceCurlPlaceholder(code.codeTemplate.curl, code.codeSampleTestnet); } + if (this.network === 'testnet4') { + return this.replaceCurlPlaceholder(code.codeTemplate.curl, code.codeSampleTestnet); + } if (this.network === 'signet') { return this.replaceCurlPlaceholder(code.codeTemplate.curl, code.codeSampleSignet); } @@ -234,6 +243,9 @@ yarn add @mempool/liquid.js`; if (this.network === 'testnet') { return code.codeSampleTestnet.response; } + if (this.network === 'testnet4') { + return code.codeSampleTestnet.response; + } if (this.network === 'signet') { return code.codeSampleSignet.response; } @@ -247,7 +259,7 @@ yarn add @mempool/liquid.js`; } wrapPythonTemplate(code: any) { - return ( ( this.network === 'testnet' || 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) {