Skip to content

Multi-Signature Approval Workflow Sequencer #538

Description

@Kingsman-99

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

  • ApprovalWorkflowSequencer.initiate(txXdr, policy): ApprovalSession creates an approval session and notifies each required signer via the registered notification adapter
  • ApprovalSession.submitSignature(signerPublicKey, signatureBase64) records a signer's contribution and checks if the required weight threshold is now met
  • Returns the fully-signed transaction XDR via ApprovalSession.getSignedXdr() once the threshold is reached
  • Expires the session after policy.timeoutMs and throws ApprovalTimeoutError (added to src/errors.ts)
  • Unit tests simulate a 2-of-3 multisig flow and assert the session resolves on the second valid signature
  • All CI checks (npm test, npm run build, ESLint/TypeScript) pass and the branch has no merge conflicts

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions