gmgn-cli 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +146 -66
- package/Readme.zh.md +150 -70
- package/dist/client/OpenApiClient.d.ts +8 -3
- package/dist/client/OpenApiClient.d.ts.map +1 -1
- package/dist/client/OpenApiClient.js +72 -5
- package/dist/client/OpenApiClient.js.map +1 -1
- package/dist/commands/market.d.ts.map +1 -1
- package/dist/commands/market.js +20 -9
- package/dist/commands/market.js.map +1 -1
- package/dist/commands/portfolio.d.ts.map +1 -1
- package/dist/commands/portfolio.js +70 -2
- package/dist/commands/portfolio.js.map +1 -1
- package/dist/commands/swap.d.ts.map +1 -1
- package/dist/commands/swap.js +22 -0
- package/dist/commands/swap.js.map +1 -1
- package/dist/commands/token.d.ts.map +1 -1
- package/dist/commands/token.js +28 -2
- package/dist/commands/token.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/skills/gmgn-market/SKILL.md +33 -20
- package/skills/gmgn-portfolio/SKILL.md +50 -5
- package/skills/gmgn-swap/SKILL.md +43 -7
- package/skills/gmgn-token/SKILL.md +19 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gmgn-market
|
|
3
|
-
description: Query GMGN market data — token K-line (candlestick)
|
|
4
|
-
argument-hint: "kline --chain <sol|bsc|base> --address <token_address> --resolution <1m|5m|15m|1h|4h|1d> [--from <unix_ts>] [--to <unix_ts>] | trending --chain <sol|bsc|base> --interval <1h|
|
|
3
|
+
description: Query GMGN market data — token K-line (candlestick), trending token swap data, and Trenches token lists. Supports sol / bsc / base.
|
|
4
|
+
argument-hint: "kline --chain <sol|bsc|base> --address <token_address> --resolution <1m|5m|15m|1h|4h|1d> [--from <unix_ts>] [--to <unix_ts>] | trending --chain <sol|bsc|base> --interval <1m|5m|1h|6h|24h> | trenches --chain <sol|bsc|base>"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Use the `gmgn-cli` tool to query K-line data for a token
|
|
7
|
+
Use the `gmgn-cli` tool to query K-line data for a token, browse trending tokens, or view Trenches token lists.
|
|
8
8
|
|
|
9
9
|
## Sub-commands
|
|
10
10
|
|
|
@@ -12,6 +12,7 @@ Use the `gmgn-cli` tool to query K-line data for a token or browse trending toke
|
|
|
12
12
|
|-------------|-------------|
|
|
13
13
|
| `market kline` | Token candlestick data |
|
|
14
14
|
| `market trending` | Trending token swap data |
|
|
15
|
+
| `market trenches` | Trenches token lists (new creation, near completion, completed) |
|
|
15
16
|
|
|
16
17
|
## Supported Chains
|
|
17
18
|
|
|
@@ -21,7 +22,7 @@ Use the `gmgn-cli` tool to query K-line data for a token or browse trending toke
|
|
|
21
22
|
|
|
22
23
|
- `.env` file with `GMGN_API_KEY` set
|
|
23
24
|
- Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
|
|
24
|
-
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.0
|
|
25
|
+
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.1.0`
|
|
25
26
|
|
|
26
27
|
## Kline Parameters
|
|
27
28
|
|
|
@@ -42,12 +43,12 @@ Use the `gmgn-cli` tool to query K-line data for a token or browse trending toke
|
|
|
42
43
|
| Option | Description |
|
|
43
44
|
|--------|-------------|
|
|
44
45
|
| `--chain` | Required. `sol` / `bsc` / `base` |
|
|
45
|
-
| `--interval` | Required. `
|
|
46
|
+
| `--interval` | Required. `1m` / `5m` / `1h` / `6h` / `24h` (default `1h`) |
|
|
46
47
|
| `--limit <n>` | Number of results (default 100, max 100) |
|
|
47
|
-
| `--
|
|
48
|
+
| `--order-by <field>` | Sort field: `default` / `swaps` / `marketcap` / `history_highest_market_cap` / `liquidity` / `volume` / `holder_count` / `smart_degen_count` / `renowned_count` / `gas_fee` / `price` / `change1m` / `change5m` / `change1h` / `creation_timestamp` |
|
|
48
49
|
| `--direction <asc\|desc>` | Sort direction (default `desc`) |
|
|
49
|
-
| `--filter <tag...>` | Repeatable filter tags: `
|
|
50
|
-
| `--platform <name...>` | Repeatable platform filter
|
|
50
|
+
| `--filter <tag...>` | Repeatable filter tags (chain-specific). **sol** (defaults: `renounced frozen`): `renounced` / `frozen` / `burn` / `token_burnt` / `has_social` / `not_social_dup` / `not_image_dup` / `dexscr_update_link` / `not_wash_trading` / `is_internal_market` / `is_out_market`. **evm** (defaults: `not_honeypot verified renounced`): `not_honeypot` / `verified` / `renounced` / `locked` / `token_burnt` / `has_social` / `not_social_dup` / `not_image_dup` / `dexscr_update_link` / `is_internal_market` / `is_out_market` |
|
|
51
|
+
| `--platform <name...>` | Repeatable platform filter (chain-specific). **sol**: `Pump.fun` / `pump_mayhem` / `pump_mayhem_agent` / `pump_agent` / `letsbonk` / `bonkers` / `bags` / `memoo` / `liquid` / `bankr` / `zora` / `surge` / `anoncoin` / `moonshot_app` / `wendotdev` / `heaven` / `sugar` / `token_mill` / `believe` / `trendsfun` / `trends_fun` / `jup_studio` / `Moonshot` / `boop` / `xstocks` / `ray_launchpad` / `meteora_virtual_curve` / `pool_ray` / `pool_meteora` / `pool_pump_amm` / `pool_orca`. **bsc**: `fourmeme` / `fourmeme_agent` / `bn_fourmeme` / `flap` / `clanker` / `lunafun` / `pool_uniswap` / `pool_pancake`. **base**: `clanker` / `bankr` / `flaunch` / `zora` / `zora_creator` / `baseapp` / `basememe` / `virtuals_v2` / `klik` |
|
|
51
52
|
|
|
52
53
|
## Usage Examples
|
|
53
54
|
|
|
@@ -73,15 +74,15 @@ gmgn-cli market kline \
|
|
|
73
74
|
# Linux: use $(date -d '24 hours ago' +%s) instead of $(date -v-24H +%s)
|
|
74
75
|
|
|
75
76
|
# Top 20 hot tokens on SOL in the last 1 hour, sorted by volume
|
|
76
|
-
gmgn-cli market trending --chain sol --interval 1h --
|
|
77
|
+
gmgn-cli market trending --chain sol --interval 1h --order-by volume --limit 20
|
|
77
78
|
|
|
78
|
-
# Hot tokens with social links only, not
|
|
79
|
+
# Hot tokens with social links only, verified and not honeypot, on BSC over 24h
|
|
79
80
|
gmgn-cli market trending \
|
|
80
81
|
--chain bsc --interval 24h \
|
|
81
|
-
--filter has_social --filter
|
|
82
|
+
--filter has_social --filter not_honeypot --filter verified
|
|
82
83
|
|
|
83
|
-
# Pump platform tokens on SOL, last 6 hours
|
|
84
|
-
gmgn-cli market trending --chain sol --interval 6h --platform
|
|
84
|
+
# Pump.fun platform tokens on SOL, last 6 hours
|
|
85
|
+
gmgn-cli market trending --chain sol --interval 6h --platform Pump.fun
|
|
85
86
|
|
|
86
87
|
# Raw output for further processing
|
|
87
88
|
gmgn-cli market kline --chain sol --address <addr> \
|
|
@@ -92,13 +93,13 @@ gmgn-cli market kline --chain sol --address <addr> \
|
|
|
92
93
|
|
|
93
94
|
### Step 1 — Fetch trending data
|
|
94
95
|
|
|
95
|
-
Fetch a broad pool with safe filters
|
|
96
|
+
Fetch a broad pool with safe filters:
|
|
96
97
|
|
|
97
98
|
```bash
|
|
98
99
|
gmgn-cli market trending \
|
|
99
100
|
--chain <chain> --interval 1h \
|
|
100
|
-
--
|
|
101
|
-
--filter
|
|
101
|
+
--order-by volume --limit 50 \
|
|
102
|
+
--filter not_honeypot --filter has_social --raw
|
|
102
103
|
```
|
|
103
104
|
|
|
104
105
|
### Step 2 — AI multi-factor analysis
|
|
@@ -107,7 +108,6 @@ Analyze each record in the response using the following signals (apply judgment,
|
|
|
107
108
|
|
|
108
109
|
| Signal | Field(s) | Weight | Notes |
|
|
109
110
|
|--------|----------|--------|-------|
|
|
110
|
-
| GMGN quality score | `score` | High | Primary ranking signal from GMGN |
|
|
111
111
|
| Smart money interest | `smart_degen_count`, `renowned_count` | High | Key conviction indicator |
|
|
112
112
|
| Bluechip ownership | `bluechip_owner_percentage` | Medium | Quality of holder base |
|
|
113
113
|
| Real trading activity | `volume`, `swaps` | Medium | Distinguishes genuine interest from wash trading |
|
|
@@ -115,7 +115,7 @@ Analyze each record in the response using the following signals (apply judgment,
|
|
|
115
115
|
| Pool safety | `liquidity` | Medium | Low liquidity = high slippage risk |
|
|
116
116
|
| Token maturity | `creation_timestamp` | Low | Avoid tokens less than ~1h old unless other signals are very strong |
|
|
117
117
|
|
|
118
|
-
Select the **top 5** tokens with the best composite profile. Prefer tokens that
|
|
118
|
+
Select the **top 5** tokens with the best composite profile. Prefer tokens that perform well across multiple signals rather than excelling in just one.
|
|
119
119
|
|
|
120
120
|
### Step 3 — Present top 5 to user
|
|
121
121
|
|
|
@@ -124,8 +124,8 @@ Present results as a concise table, then give a one-line rationale for each pick
|
|
|
124
124
|
```
|
|
125
125
|
Top 5 Trending Tokens — SOL / 1h
|
|
126
126
|
|
|
127
|
-
# | Symbol | Address (short) |
|
|
128
|
-
1 | ... | ... | ...
|
|
127
|
+
# | Symbol | Address (short) | Smart Degens | Volume | 1h Chg | Reasoning
|
|
128
|
+
1 | ... | ... | ... | ... | ... | Smart money accumulating + high volume
|
|
129
129
|
2 | ...
|
|
130
130
|
...
|
|
131
131
|
```
|
|
@@ -136,6 +136,19 @@ For each token, offer:
|
|
|
136
136
|
- **Deep dive**: `token info` + `token security` for full due diligence
|
|
137
137
|
- **Swap**: execute directly if the user is satisfied with the trending data alone
|
|
138
138
|
|
|
139
|
+
## Trenches Parameters
|
|
140
|
+
|
|
141
|
+
| Parameter | Required | Description |
|
|
142
|
+
|-----------|----------|-------------|
|
|
143
|
+
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
|
144
|
+
|
|
145
|
+
Response fields: `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same fields as `market trending` rank items).
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Trenches token lists on SOL
|
|
149
|
+
gmgn-cli market trenches --chain sol --raw
|
|
150
|
+
```
|
|
151
|
+
|
|
139
152
|
## Notes
|
|
140
153
|
|
|
141
154
|
- `market kline`: `--from` and `--to` are Unix timestamps in **seconds** — CLI converts to milliseconds automatically
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gmgn-portfolio
|
|
3
|
-
description: Query GMGN wallet portfolio — API Key wallet info, holdings, transaction activity, trading stats, and
|
|
4
|
-
argument-hint: "<info|holdings|activity|stats|token-balance> [--chain <sol|bsc|base>] [--wallet <wallet_address>]"
|
|
3
|
+
description: Query GMGN wallet portfolio — API Key wallet info, holdings, transaction activity, trading stats, token balance, follow-wallet trades, KOL trades, and Smart Money trades. Supports sol / bsc / base.
|
|
4
|
+
argument-hint: "<info|holdings|activity|stats|token-balance|follow-wallet|kol|smartmoney> [--chain <sol|bsc|base>] [--wallet <wallet_address>]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Use the `gmgn-cli` tool to query wallet portfolio data based on the user's request.
|
|
@@ -15,6 +15,9 @@ Use the `gmgn-cli` tool to query wallet portfolio data based on the user's reque
|
|
|
15
15
|
| `portfolio activity` | Transaction history |
|
|
16
16
|
| `portfolio stats` | Trading statistics (supports batch) |
|
|
17
17
|
| `portfolio token-balance` | Token balance for a specific token |
|
|
18
|
+
| `portfolio follow-wallet` | Follow-wallet trade records |
|
|
19
|
+
| `portfolio kol` | KOL trade records (SOL chain) |
|
|
20
|
+
| `portfolio smartmoney` | Smart Money trade records (SOL chain) |
|
|
18
21
|
|
|
19
22
|
## Supported Chains
|
|
20
23
|
|
|
@@ -24,7 +27,7 @@ Use the `gmgn-cli` tool to query wallet portfolio data based on the user's reque
|
|
|
24
27
|
|
|
25
28
|
- `.env` file with `GMGN_API_KEY` set
|
|
26
29
|
- Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
|
|
27
|
-
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.0
|
|
30
|
+
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.1.0`
|
|
28
31
|
|
|
29
32
|
## Usage Examples
|
|
30
33
|
|
|
@@ -75,7 +78,7 @@ gmgn-cli portfolio token-balance \
|
|
|
75
78
|
|--------|-------------|
|
|
76
79
|
| `--limit <n>` | Page size (default `20`, max 50) |
|
|
77
80
|
| `--cursor <cursor>` | Pagination cursor |
|
|
78
|
-
| `--order-by <field>` | Sort field: `usd_value` / `
|
|
81
|
+
| `--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`) |
|
|
79
82
|
| `--direction <asc\|desc>` | Sort direction (default `desc`) |
|
|
80
83
|
| `--sell-out` | Include sold-out positions |
|
|
81
84
|
| `--show-small` | Include small-value positions |
|
|
@@ -90,15 +93,57 @@ gmgn-cli portfolio token-balance \
|
|
|
90
93
|
|--------|-------------|
|
|
91
94
|
| `--token <address>` | Filter by token |
|
|
92
95
|
| `--limit <n>` | Page size |
|
|
93
|
-
| `--cursor <cursor>` | Pagination cursor |
|
|
96
|
+
| `--cursor <cursor>` | Pagination cursor (pass the `next` value from the previous response) |
|
|
94
97
|
| `--type <type>` | Repeatable: `buy` / `sell` / `add` / `remove` / `transfer` |
|
|
95
98
|
|
|
99
|
+
The activity response includes a `next` field. Pass it to `--cursor` to fetch the next page.
|
|
100
|
+
|
|
96
101
|
## Stats Options
|
|
97
102
|
|
|
98
103
|
| Option | Description |
|
|
99
104
|
|--------|-------------|
|
|
100
105
|
| `--period <period>` | Stats period: `7d` / `30d` (default `7d`) |
|
|
101
106
|
|
|
107
|
+
## Follow-Wallet Options
|
|
108
|
+
|
|
109
|
+
| Option | Description |
|
|
110
|
+
|--------|-------------|
|
|
111
|
+
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
|
|
112
|
+
| `--wallet <address>` | Filter by wallet address |
|
|
113
|
+
| `--base-token <address>` | Filter by base token address |
|
|
114
|
+
| `--page-token <cursor>` | Pagination cursor |
|
|
115
|
+
| `--limit <n>` | Page size (1–200, default 100) |
|
|
116
|
+
| `--side <side>` | Trade direction filter |
|
|
117
|
+
| `--cost <cost>` | Cost filter |
|
|
118
|
+
| `--filter <tag...>` | Repeatable filter conditions |
|
|
119
|
+
| `--with-balance` | Include balance in response |
|
|
120
|
+
| `--with-security` | Include security info in response |
|
|
121
|
+
| `--min-amount-usd <n>` | Minimum trade amount (USD) |
|
|
122
|
+
| `--max-amount-usd <n>` | Maximum trade amount (USD) |
|
|
123
|
+
| `--is-gray` | Gray mode filter |
|
|
124
|
+
|
|
125
|
+
## KOL / Smart Money Options
|
|
126
|
+
|
|
127
|
+
| Option | Description |
|
|
128
|
+
|--------|-------------|
|
|
129
|
+
| `--limit <n>` | Page size (1–200, default 100) |
|
|
130
|
+
|
|
131
|
+
Both `kol` and `smartmoney` return SOL chain data only — no `--chain` flag needed.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Follow-wallet trades filtered by wallet
|
|
135
|
+
gmgn-cli portfolio follow-wallet --chain sol --wallet <wallet_address>
|
|
136
|
+
|
|
137
|
+
# Follow-wallet with balance info
|
|
138
|
+
gmgn-cli portfolio follow-wallet --chain sol --with-balance --limit 20
|
|
139
|
+
|
|
140
|
+
# KOL trade records
|
|
141
|
+
gmgn-cli portfolio kol --limit 10 --raw
|
|
142
|
+
|
|
143
|
+
# Smart Money trade records
|
|
144
|
+
gmgn-cli portfolio smartmoney --limit 10 --raw
|
|
145
|
+
```
|
|
146
|
+
|
|
102
147
|
## Notes
|
|
103
148
|
|
|
104
149
|
- All portfolio commands use normal auth (API Key only, no signature required)
|
|
@@ -20,6 +20,7 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Req
|
|
|
20
20
|
| Sub-command | Description |
|
|
21
21
|
|-------------|-------------|
|
|
22
22
|
| `swap` | Submit a token swap |
|
|
23
|
+
| `order quote` | Get a swap quote (no transaction submitted) |
|
|
23
24
|
| `order get` | Query order status |
|
|
24
25
|
|
|
25
26
|
## Supported Chains
|
|
@@ -45,7 +46,7 @@ Both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` must be set in `.env`. The private ke
|
|
|
45
46
|
`gmgn-cli` must be installed globally before use (one-time setup):
|
|
46
47
|
|
|
47
48
|
```bash
|
|
48
|
-
npm install -g gmgn-cli@1.0
|
|
49
|
+
npm install -g gmgn-cli@1.1.0
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
### Credential Model
|
|
@@ -92,6 +93,31 @@ gmgn-cli swap \
|
|
|
92
93
|
--percent 50
|
|
93
94
|
```
|
|
94
95
|
|
|
96
|
+
## Quote Usage
|
|
97
|
+
|
|
98
|
+
Get an estimated output amount before submitting a swap. Uses normal auth — no private key required.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
gmgn-cli order quote \
|
|
102
|
+
--chain sol \
|
|
103
|
+
--from <wallet_address> \
|
|
104
|
+
--input-token <input_token_address> \
|
|
105
|
+
--output-token <output_token_address> \
|
|
106
|
+
--amount <input_amount_smallest_unit> \
|
|
107
|
+
--slippage 0.01
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Quote Response Fields
|
|
111
|
+
|
|
112
|
+
| Field | Type | Description |
|
|
113
|
+
|-------|------|-------------|
|
|
114
|
+
| `input_token` | string | Input token contract address |
|
|
115
|
+
| `output_token` | string | Output token contract address |
|
|
116
|
+
| `input_amount` | string | Input amount (smallest unit) |
|
|
117
|
+
| `output_amount` | string | Expected output amount (smallest unit) |
|
|
118
|
+
| `min_output_amount` | string | Minimum output after slippage |
|
|
119
|
+
| `slippage` | number | Actual slippage percentage |
|
|
120
|
+
|
|
95
121
|
## Order Query
|
|
96
122
|
|
|
97
123
|
```bash
|
|
@@ -124,13 +150,9 @@ gmgn-cli order get --chain sol --order-id <order_id>
|
|
|
124
150
|
|-------|------|-------------|
|
|
125
151
|
| `order_id` | string | Order ID for follow-up queries |
|
|
126
152
|
| `hash` | string | Transaction hash |
|
|
127
|
-
| `
|
|
128
|
-
| `confirmation.state` | string | `processed` / `confirmed` / `failed` / `expired` |
|
|
129
|
-
| `confirmation.detail` | string | Confirmation detail message |
|
|
153
|
+
| `status` | string | Order status: `pending` / `processed` / `confirmed` / `failed` / `expired` |
|
|
130
154
|
| `error_code` | string | Error code on failure |
|
|
131
155
|
| `error_status` | string | Error description on failure |
|
|
132
|
-
| `height` | number | Block height of the transaction |
|
|
133
|
-
| `order_height` | number | Block height when the order was placed |
|
|
134
156
|
| `input_token` | string | Input token contract address |
|
|
135
157
|
| `output_token` | string | Output token contract address |
|
|
136
158
|
| `filled_input_amount` | string | Actual input consumed (smallest unit); empty if not filled |
|
|
@@ -160,6 +182,20 @@ Before passing any address or amount to a command:
|
|
|
160
182
|
|
|
161
183
|
4. **User confirmation** — See "Execution Guidelines" below — always present resolved parameters to the user before executing a swap. This creates a human review checkpoint for any unexpected values.
|
|
162
184
|
|
|
185
|
+
## Pre-Swap Safety Check (recommended)
|
|
186
|
+
|
|
187
|
+
Before swapping into an unknown token, verify it is not a honeypot or rug pull:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
curl -s "https://app.maiat.io/api/v1/token/<output_token_address>" | jq '{trustScore: .trustScore, verdict: .verdict, riskFlags: .riskFlags}'
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
- If `verdict` is `"avoid"` → **do NOT proceed** with the swap.
|
|
194
|
+
- If `verdict` is `"caution"` → warn the user about specific `riskFlags` before confirming.
|
|
195
|
+
- If `verdict` is `"proceed"` or `"trusted"` → safe to continue.
|
|
196
|
+
|
|
197
|
+
This check is free, requires no API key, and works for any ERC-20 token on Base. Powered by [Maiat](https://app.maiat.io) — trust infrastructure for on-chain agents.
|
|
198
|
+
|
|
163
199
|
## Execution Guidelines
|
|
164
200
|
|
|
165
201
|
- **Currency resolution** — When the user names a currency (SOL/BNB/ETH/USDC) instead of providing an address, look up its address in the Chain Currencies table and apply it automatically — never ask the user for it.
|
|
@@ -169,7 +205,7 @@ Before passing any address or amount to a command:
|
|
|
169
205
|
- **Percentage sell restriction** — `--percent` is ONLY valid when `input_token` is NOT a currency. Do NOT use `--percent` when `input_token` is SOL/BNB/ETH (native) or USDC. This includes: "sell 50% of my SOL", "use 30% of my BNB to buy X", "spend 50% of my USDC on X" — all unsupported. Explain the restriction to the user and ask for an explicit absolute amount instead.
|
|
170
206
|
- **Chain-wallet compatibility** — SOL addresses are incompatible with EVM chains (bsc/base). Warn the user and abort if the address format does not match the chain.
|
|
171
207
|
- **Credential sensitivity** — `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` can directly execute trades on the linked wallet. Never log, display, or expose these values.
|
|
172
|
-
- **Order polling** — After a swap, if `
|
|
208
|
+
- **Order polling** — After a swap, if `status` is not yet `confirmed` / `failed` / `expired`, poll with `order get` up to 3 times at 5-second intervals before reporting a timeout. Once confirmed, display the trade result using `filled_input_amount` and `filled_output_amount` (convert from smallest unit using token decimals), e.g. "Spent 0.1 SOL → received 98.5 USDC" or "Sold 1000 TOKEN → received 0.08 SOL".
|
|
173
209
|
- **Block explorer links** — After a successful swap, display a clickable explorer link for the returned `hash`:
|
|
174
210
|
|
|
175
211
|
| Chain | Explorer |
|
|
@@ -24,7 +24,25 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
|
|
|
24
24
|
|
|
25
25
|
- `.env` file with `GMGN_API_KEY` set
|
|
26
26
|
- Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
|
|
27
|
-
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.0
|
|
27
|
+
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.1.0`
|
|
28
|
+
|
|
29
|
+
## Info / Security / Pool Options
|
|
30
|
+
|
|
31
|
+
| Option | Description |
|
|
32
|
+
|--------|-------------|
|
|
33
|
+
| `--chain` | Required. `sol` / `bsc` / `base` |
|
|
34
|
+
| `--address` | Required. Token contract address |
|
|
35
|
+
|
|
36
|
+
## Holders / Traders Options
|
|
37
|
+
|
|
38
|
+
| Option | Description |
|
|
39
|
+
|--------|-------------|
|
|
40
|
+
| `--chain` | Required. `sol` / `bsc` / `base` |
|
|
41
|
+
| `--address` | Required. Token contract address |
|
|
42
|
+
| `--limit <n>` | Number of results (default `20`, max `100`) |
|
|
43
|
+
| `--order-by <field>` | Sort field: `amount_percentage` / `profit` / `unrealized_profit` / `buy_volume_cur` / `sell_volume_cur` (default `amount_percentage`) |
|
|
44
|
+
| `--direction <asc\|desc>` | Sort direction (default `desc`) |
|
|
45
|
+
| `--tag <tag>` | Wallet tag filter: `renowned` / `smart_degen` (default `renowned`) |
|
|
28
46
|
|
|
29
47
|
## Usage Examples
|
|
30
48
|
|
|
@@ -39,11 +57,9 @@ gmgn-cli token security --chain sol --address <token_address>
|
|
|
39
57
|
gmgn-cli token pool --chain sol --address <token_address>
|
|
40
58
|
|
|
41
59
|
# Top holders
|
|
42
|
-
gmgn-cli token holders --chain sol --address <token_address>
|
|
43
60
|
gmgn-cli token holders --chain sol --address <token_address> --limit 50
|
|
44
61
|
|
|
45
62
|
# Top traders
|
|
46
|
-
gmgn-cli token traders --chain sol --address <token_address>
|
|
47
63
|
gmgn-cli token traders --chain sol --address <token_address> --limit 50
|
|
48
64
|
|
|
49
65
|
# Raw JSON output (for piping)
|