Addresses and Keys¶
The checks of an address, of the keys, of a seed and of a payment ID, for a network, with no wallet. is_valid_* returns whether it is valid, validate_* raises a MoneroError that says why it is not.
is_valid_address(address, network_type) staticmethod ¶
Determine if the given address is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address | str | is the address to validate. | required |
network_type | MoneroNetworkType | is the address's network type. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_address(address, network_type) staticmethod ¶
Validates the given address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address | str | is the address to validate. | required |
network_type | MoneroNetworkType | is the address's network type. | required |
get_integrated_address(network_type, standard_address, payment_id='') staticmethod ¶
Get an integrated address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network_type | MoneroNetworkType | is the network type of the integrated address. | required |
standard_address | str | is the address to derive the integrated address from. | required |
payment_id | str | optionally specifies the integrated address's payment id (defaults to random payment id). | '' |
Returns:
| Type | Description |
|---|---|
MoneroIntegratedAddress | the integrated address. |
is_valid_private_view_key(private_view_key) staticmethod ¶
Indicates if a private view key is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
private_view_key | str | is the private view key to validate. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_private_view_key(private_view_key) staticmethod ¶
Validate a private view key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
private_view_key | str | is the private view key to validate. | required |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given private view key is invalid. |
is_valid_private_spend_key(private_spend_key) staticmethod ¶
Indicates if a private spend key is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
private_spend_key | str | is the private spend key to validate. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_private_spend_key(private_spend_key) staticmethod ¶
Validate a private spend key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
private_spend_key | str | is the private spend key to validate. | required |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given private spend key is invalid. |
is_valid_public_view_key(public_view_key) staticmethod ¶
Indicates if a public view key is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
public_view_key | str | is the public view key to validate. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_public_view_key(public_view_key) staticmethod ¶
Validate a public view key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
public_view_key | str | is the public view key to validate. | required |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given public view key is invalid. |
is_valid_public_spend_key(public_spend_key) staticmethod ¶
Indicates if a public spend key is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
public_spend_key | str | is the public spend key to validate. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_public_spend_key(public_spend_key) staticmethod ¶
Validate a public spend key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
public_spend_key | str | is the public spend key to validate. | required |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given public spend key is invalid. |
is_valid_mnemonic(mnemonic, language='') staticmethod ¶
Indicates if a mnemonic is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mnemonic | str | is the mnemonic to validate. | required |
language | str | is the mnemonic expected language. | '' |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_mnemonic(mnemonic, language='') staticmethod ¶
Validates the given mnemonic phrase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mnemonic | str | is the mnemonic to validate. | required |
language | str | is the mnemonic expected language. | '' |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given mnemonic is invalid. |
is_valid_language(language) staticmethod ¶
Indicates if the given language is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language | str | is the language to validate | required |
Returns:
| Type | Description |
|---|---|
bool |
|
is_valid_payment_id(payment_id) staticmethod ¶
Indicates if a payment id is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payment_id | str | is the payment id to validate. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_payment_id(payment_id) staticmethod ¶
Validate a payment id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payment_id | str | is the payment id to validate. | required |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given payment id is invalid. |
is_valid_payment_id_short(payment_id) staticmethod ¶
Indicates if a short (16 hex character) payment id is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payment_id | str | is the payment id to validate. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_payment_id_short(payment_id) staticmethod ¶
Validate a short (16 hex character) payment id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payment_id | str | is the payment id to validate. | required |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given payment id is not a valid short payment id. |
is_valid_payment_id_long(payment_id) staticmethod ¶
Indicates if a long (64 hex character) payment id is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payment_id | str | is the payment id to validate. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
validate_payment_id_long(payment_id) staticmethod ¶
Validate a long (64 hex character) payment id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payment_id | str | is the payment id to validate. | required |
Raises:
| Type | Description |
|---|---|
MoneroError | if the given payment id is not a valid long payment id. |