keep-starknet-strange / vault

Empower Your Assets, Redefine Control.
https://vlt.finance
MIT License
23 stars 18 forks source link

Implement /get_teen_accounts Endpoint #38

Open 0xLucqs opened 6 months ago

0xLucqs commented 6 months ago

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

Request Parameters:

Response:

[
  "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:

Gift-Naomi commented 5 months ago

@LucasLvy Please assign this to me.