Interface EscrowObject

All Superinterfaces:
LedgerObject
All Known Implementing Classes:
ImmutableEscrowObject

@Immutable public interface EscrowObject extends LedgerObject
Represents a held payment of XRP, IOU tokens, or MPT tokens waiting to be executed or canceled. An EscrowCreate transaction creates an EscrowObject in the ledger. A successful EscrowFinish or EscrowCancel transaction deletes the object.

If the EscrowObject has a crypto-condition, the payment can only succeed if an EscrowFinish transaction provides the corresponding fulfillment that satisfies the condition (the only supported crypto-condition type is PREIMAGE-SHA-256). If the EscrowObject has a finishAfter() time, the held payment can only execute after that time.

With the TokenEscrow amendment, escrows can hold IOU tokens (trustline-based) or MPT tokens (Multi-Purpose Tokens) in addition to XRP. The transfer rate or transfer fee is locked at escrow creation time.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject

    LedgerObject.LedgerEntryType
  • Method Summary

    Modifier and Type
    Method
    Description
    The Address of the owner (sender) of this held payment.
    The number of tokens to be delivered by the held payment.
    Construct a builder for this class.
    Optional<com.google.common.primitives.UnsignedLong>
    The held payment can be canceled if and only if this field is present and the time it specifies has passed.
    Optional<com.ripple.cryptoconditions.Condition>
    A PREIMAGE-SHA-256 crypto-condition in DER hexadecimal encoding.
    The destination Address where the tokens are paid if the held payment is successful.
    A hint indicating which page of the destination's owner directory links to this object, in case the directory consists of multiple pages.
    Optional<com.google.common.primitives.UnsignedInteger>
    An arbitrary tag to further specify the destination for this held payment, such as a hosted recipient at the destination address.
    Optional<com.google.common.primitives.UnsignedLong>
    The time, in seconds since the Ripple Epoch, after which this held payment can be finished.
    default Flags
    A bit-map of boolean flags.
    The unique ID of this EscrowObject.
    A hint indicating which page of the issuer's owner directory links to this object, in case the directory consists of multiple pages.
    The type of ledger object, which is always "Escrow".
    A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages.
    The identifying hash of the transaction that most recently modified this object.
    Optional<com.google.common.primitives.UnsignedInteger>
    The index of the ledger that contains the transaction that most recently modified this object.
    Optional<com.google.common.primitives.UnsignedInteger>
    An arbitrary tag to further specify the source for this held payment, such as a hosted recipient at the owner's address.
    Optional<com.google.common.primitives.UnsignedInteger>
    The transfer rate or transfer fee locked at escrow creation time.
  • Method Details

    • builder

      Construct a builder for this class.
      Returns:
      An ImmutableEscrowObject.Builder.
    • ledgerEntryType

      @Derived default LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object, which is always "Escrow".
      Returns:
      Always LedgerObject.LedgerEntryType.ESCROW.
    • account

      Address account()
      The Address of the owner (sender) of this held payment. This is the account that provided the tokens, and gets them back if the held payment is canceled.
      Returns:
      The Address of the owner of this escrow.
    • destination

      Address destination()
      The destination Address where the tokens are paid if the held payment is successful.
      Returns:
      The Address of the destination of this escrow.
    • amount

      CurrencyAmount amount()
      The number of tokens to be delivered by the held payment.

      Can be one of:

      Returns:
      A CurrencyAmount denoting the amount.
    • transferRate

      Optional<com.google.common.primitives.UnsignedInteger> transferRate()
      The transfer rate or transfer fee locked at escrow creation time. This field is present only for IOU or MPT escrows (not XRP escrows).

      For IOU tokens, this represents the transfer rate (in billionths of a unit) from the issuer's TransferRate setting at the time of escrow creation. For MPT tokens, this represents the transfer fee (in ten-thousandths of a basis point) from the MPT issuance's TransferFee setting at the time of escrow creation.

      This value is used during EscrowFinish to apply the correct fee, even if the issuer changes their transfer rate/fee after the escrow was created.

      Returns:
      An Optional of type UnsignedInteger representing the locked transfer rate or fee.
    • issuerNode

      Optional<String> issuerNode()
      A hint indicating which page of the issuer's owner directory links to this object, in case the directory consists of multiple pages. This field is present only when the issuer is neither the source nor the destination of the escrow (i.e., for IOU or MPT escrows where a third-party issuer is involved).
      Returns:
      An Optional of type String containing the issuer node hint.
    • condition

      Optional<com.ripple.cryptoconditions.Condition> condition()
      A PREIMAGE-SHA-256 crypto-condition in DER hexadecimal encoding. If present, the EscrowFinish transaction must contain a fulfillment that satisfies this condition.
      Returns:
      An Optional of type Condition containing the escrow condition.
      See Also:
      • "https://tools.ietf.org/html/draft-thomas-crypto-conditions-04#section-8.1"
    • cancelAfter

      Optional<com.google.common.primitives.UnsignedLong> cancelAfter()
      The held payment can be canceled if and only if this field is present and the time it specifies has passed. Specifically, this is specified as seconds since the Ripple Epoch and it "has passed" if it's earlier than the close time of the previous validated ledger.
      Returns:
      An Optional of type UnsignedLong representing the cancel after time.
    • finishAfter

      Optional<com.google.common.primitives.UnsignedLong> finishAfter()
      The time, in seconds since the Ripple Epoch, after which this held payment can be finished. Any EscrowFinish transaction before this time fails. (Specifically, this is compared with the close time of the previous validated ledger.)
      Returns:
      An Optional of type UnsignedLong representing the finish after time.
    • flags

      @Derived default Flags flags()
      A bit-map of boolean flags. No flags are defined for the EscrowObject type, so this value is always 0.
      Returns:
      Always Flags.UNSET.
    • sourceTag

      Optional<com.google.common.primitives.UnsignedInteger> sourceTag()
      An arbitrary tag to further specify the source for this held payment, such as a hosted recipient at the owner's address.
      Returns:
      An Optional of type UnsignedInteger representing the tag of the owner account.
    • destinationTag

      Optional<com.google.common.primitives.UnsignedInteger> destinationTag()
      An arbitrary tag to further specify the destination for this held payment, such as a hosted recipient at the destination address.
      Returns:
      An Optional of type UnsignedInteger representing the tag of the destination account.
    • ownerNode

      Optional<String> ownerNode()
      A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages.

      Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.

      Returns:
      An Optional of type String containing the owner node hint.
    • destinationNode

      Optional<String> destinationNode()
      A hint indicating which page of the destination's owner directory links to this object, in case the directory consists of multiple pages. Omitted on escrows created before enabling the fix1523 amendment.
      Returns:
      An Optional of type String containing the destination node hint.
    • previousTransactionId

      Optional<Hash256> previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Returns:
      A Hash256 containing the previous transaction hash.
    • previousTransactionLedgerSequence

      Optional<com.google.common.primitives.UnsignedInteger> previousTransactionLedgerSequence()
      The index of the ledger that contains the transaction that most recently modified this object.
      Returns:
      An Optional of type UnsignedInteger representing the previous transaction ledger sequence.
    • index

      Hash256 index()
      The unique ID of this EscrowObject.
      Returns:
      A Hash256 containing the ID.