Class: Transaction

Transaction(envelope)

A new Transaction object is created from a transaction envelope or via TransactionBuilder. Once a Transaction has been created from an envelope, its attributes and operations should not be changed. You should only add signers (using Transaction#sign) to a Transaction object before submitting to the network or forwarding on to additional signers.

Constructor

new Transaction(envelope)

Parameters:
Name Type Description
envelope string | xdr.TransactionEnvelope The transaction envelope object or base64 encoded string.
Source:

Methods

hash() → {Buffer}

Returns a hash for this transaction, suitable for signing.
Source:
Returns:
Type
Buffer

sign(…keypairs) → {void}

Signs the transaction with the given Keypair.
Parameters:
Name Type Attributes Description
keypairs Keypair <repeatable>
Keypairs of signers
Source:
Returns:
Type
void

signatureBase() → {Buffer}

Returns the "signature base" of this transaction, which is the value that, when hashed, should be signed to create a signature that validators on the Stellar Network will accept. It is composed of a 4 prefix bytes followed by the xdr-encoded form of this transaction.
Source:
Returns:
Type
Buffer

signHashX(preimage) → {void}

Add `hashX` signer preimage as signature.
Parameters:
Name Type Description
preimage Buffer | String Preimage of hash used as signer
Source:
Returns:
Type
void

toEnvelope() → {xdr.TransactionEnvelope}

To envelope returns a xdr.TransactionEnvelope which can be submitted to the network.
Source:
Returns:
Type
xdr.TransactionEnvelope