Skip to content

[api] Implement POST /transactions Soroban transaction relay endpoint #304

Description

@Mimah97

Problem

The frontend swap, remove-liquidity, and fee-collection flows POST signed XDR to ${API_BASE}/transactions, but no controller implements this route. Swaps cannot complete end-to-end on testnet.

Affected callers:

  • apps/web/hooks/useSwapExecution.ts
  • apps/web/hooks/useRemoveLiquidity.ts
  • apps/web/app/portfolio/page.tsx (fee collection)

Acceptance criteria

  • Add TransactionsController with POST /transactions accepting { xdr: string }
  • Submit transaction via @stellar/stellar-sdk RPC using STELLAR_RPC_URL
  • Return { hash: string } on success
  • Map Soroban slippage errors to { code: "SLIPPAGE_EXCEEDED" }
  • Unit + e2e tests with mocked RPC

Files

  • New module under apps/api/src/transactions/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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