-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add support for clawback amendment * checkstyle * fix normalization functions in AccountSet * mark all Clawback code @beta * mark CLAWBACK transaction type beta
- Loading branch information
Showing
14 changed files
with
540 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.xrpl.xrpl4j.model.transactions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import com.google.common.annotations.Beta; | ||
import org.immutables.value.Value; | ||
import org.immutables.value.Value.Immutable; | ||
import org.xrpl.xrpl4j.model.flags.TransactionFlags; | ||
|
||
/** | ||
* Clawback an issued currency that exists on a Trustline. | ||
* | ||
* <p>This class will be marked {@link Beta} until the Clawback amendment is enabled on mainnet. Its API is subject | ||
* to change.</p> | ||
*/ | ||
@Immutable | ||
@JsonSerialize(as = ImmutableClawback.class) | ||
@JsonDeserialize(as = ImmutableClawback.class) | ||
@Beta | ||
public interface Clawback extends Transaction { | ||
|
||
/** | ||
* Construct a {@code Clawback} builder. | ||
* | ||
* @return An {@link ImmutableClawback.Builder}. | ||
*/ | ||
static ImmutableClawback.Builder builder() { | ||
return ImmutableClawback.builder(); | ||
} | ||
|
||
/** | ||
* Set of {@link TransactionFlags}s for this {@link Clawback}, which only allows the | ||
* {@code tfFullyCanonicalSig} flag, which is deprecated. | ||
* | ||
* @return Always {@link TransactionFlags#EMPTY}. | ||
*/ | ||
@JsonProperty("Flags") | ||
@Value.Default | ||
default TransactionFlags flags() { | ||
return TransactionFlags.EMPTY; | ||
} | ||
|
||
/** | ||
* Indicates the amount being clawed back, as well as the counterparty from which the amount is being clawed back | ||
* from. This amount must not exceed the holder's balance and must be greater than zero. The issuer in this amount | ||
* must not be the same as the source account of this transaction. | ||
* | ||
* @return An {@link IssuedCurrencyAmount} indicating the amount to clawback. | ||
*/ | ||
@JsonProperty("Amount") | ||
IssuedCurrencyAmount amount(); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.