@four-meme/four-meme-ai 1.0.0 → 1.0.2

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
@@ -57,9 +57,9 @@ Never ask the user to paste a private key into chat. All private keys must come
57
57
  3. **Create token**:
58
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
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**:
61
- - Use env `BSC_RPC_URL` when set; otherwise fall back to public BSC RPC defaults (see scripts).
62
- - Private key envs: `PRIVATE_KEY` or `FOURMEME_PRIVATE_KEY` (no key should ever be requested from the user in plain text).
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` (or `FOURMEME_PRIVATE_KEY`) and optionally `BSC_RPC_URL` via the process environment—e.g. a `.env` file in the project root (loaded by the user before running `npx fourmeme`) or shell `export`. The scripts do not load `.env` automatically; the variables must be in the environment when the CLI runs. Do not ask the user to paste a private key in chat.
63
63
 
64
64
  ## CLI Usage (fourmeme)
65
65
 
package/README.md CHANGED
@@ -27,6 +27,35 @@ cd four-meme-ai
27
27
  npm install
28
28
  ```
29
29
 
30
+ ## Environment variables (without OpenClaw)
31
+
32
+ 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:
33
+
34
+ **Option 1: `.env` file in the project root**
35
+
36
+ Create a file named `.env` in the repo root (same directory as `package.json`):
37
+
38
+ ```bash
39
+ # .env (do not commit this file)
40
+ PRIVATE_KEY=your_hex_private_key_with_or_without_0x_prefix
41
+ BSC_RPC_URL=https://bsc-dataseed.binance.org
42
+ ```
43
+
44
+ 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.
45
+
46
+ **Option 2: export in the shell**
47
+
48
+ ```bash
49
+ export PRIVATE_KEY=your_hex_private_key
50
+ export BSC_RPC_URL=https://bsc-dataseed.binance.org
51
+ npx fourmeme create-api ./logo.png MyToken MTK "Desc" AI
52
+ ```
53
+
54
+ - **PRIVATE_KEY** (or **FOURMEME_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.
55
+ - **BSC_RPC_URL**: Optional. BSC RPC endpoint; if unset, scripts use a default public BSC RPC.
56
+
57
+ **Security**: Do not commit `.env` or share your private key. Add `.env` to `.gitignore` if you use a `.env` file.
58
+
30
59
  ## Install as OpenClaw plugin
31
60
 
32
61
  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`):
@@ -42,7 +71,7 @@ Then in `~/.openclaw/openclaw.json` set:
42
71
  {
43
72
  skills: {
44
73
  entries: {
45
- "four-meme-integration": {
74
+ "four-meme-ai": {
46
75
  enabled: true,
47
76
  env: {
48
77
  PRIVATE_KEY: "0x...",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@four-meme/four-meme-ai",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Four.meme AI skills for creating and trading meme tokens (BSC only)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,8 +48,7 @@
48
48
  "typescript": "^5.0.0",
49
49
  "viem": "^2.0.0"
50
50
  },
51
- "dependencies": {
52
- "four-meme-ai": "^1.0.0"
53
- },
54
- "publishConfig": { "access": "public" }
51
+ "publishConfig": {
52
+ "access": "public"
53
+ }
55
54
  }
@@ -12,8 +12,8 @@ description: |
12
12
  - Querying TaxToken fee/tax config on-chain (BSC only)
13
13
  - **Discover → detail → quote → execute**: use token-rankings / token-list / events to find tokens → token-get / token-info for details → quote-buy / quote-sell to estimate → buy / sell to execute (see "Agent workflow: buy/sell from rankings or events" below).
14
14
 
15
- BSC only (Arbitrum/Base not supported). Requires npm install. Create/chain need PRIVATE_KEY. TokenManager V1 not supported.
16
- **OpenClaw**: PRIVATE_KEY and BSC_RPC_URL are declared in metadata and injected by OpenClaw only when this skill is enabled (only this skill can access them). Configure in `~/.openclaw/openclaw.json` under `skills.entries["four-meme-ai"].env` or `apiKey`.
15
+ BSC only (Arbitrum/Base not supported). **Before use, the fourmeme CLI must be installed** (e.g. `npm install -g @four-meme/four-meme-ai@latest`). Create/chain need PRIVATE_KEY. TokenManager V1 not supported.
16
+ **OpenClaw**: PRIVATE_KEY and BSC_RPC_URL are declared in metadata and injected by OpenClaw only when this skill is **enabled** (only this skill can access them). **Two steps required**: (1) Configure private key in the skill’s `apiKey` or `skills.entries["four-meme-ai"].env`; (2) **Enable this skill** in the agent/session so OpenClaw injects the env. See "PRIVATE_KEY and BSC_RPC_URL" below.
17
17
  allowed-tools:
18
18
  - Bash(fourmeme *)
19
19
  - Bash(npx fourmeme *)
@@ -95,6 +95,16 @@ See the **CLI (fourmeme)** table and sections below for commands and arguments.
95
95
 
96
96
  BSC only; all commands output JSON. Run `fourmeme --help` for usage.
97
97
 
98
+ ## Installation (required before use)
99
+
100
+ **You must install the fourmeme CLI before using this skill.** Recommended (global):
101
+
102
+ ```bash
103
+ npm install -g @four-meme/four-meme-ai@latest
104
+ ```
105
+
106
+ After installation, run commands with `fourmeme <command> [args]`. If you use a local install instead, use `npx fourmeme <command> [args]` from the project root.
107
+
98
108
  This skill provides: token creation (API + chain), buy/sell quotes and execution, token info/list/rankings, event listening, Tax token fee queries, send, and EIP-8004 identity NFT register and balance. Contract addresses and version notes: [references/contract-addresses.md](references/contract-addresses.md). **TokenManager V1 is not supported in this skill.**
99
109
 
100
110
  ## Create token flow
@@ -153,14 +163,22 @@ When the user asks to “buy/sell based on rankings or activity”, the Agent sh
153
163
 
154
164
  ## CLI (fourmeme)
155
165
 
156
- Run `npx fourmeme --help` for usage. From project root after `npm install`, use **`npx fourmeme <command> [args]`** (local install does not add `fourmeme` to PATH; use `npm link` for global `fourmeme`).
166
+ Run `fourmeme --help` for usage. After **global install** (`npm install -g @four-meme/four-meme-ai@latest`), use **`fourmeme <command> [args]`**. With a local install only, use **`npx fourmeme <command> [args]`** from the project root.
167
+
168
+ ### PRIVATE_KEY and BSC_RPC_URL
169
+
170
+ **When using OpenClaw**
171
+ This skill declares `requires.env: ["PRIVATE_KEY"]` and `primaryEnv: "PRIVATE_KEY"` in metadata; OpenClaw injects them only when an agent runs with **this skill enabled** (other skills cannot access them).
157
172
 
158
- ### OpenClaw config (PRIVATE_KEY / BSC_RPC_URL)
173
+ **Required steps:**
174
+ 1. **Configure private key**: In the Skill management page, set the four-meme-ai skill’s **apiKey** (corresponds to `primaryEnv: "PRIVATE_KEY"`), or set `PRIVATE_KEY` under `skills.entries["four-meme-ai"].env` in `~/.openclaw/openclaw.json`. Optionally set **BSC_RPC_URL** in global env if needed.
175
+ 2. **Enable this skill**: In the agent or session, ensure the **four-meme-ai** skill is **enabled**. Only when the skill is enabled will OpenClaw inject `PRIVATE_KEY` (and `BSC_RPC_URL`) into the process; otherwise create/buy/sell/send/8004-register will fail with missing key.
159
176
 
160
- This skill declares `requires.env: ["PRIVATE_KEY"]` and `primaryEnv: "PRIVATE_KEY"` in metadata; OpenClaw injects them when an agent runs with **only this skill** enabled (other skills cannot access them).
177
+ **When not using OpenClaw (standalone)**
178
+ Set **PRIVATE_KEY** (or **FOURMEME_PRIVATE_KEY**) and optionally **BSC_RPC_URL** via the process environment so they are available when running `npx fourmeme` or `node bin/fourmeme.cjs`:
161
179
 
162
- - **apiKey**: Corresponds to `primaryEnv: "PRIVATE_KEY"`; you can enter the private key in the four-meme-ai skill’s `apiKey` field in the Skill management page.
163
- - **env**: Injected into the agent process for this skill; BSC_RPC_URL can be set in the global env management page.
180
+ - **.env file**: Create a `.env` file in the project root with lines like `PRIVATE_KEY=...` and `BSC_RPC_URL=...`. The CLI scripts do not load `.env` automatically; you must load it before running (e.g. `export $(cat .env | xargs)` or a tool that injects `.env` into the process). Do not commit `.env`; add it to `.gitignore`.
181
+ - **Shell export**: `export PRIVATE_KEY=your_hex_key` and `export BSC_RPC_URL=https://bsc-dataseed.binance.org` (or another BSC RPC), then run `npx fourmeme <command> ...`.
164
182
 
165
183
  | Need | Command | When |
166
184
  |------|---------|------|