mirror of
https://github.com/GMGNAI/gmgn-skills.git
synced 2026-07-28 01:07:44 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aebe509f29 | |||
| 26ebfe6843 | |||
| 412531f04e | |||
| b0b25118aa | |||
| 0a12f0615d | |||
| 0979d14d6a | |||
| 8729cff4d3 | |||
| 0cf2e514e6 | |||
| 693a63c723 | |||
| 81d67808fa | |||
| 8a095a99a8 |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "gmgn-cli",
|
||||
"version": "1.3.6",
|
||||
"version": "1.3.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gmgn-cli",
|
||||
"version": "1.3.6",
|
||||
"version": "1.3.7",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^12.1.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gmgn-cli",
|
||||
"version": "1.3.6",
|
||||
"version": "1.3.7",
|
||||
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -233,7 +233,8 @@ The response has a `activities` array and a `next` cursor field for pagination.
|
||||
| `token.symbol` | Token ticker |
|
||||
| `token_amount` | Token quantity in this transaction |
|
||||
| `cost_usd` | USD value of this transaction |
|
||||
| `price` | Token price in USD at time of transaction |
|
||||
| `price` | Token price denominated in the quote token of the trading pair at time of transaction |
|
||||
| `price_usd` | Token price in USD at time of transaction |
|
||||
| `timestamp` | Unix timestamp of the transaction |
|
||||
| `next` | Pagination cursor — pass to `--cursor` to fetch the next page |
|
||||
|
||||
|
||||
+114
-5
@@ -88,6 +88,9 @@ All swap-related routes used by this skill go through GMGN's leaky-bucket limite
|
||||
| `multi-swap` | `POST /v1/trade/multi_swap` | 5 |
|
||||
| `order quote` | `GET /v1/trade/quote` | 2 |
|
||||
| `order get` | `GET /v1/trade/query_order` | 1 |
|
||||
| `order strategy create` | `POST /v1/trade/strategy/create` | 5 |
|
||||
| `order strategy cancel` | `POST /v1/trade/strategy/cancel` | 2 |
|
||||
| `order strategy list` | `GET /v1/trade/strategy/orders` | 1 |
|
||||
| `gas-price` | `GET /v1/trade/gas_price` | 1 |
|
||||
|
||||
When a request returns `429`:
|
||||
@@ -544,7 +547,7 @@ gmgn-cli order strategy create \
|
||||
| `--quote-token` | Yes | all | Quote token contract address |
|
||||
| `--order-type` | Yes | all | Order type: `limit_order` |
|
||||
| `--sub-order-type` | Yes | all | Sub-order type: `buy_low` / `buy_high` / `stop_loss` / `take_profit` |
|
||||
| `--check-price` | Yes | all | Trigger check price |
|
||||
| `--check-price` | Yes | all | Trigger price in USD — the order fires when the token's USD price crosses this value |
|
||||
| `--amount-in` | No* | all | Input amount (smallest unit). Mutually exclusive with `--amount-in-percent` |
|
||||
| `--amount-in-percent` | No* | all | Input as percentage (e.g. `50` = 50%). Mutually exclusive with `--amount-in` |
|
||||
| `--limit-price-mode` | No | all | `exact` / `slippage` (default: `slippage`) |
|
||||
@@ -600,11 +603,117 @@ gmgn-cli order strategy list --chain sol --group-tag STMix --base-token <token_a
|
||||
|
||||
### `order strategy list` Response Fields
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| Field | Type | Description |
|
||||
| ----------------- | ------ | ---- |
|
||||
| `next_page_token` | string | Cursor for next page; empty when no more data |
|
||||
| `total` | int | Total count (only returned when `--type open`) |
|
||||
| `list` | array | Strategy order list |
|
||||
| `total` | int | Total count (only returned when `--type open`) |
|
||||
| `list` | array | Array of strategy order objects; see fields below |
|
||||
|
||||
#### `list[]` — Strategy Order Object
|
||||
|
||||
| Field | Type | Description |
|
||||
| -------------------------- | ------ | ---- |
|
||||
| `anti_mev_mode` | string | Anti-MEV mode string; empty when not set |
|
||||
| `auto_slippage` | bool | Whether auto slippage is enabled |
|
||||
| `base_decimal` | int | Base token decimal places |
|
||||
| `base_token` | string | Base token contract address |
|
||||
| `chain` | string | Chain: `sol` / `bsc` / `base` / `eth` |
|
||||
| `close_amount` | string | Token amount sold on close; empty when order is open |
|
||||
| `close_price` | string | Token price at close; empty when order is open |
|
||||
| `close_sell_model` | string | Sell model used on close; empty when order is open |
|
||||
| `close_sign_hash` | string | Close transaction hash; empty when order is open |
|
||||
| `close_time` | int | Close timestamp (ms); `0` when order is open |
|
||||
| `condition_orders` | array | Condition sub-orders; each element is an object — see `condition_orders[]` below |
|
||||
| `create_time` | int | Creation timestamp (ms) |
|
||||
| `custom_rpc` | string | Custom RPC endpoint; empty string when not set |
|
||||
| `dev_sell_ratio` | string | Dev sell trigger ratio; empty when not set |
|
||||
| `drawdown_rate` | string | Trailing drawdown rate for `profit_stop_trace` / `loss_stop_trace`; empty when not set |
|
||||
| `expire_time` | int | Expiration timestamp (ms) |
|
||||
| `fee` | string | Base transaction fee |
|
||||
| `gas_price` | string | Gas price |
|
||||
| `is_anti_mev` | bool | Whether anti-MEV protection is active |
|
||||
| `limit_price_mode` | string | Limit price mode; empty when not set |
|
||||
| `loss_stop` | string | Stop-loss trigger price; empty when not set |
|
||||
| `loss_stop_type` | string | Stop-loss type; empty when not set |
|
||||
| `max_fee_per_gas` | string | EIP-1559 max fee per gas; EVM only; empty on SOL |
|
||||
| `max_priority_fee_per_gas` | string | EIP-1559 max priority fee per gas; EVM only; empty on SOL |
|
||||
| `open_amount` | string | Token amount at open (smallest unit) |
|
||||
| `open_price` | string | Token price at open |
|
||||
| `open_sign_hash` | string | Open transaction hash; empty before confirmed |
|
||||
| `order_id` | string | Unique order ID (UUID) |
|
||||
| `order_statistic` | object | Cumulative order statistics; see `order_statistic` Object below |
|
||||
| `order_type` | string | Order type: `smart_trade` / `limit_order` |
|
||||
| `place_action` | string | Placement action; empty when not applicable |
|
||||
| `prepare_status` | string | Preparation status; empty when not applicable |
|
||||
| `priority_fee` | string | Priority fee; SOL / BSC only |
|
||||
| `profit_stop` | string | Take-profit trigger price; empty when not set |
|
||||
| `profit_stop_type` | string | Take-profit type; empty when not set |
|
||||
| `quote_decimal` | int | Quote token decimal places |
|
||||
| `quote_investment` | string | Quote token investment amount (smallest unit) |
|
||||
| `quote_token` | string | Quote token contract address |
|
||||
| `reason_by` | string | Entity that triggered the close; empty when open |
|
||||
| `reason_code` | string | Reason code for the close action; empty when open |
|
||||
| `record_high_price` | string | Highest recorded price since open; used for trailing stops |
|
||||
| `sell_param` | object | Sell transaction parameters; see `sell_param` Object below |
|
||||
| `sell_ratio` | string | Sell ratio; empty when not set |
|
||||
| `sell_ratio_type` | string | Sell ratio base: `buy_amount` / others |
|
||||
| `slippage` | int | Slippage tolerance (0 = auto) |
|
||||
| `status` | string | Order lifecycle status: `open` / `closed` |
|
||||
| `strategy_status` | string | Strategy running status: `running` / `stopped` |
|
||||
| `sub_order_type` | string | Sub-order type: `mix_trade` / others |
|
||||
| `tip_fee` | string | Tip fee; SOL only |
|
||||
| `token_balance` | string | Remaining token balance; empty when not available |
|
||||
| `token_logo` | string | Token logo URL |
|
||||
| `token_name` | string | Token display name |
|
||||
| `token_price` | string | Current token price; empty when not available |
|
||||
| `total_supply` | string | Token total supply |
|
||||
| `version` | int | Order schema version |
|
||||
| `wallet_address` | string | Wallet address that placed the order |
|
||||
|
||||
#### `condition_orders[]` — Condition Sub-Order Object
|
||||
|
||||
| Field | Type | Description |
|
||||
| ------------- | ------ | ---- |
|
||||
| `cid` | string | Condition sub-order ID (UUID) |
|
||||
| `order_type` | string | Sub-order type: `profit_stop` / `loss_stop` / `profit_stop_trace` / `loss_stop_trace` |
|
||||
| `side` | string | Trade side: `sell` |
|
||||
| `price_scale` | string | Price ratio relative to open price (string); `profit_stop` / `loss_stop` required |
|
||||
| `sell_ratio` | string | Sell ratio (string), e.g. `"100"` |
|
||||
| `check_price` | string | Computed trigger price derived from `price_scale` and open price |
|
||||
| `status` | string | Sub-order status: `cancel` / `success` / `failed` |
|
||||
|
||||
#### `order_statistic` Object
|
||||
|
||||
| Field | Type | Description |
|
||||
| ---------------------- | ------ | ---- |
|
||||
| `buy_amount` | string | Bought token amount (smallest unit) |
|
||||
| `buy_quote_price` | string | Quote token price at buy |
|
||||
| `buy_usdt_price` | string | USDT-denominated price at buy |
|
||||
| `quote_profit` | string | Realized profit in quote token |
|
||||
| `sell_amount` | string | Total token amount sold |
|
||||
| `sell_num` | int | Total number of sell attempts |
|
||||
| `success_sell_amount` | string | Successfully sold token amount |
|
||||
| `success_sell_num` | int | Number of successful sells |
|
||||
| `usdt_profit` | string | Realized profit in USDT |
|
||||
|
||||
#### `sell_param` Object
|
||||
|
||||
| Field | Type | Description |
|
||||
| -------------------------- | ------ | ---- |
|
||||
| `anti_mev_mode` | string | Anti-MEV mode for the sell transaction |
|
||||
| `auto_fee` | bool | Whether auto fee is enabled for the sell |
|
||||
| `auto_slippage` | bool | Whether auto slippage is enabled for the sell |
|
||||
| `auto_tip` | bool | Whether auto tip is enabled |
|
||||
| `custom_rpc` | string | Custom RPC endpoint; empty string when not set |
|
||||
| `fee` | string | Sell transaction fee |
|
||||
| `gas_price` | string | Gas price for the sell |
|
||||
| `is_anti_mev` | bool | Whether anti-MEV protection is active for the sell |
|
||||
| `max_fee_per_gas` | string | EIP-1559 max fee per gas for the sell; EVM only |
|
||||
| `max_priority_fee_per_gas` | string | EIP-1559 max priority fee per gas for the sell; EVM only |
|
||||
| `max_tip_fee` | string | Maximum tip fee; empty when not set |
|
||||
| `priority_fee` | string | Priority fee for the sell; SOL / BSC only |
|
||||
| `slippage` | int | Slippage tolerance for the sell (0 = auto) |
|
||||
| `tip_fee` | string | Tip fee for the sell; SOL only |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -44,11 +44,12 @@ export function buildMessage(
|
||||
const sortedQs = Object.keys(queryParams)
|
||||
.sort()
|
||||
.flatMap((k) => {
|
||||
const ek = encodeURIComponent(k);
|
||||
const v = queryParams[k];
|
||||
if (Array.isArray(v)) {
|
||||
return [...v].sort().map((item) => `${k}=${item}`);
|
||||
return [...v].sort().map((item) => `${ek}=${encodeURIComponent(item)}`);
|
||||
}
|
||||
return [`${k}=${v}`];
|
||||
return [`${ek}=${encodeURIComponent(String(v))}`];
|
||||
})
|
||||
.join("&");
|
||||
return `${subPath}:${sortedQs}:${body}:${timestamp}`;
|
||||
|
||||
Reference in New Issue
Block a user