TransactionSign class¶
-
class
TransactionSign()¶ An object of this class is not created using the
newoperator, but is returned by thesign_transaction()method ofAddr()object.Actually, the
TransactionSign()objects are storage for the following data:- encoded transaction data;
- a transaction hash (Blake2B);
- a sign of hash;
- the public key (with no prefix) of the key pair with which the signature was made.
Class methods¶
-
data()¶ Returns: A stringcontaining encoded transaction data.Method to get encoded transaction data.
-
hash()¶ Returns: A stringcontaining a hash (Blake2B) of the transaction data.Method to get a hash of the transaction data.
-
sign()¶ Returns: A stringcontaining a sign of the transaction data hash.Method to get a sign of the transaction data hash.
-
public_key()¶ Returns: A stringcontaining the public key.Method to get the public key (with no prefix) of the key pair with which the signature was made.
-
encode()¶ Returns: A stringcontaining encodedTransactionSign()object.Encode all data contained in this object in order to prepare before sending to the Semux network.Example:var transaction_sign = GetRes(hdAddr.sign_transaction(transaction)); var transaction_hash = GetRes(transaction_sign.hash()); console.log("Transaction hash '" + transaction_hash + "'"); var transaction_sign_hex_encoded = GetRes(transaction_sign.encode()); console.log("Transaction sign hex str '" + transaction_sign_hex_encoded + "'");