@did-btcr2/bitcoin 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bitcoin.js +4 -4
- package/dist/esm/bitcoin.js +4 -4
- package/dist/types/bitcoin.d.ts +3 -3
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/bitcoin.ts +4 -4
- package/src/types.ts +1 -1
package/dist/cjs/bitcoin.js
CHANGED
|
@@ -10,7 +10,7 @@ import { DEFAULT_BITCOIN_NETWORK_CONFIG } from './constants.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export class BitcoinNetworkConnection {
|
|
12
12
|
network;
|
|
13
|
-
|
|
13
|
+
bitcoin;
|
|
14
14
|
testnet3;
|
|
15
15
|
testnet4;
|
|
16
16
|
signet;
|
|
@@ -34,7 +34,7 @@ export class BitcoinNetworkConnection {
|
|
|
34
34
|
// Parse the BITCOIN_NETWORK_CONFIG
|
|
35
35
|
const networkConfigs = JSON.parse(BITCOIN_NETWORK_CONFIG);
|
|
36
36
|
// Set a list of available networks
|
|
37
|
-
const networks = ['
|
|
37
|
+
const networks = ['bitcoin', 'testnet3', 'testnet4', 'signet', 'mutinynet', 'regtest'];
|
|
38
38
|
// Iterate over the networks and create the client connections
|
|
39
39
|
for (const network of networks) {
|
|
40
40
|
const networkConfig = (configs?.[network] ?? networkConfigs[network]);
|
|
@@ -60,7 +60,7 @@ export class BitcoinNetworkConnection {
|
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Get the Bitcoin network configuration for a specific network.
|
|
63
|
-
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., '
|
|
63
|
+
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
64
64
|
* @returns {Bitcoin} The Bitcoin object.
|
|
65
65
|
*/
|
|
66
66
|
getNetworkConnection(network) {
|
|
@@ -72,7 +72,7 @@ export class BitcoinNetworkConnection {
|
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Sets the active Bitcoin network.
|
|
75
|
-
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., '
|
|
75
|
+
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
76
76
|
* @throws {MethodError} If no configuration is found for the specified network.
|
|
77
77
|
*/
|
|
78
78
|
setActiveNetwork(active) {
|
package/dist/esm/bitcoin.js
CHANGED
|
@@ -10,7 +10,7 @@ import { DEFAULT_BITCOIN_NETWORK_CONFIG } from './constants.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export class BitcoinNetworkConnection {
|
|
12
12
|
network;
|
|
13
|
-
|
|
13
|
+
bitcoin;
|
|
14
14
|
testnet3;
|
|
15
15
|
testnet4;
|
|
16
16
|
signet;
|
|
@@ -34,7 +34,7 @@ export class BitcoinNetworkConnection {
|
|
|
34
34
|
// Parse the BITCOIN_NETWORK_CONFIG
|
|
35
35
|
const networkConfigs = JSON.parse(BITCOIN_NETWORK_CONFIG);
|
|
36
36
|
// Set a list of available networks
|
|
37
|
-
const networks = ['
|
|
37
|
+
const networks = ['bitcoin', 'testnet3', 'testnet4', 'signet', 'mutinynet', 'regtest'];
|
|
38
38
|
// Iterate over the networks and create the client connections
|
|
39
39
|
for (const network of networks) {
|
|
40
40
|
const networkConfig = (configs?.[network] ?? networkConfigs[network]);
|
|
@@ -60,7 +60,7 @@ export class BitcoinNetworkConnection {
|
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Get the Bitcoin network configuration for a specific network.
|
|
63
|
-
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., '
|
|
63
|
+
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
64
64
|
* @returns {Bitcoin} The Bitcoin object.
|
|
65
65
|
*/
|
|
66
66
|
getNetworkConnection(network) {
|
|
@@ -72,7 +72,7 @@ export class BitcoinNetworkConnection {
|
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Sets the active Bitcoin network.
|
|
75
|
-
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., '
|
|
75
|
+
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
76
76
|
* @throws {MethodError} If no configuration is found for the specified network.
|
|
77
77
|
*/
|
|
78
78
|
setActiveNetwork(active) {
|
package/dist/types/bitcoin.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type BitcoinNetworkConfigMap = {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare class BitcoinNetworkConnection {
|
|
21
21
|
network: BitcoinNetworkConfig;
|
|
22
|
-
|
|
22
|
+
bitcoin?: BitcoinNetworkConfig;
|
|
23
23
|
testnet3?: BitcoinNetworkConfig;
|
|
24
24
|
testnet4?: BitcoinNetworkConfig;
|
|
25
25
|
signet?: BitcoinNetworkConfig;
|
|
@@ -34,13 +34,13 @@ export declare class BitcoinNetworkConnection {
|
|
|
34
34
|
constructor(configs?: BitcoinNetworkConfigMap);
|
|
35
35
|
/**
|
|
36
36
|
* Get the Bitcoin network configuration for a specific network.
|
|
37
|
-
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., '
|
|
37
|
+
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
38
38
|
* @returns {Bitcoin} The Bitcoin object.
|
|
39
39
|
*/
|
|
40
40
|
getNetworkConnection(network: string): BitcoinNetworkConnection;
|
|
41
41
|
/**
|
|
42
42
|
* Sets the active Bitcoin network.
|
|
43
|
-
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., '
|
|
43
|
+
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
44
44
|
* @throws {MethodError} If no configuration is found for the specified network.
|
|
45
45
|
*/
|
|
46
46
|
setActiveNetwork(active: string): void;
|
package/dist/types/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/bitcoin.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type BitcoinNetworkConfigMap = {
|
|
|
25
25
|
*/
|
|
26
26
|
export class BitcoinNetworkConnection {
|
|
27
27
|
public network: BitcoinNetworkConfig;
|
|
28
|
-
public
|
|
28
|
+
public bitcoin?: BitcoinNetworkConfig;
|
|
29
29
|
public testnet3?: BitcoinNetworkConfig;
|
|
30
30
|
public testnet4?: BitcoinNetworkConfig;
|
|
31
31
|
public signet?: BitcoinNetworkConfig;
|
|
@@ -62,7 +62,7 @@ export class BitcoinNetworkConnection {
|
|
|
62
62
|
const networkConfigs: Record<string, BitcoinClientConfig> = JSON.parse(BITCOIN_NETWORK_CONFIG);
|
|
63
63
|
|
|
64
64
|
// Set a list of available networks
|
|
65
|
-
const networks: (keyof AvailableNetworks)[] = ['
|
|
65
|
+
const networks: (keyof AvailableNetworks)[] = ['bitcoin', 'testnet3', 'testnet4', 'signet', 'mutinynet', 'regtest'];
|
|
66
66
|
|
|
67
67
|
// Iterate over the networks and create the client connections
|
|
68
68
|
for (const network of networks) {
|
|
@@ -97,7 +97,7 @@ export class BitcoinNetworkConnection {
|
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Get the Bitcoin network configuration for a specific network.
|
|
100
|
-
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., '
|
|
100
|
+
* @param {keyof AvailableNetworks} network - The Bitcoin network (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
101
101
|
* @returns {Bitcoin} The Bitcoin object.
|
|
102
102
|
*/
|
|
103
103
|
public getNetworkConnection(network: string): BitcoinNetworkConnection {
|
|
@@ -113,7 +113,7 @@ export class BitcoinNetworkConnection {
|
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Sets the active Bitcoin network.
|
|
116
|
-
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., '
|
|
116
|
+
* @param {keyof AvailableNetworks} active - The Bitcoin network to set as active (e.g., 'bitcoin', 'testnet3', 'signet', 'regtest').
|
|
117
117
|
* @throws {MethodError} If no configuration is found for the specified network.
|
|
118
118
|
*/
|
|
119
119
|
public setActiveNetwork(active: string): void {
|