Class SorobanTransactionMetaExtV1

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

public class SorobanTransactionMetaExtV1 extends Object implements XdrElement
SorobanTransactionMetaExtV1's original definition in the XDR file is:
 struct SorobanTransactionMetaExtV1
 {
     ExtensionPoint ext;

     // The following are the components of the overall Soroban resource fee
     // charged for the transaction.
     // The following relation holds:
     // `resourceFeeCharged = totalNonRefundableResourceFeeCharged + totalRefundableResourceFeeCharged`
     // where `resourceFeeCharged` is the overall fee charged for the
     // transaction. Also, `resourceFeeCharged` <= `sorobanData.resourceFee`
     // i.e.we never charge more than the declared resource fee.
     // The inclusion fee for charged the Soroban transaction can be found using
     // the following equation:
     // `result.feeCharged = resourceFeeCharged + inclusionFeeCharged`.

     // Total amount (in stroops) that has been charged for non-refundable
     // Soroban resources.
     // Non-refundable resources are charged based on the usage declared in
     // the transaction envelope (such as `instructions`, `readBytes` etc.) and
     // is charged regardless of the success of the transaction.
     int64 totalNonRefundableResourceFeeCharged;
     // Total amount (in stroops) that has been charged for refundable
     // Soroban resource fees.
     // Currently this comprises the rent fee (`rentFeeCharged`) and the
     // fee for the events and return value.
     // Refundable resources are charged based on the actual resources usage.
     // Since currently refundable resources are only used for the successful
     // transactions, this will be `0` for failed transactions.
     int64 totalRefundableResourceFeeCharged;
     // Amount (in stroops) that has been charged for rent.
     // This is a part of `totalNonRefundableResourceFeeCharged`.
     int64 rentFeeCharged;
 };
 
  • Constructor Details

    • SorobanTransactionMetaExtV1

      public SorobanTransactionMetaExtV1()
    • SorobanTransactionMetaExtV1

      public SorobanTransactionMetaExtV1(ExtensionPoint ext, Int64 totalNonRefundableResourceFeeCharged, Int64 totalRefundableResourceFeeCharged, Int64 rentFeeCharged)
      Creates a new SorobanTransactionMetaExtV1 instance.
      Parameters:
      ext - the ext field value
      totalNonRefundableResourceFeeCharged - the totalNonRefundableResourceFeeCharged field value
      totalRefundableResourceFeeCharged - the totalRefundableResourceFeeCharged field value
      rentFeeCharged - the rentFeeCharged 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 SorobanTransactionMetaExtV1 decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

      public static SorobanTransactionMetaExtV1 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 SorobanTransactionMetaExtV1 fromJson(String json)
    • builder

    • toBuilder

    • getExt

      public ExtensionPoint getExt()
      Value of the ext field.
      Returns:
      the ext field value
    • getTotalNonRefundableResourceFeeCharged

      public Int64 getTotalNonRefundableResourceFeeCharged()
      Value of the totalNonRefundableResourceFeeCharged field.
      Returns:
      the totalNonRefundableResourceFeeCharged field value
    • getTotalRefundableResourceFeeCharged

      public Int64 getTotalRefundableResourceFeeCharged()
      Value of the totalRefundableResourceFeeCharged field.
      Returns:
      the totalRefundableResourceFeeCharged field value
    • getRentFeeCharged

      public Int64 getRentFeeCharged()
      Value of the rentFeeCharged field.
      Returns:
      the rentFeeCharged field value
    • setExt

      public void setExt(ExtensionPoint ext)
      Value of the ext field.
      Parameters:
      ext - the ext field value
    • setTotalNonRefundableResourceFeeCharged

      public void setTotalNonRefundableResourceFeeCharged(Int64 totalNonRefundableResourceFeeCharged)
      Value of the totalNonRefundableResourceFeeCharged field.
      Parameters:
      totalNonRefundableResourceFeeCharged - the totalNonRefundableResourceFeeCharged field value
    • setTotalRefundableResourceFeeCharged

      public void setTotalRefundableResourceFeeCharged(Int64 totalRefundableResourceFeeCharged)
      Value of the totalRefundableResourceFeeCharged field.
      Parameters:
      totalRefundableResourceFeeCharged - the totalRefundableResourceFeeCharged field value
    • setRentFeeCharged

      public void setRentFeeCharged(Int64 rentFeeCharged)
      Value of the rentFeeCharged field.
      Parameters:
      rentFeeCharged - the rentFeeCharged 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