Add --buy-or-sell option to token who-bought-sold command#347
Merged
Conversation
Allows filtering by BUY or SELL side (defaults to BUY). Passes buy_or_sell in the request body to /api/v1/tgm/who-bought-sold. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TimNooren
reviewed
Mar 26, 2026
| 'who-bought-sold': () => { | ||
| const date = parseDateOption(options.date, days); | ||
| return apiInstance.tokenWhoBoughtSold({ tokenAddress, chain, filters, orderBy, pagination, days, date }); | ||
| const buyOrSell = options['buy-or-sell'] || 'BUY'; |
Contributor
There was a problem hiding this comment.
💭 Should we uppercase the user input so we also accept buy/sell?
TimNooren
previously approved these changes
Mar 26, 2026
kome12
commented
Mar 27, 2026
Contributor
Author
kome12
left a comment
There was a problem hiding this comment.
Good call — applied so buy/sell (lowercase) now work too.
Contributor
Author
|
Good call — applied .toUpperCase() so buy/sell (lowercase) also works now. |
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
The
/api/v1/tgm/who-bought-soldendpoint accepts abuy_or_sellparameter (BUY|SELL), but the CLI never sent it — meaning sell-side data was completely inaccessible.Changes
src/schema.json— addedbuy-or-selloption with enum["BUY", "SELL"], default"BUY"src/cli.js— reads--buy-or-selloption and passes it throughsrc/api.js— includesbuy_or_sellin the request body (default'BUY')src/__tests__/api.test.js+cli.internal.test.js— tests for default and explicit SELLUsage