Skip to content

Add trade webhook registration so creators are notified when their keys are bought or sold #425

@Chucks1093

Description

@Chucks1093

Summary

When someone buys or sells a creator's keys, the creator only finds out if they happen to refresh the page. Creators need a way to register a webhook URL so the server notifies them in real time whenever a trade event involving their keys is indexed. This lets creators integrate AccessLayer events into their own tools, bots, or notification pipelines.

Scope

  • Add POST /creators/:id/webhooks to register a webhook URL for that creator's trade events
    • Requires wallet signature verification to confirm the caller is the creator
    • Accepts: { callback_url, events: ['buy', 'sell'] } to allow filtering by event type
  • Add DELETE /creators/:id/webhooks/:webhook_id to remove a registration
  • Add GET /creators/:id/webhooks to list active webhooks (creator auth required)
  • On each indexed trade event, POST to all registered callback URLs with: { event_type, creator_id, buyer_or_seller_address, amount, price, fee_paid, timestamp }
  • Failed delivery retried up to 3 times with exponential backoff; after exhaustion the webhook is flagged as failing but not deleted

Acceptance Criteria

  • Creator can register, list, and delete webhooks (requires wallet signature)
  • Webhook fires within 2 seconds of trade event being indexed
  • events filter correctly limits which event types trigger the webhook
  • Failed delivery is retried 3 times; webhook is flagged failing after exhaustion
  • A creator cannot register more than a configurable max number of webhooks (default: 5)
  • Integration test covers: buy event delivery, sell event delivery, filter by type, retry on failure

Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions