crypto_addresses¶
validators.crypto_addresses.bsc_address
¶
BSC Address.
bsc_address(value)
¶
Return whether or not given value is a valid binance smart chain address.
Full validation is implemented for BSC addresses.
Examples:
>>> bsc_address('0x4e5acf9684652BEa56F2f01b7101a225Ee33d23f')
# Output: True
>>> bsc_address('0x4g5acf9684652BEa56F2f01b7101a225Eh33d23z')
# Output: ValidationError(func=bsc_address, args=...)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
str
|
BSC address string to validate. |
required |
Returns:
Type | Description |
---|---|
Literal[True]
|
If |
ValidationError
|
If |
Source code in src/validators/crypto_addresses/bsc_address.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
validators.crypto_addresses.btc_address
¶
BTC Address.
btc_address(value)
¶
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')
# Output: True
>>> btc_address('1BvBMsEYstWetqTFn5Au4m4GFg7xJaNVN2')
# Output: ValidationError(func=btc_address, args=...)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
str
|
Bitcoin address string to validate. |
required |
Returns:
Type | Description |
---|---|
Literal[True]
|
If |
ValidationError
|
If |
Source code in src/validators/crypto_addresses/btc_address.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
validators.crypto_addresses.eth_address
¶
ETH Address.
eth_address(value)
¶
Return whether or not given value is a valid ethereum address.
Full validation is implemented for ERC20 addresses.
Examples:
>>> eth_address('0x9cc14ba4f9f68ca159ea4ebf2c292a808aaeb598')
# Output: True
>>> eth_address('0x8Ba1f109551bD432803012645Ac136ddd64DBa72')
# Output: ValidationError(func=eth_address, args=...)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
str
|
Ethereum address string to validate. |
required |
Returns:
Type | Description |
---|---|
Literal[True]
|
If |
ValidationError
|
If |
Source code in src/validators/crypto_addresses/eth_address.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
validators.crypto_addresses.trx_address
¶
TRX Address.
trx_address(value)
¶
Return whether or not given value is a valid tron address.
Full validation is implemented for TRC20 tron addresses.
Examples:
>>> trx_address('TLjfbTbpZYDQ4EoA4N5CLNgGjfbF8ZWz38')
# Output: True
>>> trx_address('TR2G7Rm4vFqF8EpY4U5xdLdQ7XgJ2U8Vd')
# Output: ValidationError(func=trx_address, args=...)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
str
|
Tron address string to validate. |
required |
Returns:
Type | Description |
---|---|
Literal[True]
|
If |
ValidationError
|
If |
Source code in src/validators/crypto_addresses/trx_address.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|