Interface Payment

All Superinterfaces:
Transaction
All Known Implementing Classes:
ImmutablePayment

@Immutable public interface Payment extends Transaction
A Payment transaction represents a transfer of value from one account to another. (Depending on the path taken, this can involve additional exchanges of value, which occur atomically.) This transaction type can be used for several types of payments, including direct XRP-to-XRP payments, creating or redeeming issued currency, cross-currency payments, partial payments, and currency conversions on the XRPL Decentralized Exchange.
  • Method Details

    • builder

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

      @Default default PaymentFlags flags()
      Set of PaymentFlagss for this Payment, which have been properly combined to yield a PaymentFlags object containing the Long representation of the set bits.

      The value of the flags can either be set manually, or constructed using PaymentFlags.Builder.

      Returns:
      The PaymentFlags for this transaction.
    • amount

      CurrencyAmount amount()
      The amount of currency to deliver. If the PaymentFlags.tfPartialPayment() flag is set, deliver up to this amount instead.
      Returns:
      A CurrencyAmount representing the amount of a specified currency to deliver.
    • destination

      Address destination()
      The unique Address of the account receiving the payment. Maybe be empty for an AccountSet or other transaction that is not a payment.
      Returns:
      The Address of the payment destination account.
    • destinationTag

      Optional<com.google.common.primitives.UnsignedInteger> destinationTag()
      Arbitrary UnsignedInteger tag that identifies the reason for the payment to the destination, or a hosted recipient to pay.
      Returns:
      An Optional of type UnsignedInteger representing the tag of the destination account.
    • invoiceId

      Optional<Hash256> invoiceId()
      Arbitrary 256-bit hash representing a specific reason or identifier for this payment.
      Returns:
      An Optional of type Hash256 containing the invoice ID.
    • paths

      List<List<PathStep>> paths()
      A List of Lists of payment paths to be used for this transaction. Must be omitted for XRP-to-XRP transactions.

      This field is auto-fillable

      Returns:
      A List of Lists of PathSteps.
      See Also:
      • "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields"
    • sendMax

      Highest amount of source currency this transaction is allowed to cost, including transfer fees, exchange rates, and slippage. Does not include the XRP destroyed as a cost for submitting the transaction.

      Must be supplied for cross-currency/cross-issue payments. Must be omitted for XRP-to-XRP payments.

      Returns:
      An Optional of type CurrencyAmount.
      See Also:
      • "https://xrpl.org/transfer-fees.html"
      • "https://en.wikipedia.org/wiki/Slippage_%28finance%29"
    • deliverMin

      Optional<CurrencyAmount> deliverMin()
      Minimum amount of destination currency this Payment should deliver. Only valid if this the PaymentFlags.tfPartialPayment()* flag is set.
      Returns:
      An Optional of type CurrencyAmount.
    • credentialIds

      List<Hash256> credentialIds()
      Set of Credentials to authorize a deposit made by this transaction. Each member of the array must be the ledger entry ID of a Credential entry in the ledger.
      Returns:
      A list of type Hash256.
    • domainId

      Optional<Hash256> domainId()
      The permissioned domain the sender intends to use. Both the sender and destination must be part of this domain.
      Returns:
      An optionally-present Hash256 representing DomainID.
    • validateCredentialIdsLength

      @Check default void validateCredentialIdsLength()
      Validate credentialIds() has less than or equal to 8 credentials.
    • validateUniqueCredentialIds

      @Check default void validateUniqueCredentialIds()
      Validate credentialIds() are unique.