Skip to content

feat: add treasury donation support - #844

Merged
Technosophorso merged 2 commits into
mainfrom
feature/treasury-donation
Sep 14, 2026
Merged

Technosophorso merged 2 commits into
mainfrom
feature/treasury-donation

Conversation

@lisicky

@lisicky lisicky commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

What

Adds treasury-donation support to MeshTxBuilder and the CST serializer.

Users can call setDonation(lovelace) with a positive lovelace amount. The donation is written into the transaction body and included in transaction balancing, so coin selection reserves it alongside deposits.

Details

  • Adds donation to MeshTxBuilderBody and preserves it through the object adapters.
  • Serializes it with CSTSerializer.
  • Rejects it with a clear error in CSLSerializer, which does not support treasury donations.
  • Accounts for it during coin selection.

Validation

  • npm test -- --runInBand packages/mesh-transaction/test/mesh-tx-builder/donation.test.ts

The test covers serialization, balancing, insufficient funds, non-positive input, and CSL rejection.

@lisicky
lisicky requested a review from twwu123 September 14, 2026 13:10
@Technosophorso

Copy link
Copy Markdown
Member

can merge @twwu123 ?

@Technosophorso
Technosophorso merged commit f15545d into main Sep 14, 2026
1 check passed
@lisicky
lisicky deleted the feature/treasury-donation branch September 14, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants