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_whitelisted_contracts_entrypoints Endpoint #37

Open
1 task
LucasLvy opened this issue Apr 2, 2024 · 3 comments
Open
1 task

Implement /get_whitelisted_contracts_entrypoints Endpoint #37

LucasLvy opened this issue Apr 2, 2024 · 3 comments
Labels
paused The issue can't be solved yet

Comments

@LucasLvy
Copy link
Contributor

LucasLvy commented Apr 2, 2024

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

  • Method: GET
  • Path: /get_whitelisted_contracts_entrypoints
  • Summary: Get whitelisted entrypoints of contracts.

Request Parameters:

  • address: The StarkNet address for which the whitelisted entrypoints of contracts are to be retrieved.

Response:

  • Status Code: 200
  • Description: Successful retrieval of whitelisted entrypoints of contracts
  • Content Type: application/json
  • Body:
[
  [
    "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:

  • Implement the /get_whitelisted_contracts_entrypoints endpoint.
@MhdSadd
Copy link

MhdSadd commented Apr 11, 2024

Good day @LucasLvy can I pick this up

@LucasLvy LucasLvy added the paused The issue can't be solved yet label Apr 11, 2024
@sprtd
Copy link

sprtd commented Apr 30, 2024

@LucasLvy would like to work on this

@LucasLvy
Copy link
Contributor Author

LucasLvy commented May 3, 2024

Hey this issue cannot be worked on for now

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

3 participants