@chainflip/bitcoin 1.0.0 → 1.0.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/index.cjs +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -216,7 +216,10 @@ var isValidAddressForNetwork = (address, network) => {
|
|
|
216
216
|
if (/^(m|n|2)/.test(address)) {
|
|
217
217
|
return parseBase58Address(address, network) !== null;
|
|
218
218
|
}
|
|
219
|
-
if (/^
|
|
219
|
+
if (network === "regtest" && /^bcrt1/.test(address)) {
|
|
220
|
+
return decodeSegwitAddress(address) !== null;
|
|
221
|
+
}
|
|
222
|
+
if (network === "testnet" && /^tb1/.test(address)) {
|
|
220
223
|
return decodeSegwitAddress(address) !== null;
|
|
221
224
|
}
|
|
222
225
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -216,7 +216,10 @@ var isValidAddressForNetwork = (address, network) => {
|
|
|
216
216
|
if (/^(m|n|2)/.test(address)) {
|
|
217
217
|
return parseBase58Address(address, network) !== null;
|
|
218
218
|
}
|
|
219
|
-
if (/^
|
|
219
|
+
if (network === "regtest" && /^bcrt1/.test(address)) {
|
|
220
|
+
return decodeSegwitAddress(address) !== null;
|
|
221
|
+
}
|
|
222
|
+
if (network === "testnet" && /^tb1/.test(address)) {
|
|
220
223
|
return decodeSegwitAddress(address) !== null;
|
|
221
224
|
}
|
|
222
225
|
}
|