bittensor_wallet.utils

Contents

bittensor_wallet.utils#

get_ss58_format(ss58_address)

Returns the SS58 format of the given address string.

is_valid_bittensor_address_or_public_key(address)

Checks if the given address is a valid destination address.

is_valid_ed25519_pubkey(public_key)

Checks if the given public_key is a valid ed25519 key.

is_valid_ss58_address(address)

Checks if the given address is a valid ss58 address.

Module Contents#

Functions Details

bittensor_wallet.utils.get_ss58_format(ss58_address)

Returns the SS58 format of the given address string.

Parameters:

ss58_address (str) – The SS58 address to extract the format from.

Returns:

The SS58 format number.

bittensor_wallet.utils.is_valid_bittensor_address_or_public_key(address)

Checks if the given address is a valid destination address.

Parameters:

address (str) – The address to check.

Returns:

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

bittensor_wallet.utils.is_valid_ed25519_pubkey(public_key)

Checks if the given public_key is a valid ed25519 key.

Parameters:

public_key (bytes) – The public_key to check as bytes.

Returns:

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

Return type:

valid (bool)

bittensor_wallet.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.