symbolchain.nem package

Submodules

symbolchain.nem.KeyPair module

class symbolchain.nem.KeyPair.KeyPair(private_key)

Bases: object

Represents an ED25519 private and public key.

property private_key

Gets the private key.

property public_key

Gets the public key.

sign(message)

Signs a message with the private key.

class symbolchain.nem.KeyPair.Verifier(public_key)

Bases: object

Verifies signatures signed by a single key pair.

verify(message, signature)

Verifies a message signature.

symbolchain.nem.MessageEncoder module

class symbolchain.nem.MessageEncoder.MessageEncoder(key_pair: KeyPair)

Bases: object

Encrypts and encodes messages between two parties.

encode(recipient_public_key: PublicKey, message: bytes)

Encodes message to recipient using recommended format.

encode_deprecated(recipient_public_key: PublicKey, message: bytes)

Encodes message to recipient using deprecated encryption and key derivation.

property public_key

Public key used for message encoding.

try_decode(recipient_public_key, encoded_message: Message)

Tries to decode encoded message, returns tuple: * True, message - if message has been decoded and decrypted * False, encoded_message - otherwise

symbolchain.nem.Network module

class symbolchain.nem.Network.Address(address)

Bases: ByteArray

Represents a nem address.

ENCODED_SIZE = 40
SIZE = 25
class symbolchain.nem.Network.Network(name, identifier, epoch_time)

Bases: Network

Represents a nem network.

MAINNET = <symbolchain.nem.Network.Network object>
NETWORKS = [<symbolchain.nem.Network.Network object>, <symbolchain.nem.Network.Network object>]
TESTNET = <symbolchain.nem.Network.Network object>
address_hasher()

Gets the primary hasher to use in the public key to address conversion.

create_address(address_without_checksum, checksum)

Creates an encoded address from an address without checksum and checksum bytes.

class symbolchain.nem.Network.NetworkTimestamp(timestamp)

Bases: NetworkTimestamp

Represents a nem network timestamp with second resolution.

add_seconds(count)

Adds a specified number of seconds to this timestamp.

symbolchain.nem.SharedKey module

class symbolchain.nem.SharedKey.SharedKey

Bases: SharedKey

static derive_shared_key(key_pair, other_public_key)

Derives shared encryption key from private key and public key.

static derive_shared_key_deprecated(key_pair, other_public_key, salt)

Derives shared encryption key from private key, public key and salt.

note: this method uses _old_ method of deriving shared key and has been deprecated.

symbolchain.nem.TransactionFactory module

class symbolchain.nem.TransactionFactory.TransactionFactory(network, type_rule_overrides=None)

Bases: object

Factory for creating NEM transactions.

static attach_signature(transaction, signature)

Attaches a signature to a transaction.

create(transaction_descriptor, autosort=True)

Creates a transaction from a transaction descriptor. When autosort is set (default), descriptor arrays requiring ordering will be automatically sorted. When unset, descriptor arrays will be presumed to be already sorted.

static deserialize(payload)

Deserializes a transaction from a binary payload.

static lookup_transaction_name(transaction_type, transaction_version)

Looks up the friendly name for the specified transaction.

static to_non_verifiable_transaction(transaction)

Converts a transaction to a non-verifiable transaction.

Module contents