Skip to content

Add sf extend#117

Merged
joshi4 merged 3 commits into
mainfrom
shantanu/metal-36-add-sf-extend-command-to-set-start-time-for-contracts
Apr 17, 2025
Merged

Add sf extend#117
joshi4 merged 3 commits into
mainfrom
shantanu/metal-36-add-sf-extend-command-to-set-start-time-for-contracts

Conversation

@joshi4
Copy link
Copy Markdown
Contributor

@joshi4 joshi4 commented Apr 16, 2025

No description provided.

@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Apr 16, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/lib/buy/index.tsx  15% smaller
  src/lib/contracts/ContractDisplay.tsx  4% smaller
  src/index.ts  0% smaller
  src/lib/contracts/utils.ts  0% smaller
  src/lib/extend/index.tsx  0% smaller

@joshi4 joshi4 force-pushed the shantanu/metal-36-add-sf-extend-command-to-set-start-time-for-contracts branch 3 times, most recently from c027322 to 5e4d0e8 Compare April 16, 2025 19:21
@joshi4
Copy link
Copy Markdown
Contributor Author

joshi4 commented Apr 16, 2025

User flow

image

@joshi4 joshi4 marked this pull request as ready for review April 16, 2025 19:27
@joshi4 joshi4 changed the title wip: sf extend Add sf extend Apr 16, 2025
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 extend command in /src/lib/extend/index.tsx with required options for contract ID (-c) and duration (-d)
  • Introduced getContractRange and getContractAcceleratorQuantity utility functions in /src/lib/contracts/utils.ts for better code organization
  • Exported key components from /src/lib/buy/index.tsx (like QuoteComponent, 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

Comment thread src/lib/extend/index.tsx
@joshi4 joshi4 force-pushed the shantanu/metal-36-add-sf-extend-command-to-set-start-time-for-contracts branch from 5e4d0e8 to 2c5cef4 Compare April 16, 2025 20:25
Comment thread src/lib/extend/index.tsx Outdated
Comment thread src/lib/extend/index.tsx
Comment thread src/lib/extend/index.tsx Outdated
Copy link
Copy Markdown
Contributor

@JohnPhamous JohnPhamous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@joshi4 joshi4 force-pushed the shantanu/metal-36-add-sf-extend-command-to-set-start-time-for-contracts branch from c4117e2 to 8a2895b Compare April 16, 2025 22:13
@joshi4
Copy link
Copy Markdown
Contributor Author

joshi4 commented Apr 16, 2025

@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.

@joshi4
Copy link
Copy Markdown
Contributor Author

joshi4 commented Apr 17, 2025

image

@joshi4 joshi4 merged commit b2a6eae into main Apr 17, 2025
1 check passed
@joshi4 joshi4 deleted the shantanu/metal-36-add-sf-extend-command-to-set-start-time-for-contracts branch April 17, 2025 00:02
Comment thread src/lib/extend/index.tsx
Comment on lines +96 to +98
export function registerExtend(program: Command) {
_registerExtend(program);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bit confused on why you didn't just export registerExtend directly here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants