Massive changes. I dont know what happens. Rewrote the action wizard again. Fixed several bugs related to the utxo selection. QR codes were added for address. Add support for data results. Experiment with other methods of role extraction

This commit is contained in:
2026-03-22 13:20:46 +00:00
parent be52f73e64
commit a28d43a68b
35 changed files with 2226 additions and 1169 deletions

View File

@@ -0,0 +1,36 @@
import type { FlowContext, StepType } from '../types.js';
import { WizardFlow } from './WizardFlow.js';
/**
* Flow strategy for transaction-based actions.
*
* Handles both single-role actions (sendSatoshis, burn) where the
* creator provides inputs and signs locally, and multi-role actions
* (receive, request) where the creator publishes an invitation for
* another party to complete.
*/
export class TransactionWizardFlow extends WizardFlow {
readonly type = 'transaction' as const;
getStepTypes(context: FlowContext): StepType[] {
const steps: StepType[] = [];
if (context.availableRoles.length > 1) steps.push('role-select');
if (context.hasVariables) steps.push('variables');
if (context.shouldCollectInputs) steps.push('inputs');
steps.push('review');
steps.push('publish');
return steps;
}
canFinalize(context: FlowContext): boolean {
return (
context.requirementsComplete &&
context.wizardCollectedInputs &&
!context.hasSignedAndBroadcasted
);
}
getFinalActionLabel(context: FlowContext): string {
return this.canFinalize(context) ? 'Sign & Broadcast' : 'Done';
}
}