From 620b91466963172d643d92f3768935b6e9c86e29 Mon Sep 17 00:00:00 2001 From: rot13maxi Date: Thu, 9 Jan 2025 15:37:45 -0500 Subject: [PATCH] add testnet4 support --- README.md | 2 +- src/services/api/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18bf454..b81d345 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ import mempoolJS from '@mempool/mempool.js'; const { bitcoin } = mempoolJS({ protocol: 'https', // optional, defaults to http for localhost, otherwise https hostname: 'mempool.space', - network: 'testnet' // 'signet' | 'testnet' | 'mainnet', + network: 'testnet4', // 'signet' | 'testnet' | 'testnet4' | 'mainnet', config: { // optional axios request config to add to requests headers: { authorization: 'Basic auth' diff --git a/src/services/api/index.ts b/src/services/api/index.ts index d4949cf..58bfb02 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -10,7 +10,7 @@ export const makeBitcoinAPI = ({ if (!protocol) { hostname?.includes('localhost') ? protocol = 'http' : protocol = 'https'; } - if (network && ['testnet', 'signet'].includes(network)) { + if (network && ['testnet', 'testnet4', 'signet'].includes(network)) { network = `/${network}`; } else { network = '';