crypto_addresses

validators.crypto_addresses.bsc_address(value: str, /)

Return whether or not given value is a valid binance smart chain address.

Full validation is implemented for BSC addresses.

Examples

>>> bsc_address('0x4e5acf9684652BEa56F2f01b7101a225Ee33d23f')
True
>>> bsc_address('0x4g5acf9684652BEa56F2f01b7101a225Eh33d23z')
ValidationError(func=bsc_address, args={'value': '0x4g5acf9684652BEa56F2f01b7101a225Eh33d23z'})
Parameters:

value – BSC address string to validate.

Returns:

If value is a valid bsc address. (ValidationError): If value is an invalid bsc address.

Return type:

(Literal[True])

validators.crypto_addresses.btc_address(value: str, /)

Return whether or not given value is a valid bitcoin address.

Full validation is implemented for P2PKH and P2SH addresses. For segwit addresses a regexp is used to provide a reasonable estimate on whether the address is valid.

Examples

>>> btc_address('3Cwgr2g7vsi1bXDUkpEnVoRLA9w4FZfC69')
True
>>> btc_address('1BvBMsEYstWetqTFn5Au4m4GFg7xJaNVN2')
ValidationError(func=btc_address, args={'value': '1BvBMsEYstWetqTFn5Au4m4GFg7xJaNVN2'})
Parameters:

value – Bitcoin address string to validate.

Returns:

If value is a valid bitcoin address. (ValidationError): If value is an invalid bitcoin address.

Return type:

(Literal[True])

validators.crypto_addresses.eth_address(value: str, /)

Return whether or not given value is a valid ethereum address.

Full validation is implemented for ERC20 addresses.

Examples

>>> eth_address('0x9cc14ba4f9f68ca159ea4ebf2c292a808aaeb598')
True
>>> eth_address('0x8Ba1f109551bD432803012645Ac136ddd64DBa72')
ValidationError(func=eth_address, args={'value': '0x8Ba1f109551bD432803012645Ac136ddd64DBa72'})
Parameters:

value – Ethereum address string to validate.

Returns:

If value is a valid ethereum address. (ValidationError): If value is an invalid ethereum address.

Return type:

(Literal[True])

validators.crypto_addresses.trx_address(value: str, /)

Return whether or not given value is a valid tron address.

Full validation is implemented for TRC20 tron addresses.

Examples

>>> trx_address('TLjfbTbpZYDQ4EoA4N5CLNgGjfbF8ZWz38')
True
>>> trx_address('TR2G7Rm4vFqF8EpY4U5xdLdQ7XgJ2U8Vd')
ValidationError(func=trx_address, args={'value': 'TR2G7Rm4vFqF8EpY4U5xdLdQ7XgJ2U8Vd'})
Parameters:

value – Tron address string to validate.

Returns:

If value is a valid tron address. (ValidationError): If value is an invalid tron address.

Return type:

(Literal[True])