mirror of
https://github.com/GMGNAI/gmgn-skills.git
synced 2026-08-19 19:18:06 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
123bdba738 | ||
|
|
1d03fb1672 | ||
|
|
6f79600869 | ||
|
|
12ab55bb63 | ||
|
|
aa09490a9b | ||
|
|
2b6c220581 | ||
|
|
e181cba142 | ||
|
|
ee04212098 | ||
|
|
e4496eafeb | ||
|
|
f56cf1f966 |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.2.8",
|
"version": "1.3.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.2.8",
|
"version": "1.3.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^12.1.0",
|
"commander": "^12.1.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.2.8",
|
"version": "1.3.0",
|
||||||
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
|
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ If a local `.env` exists but lacks `GMGN_API_KEY` / `GMGN_PRIVATE_KEY`, either a
|
|||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
All cooking routes go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second.
|
All cooking routes go through GMGN's leaky-bucket limiter with `rate=20` and `capacity=20`. Sustained throughput is roughly `20 ÷ weight` requests/second.
|
||||||
|
|
||||||
| Command | Weight |
|
| Command | Weight |
|
||||||
|---------|--------|
|
|---------|--------|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ Use the `gmgn-cli` tool to query K-line data for a token, browse trending tokens
|
|||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
All market routes used by this skill go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second, and the max burst is roughly `floor(10 ÷ weight)` when the bucket is full.
|
All market routes used by this skill go through GMGN's leaky-bucket limiter with `rate=20` and `capacity=20`. Sustained throughput is roughly `20 ÷ weight` requests/second, and the max burst is roughly `floor(20 ÷ weight)` when the bucket is full.
|
||||||
|
|
||||||
| Command | Route | Weight |
|
| Command | Route | Weight |
|
||||||
|---------|-------|--------|
|
|---------|-------|--------|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ Use the `gmgn-cli` tool to query wallet portfolio data based on the user's reque
|
|||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
All portfolio routes used by this skill go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second, and the max burst is roughly `floor(10 ÷ weight)` when the bucket is full.
|
All portfolio routes used by this skill go through GMGN's leaky-bucket limiter with `rate=20` and `capacity=20`. Sustained throughput is roughly `20 ÷ weight` requests/second, and the max burst is roughly `floor(20 ÷ weight)` when the bucket is full.
|
||||||
|
|
||||||
| Command | Route | Weight |
|
| Command | Route | Weight |
|
||||||
|---------|-------|--------|
|
|---------|-------|--------|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ Currency tokens are the base/native assets of each chain. They are used to buy o
|
|||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
All swap-related routes used by this skill go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second, and the max burst is roughly `floor(10 ÷ weight)` when the bucket is full.
|
All swap-related routes used by this skill go through GMGN's leaky-bucket limiter with `rate=20` and `capacity=20`. Sustained throughput is roughly `20 ÷ weight` requests/second, and the max burst is roughly `floor(20 ÷ weight)` when the bucket is full.
|
||||||
|
|
||||||
| Command | Route | Weight |
|
| Command | Route | Weight |
|
||||||
|---------|-------|--------|
|
|---------|-------|--------|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
|
|||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
All token routes used by this skill go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second, and the max burst is roughly `floor(10 ÷ weight)` when the bucket is full.
|
All token routes used by this skill go through GMGN's leaky-bucket limiter with `rate=20` and `capacity=20`. Sustained throughput is roughly `20 ÷ weight` requests/second, and the max burst is roughly `floor(20 ÷ weight)` when the bucket is full.
|
||||||
|
|
||||||
| Command | Route | Weight |
|
| Command | Route | Weight |
|
||||||
|---------|-------|--------|
|
|---------|-------|--------|
|
||||||
@@ -418,13 +418,18 @@ The response is an object with a `list` array. Each item in `list` represents on
|
|||||||
| `maker_token_tags` | Token-specific behavior tags for this wallet (e.g. `["bundler"]`, `["paper_hands"]`, `["top_holder"]`) |
|
| `maker_token_tags` | Token-specific behavior tags for this wallet (e.g. `["bundler"]`, `["paper_hands"]`, `["top_holder"]`) |
|
||||||
| `created_at` | Wallet creation timestamp (Unix seconds); `0` if unknown |
|
| `created_at` | Wallet creation timestamp (Unix seconds); `0` if unknown |
|
||||||
|
|
||||||
|
**Shared Funding**
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| `native_transfer` | First native token (SOL/BNB/ETH) transfer into this wallet — indicates the original funding source; wallets sharing the same `native_transfer.address` are likely funded from a common origin (coordinated wallets / same operator) |
|
||||||
|
|
||||||
**Last Transaction Records**
|
**Last Transaction Records**
|
||||||
|
|
||||||
Each of the following is an object with `name`, `address`, `timestamp`, `tx_hash`, `type`:
|
Each of the following is an object with `name`, `address`, `timestamp`, `tx_hash`, `type`:
|
||||||
|
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
|-------|-------------|
|
|-------|-------------|
|
||||||
| `native_transfer` | Most recent native token (SOL/BNB/ETH) transfer associated with this wallet |
|
|
||||||
| `token_transfer` | Most recent token transfer (buy or sell) |
|
| `token_transfer` | Most recent token transfer (buy or sell) |
|
||||||
| `token_transfer_in` | Most recent inbound token transfer |
|
| `token_transfer_in` | Most recent inbound token transfer |
|
||||||
| `token_transfer_out` | Most recent outbound token transfer |
|
| `token_transfer_out` | Most recent outbound token transfer |
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ Use the `gmgn-cli` tool to query on-chain tracking data based on the user's requ
|
|||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
All tracking routes used by this skill go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second, and the max burst is roughly `floor(10 ÷ weight)` when the bucket is full.
|
All tracking routes used by this skill go through GMGN's leaky-bucket limiter with `rate=20` and `capacity=20`. Sustained throughput is roughly `20 ÷ weight` requests/second, and the max burst is roughly `floor(20 ÷ weight)` when the bucket is full.
|
||||||
|
|
||||||
| Command | Route | Weight |
|
| Command | Route | Weight |
|
||||||
|---------|-------|--------|
|
|---------|-------|--------|
|
||||||
|
|||||||
@@ -290,13 +290,14 @@ const TRENCHES_FILTER_PRESETS: Record<string, Record<string, number | string>> =
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Convert API snake_case field to Commander.js opts key
|
// Convert API snake_case field to Commander.js opts key
|
||||||
// Commander.js camelCase: only converts -[a-z] patterns, digits stay as-is
|
// Commander.js camelCase: converts -[a-z] to uppercase, and removes hyphen before digits
|
||||||
// e.g. min_volume_24h → min-volume-24h → minVolume-24h (digit prefix -24 is NOT converted)
|
// e.g. min_volume_24h → min-volume-24h → minVolume-24h → minVolume24h
|
||||||
// e.g. min_smart_degen_count → min-smart-degen-count → minSmartDegenCount (all letters, converts fully)
|
// e.g. min_smart_degen_count → min-smart-degen-count → minSmartDegenCount
|
||||||
function apiFieldToCliKey(apiField: string): string {
|
function apiFieldToCliKey(apiField: string): string {
|
||||||
return apiField
|
return apiField
|
||||||
.replace(/_/g, '-')
|
.replace(/_/g, '-')
|
||||||
.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase());
|
.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())
|
||||||
|
.replace(/-(\d)/g, '$1');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client-side sort helpers (API does not support server-side sort for trenches)
|
// Client-side sort helpers (API does not support server-side sort for trenches)
|
||||||
|
|||||||
+4
-4
@@ -3,9 +3,9 @@ import { homedir } from "os";
|
|||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
|
||||||
|
|
||||||
// Load global config first (~/.config/gmgn/.env), then project .env (project takes precedence)
|
// Load global config first (~/.config/gmgn/.env, takes precedence), then project .env (supplements only)
|
||||||
loadDotenv({ path: join(homedir(), ".config", "gmgn", ".env") });
|
loadDotenv({ path: join(homedir(), ".config", "gmgn", ".env"), override: true });
|
||||||
loadDotenv({ override: true });
|
loadDotenv();
|
||||||
|
|
||||||
export interface Config {
|
export interface Config {
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
@@ -39,7 +39,7 @@ export function getConfig(requirePrivateKey = false): Config {
|
|||||||
die(PRIVATE_KEY_REQUIRED_MSG);
|
die(PRIVATE_KEY_REQUIRED_MSG);
|
||||||
}
|
}
|
||||||
|
|
||||||
const host = process.env.GMGN_HOST ?? "https://openapi.gmgn.ai";
|
const host = "https://openapi.gmgn.ai";
|
||||||
_config = { apiKey: apiKey!, privateKeyPem, host };
|
_config = { apiKey: apiKey!, privateKeyPem, host };
|
||||||
return _config;
|
return _config;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user