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:
Fork and Create Branch:
Fork the repository and create a new branch using the issue number:
git checkout -b fix-[issue-number]
Implement Changes:
[ ] Add a new route in the application to handle GET /get_expiring_domains.
[ ] Create a function to query the domains collection. The query should:
Filter documents where:
_cursor.to is null.
expiry is less than the current timestamp plus one week.
Return an array of objects in the following format:
{
"addr": "0x",
"domain": "ben.stark"
}
[ ] Ensure the function retrieves the required fields (legacy_address as addr, and domain).
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;
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:
Assignment: Don't create a pull request if you weren’t assigned to this issue.
Timeframe: Complete the task within 3 business days.
Closing the Issue: In your PR description, close the issue by writing Close #[issue_id].
Review Process:
Once you've submitted your PR, change the label to "ready for review".
If changes are requested, address them and then update the label back to "ready for review" once done.
Testing: Test your PR locally before pushing, and verify that tests and build are working after pushing.
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.
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:
Fork and Create Branch:
Fork the repository and create a new branch using the issue number:
Implement Changes:
GET /get_expiring_domains
.domains
collection. The query should:_cursor.to
isnull
.expiry
is less than the current timestamp plus one week.legacy_address
asaddr
, anddomain
).Example Code Snippet:
Run Tests and Commit Changes:
Make sure your changes don't break existing functionality and commit with a clear message:
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.