@four-meme/four-meme-ai 1.0.7 → 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 +91 -91
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/bin/fourmeme.cjs +7 -4
- package/package.json +1 -1
- package/skills/four-meme-integration/SKILL.md +11 -8
- package/skills/four-meme-integration/references/token-query-api.md +28 -24
- 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/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/skills/four-meme-integration/scripts/token-list.ts +102 -20
- package/skills/four-meme-integration/scripts/token-rankings.ts +122 -14
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` | `[--
|
|
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=
|
|
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
|
-
|
|
91
|
-
|
|
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
|
-
|
|
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
|
@@ -120,9 +120,9 @@ Set **PRIVATE_KEY** and optionally **BSC_RPC_URL** via the process environment s
|
|
|
120
120
|
|------|---------|------|
|
|
121
121
|
| Public config | `fourmeme config` | Get raisedToken / config (no auth) |
|
|
122
122
|
| Token info (on-chain) | `fourmeme token-info <tokenAddress>` | Version, tokenManager, price, offers (BSC Helper3) |
|
|
123
|
-
| Token list (REST) | `fourmeme token-list [--orderBy=] [--
|
|
123
|
+
| Token list (REST) | `fourmeme token-list` — POST `/public/token/search`; legacy flags `[--orderBy=] …` plus legacy `--queryMode=Binance|USD1` (infers `listType`), or new `[--type=] [--listType=] [--keyword=] [--tag=] [--status=] [--sort=] [--version=]` | Filtered, paginated token list |
|
|
124
124
|
| Token detail (REST) | `fourmeme token-get <tokenAddress>` | Token detail and trading info (get/v2) |
|
|
125
|
-
| Token rankings (REST) | `fourmeme token-rankings <orderBy> [--barType
|
|
125
|
+
| Token rankings (REST) | `fourmeme token-rankings <orderBy|type> [--barType=…]` | POST `/public/token/ranking`; legacy orderBy or native RankingType (e.g. VOL_DAY_1); optional filters `--pageSize` `--symbol` `--version` `--rankingKind` `minCap` `maxCap` `minVol` `maxVol` `minHold` `maxHold` … |
|
|
126
126
|
| Buy quote | `fourmeme quote-buy <token> <amountWei> [fundsWei]` | Estimate only; no transaction |
|
|
127
127
|
| Sell quote | `fourmeme quote-sell <token> <amountWei>` | Estimate only; no transaction |
|
|
128
128
|
| **Execute buy** | `fourmeme buy <token> amount <amountWei> <maxFundsWei>` | Buy fixed amount (needs PRIVATE_KEY) |
|
|
@@ -210,10 +210,13 @@ On-chain query (Helper3); returns version, tokenManager, price, offers, etc.
|
|
|
210
210
|
|
|
211
211
|
Four.meme REST API; use `Accept: application/json`; no login or cookie.
|
|
212
212
|
|
|
213
|
-
**Token list (filter / paginate)**
|
|
213
|
+
**Token list (filter / paginate)** — `POST /public/token/search`
|
|
214
214
|
```bash
|
|
215
215
|
fourmeme token-list [--orderBy=Hot] [--pageIndex=1] [--pageSize=30] [--tokenName=] [--symbol=] [--labels=] [--listedPancake=false]
|
|
216
|
+
fourmeme token-list [--type=HOT] [--listType=NOR] [--keyword=] [--tag=Meme,AI] [--status=PUBLISH|TRADE|ALL] [--sort=DESC] [--version=]
|
|
217
|
+
fourmeme token-list [--queryMode=Binance|USD1] [--listedPancake=true|false] (legacy shortcut; infers listType BIN/BIN_DEX or USD1/USD1_DEX)
|
|
216
218
|
```
|
|
219
|
+
Legacy `listedPancake=false` maps to `status=PUBLISH`; use `--status=ALL` when you need all statuses.
|
|
217
220
|
|
|
218
221
|
**Token detail and trading info**
|
|
219
222
|
```bash
|
|
@@ -221,11 +224,11 @@ fourmeme token-get <tokenAddress>
|
|
|
221
224
|
```
|
|
222
225
|
API: GET `/private/token/get/v2?address=...`
|
|
223
226
|
|
|
224
|
-
**Rankings**
|
|
227
|
+
**Rankings** — `POST /public/token/ranking`
|
|
225
228
|
```bash
|
|
226
|
-
fourmeme token-rankings <orderBy> [--barType=HOUR24]
|
|
229
|
+
fourmeme token-rankings <orderBy|type> [--barType=HOUR24] [--pageSize=20] [--symbol=] [--version=] [--rankingKind=] [--minCap=] [--maxCap=] [--minVol=] [--maxVol=] [--minHold=] [--maxHold=] …
|
|
227
230
|
```
|
|
228
|
-
orderBy: `Time`
|
|
231
|
+
Legacy orderBy: `Time` → NEW | `ProgressDesc` | `TradingDesc` (volume window via `--barType`: HOUR24→VOL_DAY_1, HOUR4, HOUR1, MIN30, MIN5) | `Hot` | `Graduated` → DEX. Or pass API `type` directly (e.g. `VOL_DAY_1`, `CAP`, `BURN`). Output JSON.
|
|
229
232
|
|
|
230
233
|
### quote-buy / quote-sell (estimate only; no transaction)
|
|
231
234
|
|
|
@@ -328,8 +331,8 @@ See [references/tax-token-query.md](references/tax-token-query.md).
|
|
|
328
331
|
This skill supports a flow to discover tokens, get details, quote, and execute. The following is an example workflow, not a trading recommendation: discover → detail → quote → execute.
|
|
329
332
|
|
|
330
333
|
1. **Discover** (one or more of):
|
|
331
|
-
- **Rankings**: `fourmeme token-rankings <orderBy>` (
|
|
332
|
-
- **List**: `fourmeme token-list
|
|
334
|
+
- **Rankings**: `fourmeme token-rankings <orderBy or type>` (legacy: Hot, TradingDesc, Time, ProgressDesc, Graduated; or e.g. VOL_DAY_1); use token addresses from the response.
|
|
335
|
+
- **List**: `fourmeme token-list` (`/public/token/search`) with `--orderBy` / `--type`, `--labels` / `--tag`, etc., to filter and get addresses.
|
|
333
336
|
- **On-chain events**: `fourmeme events <fromBlock> [toBlock]`; parse token addresses from TokenCreate/TokenPurchase, etc., for "newly created" or "recent trades" strategies.
|
|
334
337
|
2. **Get details**: For each candidate, call `fourmeme token-get <address>` (REST detail and trading info) or `fourmeme token-info <address>` (on-chain version, tokenManager, price, offers) to filter or display.
|
|
335
338
|
3. **Quote**: `fourmeme quote-buy <token> <amountWei> [fundsWei]` / `fourmeme quote-sell <token> <amountWei>` for estimated cost or proceeds.
|
|
@@ -4,19 +4,21 @@ Base: `https://four.meme/meme-api/v1`. Requests need `Accept: application/json`;
|
|
|
4
4
|
|
|
5
5
|
## 1. Token list (filter / paginate)
|
|
6
6
|
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
**POST** `/public/token/search`
|
|
8
|
+
JSON body: `type`, `listType`, `pageIndex`, `pageSize`, `status`, `sort`, optional `keyword`, `symbol`, `tag` (array), `version`.
|
|
9
|
+
|
|
10
|
+
| Parameter | Description |
|
|
11
|
+
|-----------|-------------|
|
|
12
|
+
| type | Ranking sort context: NEW, HOT, PROGRESS, VOL, LAST, CAP, DEX, BURN, … |
|
|
13
|
+
| listType | NOR, NOR_DEX, BIN, USD1, BIN_DEX, USD1_DEX, ADV |
|
|
14
|
+
| status | PUBLISH, TRADE, ALL |
|
|
15
|
+
| sort | DESC, ASC |
|
|
16
|
+
| keyword | Search keyword |
|
|
17
|
+
| symbol | Quote symbol (e.g. BNB, USDT) |
|
|
18
|
+
| tag | Label filters (e.g. Meme, AI) |
|
|
19
|
+
| version | V9 (tax), V10 (AI); omit for all |
|
|
20
|
+
|
|
21
|
+
CLI: `fourmeme token-list` — legacy flags still map to the above (e.g. `--orderBy` → `type`, `--tokenName` → `keyword`, `--labels` → `tag`, `--listedPancake=false` → `status=PUBLISH`). See script header for full list.
|
|
20
22
|
|
|
21
23
|
## 2. Token detail and trading info
|
|
22
24
|
|
|
@@ -24,17 +26,19 @@ CLI: `fourmeme token-list [--orderBy=Hot] [--pageIndex=1] [--pageSize=30] [--tok
|
|
|
24
26
|
|
|
25
27
|
CLI: `fourmeme token-get <tokenAddress>`
|
|
26
28
|
|
|
27
|
-
## 3. Rankings
|
|
29
|
+
## 3. Rankings
|
|
30
|
+
|
|
31
|
+
**POST** `/public/token/ranking`
|
|
32
|
+
JSON body: `type` (required RankingType), `pageSize`, optional `rankingKind`, `version`, `symbol`, `minCap`, `maxCap`, `minVol`, `maxVol`, `minHold`, `maxHold`.
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
| Legacy CLI orderBy | Maps to type |
|
|
35
|
+
|--------------------|--------------|
|
|
36
|
+
| Time | NEW |
|
|
37
|
+
| ProgressDesc | PROGRESS |
|
|
38
|
+
| TradingDesc | VOL_DAY_1 (default); `--barType` selects VOL_HOUR_1, VOL_HOUR_4, VOL_MIN_30, VOL_MIN_5, … |
|
|
39
|
+
| Hot | HOT |
|
|
40
|
+
| Graduated | DEX |
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|---------|-------------|
|
|
34
|
-
| Time | Newest tokens |
|
|
35
|
-
| ProgressDesc | Fundraise progress ranking |
|
|
36
|
-
| TradingDesc | 24h trading volume (can use barType: HOUR24) |
|
|
37
|
-
| Hot | Hot ranking |
|
|
38
|
-
| Graduated | Recently graduated / launched |
|
|
42
|
+
You may also pass a native `type` as the first argument (e.g. `VOL_DAY_1`, `CAP`, `BURN`).
|
|
39
43
|
|
|
40
|
-
CLI: `fourmeme token-rankings <orderBy> [--barType=HOUR24]
|
|
44
|
+
CLI: `fourmeme token-rankings <orderBy|type> [--barType=HOUR24] [--pageSize=20] [--symbol=] [--version=] …`
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* EIP-8004 NFT – query balance (number of identity NFTs owned by address).
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* npx tsx 8004-balance.ts <ownerAddress>
|
|
7
|
-
*
|
|
8
|
-
* Optional env: BSC_RPC_URL, 8004_NFT_ADDRESS.
|
|
9
|
-
* Default contract: 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 (BSC).
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { createPublicClient, http, parseAbi } from 'viem';
|
|
13
|
-
import { bsc } from 'viem/chains';
|
|
14
|
-
|
|
15
|
-
const DEFAULT_8004_NFT = '0x8004A169FB4a3325136EB29fA0ceB6D2e539a432' as const;
|
|
16
|
-
|
|
17
|
-
const ABI = parseAbi(['function balanceOf(address owner) view returns (uint256)']);
|
|
18
|
-
|
|
19
|
-
function isAddress(s: string): boolean {
|
|
20
|
-
return /^0x[0-9a-fA-F]{40}$/.test(s);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function main() {
|
|
24
|
-
const ownerAddress = process.argv[2];
|
|
25
|
-
if (!ownerAddress || !isAddress(ownerAddress)) {
|
|
26
|
-
console.error('Usage: 8004-balance.ts <ownerAddress>');
|
|
27
|
-
console.error(' ownerAddress: 0x... wallet address');
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const contractAddress = (process.env['8004_NFT_ADDRESS'] || process.env.EIP8004_NFT_ADDRESS || DEFAULT_8004_NFT) as `0x${string}`;
|
|
32
|
-
const rpcUrl = process.env.BSC_RPC_URL || 'https://bsc-dataseed.binance.org';
|
|
33
|
-
|
|
34
|
-
const client = createPublicClient({
|
|
35
|
-
chain: bsc,
|
|
36
|
-
transport: http(rpcUrl),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const balance = await client.readContract({
|
|
40
|
-
address: contractAddress,
|
|
41
|
-
abi: ABI,
|
|
42
|
-
functionName: 'balanceOf',
|
|
43
|
-
args: [ownerAddress as `0x${string}`],
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
console.log(JSON.stringify({ owner: ownerAddress, balance: Number(balance) }, null, 2));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
main().catch((e) => {
|
|
50
|
-
console.error(e.message || e);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* EIP-8004 NFT – query balance (number of identity NFTs owned by address).
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx tsx 8004-balance.ts <ownerAddress>
|
|
7
|
+
*
|
|
8
|
+
* Optional env: BSC_RPC_URL, 8004_NFT_ADDRESS.
|
|
9
|
+
* Default contract: 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 (BSC).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { createPublicClient, http, parseAbi } from 'viem';
|
|
13
|
+
import { bsc } from 'viem/chains';
|
|
14
|
+
|
|
15
|
+
const DEFAULT_8004_NFT = '0x8004A169FB4a3325136EB29fA0ceB6D2e539a432' as const;
|
|
16
|
+
|
|
17
|
+
const ABI = parseAbi(['function balanceOf(address owner) view returns (uint256)']);
|
|
18
|
+
|
|
19
|
+
function isAddress(s: string): boolean {
|
|
20
|
+
return /^0x[0-9a-fA-F]{40}$/.test(s);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function main() {
|
|
24
|
+
const ownerAddress = process.argv[2];
|
|
25
|
+
if (!ownerAddress || !isAddress(ownerAddress)) {
|
|
26
|
+
console.error('Usage: 8004-balance.ts <ownerAddress>');
|
|
27
|
+
console.error(' ownerAddress: 0x... wallet address');
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const contractAddress = (process.env['8004_NFT_ADDRESS'] || process.env.EIP8004_NFT_ADDRESS || DEFAULT_8004_NFT) as `0x${string}`;
|
|
32
|
+
const rpcUrl = process.env.BSC_RPC_URL || 'https://bsc-dataseed.binance.org';
|
|
33
|
+
|
|
34
|
+
const client = createPublicClient({
|
|
35
|
+
chain: bsc,
|
|
36
|
+
transport: http(rpcUrl),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const balance = await client.readContract({
|
|
40
|
+
address: contractAddress,
|
|
41
|
+
abi: ABI,
|
|
42
|
+
functionName: 'balanceOf',
|
|
43
|
+
args: [ownerAddress as `0x${string}`],
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
console.log(JSON.stringify({ owner: ownerAddress, balance: Number(balance) }, null, 2));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
main().catch((e) => {
|
|
50
|
+
console.error(e.message || e);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
});
|