Interface EscrowObject
- All Superinterfaces:
LedgerObject
- All Known Implementing Classes:
ImmutableEscrowObject
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 TypeMethodDescriptionaccount()TheAddressof the owner (sender) of this held payment.amount()The number of tokens to be delivered by the held payment.builder()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 destinationAddresswhere 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 Flagsflags()A bit-map of boolean flags.index()The unique ID of thisEscrowObject.A hint indicating which page of the issuer's owner directory links to this object, in case the directory consists of multiple pages.default LedgerObject.LedgerEntryTypeThe 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
The type of ledger object, which is always "Escrow".- Returns:
- Always
LedgerObject.LedgerEntryType.ESCROW.
-
account
Address account()TheAddressof 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
Addressof the owner of this escrow.
-
destination
Address destination()The destinationAddresswhere the tokens are paid if the held payment is successful.- Returns:
- The
Addressof the destination of this escrow.
-
amount
CurrencyAmount amount()The number of tokens to be delivered by the held payment.Can be one of:
XrpCurrencyAmount- XRP in dropsIssuedCurrencyAmount- IOU tokensMptCurrencyAmount- MPT tokens
- Returns:
- A
CurrencyAmountdenoting 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
TransferRatesetting 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'sTransferFeesetting at the time of escrow creation.This value is used during
EscrowFinishto apply the correct fee, even if the issuer changes their transfer rate/fee after the escrow was created.- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the locked transfer rate or fee.
-
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). -
condition
Optional<com.ripple.cryptoconditions.Condition> condition()A PREIMAGE-SHA-256 crypto-condition in DER hexadecimal encoding. If present, theEscrowFinishtransaction must contain a fulfillment that satisfies this condition.- Returns:
- An
Optionalof typeConditioncontaining the escrow condition. - See Also:
-
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
Optionalof typeUnsignedLongrepresenting 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. AnyEscrowFinishtransaction before this time fails. (Specifically, this is compared with the close time of the previous validated ledger.)- Returns:
- An
Optionalof typeUnsignedLongrepresenting the finish after time.
-
flags
A bit-map of boolean flags. No flags are defined for theEscrowObjecttype, 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
Optionalof typeUnsignedIntegerrepresenting 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
Optionalof typeUnsignedIntegerrepresenting the tag of the destination account.
-
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.
-
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. -
previousTransactionId
The identifying hash of the transaction that most recently modified this object.- Returns:
- A
Hash256containing 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
Optionalof typeUnsignedIntegerrepresenting the previous transaction ledger sequence.
-
index
Hash256 index()The unique ID of thisEscrowObject.- Returns:
- A
Hash256containing the ID.
-