util

microalgos_to_algos(microalgos)

Convert microalgos to algos.

Parameters:microalgos (int) – how many microalgos
Returns:how many algos
Return type:int or decimal
algos_to_microalgos(algos)

Convert algos to microalgos.

Parameters:algos (int or decimal) – how many algos
Returns:how many microalgos
Return type:int
sign_bytes(to_sign, private_key)

Sign arbitrary bytes after prepending with “MX” for domain separation.

Parameters:to_sign (bytes) – bytes to sign
Returns:base64 signature
Return type:str
verify_bytes(message, signature, public_key)

Verify the signature of a message that was prepended with “MX” for domain separation.

Parameters:
  • message (bytes) – message that was signed, without prefix
  • signature (str) – base64 signature
  • public_key (str) – base32 address
Returns:

whether or not the signature is valid

Return type:

bool