Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(isBtcAddress): ✨ Add support for all address formats and testnets
  • Loading branch information
madoke committed May 26, 2024
commit 31c84823577ae906065806652c5566d88eb85212
6 changes: 3 additions & 3 deletions src/lib/isBtcAddress.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assertString from './util/assertString';
import assertString from "./util/assertString";

const bech32 = /^(bc1)[a-z0-9]{25,39}$/;
const base58 = /^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;
const bech32 = /^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/;
const base58 = /^(1|2|3|m)[A-HJ-NP-Za-km-z1-9]{25,39}$/;

export default function isBtcAddress(str) {
assertString(str);
Expand Down
Loading