gmgn-cli 1.2.1 → 1.2.3
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 +107 -47
- package/Readme.zh.md +107 -48
- package/dist/client/OpenApiClient.d.ts +4 -2
- package/dist/client/OpenApiClient.d.ts.map +1 -1
- package/dist/client/OpenApiClient.js +6 -7
- package/dist/client/OpenApiClient.js.map +1 -1
- package/dist/commands/swap.js +6 -6
- package/dist/commands/swap.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -2
- package/dist/config.js.map +1 -1
- package/package.json +1 -1
- package/skills/gmgn-cooking/SKILL.md +40 -23
- package/skills/gmgn-market/SKILL.md +1 -0
- package/skills/gmgn-portfolio/SKILL.md +25 -1
- package/skills/gmgn-swap/SKILL.md +129 -37
- package/skills/gmgn-token/SKILL.md +28 -1
- package/skills/gmgn-track/SKILL.md +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.js","sourceRoot":"","sources":["../../src/commands/swap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAA0D,MAAM,4BAA4B,CAAC;AACnH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEtG,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,qBAAqB,CAAC;SAClC,cAAc,CAAC,iBAAiB,EAAE,gCAAgC,CAAC;SACnE,cAAc,CAAC,kBAAkB,EAAE,6CAA6C,CAAC;SACjF,cAAc,CAAC,yBAAyB,EAAE,8BAA8B,CAAC;SACzE,cAAc,CAAC,0BAA0B,EAAE,+BAA+B,CAAC;SAC3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CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAMD,wBAAgB,SAAS,CAAC,iBAAiB,UAAQ,GAAG,MAAM,CAyB3D"}
|
package/dist/config.js
CHANGED
|
@@ -5,10 +5,11 @@ import { join } from "path";
|
|
|
5
5
|
loadDotenv({ path: join(homedir(), ".config", "gmgn", ".env") });
|
|
6
6
|
loadDotenv({ override: true });
|
|
7
7
|
let _config = null;
|
|
8
|
+
const PRIVATE_KEY_REQUIRED_MSG = "GMGN_PRIVATE_KEY is required for critical-auth commands (swap and all order commands)";
|
|
8
9
|
export function getConfig(requirePrivateKey = false) {
|
|
9
10
|
if (_config) {
|
|
10
11
|
if (requirePrivateKey && !_config.privateKeyPem) {
|
|
11
|
-
die(
|
|
12
|
+
die(PRIVATE_KEY_REQUIRED_MSG);
|
|
12
13
|
}
|
|
13
14
|
return _config;
|
|
14
15
|
}
|
|
@@ -23,7 +24,7 @@ export function getConfig(requirePrivateKey = false) {
|
|
|
23
24
|
privateKeyPem = privateKey.replace(/\\n/g, "\n");
|
|
24
25
|
}
|
|
25
26
|
else if (requirePrivateKey) {
|
|
26
|
-
die(
|
|
27
|
+
die(PRIVATE_KEY_REQUIRED_MSG);
|
|
27
28
|
}
|
|
28
29
|
const host = process.env.GMGN_HOST ?? "https://openapi.gmgn.ai";
|
|
29
30
|
_config = { apiKey: apiKey, privateKeyPem, host };
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,+FAA+F;AAC/F,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AACjE,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAQ/B,IAAI,OAAO,GAAkB,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,+FAA+F;AAC/F,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AACjE,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAQ/B,IAAI,OAAO,GAAkB,IAAI,CAAC;AAClC,MAAM,wBAAwB,GAC5B,uFAAuF,CAAC;AAE1F,MAAM,UAAU,SAAS,CAAC,iBAAiB,GAAG,KAAK;IACjD,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,iBAAiB,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YAChD,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,aAAiC,CAAC;IACtC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAChD,IAAI,UAAU,EAAE,CAAC;QACf,+DAA+D;QAC/D,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;SAAM,IAAI,iBAAiB,EAAE,CAAC;QAC7B,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,yBAAyB,CAAC;IAChE,OAAO,GAAG,EAAE,MAAM,EAAE,MAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACnD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,GAAG,CAAC,GAAW;IACtB,OAAO,CAAC,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -66,6 +66,12 @@ When the user names a platform colloquially (e.g. "pump.fun", "four.meme", "Panc
|
|
|
66
66
|
- `cooking create`: Both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` must be configured in `~/.config/gmgn/.env`. The private key must correspond to the wallet bound to the API Key.
|
|
67
67
|
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
|
|
68
68
|
|
|
69
|
+
**IMPORTANT — Credential lookup order:** `gmgn-cli` loads `~/.config/gmgn/.env` first, then overlays any `.env` found in the **current working directory** (project-level overrides global). If credentials appear missing or wrong, check whether a `.env` in the workspace directory is shadowing the global config:
|
|
70
|
+
```bash
|
|
71
|
+
ls -la .env 2>/dev/null && echo "WARNING: local .env is overriding ~/.config/gmgn/.env"
|
|
72
|
+
```
|
|
73
|
+
If a local `.env` exists but lacks `GMGN_API_KEY` / `GMGN_PRIVATE_KEY`, either add them to that file or remove it so the global config is used.
|
|
74
|
+
|
|
69
75
|
## Rate Limit Handling
|
|
70
76
|
|
|
71
77
|
All cooking routes go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second.
|
|
@@ -78,6 +84,7 @@ All cooking routes go through GMGN's leaky-bucket limiter with `rate=10` and `ca
|
|
|
78
84
|
When a request returns `429`:
|
|
79
85
|
|
|
80
86
|
- Read `X-RateLimit-Reset` from the response headers — Unix timestamp for when the limit resets.
|
|
87
|
+
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
|
|
81
88
|
- `cooking create` is a real transaction: **never loop or auto-resubmit** after a `429`. Wait until the reset time, then ask for confirmation again before retrying.
|
|
82
89
|
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during cooldown extend the ban by 5 seconds each time, up to 5 minutes.
|
|
83
90
|
|
|
@@ -160,7 +167,7 @@ Token creation is **asynchronous**. If the initial `cooking create` response sho
|
|
|
160
167
|
```bash
|
|
161
168
|
gmgn-cli order get --chain <chain> --order-id <order_id>
|
|
162
169
|
```
|
|
163
|
-
2. The new token's contract / mint address is in the **`output_token`** field of the `order get` response — it is NOT returned by `cooking create` directly.
|
|
170
|
+
2. The new token's contract / mint address is in the **`report.output_token`** field of the `order get` response (only present when `state = 30` and `status = "successful"`) — it is NOT returned by `cooking create` directly.
|
|
164
171
|
3. Stop polling once `status` is `confirmed`, `failed`, or `expired`.
|
|
165
172
|
4. On `confirmed`: display `output_token` as the token address and include the block explorer link.
|
|
166
173
|
5. On `failed` / `expired`: report the `error_status` and do not retry automatically.
|
|
@@ -270,13 +277,15 @@ Block explorer links:
|
|
|
270
277
|
|
|
271
278
|
## Guided Launch Flow
|
|
272
279
|
|
|
273
|
-
When a user says they want to launch / create / deploy a token but has not provided all required information,
|
|
280
|
+
When a user says they want to launch / create / deploy a token but has not provided all required information, collect information **one required field at a time** — never bundle multiple required fields into a single question. The user should be able to reply with a single value, not a labeled list.
|
|
281
|
+
|
|
282
|
+
Ask each required field as a short, direct question. Wait for the answer before moving to the next. Optional fields are grouped into one question after all required fields are collected.
|
|
274
283
|
|
|
275
284
|
### Step 1 — Chain & Platform
|
|
276
285
|
|
|
277
|
-
Ask: *"Which chain and platform
|
|
286
|
+
Ask: *"Which chain and platform?"*
|
|
278
287
|
|
|
279
|
-
Show the
|
|
288
|
+
Show the options concisely:
|
|
280
289
|
|
|
281
290
|
| Chain | Platform | `--dex` |
|
|
282
291
|
|-------|----------|---------|
|
|
@@ -294,39 +303,47 @@ Show the available options:
|
|
|
294
303
|
| Base | Flaunch | `flaunch` |
|
|
295
304
|
| Base | Virtuals | `virtuals_v2` |
|
|
296
305
|
|
|
297
|
-
If the user is unsure, recommend: **Pump.fun (SOL)** or **FourMeme (BSC)
|
|
298
|
-
|
|
299
|
-
### Step 2 — Token Identity
|
|
306
|
+
If the user is unsure, recommend: **Pump.fun (SOL)** or **FourMeme (BSC)**.
|
|
300
307
|
|
|
301
|
-
|
|
308
|
+
### Step 2 — Token Name
|
|
302
309
|
|
|
303
|
-
*"
|
|
310
|
+
Ask: *"Token name?"*
|
|
304
311
|
|
|
305
|
-
|
|
306
|
-
- Symbol: short uppercase ticker, typically 3–8 characters (e.g. `DOGEK`)
|
|
307
|
-
- Description: optional but recommended — a one-line pitch shown on the launchpad
|
|
312
|
+
Wait for the user's reply (e.g. `Doge Killer`).
|
|
308
313
|
|
|
309
|
-
### Step 3 —
|
|
314
|
+
### Step 3 — Token Symbol
|
|
310
315
|
|
|
311
|
-
Ask: *"
|
|
316
|
+
Ask: *"Ticker symbol?"*
|
|
312
317
|
|
|
313
|
-
|
|
314
|
-
- If the user provides a **URL**: use `--image-url` directly.
|
|
315
|
-
- If the user has no logo: note that most platforms accept a launch without one, but it significantly reduces visibility. Ask if they want to proceed without it.
|
|
318
|
+
Wait for the user's reply (e.g. `DOGEK`). Typically 3–8 uppercase characters.
|
|
316
319
|
|
|
317
|
-
### Step 4 —
|
|
320
|
+
### Step 4 — Logo
|
|
318
321
|
|
|
319
|
-
Ask: *"
|
|
322
|
+
Ask: *"Logo image? (file path or URL — skip to launch without one)"*
|
|
320
323
|
|
|
321
|
-
|
|
324
|
+
- **File path** → silently run `base64 -i <path>` and pass the result to `--image`. Do not mention "base64" to the user.
|
|
325
|
+
- **URL** → use `--image-url` directly.
|
|
326
|
+
- **Skip / none** → proceed without a logo. Note that most platforms accept this, but it reduces visibility.
|
|
322
327
|
|
|
323
328
|
### Step 5 — Initial Buy Amount
|
|
324
329
|
|
|
325
|
-
Ask: *"How much {SOL / BNB / ETH}
|
|
330
|
+
Ask: *"How much {SOL / BNB / ETH} for the initial buy?"*
|
|
331
|
+
|
|
332
|
+
Pass the user's answer directly to `--buy-amt` — already in full token units (e.g. `0.01` = 0.01 SOL). Do NOT convert to lamports or wei.
|
|
333
|
+
|
|
334
|
+
### Step 6 — Optional Details (single question)
|
|
335
|
+
|
|
336
|
+
Ask all optional fields together in one message:
|
|
337
|
+
|
|
338
|
+
*"Any optional extras? (skip any you don't need)"*
|
|
339
|
+
- *Description* — one-line pitch shown on the launchpad
|
|
340
|
+
- *Twitter* — Twitter / X URL
|
|
341
|
+
- *Telegram* — Telegram group URL
|
|
342
|
+
- *Website* — project website URL
|
|
326
343
|
|
|
327
|
-
|
|
344
|
+
The user can reply with just the ones they have, or say "skip" / "none" to proceed.
|
|
328
345
|
|
|
329
|
-
### Step
|
|
346
|
+
### Step 7 — Confirmation & Execute
|
|
330
347
|
|
|
331
348
|
Once all information is collected, present the pre-create confirmation summary (see Output Format section) and wait for the user to reply "confirm" before executing.
|
|
332
349
|
|
|
@@ -71,6 +71,7 @@ All market routes used by this skill go through GMGN's leaky-bucket limiter with
|
|
|
71
71
|
When a request returns `429`:
|
|
72
72
|
|
|
73
73
|
- Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
|
|
74
|
+
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
|
|
74
75
|
- 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.
|
|
75
76
|
- 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.
|
|
76
77
|
|
|
@@ -64,6 +64,7 @@ All portfolio routes used by this skill go through GMGN's leaky-bucket limiter w
|
|
|
64
64
|
When a request returns `429`:
|
|
65
65
|
|
|
66
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
|
+
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
|
|
67
68
|
- 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
69
|
- 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
|
|
|
@@ -211,6 +212,28 @@ The response is an object (or array for batch). Key fields:
|
|
|
211
212
|
| `sell_count` | Number of sell transactions |
|
|
212
213
|
| `pnl` | Profit/loss ratio = `realized_profit / total_cost` |
|
|
213
214
|
|
|
215
|
+
The response also includes a `common` object when available (absent if the upstream identity service is unavailable):
|
|
216
|
+
|
|
217
|
+
| Field | Description |
|
|
218
|
+
|-------|-------------|
|
|
219
|
+
| `common.avatar` | Wallet avatar URL |
|
|
220
|
+
| `common.name` | Display name |
|
|
221
|
+
| `common.ens` | ENS domain (EVM chains only) |
|
|
222
|
+
| `common.tag` | Primary wallet tag |
|
|
223
|
+
| `common.tags` | All wallet tags (e.g. `["smart_money"]`) |
|
|
224
|
+
| `common.twitter_username` | Twitter handle |
|
|
225
|
+
| `common.twitter_name` | Twitter display name |
|
|
226
|
+
| `common.followers_count` | Twitter follower count |
|
|
227
|
+
| `common.is_blue_verified` | Twitter blue-verified badge |
|
|
228
|
+
| `common.follow_count` | Number of GMGN users following this wallet |
|
|
229
|
+
| `common.remark_count` | Number of GMGN users who have remarked this wallet |
|
|
230
|
+
| `common.created_token_count` | Tokens created by this wallet |
|
|
231
|
+
| `common.fund_from` | Funding source label |
|
|
232
|
+
| `common.fund_from_address` | Address that funded this wallet |
|
|
233
|
+
| `common.fund_amount` | Funding amount |
|
|
234
|
+
|
|
235
|
+
Use `common.tags` and `common.twitter_username` when building a wallet profile narrative. If `common` is absent in the response, omit identity fields silently — do not report it as an error.
|
|
236
|
+
|
|
214
237
|
**Do NOT guess field names not listed here.** If a field appears in the response but is not in this table, do not interpret it without reading the raw output first.
|
|
215
238
|
|
|
216
239
|
## Output Format
|
|
@@ -250,9 +273,10 @@ Win Rate: {winrate × 100}%
|
|
|
250
273
|
Total Spent: ${total_cost}
|
|
251
274
|
Buys / Sells: {buy_count} / {sell_count}
|
|
252
275
|
PnL Ratio: {pnl}x
|
|
276
|
+
[Identity: {common.name or common.twitter_username} | Tags: {common.tags}]
|
|
253
277
|
```
|
|
254
278
|
|
|
255
|
-
For batch queries (multiple wallets), present one summary block per wallet.
|
|
279
|
+
Show the `[Identity: ...]` line only if `common` is present in the response. For batch queries (multiple wallets), present one summary block per wallet.
|
|
256
280
|
|
|
257
281
|
## Notes
|
|
258
282
|
|
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
|
|
13
13
|
**⚠️ IPv6 NOT SUPPORTED: If you get a `401` or `403` error and credentials look correct, check for IPv6 immediately: (1) list all network interfaces and their IPv6 addresses — run `ifconfig | grep inet6` (macOS) or `ip addr show | grep inet6` (Linux); (2) send a test request to `https://ipv6.icanhazip.com` — if the response is an IPv6 address, outbound traffic is going via IPv6. Tell the user immediately: "Please disable IPv6 on your network interface — gmgn-cli commands only work over IPv4."**
|
|
14
14
|
|
|
15
|
-
Use the `gmgn-cli` tool to submit a token swap or query an existing order.
|
|
15
|
+
Use the `gmgn-cli` tool to submit a token swap or query an existing order. `GMGN_API_KEY` is always required. `GMGN_PRIVATE_KEY` is required for critical-auth commands such as `swap` and all `order` subcommands, including `order quote`.
|
|
16
16
|
|
|
17
17
|
## Core Concepts
|
|
18
18
|
|
|
@@ -24,19 +24,19 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Req
|
|
|
24
24
|
|
|
25
25
|
- **Currency tokens** — Each chain has designated currency tokens (SOL, BNB, ETH, USDC). These are the base assets used to buy other tokens or receive swap proceeds. Their contract addresses are fixed — look them up in the Chain Currencies table, never guess them.
|
|
26
26
|
|
|
27
|
-
- **Anti-MEV** — MEV (Miner/Maximal Extractable Value) refers to frontrunning and sandwich attacks where bots exploit pending transactions. `--anti-mev` routes the transaction through protected channels to reduce this risk.
|
|
27
|
+
- **Anti-MEV** — MEV (Miner/Maximal Extractable Value) refers to frontrunning and sandwich attacks where bots exploit pending transactions. `--anti-mev` routes the transaction through protected channels to reduce this risk. **Recommended: always enable.** Default: on.
|
|
28
28
|
|
|
29
|
-
- **Critical auth** — `swap`
|
|
29
|
+
- **Critical auth** — `swap` and all `order` subcommands require both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY`. The private key never leaves the machine — the CLI uses it only for local signing and sends only the resulting signature.
|
|
30
30
|
|
|
31
31
|
- **`order_id` / `status`** — After submitting a swap, the response includes an `order_id`. Use `order get --order-id` to poll for final status. Possible values: `pending` → `processed` → `confirmed` (success) or `failed` / `expired`. Do not report success until status is `confirmed`.
|
|
32
32
|
|
|
33
|
-
- **`
|
|
33
|
+
- **`report.input_amount` / `report.output_amount`** — Actual amounts consumed/received, in smallest unit. Only present when `state = 30` and `status = "successful"`. Convert to human-readable using `report.input_token_decimals` / `report.output_token_decimals` before displaying to the user.
|
|
34
34
|
|
|
35
35
|
## Financial Risk Notice
|
|
36
36
|
|
|
37
37
|
**This skill executes REAL, IRREVERSIBLE blockchain transactions.**
|
|
38
38
|
|
|
39
|
-
- Every `swap` command submits an on-chain transaction that moves real funds.
|
|
39
|
+
- Every `swap` and `order strategy create` command submits an on-chain transaction that moves real funds.
|
|
40
40
|
- Transactions cannot be undone once confirmed on-chain.
|
|
41
41
|
- The AI agent must **never auto-execute a swap** — explicit user confirmation is required every time, without exception.
|
|
42
42
|
- Only use this skill with funds you are willing to trade. Start with small amounts when testing.
|
|
@@ -46,10 +46,10 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Req
|
|
|
46
46
|
| Sub-command | Description |
|
|
47
47
|
|-------------|-------------|
|
|
48
48
|
| `swap` | Submit a token swap |
|
|
49
|
-
| `order quote` | Get a swap quote (no transaction submitted) |
|
|
49
|
+
| `order quote` | Get a swap quote (no transaction submitted; requires critical auth) |
|
|
50
50
|
| `order get` | Query order status |
|
|
51
51
|
| `order strategy create` | Create a limit/strategy order (requires private key) |
|
|
52
|
-
| `order strategy list` | List strategy orders (
|
|
52
|
+
| `order strategy list` | List strategy orders (requires private key) |
|
|
53
53
|
| `order strategy cancel` | Cancel a strategy order (requires private key) |
|
|
54
54
|
|
|
55
55
|
## Supported Chains
|
|
@@ -70,7 +70,7 @@ Currency tokens are the base/native assets of each chain. They are used to buy o
|
|
|
70
70
|
|
|
71
71
|
## Prerequisites
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
`GMGN_API_KEY` must be configured in `~/.config/gmgn/.env`. `GMGN_PRIVATE_KEY` is additionally required for `swap` and all `order` subcommands. The private key must correspond to the wallet bound to the API Key.
|
|
74
74
|
|
|
75
75
|
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
|
|
76
76
|
|
|
@@ -87,6 +87,7 @@ All swap-related routes used by this skill go through GMGN's leaky-bucket limite
|
|
|
87
87
|
When a request returns `429`:
|
|
88
88
|
|
|
89
89
|
- Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
|
|
90
|
+
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
|
|
90
91
|
- `swap` is a real transaction: never loop or auto-submit repeated swap attempts after a `429`. Wait until the reset time, then ask for confirmation again before retrying.
|
|
91
92
|
- The CLI may wait and retry once automatically for short cooldowns on read-only commands such as `order quote` and `order get`. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
|
|
92
93
|
- 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.
|
|
@@ -164,7 +165,7 @@ gmgn-cli swap \
|
|
|
164
165
|
|
|
165
166
|
## `order quote` Usage
|
|
166
167
|
|
|
167
|
-
Get an estimated output amount before submitting a swap.
|
|
168
|
+
Get an estimated output amount before submitting a swap. All supported quote chains use critical auth and require `GMGN_PRIVATE_KEY`.
|
|
168
169
|
|
|
169
170
|
```bash
|
|
170
171
|
gmgn-cli order quote \
|
|
@@ -206,33 +207,113 @@ gmgn-cli order get --chain sol --order-id <order_id>
|
|
|
206
207
|
| `--slippage <n>` | No | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — use one or the other. |
|
|
207
208
|
| `--auto-slippage` | No | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
|
|
208
209
|
| `--min-output <n>` | No | Minimum output amount |
|
|
209
|
-
| `--anti-mev` | No | Enable anti-MEV protection
|
|
210
|
+
| `--anti-mev` | No | Enable anti-MEV protection — **recommended**; protects against frontrunning and sandwich attacks. Default: on |
|
|
210
211
|
| `--priority-fee <sol>` | No | Priority fee in SOL (≥ 0.00001, SOL only) |
|
|
211
212
|
| `--tip-fee <n>` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB) |
|
|
212
213
|
| `--max-auto-fee <n>` | No | Max automatic fee cap |
|
|
213
214
|
| `--gas-price <gwei>` | No | Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01) |
|
|
214
215
|
| `--max-fee-per-gas <n>` | No | EIP-1559 max fee per gas (Base only) |
|
|
215
216
|
| `--max-priority-fee-per-gas <n>` | No | EIP-1559 max priority fee per gas (Base only) |
|
|
217
|
+
| `--condition-orders <json>` | No | JSON array of condition sub-orders (take-profit / stop-loss) to attach after a successful swap. **Max 10 sub-orders.** Strategy creation is best-effort: if the swap succeeds but strategy creation fails, the swap result is still returned. See ConditionOrder fields below. |
|
|
218
|
+
| `--sell-ratio-type <type>` | No | Sell ratio basis for `--condition-orders`: `buy_amount` (default) — when triggered, sells a fixed token amount stored at strategy creation time; `hold_amount` — when triggered, sells a fixed percentage of the position held at trigger time |
|
|
216
219
|
|
|
217
|
-
|
|
220
|
+
### ConditionOrder Fields (for `--condition-orders`)
|
|
218
221
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
|
222
|
-
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
227
|
-
| `
|
|
228
|
-
|
|
229
|
-
|
|
222
|
+
Each element in the `--condition-orders` JSON array supports:
|
|
223
|
+
|
|
224
|
+
| Field | Required | Type | Description |
|
|
225
|
+
|-------|----------|------|-------------|
|
|
226
|
+
| `order_type` | Yes | string | Sub-order type: `profit_stop` (fixed take-profit), `loss_stop` (fixed stop-loss), `profit_stop_trace` (trailing take-profit), `loss_stop_trace` (trailing stop-loss) |
|
|
227
|
+
| `side` | Yes | string | Always `"sell"` |
|
|
228
|
+
| `price_scale` | Conditional | string | Gain/drop % from entry. Required for `profit_stop` / `loss_stop` / `profit_stop_trace`; optional for `loss_stop_trace`. For `profit_stop` / `profit_stop_trace`: gain % (e.g. `"100"` = +100% / 2× entry). For `loss_stop` / `loss_stop_trace`: drop % (e.g. `"65"` = drops 65%, triggers at 35% of entry). |
|
|
229
|
+
| `sell_ratio` | Yes | string | Percentage of position to sell when triggered, e.g. `"100"` = 100% |
|
|
230
|
+
| `drawdown_rate` | Conditional | string | Required for `profit_stop_trace` and `loss_stop_trace`. Trailing callback %: after price peaks, how far it must fall before the order fires. E.g. `"50"` = 50% drawdown from peak. |
|
|
231
|
+
|
|
232
|
+
**Example — attach take-profit at 2× (+100%) and stop-loss at -60%:**
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
[
|
|
236
|
+
{"order_type": "profit_stop", "side": "sell", "price_scale": "100", "sell_ratio": "100"},
|
|
237
|
+
{"order_type": "loss_stop", "side": "sell", "price_scale": "60", "sell_ratio": "100"}
|
|
238
|
+
]
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Example — buy token A with 0.01 SOL, take-profit 50% at +100%, take-profit remaining 50% at +300%, stop-loss 100% at -65% (trigger at 35% entry price) (`hold_amount` mode):**
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
gmgn-cli swap \
|
|
245
|
+
--chain sol \
|
|
246
|
+
--from <wallet_address> \
|
|
247
|
+
--input-token So11111111111111111111111111111111111111112 \
|
|
248
|
+
--output-token <token_A_address> \
|
|
249
|
+
--amount 10000000 \
|
|
250
|
+
--slippage 0.3 \
|
|
251
|
+
--anti-mev \
|
|
252
|
+
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
|
|
253
|
+
--sell-ratio-type hold_amount
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
> `price_scale` for `profit_stop`: gain % from entry (`"100"` = +100% / 2×, `"300"` = +300% / 4×). For `loss_stop`: drop % from entry (`"65"` = drops 65%, triggers at 35% of entry).
|
|
257
|
+
> `hold_amount`: the second take-profit fires on whatever is held at trigger time (the remaining 50%). If you added to your position in between, those additional tokens will be included as well.
|
|
258
|
+
|
|
259
|
+
**Same strategy using `buy_amount` mode — fixed percentage of the original bought amount at each trigger:**
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
gmgn-cli swap \
|
|
263
|
+
--chain sol \
|
|
264
|
+
--from <wallet_address> \
|
|
265
|
+
--input-token So11111111111111111111111111111111111111112 \
|
|
266
|
+
--output-token <token_A_address> \
|
|
267
|
+
--amount 10000000 \
|
|
268
|
+
--slippage 0.3 \
|
|
269
|
+
--anti-mev \
|
|
270
|
+
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
|
|
271
|
+
--sell-ratio-type buy_amount
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
> `buy_amount`: each take-profit sells 50% of the **original** bought amount. Stop-loss sells 100% of the original bought amount.
|
|
275
|
+
|
|
276
|
+
## `swap` / `order get` Response Fields
|
|
277
|
+
|
|
278
|
+
| Field | Type | Description |
|
|
279
|
+
| ------------------- | ------ | ---- |
|
|
280
|
+
| `order_id` | string | Order ID for follow-up queries |
|
|
281
|
+
| `hash` | string | Transaction hash |
|
|
282
|
+
| `status` | string | Order status: `pending` / `processed` / `confirmed` / `failed` / `expired` |
|
|
283
|
+
| `error_code` | string | Error code on failure |
|
|
284
|
+
| `error_status` | string | Error description on failure |
|
|
285
|
+
| `strategy_order_id` | string | Strategy order ID; only present when `--condition-orders` was passed and strategy creation succeeded (best-effort) |
|
|
286
|
+
| `report` | object | Execution report; only present when `state = 30` and `status = "successful"`. See Report Fields below. |
|
|
287
|
+
|
|
288
|
+
### Report Fields (present only when `status = "successful"`)
|
|
289
|
+
|
|
290
|
+
| Field | Type | Description |
|
|
291
|
+
| ----------------------- | ------- | ---- |
|
|
292
|
+
| `input_token` | string | Input token contract address |
|
|
293
|
+
| `input_token_decimals` | integer | Input token decimal places |
|
|
294
|
+
| `swap_mode` | string | Swap mode: `ExactIn` / `ExactOut` |
|
|
295
|
+
| `input_amount` | string | Actual input consumed (smallest unit) |
|
|
296
|
+
| `output_token` | string | Output token contract address |
|
|
297
|
+
| `output_token_decimals` | integer | Output token decimal places |
|
|
298
|
+
| `output_amount` | string | Actual output received (smallest unit) |
|
|
299
|
+
| `quote_token` | string | Quote token contract address |
|
|
300
|
+
| `quote_decimals` | integer | Quote token decimal places |
|
|
301
|
+
| `quote_amount` | string | Quote amount (smallest unit) |
|
|
302
|
+
| `base_token` | string | Base token contract address |
|
|
303
|
+
| `base_decimals` | integer | Base token decimal places |
|
|
304
|
+
| `base_amount` | string | Base token amount (smallest unit) |
|
|
305
|
+
| `price` | string | Execution price (quote/base token) |
|
|
306
|
+
| `price_usd` | string | Execution price in USD |
|
|
307
|
+
| `height` | integer | Block height of execution |
|
|
308
|
+
| `order_height` | integer | Block height when order was placed |
|
|
309
|
+
| `gas_native` | string | Gas fee in native token |
|
|
310
|
+
| `gas_usd` | string | Gas fee in USD |
|
|
230
311
|
|
|
231
312
|
## Output Format
|
|
232
313
|
|
|
233
314
|
### Pre-swap Confirmation
|
|
234
315
|
|
|
235
|
-
Before displaying the confirmation, run `order quote` to get the estimated output (
|
|
316
|
+
Before displaying the confirmation, run `order quote` to get the estimated output (requires critical auth and `GMGN_PRIVATE_KEY` on every supported quote chain):
|
|
236
317
|
|
|
237
318
|
```bash
|
|
238
319
|
gmgn-cli order quote \
|
|
@@ -274,13 +355,13 @@ After a confirmed swap, display:
|
|
|
274
355
|
```
|
|
275
356
|
✅ Swap Confirmed
|
|
276
357
|
|
|
277
|
-
Spent: {
|
|
278
|
-
Received: {
|
|
358
|
+
Spent: {report.input_amount in human units} {input symbol}
|
|
359
|
+
Received: {report.output_amount in human units} {output symbol}
|
|
279
360
|
Tx: {explorer link for hash}
|
|
280
361
|
Order ID: {order_id}
|
|
281
362
|
```
|
|
282
363
|
|
|
283
|
-
Convert `
|
|
364
|
+
Convert `report.input_amount` and `report.output_amount` from smallest unit using `report.input_token_decimals` and `report.output_token_decimals` before displaying.
|
|
284
365
|
|
|
285
366
|
## `order strategy create` Parameters
|
|
286
367
|
|
|
@@ -290,22 +371,23 @@ Convert `filled_input_amount` and `filled_output_amount` from smallest unit usin
|
|
|
290
371
|
| `--from` | Yes | Wallet address (must match API Key binding) |
|
|
291
372
|
| `--base-token` | Yes | Base token contract address |
|
|
292
373
|
| `--quote-token` | Yes | Quote token contract address |
|
|
293
|
-
| `--
|
|
374
|
+
| `--order-type` | Yes | Order type: `limit_order` |
|
|
375
|
+
| `--sub-order-type` | Yes | Sub-order type: `buy_low` / `buy_high` / `stop_loss` / `take_profit` |
|
|
294
376
|
| `--check-price` | Yes | Trigger check price |
|
|
295
377
|
| `--amount-in` | No* | Input amount (smallest unit). Mutually exclusive with `--amount-in-percent` |
|
|
296
378
|
| `--amount-in-percent` | No* | Input as percentage (e.g. `50` = 50%). Mutually exclusive with `--amount-in` |
|
|
297
379
|
| `--limit-price-mode` | No | `exact` / `slippage` (default: `slippage`) |
|
|
298
380
|
| `--expire-in` | No | Order expiry in seconds |
|
|
299
|
-
| `--sell-ratio-type` | No | `buy_amount` (default)
|
|
381
|
+
| `--sell-ratio-type` | No | `buy_amount` (default) — when triggered, sells a fixed token amount stored at strategy creation time; `hold_amount` — when triggered, sells a fixed percentage of the position held at trigger time |
|
|
300
382
|
| `--slippage` | No | Slippage tolerance, e.g. `0.01` = 1%. Mutually exclusive with `--auto-slippage` |
|
|
301
383
|
| `--auto-slippage` | No | Enable automatic slippage |
|
|
302
384
|
| `--priority-fee` | No | Priority fee in SOL (SOL only) |
|
|
303
385
|
| `--tip-fee` | No | Tip fee |
|
|
304
|
-
| `--gas-price` | No | Gas price in
|
|
386
|
+
| `--gas-price` | No | Gas price in gwei (BSC ≥ 0.05 gwei / BASE/ETH ≥ 0.01 gwei) |
|
|
305
387
|
| `--anti-mev` | No | Enable anti-MEV protection |
|
|
306
388
|
|
|
307
389
|
|
|
308
|
-
|
|
390
|
+
### `order strategy create` Response Fields
|
|
309
391
|
|
|
310
392
|
| Field | Type | Description |
|
|
311
393
|
|-------|------|-------------|
|
|
@@ -319,11 +401,12 @@ Convert `filled_input_amount` and `filled_output_amount` from smallest unit usin
|
|
|
319
401
|
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
|
320
402
|
| `--type` | No | `open` (default) / `history` |
|
|
321
403
|
| `--from` | No | Filter by wallet address |
|
|
404
|
+
| `--group-tag` | Yes | Filter by order group: `LimitOrder` (limit orders only) / `STMix` (mixed strategy orders: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
|
|
322
405
|
| `--base-token` | No | Filter by token address |
|
|
323
406
|
| `--page-token` | No | Pagination cursor from previous response |
|
|
324
407
|
| `--limit` | No | Results per page (default 10 for history) |
|
|
325
408
|
|
|
326
|
-
|
|
409
|
+
### `order strategy list` Response Fields
|
|
327
410
|
|
|
328
411
|
| Field | Type | Description |
|
|
329
412
|
|-------|------|-------------|
|
|
@@ -338,6 +421,7 @@ Convert `filled_input_amount` and `filled_output_amount` from smallest unit usin
|
|
|
338
421
|
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
|
339
422
|
| `--from` | Yes | Wallet address (must match API Key binding) |
|
|
340
423
|
| `--order-id` | Yes | Order ID to cancel |
|
|
424
|
+
| `--order-type` | No | Order type: `limit_order` (limit order) / `smart_trade` (mixed strategy order: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
|
|
341
425
|
| `--close-sell-model` | No | Sell model when closing the order |
|
|
342
426
|
|
|
343
427
|
## `order strategy` Usage Examples
|
|
@@ -349,6 +433,7 @@ gmgn-cli order strategy create \
|
|
|
349
433
|
--from <wallet_address> \
|
|
350
434
|
--base-token <token_address> \
|
|
351
435
|
--quote-token <sol_address> \
|
|
436
|
+
--order-type limit_order \
|
|
352
437
|
--sub-order-type take_profit \
|
|
353
438
|
--check-price 0.002 \
|
|
354
439
|
--amount-in 1000000 \
|
|
@@ -360,16 +445,23 @@ gmgn-cli order strategy create \
|
|
|
360
445
|
--from <wallet_address> \
|
|
361
446
|
--base-token <token_address> \
|
|
362
447
|
--quote-token <sol_address> \
|
|
448
|
+
--order-type limit_order \
|
|
363
449
|
--sub-order-type stop_loss \
|
|
364
450
|
--check-price 0.0005 \
|
|
365
451
|
--amount-in-percent 100 \
|
|
366
452
|
--slippage 0.01
|
|
367
453
|
|
|
368
|
-
# List open
|
|
369
|
-
gmgn-cli order strategy list --chain sol
|
|
454
|
+
# List open condition orders (profit_stop / loss_stop / trace types) — use STMix
|
|
455
|
+
gmgn-cli order strategy list --chain sol --group-tag STMix
|
|
456
|
+
|
|
457
|
+
# List open limit orders (buy_low / buy_high / stop_loss / take_profit) — use LimitOrder
|
|
458
|
+
gmgn-cli order strategy list --chain sol --group-tag LimitOrder
|
|
459
|
+
|
|
460
|
+
# List condition order history with pagination
|
|
461
|
+
gmgn-cli order strategy list --chain sol --group-tag STMix --type history --limit 20
|
|
370
462
|
|
|
371
|
-
#
|
|
372
|
-
gmgn-cli order strategy list --chain sol --
|
|
463
|
+
# Filter by token
|
|
464
|
+
gmgn-cli order strategy list --chain sol --group-tag STMix --base-token <token_address>
|
|
373
465
|
|
|
374
466
|
# Cancel a strategy order
|
|
375
467
|
gmgn-cli order strategy cancel \
|
|
@@ -383,7 +475,7 @@ gmgn-cli order strategy cancel \
|
|
|
383
475
|
- Swap uses **critical auth** (API Key + signature) — CLI handles signing automatically, no manual processing needed
|
|
384
476
|
- After submitting a swap, use `order get` to poll for confirmation
|
|
385
477
|
- `--amount` is in the **smallest unit** (e.g., lamports for SOL)
|
|
386
|
-
- `order strategy create` and `order strategy cancel` use critical auth (require `GMGN_PRIVATE_KEY`)
|
|
478
|
+
- `order strategy create`, `order strategy list`, and `order strategy cancel` use critical auth (require `GMGN_PRIVATE_KEY`)
|
|
387
479
|
- Use `--raw` to get single-line JSON for further processing
|
|
388
480
|
|
|
389
481
|
## Input Validation
|
|
@@ -431,7 +523,7 @@ For full token research before swapping, see [`docs/workflow-token-research.md`]
|
|
|
431
523
|
- **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.
|
|
432
524
|
- **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.
|
|
433
525
|
- **Credential sensitivity** — `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` can directly execute trades on the linked wallet. Never log, display, or expose these values.
|
|
434
|
-
- **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 `
|
|
526
|
+
- **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 `report.input_amount` and `report.output_amount` (convert from smallest unit using `report.input_token_decimals` / `report.output_token_decimals`), e.g. "Spent 0.1 SOL → received 98.5 USDC" or "Sold 1000 TOKEN → received 0.08 SOL".
|
|
435
527
|
- **Block explorer links** — After a successful swap, display a clickable explorer link for the returned `hash`:
|
|
436
528
|
|
|
437
529
|
| Chain | Explorer |
|