Add sf extend#117
Merged
joshi4 merged 3 commits intoApr 17, 2025
Merged
Conversation
Changed Files
|
c027322 to
5e4d0e8
Compare
Contributor
Author
Contributor
There was a problem hiding this comment.
PR Summary
This PR introduces a new 'extend' command to the CLI that enables users to extend existing active contracts, with support for duration and price specifications.
- Added new
extendcommand in/src/lib/extend/index.tsxwith required options for contract ID (-c) and duration (-d) - Introduced
getContractRangeandgetContractAcceleratorQuantityutility functions in/src/lib/contracts/utils.tsfor better code organization - Exported key components from
/src/lib/buy/index.tsx(likeQuoteComponent,QuoteAndBuy) to enable reuse in extend functionality - Added validation to ensure only active contracts can be extended, using contract's end time as start time for extension
4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
5e4d0e8 to
2c5cef4
Compare
JohnPhamous
reviewed
Apr 16, 2025
JohnPhamous
reviewed
Apr 16, 2025
JohnPhamous
reviewed
Apr 16, 2025
JohnPhamous
approved these changes
Apr 16, 2025
Contributor
JohnPhamous
left a comment
There was a problem hiding this comment.
looks good!
non-blocking/nice to have: sf clusters ls, for active contracts, should show the extend command so the user can copy and paste it.
Co-authored-by: John Pham <john@pham.codes>
c4117e2 to
8a2895b
Compare
Contributor
Author
|
@JohnPhamous love the idea of putting the extend command in contracts ls - added that in. Will wait for the market to be back up to test. |
Contributor
Author
Comment on lines
+96
to
+98
| export function registerExtend(program: Command) { | ||
| _registerExtend(program); | ||
| } |
Member
There was a problem hiding this comment.
bit confused on why you didn't just export registerExtend directly here?
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.


No description provided.