public abstract class AbstractTransaction
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
MIN_BASE_FEE
Minimum base fee for transactions.
|
Modifier and Type | Method and Description |
---|---|
void |
addSignature(DecoratedSignature signature)
Adds a signature to the transaction's existing list of signatures.
|
static AbstractTransaction |
fromEnvelopeXdr(java.lang.String envelope,
Network network)
Creates a
Transaction instance from previously build TransactionEnvelope
|
static AbstractTransaction |
fromEnvelopeXdr(TransactionEnvelope envelope,
Network network)
Creates a
AbstractTransaction instance from previously build
TransactionEnvelope |
@NonNull Network |
getNetwork()
The network that the transaction is to be submitted to.
|
java.util.List<DecoratedSignature> |
getSignatures()
Gets read only list(immutable) of the signatures on transaction.
|
static byte[] |
getTransactionSignatureBase(TransactionSignaturePayload.TransactionSignaturePayloadTaggedTransaction taggedTransaction,
Network network)
Get the signature base of this transaction envelope.
|
byte[] |
hash()
Returns transaction hash.
|
java.lang.String |
hashHex()
Returns transaction hash encoded as a hexadecimal string.
|
void |
sign(byte[] preimage)
Adds a new sha256Hash signature to this transaction by revealing preimage.
|
void |
sign(@NonNull KeyPair signer)
Adds a new signature ed25519PublicKey to this transaction.
|
abstract byte[] |
signatureBase()
Returns signature base.
|
abstract TransactionEnvelope |
toEnvelopeXdr() |
java.lang.String |
toEnvelopeXdrBase64()
Returns base64-encoded TransactionEnvelope XDR object.
|
public static final long MIN_BASE_FEE
public void sign(@NonNull @NonNull KeyPair signer)
signer
- KeyPair
object representing a signerpublic void sign(byte[] preimage)
preimage
- the sha256 hash of preimage should be equal to signer hashpublic byte[] hash()
public java.lang.String hashHex()
public abstract byte[] signatureBase()
public java.util.List<DecoratedSignature> getSignatures()
public void addSignature(DecoratedSignature signature)
signature
- the signature to addpublic abstract TransactionEnvelope toEnvelopeXdr()
public java.lang.String toEnvelopeXdrBase64()
public static AbstractTransaction fromEnvelopeXdr(TransactionEnvelope envelope, Network network)
AbstractTransaction
instance from previously build
TransactionEnvelope
envelope
- the transaction envelopenetwork
- the network that the transaction is to be submitted toTransaction
or FeeBumpTransaction
instancepublic static AbstractTransaction fromEnvelopeXdr(java.lang.String envelope, Network network)
Transaction
instance from previously build TransactionEnvelope
envelope
- Base-64 encoded TransactionEnvelope
Transaction
or FeeBumpTransaction
instancejava.lang.IllegalArgumentException
- if the envelope is malformedpublic static byte[] getTransactionSignatureBase(TransactionSignaturePayload.TransactionSignaturePayloadTaggedTransaction taggedTransaction, Network network)
taggedTransaction
- the tagged transaction for signingnetwork
- the network that the transaction is to be submitted to@NonNull public @NonNull Network getNetwork()