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.
- package/Readme.md +117 -24
- package/Readme.zh.md +58 -29
- package/dist/client/OpenApiClient.d.ts +69 -0
- package/dist/client/OpenApiClient.d.ts.map +1 -1
- package/dist/client/OpenApiClient.js +188 -26
- package/dist/client/OpenApiClient.js.map +1 -1
- package/dist/commands/cooking.d.ts +3 -0
- package/dist/commands/cooking.d.ts.map +1 -0
- package/dist/commands/cooking.js +82 -0
- package/dist/commands/cooking.js.map +1 -0
- package/dist/commands/swap.d.ts.map +1 -1
- package/dist/commands/swap.js +135 -0
- package/dist/commands/swap.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/gmgn-cooking/SKILL.md +363 -0
- package/skills/gmgn-market/SKILL.md +34 -3
- package/skills/gmgn-portfolio/SKILL.md +36 -3
- package/skills/gmgn-swap/SKILL.md +136 -5
- package/skills/gmgn-token/SKILL.md +36 -3
- package/skills/gmgn-track/SKILL.md +39 -4
package/Readme.md
CHANGED
|
@@ -10,7 +10,7 @@ English | [简体中文](Readme.zh.md)
|
|
|
10
10
|
|
|
11
11
|
## GMGN Agent Skills
|
|
12
12
|
|
|
13
|
-
With GMGN Agent Skills, you can use AI agents to query real-time trending token rankings across multiple chains, token fundamentals, social media signals, live trading activity, new tokens in Trenches, top holders, top traders, smart money positions, KOL holdings, insider wallets, bundled wallet exposure, and other professional on-chain analytics. It also supports market orders, limit orders, advanced take-profit/stop-loss strategy orders, and wallet management — including real-time holdings, recent P&L, and transaction history — all through natural language.
|
|
13
|
+
With GMGN Agent Skills, you can use AI agents to query real-time trending token rankings across multiple chains, token fundamentals, social media signals, live trading activity, new tokens in Trenches, top holders, top traders, smart money positions, KOL holdings, insider wallets, bundled wallet exposure, and other professional on-chain analytics. It also supports market orders, limit orders, advanced take-profit/stop-loss strategy orders, one-command cooking orders (buy + condition orders in a single flow), and wallet management — including real-time holdings, recent P&L, and transaction history — all through natural language.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -89,7 +89,8 @@ No more scraping web pages or getting blocked by Cloudflare. Query all the profe
|
|
|
89
89
|
| [`/gmgn-market`](skills/gmgn-market/SKILL.md) | K-line market data, trending tokens | [SKILL.md](skills/gmgn-market/SKILL.md) |
|
|
90
90
|
| [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | Wallet holdings, activity, stats | [SKILL.md](skills/gmgn-portfolio/SKILL.md) |
|
|
91
91
|
| [`/gmgn-track`](skills/gmgn-track/SKILL.md) | Follow-wallet trades, KOL trades, Smart Money trades | [SKILL.md](skills/gmgn-track/SKILL.md) |
|
|
92
|
-
| [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | Swap submission + order query | [SKILL.md](skills/gmgn-swap/SKILL.md) |
|
|
92
|
+
| [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | Swap submission + limit orders + strategy orders + order query | [SKILL.md](skills/gmgn-swap/SKILL.md) |
|
|
93
|
+
| [`/gmgn-cooking`](skills/gmgn-cooking/SKILL.md) | One-command cooking orders (buy + take-profit/stop-loss in a single flow) | [SKILL.md](skills/gmgn-cooking/SKILL.md) |
|
|
93
94
|
|
|
94
95
|
> For detailed CLI commands, parameters, and recommended values, see the [Wiki documentation](https://github.com/GMGNAI/gmgn-skills/wiki).
|
|
95
96
|
|
|
@@ -99,7 +100,7 @@ No more scraping web pages or getting blocked by Cloudflare. Query all the profe
|
|
|
99
100
|
|
|
100
101
|
Ready to install? [Jump to Installation →](#1-installation)
|
|
101
102
|
|
|
102
|
-
Already installed? [Upgrade Skills and CLI →](#
|
|
103
|
+
Already installed? [Upgrade Skills and CLI →](#10-upgrade-skills-and-cli)
|
|
103
104
|
|
|
104
105
|
> **Tip:** If your AI agent tries to open or scrape the gmgn.ai website instead of using the CLI, add this to your prompt: `Use gmgn-cli commands. Do not call gmgn.ai web endpoints directly.`
|
|
105
106
|
|
|
@@ -176,9 +177,10 @@ If output appears without error, setup is complete.
|
|
|
176
177
|
|
|
177
178
|
## Upgrade (AI Agent)
|
|
178
179
|
|
|
179
|
-
> Run
|
|
180
|
+
> Run these two commands to upgrade both the CLI and Skills to the latest version.
|
|
180
181
|
|
|
181
182
|
```bash
|
|
183
|
+
npm install -g gmgn-cli
|
|
182
184
|
npx skills add GMGNAI/gmgn-skills
|
|
183
185
|
```
|
|
184
186
|
|
|
@@ -188,7 +190,7 @@ Check the installed version after upgrading:
|
|
|
188
190
|
gmgn-cli --version
|
|
189
191
|
```
|
|
190
192
|
|
|
191
|
-
> For the full upgrade reference, see [Section
|
|
193
|
+
> For the full upgrade reference, see [Section 10 — Upgrade Skills and CLI](#10-upgrade-skills-and-cli).
|
|
192
194
|
|
|
193
195
|
---
|
|
194
196
|
|
|
@@ -340,7 +342,7 @@ Skills are automatically discovered via the `.cursor-plugin/` configuration.
|
|
|
340
342
|
```bash
|
|
341
343
|
echo "$(npm root -g)/gmgn-skills/skills"
|
|
342
344
|
```
|
|
343
|
-
3. Restart Cline — `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-track`, `/gmgn-swap` will be available
|
|
345
|
+
3. Restart Cline — `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-track`, `/gmgn-swap`, `/gmgn-cooking` will be available
|
|
344
346
|
|
|
345
347
|
#### Codex CLI
|
|
346
348
|
|
|
@@ -373,12 +375,23 @@ Natural language prompts you can send to any AI assistant with gmgn-cli skills i
|
|
|
373
375
|
```
|
|
374
376
|
buy 0.1 SOL of <token_address>
|
|
375
377
|
sell 50% of <token_address> on BSC
|
|
378
|
+
sell 30% of my <token_address> position
|
|
379
|
+
get a quote: how much <token_address> can I get for 1 SOL?
|
|
376
380
|
check order status <order_id>
|
|
377
381
|
is <token_address> safe to buy on solana?
|
|
378
382
|
show top holders of <token_address>
|
|
383
|
+
show smart money holdings of <token_address>, sorted by buy volume
|
|
384
|
+
show recent KOL trades for <token_address>
|
|
379
385
|
show my wallet holdings on SOL
|
|
380
386
|
query token details for 0x1234...
|
|
387
|
+
show 24h K-line and volume for <token_address>
|
|
381
388
|
show trading stats for wallet <wallet_address> on BSC
|
|
389
|
+
show recent trades for wallet <wallet_address>
|
|
390
|
+
which wallets are linked to my API key, and what are their balances
|
|
391
|
+
show the latest smart money trades on SOL
|
|
392
|
+
show what KOLs are buying on SOL
|
|
393
|
+
show newly launched tokens on Solana
|
|
394
|
+
show Solana 1-minute trending tokens
|
|
382
395
|
```
|
|
383
396
|
|
|
384
397
|
### Typical Workflows
|
|
@@ -428,26 +441,26 @@ Full parameter reference: [docs/cli-usage.md](docs/cli-usage.md). All commands s
|
|
|
428
441
|
### Token
|
|
429
442
|
|
|
430
443
|
```bash
|
|
431
|
-
|
|
444
|
+
gmgn-cli token info --chain sol --address <addr>
|
|
432
445
|
```
|
|
433
446
|
|
|
434
447
|
### Market
|
|
435
448
|
|
|
436
449
|
```bash
|
|
437
|
-
|
|
450
|
+
gmgn-cli market trending \
|
|
438
451
|
--chain sol \
|
|
439
452
|
--interval 1h \
|
|
440
453
|
--order-by volume --limit 20 \
|
|
441
454
|
--filter not_risk --filter not_honeypot
|
|
442
455
|
|
|
443
|
-
|
|
456
|
+
gmgn-cli market trenches \
|
|
444
457
|
--chain sol \
|
|
445
458
|
--type new_creation --type near_completion --type completed \
|
|
446
459
|
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform letsbonk \
|
|
447
460
|
--limit 80
|
|
448
461
|
|
|
449
462
|
# With server-side filters: safe preset + require smart money + sort by smart degen count
|
|
450
|
-
|
|
463
|
+
gmgn-cli market trenches \
|
|
451
464
|
--chain sol --type new_creation \
|
|
452
465
|
--filter-preset safe --min-smart-degen-count 1 --sort-by smart_degen_count
|
|
453
466
|
```
|
|
@@ -455,30 +468,89 @@ npx gmgn-cli market trenches \
|
|
|
455
468
|
### Portfolio
|
|
456
469
|
|
|
457
470
|
```bash
|
|
458
|
-
|
|
471
|
+
# Holdings
|
|
472
|
+
gmgn-cli portfolio holdings --chain sol --wallet <addr>
|
|
473
|
+
|
|
474
|
+
# Activity
|
|
475
|
+
gmgn-cli portfolio activity --chain sol --wallet <addr>
|
|
476
|
+
|
|
477
|
+
# Stats (supports multiple wallets)
|
|
478
|
+
gmgn-cli portfolio stats --chain sol --wallet <addr1> --wallet <addr2>
|
|
479
|
+
|
|
480
|
+
# Wallets and balances linked to API key
|
|
481
|
+
gmgn-cli portfolio info
|
|
482
|
+
|
|
483
|
+
# Single token balance
|
|
484
|
+
gmgn-cli portfolio token-balance --chain sol --wallet <addr> --token <token_addr>
|
|
459
485
|
```
|
|
460
486
|
|
|
461
487
|
### Track
|
|
462
488
|
|
|
463
489
|
```bash
|
|
464
490
|
# Follow-wallet trade records (requires GMGN_PRIVATE_KEY)
|
|
465
|
-
|
|
466
|
-
|
|
491
|
+
gmgn-cli track follow-wallet --chain sol
|
|
492
|
+
gmgn-cli track follow-wallet --chain sol --wallet <wallet_address> --side buy
|
|
467
493
|
|
|
468
494
|
# KOL trade records
|
|
469
|
-
|
|
470
|
-
|
|
495
|
+
gmgn-cli track kol --limit 100 --raw
|
|
496
|
+
gmgn-cli track kol --chain sol --side buy --limit 50 --raw
|
|
471
497
|
|
|
472
498
|
# Smart Money trade records
|
|
473
|
-
|
|
474
|
-
|
|
499
|
+
gmgn-cli track smartmoney --limit 100 --raw
|
|
500
|
+
gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### Limit Orders (requires private key)
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
# Create a take-profit order
|
|
507
|
+
gmgn-cli order strategy create \
|
|
508
|
+
--chain sol \
|
|
509
|
+
--from <wallet_address> \
|
|
510
|
+
--base-token <token_address> \
|
|
511
|
+
--quote-token <sol_address> \
|
|
512
|
+
--sub-order-type take_profit \
|
|
513
|
+
--check-price 0.002 \
|
|
514
|
+
--amount-in-percent 100 \
|
|
515
|
+
--slippage 0.01
|
|
516
|
+
|
|
517
|
+
# Create a stop-loss order
|
|
518
|
+
gmgn-cli order strategy create \
|
|
519
|
+
--chain sol \
|
|
520
|
+
--from <wallet_address> \
|
|
521
|
+
--base-token <token_address> \
|
|
522
|
+
--quote-token <sol_address> \
|
|
523
|
+
--sub-order-type stop_loss \
|
|
524
|
+
--check-price 0.0005 \
|
|
525
|
+
--amount-in-percent 100 \
|
|
526
|
+
--slippage 0.01
|
|
527
|
+
|
|
528
|
+
# List open strategy orders
|
|
529
|
+
gmgn-cli order strategy list --chain sol
|
|
530
|
+
|
|
531
|
+
# Cancel a strategy order
|
|
532
|
+
gmgn-cli order strategy cancel --chain sol --from <wallet_address> --order-id <order_id>
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### Cooking (requires private key)
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
# Buy token and automatically attach take-profit + stop-loss condition orders
|
|
539
|
+
gmgn-cli cooking \
|
|
540
|
+
--chain sol \
|
|
541
|
+
--from <wallet_address> \
|
|
542
|
+
--input-token So11111111111111111111111111111111111111112 \
|
|
543
|
+
--output-token <token_address> \
|
|
544
|
+
--amount 1000000000 \
|
|
545
|
+
--slippage 0.1 \
|
|
546
|
+
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"200","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
|
|
475
547
|
```
|
|
476
548
|
|
|
477
549
|
### Swap (requires private key)
|
|
478
550
|
|
|
479
551
|
```bash
|
|
480
552
|
# Submit swap with fixed slippage
|
|
481
|
-
|
|
553
|
+
gmgn-cli swap \
|
|
482
554
|
--chain sol \
|
|
483
555
|
--from <wallet-address> \
|
|
484
556
|
--input-token <input-token-addr> \
|
|
@@ -487,7 +559,7 @@ npx gmgn-cli swap \
|
|
|
487
559
|
--slippage 0.01
|
|
488
560
|
|
|
489
561
|
# Submit swap with automatic slippage
|
|
490
|
-
|
|
562
|
+
gmgn-cli swap \
|
|
491
563
|
--chain sol \
|
|
492
564
|
--from <wallet-address> \
|
|
493
565
|
--input-token <input-token-addr> \
|
|
@@ -495,11 +567,29 @@ npx gmgn-cli swap \
|
|
|
495
567
|
--amount 1000000 \
|
|
496
568
|
--auto-slippage
|
|
497
569
|
|
|
570
|
+
# Sell by position percentage (e.g. sell 50%)
|
|
571
|
+
gmgn-cli swap \
|
|
572
|
+
--chain sol \
|
|
573
|
+
--from <wallet-address> \
|
|
574
|
+
--input-token <token-addr> \
|
|
575
|
+
--output-token <usdc-addr> \
|
|
576
|
+
--percent 50 \
|
|
577
|
+
--auto-slippage
|
|
578
|
+
|
|
579
|
+
# Get quote (no transaction submitted)
|
|
580
|
+
gmgn-cli order quote \
|
|
581
|
+
--chain sol \
|
|
582
|
+
--from <wallet-address> \
|
|
583
|
+
--input-token <input-token-addr> \
|
|
584
|
+
--output-token <output-token-addr> \
|
|
585
|
+
--amount 1000000 \
|
|
586
|
+
--slippage 0.01
|
|
587
|
+
|
|
498
588
|
# Query order
|
|
499
|
-
|
|
589
|
+
gmgn-cli order get --chain sol --order-id <order-id>
|
|
500
590
|
```
|
|
501
591
|
|
|
502
|
-
##
|
|
592
|
+
## 9. Supported Chains
|
|
503
593
|
|
|
504
594
|
| Commands | Chains | Chain Currencies |
|
|
505
595
|
|----------|--------|-----------------|
|
|
@@ -508,10 +598,13 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
|
|
|
508
598
|
|
|
509
599
|
---
|
|
510
600
|
|
|
511
|
-
##
|
|
601
|
+
## 10. Upgrade Skills and CLI
|
|
512
602
|
|
|
513
603
|
```bash
|
|
514
|
-
# Upgrade CLI
|
|
604
|
+
# Upgrade CLI
|
|
605
|
+
npm install -g gmgn-cli
|
|
606
|
+
|
|
607
|
+
# Upgrade Skills
|
|
515
608
|
npx skills add GMGNAI/gmgn-skills
|
|
516
609
|
|
|
517
610
|
# Check current version
|
|
@@ -522,7 +615,7 @@ gmgn-cli --version
|
|
|
522
615
|
|
|
523
616
|
---
|
|
524
617
|
|
|
525
|
-
##
|
|
618
|
+
## 11. Security & Disclaimer (Read Before Use)
|
|
526
619
|
|
|
527
620
|
This tool can be invoked by an AI Agent to submit real on-chain transactions automatically. It carries inherent risks including model hallucination, uncontrolled execution, and prompt injection. Once authorized, the AI Agent will submit transactions on behalf of your linked wallet address — **on-chain transactions are irreversible once confirmed** and may result in financial loss. Use with caution.
|
|
528
621
|
|
package/Readme.zh.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## GMGN Agent Skills
|
|
12
12
|
|
|
13
|
-
使用 GMGN Agent Skills,你可以通过 AI Agent 实时查询多个链上热门代币排行榜,代币基础信息,社交媒体信息,实时交易动态,实时战壕新币,报持仓大户(Top Holder),交易大户(Top Trader),聪明钱持仓占比,KOL
|
|
13
|
+
使用 GMGN Agent Skills,你可以通过 AI Agent 实时查询多个链上热门代币排行榜,代币基础信息,社交媒体信息,实时交易动态,实时战壕新币,报持仓大户(Top Holder),交易大户(Top Trader),聪明钱持仓占比,KOL持仓占比,老鼠仓持仓,捆绑持仓占比,等代币专业数据分析数据,以及支持代币市价单交易、限价单交易、高级止盈止损策略单交易、一键 Cooking 策略单(买入 + 条件单一体化),以及钱包资产管理相关功能,例如查询钱包实时持仓、钱包最近盈亏、钱包交易动态等,全部通过自然语言与 AI Agent 交互即可完成。
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -92,7 +92,8 @@ SOL / BSC / Base 多链数据每次查询均为实时,支持多参数个性化
|
|
|
92
92
|
| [`/gmgn-market`](skills/gmgn-market/SKILL.md) | K 线行情数据、热门代币 | [SKILL.md](skills/gmgn-market/SKILL.md) |
|
|
93
93
|
| [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | 钱包持仓、活动、统计 | [SKILL.md](skills/gmgn-portfolio/SKILL.md) |
|
|
94
94
|
| [`/gmgn-track`](skills/gmgn-track/SKILL.md) | 追踪关注钱包交易动态、KOL 交易动态、聪明钱交易动态 | [SKILL.md](skills/gmgn-track/SKILL.md) |
|
|
95
|
-
| [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | 兑换提交 + 订单查询 | [SKILL.md](skills/gmgn-swap/SKILL.md) |
|
|
95
|
+
| [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | 兑换提交 + 限价单 + 策略单 + 订单查询 | [SKILL.md](skills/gmgn-swap/SKILL.md) |
|
|
96
|
+
| [`/gmgn-cooking`](skills/gmgn-cooking/SKILL.md) | 一键 Cooking 策略单(买入 + 止盈止损条件单一体化) | [SKILL.md](skills/gmgn-cooking/SKILL.md) |
|
|
96
97
|
|
|
97
98
|
> 如需查看详细的 CLI 接口说明、传参格式和推荐值,请参阅 [Wiki 文档](https://github.com/GMGNAI/gmgn-skills/wiki/Home-Chinese)。
|
|
98
99
|
|
|
@@ -102,7 +103,7 @@ SOL / BSC / Base 多链数据每次查询均为实时,支持多参数个性化
|
|
|
102
103
|
|
|
103
104
|
已准备好?[点击这里开始安装 Skills →](#开始安装-skills)
|
|
104
105
|
|
|
105
|
-
已安装?[升级 Skills 和 CLI →](#
|
|
106
|
+
已安装?[升级 Skills 和 CLI →](#10-升级-skills-和-cli)
|
|
106
107
|
|
|
107
108
|
> **提示:** 如果你的 AI Agent 尝试直接打开 gmgn.ai 网站而不是使用 CLI,请在提示词中加上:
|
|
108
109
|
> ```
|
|
@@ -182,9 +183,10 @@ gmgn-cli market trending --chain sol --interval 1h --limit 3
|
|
|
182
183
|
|
|
183
184
|
## AI Agent 升级
|
|
184
185
|
|
|
185
|
-
>
|
|
186
|
+
> 运行以下两条命令,将 CLI 和 Skills 同时升级到最新版本。
|
|
186
187
|
|
|
187
188
|
```bash
|
|
189
|
+
npm install -g gmgn-cli
|
|
188
190
|
npx skills add GMGNAI/gmgn-skills
|
|
189
191
|
```
|
|
190
192
|
|
|
@@ -194,7 +196,7 @@ npx skills add GMGNAI/gmgn-skills
|
|
|
194
196
|
gmgn-cli --version
|
|
195
197
|
```
|
|
196
198
|
|
|
197
|
-
> 完整升级说明请参阅[第
|
|
199
|
+
> 完整升级说明请参阅[第 10 节 — 升级 Skills 和 CLI](#10-升级-skills-和-cli)。
|
|
198
200
|
|
|
199
201
|
---
|
|
200
202
|
|
|
@@ -223,15 +225,6 @@ gmgn-cli --version
|
|
|
223
225
|
|
|
224
226
|
---
|
|
225
227
|
|
|
226
|
-
## 开始安装 Skills
|
|
227
|
-
|
|
228
|
-
安装前,请先在 **https://gmgn.ai/ai** 创建 API Key,用于:
|
|
229
|
-
|
|
230
|
-
1. 读取数据:代币、榜单、K 线、特色数据指标
|
|
231
|
-
2. 提交交易:市价立即交易、创建限价单、策略单等
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
228
|
## 1. 安装
|
|
236
229
|
|
|
237
230
|
选择以下任意一种方式
|
|
@@ -260,20 +253,10 @@ node dist/index.js <command> [options]
|
|
|
260
253
|
|
|
261
254
|
## 2. 验证连通性
|
|
262
255
|
|
|
263
|
-
### 方式一:通过 AI Agent 验证
|
|
264
|
-
|
|
265
|
-
发送以下提示词给你的 AI Agent:
|
|
266
|
-
|
|
267
|
-
```
|
|
268
|
-
执行这个cli命令:GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
### 方式二:通过 CLI 验证
|
|
272
|
-
|
|
273
256
|
使用公共 API Key 测试,无需注册:
|
|
274
257
|
|
|
275
258
|
```bash
|
|
276
|
-
GMGN_API_KEY=gmgn_solbscbaseethmonadtron
|
|
259
|
+
GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3
|
|
277
260
|
```
|
|
278
261
|
|
|
279
262
|
看到 JSON 输出即表示 CLI 正常工作。公共 Key 支持所有只读接口(token / market / portfolio),公共 Key 仅用于测试,正式使用任何接口均需申请个人 API Key(见第 3 步)。
|
|
@@ -363,7 +346,7 @@ cp .env.example .env
|
|
|
363
346
|
```bash
|
|
364
347
|
echo "$(npm root -g)/gmgn-skills/skills"
|
|
365
348
|
```
|
|
366
|
-
3. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-track`、`/gmgn-swap` 即可使用
|
|
349
|
+
3. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-track`、`/gmgn-swap`、`/gmgn-cooking` 即可使用
|
|
367
350
|
|
|
368
351
|
#### Codex CLI
|
|
369
352
|
|
|
@@ -549,6 +532,52 @@ gmgn-cli track smartmoney --limit 100 --raw
|
|
|
549
532
|
gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
|
|
550
533
|
```
|
|
551
534
|
|
|
535
|
+
### 限价单(需要私钥)
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
# 创建止盈单
|
|
539
|
+
gmgn-cli order strategy create \
|
|
540
|
+
--chain sol \
|
|
541
|
+
--from <wallet_address> \
|
|
542
|
+
--base-token <token_address> \
|
|
543
|
+
--quote-token <sol_address> \
|
|
544
|
+
--sub-order-type take_profit \
|
|
545
|
+
--check-price 0.002 \
|
|
546
|
+
--amount-in-percent 100 \
|
|
547
|
+
--slippage 0.01
|
|
548
|
+
|
|
549
|
+
# 创建止损单
|
|
550
|
+
gmgn-cli order strategy create \
|
|
551
|
+
--chain sol \
|
|
552
|
+
--from <wallet_address> \
|
|
553
|
+
--base-token <token_address> \
|
|
554
|
+
--quote-token <sol_address> \
|
|
555
|
+
--sub-order-type stop_loss \
|
|
556
|
+
--check-price 0.0005 \
|
|
557
|
+
--amount-in-percent 100 \
|
|
558
|
+
--slippage 0.01
|
|
559
|
+
|
|
560
|
+
# 查看当前挂单
|
|
561
|
+
gmgn-cli order strategy list --chain sol
|
|
562
|
+
|
|
563
|
+
# 撤销策略单
|
|
564
|
+
gmgn-cli order strategy cancel --chain sol --from <wallet_address> --order-id <order_id>
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
### Cooking 一键策略单(需要私钥)
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
# 买入代币,同时自动挂止盈 + 止损条件单
|
|
571
|
+
gmgn-cli cooking \
|
|
572
|
+
--chain sol \
|
|
573
|
+
--from <wallet_address> \
|
|
574
|
+
--input-token So11111111111111111111111111111111111111112 \
|
|
575
|
+
--output-token <token_address> \
|
|
576
|
+
--amount 1000000000 \
|
|
577
|
+
--slippage 0.1 \
|
|
578
|
+
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"200","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
|
|
579
|
+
```
|
|
580
|
+
|
|
552
581
|
### Swap(需要私钥)
|
|
553
582
|
|
|
554
583
|
```bash
|
|
@@ -592,7 +621,7 @@ gmgn-cli order quote \
|
|
|
592
621
|
gmgn-cli order get --chain sol --order-id <order-id>
|
|
593
622
|
```
|
|
594
623
|
|
|
595
|
-
##
|
|
624
|
+
## 9. 支持的链
|
|
596
625
|
|
|
597
626
|
| 接口类型 | 支持的链 | 链原生货币 |
|
|
598
627
|
|----------|----------|-----------|
|
|
@@ -601,7 +630,7 @@ gmgn-cli order get --chain sol --order-id <order-id>
|
|
|
601
630
|
|
|
602
631
|
---
|
|
603
632
|
|
|
604
|
-
##
|
|
633
|
+
## 10. 升级 Skills 和 CLI
|
|
605
634
|
|
|
606
635
|
将 `gmgn-cli` 和 Skills 升级到最新版本:
|
|
607
636
|
|
|
@@ -633,7 +662,7 @@ gmgn-cli --version
|
|
|
633
662
|
|
|
634
663
|
---
|
|
635
664
|
|
|
636
|
-
##
|
|
665
|
+
## 11. 安全与免责(使用前必读)
|
|
637
666
|
|
|
638
667
|
本工具可供 AI Agent 调用以自动执行链上交易,存在模型幻觉、执行不可控、提示词注入等固有风险。AI Agent 在获得授权后,将以您绑定的钱包地址提交真实的链上交易,**交易一经上链即不可撤销**,可能导致资金损失,请您谨慎使用。
|
|
639
668
|
|
|
@@ -30,6 +30,69 @@ export interface SwapParams {
|
|
|
30
30
|
gas_price?: string;
|
|
31
31
|
max_fee_per_gas?: string;
|
|
32
32
|
max_priority_fee_per_gas?: string;
|
|
33
|
+
condition_orders?: StrategyConditionOrder[];
|
|
34
|
+
sell_ratio_type?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface StrategyConditionOrder {
|
|
37
|
+
order_type: string;
|
|
38
|
+
side: string;
|
|
39
|
+
price_scale: string;
|
|
40
|
+
sell_ratio: string;
|
|
41
|
+
}
|
|
42
|
+
export interface StrategyCreateParams {
|
|
43
|
+
chain: string;
|
|
44
|
+
from_address: string;
|
|
45
|
+
base_token: string;
|
|
46
|
+
quote_token: string;
|
|
47
|
+
order_type: string;
|
|
48
|
+
sub_order_type: string;
|
|
49
|
+
check_price: string;
|
|
50
|
+
amount_in?: string;
|
|
51
|
+
amount_in_percent?: string;
|
|
52
|
+
limit_price_mode?: string;
|
|
53
|
+
price_gap_ratio?: string;
|
|
54
|
+
expire_in?: number;
|
|
55
|
+
sell_ratio_type?: string;
|
|
56
|
+
slippage?: number;
|
|
57
|
+
auto_slippage?: boolean;
|
|
58
|
+
fee?: string;
|
|
59
|
+
gas_price?: string;
|
|
60
|
+
max_fee_per_gas?: string;
|
|
61
|
+
max_priority_fee_per_gas?: string;
|
|
62
|
+
is_anti_mev?: boolean;
|
|
63
|
+
anti_mev_mode?: string;
|
|
64
|
+
priority_fee?: string;
|
|
65
|
+
tip_fee?: string;
|
|
66
|
+
custom_rpc?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface StrategyCancelParams {
|
|
69
|
+
chain: string;
|
|
70
|
+
from_address: string;
|
|
71
|
+
order_id: string;
|
|
72
|
+
order_type?: string;
|
|
73
|
+
close_sell_model?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface CreateTokenParams {
|
|
76
|
+
chain: string;
|
|
77
|
+
dex: string;
|
|
78
|
+
from_address: string;
|
|
79
|
+
name: string;
|
|
80
|
+
symbol: string;
|
|
81
|
+
buy_amt: string;
|
|
82
|
+
image?: string;
|
|
83
|
+
image_url?: string;
|
|
84
|
+
website?: string;
|
|
85
|
+
twitter?: string;
|
|
86
|
+
telegram?: string;
|
|
87
|
+
slippage?: number;
|
|
88
|
+
auto_slippage?: boolean;
|
|
89
|
+
priority_fee?: string;
|
|
90
|
+
tip_fee?: string;
|
|
91
|
+
gas_price?: string;
|
|
92
|
+
max_priority_fee_per_gas?: string;
|
|
93
|
+
max_fee_per_gas?: string;
|
|
94
|
+
is_anti_mev?: boolean;
|
|
95
|
+
anti_mev_mode?: string;
|
|
33
96
|
}
|
|
34
97
|
export declare class OpenApiClient {
|
|
35
98
|
private readonly apiKey;
|
|
@@ -55,8 +118,14 @@ export declare class OpenApiClient {
|
|
|
55
118
|
quoteOrder(chain: string, from_address: string, input_token: string, output_token: string, input_amount: string, slippage: number): Promise<unknown>;
|
|
56
119
|
swap(params: SwapParams): Promise<unknown>;
|
|
57
120
|
queryOrder(orderId: string, chain: string): Promise<unknown>;
|
|
121
|
+
createStrategyOrder(params: StrategyCreateParams): Promise<unknown>;
|
|
122
|
+
getStrategyOrders(chain: string, extra?: Record<string, string | number>): Promise<unknown>;
|
|
123
|
+
cancelStrategyOrder(params: StrategyCancelParams): Promise<unknown>;
|
|
124
|
+
getCookingStatistics(): Promise<unknown>;
|
|
125
|
+
createToken(params: CreateTokenParams): Promise<unknown>;
|
|
58
126
|
private normalRequest;
|
|
59
127
|
private criticalRequest;
|
|
128
|
+
private executePreparedRequest;
|
|
60
129
|
private doFetch;
|
|
61
130
|
private parseResponse;
|
|
62
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenApiClient.d.ts","sourceRoot":"","sources":["../../src/client/OpenApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"OpenApiClient.d.ts","sour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