Skip to content

Add a webhook handler for Stellar Horizon transaction events to update key ownership records #777

Description

@Chucks1093

Summary

Key ownership updates currently depend on polling. A webhook handler that receives Stellar Horizon payment and account events should update ownership records in real time, reducing latency between on-chain settlement and off-chain state.

Scope

  • Expose a POST /webhooks/horizon endpoint to receive Horizon event callbacks
  • Verify the HMAC-SHA256 signature on every incoming webhook payload
  • Parse payment_received and transaction_successful event types
  • Match the transaction memo to a pending key purchase order
  • Update the owner field on the key record and emit an internal ownership_transferred event

Acceptance Criteria

  • Endpoint rejects requests with invalid HMAC signatures with 401
  • payment_received events update key ownership correctly
  • Unmatched memos are logged and discarded without error
  • Duplicate event delivery is idempotent
  • ownership_transferred event emitted after successful update

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

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