keep-starknet-strange / vault

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

Implement /get_whitelisted_contracts_entrypoints Endpoint #37

Open 0xLucqs opened 6 months ago

0xLucqs commented 6 months ago

Description

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

Details

Request Parameters:

Response:

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

Notes:

The whitelisted entrypoints of contracts are represented as an array of arrays of hexadecimal strings.

Example

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

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

// Define the get_whitelisted_contracts_entrypoints endpoint
app.get('/get_whitelisted_contracts_entrypoints', async (request, reply) => {
    try {
        // Logic to retrieve the whitelisted entrypoints of contracts goes here

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

Tasks:

MhdSadd commented 5 months ago

Good day @LucasLvy can I pick this up

sprtd commented 5 months ago

@LucasLvy would like to work on this

0xLucqs commented 4 months ago

Hey this issue cannot be worked on for now