TransactionSign class¶
-
class
TransactionSign
()¶ An object of this class is not created using the
new
operator, 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 string
containing encoded transaction data.Method to get encoded transaction data.
-
hash
()¶ Returns: A string
containing a hash (Blake2B) of the transaction data.Method to get a hash of the transaction data.
-
sign
()¶ Returns: A string
containing a sign of the transaction data hash.Method to get a sign of the transaction data hash.
-
public_key
()¶ Returns: A string
containing 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 string
containing 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 + "'");