Skip to content

Recent Escrow Events Viewer (Last 7 Days) #43

@techrebelgit

Description

@techrebelgit

Product: Escrow Viewer (Astro-based dApp)
Type: Feature · On-chain Observability
Difficulty: Medium → Hard
Track: Soroban · Stellar RPC · Transparency
Repo: Escrow Viewer repository


Overview

Add a “Recent Events” section to the Escrow Viewer that shows Soroban contract events emitted by the escrow in the last 7 days, if any.

This feature uses Stellar RPC (getEvents) directly and is intentionally limited to recent history due to RPC retention constraints.


Context

Soroban smart contracts can emit events, which are queryable via Stellar RPC using the getEvents method.

However:

  • RPC nodes only retain event data for ~7 days
  • Full historical event data requires ingestion or an indexer
  • Trustless Work is building an indexer, but it is out of scope here

This task implements a best-effort, real-time event view for escrow contracts.


Goal

Allow users to:

“See what happened recently on this escrow contract.”

Examples:

  • Milestone updates
  • Releases
  • Disputes
  • Other escrow-related events (if emitted)

Data Source (Required)

Use Stellar RPC:

  • Method: getEvents

  • Network-aware (testnet / mainnet)

  • Filter by:

    • contractIds: [escrowContractId]
    • type: "contract"

⚠️ Do not ingest or persist events.


Important Constraints (Non-Negotiable)

🚨 This feature must be read-only and ephemeral.

  • ❌ No database
  • ❌ No cron jobs
  • ❌ No Prisma / SQLite
  • ❌ No ingestion logic
  • ❌ No guarantees beyond ~7 days

This is not an indexer.


UI Requirements

Section Placement

WE have a View transaction history button on the viewer that open a Modal where this was supposed to be. You can modify it or add

  • Add a new section in the Escrow Viewer:

    • Title: Recent Contract Events
    • Subtitle: Last 7 days (RPC-limited)

Event Display

For each event, show (best-effort):

  • Event type
  • Ledger number
  • Event ID
  • Topics (decoded if possible, raw base64 otherwise)
  • Value (decoded if possible, raw base64 otherwise)

Order:

  • Most recent first

Empty & Error States

  • If no events found:

    “No contract events found in the last 7 days.”

  • If RPC fails:

    “Unable to fetch recent events from Stellar RPC.”


Disclosure (Important UX)

Include a clear note:

“This view shows only events available via Stellar RPC (last ~7 days).
Historical events will be available in future versions.”


Technical Expectations

  • Use @stellar/stellar-sdk RPC client
  • Use existing network configuration (testnet / mainnet)
  • Contract ID must come from the currently loaded escrow
  • Keep logic isolated and readable

Decoding:

  • Decode topics / values only if safe and simple
  • It’s acceptable to show base64 for unknown structures

Functional Requirements

  • Queries Stellar RPC using getEvents
  • Filters by escrow contract ID
  • Handles testnet and mainnet correctly
  • Displays recent events (if any)
  • Handles empty and error states gracefully
  • No persistence or ingestion

Developer Workflow (required)

  • Create a new branch:
feature/recent-escrow-events
  • Open a PR into main

  • Include:

    • Screenshot of the events section
    • Screenshot of empty state (if applicable)
    • Short explanation of RPC approach

Acceptance Criteria

  • Events load correctly when available
  • UI clearly communicates limitations
  • Viewer remains performant
  • No backend or storage added
  • No regressions elsewhere in Viewer

Learning Outcomes (why this task exists)

By completing this task, contributors will learn:

  • How Soroban contract events work

  • How to use Stellar RPC getEvents

  • Why event retention matters

  • The difference between:

    • RPC queries
    • Indexers
    • Ingestion pipelines
  • How to design honest, limitation-aware UX in Web3


Notes for Contributors

This task values:

  • correctness
  • clarity
  • restraint

It is OK to:

  • show raw data when decoding is unclear
  • document limitations

It is NOT OK to:

  • build an indexer
  • over-engineer persistence
  • hide the 7-day limitation

✅ Ideal for contributors who want to:

  • Learn Soroban deeply
  • Work with Stellar RPC
  • Understand on-chain observability
  • Build transparent Web3 UX

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions