Skip to content

docs(escrow): document lifecycle hooks and query pagination (#826) - #866

Merged
fati-Onchain merged 2 commits into
Facil-Pay:mainfrom
aboisamcrypto:feat/759-760-762-826
Oct 23, 2026
Merged

fati-Onchain merged 2 commits into
Facil-Pay:mainfrom
aboisamcrypto:feat/759-760-762-826

Conversation

@aboisamcrypto

Copy link
Copy Markdown
Contributor

Pull Request: Escrow Lifecycle Hooks & Query Pagination Documentation

Summary

This PR documents the previously undocumented public escrow functions for
lifecycle hook registration and paginated escrow queries, resolving issue #826.

No contract logic is changed — this is a documentation-only update to
contracts/escrow/README.md.

Changes

contracts/escrow/README.md

New section — Escrow Lifecycle Hooks

Documents the publish-subscribe notification system:

  • register_escrow_hook — subscriber registration with ping() validation,
    per-event cap (10), auth requirements, and returned hook_id.
  • deregister_escrow_hook — marks a hook inactive; only the original
    subscriber may deregister.
  • get_escrow_hooks — lists all active hooks for a given event type.
  • Full EscrowEventType table (Created, Released, Disputed, Resolved,
    Refunded, Cancelled, StatusChanged).
  • Subscriber interface contract (ping() + on_escrow_event()).
  • Error codes, emitted events, and a usage example.

New section — Escrow Queries and Pagination

Documents all six paginated query functions with clear offset/limit semantics:

  • get_escrows_by_status / get_escrow_count_by_status
  • get_escrows_by_customer / get_escrow_count_by_customer
  • get_escrows_by_merchant / get_escrow_count_by_merchant
  • Pagination examples (full-scan loop, single-page fetch, count-then-page).
  • Implementation note on the append-only status index and stale-entry skipping.
  • Note on total_volume being a raw cross-token sum.

Testing

Documentation-only change. No new code paths are introduced and no existing
tests are modified.

Closes

Closes #759, closes #760, closes #826, closes #762

aboisamcrypto and others added 2 commits October 22, 2026 07:42
…y#826)

Add two new sections to contracts/escrow/README.md:
- Escrow Lifecycle Hooks: register_escrow_hook, deregister_escrow_hook,
  get_escrow_hooks, EscrowEventType values, subscriber interface,
  registration/deregistration rules, events and error codes.
- Escrow Queries and Pagination: get_escrows_by_status,
  get_escrow_count_by_status, get_escrows_by_customer,
  get_escrow_count_by_customer, get_escrows_by_merchant,
  get_escrow_count_by_merchant, with pagination semantics, examples,
  and implementation notes.
@fati-Onchain
fati-Onchain merged commit a22a51a into Facil-Pay:main Oct 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants