Class FractionalFee

java.lang.Object
com.google.protobuf.AbstractMessageLite<FractionalFee,FractionalFee.Builder>
com.google.protobuf.GeneratedMessageLite<FractionalFee,FractionalFee.Builder>
com.hedera.hashgraph.sdk.proto.FractionalFee
All Implemented Interfaces:
com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, FractionalFeeOrBuilder

@Generated public final class FractionalFee extends com.google.protobuf.GeneratedMessageLite<FractionalFee,FractionalFee.Builder> implements FractionalFeeOrBuilder
 *
 A descriptor for a fee based on a portion of the tokens transferred.

 This fee option describes fees as a fraction of the amount of
 fungible/common token(s) transferred.  The fee also describes a minimum
 and maximum amount, both of which are OPTIONAL.

 This type of fee SHALL be assessed only for fungible/common tokens.<br/>
 This type of fee MUST NOT be defined for a non-fungible/unique
 token type.<br/>
 This fee SHALL be paid with the same type of tokens as those
 transferred.<br/>
 The fee MAY be subtracted from the transferred tokens, or MAY be assessed
 to the sender in addition to the tokens actually transferred, based on
 the `net_of_transfers` field.

 When a single transaction sends tokens from one sender to multiple
 recipients, and the `net_of_transfers` flag is false, the network
 SHALL attempt to evenly assess the total fee across all recipients
 proportionally. This may be inexact and, particularly when there are
 large differences between recipients, MAY result in small deviations
 from an ideal "fair" distribution.<br/>
 If the sender lacks sufficient tokens to pay fees, or the assessment
 of custom fees reduces the net amount transferred to or below zero,
 the transaction MAY fail due to insufficient funds to pay all fees.
 
Protobuf type proto.FractionalFee
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    * A descriptor for a fee based on a portion of the tokens transferred.

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite

    com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite,Type>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageLite

    unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
     
     
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
    long
    * A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    long
    * A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
    boolean
    * Flag requesting to assess the calculated fee against the sender, without reducing the amount transferred.<br/> #### Effects of this flag <ol> <li>If this value is true <ul> <li>The receiver of a transfer SHALL receive the entire amount sent.</li> <li>The fee SHALL be charged to the sender as an additional amount, increasing the token transfer debit.</li> </ul> </li> <li>If this value is false <ul> <li>The receiver of a transfer SHALL receive the amount sent _after_ deduction of the calculated fee.</li> </ul> </li> </ol>
    boolean
    * A Fraction of the transferred tokens to assess as a fee.<br/> This value MUST be less than or equal to one.<br/> This value MUST be greater than zero.
     
     
     
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(byte[] data)
     
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.ByteString data)
     
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<FractionalFee>
     

    Methods inherited from class com.google.protobuf.GeneratedMessageLite

    createBuilder, createBuilder, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeTo

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Field Details

    • FRACTIONAL_AMOUNT_FIELD_NUMBER

      public static final int FRACTIONAL_AMOUNT_FIELD_NUMBER
      See Also:
    • MINIMUM_AMOUNT_FIELD_NUMBER

      public static final int MINIMUM_AMOUNT_FIELD_NUMBER
      See Also:
    • MAXIMUM_AMOUNT_FIELD_NUMBER

      public static final int MAXIMUM_AMOUNT_FIELD_NUMBER
      See Also:
    • NET_OF_TRANSFERS_FIELD_NUMBER

      public static final int NET_OF_TRANSFERS_FIELD_NUMBER
      See Also:
  • Method Details

    • hasFractionalAmount

      public boolean hasFractionalAmount()
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
      Specified by:
      hasFractionalAmount in interface FractionalFeeOrBuilder
      Returns:
      Whether the fractionalAmount field is set.
    • getFractionalAmount

      public Fraction getFractionalAmount()
       *
       A Fraction of the transferred tokens to assess as a fee.<br/>
       This value MUST be less than or equal to one.<br/>
       This value MUST be greater than zero.
       
      .proto.Fraction fractional_amount = 1;
      Specified by:
      getFractionalAmount in interface FractionalFeeOrBuilder
      Returns:
      The fractionalAmount.
    • getMinimumAmount

      public long getMinimumAmount()
       *
       A minimum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no minimum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, all transfers SHALL pay at least this amount.
       
      int64 minimum_amount = 2;
      Specified by:
      getMinimumAmount in interface FractionalFeeOrBuilder
      Returns:
      The minimumAmount.
    • getMaximumAmount

      public long getMaximumAmount()
       *
       A maximum fee to charge, in units of 10<sup>-decimals</sup> tokens.
       <p>
       This value is OPTIONAL, with a default of `0` indicating no maximum.<br/>
       If set, this value MUST be greater than zero.<br/>
       If set, any fee charged SHALL NOT exceed this value.<br/>
       This value SHOULD be strictly greater than `minimum_amount`.
       If this amount is less than or equal to `minimum_amount`, then
       the fee charged SHALL always be equal to this value and
       `fractional_amount` SHALL NOT have any effect.
       
      int64 maximum_amount = 3;
      Specified by:
      getMaximumAmount in interface FractionalFeeOrBuilder
      Returns:
      The maximumAmount.
    • getNetOfTransfers

      public boolean getNetOfTransfers()
       *
       Flag requesting to assess the calculated fee against the sender,
       without reducing the amount transferred.<br/>
       #### Effects of this flag
       <ol>
       <li>If this value is true
       <ul>
       <li>The receiver of a transfer SHALL receive the entire
       amount sent.</li>
       <li>The fee SHALL be charged to the sender as an additional
       amount, increasing the token transfer debit.</li>
       </ul>
       </li>
       <li>If this value is false
       <ul>
       <li>The receiver of a transfer SHALL receive the amount sent
       _after_ deduction of the calculated fee.</li>
       </ul>
       </li>
       </ol>
       
      bool net_of_transfers = 4;
      Specified by:
      getNetOfTransfers in interface FractionalFeeOrBuilder
      Returns:
      The netOfTransfers.
    • parseFrom

      public static FractionalFee parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FractionalFee parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FractionalFee parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FractionalFee parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FractionalFee parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FractionalFee parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FractionalFee parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static FractionalFee parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static FractionalFee parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static FractionalFee parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static FractionalFee parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static FractionalFee parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilder

      public static FractionalFee.Builder newBuilder()
    • newBuilder

      public static FractionalFee.Builder newBuilder(FractionalFee prototype)
    • dynamicMethod

      protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
      Specified by:
      dynamicMethod in class com.google.protobuf.GeneratedMessageLite<FractionalFee,FractionalFee.Builder>
    • getDefaultInstance

      public static FractionalFee getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<FractionalFee> parser()