Skip to content

Contract escrow-marketplace: add escrow status snapshot and release-readiness accessor #497

@CMI-James

Description

@CMI-James

Background

Marketplace and operations surfaces need fast visibility into escrow health so users can understand whether assets are still locked, disputed, or eligible for release without manually combining multiple reads.

Feature Focus

Add escrow status and release-readiness accessors to the escrow marketplace contract.

Where to Implement (Exact Targets)

  • contracts/escrow-marketplace/src/lib.rs
  • contracts/escrow-marketplace/src/storage.rs
  • contracts/escrow-marketplace/src/types.rs
  • contracts/escrow-marketplace/src/test.rs

What to Implement

  • Add a snapshot accessor that returns escrow state, buyer/seller identifiers, expiry metadata, and dispute flags.
  • Add a release-readiness accessor that explains whether release conditions are satisfied and which blocker remains when not ready.
  • Normalize response payloads so frontend workflows can render badges and CTA states directly.
  • Preserve compatibility with existing settlement logic and dispute windows.

Interface / Endpoint / Method Details

  • Return structured data rather than a narrow boolean so clients can present actionable state.
  • Include timestamp or ledger-derived readiness context where already tracked by the contract.
  • Avoid duplicating settlement transitions inside the read path.

Acceptance Criteria

  • Clients can distinguish locked, releasable, disputed, and expired escrows using public reads alone.
  • Accessors gracefully handle unknown escrow ids.
  • Existing write flows continue to behave unchanged.

Required Tests

  • Unit tests for pending, releasable, expired, disputed, and missing-escrow cases.
  • Regression coverage confirming reads do not affect escrow settlement state.

Definition of Done

  • Snapshot and readiness accessors are live, documented, and tested.
  • Contract interface docs stay in sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ContractSmart contract workHighHigh complexitySorobanSoroban-specific workStellar WaveStellar Wave initiativeenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions