You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: an invalid network option silently rejects every address #6
JavaScript callers, or values coming from config or env, get a misleading NETWORK_MISMATCH instead of a clear error. Chains without a network (EVM and others) still pass, so the behaviour is inconsistent. Suggestion: throw a RangeError for values other than 'mainnet' | 'testnet' | 'auto', the same way an unsupported chain throws.
An invalid network option now throws a RangeError instead of reporting NETWORK_MISMATCH (commit 4741a8f). The README and the Unreleased CHANGELOG section are updated.
Confirmed on main with network: 'foo' from JavaScript. A valid mainnet Bitcoin address returns NETWORK_MISMATCH and a valid Ethereum address succeeds with exactly the same option. That can send a caller looking for a problem with the recipient when the configuration is wrong.
I’d prioritize a consistent RangeError for unsupported network values. Please cover direct validators, single-address validation, batches (including an empty batch), and detection (including empty input). A valid network: 'mainnet' paired with a real testnet address should still return NETWORK_MISMATCH with the decoded network.
Activity
fix: throw RangeError for an invalid network option
perf: single-pass Bech32 checksum, leaner SHA-256, Byron precheck
Dhananjay-alt commentedon Nov 21, 2026
Fixed in #10.
An invalid network option now throws a RangeError instead of reporting NETWORK_MISMATCH (commit 4741a8f). The README and the Unreleased CHANGELOG section are updated.
Samarth208P commentedon Nov 21, 2026
Confirmed on
mainwithnetwork: 'foo'from JavaScript. A valid mainnet Bitcoin address returnsNETWORK_MISMATCHand a valid Ethereum address succeeds with exactly the same option. That can send a caller looking for a problem with the recipient when the configuration is wrong.I’d prioritize a consistent
RangeErrorfor unsupported network values. Please cover direct validators, single-address validation, batches (including an empty batch), and detection (including empty input). A validnetwork: 'mainnet'paired with a real testnet address should still returnNETWORK_MISMATCHwith the decoded network.fix: throw RangeError for an unsupported network option (Samarth208P#13)