Internal Utillities

class ethextended.utils

Local native ethereum utillities, that don’t need internet connection.

utils.clear_0x(text)

Removes 0x prefix from text.

>>> ethextended.utils.clear_0x("0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE")
'3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE'
utils.is_hex(text)

Checks if input text is hexdecimal.

>>> ethextended.utils.is_hex("0x1234567890ABCDEF")
True
>>> ethextended.utils.is_hex("0x1234567890ABCDEFGHIJKLMNOP")
False
utils.is_address(text)

Checks if input text is address.

>>> ethextended.utils.is_address("0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE")
True
>>> ethextended.utils.is_address("0xE9af3971dD833D26bA")
False
utils.to_checksum_address(text)

Converts address to checksum format.

>>> ethextended.utils.to_checksum_address("0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be")
'0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE'