# Class BSV::Wallet::Store::SweepableState <a id="class-BSV-Wallet-Store-SweepableState"></a>

**Inherits:** `Data`

Snapshot of "would dropping this wallet's database destroy state that the
wallet has anchored on chain?" — answered structurally from `spendable` ×
`outputs` × `actions` join.

Returned by {Store#sweepable_state}. Consulted by destructive operations
(spec-setup DB recreation, a future `bsv-wallet destroy` CLI, programmatic
resets) before they proceed.

<code>clean?</code> is true ⇔ zero spendable outputs at BRC-42 derived keys
whose action has been signed and broadcast. Under that condition the wallet
has no on-chain commitment a destroy would orphan:

*   Root outputs (no derivation triple — `derivation_prefix IS NULL`) don't
    count — root P2PKH funds are recoverable from the identity key alone.
*   Unsigned / aborted actions don't count — no broadcast happened, so no
    on-chain anchor was created.

The non-clean payload is a guided refusal: it names the count of at-risk
outputs and the actions they sit under, and points the caller at
`sweep_to_root`. The guard isn't a veto; it makes the right next step obvious.

## Attributes
### `at_risk_actions` [R] <a id="attribute-i-at_risk_actions"></a> <a id="at_risk_actions-instance_method"></a>
Returns the value of attribute at_risk_actions
- **@return** [Object] the current value of at_risk_actions

### `at_risk_outputs` [R] <a id="attribute-i-at_risk_outputs"></a> <a id="at_risk_outputs-instance_method"></a>
Returns the value of attribute at_risk_outputs
- **@return** [Object] the current value of at_risk_outputs

## Public Instance Methods
### `clean?()` <a id="method-i-clean-3F"></a> <a id="clean?-instance_method"></a>
- **@return** [Boolean] true ⇔ no on-chain commitment a destroy would
orphan; safe to drop the database.

### `detail()` <a id="method-i-detail"></a> <a id="detail-instance_method"></a>
- **@return** [Hash] structured breakdown for CLI / log reporting.
Always includes :at_risk_outputs and :at_risk_actions; +guidance+
is nil when clean and a suggested next step otherwise.
