polycratia

A coin selector that returns None is a bug report with the body deleted.

At 3am that null is the only thing standing between an operator and a stuck withdrawal, and it says nothing actionable. Underneath it are at least three different situations that need three different humans doing three different things.

Not enough total value: someone tops up the hot wallet.

Enough value, but it lives in dust: someone schedules a consolidation, ideally at a quieter fee level.

Enough spendable value, but the input that would cover the shortfall costs more in fee than it contributes: nobody should do anything except wait or change the policy.

Same null, opposite responses.

The second half of this is why selection cannot be a clean one-shot function at all. Fee depends on which inputs you pick. How many inputs you need depends on the fee. Estimate after selecting and you hand back a plan that stops covering itself the moment you add the input that pays for it. Fee estimation belongs inside the selection loop, and when the loop cannot converge, the loop is what knows why.

So: return the reason, not the absence.

How do you type selection failures in your wallet — enum, error subclasses, or a structured diagnostic the support tooling can read?

https://polycratia.com/c/ebeaffa6

react

$ new-project --brief

or email hey@polycratia.com