Add new time periods for ERC20 and native token permissions #190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the Transfer Window period picker to align with the latest design specifications.
Previously, the picker displayed durations in seconds or allowed manual input of seconds, which was confusing and inconsistent.
The updated picker now offers a fixed set of human-readable transfer window options for improved usability and clarity:
These predefined options provide a more opinionated and user-friendly experience, covering the majority of use cases while maintaining consistency with the design direction.
Related issues
Fixes: #396
Manual testing steps
Go to the page where the transfer period picker is displayed.
Open the period picker dropdown.
Verify that the options available are:
Select any option and confirm that:
Verify that manual second input is no longer available.
Screenshots/Recordings
Before
Period duration shown in seconds or manual seconds input field.
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds fixed transfer window options (Hourly/Daily/Weekly/Biweekly/Monthly/Yearly), removes custom seconds input, and validates/maps durations to standard periods across periodic permissions.
Transfer Window
; remove manualperiodDuration
input and render onlystartTime
,periodAmount
,periodType
,expiry
.periodType
options toHourly
,Daily
,Weekly
,Biweekly
,Monthly
,Yearly
.TimePeriod
enum expanded (addHOURLY
,BIWEEKLY
,YEARLY
).periodType
now strictlyTimePeriod
(remove'Other'
).zTimestamp
withzPeriodDuration
forperiodDuration
.TIME_PERIOD_TO_SECONDS
for all periods (monthly ≈ 30 days); newgetClosestTimePeriod(seconds)
.periodDuration
(positive bigint) and map to closest standard period; set canonical duration.periodType
rule validates input and derivesperiodDuration
from mapping.getClosestTimePeriod
and time utilities.Written by Cursor Bugbot for commit a51061f. This will update automatically on new commits. Configure here.