Description
Invoices above a configurable threshold require multi-signature approval from multiple authorised signers before the payment transaction is submitted. The SDK has no workflow primitive for collecting signatures in sequence, notifying pending signers, or timing out after a maximum collection window. An approval workflow sequencer should orchestrate the signing round, gathering XDR-encoded signatures until the required signer weight is reached.
Technical Context
Add src/approvalWorkflowSequencer.ts. Reads MultiSigPolicy from src/types.ts. Integrates with src/requestSigner.ts for signature collection and src/txBuilder.ts to inject collected signatures into the transaction. Uses src/scheduler.ts for timeout enforcement. Emits approvalRequested, approvalReceived, and approvalWorkflowComplete via src/events.ts.
Acceptance Criteria
Description
Invoices above a configurable threshold require multi-signature approval from multiple authorised signers before the payment transaction is submitted. The SDK has no workflow primitive for collecting signatures in sequence, notifying pending signers, or timing out after a maximum collection window. An approval workflow sequencer should orchestrate the signing round, gathering XDR-encoded signatures until the required signer weight is reached.
Technical Context
Add
src/approvalWorkflowSequencer.ts. ReadsMultiSigPolicyfromsrc/types.ts. Integrates withsrc/requestSigner.tsfor signature collection andsrc/txBuilder.tsto inject collected signatures into the transaction. Usessrc/scheduler.tsfor timeout enforcement. EmitsapprovalRequested,approvalReceived, andapprovalWorkflowCompleteviasrc/events.ts.Acceptance Criteria
ApprovalWorkflowSequencer.initiate(txXdr, policy): ApprovalSessioncreates an approval session and notifies each required signer via the registered notification adapterApprovalSession.submitSignature(signerPublicKey, signatureBase64)records a signer's contribution and checks if the required weight threshold is now metApprovalSession.getSignedXdr()once the threshold is reachedpolicy.timeoutMsand throwsApprovalTimeoutError(added tosrc/errors.ts)