99 * Licensed under the Apache License, Version 2.0 (the "License");
1010 * you may not use this file except in compliance with the License.
1111 * You may obtain a copy of the License at
12- *
12+ *
1313 * http://www.apache.org/licenses/LICENSE-2.0
14- *
14+ *
1515 * Unless required by applicable law or agreed to in writing, software
1616 * distributed under the License is distributed on an "AS IS" BASIS,
1717 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2929import org .immutables .value .Value ;
3030import org .xrpl .xrpl4j .model .flags .Flags ;
3131import org .xrpl .xrpl4j .model .transactions .Address ;
32+ import org .xrpl .xrpl4j .model .transactions .CurrencyAmount ;
3233import org .xrpl .xrpl4j .model .transactions .EscrowCancel ;
3334import org .xrpl .xrpl4j .model .transactions .EscrowCreate ;
3435import org .xrpl .xrpl4j .model .transactions .EscrowFinish ;
3536import org .xrpl .xrpl4j .model .transactions .Hash256 ;
36- import org .xrpl .xrpl4j .model .transactions .XrpCurrencyAmount ;
3737
3838import java .util .Optional ;
3939
4040/**
41- * Represents a held payment of XRP waiting to be executed or canceled. An {@link EscrowCreate} transaction creates an
42- * {@link EscrowObject} in the ledger. A successful {@link EscrowFinish} or {@link EscrowCancel} transaction deletes the
43- * object. If the {@link EscrowObject} has a crypto-condition, the payment can only succeed if an {@link EscrowFinish}
41+ * Represents a held payment of XRP, IOU tokens, or MPT tokens waiting to be executed or canceled. An
42+ * {@link EscrowCreate} transaction creates an {@link EscrowObject} in the ledger. A successful {@link EscrowFinish} or
43+ * {@link EscrowCancel} transaction deletes the object.
44+ *
45+ * <p>If the {@link EscrowObject} has a crypto-condition, the payment can only succeed if an {@link EscrowFinish}
4446 * transaction provides the corresponding fulfillment that satisfies the condition (the only supported crypto-condition
4547 * type is PREIMAGE-SHA-256). If the {@link EscrowObject} has a {@link EscrowObject#finishAfter()} time, the held
4648 * payment can only execute after that time.
49+ *
50+ * <p>With the TokenEscrow amendment, escrows can hold IOU tokens (trustline-based) or MPT tokens (Multi-Purpose
51+ * Tokens) in addition to XRP. The transfer rate or transfer fee is locked at escrow creation time.
4752 */
4853@ Value .Immutable
4954@ JsonSerialize (as = ImmutableEscrowObject .class )
@@ -71,36 +76,72 @@ default LedgerEntryType ledgerEntryType() {
7176 }
7277
7378 /**
74- * The {@link Address} of the owner (sender) of this held payment. This is the account that provided the XRP , and gets
75- * it back if the held payment is canceled.
79+ * The {@link Address} of the owner (sender) of this held payment. This is the account that provided the tokens , and
80+ * gets them back if the held payment is canceled.
7681 *
7782 * @return The {@link Address} of the owner of this escrow.
7883 */
7984 @ JsonProperty ("Account" )
8085 Address account ();
8186
8287 /**
83- * The destination {@link Address} where the XRP is paid if the held payment is successful.
88+ * The destination {@link Address} where the tokens are paid if the held payment is successful.
8489 *
8590 * @return The {@link Address} of the destination of this escrow.
8691 */
8792 @ JsonProperty ("Destination" )
8893 Address destination ();
8994
9095 /**
91- * The amount of XRP, in drops, to be delivered by the held payment.
96+ * The number of tokens to be delivered by the held payment.
9297 *
93- * @return A {@link XrpCurrencyAmount} denoting the amount.
98+ * <p>Can be one of:
99+ * <ul>
100+ * <li>{@link org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount} - XRP in drops</li>
101+ * <li>{@link org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount} - IOU tokens</li>
102+ * <li>{@link org.xrpl.xrpl4j.model.transactions.MptCurrencyAmount} - MPT tokens</li>
103+ * </ul>
104+ *
105+ * @return A {@link CurrencyAmount} denoting the amount.
94106 */
95107 @ JsonProperty ("Amount" )
96- XrpCurrencyAmount amount ();
108+ CurrencyAmount amount ();
109+
110+ /**
111+ * The transfer rate or transfer fee locked at escrow creation time. This field is present only for IOU or MPT escrows
112+ * (not XRP escrows).
113+ *
114+ * <p>For IOU tokens, this represents the transfer rate (in billionths of a unit) from the issuer's
115+ * {@code TransferRate} setting at the time of escrow creation. For MPT tokens, this represents the transfer fee (in
116+ * ten-thousandths of a basis point) from the MPT issuance's {@code TransferFee} setting at the time of escrow
117+ * creation.
118+ *
119+ * <p>This value is used during {@link org.xrpl.xrpl4j.model.transactions.EscrowFinish} to apply the correct fee,
120+ * even if the issuer changes their transfer rate/fee after the escrow was created.
121+ *
122+ * @return An {@link Optional} of type {@link UnsignedInteger} representing the locked transfer rate or fee.
123+ */
124+ @ JsonProperty ("TransferRate" )
125+ Optional <UnsignedInteger > transferRate ();
126+
127+ /**
128+ * A hint indicating which page of the issuer's owner directory links to this object, in case the directory consists
129+ * of multiple pages. This field is present only when the issuer is neither the source nor the destination of the
130+ * escrow (i.e., for IOU or MPT escrows where a third-party issuer is involved).
131+ *
132+ * @return An {@link Optional} of type {@link String} containing the issuer node hint.
133+ */
134+ @ JsonProperty ("IssuerNode" )
135+ Optional <String > issuerNode ();
136+
97137
98138 /**
99139 * A PREIMAGE-SHA-256 crypto-condition in DER hexadecimal encoding. If present, the
100- * {@link org.xrpl.xrpl4j.model.transactions.EscrowFinish} transaction
101- * must contain a fulfillment that satisfies this condition.
140+ * {@link org.xrpl.xrpl4j.model.transactions.EscrowFinish} transaction must contain a fulfillment that satisfies this
141+ * condition.
102142 *
103143 * @return An {@link Optional} of type {@link Condition} containing the escrow condition.
144+ *
104145 * @see "https://tools.ietf.org/html/draft-thomas-crypto-conditions-04#section-8.1"
105146 */
106147 @ JsonProperty ("Condition" )
@@ -120,8 +161,8 @@ default LedgerEntryType ledgerEntryType() {
120161 /**
121162 * The time, in <a href="https://xrpl.org/basic-data-types.html#specifying-time">seconds since the Ripple Epoch</a>,
122163 * after which this held payment can be finished. Any {@link org.xrpl.xrpl4j.model.transactions.EscrowFinish}
123- * transaction before this time fails.
124- * (Specifically, this is compared with the close time of the previous validated ledger.)
164+ * transaction before this time fails. (Specifically, this is compared with the close time of the previous validated
165+ * ledger.)
125166 *
126167 * @return An {@link Optional} of type {@link UnsignedLong} representing the finish after time.
127168 */
0 commit comments