Interface AccountSet

All Superinterfaces:
Transaction
All Known Implementing Classes:
ImmutableAccountSet

@Immutable public interface AccountSet extends Transaction
An AccountSet transaction modifies the properties of an account in the XRP Ledger.
  • Method Details

    • builder

      static ImmutableAccountSet.Builder builder()
      Construct a builder for this class.
      Returns:
      An ImmutableAccountSet.Builder.
    • flags

      @Default default AccountSetTransactionFlags flags()
      Returns:
      An AccountSetTransactionFlags.
    • clearFlag

      Unique identifier of a flag to disable for this account.

      If this field is empty, developers should check if clearFlagRawValue() is also empty. If clearFlagRawValue() is present, it means that the ClearFlag field of the transaction was not a valid AccountSet.AccountSetFlag but was still present in a validated transaction on ledger.

      Because the preferred way of setting account flags is with AccountSet.AccountSetFlags, this field should not be set in conjunction with the flags() field.

      Returns:
      An Optional of type AccountSet.AccountSetFlag representing the flag to disable on this account.
    • clearFlagRawValue

      Optional<com.google.common.primitives.UnsignedInteger> clearFlagRawValue()
      A flag to disable for this account, as an UnsignedInteger.

      Developers should prefer setting clearFlag() and leaving this field empty when constructing a new AccountSet. This field is used to serialize and deserialize the "ClearFlag" field in JSON, as some AccountSet transactions on the XRPL set the "ClearFlag" field to a number that is not recognized as an asf flag by rippled. Without this field, xrpl4j would fail to deserialize those transactions, as AccountSet.AccountSetFlag does not support arbitrary integer values.

      Additionally, using this field as the source of truth for JSON serialization/deserialization rather than clearFlag() allows developers to recompute the hash of a transaction that was deserialized from a rippled RPC/WS result accurately. An alternative to this field would be to add an enum variant to AccountSet.AccountSetFlag for unknown values, but binary serializing an AccountSet that was constructed by deserializing JSON would result in a different binary blob than what exists on ledger.

      Returns:
      An Optional UnsignedInteger.
    • normalizeClearFlag

      @Check default AccountSet normalizeClearFlag()
      Normalization method to try to get clearFlag()and clearFlagRawValue() to match.

      If neither field is present, there is nothing to do.

      If both fields are present, there is nothing to do, but we will check that clearFlag()'s underlying value equals clearFlagRawValue().

      If clearFlag() is present but clearFlagRawValue() is empty, we set clearFlagRawValue() to the underlying value of clearFlag().

      If clearFlag() is empty and clearFlagRawValue() is present, we will set clearFlag() to the AccountSet.AccountSetFlag variant associated with clearFlagRawValue(), or leave clearFlag() empty if clearFlagRawValue() does not map to an AccountSet.AccountSetFlag.

      Returns:
      A normalized AccountSet.
    • setFlag

      Unique identifier of a flag to enable for this account.

      If this field is empty, developers should check if setFlagRawValue() is also empty. If setFlagRawValue() is present, it means that the ClearFlag field of the transaction was not a valid AccountSet.AccountSetFlag but was still present in a validated transaction on ledger.

      Because the preferred way of setting account flags is with AccountSet.AccountSetFlags, this field should not be set in conjunction with the flags() field.

      Returns:
      An Optional of type AccountSet.AccountSetFlag representing the flag to enable on this account.
    • setFlagRawValue

      Optional<com.google.common.primitives.UnsignedInteger> setFlagRawValue()
      A flag to disable for this account, as an UnsignedInteger.

      Developers should prefer setting setFlag() and leaving this field empty when constructing a new AccountSet. This field is used to serialize and deserialize the "ClearFlag" field in JSON, as some AccountSet transactions on the XRPL set the "ClearFlag" field to a number that is not recognized as an asf flag by rippled. Without this field, xrpl4j would fail to deserialize those transactions, as AccountSet.AccountSetFlag does not support arbitrary integer values.

      Additionally, using this field as the source of truth for JSON serialization/deserialization rather than setFlag() allows developers to recompute the hash of a transaction that was deserialized from a rippled RPC/WS result accurately. An alternative to this field would be to add an enum variant to AccountSet.AccountSetFlag for unknown values, but binary serializing an AccountSet that was constructed by deserializing JSON would result in a different binary blob than what exists on ledger.

      Returns:
      An Optional UnsignedInteger
    • normalizeSetFlag

      @Check default AccountSet normalizeSetFlag()
      Normalization method to try to get setFlag()and setFlagRawValue() to match.

      If neither field is present, there is nothing to do.

      If both fields are present, there is nothing to do, but we will check that setFlag()'s underlying value equals setFlagRawValue().

      If setFlag() is present but setFlagRawValue() is empty, we set setFlagRawValue() to the underlying value of setFlag().

      If setFlag() is empty and setFlagRawValue() is present, we will set setFlag() to the AccountSet.AccountSetFlag variant associated with setFlagRawValue(), or leave setFlag() empty if setFlagRawValue() does not map to an AccountSet.AccountSetFlag.

      Returns:
      A normalized AccountSet.
    • domain

      Optional<String> domain()
      The hex string of the lowercase ASCII of the domain for the account. For example, the domain example.com would be represented as "6578616D706C652E636F6D".

      To remove the Domain field from an account, send an AccountSet with this domain field set to an empty string.

      Returns:
      An Optional of type String containing the domain.
    • emailHash

      Optional<String> emailHash()
      Hash of an email address to be used for generating an avatar image. Conventionally, clients use Gravatar to display this image.
      Returns:
      An Optional of type String containing the hash of the email.
    • messageKey

      Optional<String> messageKey()
      Hexadecimal encoded public key for sending encrypted messages to this account.
      Returns:
      An Optional of type String containing the messaging public key.
    • transferRate

      Optional<com.google.common.primitives.UnsignedInteger> transferRate()
      The fee to charge when users transfer this account's issued currencies, represented as billionths of a unit. Cannot be more than 2000000000 or less than 1000000000, except for the special case 0 meaning no fee.
      Returns:
      An Optional of type UnsignedInteger representing the transfer rate.
    • tickSize

      Optional<com.google.common.primitives.UnsignedInteger> tickSize()
      Tick size to use for offers involving a currency issued by this address. The exchange rates of those offers is rounded to this many significant digits. Valid values are 3 to 15 inclusive, or 0 to disable.
      Returns:
      An Optional of type UnsignedInteger representing the tick size.
    • mintAccount

      Optional<Address> mintAccount()
      Sets an alternate account that is allowed to mint NFTokens on this account's behalf using NFTokenMint's `Issuer` field.
      Returns:
      An Optional field of type Address.
    • walletLocator

      Optional<String> walletLocator()
      An arbitrary 256-bit value. If specified, the value is stored as part of the account but has no inherent meaning or requirements.
      Returns:
      The 256-bit value as a hex encoded String.
    • walletSize

      Optional<com.google.common.primitives.UnsignedInteger> walletSize()
      Not used. This field is valid in AccountSet transactions but does nothing.
      Returns:
      An optionally present UnsignedInteger.
    • checkEmailHashLength

      @Check default void checkEmailHashLength()
      Check email hash length.
    • checkTransferRate

      @Check default void checkTransferRate()
      Check transfer rate.
    • checkTickSize

      @Check default void checkTickSize()
      Check tick size.