keep-starknet-strange / vault

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

Implement /get_whitelisted_entrypoints Endpoint #36

Open 0xLucqs opened 6 months ago

0xLucqs commented 6 months ago

Description

We need to implement the /get_whitelisted_entrypoints endpoint in the Vault backend. This endpoint is responsible for retrieving the whitelisted entry points associated with a specific account on StarkNet.

Details

Request Parameters:

Response:

[
  "0x0123456789abcdefABCDEF0123456789abcdefABCDEF0123456789abcdefABCD",
  "0x1234567890abcdefABCDEF0123456789abcdefABCDEF0123456789abcdefABC",
  ...
]

Notes:

The whitelisted entry points 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_whitelisted_entrypoints endpoint
app.get('/get_whitelisted_entrypoints', async (request, reply) => {
    try {
        // Logic to retrieve the whitelisted entry points goes here

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

Tasks:

martinvibes commented 4 months ago

hey please assign me to this @LucasLvy