Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Blockchain Controller to Expose API Endpoints #12

Open
13 tasks
Josue19-08 opened this issue Feb 10, 2025 · 0 comments
Open
13 tasks

Implement Blockchain Controller to Expose API Endpoints #12

Josue19-08 opened this issue Feb 10, 2025 · 0 comments

Comments

@Josue19-08
Copy link
Contributor

📌 Issue: Implement Blockchain Controller to Expose API Endpoints

🔹 Description

Expose RESTful API endpoints for blockchain interactions, allowing external services to fetch NFT balances, metadata, and execute token transfers via the ERC-1155 contract on StarkNet Testnet.


📂 Project Structure

  • Controller: src/modules/blockchain/controllers/blockchain.controller.ts
  • Service: src/modules/blockchain/services/starknet.service.ts
  • DTOs: src/modules/blockchain/dtos/transfer.dto.ts

🛠️ Tasks

  • Create blockchain.controller.ts to handle HTTP requests.
  • Implement the following API endpoints:
    • GET /blockchain/balance/:account/:tokenId → Returns the balance of a specific token for a given account.
    • GET /blockchain/token/:tokenId → Returns metadata for a specific token.
    • POST /blockchain/transfer → Transfers a token between two accounts.
  • Ensure request validation using DTOs.
  • Implement error handling for invalid requests.
  • Integrate the controller with StarknetService.
  • Write unit tests to validate:
    • Correct responses for balance and metadata retrieval.
    • Successful transfers via API.
    • Handling of invalid input parameters.
  • Generate API documentation using Swagger/OpenAPI.

✅ Acceptance Criteria

  • The API should correctly expose blockchain-related functionalities.
  • Swagger documentation must be available for all endpoints.
  • API must handle errors gracefully and provide meaningful responses.
  • Unit tests must pass before merging.
@Josue19-08 Josue19-08 assigned Josue19-08 and unassigned Josue19-08 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant