diff --git a/docs/cli-usage.md b/docs/cli-usage.md index 9a6e35e..e438a20 100644 --- a/docs/cli-usage.md +++ b/docs/cli-usage.md @@ -379,6 +379,24 @@ gmgn-cli track follow-tokens \ --- +## track follow-token-groups + +Query the follow token group names for a wallet. Returns the groups a wallet uses to organise its followed tokens on GMGN. API Key auth only. + +```bash +gmgn-cli track follow-token-groups \ + --chain \ + --wallet \ + [--raw] +``` + +| Option | Required | Description | +|--------|----------|-------------| +| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` | +| `--wallet` | Yes | Wallet address | + +--- + ## portfolio follow-wallet Query follow-wallet trade records. Returns trades from wallets you personally follow on the GMGN platform. The follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional. Signed auth (API Key + private key signature). diff --git a/skills/gmgn-track/SKILL.md b/skills/gmgn-track/SKILL.md index af31987..2c18c99 100644 --- a/skills/gmgn-track/SKILL.md +++ b/skills/gmgn-track/SKILL.md @@ -49,7 +49,8 @@ Use the `gmgn-cli` tool to query on-chain tracking data based on the user's requ | Sub-command | Description | |-------------|-------------| -| `track follow-tokens` | Followed token map for a wallet — which tokens a wallet has bookmarked on GMGN | +| `track follow-tokens` | Followed token list for a wallet — which tokens a wallet has bookmarked on GMGN, with full market data | +| `track follow-token-groups` | Follow token group names for a wallet — the group names and IDs the wallet uses to organise followed tokens | | `track follow-wallet` | Trade records from wallets the user personally follows on GMGN | | `track kol` | Real-time trades from KOL / influencer wallets tagged by GMGN | | `track smartmoney` | Real-time trades from smart money / whale wallets tagged by GMGN | @@ -71,6 +72,7 @@ All tracking routes used by this skill go through GMGN's leaky-bucket limiter wi | Command | Route | Weight | |---------|-------|--------| | `track follow-tokens` | `GET /v1/user/follow_tokens` | 3 | +| `track follow-token-groups` | `GET /v1/user/follow_token_groups` | 1 | | `track follow-wallet` | `GET /v1/trade/follow_wallet` | 3 | | `track kol` | `GET /v1/user/kol` | 1 | | `track smartmoney` | `GET /v1/user/smartmoney` | 1 | @@ -103,12 +105,18 @@ When a request returns `429`: ## Usage Examples ```bash -# Followed token map for a wallet on SOL +# Followed token list for a wallet on SOL gmgn-cli track follow-tokens --chain sol --wallet -# Followed token map on BSC, raw JSON output +# Followed token list on BSC, raw JSON output gmgn-cli track follow-tokens --chain bsc --wallet --raw +# Follow token group names for a wallet on SOL +gmgn-cli track follow-token-groups --chain sol --wallet + +# Follow token group names, raw JSON output +gmgn-cli track follow-token-groups --chain sol --wallet --raw + # Follow-wallet trades (all wallets you follow) gmgn-cli track follow-wallet --chain sol @@ -176,6 +184,24 @@ Each item in `followings` contains: | `group_ids` | Follow groups this token belongs to | | `open_timestamp` | Unix timestamp when trading opened | +## `track follow-token-groups` Options + +| Option | Description | +|--------|-------------| +| `--chain` | Required. `sol` / `bsc` / `base` / `eth` | +| `--wallet
` | Required. Wallet address to query | + +## `track follow-token-groups` Response Fields + +`data` is an array. Each item contains: + +| Field | Description | +|-------|-------------| +| `chain` | Chain the group is on | +| `group_id` | Group identifier (e.g. `default`, or a user-defined ID) | +| `group_name` | Human-readable group name | +| `rank` | Display order / sort rank | + ## `track follow-wallet` Options | Option | Description | diff --git a/src/client/OpenApiClient.ts b/src/client/OpenApiClient.ts index 5dc52f6..906948f 100644 --- a/src/client/OpenApiClient.ts +++ b/src/client/OpenApiClient.ts @@ -438,6 +438,10 @@ export class OpenApiClient { return this.authExistRequest("GET", "/v1/user/follow_tokens", { chain, wallet_address: walletAddress, ...extra }); } + async getFollowGroupNames(chain: string, walletAddress: string): Promise { + return this.authExistRequest("GET", "/v1/user/follow_token_groups", { chain, wallet_address: walletAddress }); + } + async getKol(chain?: string, limit?: number): Promise { const query: Record = {}; if (chain) query["chain"] = chain; diff --git a/src/commands/track.ts b/src/commands/track.ts index 8963211..9506729 100644 --- a/src/commands/track.ts +++ b/src/commands/track.ts @@ -35,6 +35,19 @@ export function registerTrackCommands(program: Command): void { printResult(data, opts.raw); }); + track + .command("follow-token-groups") + .description("Get the follow token group names for a wallet on a given chain") + .requiredOption("--chain ", "Chain: sol / bsc / base / eth") + .requiredOption("--wallet
", "Wallet address") + .option("--raw", "Output raw JSON") + .action(async (opts) => { + validateChain(opts.chain); + const client = new OpenApiClient(getConfig()); + const data = await client.getFollowGroupNames(opts.chain, opts.wallet).catch(exitOnError); + printResult(data, opts.raw); + }); + track .command("follow-wallet") .description("Get follow-wallet trade records")