Expand description
Helper functions for Midnight-specific operations.
This module provides utility functions for working with Midnight-specific data types and formatting, including address normalization, value parsing, and operation processing.
Functions§
- are_
same_ address - Compares two addresses for equality, ignoring case and “0x” prefixes.
- are_
same_ hash - Compares two hashes for equality, ignoring case and “0x” prefixes.
- are_
same_ signature - Compares two function signatures for equality, ignoring case and whitespace. We remove anything between parentheses from the signatures before comparing them because we cannot access the function arguments from the transaction in Midnight.
- map_
chain_ type - Map a chain type to a NetworkId
- normalize_
address - Normalizes an address string by removing “0x” prefix, spaces, and converting to lowercase.
- normalize_
address_ size - Normalize the size of an address
- normalize_
hash - Normalizes a hash by removing “0x” prefix, spaces, and converting to lowercase.
- normalize_
signature - Normalizes a function signature by removing spaces and converting to lowercase.
- parse_
tx_ index_ item - Parse a transaction index item
- process_
transaction_ for_ coins - Process the coins in a transaction
- remove_
parentheses - Removes anything after the first parenthesis from a string
- seed_
to_ secret_ keys - Convert a seed to a viewing key
- try_
decrypt_ coin - Try to decrypt a coin ciphertext using a viewing key