Compare commits

..
Author SHA1 Message Date
David LauandClaude Sonnet 4.6 757105eb0c 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>
2026-06-11 11:24:11 +08:00
David LauandClaude Sonnet 4.6 664ff6c0b1 feat(track): add follow-token-groups subcommand
Adds `track follow-token-groups` command that calls
GET /v1/user/follow_token_groups to retrieve a wallet's token follow
group names (id, name, rank) for a given chain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:49:53 +08:00
David LauandClaude Sonnet 4.6 21d78d0947 feat(track): add follow-tokens subcommand
Adds gmgn-cli track follow-tokens to query a wallet's followed token
list on a given chain via GET /v1/user/follow_tokens.

- Add getFollowTokens() to OpenApiClient (authExist)
- Add track follow-tokens command with --chain, --wallet (required),
  --group-id, --interval, --order-by, --direction, --limit, --cursor,
  --search optional flags
- Update SKILL.md: sub-commands table, rate limit table (weight 3),
  usage examples, options table, response fields
- Update docs/cli-usage.md and Readme.md / Readme.zh.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:49:53 +08:00
10 changed files with 33 additions and 36 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
+4 -7
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 |
---
@@ -797,7 +793,7 @@ gmgn-cli cooking create \
[--fourmeme-rate-conf <json>] \
[--bags-fee-share-list <json>] \
[--bonk-model <model>] \
[--buy-wallets <json>] [--snip-buy-wallets <json>] \
[--buy-wallets <json>] [--snip-buy-wallets <json>] [--interval-seconds <n>] \
[--buy-trade-config <json>] [--sell-trade-config <json>] [--sell-configs <json>] \
[--raw]
```
@@ -843,6 +839,7 @@ gmgn-cli cooking create \
| `--bonk-model` | No | Bonk model identifier (**bonk DEX only**) |
| `--buy-wallets` | No | Multi-wallet buy config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--snip-buy-wallets` | No | Snipe-buy wallet config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--interval-seconds` | No | Interval between multi-wallet buys in seconds |
| `--buy-trade-config` | No | Buy-side trade config for CondMarket orders as JSON (TradeParam) |
| `--sell-trade-config` | No | Sell-side trade config for auto-sell / pending_sell as JSON (TradeParam) |
| `--sell-configs` | No | Auto-sell strategy list as JSON array (CookingSellConfig[]): `[{"sell_type":"delay_sell","delay_sec":<n>,"sell_ratio":"0.5","wallet_addresses":["<addr>"]}]` |
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "gmgn-cli",
"version": "1.4.4",
"version": "1.4.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gmgn-cli",
"version": "1.4.4",
"version": "1.4.3",
"license": "MIT",
"dependencies": {
"commander": "^12.1.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gmgn-cli",
"version": "1.4.4",
"version": "1.4.3",
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
"type": "module",
"bin": {
+1
View File
@@ -180,6 +180,7 @@ gmgn-cli cooking stats [--raw]
| `--bonk-model` | No | Bonk model identifier (**bonk DEX only**) |
| `--buy-wallets` | No | Multi-wallet buy config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--snip-buy-wallets` | No | Snipe-buy wallet config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--interval-seconds` | No | Interval between multi-wallet buys in seconds |
| `--buy-trade-config` | No | Buy-side trade config for CondMarket orders as JSON (TradeParam) — see Advanced API Fields |
| `--sell-trade-config` | No | Sell-side trade config for auto-sell / pending_sell as JSON (TradeParam) — see Advanced API Fields |
| `--sell-configs` | No | Auto-sell strategy list as JSON array (CookingSellConfig[]) — see Auto-Sell Configuration |
+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
+5 -4
View File
@@ -314,6 +314,7 @@ export interface CreateTokenParams {
// Multi-wallet buy
buy_wallets?: BuyWalletInfo[];
snip_buy_wallets?: BuyWalletInfo[];
interval_seconds?: number;
}
export class OpenApiClient {
@@ -435,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> {
+2
View File
@@ -66,6 +66,7 @@ export function registerCookingCommands(program: Command): void {
// Multi-wallet buy
.option("--buy-wallets <json>", "Multi-wallet buy config as JSON array [{from_address, buy_amt}]")
.option("--snip-buy-wallets <json>", "Snipe-buy wallet config as JSON array [{from_address, buy_amt}]")
.option("--interval-seconds <n>", "Interval between multi-wallet buys in seconds", parseInt)
// CondMarket execution config + auto-sell (JSON)
.option("--buy-trade-config <json>", "Buy-side trade config for CondMarket orders as JSON (TradeParam)")
.option("--sell-trade-config <json>", "Sell-side trade config for auto-sell / pending_sell as JSON (TradeParam)")
@@ -123,6 +124,7 @@ export function registerCookingCommands(program: Command): void {
if (opts.bonkModel) params.bonk_model = opts.bonkModel;
if (opts.buyWallets) params.buy_wallets = JSON.parse(opts.buyWallets);
if (opts.snipBuyWallets) params.snip_buy_wallets = JSON.parse(opts.snipBuyWallets);
if (opts.intervalSeconds != null) params.interval_seconds = opts.intervalSeconds;
if (opts.buyTradeConfig) params.buy_trade_config = JSON.parse(opts.buyTradeConfig);
if (opts.sellTradeConfig) params.sell_trade_config = JSON.parse(opts.sellTradeConfig);
if (opts.sellConfigs) params.sell_configs = JSON.parse(opts.sellConfigs);
+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);
});