TransactionSign class¶
-
class
TransactionSign()¶ An object of this class is not created using the
newoperator, but is returned by thesign1()orsign2()methods 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¶
-
txData()¶ Returns: A stringcontaining encoded transaction data.Method to get encoded transaction data.
-
txHash()¶ Returns: A stringcontaining a hash (Blake2B) of the transaction data.Method to get a hash of the transaction data.Example:var sign_tx_hash_rs = sign.txHash(); if (typeof sign_tx_hash_rs.error != "undefined") { console.log(sign_tx_hash_rs.error); } else { console.log("Transaction hash '" + sign_tx_hash_rs.res + "'"); }
-
sign()¶ Returns: A stringcontaining a sign of the transaction data hash.Method to get a sign of the transaction data hash.
-
pubKeyNoPrefix()¶ 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 sign_encode_rs = sign.encode() if (typeof sign_encode_rs.error != "undefined") { console.log(sign_encode_rs.error); } else { console.log("Transaction sign hex str '" + sign_encode_rs.res + "'"); }