java.lang.Object
com.google.protobuf.AbstractMessageLite<RoyaltyFee,RoyaltyFee.Builder>
com.google.protobuf.GeneratedMessageLite<RoyaltyFee,RoyaltyFee.Builder>
com.hedera.hashgraph.sdk.proto.RoyaltyFee
- All Implemented Interfaces:
com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,RoyaltyFeeOrBuilder
@Generated
public final class RoyaltyFee
extends com.google.protobuf.GeneratedMessageLite<RoyaltyFee,RoyaltyFee.Builder>
implements RoyaltyFeeOrBuilder
* A fee to assess during a CryptoTransfer that changes ownership of a non-fungible/unique (NFT) token.<br/> This message defines the fraction of the fungible value exchanged for an NFT that the ledger should collect as a royalty. "Fungible value" includes both HBAR (ℏ) and units of fungible HTS tokens. When the NFT sender does not receive any fungible value, the ledger will assess the fallback fee, if present, to the new NFT owner. Royalty fees can only be added to non-fungible/unique tokens. #### Important Note > Users should be aware that native royalty fees are _strictly_ a > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT > enforce _inescapable_ royalties on the exchange of a unique NFT.<br/> > For _one_ example, if the counterparties agree to split their value > transfer and NFT exchange into separate transactions, the network cannot > possibly determine the value exchanged. Even trustless transactions, > using a smart contract or other form of escrow, can arrange such split > transactions as a single _logical_ transfer. Counterparties that wish to _respect_ creator royalties MUST follow the pattern the network recognizes. <div style="margin-left: 2em; margin-top: -0.8em"> A single transaction MUST contain all three elements, transfer of the NFT, debit of fungible value from the receiver, and credit of fungible value to the sender, in order for the network to accurately assess royalty fees. </div> <div style="margin-left: 1em; margin-top: -0.8em"> Two examples are presented here. <div style="margin-left: 1em"> The NFT sender and receiver MUST both sign a single `cryptoTransfer` that transfers the NFT from sender to receiver, debits the fungible value from the receiver, and credits the sender with the fungible value the receiver is exchanging for the NFT.<br/> A marketplace using an approved spender account for an escrow transaction MUST credit the account selling the NFT in the same `cryptoTransfer` transaction that transfers the NFT to, and deducts fungible value from, the buying account. </div></div> This type of fee MAY NOT produce accurate results if multiple transfers are executed in a single transaction. It is RECOMMENDED that each NFT subject to royalty fees be transferred separately and without unrelated fungible token transfers. The network SHALL NOT consider third-party transfers, including "approved spender" accounts, in collecting royalty fees. An honest broker MUST ensure that transfer of an NFT and payment delivered to the sender are present in the same transaction. There is an [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) that proposes to broaden the scope of transfers from which the network automatically collects royalties to cover related third parties. If this interests or concerns you, please add your voice to that discussion.Protobuf type
proto.RoyaltyFee-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class* A fee to assess during a CryptoTransfer that changes ownership of a non-fungible/unique (NFT) token.<br/> This message defines the fraction of the fungible value exchanged for an NFT that the ledger should collect as a royalty.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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageLite
unknownFieldsFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionprotected final ObjectdynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) static RoyaltyFee* The fraction of fungible value exchanged for an NFT to collect as royalty.* A fixed fee to assess if no fungible value is known to be traded for the NFT.boolean* The fraction of fungible value exchanged for an NFT to collect as royalty.boolean* A fixed fee to assess if no fungible value is known to be traded for the NFT.static RoyaltyFee.Builderstatic RoyaltyFee.BuildernewBuilder(RoyaltyFee prototype) static RoyaltyFeeparseDelimitedFrom(InputStream input) static RoyaltyFeeparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoyaltyFeeparseFrom(byte[] data) static RoyaltyFeeparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoyaltyFeeparseFrom(com.google.protobuf.ByteString data) static RoyaltyFeeparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoyaltyFeeparseFrom(com.google.protobuf.CodedInputStream input) static RoyaltyFeeparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoyaltyFeeparseFrom(InputStream input) static RoyaltyFeeparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoyaltyFeeparseFrom(ByteBuffer data) static RoyaltyFeeparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<RoyaltyFee> parser()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, writeToMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Field Details
-
EXCHANGE_VALUE_FRACTION_FIELD_NUMBER
public static final int EXCHANGE_VALUE_FRACTION_FIELD_NUMBER- See Also:
-
FALLBACK_FEE_FIELD_NUMBER
public static final int FALLBACK_FEE_FIELD_NUMBER- See Also:
-
-
Method Details
-
hasExchangeValueFraction
public boolean hasExchangeValueFraction()* The fraction of fungible value exchanged for an NFT to collect as royalty. <p> This SHALL be applied once to the total fungible value transferred for the transaction.<br/> There SHALL NOT be any adjustment based on multiple transfers involving the NFT sender as part of a single transaction.
.proto.Fraction exchange_value_fraction = 1;- Specified by:
hasExchangeValueFractionin interfaceRoyaltyFeeOrBuilder- Returns:
- Whether the exchangeValueFraction field is set.
-
getExchangeValueFraction
* The fraction of fungible value exchanged for an NFT to collect as royalty. <p> This SHALL be applied once to the total fungible value transferred for the transaction.<br/> There SHALL NOT be any adjustment based on multiple transfers involving the NFT sender as part of a single transaction.
.proto.Fraction exchange_value_fraction = 1;- Specified by:
getExchangeValueFractionin interfaceRoyaltyFeeOrBuilder- Returns:
- The exchangeValueFraction.
-
hasFallbackFee
public boolean hasFallbackFee()* A fixed fee to assess if no fungible value is known to be traded for the NFT. <p> If an NFT is transferred without a corresponding transfer of _fungible_ value returned in the same transaction, the network SHALL charge this fee as a fallback.<br/> Fallback fees MAY have unexpected effects when interacting with escrow, market transfers, and smart contracts. It is RECOMMENDED that developers carefully consider possible effects from fallback fees when designing systems that facilitate the transfer of NFTs.
.proto.FixedFee fallback_fee = 2;- Specified by:
hasFallbackFeein interfaceRoyaltyFeeOrBuilder- Returns:
- Whether the fallbackFee field is set.
-
getFallbackFee
* A fixed fee to assess if no fungible value is known to be traded for the NFT. <p> If an NFT is transferred without a corresponding transfer of _fungible_ value returned in the same transaction, the network SHALL charge this fee as a fallback.<br/> Fallback fees MAY have unexpected effects when interacting with escrow, market transfers, and smart contracts. It is RECOMMENDED that developers carefully consider possible effects from fallback fees when designing systems that facilitate the transfer of NFTs.
.proto.FixedFee fallback_fee = 2;- Specified by:
getFallbackFeein interfaceRoyaltyFeeOrBuilder- Returns:
- The fallbackFee.
-
parseFrom
public static RoyaltyFee parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoyaltyFee parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoyaltyFee parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoyaltyFee parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoyaltyFee parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoyaltyFee parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static RoyaltyFee parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static RoyaltyFee parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static RoyaltyFee parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilder
-
newBuilder
-
dynamicMethod
protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) - Specified by:
dynamicMethodin classcom.google.protobuf.GeneratedMessageLite<RoyaltyFee,RoyaltyFee.Builder>
-
getDefaultInstance
-
parser
-