Skip to content

[BE-29] Add resource credit balance endpoint #833

@yusuftomilola

Description

@yusuftomilola

Overview

Add an endpoint that fetches a member's on-chain resource credit balance from the Soroban resource_credits contract. All implementation goes in backend/sandbox/.

Acceptance Criteria

  • GET /sandbox/credits/balance returns the current user's credit balance
  • Reads from the deployed Soroban resource_credits contract using the Stellar SDK
  • Contract address is read from an env variable RESOURCE_CREDITS_CONTRACT_ID
  • Returns { balance: string, address: string } (balance as string to avoid precision loss)
  • Returns 503 with a clear message if the Stellar network is unreachable
  • JWT-protected

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions