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 /get_teen_accounts Endpoint #38

Open
1 task
0xLucqs opened this issue Apr 2, 2024 · 1 comment
Open
1 task

Implement /get_teen_accounts Endpoint #38

0xLucqs opened this issue Apr 2, 2024 · 1 comment
Labels
paused The issue can't be solved yet

Comments

@0xLucqs
Copy link
Contributor

0xLucqs commented Apr 2, 2024

Description

We need to implement the /get_teen_accounts endpoint in the Vault backend. This endpoint is responsible for retrieving all the teen accounts controlled by a specific account.

Details

  • Method: GET
  • Path: /get_teen_accounts
  • Summary: Get all the teen accounts controlled by this account.

Request Parameters:

  • address: The StarkNet address for which the teen accounts are to be retrieved.

Response:

  • Status Code: 200
  • Description: Successful retrieval of teen accounts
  • Content Type: application/json
  • Body:
[
  "0x0123456789abcdefABCDEF0123456789abcdefABCDEF0123456789abcdefABCD",
  "0x1234567890abcdefABCDEF0123456789abcdefABCDEF0123456789abcdefABC",
  "0xABCDEF0123456789abcdef0123456789abcdefABCDEF0123456789abcdef0123",
  ...
]

Notes:

The teen accounts are represented as an array of hexadecimal strings.

Example

// Import necessary modules
import fastify from 'fastify';

// Create Fastify instance
const app = fastify({ logger: true });

// Define the get_teen_accounts endpoint
app.get('/get_teen_accounts', async (request, reply) => {
    try {
        // Logic to retrieve the teen accounts goes here

        // Return the teen accounts
        return [
            "0x0123456789abcdefABCDEF0123456789abcdefABCDEF0123456789abcdefABCD",
            "0x1234567890abcdefABCDEF0123456789abcdefABCDEF0123456789abcdefABC",
            "0xABCDEF0123456789abcdef0123456789abcdefABCDEF0123456789abcdef0123",
            ...
        ];
    } catch (error) {
        // Handle errors
        console.error('Error while retrieving teen accounts:', error);
        return reply.status(500).send({ error: 'Internal Server Error' });
    }
});

Tasks:

  • Implement the /get_teen_accounts endpoint.
@Mystic-Nayy
Copy link
Contributor

@LucasLvy Please assign this to me.

@0xLucqs 0xLucqs added the paused The issue can't be solved yet label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paused The issue can't be solved yet
Projects
None yet
Development

No branches or pull requests

2 participants