Class Transaction

java.lang.Object
org.stellar.sdk.xdr.Transaction
All Implemented Interfaces:
XdrElement

public class Transaction extends Object implements XdrElement
Transaction's original definition in the XDR file is:
 struct Transaction
 {
     // account used to run the transaction
     MuxedAccount sourceAccount;

     // the fee the sourceAccount will pay
     uint32 fee;

     // sequence number to consume in the account
     SequenceNumber seqNum;

     // validity conditions
     Preconditions cond;

     Memo memo;

     Operation operations<MAX_OPS_PER_TX>;

     union switch (int v)
     {
     case 0:
         void;
     case 1:
         SorobanTransactionData sorobanData;
     }
     ext;
 };
 
  • Constructor Details

    • Transaction

      public Transaction()
    • Transaction

      public Transaction(MuxedAccount sourceAccount, Uint32 fee, SequenceNumber seqNum, Preconditions cond, Memo memo, Operation[] operations, Transaction.TransactionExt ext)
      Creates a new Transaction instance.
      Parameters:
      sourceAccount - the sourceAccount field value
      fee - the fee field value
      seqNum - the seqNum field value
      cond - the cond field value
      memo - the memo field value
      operations - the operations field value
      ext - the ext field value
  • Method Details

    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Description copied from interface: XdrElement
      Encodes this value to XDR and writes it to the provided stream.
      Specified by:
      encode in interface XdrElement
      Parameters:
      stream - the destination XDR output stream
      Throws:
      IOException - if an I/O error occurs while writing the value
    • decode

      public static Transaction decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static Transaction decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static Transaction fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static Transaction fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toJson

      public String toJson()
      Description copied from interface: XdrElement
      Serializes this value to JSON.
      Specified by:
      toJson in interface XdrElement
      Returns:
      the JSON representation of this value
    • fromJson

      public static Transaction fromJson(String json)
    • builder

      public static Transaction.TransactionBuilder builder()
    • toBuilder

      public Transaction.TransactionBuilder toBuilder()
    • getSourceAccount

      public MuxedAccount getSourceAccount()
      Value of the sourceAccount field.
      Returns:
      the sourceAccount field value
    • getFee

      public Uint32 getFee()
      Value of the fee field.
      Returns:
      the fee field value
    • getSeqNum

      public SequenceNumber getSeqNum()
      Value of the seqNum field.
      Returns:
      the seqNum field value
    • getCond

      public Preconditions getCond()
      Value of the cond field.
      Returns:
      the cond field value
    • getMemo

      public Memo getMemo()
      Value of the memo field.
      Returns:
      the memo field value
    • getOperations

      public Operation[] getOperations()
      Value of the operations field.
      Returns:
      the operations field value
    • getExt

      public Transaction.TransactionExt getExt()
      Value of the ext field.
      Returns:
      the ext field value
    • setSourceAccount

      public void setSourceAccount(MuxedAccount sourceAccount)
      Value of the sourceAccount field.
      Parameters:
      sourceAccount - the sourceAccount field value
    • setFee

      public void setFee(Uint32 fee)
      Value of the fee field.
      Parameters:
      fee - the fee field value
    • setSeqNum

      public void setSeqNum(SequenceNumber seqNum)
      Value of the seqNum field.
      Parameters:
      seqNum - the seqNum field value
    • setCond

      public void setCond(Preconditions cond)
      Value of the cond field.
      Parameters:
      cond - the cond field value
    • setMemo

      public void setMemo(Memo memo)
      Value of the memo field.
      Parameters:
      memo - the memo field value
    • setOperations

      public void setOperations(Operation[] operations)
      Value of the operations field.
      Parameters:
      operations - the operations field value
    • setExt

      public void setExt(Transaction.TransactionExt ext)
      Value of the ext field.
      Parameters:
      ext - the ext field value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object