# Class BSV::Wallet::Engine::FundingStrategy <a id="class-BSV-Wallet-Engine-FundingStrategy"></a>

**Inherits:** `Object`
**Includes:** `BSV::Wallet::Interface::FundingStrategy`

Input acquisition for outbound action construction.

The quartermaster: borrows inputs from `utxo_pool`, externalises the lease via
<code>store.lock_inputs</code>, and drives the build collaborator's fixpoint
loop until the inputs cover the required fee. See
<code>Interface::FundingStrategy</code> for the full contract.

The strategy orchestrates atomic Store methods only — it never opens a
database transaction. The build collaborator is called through a one-way seam:
it reports done-or-shortfall by value, never reaches down to fetch inputs.

## Constants
### `MAX_LOCK_RETRIES` <a id="constant-MAX_LOCK_RETRIES"></a> <a id="MAX_LOCK_RETRIES-constant"></a>
Bound on the bounded contention-retry primitive (#213). On a short-count
return from <code>store.lock_inputs</code>, the strategy re-selects the
contended candidates out of the pool and retries up to this many times before
raising `InsufficientFundsError`. Retry is safe because the lock is a
**lease** — the batch rolls back atomically on contention, so no canonical
state is unwound by re-borrowing scratch.

Pool depletion (selection cannot meet the target after <code>exclude:</code>)
still terminates immediately in `InsufficientFundsError`; it is a distinct
condition from contention-retry exhaustion.

## Public Instance Methods
### `acquire(action_id:, caller_outputs:, caller_supplied_inputs:, caller_inputs:, build:)` <a id="method-i-acquire"></a> <a id="acquire-instance_method"></a>
See +Interface::FundingStrategy#acquire+.
- **@raise** [BSV::Wallet::InsufficientFundsError]

### `initialize(store:, utxo_pool:)` <a id="method-i-initialize"></a> <a id="initialize-instance_method"></a>
Construct a funding strategy. Explicit DI: no engine back-reference. The
strategy reads `utxo_pool` for selection and calls atomic Store methods on
`store`; nothing else.
- **@return** [FundingStrategy] a new instance of FundingStrategy
