@four-meme/four-meme-ai 1.0.4 → 1.0.6
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 +91 -91
- package/README.md +136 -108
- package/bin/fourmeme.cjs +171 -128
- package/package.json +2 -1
- package/skills/four-meme-integration/SKILL.md +18 -25
- package/skills/four-meme-integration/references/agent-creator-and-wallets.md +87 -0
- package/skills/four-meme-integration/references/api-create-token.md +55 -55
- package/skills/four-meme-integration/references/contract-addresses.md +47 -34
- package/skills/four-meme-integration/references/create-token-scripts.md +111 -63
- package/skills/four-meme-integration/references/errors.md +29 -27
- package/skills/four-meme-integration/references/event-listening.md +75 -75
- package/skills/four-meme-integration/references/execute-trade.md +31 -31
- package/skills/four-meme-integration/references/tax-token-query.md +38 -38
- package/skills/four-meme-integration/references/token-tax-info.md +77 -77
- package/skills/four-meme-integration/scripts/8004-balance.ts +52 -52
- package/skills/four-meme-integration/scripts/8004-register.ts +108 -108
- package/skills/four-meme-integration/scripts/create-token-api.ts +321 -251
- package/skills/four-meme-integration/scripts/create-token-chain.ts +102 -85
- package/skills/four-meme-integration/scripts/create-token-instant.ts +106 -0
- package/skills/four-meme-integration/scripts/execute-buy.ts +198 -198
- package/skills/four-meme-integration/scripts/execute-sell.ts +150 -150
- package/skills/four-meme-integration/scripts/send-token.ts +98 -98
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/README.md
CHANGED
|
@@ -1,108 +1,136 @@
|
|
|
1
|
-
# four-meme-ai
|
|
2
|
-
|
|
3
|
-
Four.meme AI skills for creating and trading meme tokens on **BSC only**. Lets agents integrate with [four.meme](https://four.meme) for token creation, buy/sell flows, Tax tokens, transfers, and EIP‑8004 identity NFTs.
|
|
4
|
-
|
|
5
|
-
## Skills
|
|
6
|
-
|
|
7
|
-
| Skill | Description |
|
|
8
|
-
|-------|-------------|
|
|
9
|
-
| `four-meme-integration` | Create/trade meme tokens on **BSC only**, query token info/lists/rankings, listen to TokenManager2 events, query TaxToken tax info, send BNB/ERC20, and register/query EIP‑8004 identity NFTs. TokenManager V1 is not supported. |
|
|
10
|
-
|
|
11
|
-
Safety, user agreement, and detailed agent behavior requirements are defined in [`skills/four-meme-integration/SKILL.md`](skills/four-meme-integration/SKILL.md) (bilingual User Agreement & Security Notice). Claude-specific guidance lives in [`CLAUDE.md`](CLAUDE.md).
|
|
12
|
-
|
|
13
|
-
## Usage (Agent)
|
|
14
|
-
|
|
15
|
-
When the user needs to create or trade meme tokens on four.meme (BSC), use the **four-meme-integration** skill:
|
|
16
|
-
|
|
17
|
-
- **Create token (API + chain)**:
|
|
18
|
-
- **Trade (buy/sell)**: Use Helper3 `getTokenInfo` to get version and tokenManager; only version 2 (TokenManager2) is supported. Use `fourmeme quote-buy`/`quote-sell` for estimates, then `fourmeme buy`/`sell` to execute. **BSC only.**
|
|
19
|
-
- **Event listening**: `fourmeme events <fromBlock> [toBlock]` to fetch TokenCreate, TokenPurchase, TokenSale, LiquidityAdded from TokenManager2. See `references/event-listening.md`.
|
|
20
|
-
- **Tax token fee/tax info**: `fourmeme tax-info <tokenAddress>`. See `references/tax-token-query.md` and `token-tax-info.md`.
|
|
21
|
-
- **Send BNB/ERC20**: `fourmeme send <toAddress> <amountWei> [tokenAddress]` to transfer from the trading wallet.
|
|
22
|
-
- **EIP‑8004 identity NFT**: `fourmeme 8004-register <name> [imageUrl] [description]` and `fourmeme 8004-balance <ownerAddress>`.
|
|
23
|
-
- **CLI
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
PRIVATE_KEY
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
# four-meme-ai
|
|
2
|
+
|
|
3
|
+
Four.meme AI skills for creating and trading meme tokens on **BSC only**. Lets agents integrate with [four.meme](https://four.meme) for token creation, buy/sell flows, Tax tokens, transfers, and EIP‑8004 identity NFTs.
|
|
4
|
+
|
|
5
|
+
## Skills
|
|
6
|
+
|
|
7
|
+
| Skill | Description |
|
|
8
|
+
|-------|-------------|
|
|
9
|
+
| `four-meme-integration` | Create/trade meme tokens on **BSC only**, query token info/lists/rankings, listen to TokenManager2 events, query TaxToken tax info, send BNB/ERC20, and register/query EIP‑8004 identity NFTs. TokenManager V1 is not supported. |
|
|
10
|
+
|
|
11
|
+
Safety, user agreement, and detailed agent behavior requirements are defined in [`skills/four-meme-integration/SKILL.md`](skills/four-meme-integration/SKILL.md) (bilingual User Agreement & Security Notice). Claude-specific guidance lives in [`CLAUDE.md`](CLAUDE.md).
|
|
12
|
+
|
|
13
|
+
## Usage (Agent)
|
|
14
|
+
|
|
15
|
+
When the user needs to create or trade meme tokens on four.meme (BSC), use the **four-meme-integration** skill:
|
|
16
|
+
|
|
17
|
+
- **Create token (API + chain)**: Use **`fourmeme create-instant ...`** for one-shot create (API + submit createToken in one command), or the two-step flow `fourmeme create-api ...` → `fourmeme create-chain ...`. Both use the same args: `--image=`, `--name=`, `--short-name=`, `--desc=`, `--label=` (and optional `--pre-sale=<BNB>` in ether units, `--web-url=`, etc.). Creation is BSC only; value (launch fee + presale if any) is computed automatically for create-instant. See `SKILL.md` and `references/create-token-scripts.md` for full details and required user questions.
|
|
18
|
+
- **Trade (buy/sell)**: Use Helper3 `getTokenInfo` to get version and tokenManager; only version 2 (TokenManager2) is supported. Use `fourmeme quote-buy`/`quote-sell` for estimates, then `fourmeme buy`/`sell` to execute. **BSC only.**
|
|
19
|
+
- **Event listening**: `fourmeme events <fromBlock> [toBlock]` to fetch TokenCreate, TokenPurchase, TokenSale, LiquidityAdded from TokenManager2. See `references/event-listening.md`.
|
|
20
|
+
- **Tax token fee/tax info**: `fourmeme tax-info <tokenAddress>`. See `references/tax-token-query.md` and `token-tax-info.md`.
|
|
21
|
+
- **Send BNB/ERC20**: `fourmeme send <toAddress> <amountWei> [tokenAddress]` to transfer from the trading wallet.
|
|
22
|
+
- **EIP‑8004 identity NFT**: `fourmeme 8004-register <name> [imageUrl] [description]` and `fourmeme 8004-balance <ownerAddress>`.
|
|
23
|
+
- **CLI**: `npx fourmeme <command> [args]`. Run `npx fourmeme --help` for the full list. See **Commands and parameters** below.
|
|
24
|
+
|
|
25
|
+
## Commands and parameters
|
|
26
|
+
|
|
27
|
+
| Command | Parameters | Description |
|
|
28
|
+
|--------|------------|-------------|
|
|
29
|
+
| `config` | *(none)* | Public config (raisedToken). No auth. |
|
|
30
|
+
| `create-api` | `--image=` `--name=` `--short-name=` `--desc=` `--label=` `[--web-url=]` `[--twitter-url=]` `[--telegram-url=]` `[--pre-sale=<BNB>]` `[--fee-plan=false]` `[--tax-options=<path>]` or `[--tax-token --tax-fee-rate=5 ...]` | Create token API only. Label: `Meme|AI|Defi|Games|Infra|De-Sci|Social|Depin|Charity|Others`. Env: PRIVATE_KEY. |
|
|
31
|
+
| `create-chain` | `<createArgHex>` `<signatureHex>` `[--value=<wei>]` or `--` (stdin JSON) | Submit createToken on BSC. Env: PRIVATE_KEY. |
|
|
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
|
+
| `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. |
|
|
35
|
+
| `token-get` | `<tokenAddress>` | REST token detail + trading info. |
|
|
36
|
+
| `token-rankings` | `<orderBy>` `[--barType=HOUR24]` | Rankings. orderBy: `Time|ProgressDesc|TradingDesc|Hot|Graduated`. |
|
|
37
|
+
| `quote-buy` | `<tokenAddress>` `<amountWei>` `[fundsWei]` | Estimate buy (no tx). Use 0 for amount or funds. |
|
|
38
|
+
| `quote-sell` | `<tokenAddress>` `<amountWei>` | Estimate sell (no tx). |
|
|
39
|
+
| `buy` | `<token>` `amount` `<amountWei>` `<maxFundsWei>` | Buy fixed amount. Env: PRIVATE_KEY. |
|
|
40
|
+
| `buy` | `<token>` `funds` `<fundsWei>` `<minAmountWei>` | Buy with fixed quote. Env: PRIVATE_KEY. |
|
|
41
|
+
| `sell` | `<tokenAddress>` `<amountWei>` `[minFundsWei]` | Execute sell. Env: PRIVATE_KEY. |
|
|
42
|
+
| `send` | `<toAddress>` `<amountWei>` `[tokenAddress]` | Send BNB or ERC20. Omit tokenAddress for BNB. Env: PRIVATE_KEY. |
|
|
43
|
+
| `8004-register` | `<name>` `[imageUrl]` `[description]` | EIP-8004 register NFT. Env: PRIVATE_KEY. |
|
|
44
|
+
| `8004-balance` | `<ownerAddress>` | EIP-8004 query balance. |
|
|
45
|
+
| `events` | `<fromBlock>` `[toBlock]` | TokenManager2 events (BSC). |
|
|
46
|
+
| `tax-info` | `<tokenAddress>` | TaxToken fee/tax config. |
|
|
47
|
+
| `verify` | *(none)* | Config + events (last 50 blocks). Read-only. |
|
|
48
|
+
|
|
49
|
+
Create token optional (omit if empty): `--web-url=`, `--twitter-url=`, `--telegram-url=`. Presale: `--pre-sale=<BNB>` in ether (e.g. `0.001`). Tax: `--tax-options=<path>` or `--tax-token --tax-fee-rate=5 --tax-burn-rate=0 --tax-divide-rate=0 --tax-liquidity-rate=100 --tax-recipient-rate=0 --tax-recipient-address= --tax-min-sharing=100000` (burn+divide+liquidity+recipient=100).
|
|
50
|
+
|
|
51
|
+
## Install (project)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd four-meme-ai
|
|
55
|
+
npm install
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Environment variables (without OpenClaw)
|
|
59
|
+
|
|
60
|
+
When you **do not** use OpenClaw, the CLI reads `PRIVATE_KEY` and `BSC_RPC_URL` from the process environment. Set them in one of these ways:
|
|
61
|
+
|
|
62
|
+
**Option 1: `.env` file in the project root**
|
|
63
|
+
|
|
64
|
+
Create a file named `.env` in the repo root (same directory as `package.json`):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# .env (do not commit this file)
|
|
68
|
+
PRIVATE_KEY=your_hex_private_key_with_or_without_0x_prefix
|
|
69
|
+
BSC_RPC_URL=https://bsc-dataseed.binance.org
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Then run commands so that the shell loads `.env` before invoking `fourmeme` (e.g. use a tool that loads `.env`, or `export $(cat .env | xargs)` then `npx fourmeme ...`). The scripts themselves do not load `.env`; you must ensure the variables are in the environment when `npx fourmeme` runs.
|
|
73
|
+
|
|
74
|
+
**Option 2: export in the shell**
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
export PRIVATE_KEY=your_hex_private_key
|
|
78
|
+
export BSC_RPC_URL=https://bsc-dataseed.binance.org
|
|
79
|
+
npx fourmeme create-instant --image=./logo.png --name=MyToken --short-name=MTK --desc="Desc" --label=AI
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- **PRIVATE_KEY**: Required for any command that signs or sends a transaction (create-api, create-chain, buy, sell, send, 8004-register). Hex string; `0x` prefix optional.
|
|
83
|
+
- **BSC_RPC_URL**: Optional. BSC RPC endpoint; if unset, scripts use a default public BSC RPC.
|
|
84
|
+
|
|
85
|
+
**Security**: Do not commit `.env` or share your private key. Add `.env` to `.gitignore` if you use a `.env` file.
|
|
86
|
+
|
|
87
|
+
## Install as OpenClaw plugin
|
|
88
|
+
|
|
89
|
+
This repo is an [OpenClaw](https://docs.openclaw.ai)-compatible plugin. Install so the skill is loaded and **PRIVATE_KEY / BSC_RPC_URL** are only injected for this skill (via `skills.entries`):
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
openclaw plugins install /path/to/four-meme-ai
|
|
93
|
+
# or from npm (if published): openclaw plugins install @scope/four-meme-ai
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Then in `~/.openclaw/openclaw.json` set:
|
|
97
|
+
|
|
98
|
+
```json5
|
|
99
|
+
{
|
|
100
|
+
skills: {
|
|
101
|
+
entries: {
|
|
102
|
+
"four-meme-ai": {
|
|
103
|
+
enabled: true,
|
|
104
|
+
env: {
|
|
105
|
+
PRIVATE_KEY: "0x...",
|
|
106
|
+
BSC_RPC_URL: "https://bsc-dataseed.binance.org"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
See [skills/four-meme-integration/SKILL.md](skills/four-meme-integration/SKILL.md) for the full OpenClaw config section and environment variable details.
|
|
115
|
+
|
|
116
|
+
## Verify the skill (read-only)
|
|
117
|
+
|
|
118
|
+
After `npm install`, run:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npx fourmeme verify
|
|
122
|
+
```
|
|
123
|
+
(In project dir, use `npx fourmeme`; or run `npm link` then `fourmeme` from anywhere.)
|
|
124
|
+
|
|
125
|
+
This runs **config** (four.meme API) and **events** for the last 50 blocks on BSC. No private key or on-chain writes. For full verification steps, see [VERIFICATION.md](VERIFICATION.md).
|
|
126
|
+
|
|
127
|
+
## Docs
|
|
128
|
+
|
|
129
|
+
- Skill instructions (agent behavior, safety, flows): `skills/four-meme-integration/SKILL.md`
|
|
130
|
+
- Claude/Claude Code guidelines: `CLAUDE.md`
|
|
131
|
+
- References: `skills/four-meme-integration/references/` (API, contract addresses, trading, events, tax, errors)
|
|
132
|
+
- Official four.meme API and contracts: [Protocol Integration](https://four-meme.gitbook.io/four.meme/brand/protocol-integration) (API documents, ABIs)
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT
|