diff --git a/src/content/docs/docs/protocol-reference/transactions/transaction-types/accountset.mdx b/src/content/docs/docs/protocol-reference/transactions/transaction-types/accountset.mdx index 1ae1f53..c39d6c5 100644 --- a/src/content/docs/docs/protocol-reference/transactions/transaction-types/accountset.mdx +++ b/src/content/docs/docs/protocol-reference/transactions/transaction-types/accountset.mdx @@ -61,6 +61,7 @@ The available AccountSet flags are: | Flag Name | Decimal Value | Corresponding Ledger Flag | Description | | --------------------------------- | ------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `asfAccountTxnID` | 5 | (None) | Track the ID of this account's most recent transaction. Required for `AccountTxnID` | +| `asfAllowTrustLineClawback` | 17 | `lsfAllowTrustLineClawback` | Enables an account to clawback tokens it has issued. This flag can only be enabled if the account’s owner directory is empty (no trust lines, offers, escrows, payment channels, checks, or signer lists). Once set, it cannot be undone. | | `asfAuthorizedNFTokenMinter` | 10 | (None) | Enable to allow another account to mint non-fungible tokens (NFTokens) on this account's behalf. Specify the authorized account in the `NFTokenMinter` field of the AccountRoot object. To remove an authorized minter, enable this flag and omit the `NFTokenMinter` field. _(Added by the \[NonFungibleTokensV1_1 amendment]\[].)_ | | `asfDefaultRipple` | 8 | `lsfDefaultRipple` | Enable rippling on this account's trust lines by default. | | `asfDepositAuth` | 9 | `lsfDepositAuth` | Enable Deposit Authorization on this account. _(Added by the \[DepositAuth amendment]\[].)_ | diff --git a/src/content/docs/docs/protocol-reference/transactions/transaction-types/clawback.mdx b/src/content/docs/docs/protocol-reference/transactions/transaction-types/clawback.mdx new file mode 100644 index 0000000..d7102af --- /dev/null +++ b/src/content/docs/docs/protocol-reference/transactions/transaction-types/clawback.mdx @@ -0,0 +1,52 @@ +--- +title: Clawback +description: >- + Revoke tokens that were previously issued by your account. +--- +\[[Source](https://github.com/Xahau/xahaud/blob/dev/src/ripple/app/tx/impl/Clawback.cpp)] + +_(Added by the \[Clawback amendment]\[].)_ + +Revoke tokens that were previously issued by your account. The **Clawback** feature is disabled by default. To use it, you must first submit an **AccountSet** transaction that enables *Allow Trust Line Clawback*. If your account has already issued tokens, you cannot enable Clawback afterward. You can only activate *Allow Trust Line Clawback* if your owner directory is completely empty — meaning before creating trust lines, offers, escrows, payment channels, checks, or signer lists. Once enabled, Clawback becomes a permanent capability of your account and cannot be undone. + +--- + +## Example + +```json +{ + "TransactionType": "Clawback", + "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "Amount": { + "currency": "USD", + "issuer": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy", + "value": "123.45" + } +} +```` + +--- + +### Fields + +A **Clawback** transaction includes: + +| Field | JSON Type | Description | +| -------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Amount` | *Currency Amount* | The quantity to be revoked, as well as the counterparty from which it is taken. The `value` must not be zero. If greater than the holder’s balance, the entire balance is revoked. In the `issuer` sub-field, specify the holder’s address (not the issuer’s). | + +In Xahau, an IOU/Non-XAH token on a trust line always has an issuer, but trust lines are bidirectional and under certain settings both sides may act as issuers. In this transaction, the issuer’s address goes in the `Account` field, while the holder’s address goes in the `issuer` sub-field of `Amount`. + +--- + +## Error Cases + +Besides the standard transaction errors, Clawback may fail with: + +| Error Code | Description | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `temDISABLED` | The **Clawback** amendment is not enabled on Xahau. | +| `temBAD_AMOUNT` | The holder’s balance is zero. (It is not an error if the specified amount exceeds the holder’s balance — in that case, the full available balance is revoked). Also occurs if the counterparty in `Amount` is the same account submitting the transaction. | +| `tecNO_LINE` | No trust line exists with the specified counterparty, or the trust line has a balance of zero. | +| `tecNO_PERMISSION` | Happens if you try to enable `lsfAllowTrustLineClawback` while `lsfNoFreeze` is already enabled, or vice versa. | +