@four-meme/four-meme-ai 1.0.6 → 1.0.8

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/CLAUDE.md CHANGED
@@ -1,91 +1,91 @@
1
- # four-meme-ai – Agent Guidelines (Claude / Claude Code)
2
-
3
- ## Overview
4
-
5
- This repo provides the **four-meme-integration** skill for AI agents: create and trade meme tokens on **four.meme (BSC only)** using the official API and on-chain contracts (**TokenManager2**, **TokenManagerHelper3**). TokenManager V1 is **not** supported by this skill.
6
-
7
- The authoritative specification for this skill is `skills/four-meme-integration/SKILL.md`. Claude/Claude Code should treat that file as the main contract for behavior, safety, and command usage.
8
-
9
- ## When to Use This Skill
10
-
11
- Use this repo when the user explicitly or implicitly asks to:
12
-
13
- - **Create** a meme token on four.meme on BSC (full API flow + `TokenManager2.createToken` on-chain).
14
- - **Buy** or **sell** a four.meme token on BSC (quote with Helper3, execute via TokenManager2).
15
- - **Query token info** (version, tokenManager, price, offers, etc.) for a given token address or requestId.
16
- - **Query lists / rankings** of four.meme tokens (REST list, detail, advanced rankings).
17
- - **Query Tax token fee/tax config**, or execute Tax-type token creation.
18
- - **Send BNB / ERC20** from the trading wallet to another address on BSC.
19
- - **Register / query** an EIP‑8004 identity NFT (8004 registry contract on BSC).
20
-
21
- If the user’s request does not involve four.meme, BSC, or these flows, you should not use this skill.
22
-
23
- ## Repo Layout
24
-
25
- ```
26
- four-meme-ai/
27
- ├── skills/
28
- │ └── four-meme-integration/
29
- │ ├── SKILL.md # Main skill instructions (Cursor / OpenClaw)
30
- │ ├── references/ # API, addresses, errors, trading, events, tax
31
- │ └── scripts/ # create-token, get-token-info, quote-buy/sell, etc.
32
- ├── bin/
33
- │ └── fourmeme.cjs # CLI dispatcher (fourmeme ...)
34
- ├── package.json
35
- ├── README.md
36
- └── CLAUDE.md # This file (Claude-facing guidelines)
37
- ```
38
-
39
- ## Safety and Private Key Handling
40
-
41
- The SKILL defines a **User Agreement & Security Notice** (bilingual: English + Traditional Chinese). Claude MUST:
42
-
43
- 1. On first use of this skill in a conversation, present the User Agreement and Security Notice in the user’s language (use the 繁體中文 block when the user writes in Traditional Chinese; otherwise use English).
44
- 2. Make clear that **continuing to use this plugin/skill implies acceptance of the User Agreement**.
45
- 3. **MUST NOT** run any operation that uses a private key or writes on-chain (e.g. `create-api`, `create-chain`, `buy`, `sell`, `send`, `8004-register`) until the user has explicitly agreed or confirmed to continue.
46
- 4. May run read‑only commands (e.g. `config`, `token-info`, `quote-buy`, `8004-balance`) while or after presenting the notice.
47
-
48
- Never ask the user to paste a private key into chat. All private keys must come from environment / config (e.g. `PRIVATE_KEY`) as described in `SKILL.md`.
49
-
50
- ## Conventions (aligned with SKILL.md)
51
-
52
- 1. **Chain**: BSC only (chainId 56). Arbitrum and Base are **out of scope** for this skill.
53
- 2. **Trading**:
54
- - Always call Helper3 `getTokenInfo(token)` first to get `version`, `tokenManager`, and current price/offers.
55
- - Only **version 2** (TokenManager2) is supported by this skill; do not attempt V1 flows.
56
- - For X Mode / TaxToken / AntiSniperFeeMode detection and error codes, see `skills/four-meme-integration/references/errors.md`.
57
- 3. **Create token**:
58
- - `raisedToken` must always come from `GET https://four.meme/meme-api/v1/public/config` and be used **as is** in the create body; do not invent or modify internal fields.
59
- - For tax-type tokens, follow `tokenTaxInfo` constraints in `references/token-tax-info.md` and the interactive flow in `SKILL.md` (“Create token (full flow)”).
60
- 4. **RPC and private key (environment)**:
61
- - When **using OpenClaw**: PRIVATE_KEY and BSC_RPC_URL are configured in OpenClaw (e.g. `skills.entries["four-meme-ai"].env` or apiKey); see SKILL.md.
62
- - When **not using OpenClaw (standalone)**: set `PRIVATE_KEY` and optionally `BSC_RPC_URL` via the process environment—e.g. a `.env` file in the **directory where you run `fourmeme`** (the CLI loads it automatically via dotenv) or shell `export`. Do not ask the user to paste a private key in chat.
63
-
64
- ## CLI Usage (fourmeme)
65
-
66
- From the project root after `npm install`, use:
67
-
68
- ```bash
69
- npx fourmeme <command> [args...]
70
- ```
71
-
72
- Key commands (full list and parameters in `SKILL.md`):
73
-
74
- - `fourmeme config` – Get public config (raisedToken).
75
- - `fourmeme create-api` / `fourmeme create-chain` – Create token (API + on-chain).
76
- - `fourmeme token-info` / `token-list` / `token-get` / `token-rankings` – On-chain info and REST queries.
77
- - `fourmeme quote-buy` / `quote-sell` – Estimate buy/sell without sending tx.
78
- - `fourmeme buy` / `sell` – Execute buy/sell via TokenManager2 (V2 only).
79
- - `fourmeme send` – Send BNB or ERC20 from the trading wallet.
80
- - `fourmeme 8004-register` / `8004-balance` – EIP‑8004 identity NFT register and query.
81
- - `fourmeme events` – TokenManager2 events (TokenCreate, TokenPurchase, TokenSale, LiquidityAdded).
82
- - `fourmeme tax-info` – TaxToken on-chain fee/tax config.
83
-
84
- Always prefer these CLI commands rather than calling scripts directly, unless `SKILL.md` suggests otherwise.
85
-
86
- ## External Docs
87
-
88
- For deeper protocol details, see:
89
-
90
- - In-repo: `skills/four-meme-integration/references/` (api-create-token, token-query-api, execute-trade, event-listening, tax-token-query, errors).
91
- - Official four.meme API and contracts (online): [Protocol Integration](https://four-meme.gitbook.io/four.meme/brand/protocol-integration) (API documents, ABIs: TokenManager, TokenManager2, Helper3, TaxToken, etc.).
1
+ # four-meme-ai – Agent Guidelines (Claude / Claude Code)
2
+
3
+ ## Overview
4
+
5
+ This repo provides the **four-meme-integration** skill for AI agents: create and trade meme tokens on **four.meme (BSC only)** using the official API and on-chain contracts (**TokenManager2**, **TokenManagerHelper3**). TokenManager V1 is **not** supported by this skill.
6
+
7
+ The authoritative specification for this skill is `skills/four-meme-integration/SKILL.md`. Claude/Claude Code should treat that file as the main contract for behavior, safety, and command usage.
8
+
9
+ ## When to Use This Skill
10
+
11
+ Use this repo when the user explicitly or implicitly asks to:
12
+
13
+ - **Create** a meme token on four.meme on BSC (full API flow + `TokenManager2.createToken` on-chain).
14
+ - **Buy** or **sell** a four.meme token on BSC (quote with Helper3, execute via TokenManager2).
15
+ - **Query token info** (version, tokenManager, price, offers, etc.) for a given token address or requestId.
16
+ - **Query lists / rankings** of four.meme tokens (REST list, detail, advanced rankings).
17
+ - **Query Tax token fee/tax config**, or execute Tax-type token creation.
18
+ - **Send BNB / ERC20** from the trading wallet to another address on BSC.
19
+ - **Register / query** an EIP‑8004 identity NFT (8004 registry contract on BSC).
20
+
21
+ If the user’s request does not involve four.meme, BSC, or these flows, you should not use this skill.
22
+
23
+ ## Repo Layout
24
+
25
+ ```
26
+ four-meme-ai/
27
+ ├── skills/
28
+ │ └── four-meme-integration/
29
+ │ ├── SKILL.md # Main skill instructions (Cursor / OpenClaw)
30
+ │ ├── references/ # API, addresses, errors, trading, events, tax
31
+ │ └── scripts/ # create-token, get-token-info, quote-buy/sell, etc.
32
+ ├── bin/
33
+ │ └── fourmeme.cjs # CLI dispatcher (fourmeme ...)
34
+ ├── package.json
35
+ ├── README.md
36
+ └── CLAUDE.md # This file (Claude-facing guidelines)
37
+ ```
38
+
39
+ ## Safety and Private Key Handling
40
+
41
+ The SKILL defines a **User Agreement & Security Notice** (bilingual: English + Traditional Chinese). Claude MUST:
42
+
43
+ 1. On first use of this skill in a conversation, present the User Agreement and Security Notice in the user’s language (use the 繁體中文 block when the user writes in Traditional Chinese; otherwise use English).
44
+ 2. Make clear that **continuing to use this plugin/skill implies acceptance of the User Agreement**.
45
+ 3. **MUST NOT** run any operation that uses a private key or writes on-chain (e.g. `create-api`, `create-chain`, `buy`, `sell`, `send`, `8004-register`) until the user has explicitly agreed or confirmed to continue.
46
+ 4. May run read‑only commands (e.g. `config`, `token-info`, `quote-buy`, `8004-balance`) while or after presenting the notice.
47
+
48
+ Never ask the user to paste a private key into chat. All private keys must come from environment / config (e.g. `PRIVATE_KEY`) as described in `SKILL.md`.
49
+
50
+ ## Conventions (aligned with SKILL.md)
51
+
52
+ 1. **Chain**: BSC only (chainId 56). Arbitrum and Base are **out of scope** for this skill.
53
+ 2. **Trading**:
54
+ - Always call Helper3 `getTokenInfo(token)` first to get `version`, `tokenManager`, and current price/offers.
55
+ - Only **version 2** (TokenManager2) is supported by this skill; do not attempt V1 flows.
56
+ - For X Mode / TaxToken / AntiSniperFeeMode detection and error codes, see `skills/four-meme-integration/references/errors.md`.
57
+ 3. **Create token**:
58
+ - `raisedToken` must always come from `GET https://four.meme/meme-api/v1/public/config` and be used **as is** in the create body; do not invent or modify internal fields.
59
+ - For tax-type tokens, follow `tokenTaxInfo` constraints in `references/token-tax-info.md` and the interactive flow in `SKILL.md` (“Create token (full flow)”).
60
+ 4. **RPC and private key (environment)**:
61
+ - When **using OpenClaw**: PRIVATE_KEY and BSC_RPC_URL are configured in OpenClaw (e.g. `skills.entries["four-meme-ai"].env` or apiKey); see SKILL.md.
62
+ - When **not using OpenClaw (standalone)**: set `PRIVATE_KEY` and optionally `BSC_RPC_URL` via the process environment—e.g. a `.env` file in the **directory where you run `fourmeme`** (the CLI loads it automatically via dotenv) or shell `export`. Do not ask the user to paste a private key in chat.
63
+
64
+ ## CLI Usage (fourmeme)
65
+
66
+ From the project root after `npm install`, use:
67
+
68
+ ```bash
69
+ npx fourmeme <command> [args...]
70
+ ```
71
+
72
+ Key commands (full list and parameters in `SKILL.md`):
73
+
74
+ - `fourmeme config` – Get public config (raisedToken).
75
+ - `fourmeme create-api` / `fourmeme create-chain` – Create token (API + on-chain).
76
+ - `fourmeme token-info` / `token-list` / `token-get` / `token-rankings` – On-chain info and REST queries.
77
+ - `fourmeme quote-buy` / `quote-sell` – Estimate buy/sell without sending tx.
78
+ - `fourmeme buy` / `sell` – Execute buy/sell via TokenManager2 (V2 only).
79
+ - `fourmeme send` – Send BNB or ERC20 from the trading wallet.
80
+ - `fourmeme 8004-register` / `8004-balance` – EIP‑8004 identity NFT register and query.
81
+ - `fourmeme events` – TokenManager2 events (TokenCreate, TokenPurchase, TokenSale, LiquidityAdded).
82
+ - `fourmeme tax-info` – TaxToken on-chain fee/tax config.
83
+
84
+ Always prefer these CLI commands rather than calling scripts directly, unless `SKILL.md` suggests otherwise.
85
+
86
+ ## External Docs
87
+
88
+ For deeper protocol details, see:
89
+
90
+ - In-repo: `skills/four-meme-integration/references/` (api-create-token, token-query-api, execute-trade, event-listening, tax-token-query, errors).
91
+ - Official four.meme API and contracts (online): [Protocol Integration](https://four-meme.gitbook.io/four.meme/brand/protocol-integration) (API documents, ABIs: TokenManager, TokenManager2, Helper3, TaxToken, etc.).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 lol-dev-99
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -31,9 +31,9 @@ When the user needs to create or trade meme tokens on four.meme (BSC), use the *
31
31
  | `create-chain` | `<createArgHex>` `<signatureHex>` `[--value=<wei>]` or `--` (stdin JSON) | Submit createToken on BSC. Env: PRIVATE_KEY. |
32
32
  | `create-instant` | `--image=` `--name=` `--short-name=` `--desc=` `--label=` `[--web-url=]` `[--twitter-url=]` `[--telegram-url=]` `[--pre-sale=<BNB>]` `[--fee-plan=false]` `[--value=<wei>]` `[--tax-options=<path>]` or `[--tax-token --tax-fee-rate=5 ...]` | One-shot create (API + chain). Same options as create-api plus `--value=` override. Env: PRIVATE_KEY. |
33
33
  | `token-info` | `<tokenAddress>` | On-chain token info (Helper3). |
34
- | `token-list` | `[--orderBy=Hot]` `[--pageIndex=1]` `[--pageSize=30]` `[--tokenName=]` `[--symbol=]` `[--labels=]` `[--listedPancake=false]` | REST token list. |
34
+ | `token-list` | Legacy query flags or `[--type=]` `[--listType=]` `[--keyword=]` `[--tag=]` `[--status=]` `[--sort=]` `[--version=]` … (also legacy `--queryMode=Binance|USD1` to infer `listType`) | POST `/public/token/search` (token list). |
35
35
  | `token-get` | `<tokenAddress>` | REST token detail + trading info. |
36
- | `token-rankings` | `<orderBy>` `[--barType=HOUR24]` | Rankings. orderBy: `Time|ProgressDesc|TradingDesc|Hot|Graduated`. |
36
+ | `token-rankings` | `<orderBy or type>` `[--barType=]` `[--pageSize=]` `[--symbol=]` `[--version=]` `[--rankingKind=]` `[--minCap=]` `[--maxCap=]` `[--minVol=]` `[--maxVol=]` `[--minHold=]` `[--maxHold=]` … | POST `/public/token/ranking`; legacy orderBy or native type (e.g. `VOL_DAY_1`). |
37
37
  | `quote-buy` | `<tokenAddress>` `<amountWei>` `[fundsWei]` | Estimate buy (no tx). Use 0 for amount or funds. |
38
38
  | `quote-sell` | `<tokenAddress>` `<amountWei>` | Estimate sell (no tx). |
39
39
  | `buy` | `<token>` `amount` `<amountWei>` `<maxFundsWei>` | Buy fixed amount. Env: PRIVATE_KEY. |
package/bin/fourmeme.cjs CHANGED
@@ -87,14 +87,17 @@ Commands and parameters:
87
87
  On-chain token info (Helper3). No auth.
88
88
 
89
89
  token-list
90
- [--orderBy=Hot] [--pageIndex=1] [--pageSize=30] [--tokenName=] [--symbol=] [--labels=] [--listedPancake=false]
91
- REST token list. No auth.
90
+ POST /public/token/search. Legacy: [--orderBy=] [--tokenName=] [--listedPancake=]
91
+ New: [--type=] [--listType=] [--keyword=] [--tag=] [--status=] [--sort=] [--version=] [--pageIndex=] [--pageSize=].
92
+ Legacy queryMode mapping: [--queryMode=Binance|USD1] (infers listType BIN/BIN_DEX or USD1/USD1_DEX by listedPancake).
93
+ No auth.
92
94
 
93
95
  token-get <tokenAddress>
94
96
  REST token detail + trading info. No auth.
95
97
 
96
- token-rankings <orderBy> [--barType=HOUR24]
97
- orderBy: Time|ProgressDesc|TradingDesc|Hot|Graduated. barType for TradingDesc. No auth.
98
+ token-rankings <orderBy|type> [--barType=HOUR24] [--pageSize=] [--symbol=] [--version=] [--rankingKind=] [--minCap=] [--maxCap=] [--minVol=] [--maxVol=] [--minHold=] [--maxHold=] …
99
+ POST /public/token/ranking. Legacy: Time|ProgressDesc|TradingDesc|Hot|Graduated; or native type e.g. VOL_DAY_1.
100
+ No auth.
98
101
 
99
102
  quote-buy <tokenAddress> <amountWei> [fundsWei]
100
103
  Estimate buy. Use 0 for amount or funds. No tx.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@four-meme/four-meme-ai",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Four.meme AI skills for creating and trading meme tokens (BSC only)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,13 +44,13 @@
44
44
  ],
45
45
  "dependencies": {
46
46
  "@four-meme/four-meme-ai": "^1.0.5",
47
- "dotenv": "^16.0.0"
47
+ "dotenv": "^16.0.0",
48
+ "tsx": "^4.20.0",
49
+ "viem": "^2.0.0"
48
50
  },
49
51
  "devDependencies": {
50
52
  "@types/node": "^20.0.0",
51
- "tsx": "^4.20.0",
52
- "typescript": "^5.0.0",
53
- "viem": "^2.0.0"
53
+ "typescript": "^5.0.0"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"