sdk_interface.utils package
Submodules
sdk_interface.utils.caching module
sdk_interface.utils.ecdsa_helpers module
- sdk_interface.utils.ecdsa_helpers.ecdsa_verify(signature: bytes, data: bytes, address: bytes) bool[source]
sdk_interface.utils.encrypted_json module
- sdk_interface.utils.encrypted_json.decode_pair_from_encrypted_json(json_data: str | dict, passphrase: str) tuple[source]
Decodes encrypted PKCS#8 message from PolkadotJS JSON format
Parameters
json_data passphrase
Returns
tuple containing private and public key
- sdk_interface.utils.encrypted_json.encode_pair(public_key: bytes, private_key: bytes, passphrase: str) bytes[source]
Encode a public/private pair to PKCS#8 format, encrypted with provided passphrase
Parameters
public_key: 32 bytes public key private_key: 64 bytes private key passphrase: passphrase to encrypt the PKCS#8 message
Returns
(Encrypted) PKCS#8 message bytes
sdk_interface.utils.hasher module
Helper functions used to calculate keys for Substrate storage items
- sdk_interface.utils.hasher.blake2_128(data)[source]
Helper function to calculate a 16 bytes Blake2b hash for provided data, used as key for Substrate storage items
Parameters
data
Returns
- sdk_interface.utils.hasher.blake2_128_concat(data)[source]
Helper function to calculate a 16 bytes Blake2b hash for provided data, concatenated with data, used as key for Substrate storage items
Parameters
data
Returns
- sdk_interface.utils.hasher.blake2_256(data)[source]
Helper function to calculate a 32 bytes Blake2b hash for provided data, used as key for Substrate storage items
Parameters
data
Returns
- sdk_interface.utils.hasher.two_x64_concat(data)[source]
Helper function to calculate a xxh64 hash with concatenated data for provided data, used as key for several Substrate
Parameters
data
Returns
sdk_interface.utils.ss58 module
SS58 is a simple address format designed for Substrate based chains. Encoding/decoding according to specification on https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)