Skip to content

sponsorship.ts: Fix sponsored account fee not attributed to sponsor in event payload #694

Description

@Kingsman-99

Description

src/sponsorship.ts emits a SponsorshipUsed event when a sponsored transaction is submitted, but the event payload's feeSource field is set to the submitter's account rather than the sponsor account. This causes incorrect fee attribution in downstream analytics.

Acceptance Criteria

  • SponsorshipUsed event feeSource field is set to the sponsor account ID
  • A test asserts the correct feeSource in the emitted event for a sponsored transaction
  • Non-sponsored transactions continue to set feeSource to the submitter
  • Unit tests pass

Context

  • Target file: src/sponsorship.ts
  • The sponsor account ID is available in the transaction envelope; no additional Horizon calls are needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions