gmgn-cli 1.1.9 → 1.1.10

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.
@@ -46,9 +46,42 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
46
46
 
47
47
  ## Prerequisites
48
48
 
49
- - `.env` file with `GMGN_API_KEY` set
50
- - Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
51
- - `gmgn-cli` installed globally: `npm install -g gmgn-cli`
49
+ - `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
50
+ - `GMGN_API_KEY` configured in `~/.config/gmgn/.env`
51
+
52
+ ## Rate Limit Handling
53
+
54
+ All token routes used by this skill go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second, and the max burst is roughly `floor(10 ÷ weight)` when the bucket is full.
55
+
56
+ | Command | Route | Weight |
57
+ |---------|-------|--------|
58
+ | `token info` | `GET /v1/token/info` | 1 |
59
+ | `token security` | `GET /v1/token/security` | 1 |
60
+ | `token pool` | `GET /v1/token/pool_info` | 1 |
61
+ | `token holders` | `GET /v1/market/token_top_holders` | 5 |
62
+ | `token traders` | `GET /v1/market/token_top_traders` | 5 |
63
+
64
+ When a request returns `429`:
65
+
66
+ - Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
67
+ - The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
68
+ - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
69
+
70
+ **First-time setup** (if `GMGN_API_KEY` is not configured):
71
+
72
+ 1. Generate key pair and show the public key to the user:
73
+ ```bash
74
+ openssl genpkey -algorithm ed25519 -out /tmp/gmgn_private.pem 2>/dev/null && \
75
+ openssl pkey -in /tmp/gmgn_private.pem -pubout 2>/dev/null
76
+ ```
77
+ Tell the user: *"This is your Ed25519 public key. Go to **https://gmgn.ai/ai**, paste it into the API key creation form, then send me the API Key value shown on the page."*
78
+
79
+ 2. Wait for the user's API key, then configure:
80
+ ```bash
81
+ mkdir -p ~/.config/gmgn
82
+ echo 'GMGN_API_KEY=<key_from_user>' > ~/.config/gmgn/.env
83
+ chmod 600 ~/.config/gmgn/.env
84
+ ```
52
85
 
53
86
  ## Parameters — `token info` / `token security` / `token pool`
54
87
 
@@ -59,10 +59,45 @@ Use the `gmgn-cli` tool to query on-chain tracking data based on the user's requ
59
59
 
60
60
  ## Prerequisites
61
61
 
62
- - `.env` file with `GMGN_API_KEY` set
63
- - `GMGN_PRIVATE_KEY` required for `track follow-wallet` (signature auth); not needed for `track kol` / `track smartmoney`
64
- - Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
65
- - `gmgn-cli` installed globally: `npm install -g gmgn-cli`
62
+ - `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
63
+ - `GMGN_API_KEY` configured in `~/.config/gmgn/.env`
64
+ - `GMGN_PRIVATE_KEY` required only for `track follow-wallet`; not needed for `track kol` / `track smartmoney`
65
+
66
+ ## Rate Limit Handling
67
+
68
+ All tracking routes used by this skill go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second, and the max burst is roughly `floor(10 ÷ weight)` when the bucket is full.
69
+
70
+ | Command | Route | Weight |
71
+ |---------|-------|--------|
72
+ | `track follow-wallet` | `GET /v1/trade/follow_wallet` | 3 |
73
+ | `track kol` | `GET /v1/user/kol` | 1 |
74
+ | `track smartmoney` | `GET /v1/user/smartmoney` | 1 |
75
+
76
+ When a request returns `429`:
77
+
78
+ - Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
79
+ - The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
80
+ - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
81
+
82
+ **First-time setup** (if `GMGN_API_KEY` is not configured):
83
+
84
+ 1. Generate key pair and show the public key to the user:
85
+ ```bash
86
+ openssl genpkey -algorithm ed25519 -out /tmp/gmgn_private.pem 2>/dev/null && \
87
+ openssl pkey -in /tmp/gmgn_private.pem -pubout 2>/dev/null
88
+ ```
89
+ Tell the user: *"This is your Ed25519 public key. Go to **https://gmgn.ai/ai**, paste it into the API key creation form, then send me the API Key value shown on the page."*
90
+
91
+ 2. Wait for the user's API key, then configure:
92
+ ```bash
93
+ mkdir -p ~/.config/gmgn
94
+ echo 'GMGN_API_KEY=<key_from_user>' > ~/.config/gmgn/.env
95
+ chmod 600 ~/.config/gmgn/.env
96
+ ```
97
+ If the user also needs `track follow-wallet`, append the private key:
98
+ ```bash
99
+ echo 'GMGN_PRIVATE_KEY="<pem_content_from_step_1>"' >> ~/.config/gmgn/.env
100
+ ```
66
101
 
67
102
  ## Usage Examples
68
103