Transaction

Transaction

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)

Source:
Parameters:
Name Type Description
envelope string | xdr.TransactionEnvelope

The transaction envelope object or base64 encoded string.

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.

Source:
Parameters:
Name Type Attributes Description
keypairs Keypair <repeatable>

Keypairs of signers

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 DigitalBits 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.

Source:
Parameters:
Name Type Description
preimage Buffer | String

Preimage of hash used as signer

Returns:
Type:
void

toEnvelope() → {xdr.TransactionEnvelope}

To envelope returns a xdr.TransactionEnvelope which can be submitted to the network.

Source:
Returns:
Type:
xdr.TransactionEnvelope