btwallet.utils#

Attributes#

Functions#

get_ss58_format(ss58_address)

Returns the ss58 format of the given ss58 address.

is_valid_ss58_address(address)

Checks if the given address is a valid ss58 address.

is_valid_ed25519_pubkey(public_key)

Checks if the given public_key is a valid ed25519 key.

is_valid_bittensor_address_or_public_key(address)

Checks if the given address is a valid destination address.

Module Contents#

btwallet.utils.SS58_FORMAT = 42#
btwallet.utils.get_ss58_format(ss58_address)#

Returns the ss58 format of the given ss58 address.

Parameters:

ss58_address (str)

Return type:

int

btwallet.utils.is_valid_ss58_address(address)#

Checks if the given address is a valid ss58 address.

Parameters:

address (str) – The address to check.

Returns:

True if the address is a valid ss58 address for Bittensor, False otherwise.

Return type:

bool

btwallet.utils.is_valid_ed25519_pubkey(public_key)#

Checks if the given public_key is a valid ed25519 key.

Parameters:

public_key (Union[str, bytes]) – The public_key to check.

Returns:

True if the public_key is a valid ed25519 key, False otherwise.

Return type:

bool

btwallet.utils.is_valid_bittensor_address_or_public_key(address)#

Checks if the given address is a valid destination address.

Parameters:

address (Union[str, bytes]) – The address to check.

Returns:

True if the address is a valid destination address, False otherwise.

Return type:

bool