Skip to content

Implement a concrete TransactionBuilder service backed by @stellar/stellar-sdk for emergency transfersΒ #860

Description

@Baskarayelu

πŸ“‹ Description

services/transaction-builder.ts declares the ITransactionBuilder interface (buildEmergencyTransfer β†’ XDR, calculateEmergencyFee), but there is no production implementation wired to @stellar/stellar-sdk. The emergency-transfer UI (components/Dashboard/EmergencyTransferModal.tsx and app/emergency-transfer/page.tsx) therefore cannot produce a real signable transaction.

This issue implements a concrete builder that constructs a payment transaction (native or asset+issuer), supports an optional memo, applies an emergency fee multiplier, and returns base64 XDR.

Why this matters: the modal collects amount, speed, and recipient but produces nothing to sign β€” the feature is presentational until a real builder exists.

🎯 Requirements & Context

Functional requirements

  • Add an implementation (e.g. services/transaction-builder-service.ts, which already exists as a stub) of ITransactionBuilder.
  • Build a TransactionBuilder payment op with Asset.native() or new Asset(code, issuer) and serialize to XDR.
  • Implement calculateEmergencyFee (emergency vs regular) returning a string.
  • Validate the memo length before building (see existing memo-length concerns).

Context & constraints

πŸ› οΈ Suggested Execution

git checkout -b feature/transaction-builder-impl
  • Implement + TSDoc each method.
  • vitest unit tests: valid native build, asset build, memo too long rejected, fee multiplier correctness, invalid destination rejected.
npx vitest run && npx tsc --noEmit && npm run lint
feat(services): implement stellar-sdk TransactionBuilder for emergency transfers

βœ… Acceptance Criteria & Guidelines

Requirement Target
ITransactionBuilder fully implemented Required
Returns valid base64 XDR Required
Memo + amount + address validation Required
Test coverage β‰₯ 90%
tsc --noEmit, lint clean Required
Timeframe 96 hours from assignment

πŸ’¬ Community & Support

Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA

Comment to claim and ask questions in the channel. πŸš€

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions