Skip to content

Engineer Type-Safe XDR Deserialization Layer for Soroban Contract Return Values #626

@temma02

Description

@temma02

Description

Build a type-safe XDR deserialization layer that converts raw Soroban contract return values into strongly-typed application objects, eliminating unsafe manual XDR parsing.

Requirements and Context

  • Type safety: XDR values must deserialize to typed objects
  • Testing: Test deserialization for all return value types
  • Documentation: Document the deserialization layer

Suggested Execution

Branch: feat/issue-090-soroban-xdr-typesafe-deserialization

Implement Changes

  • Add a type-safe XDR deserialization layer to packages/stellar/src/soroban.ts
  • Map Soroban SCVal types to TypeScript types
  • Handle all scalar, vector, and map return value types
  • Throw typed errors on deserialization failures

Test and Commit

  • Test deserialization of scalar, vector, and map return values
  • Test typed error on malformed XDR
  • Document the deserialization layer

Example Commit Message

feat(soroban): add type-safe XDR deserialization layer

- Map Soroban SCVal types to TypeScript types
- Handle scalar, vector, and map return values
- Throw typed errors on deserialization failures

Guidelines

  • Cover all SCVal variants used by templates
  • Never silently coerce malformed XDR
  • Build on the existing typed error infrastructure

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

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