Skip to content

Publish structured payloads on contract events #6

Description

@iexwr

Context

Events in src/request.rs are emitted as env.events().publish((Symbol, id), ()) — the payload is empty, so the backend indexer cannot read fields without re-deriving state from storage.

Acceptance criteria

  • request_created publishes (request_id, payee, asset, amount, memo, expires_at).
  • request_paid publishes (request_id, payer).
  • request_cancelled publishes (request_id).
  • The event payload shapes are documented in README.md (Contract reference table).

Technical notes

  • Soroban event topics must be Serde-serializable; use Vec/tuple of Vals via IntoVal, or define #[contracttype] structs for payloads.
  • Keep the first topic (the event name Symbol) stable — the backend filters on it.

Testing

  • Add a test asserting emitted event topics/body via env.events().all() (testutils).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveStellar Wave for StackPayenhancementNew feature or request

    Type

    No type

    Fields

    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