Commit fce6717
committed
cat21-mint: refactor onto Cat21MintOrchestrator
The fat RxJS pipelines that lived in this component (selectedFeeRate$,
paymentOutputsForCurrentWallet$, paymentOutputs$ + its 2-pass
simulation logic) now live in the SDK's Cat21MintOrchestrator,
consumed identically by cat21.space when phase C lands.
Component shrinks from 265 lines of orchestration logic to a thin
form + view layer:
- Inject Cat21MintOrchestrator alongside the existing WalletService /
Cat21ApiService.
- paymentOutputs$ becomes a derived map of orchestrator.simulations$:
filter insufficient rows, sort by UTXO value desc, cap at 10 for
the expert panel. Same surface the template already bound.
- selectedPaymentOutput stays as a component field for template
compatibility but is two-way-bound to orchestrator.selectedUtxo:
- paymentOutputs$ tap auto-syncs on every fresh simulation list
(largest viable entry by default, or keep the user's pick if
it's still viable).
- selectPaymentOutput(row) handler updates both sides when the
user clicks "Use this UTXO".
- mintCat21() delegates to orchestrator.mint() — the orchestrator
recomputes the precise fee from vsize × feeRate at call time and
dispatches to the right WalletSigner.
- Component-level booleans (utxoLoading, utxoError, mintCat21Loading,
mintCat21Success, mintCat21Error) become read-only computed
signals projecting orchestrator.state() / errorMessage() /
successTxId(). Same template-facing names, same shapes; template
references update to `name()` invocations + `*ngIf="x() as alias"`
patterns for the two places that used optional chaining on the
old field shape.
ngOnInit + the form's feeRate valueChanges subscription still own
the policy bits that don't belong in the SDK (minRequiredFee
validator, fastestFee default-pick, the disable-min-fee-check
escape hatch).
AOT build clean; the bundle is unchanged in size (orchestrator was
already included by the SDK bump; this commit just reorganises the
component code).1 parent a155af0 commit fce6717
2 files changed
Lines changed: 140 additions & 217 deletions
File tree
- frontend/src/app/components/_ordpool/cat21-mint
Lines changed: 15 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
| 205 | + | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
| 209 | + | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
0 commit comments