Skip to content

iou.clawback()

[Source]

Reclaim a holder's balance back to the issuer.

Note

Verifies the issuer has asfAllowTrustLineClawback enabled first (a ledger read), throwing a clear error if not. The flag can only be enabled before the issuer owns any trust lines, offers, or other ledger objects, which this SDK does not itself pre-check.

Signature

iou.clawback(
  params: IOUClawbackParams,
  options?: IOUWriteOptions,
): Promise<SubmissionResult<IOUClawbackIntent>>

Parameters

ParameterTypeRequiredDescription
tickerstringYesThe currency code (3-character ISO-4217-style or 40-character hex; other codes are auto-encoded to hex).
holderstringYesThe holder's r-address to claw the currency back from.
amountstringYesThe amount to claw back, as a decimal string. Must be non-negative, with at most 15 significant digits.

Options

options is an optional second argument that sets the source account and overrides the fee.

OptionTypeRequiredDescription
fromAccountSelectorNoThe account to act as — an r-address string, or an object { address } or { signer, account? }. Defaults to the primary signer's primary account. (For IOU operations, this is the issuer.)
feeFeeIntentNoFee override — a priority tier and/or a maxFeeDrops cap.
idempotencyKeystringNoA prior submission's idempotencyKey, to retry to the same intent instead of creating a duplicate. Auto-generated when omitted.

Returns

Resolves to a SubmissionResult<IOUClawbackIntent>.

Every simpleXRPL write resolves to a SubmissionResult<T> — a union tagged by source, with the backend's raw response preserved verbatim. Its common fields are:

FieldTypeDescription
intentTThe operation-specific output — see the operation's own return fields.
source'xrpld' | 'custody' | 'palisade'Which backend produced the result; discriminates response.
responseTxResponse | custody record | Palisade recordThe backend's raw response, preserved verbatim.
txHashstring (optional)The XRPL transaction hash, once the transaction is on-ledger.
intentIdstring (optional)The custodian intent id, when the path produced one. Hold onto this to resume via client.intent.
idempotencyKeystring (optional)The UUIDv7 this submission carried. Pass it back as a later call's idempotencyKey to retry to the same intent rather than creating a duplicate.

Return fields

For IOU.clawback, the intent (IOUClawbackIntent) echoes:

FieldTypeDescription
holderstringThe holder's r-address clawed back from.
amountstringThe amount clawed back.

Underlying XRPL transactor

Builds and submits a single Clawback transaction.

Example

await client.iou.clawback({
  ticker: 'USD',
  holder: 'rHolder...',
  amount: '50',
})