Skip to content

feat: Implement Client-Side Transaction Builder#30

Merged
ayshadogo merged 2 commits intoDfunder:mainfrom
KingFRANKHOOD:main
Feb 25, 2026
Merged

feat: Implement Client-Side Transaction Builder#30
ayshadogo merged 2 commits intoDfunder:mainfrom
KingFRANKHOOD:main

Conversation

@KingFRANKHOOD
Copy link
Contributor

Implement client-side Stellar donation transaction builder (XDR-ready) Closes #27

Description

This PR adds a donation transaction builder service to construct Stellar payment transactions for frontend signing workflows. It supports native and issued assets, adds project memo tagging, calculates transaction fees, and returns signable XDR with robust error handling.

What Changed

  • New Service: Added a dedicated donation transaction builder in donation_tx_builder.rs.
  • CLI Integration: Added build-donation-tx command in main.rs to generate unsigned XDR.
  • Destination Resolution: Implemented destination resolution from environment variables (STELLARAID_PLATFORM_PUBLIC_KEY) with CLI override support.
  • Validation & Error Handling:
    • Invalid donor/destination addresses and timeout validation.
    • Invalid/negative/over-precision amounts.
    • Asset validation (including missing issuer for non-XLM assets).
    • Memo validation (ASCII + max 28 bytes).
  • Logging: Added non-sensitive transaction logging (destination, asset, amount, memo, fee).
  • Tests: Added coverage for XLM, 4-char (USDC), and 12-char assets, memo presence, and error paths.

Transaction Structure

The generated transaction envelope follows this schema:

  • Source: Donor address.
  • Operations: Single Payment op (Destination: platform address).
  • Asset: Selected asset (XLM or issued).
  • Memo: project_<project_id>.
  • Fee/Timeout: Configured base fee and transaction timeout.
  • Output: Unsigned XDR ready for wallet/client-side signing.

Acceptance Criteria Mapping

  • Transactions build successfully for all supported asset types.
  • Memo correctly includes project ID.
  • Fee is correctly applied.
  • XDR is valid and ready for signing.
  • Errors are caught and surfaced clearly.

🛠 Validation performed

  • Ran targeted tests for tools transaction builder logic.
  • Ran workspace checks via make ci (audit/deny/fmt/lint/tests) successfully.

@KingFRANKHOOD
Copy link
Contributor Author

@ayshadogo Please review PRs

@ayshadogo ayshadogo merged commit 4da4cea into Dfunder:main Feb 25, 2026
0 of 3 checks passed
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.

Implement Client-Side Transaction Builder

2 participants