From ad883da066e7f4619c08783f2c2ae7a02f927b37 Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Sat, 11 May 2024 00:20:59 +0200 Subject: [PATCH] add testnet4 option --- btc.js | 3 ++- btc.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/btc.js b/btc.js index 87a82b7..24f800f 100644 --- a/btc.js +++ b/btc.js @@ -48,10 +48,11 @@ var Uint256; exports.networks = { main: bitcoin.networks.bitcoin, test: bitcoin.networks.testnet, + testnet4: bitcoin.networks.testnet, regtest: bitcoin.networks.regtest, signet: bitcoin.networks.testnet }; -let chain = 'test'; +let chain = 'testnet4'; exports.network = exports.networks[chain]; async function btc(...args) { return new Promise((r, e) => { diff --git a/btc.ts b/btc.ts index 338698a..db08c77 100644 --- a/btc.ts +++ b/btc.ts @@ -187,16 +187,17 @@ export interface ListUnspentArgs { export type TransactionType = string | Buffer | bitcoin.Transaction; export type PsbtType = string | bitcoin.Psbt; -export type Chain = 'main' | 'test' | 'regtest' | 'signet'; +export type Chain = 'main' | 'test' | 'testnet4' | 'regtest' | 'signet'; export const networks: { [name in Chain]: bitcoin.networks.Network } = { main: bitcoin.networks.bitcoin, test: bitcoin.networks.testnet, + testnet4: bitcoin.networks.testnet, regtest: bitcoin.networks.regtest, signet: bitcoin.networks.testnet }; -let chain: Chain = 'test'; +let chain: Chain = 'testnet4'; export let network = networks[chain]; export async function btc(...args: (string | Buffer | number | {} | TransactionType | PsbtType)[]): Promise {