@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 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 (/^(tb|bcrt)1/.test(address)) {
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 (/^(tb|bcrt)1/.test(address)) {
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/bitcoin",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/chainflip-io/chainflip-product-toolkit.git",
6
6
  "publishConfig": {