Interface EscrowFinish

All Superinterfaces:
Transaction
All Known Implementing Classes:
ImmutableEscrowFinish

@Immutable public interface EscrowFinish extends Transaction
Deliver XRP, IOU tokens, or MPT tokens from a held payment to the recipient.

With the TokenEscrow amendment enabled, this transaction can finish escrows containing:

  • XRP (as before)
  • IOU tokens (trustline-based tokens)
  • MPT tokens (Multi-Purpose Tokens)

Note: The transfer rate or transfer fee is locked at escrow creation time and applied during settlement, even if the issuer changes the rate after the escrow was created.

  • Field Details

    • logger

      static final org.slf4j.Logger logger
  • Method Details

    • builder

      Construct a builder for this class.
      Returns:
      An ImmutableEscrowFinish.Builder.
    • computeFee

      static XrpCurrencyAmount computeFee(XrpCurrencyAmount currentLedgerBaseFeeDrops, com.ripple.cryptoconditions.Fulfillment<?> fulfillment)
      Compute the fee for the supplied fulfillment. The minimum transaction cost to submit an EscrowFinish transaction increases if it contains a fulfillment. If the transaction contains a fulfillment, the transaction cost is 330 drops of XRP plus another 10 drops for every 16 bytes in size of the preimage.
      Parameters:
      currentLedgerBaseFeeDrops - The number of drops that the ledger demands at present.
      fulfillment - The Fulfillment that is being presented to the ledger for computation purposes.
      Returns:
      An XrpCurrencyAmount representing the computed fee.
      See Also:
      • "https://xrpl.org/escrowfinish.html"
    • flags

      @Default default TransactionFlags flags()
      Set of TransactionFlagss for this EscrowFinish, which only allows the tfFullyCanonicalSig flag, which is deprecated.

      The value of the flags cannot be set manually, but exists for JSON serialization/deserialization only and for proper signature computation in rippled.

      Returns:
      Always TransactionFlags.EMPTY.
    • owner

      Address owner()
      Address of the source account that funded the escrow payment.
      Returns:
      The Address of the source account.
    • offerSequence

      com.google.common.primitives.UnsignedInteger offerSequence()
      The Transaction.sequence() of the transaction that created the escrow to cancel.
      Returns:
      An UnsignedInteger representing the sequence number.
    • condition

      Optional<com.ripple.cryptoconditions.Condition> condition()
      Hex value matching the previously-supplied PREIMAGE-SHA-256 crypto-condition of the held payment.

      If this field is empty, developers should check if conditionRawValue() is also empty. If conditionRawValue() is present, it means that the "Condition" field of the transaction was not a well-formed crypto-condition but was still present in a transaction on ledger.

      Returns:
      An Optional of type Condition containing the escrow condition.
    • conditionRawValue

      Optional<String> conditionRawValue()
      The raw, hex-encoded PREIMAGE-SHA-256 crypto-condition of the escrow.

      Developers should prefer setting condition() and leaving this field empty when constructing a new EscrowFinish. This field is used to serialize and deserialize the "Condition" field in JSON, the XRPL will sometimes include an EscrowFinish in its ledger even if the crypto condition is malformed. Without this field, xrpl4j would fail to deserialize those transactions, as condition() is typed as a Condition, which tries to decode the condition from DER.

      Note that a similar field does not exist on EscrowCreate, EscrowObject, or MetaEscrowObject because EscrowCreates with malformed conditions will never be included in a ledger by the XRPL. Because of this fact, an EscrowObject and MetaEscrowObject will also never contain a malformed crypto condition.

      Returns:
      An Optional String containing the hex-encoded PREIMAGE-SHA-256 condition.
    • fulfillment

      Optional<com.ripple.cryptoconditions.Fulfillment<?>> fulfillment()
      Hex value of the PREIMAGE-SHA-256 crypto-condition fulfillment matching the held payment's condition().

      If this field is empty, developers should check if fulfillmentRawValue() is also empty. If fulfillmentRawValue() is present, it means that the "Fulfillment" field of the transaction was not a well-formed crypto-condition fulfillment but was still present in a transaction on ledger.

      Returns:
      An Optional of type Fulfillment containing the fulfillment for the escrow's condition.
    • fulfillmentRawValue

      Optional<String> fulfillmentRawValue()
      The raw, hex-encoded value of the PREIMAGE-SHA-256 crypto-condition fulfillment matching the held payment's condition().

      Developers should prefer setting fulfillment() and leaving this field empty when constructing a new EscrowFinish. This field is used to serialize and deserialize the "Fulfillment" field in JSON, the XRPL will sometimes include an EscrowFinish in its ledger even if the crypto fulfillment is malformed. Without this field, xrpl4j would fail to deserialize those transactions, as fulfillment() is typed as a Fulfillment, which tries to decode the fulfillment from DER.

      Returns:
      An Optional String containing the hex-encoded PREIMAGE-SHA-256 fulfillment.
    • 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.
    • validateCredentialIdsLength

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

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

      @Check default EscrowFinish normalizeCondition()
      Normalization method to try to get condition() and conditionRawValue() 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 condition()'s underlying value equals conditionRawValue().

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

      If condition() is empty and conditionRawValue() is present, we will set condition() to the Condition representing the raw condition value, or leave condition() empty if conditionRawValue() is a malformed Condition.

      Returns:
      A normalized EscrowFinish.
    • normalizeFulfillment

      @Check default EscrowFinish normalizeFulfillment()
      Normalization method to try to get fulfillment() and fulfillmentRawValue() 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 fulfillment()'s underlying value equals fulfillmentRawValue().

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

      If fulfillment() is empty and fulfillmentRawValue() is present, we will set fulfillment() to the Fulfillment representing the raw fulfillment value, or leave fulfillment() empty if fulfillmentRawValue() is a malformed Fulfillment.

      Returns:
      A normalized EscrowFinish.