Skip to content

Commit f56119d

Browse files
committed
feat: add AUTH_CLAWBACK_ENABLED_FLAG to AccountFlag.
1 parent b08a708 commit f56119d

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Pending
44

5+
### Update:
6+
- feat: add `AUTH_CLAWBACK_ENABLED_FLAG` to `AccountFlag`.
7+
58
## 2.1.0
69

710
### Update:

src/main/java/org/stellar/sdk/AccountFlag.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ public enum AccountFlag {
2727
* Authorization immutable (0x4): If this is set then none of the authorization flags can be set
2828
* and the account can never be deleted.
2929
*/
30-
AUTH_IMMUTABLE_FLAG(AccountFlags.AUTH_IMMUTABLE_FLAG.getValue());
30+
AUTH_IMMUTABLE_FLAG(AccountFlags.AUTH_IMMUTABLE_FLAG.getValue()),
3131

32-
// TODO: Add Clawback Enabled flag
32+
/**
33+
* Authorization clawback enabled (0x8): Allows the issuing account to clawback its credit held by
34+
* other accounts. This flag requires that {@link #AUTH_REVOCABLE_FLAG} is also set.
35+
*/
36+
AUTH_CLAWBACK_ENABLED_FLAG(AccountFlags.AUTH_CLAWBACK_ENABLED_FLAG.getValue());
3337

3438
private final int value;
3539

src/main/java/org/stellar/sdk/operations/SetOptionsOperation.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ public class SetOptionsOperation extends Operation {
3434

3535
/**
3636
* Indicates which flags to clear. For details about the flags, please refer to the <a
37-
* href="https://developers.stellar.org/docs/glossary/accounts/" target="_blank">accounts doc</a>.
38-
* You can also use {@link AccountFlag} enum.
37+
* href="https://developers.stellar.org/docs/learn/glossary#flags" target="_blank">accounts
38+
* doc</a>. You can also use {@link AccountFlag} enum.
3939
*/
40+
// TODO: change to EnumSet<AccountFlag> in next major release
4041
@Nullable private final Integer clearFlags;
4142

4243
/**
4344
* Indicates which flags to set. For details about the flags, please refer to the <a
44-
* href="https://developers.stellar.org/docs/glossary/accounts/" target="_blank">accounts doc</a>.
45-
* You can also use {@link AccountFlag} enum.
45+
* href="https://developers.stellar.org/docs/learn/glossary#flags" target="_blank">accounts
46+
* doc</a>. You can also use {@link AccountFlag} enum.
4647
*/
4748
@Nullable private final Integer setFlags;
4849

src/test/java/org/stellar/sdk/AccountFlagTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ public void testValues() {
1010
assertEquals(1, AccountFlag.AUTH_REQUIRED_FLAG.getValue());
1111
assertEquals(2, AccountFlag.AUTH_REVOCABLE_FLAG.getValue());
1212
assertEquals(4, AccountFlag.AUTH_IMMUTABLE_FLAG.getValue());
13+
assertEquals(8, AccountFlag.AUTH_CLAWBACK_ENABLED_FLAG.getValue());
1314
}
1415
}

0 commit comments

Comments
 (0)