refactor(track): resolve follow-tokens identity from API Key, drop --wallet

follow-tokens and follow-token-groups now derive user identity server-side
from the API Key principal — callers no longer supply --wallet / wallet_address.

- Remove walletAddress param from getFollowTokens and getFollowGroupNames in OpenApiClient
- Drop --wallet option from track follow-tokens and track follow-token-groups commands
- Update SKILL.md, cli-usage.md, Readme.md, Readme.zh.md accordingly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
David Lau
2026-06-11 11:24:11 +08:00
parent 664ff6c0b1
commit 757105eb0c
6 changed files with 24 additions and 32 deletions
+2 -2
View File
@@ -505,8 +505,8 @@ gmgn-cli portfolio created-tokens --chain sol --wallet <addr>
### Track
```bash
# Followed token map for a wallet
gmgn-cli track follow-tokens --chain sol --wallet <wallet_address>
# Followed token list for the authenticated user
gmgn-cli track follow-tokens --chain sol
# Follow-wallet trade records
gmgn-cli track follow-wallet --chain sol
+2 -2
View File
@@ -529,8 +529,8 @@ gmgn-cli portfolio created-tokens --chain sol --wallet <addr>
### Track
```bash
# 查询钱包收藏的代币列表
gmgn-cli track follow-tokens --chain sol --wallet <wallet_address>
# 查询当前 API Key 绑定用户收藏的代币列表
gmgn-cli track follow-tokens --chain sol
# 追踪关注钱包的交易动态
gmgn-cli track follow-wallet --chain sol
+2 -6
View File
@@ -351,12 +351,11 @@ gmgn-cli market signal --chain sol --groups '<json_array>' [--raw]
## track follow-tokens
Query the followed token list for a wallet. Returns a paginated list of tokens the wallet has bookmarked on GMGN, with full market data. API Key auth only.
Query the followed token list for the authenticated user. Returns a paginated list of tokens the API Key's bound user has bookmarked on GMGN, with full market data. User identity is resolved server-side from the API Key. API Key auth only.
```bash
gmgn-cli track follow-tokens \
--chain <chain> \
--wallet <wallet_address> \
[--group-id <id>] \
[--order-by <field>] \
[--direction <asc|desc>] \
@@ -368,7 +367,6 @@ gmgn-cli track follow-tokens \
| Option | Required | Description |
|--------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
| `--wallet` | Yes | Wallet address |
| `--group-id` | No | `all_group` (all tokens), `default`, or a user-defined group ID |
| `--interval` | No | Time interval for price change stats: `1m` / `5m` / `1h` / `6h` / `24h` |
| `--order-by` | No | `created_at` / `swaps` / `volume` / `market_cap` / `liquidity` / `price` / `open_timestamp` |
@@ -381,19 +379,17 @@ 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.
Query the follow token group names for the authenticated user. Returns the groups the API Key's bound user uses to organise their followed tokens on GMGN. User identity is resolved server-side from the API Key. API Key auth only.
```bash
gmgn-cli track follow-token-groups \
--chain <chain> \
--wallet <wallet_address> \
[--raw]
```
| Option | Required | Description |
|--------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
| `--wallet` | Yes | Wallet address |
---
+10 -12
View File
@@ -1,7 +1,7 @@
---
name: gmgn-track
description: Get real-time crypto buy/sell activity from Smart Money wallets, KOL influencer wallets, and personally followed wallets via GMGN API — alpha signals, whale tracking, meme token copy-trading ideas on Solana, BSC, Base, or Ethereum. Also query which tokens a wallet has followed (bookmarked) on GMGN. Use when user asks what smart money or KOLs are buying, wants whale alerts, on-chain alpha, copy-trade signals, or wants to check a wallet's followed tokens. (For a specific wallet address's portfolio, use gmgn-portfolio.)
argument-hint: "<follow-tokens|follow-wallet|kol|smartmoney> --chain <sol|bsc|base|eth> [--wallet <wallet_address>]"
argument-hint: "<follow-tokens|follow-token-groups|follow-wallet|kol|smartmoney> --chain <sol|bsc|base|eth>"
metadata:
cliHelp: "gmgn-cli track --help"
---
@@ -49,8 +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 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-tokens` | Followed token list for the authenticated user — which tokens the API Key's bound user has bookmarked on GMGN, with full market data |
| `track follow-token-groups` | Follow token group names for the authenticated user — the group names and IDs the bound user 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 |
@@ -105,17 +105,17 @@ When a request returns `429`:
## Usage Examples
```bash
# Followed token list for a wallet on SOL
gmgn-cli track follow-tokens --chain sol --wallet <wallet_address>
# Followed token list for the authenticated user on SOL
gmgn-cli track follow-tokens --chain sol
# Followed token list on BSC, raw JSON output
gmgn-cli track follow-tokens --chain bsc --wallet <wallet_address> --raw
gmgn-cli track follow-tokens --chain bsc --raw
# Follow token group names for a wallet on SOL
gmgn-cli track follow-token-groups --chain sol --wallet <wallet_address>
# Follow token group names for the authenticated user on SOL
gmgn-cli track follow-token-groups --chain sol
# Follow token group names, raw JSON output
gmgn-cli track follow-token-groups --chain sol --wallet <wallet_address> --raw
gmgn-cli track follow-token-groups --chain sol --raw
# Follow-wallet trades (all wallets you follow)
gmgn-cli track follow-wallet --chain sol
@@ -147,7 +147,6 @@ gmgn-cli track smartmoney --chain sol --side sell --limit 10 --raw
| Option | Description |
|--------|-------------|
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
| `--wallet <address>` | Required. Wallet address to query |
| `--group-id <id>` | Filter by group: `all_group` (all tokens across groups), `default` (default group), or a user-defined group ID |
| `--interval <interval>` | Time interval for price change stats (e.g. `1m`, `5m`, `1h`, `6h`, `24h`) |
| `--order-by <field>` | Sort field: `created_at` / `swaps` / `volume` / `market_cap` / `liquidity` / `price` / `open_timestamp` |
@@ -189,7 +188,6 @@ Each item in `followings` contains:
| Option | Description |
|--------|-------------|
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
| `--wallet <address>` | Required. Wallet address to query |
## `track follow-token-groups` Response Fields
@@ -387,7 +385,7 @@ To research any token surfaced by smart money activity, follow [`docs/workflow-t
## Notes
- `track follow-tokens` uses exist auth (API Key only); `--wallet` is required
- `track follow-tokens` and `track follow-token-groups` use exist auth (API Key only); user identity is resolved server-side from the API Key — no `--wallet` needed
- `track follow-wallet` uses signed auth (API Key + private key signature); `track kol` and `track smartmoney` use exist auth (API Key only)
- `track follow-wallet` returns trades from wallets followed on the GMGN platform; the follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional
- Use `--raw` to get single-line JSON for further processing
+4 -4
View File
@@ -436,12 +436,12 @@ export class OpenApiClient {
return this.authSignedRequest("GET", "/v1/trade/follow_wallet", { chain, ...extra }, null);
}
async getFollowTokens(chain: string, walletAddress: string, extra: Record<string, string | number> = {}): Promise<unknown> {
return this.authExistRequest("GET", "/v1/user/follow_tokens", { chain, wallet_address: walletAddress, ...extra });
async getFollowTokens(chain: string, extra: Record<string, string | number> = {}): Promise<unknown> {
return this.authExistRequest("GET", "/v1/user/follow_tokens", { chain, ...extra });
}
async getFollowGroupNames(chain: string, walletAddress: string): Promise<unknown> {
return this.authExistRequest("GET", "/v1/user/follow_token_groups", { chain, wallet_address: walletAddress });
async getFollowGroupNames(chain: string): Promise<unknown> {
return this.authExistRequest("GET", "/v1/user/follow_token_groups", { chain });
}
async getKol(chain?: string, limit?: number): Promise<unknown> {
+4 -6
View File
@@ -9,9 +9,8 @@ export function registerTrackCommands(program: Command): void {
track
.command("follow-tokens")
.description("Get the followed token list for a wallet on a given chain")
.description("Get the followed token list for the authenticated user on a given chain")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
.requiredOption("--wallet <address>", "Wallet address")
.option("--group-id <id>", "Filter by group: all_group (all), default, or a user-defined group ID")
.option("--interval <interval>", "Time interval for price change stats (e.g. 1m, 5m, 1h, 6h, 24h)")
.option("--order-by <field>", "Sort field: created_at / swaps / volume / market_cap / liquidity / price / open_timestamp")
@@ -31,20 +30,19 @@ export function registerTrackCommands(program: Command): void {
if (opts.cursor) extra["cursor"] = opts.cursor;
if (opts.search) extra["search_text"] = opts.search;
const client = new OpenApiClient(getConfig());
const data = await client.getFollowTokens(opts.chain, opts.wallet, extra).catch(exitOnError);
const data = await client.getFollowTokens(opts.chain, extra).catch(exitOnError);
printResult(data, opts.raw);
});
track
.command("follow-token-groups")
.description("Get the follow token group names for a wallet on a given chain")
.description("Get the follow token group names for the authenticated user on a given chain")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
.requiredOption("--wallet <address>", "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);
const data = await client.getFollowGroupNames(opts.chain).catch(exitOnError);
printResult(data, opts.raw);
});