Skip to content

B-6: Multi-asset support (Stellar custom tokens / USDC) #201

@KuchiMercy

Description

@KuchiMercy

Summary

The platform currently only supports XLM for escrow amounts. Stellar supports custom assets (including USDC via Stellar Asset Contract), and the architecture is ready for token abstraction. Adding multi-asset support significantly expands the platform's utility.

Requirements

  • Extend the escrow creation DTO to accept an asset parameter: { code: string, issuer: string } (native XLM uses a sentinel value)
  • Build an admin-managed token allowlist: AllowedAsset entity with fields for asset code, issuer, display name, icon URL, decimals, and active flag
  • Add admin CRUD endpoints for the allowlist: POST/GET/PATCH/DELETE /admin/assets
  • Integrate Stellar Horizon API to validate that an asset exists and fetch its metadata
  • Update the Stellar integration service to handle SAC (Stellar Asset Contract) token transfers
  • Update the smart contract interaction layer to pass asset info to the Soroban contract
  • Add a GET /assets public endpoint returning the list of supported assets
  • Update escrow amount display to respect asset decimals

Acceptance Criteria

  • Escrows can be created with any asset on the allowlist
  • XLM remains the default if no asset is specified (backward compatible)
  • Admin can add/remove assets from the allowlist
  • Asset validation checks the Stellar network before allowing creation
  • USDC on Stellar works end-to-end (create, fund, release)
  • Escrow amounts display with correct decimal precision per asset
  • Invalid or deactivated assets are rejected at creation time

Context

  • Escrow entity amount field: apps/backend/src/modules/escrow/entities/escrow.entity.ts
  • Stellar integration: apps/backend/src/modules/escrow/services/escrow-stellar-integration.service.ts
  • Stellar SDK: @stellar/stellar-sdk v13.3.0 (already in dependencies)
  • Smart contract types: apps/onchain/src/types.rs

Rollout Phase

Phase 4 — User Features

Points: 200 (Difficult)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions