Skip to content

Sync contract error codes from Rust to backend #870

Description

@Jayy4rl

Context: The Rust SDK defines numeric contract error codes. The backend should translate them to human-readable messages when surfacing RPC simulation errors.

Requirements:

  • Create backend/src/stellar/error-codes.ts mapping numeric codes to string descriptions (manually synced from errors.rs, with a comment pointing to the source file).
  • In stellar.ts, catch simulation errors and include the mapped description in the thrown error message.

Acceptance criteria:

  • A simulation failing with code 10 throws "FundingTargetNotMet: vault has not reached its funding target".
  • Unknown codes fall back to "Contract error code N".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions