Skip to content

Commit

Permalink
add testnet4 option
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed May 10, 2024
1 parent 64db05a commit ad883da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion btc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions btc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
Expand Down

0 comments on commit ad883da

Please sign in to comment.