Repository navigation
PR title: feat(creator-keys): add get_cooldown_remaining view (#1050) - #1077
Merged
Chucks1093 merged 1 commit intoOct 18, 2026
Merged
Conversation
|
@Cmitchelle7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #1050.
The trade cooldown system merged into
maincoversset_cooldown,get_cooldown_status, per-(creator, wallet) enforcement inbuy_key/sell_key, and theCooldownViolationEvent.seconds_remainingpayload — verified againstcreator-keys/src/lib.rs:11221and:11249.This PR adds the one piece of the original issue text that isn't yet exposed:
get_cooldown_remaining(key_id, wallet) -> u64— a convenience view returning seconds until the cooldown expires (0 when inactive). Matches the name used in #1050 verbatim.Changes
creator-keys/src/lib.rsget_cooldown_remaining(key_id, wallet)— thin wrapper overget_cooldown_statusthat returnsexpires_at - now(0 when inactive or unconfigured)creator-keys/tests/trade_cooldown.rstest_get_cooldown_remaining_tracks_window— full duration → half → 0test_get_cooldown_remaining_zero_when_unconfigured— 0 when no cooldowntest_get_cooldown_remaining_is_per_wallet— one wallet's timer doesn't affect another'sTest plan
trade_cooldown.rscargo test -p creator-keys trade_cooldown(CI will verify)