Skip to content

Verification History Endpoint #179

@mftee

Description

@mftee

Description:

Implement a GET /verify/:hash/history endpoint that retrieves the full on-chain history for a document hash — all Stellar transactions that reference the hash in their memo field.

Requirements:

  • Extend StellarClient with get_hash_history(document_hash: &str) -> Result<Vec<TransactionRecord>> where TransactionRecord contains:
    pub struct TransactionRecord {
        pub transaction_id: String,
        pub timestamp: i64,
        pub memo: String,
        pub ledger: u64,
    }
  • The Horizon query must paginate through results (limit=200, follow next cursor links if present)
  • Sort results chronologically (oldest first)
  • Cache the full history with a TTL of 300 seconds
  • Return 404 if no transactions are found for the hash

Acceptance Criteria:

  • Returns an ordered list of all transactions referencing the hash
  • Pagination is followed (not just the first page)
  • Cache is used on subsequent requests within TTL
  • Unit tests for the sorting and pagination logic

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions