lfglabs-dev / api.starknet.id

StarknetID API written in Rust.
2 stars 1 forks source link

New route: get_expiring_domains #109

Open Marchand-Nicolas opened 2 days ago

Marchand-Nicolas commented 2 days ago

Description đź“ą

Add an endpoint called get_expiring_domains to return all domains that will expire in less than a week.

Proposed Actions 🛠️

Here’s a checklist of actions to follow for resolving this issue:

  1. Fork and Create Branch:
    Fork the repository and create a new branch using the issue number:

    git checkout -b fix-[issue-number]
  2. Implement Changes:

Example Code Snippet:

// Pseudocode for database query
let current_time = get_current_timestamp();
let one_week_later = current_time + 604800; // 7 days in seconds

let expiring_domains = domains_collection.find(
    {
        "expiry": { "$lt": one_week_later },
        "_cursor.to": null
    },
    {
        "projection": { "domain": 1, "legacy_address": 1 }
    }
);

let response = expiring_domains.map(|doc| {
    {
        "addr": doc.legacy_address,
        "domain": doc.domain,
    }
});

return response;
  1. Run Tests and Commit Changes:
    Make sure your changes don't break existing functionality and commit with a clear message:

    git commit -m "Fix: Add endpoint for fetching domains expiring in less than a week"

Required đź“‹

To keep our workflow smooth, please make sure you follow these guidelines:

Thank you for your contribution 🙏

⚠️ WARNING: Failure to follow the requirements above may result in being added to the OnlyDust blacklist, affecting your ability to receive future rewards.

Snehagupta1907 commented 1 day ago

can i take up thi sissue?i have fullsatck experience and worked on starkent other repo too