Compare commits

..
Author SHA1 Message Date
David LauandClaude Sonnet 4.6 0eee7325f1 fix: move wallet_holdings filter defaults to CLI, remove no-op flags
Portfolio holdings to return empty results for wallets that only have closed positions (issue #21).

Changes:
- Convert --hide-closed, --hide-airdrop, --hide-abnormal to value options with explicit defaults (hide_closed=true, hide_airdrop=true, hide_abnormal=false), so defaults are enforced by the CLI and users can override with e.g. --hide-closed false
- Remove --sell-out and --show-small which are hard-coded in the service and were never forwarded to the upstream API
- Update SKILL.md to reflect new option signatures and defaults

Fixes #21

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 18:30:08 +08:00
6 changed files with 15 additions and 21 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "gmgn-cli",
"version": "1.1.6",
"version": "1.1.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gmgn-cli",
"version": "1.1.6",
"version": "1.1.5",
"license": "MIT",
"dependencies": {
"commander": "^12.1.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gmgn-cli",
"version": "1.1.6",
"version": "1.1.5",
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
"type": "module",
"bin": {
+3 -5
View File
@@ -81,11 +81,9 @@ gmgn-cli portfolio token-balance \
| `--cursor <cursor>` | Pagination cursor |
| `--order-by <field>` | Sort field: `usd_value` / `last_active_timestamp` / `realized_profit` / `unrealized_profit` / `total_profit` / `history_bought_cost` / `history_sold_income` (default `usd_value`) |
| `--direction <asc\|desc>` | Sort direction (default `desc`) |
| `--sell-out` | Include sold-out positions |
| `--show-small` | Include small-value positions |
| `--hide-abnormal` | Hide abnormal positions |
| `--hide-airdrop` | Hide airdrop positions |
| `--hide-closed` | Hide closed positions |
| `--hide-abnormal <bool>` | Hide abnormal positions: `true` / `false` (default: `false`) |
| `--hide-airdrop <bool>` | Hide airdrop positions: `true` / `false` (default: `true`) |
| `--hide-closed <bool>` | Hide closed positions: `true` / `false` (default: `true`) |
| `--hide-open` | Hide open positions |
## `portfolio activity` Options
+1 -1
View File
@@ -47,7 +47,7 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
| `--limit` | No | `20` | Number of results, max `100` |
| `--order-by` | No | `amount_percentage` | Sort field — see table below |
| `--direction` | No | `desc` | Sort direction: `asc` / `desc` |
| `--tag` | No | — | Wallet filter: `renowned` (KOL wallets) / `smart_degen` (smart money). Omit to return all wallets. |
| `--tag` | No | — | Wallet filter: `renowned` (KOL wallets) / `smart_degen` (smart money) |
| `--raw` | No | — | Output raw single-line JSON |
### `--order-by` Values
+6 -10
View File
@@ -17,11 +17,9 @@ export function registerPortfolioCommands(program: Command): void {
.option("--order-by <field>", "Sort field: usd_value / last_active_timestamp / realized_profit / unrealized_profit / total_profit / history_bought_cost / history_sold_income", "usd_value")
.option("--direction <dir>", "Sort direction: asc / desc", "desc")
.option("--interval <interval>", "Stats interval (default 24h)")
.option("--sell-out", "Include sold-out positions")
.option("--show-small", "Include small-value positions")
.option("--hide-abnormal", "Hide abnormal positions")
.option("--hide-airdrop", "Hide airdrop positions")
.option("--hide-closed", "Hide closed positions")
.option("--hide-abnormal <bool>", "Hide abnormal positions (default: false)", "false")
.option("--hide-airdrop <bool>", "Hide airdrop positions (default: true)", "true")
.option("--hide-closed <bool>", "Hide closed positions (default: true)", "true")
.option("--hide-open", "Hide open positions")
.option("--tx30d", "Only show positions with trades in last 30 days")
.option("--raw", "Output raw JSON")
@@ -34,11 +32,9 @@ export function registerPortfolioCommands(program: Command): void {
if (opts.orderBy) extra["order_by"] = opts.orderBy;
if (opts.direction) extra["direction"] = opts.direction;
if (opts.interval) extra["interval"] = opts.interval;
if (opts.sellOut) extra["sell_out"] = "true";
if (opts.showSmall) extra["show_small"] = "true";
if (opts.hideAbnormal) extra["hide_abnormal"] = "true";
if (opts.hideAirdrop) extra["hide_airdrop"] = "true";
if (opts.hideClosed) extra["hide_closed"] = "true";
extra["hide_abnormal"] = opts.hideAbnormal;
extra["hide_airdrop"] = opts.hideAirdrop;
extra["hide_closed"] = opts.hideClosed;
if (opts.hideOpen) extra["hide_open"] = "true";
if (opts.tx30d) extra["tx30d"] = "true";
+2 -2
View File
@@ -57,7 +57,7 @@ export function registerTokenCommands(program: Command): void {
.option("--limit <n>", "Number of results (default 20, max 100)", parseInt)
.option("--order-by <field>", "Sort field: amount_percentage / profit / unrealized_profit / buy_volume_cur / sell_volume_cur", "amount_percentage")
.option("--direction <dir>", "Sort direction: asc / desc", "desc")
.option("--tag <tag>", "Wallet tag filter: renowned / smart_degen")
.option("--tag <tag>", "Wallet tag filter: renowned / smart_degen", "renowned")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);
@@ -80,7 +80,7 @@ export function registerTokenCommands(program: Command): void {
.option("--limit <n>", "Number of results (default 20, max 100)", parseInt)
.option("--order-by <field>", "Sort field: amount_percentage / profit / unrealized_profit / buy_volume_cur / sell_volume_cur", "amount_percentage")
.option("--direction <dir>", "Sort direction: asc / desc", "desc")
.option("--tag <tag>", "Wallet tag filter: renowned / smart_degen")
.option("--tag <tag>", "Wallet tag filter: renowned / smart_degen", "renowned")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);