Skip to content

Feat (Core): Implement Multi-Signature Escrow & Trust Account Module - #38

Merged
akargi merged 10 commits into
Chulilee:mainfrom
uadamu00009-ux:feat/Escrow
Aug 19, 2026
Merged

Feat (Core): Implement Multi-Signature Escrow & Trust Account Module#38
akargi merged 10 commits into
Chulilee:mainfrom
uadamu00009-ux:feat/Escrow

Conversation

@uadamu00009-ux

Copy link
Copy Markdown
Contributor

Summary

Implemented Multi-Signature Escrow & Trust Account Module

Related Issues

Closes #26

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation only
  • Refactor / chore (no functional change)

Changes

Checklist

  • I have read the CONTRIBUTING guide.
  • npm run lint passes.
  • npx tsc --noEmit passes (no type errors).
  • npm run build succeeds.
  • npm test passes, and I added/updated tests for my change where it
    made sense.
  • Any Stellar/Soroban network access goes through the stellar module
    services (no direct Horizon/RPC calls from feature modules).
  • I did not commit secrets, private keys, or mainnet credentials.

Notes for Reviewers

uadamu00009-ux and others added 10 commits August 19, 2026 18:29
Define EscrowStatus (10 states), EscrowType (4 types including
time-locked and milestone-based), SignatoryRole, and
EscrowTimelineEventType enums to support the multi-sig escrow module.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Define default timeout durations, minimum/maximum signatory limits,
and configurable thresholds for escrow account lifecycle management.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Define typed event classes for fund, approval, settlement, timeout,
dispute, milestone, and cancellation events to support real-time
notifications and inter-service communication.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…estones, and timeline

Introduce TypeORM entities for multi-sig escrow management:
- EscrowAccount: m-of-n config, amounts, deadlines, time-locks
- EscrowSignatory: per-user approval tracking with role-based access
- EscrowMilestone: milestone-based partial fund release
- EscrowTimeline: immutable audit trail for all state changes

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Add request/response DTOs with class-validator decorations for:
- CreateEscrowDto: m-of-n config, signatories, amounts, deadlines
- ApproveEscrowDto: signature recording with IP audit
- QueryEscrowDto: filtered listing with pagination

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…one management

Add request DTOs for:
- ReleaseFundsDto: full/partial release with milestone gating
- FlagDisputeDto: dispute initiation with reason and evidence
- UpdateMilestoneDto: milestone completion status updates

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Implement EscrowTimelineService to record all state changes in an
immutable timeline, supporting queries by escrow account with
chronological ordering.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Implement EscrowService with full escrow lifecycle management:
- Account creation with m-of-n signatory requirements
- Fund deposit and approval workflow with threshold detection
- Milestone-gated partial fund release
- Time-locked automatic settlement
- Timeout-triggered refunds
- Dispute flagging (freeze) and resolution (admin/arbitrator)
- Cancel and force-release for admin override
- Stellar keypair generation for on-chain multisig integration

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Expose 14 REST endpoints under /api/escrow for full escrow lifecycle
management with JWT auth and role-based guards. Register EscrowModule
in AppModule and wire up TypeORM entity and provider dependencies.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Add 79 unit tests covering the full escrow service lifecycle:
creation, funding, approval with threshold detection, release
(full and milestone-gated), refund, timeout, time-lock settlement,
dispute flagging/resolution, cancellation, and timeline queries.
Achieves 97% statement and 91% branch coverage.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@akargi
akargi merged commit 537a96a into Chulilee:main Aug 19, 2026
1 check passed
@akargi

akargi commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Welldone @uadamu00009-ux this is production standard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Multi-Signature Escrow & Trust Account Module

2 participants