Commit Graph
19 Commits
Author SHA1 Message Date
zhongsongzhi-cmykandClaude 227011b834 fix(config): make project .env override global config as documented
src/config.ts loaded ~/.config/gmgn/.env with override:true and then the
cwd .env without override, so the global file always won — the opposite
of what Readme, Readme.zh, CLAUDE.md and the gmgn-cooking skill promise.
A user who updated GMGN_PRIVATE_KEY in a project .env kept signing with
the stale global key and got AUTH_SIGNATURE_INVALID.

Load the cwd .env first and the global file second, both without
override, so precedence is shell env > project .env > global .env.
`config --check` reuses the same loader instead of its own copy.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-25 23:04:53 +08:00
zhongsongzhi-cmykandClaude 35c5e05cbc docs(swap,cooking): drop per-chain fee bounds from CLI help and docs
gmgn-openapi-service no longer clamps priority_fee / tip_fee / gas_price /
max_fee_per_gas / max_priority_fee_per_gas to per-chain min/max (openapi MR
!114, merged 2026-10-19). Fees are forwarded as-is and the trade backend
enforces its global ceilings; the server only rejects non-numeric or
negative values, plus BSC "0" for the EIP-1559 fields.

Remove the stale "≥ X" / "Clamped per chain minimums" wording from swap.ts
option help, gmgn-swap and gmgn-cooking SKILL.md, and docs/cli-usage.md, and
replace the gmgn-swap "EIP-1559 minimum values" note with the current rules.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-23 11:28:48 +08:00
zhongsongzhi-cmykandClaude 866876a65e fix(market): add quote address type 26 to robinhood trenches defaults
Align with the server-side default (gmgn-openapi-service trenchesDefaults["robinhood"].QuoteAddressType)
that went live in July. Without it, default trenches queries on robinhood miss tokens paired
with quote type 26 (RWA pools).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 14:16:15 +08:00
zhongsongzhi-cmykandClaude fb65aa487a feat(cli): add callout record / global read commands and gmgn-callout skill
gmgn-openapi-service already exposes two read-only call-out routes on
openapi.gmgn.ai behind the normal API-key auth, so the CLI can reach them
without the separate papi AK/SK channel:

- gmgn-cli callout record -> POST /v1/callout/get_record: one wallet's
  call-outs over the last 30 days plus the 7d/30d summary card
- gmgn-cli callout global -> POST /v1/callout/global: multi-chain feed with
  only-kol / only-declaration / only-safe / holding-range filters

Both are weight 3. Chains are validated against the service's 13-chain
callout list, kept separate from the tradable VALID_CHAINS. Limit is checked
against the service's 0-50 bound; holding bounds are sent as decimal
strings. /v1/callout/token is deliberately left out: the service removed it
(prod returns 404) and publishing call-outs is not part of OpenAPI.

Docs: new skills/gmgn-callout/SKILL.md, CLI reference in docs/cli-usage.md
and both Readmes, routing rows in CLAUDE.md.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 16:32:21 +08:00
zhongsongzhi-cmykandClaude c4259c267e feat(cli): explain RATE_LIMIT_BANNED_MAX and PLAN_UPGRADE_REQUIRED
The OpenAPI service now returns two new rate-limit codes:

- RATE_LIMIT_BANNED_MAX (429): the ban has reached its 5-minute ceiling
  because requests kept arriving during the cooldown. The CLI now says to
  stop all requests until reset_at instead of the generic retry hint.
- PLAN_UPGRADE_REQUIRED (403): the route's weight exceeds the plan's bucket
  capacity (e.g. Free on swap / quote / follow-wallet), so it can never
  succeed. The CLI surfaces the upgrade message; previously 403s were
  printed without it.

Skills and docs/cli-usage.md tell agents not to retry either code, and the
stale rate=10/capacity=10 note is replaced by the plan tiers.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 11:57:18 +08:00
zhongsongzhi-cmyk b1c6bd095c fix(cli): remove interactive trade confirmations 2026-10-14 17:50:02 +08:00
zhongsongzhi-cmykandClaude b5cca5cc6d fix(confirm): address review findings on the trade confirmation gate
- Escape every non-visible character in the confirmation block by Unicode
  property (\p{C}, \p{Z}, \p{M}, Default_Ignorable_Code_Point, U+2800) instead
  of a hand-kept list; soft hyphens, Hangul fillers, tag characters etc. can no
  longer make a fee-share username look like another.
- Fold only fields a command declares as blobs (cooking --image); key fields
  are always shown in full. multi-swap and strategy create/cancel now validate
  their addresses like swap does.
- Judge protections on the values being sent (min_output 0, anti_mev_mode off,
  expire_in 0 now warn), and reject NaN / Infinity / negative --slippage,
  --percent, --expire-in, --dev-wallet-bps before they reach a signed body.
  --gas-price is converted gwei→wei exactly (was float-rounded).
- Total tip / priority fees per container, including sell_param / buy_param and
  buy_trade_config / sell_trade_config, so section ① no longer understates.
- Anti-MEV warning only where accurate: none for swap (documented default on),
  "server default applies" for multi-swap / strategy on sol / bsc / eth, and
  an explicit "off" warning for cooking create on sol.
