Overview
Stellar's asset control features — AUTHORIZATION_REQUIRED, AUTHORIZATION_REVOCABLE, AUTHORIZATION_CLAWBACK_ENABLED, AUTHORIZATION_IMMUTABLE — and the associated operations (AllowTrust, SetTrustlineFlags, Clawback, ClawbackClaimableBalance) are among the least-understood parts of the protocol. Regulated asset issuers, stablecoin operators, and compliance teams all need these, but the operations are complex and easy to misconfigure. SaviTools should expose a full Asset Control workstation that lets an issuer inspect all trustlines for their asset, set authorization flags, execute clawbacks, and preview the exact operations before submitting.
What needs to be built
apps/api/src/modules/wallet/assetcontrol.service.ts
-
GET /wallet/asset/:code/:issuer/trustlines — fetches all accounts that hold a trustline to the specified asset; returns { trustlines: [{ account, balance, limit, authorized, authorizedToMaintainLiabilities, clawbackEnabled }] }
-
POST /wallet/asset/:code/:issuer/set-flags — accepts { account, flags: { authorized?, authorizedToMaintainLiabilities? } }: builds a SetTrustlineFlags operation; returns assembled XDR for the issuer to sign — never signs on behalf of the issuer
-
POST /wallet/asset/:code/:issuer/clawback — accepts { account, amount }:
- Validates that the asset has
AUTHORIZATION_CLAWBACK_ENABLED set on the issuer account — rejects with CLAWBACK_NOT_ENABLED if not
- Builds a
Clawback operation; returns assembled XDR
-
GET /wallet/asset/:code/:issuer/flags — fetches the issuer account from Horizon; returns parsed asset control flags: { authorizationRequired, authorizationRevocable, authorizationClawbackEnabled, authorizationImmutable }
apps/web/src/app/sandbox/assetcontrol/
-
Asset selector: code + issuer public key input; "Load Asset" fetches flags and trustlines
-
Asset flags panel: four flag badges (colour-coded enabled/disabled); "Edit Flags" opens a form to set issuer account flags via SetOptions
-
Trustline table: all accounts holding this asset, with balance, limit, authorization status per row; per-row actions: "Authorize" / "Deauthorize" (builds SetTrustlineFlags XDR), "Clawback" (opens amount input, builds Clawback XDR)
-
XDR preview modal — shows the assembled operation(s) for review before the user copies to submit via the Transaction Composer
-
Search/filter on the trustline table: filter by authorization status, balance range, account address
Acceptance criteria
Overview
Stellar's asset control features —
AUTHORIZATION_REQUIRED,AUTHORIZATION_REVOCABLE,AUTHORIZATION_CLAWBACK_ENABLED,AUTHORIZATION_IMMUTABLE— and the associated operations (AllowTrust,SetTrustlineFlags,Clawback,ClawbackClaimableBalance) are among the least-understood parts of the protocol. Regulated asset issuers, stablecoin operators, and compliance teams all need these, but the operations are complex and easy to misconfigure. SaviTools should expose a full Asset Control workstation that lets an issuer inspect all trustlines for their asset, set authorization flags, execute clawbacks, and preview the exact operations before submitting.What needs to be built
apps/api/src/modules/wallet/assetcontrol.service.tsGET /wallet/asset/:code/:issuer/trustlines— fetches all accounts that hold a trustline to the specified asset; returns{ trustlines: [{ account, balance, limit, authorized, authorizedToMaintainLiabilities, clawbackEnabled }] }POST /wallet/asset/:code/:issuer/set-flags— accepts{ account, flags: { authorized?, authorizedToMaintainLiabilities? } }: builds aSetTrustlineFlagsoperation; returns assembled XDR for the issuer to sign — never signs on behalf of the issuerPOST /wallet/asset/:code/:issuer/clawback— accepts{ account, amount }:AUTHORIZATION_CLAWBACK_ENABLEDset on the issuer account — rejects withCLAWBACK_NOT_ENABLEDif notClawbackoperation; returns assembled XDRGET /wallet/asset/:code/:issuer/flags— fetches the issuer account from Horizon; returns parsed asset control flags:{ authorizationRequired, authorizationRevocable, authorizationClawbackEnabled, authorizationImmutable }apps/web/src/app/sandbox/assetcontrol/Asset selector: code + issuer public key input; "Load Asset" fetches flags and trustlines
Asset flags panel: four flag badges (colour-coded enabled/disabled); "Edit Flags" opens a form to set issuer account flags via
SetOptionsTrustline table: all accounts holding this asset, with balance, limit, authorization status per row; per-row actions: "Authorize" / "Deauthorize" (builds
SetTrustlineFlagsXDR), "Clawback" (opens amount input, buildsClawbackXDR)XDR preview modal — shows the assembled operation(s) for review before the user copies to submit via the Transaction Composer
Search/filter on the trustline table: filter by authorization status, balance range, account address
Acceptance criteria
Clawbackoperation is rejected withCLAWBACK_NOT_ENABLEDwhen the issuer account does not have the clawback flag set — confirmed without any Horizon submissionSetTrustlineFlagsXDR produced for deauthorization is a valid Stellar transaction — accepted by Horizon testnet when signed by the issuerAUTHORIZATION_IMMUTABLEwhich blocks further flag changesauthorized=falsereturns only unauthorised trustlines — correct even when the full list spans multiple Horizon pages