Description
Stellar accounts carry boolean flags (AUTH_REQUIRED, AUTH_REVOCABLE, AUTH_CLAWBACK_ENABLED, AUTH_IMMUTABLE) that significantly affect which operations can be performed against them. The SDK does not currently surface these flags in a typed, structured form, forcing callers to inspect raw Horizon AccountRecord.flags objects. A flags inspector should decode account flags and expose typed methods for checking each flag.
Technical Context
Add src/accountFlagsInspector.ts. Reads AccountRecord.flags from @stellar/stellar-sdk Horizon types. Extends src/flags.ts. Adds AccountFlagSet interface to src/types.ts. Integrates with src/preflightChecker.ts to warn or block operations that are incompatible with the recipient's flag state (e.g. sending to an AUTH_REQUIRED asset issuer without prior authorisation).
Acceptance Criteria
Description
Stellar accounts carry boolean flags (
AUTH_REQUIRED,AUTH_REVOCABLE,AUTH_CLAWBACK_ENABLED,AUTH_IMMUTABLE) that significantly affect which operations can be performed against them. The SDK does not currently surface these flags in a typed, structured form, forcing callers to inspect raw HorizonAccountRecord.flagsobjects. A flags inspector should decode account flags and expose typed methods for checking each flag.Technical Context
Add
src/accountFlagsInspector.ts. ReadsAccountRecord.flagsfrom@stellar/stellar-sdkHorizon types. Extendssrc/flags.ts. AddsAccountFlagSetinterface tosrc/types.ts. Integrates withsrc/preflightChecker.tsto warn or block operations that are incompatible with the recipient's flag state (e.g. sending to anAUTH_REQUIREDasset issuer without prior authorisation).Acceptance Criteria
inspectFlags(accountId: string): Promise<AccountFlagSet>returns{ authRequired, authRevocable, authImmutable, authClawbackEnabled }as typed booleansAccountFlagSet.isCompatibleWith(operation: string): booleanreturnsfalsewhen a flag makes the operation impossible (e.g.authRequiredblocks trustline creation without explicit authorisation)src/preflightChecker.tscallsinspectFlags()for each recipient and attaches the result to the preflight reporthasAnyRestrictiveFlag(account): booleanas a convenience method for quick-fail checksAccountRecord.flagscombinations and assert correct boolean decoding for all 16 possible flag combinations