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.
2424import org .xrpl .xrpl4j .model .transactions .AccountSet ;
2525
2626/**
27- * {@link TransactionFlags} for {@link AccountSet} transactions. Note that using these directly is
28- * discouraged, but can be useful when setting multiple flags for an account.
27+ * {@link TransactionFlags} for {@link AccountSet} transactions. Note that using these directly is discouraged, but can
28+ * be useful when setting multiple flags for an account.
2929 */
3030public class AccountSetTransactionFlags extends TransactionFlags {
31+
3132 /**
3233 * Constant for an unset flag.
3334 */
@@ -63,6 +64,15 @@ public class AccountSetTransactionFlags extends TransactionFlags {
6364 */
6465 protected static final AccountSetTransactionFlags ALLOW_XRP = new AccountSetTransactionFlags (0x00200000 );
6566
67+ /**
68+ * Constant {@link AccountSetTransactionFlags} for the {@code tfInnerBatchTxn} flag. This flag is used to indicate
69+ * that a transaction is an inner transaction of a Batch.
70+ *
71+ * @see "https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0056-batch"
72+ */
73+ public static final AccountSetTransactionFlags INNER_BATCH_TXN =
74+ new AccountSetTransactionFlags (TransactionFlags .INNER_BATCH_TXN .getValue ());
75+
6676 private AccountSetTransactionFlags (long value ) {
6777 super (value );
6878 }
@@ -77,7 +87,8 @@ private static AccountSetTransactionFlags of(
7787 boolean tfRequireAuth ,
7888 boolean tfOptionalAuth ,
7989 boolean tfDisallowXrp ,
80- boolean tfAllowXrp
90+ boolean tfAllowXrp ,
91+ boolean tfInnerBatchTxn
8192 ) {
8293 Preconditions .checkArgument (
8394 !(tfRequireDestTag && tfOptionalDestTag ),
@@ -101,7 +112,8 @@ private static AccountSetTransactionFlags of(
101112 tfRequireAuth ? REQUIRE_AUTH : UNSET ,
102113 tfOptionalAuth ? OPTIONAL_AUTH : UNSET ,
103114 tfDisallowXrp ? DISALLOW_XRP : UNSET ,
104- tfAllowXrp ? ALLOW_XRP : UNSET
115+ tfAllowXrp ? ALLOW_XRP : UNSET ,
116+ tfInnerBatchTxn ? TransactionFlags .INNER_BATCH_TXN : UNSET
105117 ).getValue ()
106118 );
107119 }
@@ -135,8 +147,8 @@ public static AccountSetTransactionFlags of(long value) {
135147 }
136148
137149 /**
138- * Construct an empty instance of {@link AccountSetTransactionFlags}. Transactions with empty flags will
139- * not be serialized with a {@code Flags} field.
150+ * Construct an empty instance of {@link AccountSetTransactionFlags}. Transactions with empty flags will not be
151+ * serialized with a {@code Flags} field.
140152 *
141153 * @return An empty {@link AccountSetTransactionFlags}.
142154 */
@@ -216,16 +228,29 @@ public boolean tfAllowXrp() {
216228 return this .isSet (ALLOW_XRP );
217229 }
218230
231+ /**
232+ * Indicates that this transaction is an inner transaction of a Batch transaction.
233+ *
234+ * @return {@code true} if {@code tfInnerBatchTxn} is set, otherwise {@code false}.
235+ *
236+ * @see "https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0056-batch"
237+ */
238+ public boolean tfInnerBatchTxn () {
239+ return this .isSet (AccountSetTransactionFlags .INNER_BATCH_TXN );
240+ }
241+
219242 /**
220243 * A builder class for {@link AccountSetTransactionFlags}.
221244 */
222245 public static class Builder {
246+
223247 private boolean tfRequireDestTag = false ;
224248 private boolean tfOptionalDestTag = false ;
225249 private boolean tfRequireAuth = false ;
226250 private boolean tfOptionalAuth = false ;
227251 private boolean tfDisallowXrp = false ;
228252 private boolean tfAllowXrp = false ;
253+ private boolean tfInnerBatchTxn = false ;
229254
230255 /**
231256 * Set {@code tfRequireDestTag} to the given value.
@@ -287,6 +312,18 @@ public Builder tfAllowXrp() {
287312 return this ;
288313 }
289314
315+ /**
316+ * Set {@code tfInnerBatchTxn} to the given value.
317+ *
318+ * @param tfInnerBatchTxn A boolean value.
319+ *
320+ * @return The same {@link Builder}.
321+ */
322+ public Builder tfInnerBatchTxn (boolean tfInnerBatchTxn ) {
323+ this .tfInnerBatchTxn = tfInnerBatchTxn ;
324+ return this ;
325+ }
326+
290327 /**
291328 * Build a new {@link AccountSetTransactionFlags} from the current boolean values.
292329 *
@@ -300,7 +337,8 @@ public AccountSetTransactionFlags build() {
300337 tfRequireAuth ,
301338 tfOptionalAuth ,
302339 tfDisallowXrp ,
303- tfAllowXrp
340+ tfAllowXrp ,
341+ tfInnerBatchTxn
304342 );
305343 }
306344 }
0 commit comments