Skip to content

Commit

Permalink
Merge pull request #577 from threshold-network/fix-btc-address-valida…
Browse files Browse the repository at this point in the history
…tion

Fix `isValidBtcAddress` function
  • Loading branch information
lukasz-zimnoch authored Jul 24, 2023
2 parents 2d46c38 + 86b6375 commit 15dbccb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/threshold-ts/utils/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export {
createOutputScriptFromAddress,
createAddressFromOutputScript,
} from "@keep-network/tbtc-v2.ts/dist/src/bitcoin"
import { toBcoinNetwork } from "@keep-network/tbtc-v2.ts/dist/src/bitcoin-network"
import {
AddressType,
getAddressInfo,
Expand All @@ -19,7 +18,7 @@ export const isValidBtcAddress = (
address: string,
network: BitcoinNetwork = BitcoinNetwork.Mainnet
): boolean => {
return validate(address, toBcoinNetwork(network) as Network)
return validate(address, network.valueOf() as Network)
}

// P2PKH, P2WPKH, P2SH, or P2WSH
Expand Down

0 comments on commit 15dbccb

Please sign in to comment.