Skip to content

docs: publish a contract event schema reference (#578) - #628

Closed
ZacLou wants to merge 3 commits into
StayLitCodes:mainfrom
ZacLou:docs/contract-events-reference
Closed

docs: publish a contract event schema reference (#578)#628
ZacLou wants to merge 3 commits into
StayLitCodes:mainfrom
ZacLou:docs/contract-events-reference

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 29, 2026

Copy link
Copy Markdown

Overview

Fixes #578 — creates docs/contract/EVENTS.md documenting every event emitted by the Vaultix escrow contract.

What's in the doc

Topic convention

Documents the three-part topic tuple (Vaultix, <schema_version>, <event_name>) and where EVENT_NAMESPACE (line 454) and EVENT_SCHEMA_VERSION (line 455) are defined in lib.rs.

All 16 emitted events documented

Each event is listed with:

  • Topic tuple
  • Entrypoint that emits it
  • State transition it represents
  • Full payload struct with field types and descriptions

Events covered:

  • Escrow lifecycle: EscrowCreated, EscrowCreatedBatch, FundsDeposited, SignatureCollected, MilestoneReleased, DeliveryConfirmed, DisputeRaised, DisputeResolved, EscrowCancelled, EscrowCompleted, EscrowExpiredRefunded
  • Admin/config: ContractUpgraded, AdminProposed, AdminProposalCancelled, RoleUpdated, FeeUpdated, PausedToggled, MultisigConfigured

Deviation flags

Events that deviate from the typed-struct pattern (SignatureCollected, MultisigConfigured, ContractUpgraded) are explicitly flagged so the doc and code can converge in a future schema version.

State transition graph

ASCII diagram showing all legal EscrowStatus transitions and which event is emitted at each transition.

Schema version bump strategy

Explains how consumers should handle a schema version bump, including backward compatibility and migration guidance.

Cross-references

Linked from docs/contract/README.md and cross-referenced with DATA_MODELS.md, ERRORS.md, WORKFLOWS.md, and DEPLOYMENT.md.

Acceptance Criteria Checklist

  • A new docs/contract/EVENTS.md documents the three-part topic convention (Vaultix, <schema version>, <event name>) and where EVENT_SCHEMA_VERSION is defined
  • Every emitted event is listed with its topic tuple, payload struct, and field types
  • Events that currently deviate from the convention are flagged so the doc and code can converge
  • Each event is mapped to the entrypoint that emits it and the state transition it represents
  • A short section explains how a consumer should handle a schema version bump
  • The doc is linked from docs/contract/README.md

Closes #578

鲁班七号 added 3 commits August 29, 2026 08:55
…LitCodes#557)

- services/api.ts now imports apiUrl from security/env.ts instead of
  reading EXPO_PUBLIC_API_BASE_URL directly
- EXPO_PUBLIC_API_BASE_URL is fully removed from the codebase
- security/env.ts: corrected dev rpcUrl default from 8545 (EVM port) to
  8000 (Soroban RPC port)
- validateEnv() now provides detailed warnings in development when env
  vars are missing or still using defaults
- validateEnv() is called at app start in app/_layout.tsx
- Added apps/mobile/.env.example documenting EXPO_PUBLIC_APP_ENV,
  EXPO_PUBLIC_API_URL, and EXPO_PUBLIC_RPC_URL

Closes StayLitCodes#557
…tCodes#579)

Created docs/ENVIRONMENT.md listing every env var per service (backend,
frontend, mobile, onchain deployment) with:
- Variable name, owning service, required/optional, secret flag, default
- Conflict & duplicate register (EXPO_PUBLIC_API_BASE_URL vs
  EXPO_PUBLIC_API_URL, NEXT_PUBLIC_API_BASE_URL vs NEXT_PUBLIC_API_URL,
  API_BASE_URL)
- Cross-service variables that must agree (API URL, Stellar network,
  Soroban RPC, contract ID)
- Quick start examples for each service

Closes StayLitCodes#579
Created docs/contract/EVENTS.md documenting:
- Three-part topic convention (Vaultix, v1, EventName)
- EVENT_NAMESPACE and EVENT_SCHEMA_VERSION constants
- All 16 emitted events with topic tuples, payload structs, and field types
- Entrypoint mapping and state transitions for each event
- Events that deviate from the typed-struct pattern (SignatureCollected,
  MultisigConfigured, ContractUpgraded) flagged for convergence
- State transition graph showing legal EscrowStatus transitions
- Schema version bump strategy for consumers

Linked from docs/contract/README.md.

Closes StayLitCodes#578
@Cedarich Cedarich closed this Aug 29, 2026
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.

[DOCS] Publish a contract event schema reference

2 participants