- Bind confirmations to method + route + query + body, and require one for
  every signed non-GET request (deny by default) instead of a path allowlist.
- In interactive mode write the block to /dev/tty, so the process launcher
  cannot filter what the human reads before typing yes.
- Display: swap --percent shows the bps line first and marks input_amount as
  ignored; strategy amount_in_percent and multi-swap per-wallet bps show "% of
  balance"; multi-swap shows the wallet count.
- Group risky leaves in linear time; load credentials before confirmation so a
  missing key is reported before the user types yes.
- Sync skills/gmgn-swap, skills/gmgn-cooking and docs/cli-usage.md with the
  gated order strategy cancel and its --yes flag.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-29 16:45:26 +08:00
zhongsongzhi-cmykandClaude 2d6f565590 fix(confirm): derive trade confirmation from the signed body and verify it before signing
The confirmation prompt for swap / multi-swap / order strategy create /
cooking create printed a hand-written summary that omitted fields still sent
and signed: tip / priority fees, gas, min_output_amount, condition_orders
(auto TP/SL), check_price, sell_param / buy_param, buy_wallets,
snip_buy_wallets, dev_wallet_bps and the creator fee-share lists. A
prompt-injected agent could hide any of them behind a normal-looking summary.

Layer 1 - confirmTrade now takes the request object itself, flattens it to
every leaf field and prints four sections: key fields; risky fields, each
with a plain-language consequence and never folded; protections that are NOT
set (no min output, no slippage limit, anti-MEV not requested, no expiry);
and every remaining field. Section 4 is "whatever 1-3 did not print", so new
parameters appear automatically. Long strings (e.g. --image base64) fold to
<string, size, sha256>, gas_price is echoed in gwei, and command-side totals
are added (extra fees, total buy spend across dev / bundle / snipe wallets,
creator-fee recipients). Control, C1, bidi and zero-width characters are
escaped so a value cannot rewrite or hide lines.

Layer 2 - confirmTrade records the canonical-JSON sha256 of the confirmed
body; authSignedRequest refuses to sign swap, multi_swap, strategy/create,
strategy/cancel and create_token unless the exact body being signed was
confirmed, consuming the confirmation so it authorizes one signature. This
blocks a new command that forgets confirmTrade and a body mutated after
confirmation.

Layer 3 - order strategy cancel gets the same gate and --yes flag; cooking
create JSON options fail with a clear error instead of a raw SyntaxError;
Readme / Readme.zh now state the confirmation block is the complete request
body about to be signed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-29 15:38:44 +08:00
zhongsongzhi-cmyk 0ffec3f73a docs(cli): synchronize OpenAPI contracts 2026-09-16 16:41:01 +08:00
zhongsongzhi-cmyk af73701a8d chore: bump gmgn-cli to 1.6.3 2026-09-14 19:46:20 +08:00
zhongsongzhi-cmyk a8f40a4be3 feat(cli): document Pro-only 1s kline 2026-09-14 19:45:58 +08:00
zhongsongzhi-cmyk d2e4e96865 feat: document Pro-only 1s kline support 2026-09-14 19:45:58 +08:00
zhongsongzhi-cmyk 263e699397 feat: support arbitrum and hyperevm 2026-09-11 11:31:49 +08:00
zhongsongzhi-cmykandClaude Opus 4.8 6572db0e2d docs: correct market trenches --limit / --launchpad-platform description
The CLI docs promised behavior the API does not deliver:

- --limit: was "max 80 (default 80)". In reality it is best-effort only —
  the new_creation category is served from a fixed live window (~60), so
  larger and smaller --limit values both tend to return ~60. Documented as
  best-effort.
- --launchpad-platform: was "default: all platforms for the chain". In
  reality, when omitted the server injects a fixed per-chain default
  allow-list (not literally all platforms), and passing values REPLACES that
  allow-list (fewer platforms => less data). Platforms outside the list
  (incl. some newer RWA / tokenized-stock launchpads) are filtered out.
- Added the previously-missing robinhood platform slug list, and noted that
  arc/stable apply no launchpad filter (all platforms).

Docs only; no code change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 15:36:35 +08:00
zhongsongzhi-cmyk 25f3452722 fix(cli): close HTTP dispatcher before exiting on errors 2026-09-01 15:34:49 +08:00
zhongsongzhi-cmyk 37a078be40 feat: show plan upgrade guidance on rate limits 2026-08-26 20:15:16 +08:00
zhongsongzhi-cmyk 8eaee1cb03 feat(portfolio): add batch wallet profits command 2026-08-20 15:57:17 +08:00
zhongsongzhi-cmyk 8036b3c096 fix(trenches): defer launchpad defaults to service 2026-08-15 11:46:23 +08:00
zhongsongzhi-cmykandClaude Opus 4.8 bd4af1f345 docs(gmgn-market): add market search subcommand
Document the new `market search` command backed by the openapi-service
`GET /v1/market/search` endpoint (search_v3). Covers parameters, the
coins/wallets response shape, usage examples, and output format, plus
updates to the frontmatter, sub-commands table, supported chains note,
rate-limit table, and Notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-12 16:25:09 +08:00