gmgn-cli 1.3.6 → 1.3.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/client/signer.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAQ1D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAKzE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,EACvD,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/client/signer.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAQ1D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAKzE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,EACvD,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,MAAM,CAaR;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAClB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,aAAa,GACvB,MAAM,CAeR"}
|
package/dist/client/signer.js
CHANGED
|
@@ -34,11 +34,12 @@ export function buildMessage(subPath, queryParams, body, timestamp) {
|
|
|
34
34
|
const sortedQs = Object.keys(queryParams)
|
|
35
35
|
.sort()
|
|
36
36
|
.flatMap((k) => {
|
|
37
|
+
const ek = encodeURIComponent(k);
|
|
37
38
|
const v = queryParams[k];
|
|
38
39
|
if (Array.isArray(v)) {
|
|
39
|
-
return [...v].sort().map((item) => `${
|
|
40
|
+
return [...v].sort().map((item) => `${ek}=${encodeURIComponent(item)}`);
|
|
40
41
|
}
|
|
41
|
-
return [`${
|
|
42
|
+
return [`${ek}=${encodeURIComponent(String(v))}`];
|
|
42
43
|
})
|
|
43
44
|
.join("&");
|
|
44
45
|
return `${subPath}:${sortedQs}:${body}:${timestamp}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/client/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzC,QAAQ,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAC9B,KAAK,SAAS,CAAC,CAAC,OAAO,SAAS,CAAC;QACjC,KAAK,KAAK,CAAC,CAAK,OAAO,YAAY,CAAC;QACpC;YACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,CAAC,iBAAiB,2BAA2B,CAAC,CAAC;IAC/F,CAAC;AACH,CAA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I,CAClB,OAAe,EACf,aAAqB,EACrB,SAAwB;IAExB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE7C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;QACrD,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,gEAAgE;IAChE,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;QACxC,GAAG,EAAE,aAAa;QAClB,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,qBAAqB;QAC/C,UAAU,EAAE,EAAE;KACf,CAAC,CAAC;IACH,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -233,7 +233,8 @@ The response has a `activities` array and a `next` cursor field for pagination.
|
|
|
233
233
|
| `token.symbol` | Token ticker |
|
|
234
234
|
| `token_amount` | Token quantity in this transaction |
|
|
235
235
|
| `cost_usd` | USD value of this transaction |
|
|
236
|
-
| `price` | Token price in
|
|
236
|
+
| `price` | Token price denominated in the quote token of the trading pair at time of transaction |
|
|
237
|
+
| `price_usd` | Token price in USD at time of transaction |
|
|
237
238
|
| `timestamp` | Unix timestamp of the transaction |
|
|
238
239
|
| `next` | Pagination cursor — pass to `--cursor` to fetch the next page |
|
|
239
240
|
|
|
@@ -88,6 +88,9 @@ All swap-related routes used by this skill go through GMGN's leaky-bucket limite
|
|
|
88
88
|
| `multi-swap` | `POST /v1/trade/multi_swap` | 5 |
|
|
89
89
|
| `order quote` | `GET /v1/trade/quote` | 2 |
|
|
90
90
|
| `order get` | `GET /v1/trade/query_order` | 1 |
|
|
91
|
+
| `order strategy create` | `POST /v1/trade/strategy/create` | 5 |
|
|
92
|
+
| `order strategy cancel` | `POST /v1/trade/strategy/cancel` | 2 |
|
|
93
|
+
| `order strategy list` | `GET /v1/trade/strategy/orders` | 1 |
|
|
91
94
|
| `gas-price` | `GET /v1/trade/gas_price` | 1 |
|
|
92
95
|
|
|
93
96
|
When a request returns `429`:
|
|
@@ -544,7 +547,7 @@ gmgn-cli order strategy create \
|
|
|
544
547
|
| `--quote-token` | Yes | all | Quote token contract address |
|
|
545
548
|
| `--order-type` | Yes | all | Order type: `limit_order` |
|
|
546
549
|
| `--sub-order-type` | Yes | all | Sub-order type: `buy_low` / `buy_high` / `stop_loss` / `take_profit` |
|
|
547
|
-
| `--check-price` | Yes | all | Trigger
|
|
550
|
+
| `--check-price` | Yes | all | Trigger price in USD — the order fires when the token's USD price crosses this value |
|
|
548
551
|
| `--amount-in` | No* | all | Input amount (smallest unit). Mutually exclusive with `--amount-in-percent` |
|
|
549
552
|
| `--amount-in-percent` | No* | all | Input as percentage (e.g. `50` = 50%). Mutually exclusive with `--amount-in` |
|
|
550
553
|
| `--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
|
|
|
600
603
|
|
|
601
604
|
### `order strategy list` Response Fields
|
|
602
605
|
|
|
603
|
-
| Field
|
|
604
|
-
|
|
606
|
+
| Field | Type | Description |
|
|
607
|
+
| ----------------- | ------ | ---- |
|
|
605
608
|
| `next_page_token` | string | Cursor for next page; empty when no more data |
|
|
606
|
-
| `total`
|
|
607
|
-
| `list`
|
|
609
|
+
| `total` | int | Total count (only returned when `--type open`) |
|
|
610
|
+
| `list` | array | Array of strategy order objects; see fields below |
|
|
611
|
+
|
|
612
|
+
#### `list[]` — Strategy Order Object
|
|
613
|
+
|
|
614
|
+
| Field | Type | Description |
|
|
615
|
+
| -------------------------- | ------ | ---- |
|
|
616
|
+
| `anti_mev_mode` | string | Anti-MEV mode string; empty when not set |
|
|
617
|
+
| `auto_slippage` | bool | Whether auto slippage is enabled |
|
|
618
|
+
| `base_decimal` | int | Base token decimal places |
|
|
619
|
+
| `base_token` | string | Base token contract address |
|
|
620
|
+
| `chain` | string | Chain: `sol` / `bsc` / `base` / `eth` |
|
|
621
|
+
| `close_amount` | string | Token amount sold on close; empty when order is open |
|
|
622
|
+
| `close_price` | string | Token price at close; empty when order is open |
|
|
623
|
+
| `close_sell_model` | string | Sell model used on close; empty when order is open |
|
|
624
|
+
| `close_sign_hash` | string | Close transaction hash; empty when order is open |
|
|
625
|
+
| `close_time` | int | Close timestamp (ms); `0` when order is open |
|
|
626
|
+
| `condition_orders` | array | Condition sub-orders; each element is an object — see `condition_orders[]` below |
|
|
627
|
+
| `create_time` | int | Creation timestamp (ms) |
|
|
628
|
+
| `custom_rpc` | string | Custom RPC endpoint; empty string when not set |
|
|
629
|
+
| `dev_sell_ratio` | string | Dev sell trigger ratio; empty when not set |
|
|
630
|
+
| `drawdown_rate` | string | Trailing drawdown rate for `profit_stop_trace` / `loss_stop_trace`; empty when not set |
|
|
631
|
+
| `expire_time` | int | Expiration timestamp (ms) |
|
|
632
|
+
| `fee` | string | Base transaction fee |
|
|
633
|
+
| `gas_price` | string | Gas price |
|
|
634
|
+
| `is_anti_mev` | bool | Whether anti-MEV protection is active |
|
|
635
|
+
| `limit_price_mode` | string | Limit price mode; empty when not set |
|
|
636
|
+
| `loss_stop` | string | Stop-loss trigger price; empty when not set |
|
|
637
|
+
| `loss_stop_type` | string | Stop-loss type; empty when not set |
|
|
638
|
+
| `max_fee_per_gas` | string | EIP-1559 max fee per gas; EVM only; empty on SOL |
|
|
639
|
+
| `max_priority_fee_per_gas` | string | EIP-1559 max priority fee per gas; EVM only; empty on SOL |
|
|
640
|
+
| `open_amount` | string | Token amount at open (smallest unit) |
|
|
641
|
+
| `open_price` | string | Token price at open |
|
|
642
|
+
| `open_sign_hash` | string | Open transaction hash; empty before confirmed |
|
|
643
|
+
| `order_id` | string | Unique order ID (UUID) |
|
|
644
|
+
| `order_statistic` | object | Cumulative order statistics; see `order_statistic` Object below |
|
|
645
|
+
| `order_type` | string | Order type: `smart_trade` / `limit_order` |
|
|
646
|
+
| `place_action` | string | Placement action; empty when not applicable |
|
|
647
|
+
| `prepare_status` | string | Preparation status; empty when not applicable |
|
|
648
|
+
| `priority_fee` | string | Priority fee; SOL / BSC only |
|
|
649
|
+
| `profit_stop` | string | Take-profit trigger price; empty when not set |
|
|
650
|
+
| `profit_stop_type` | string | Take-profit type; empty when not set |
|
|
651
|
+
| `quote_decimal` | int | Quote token decimal places |
|
|
652
|
+
| `quote_investment` | string | Quote token investment amount (smallest unit) |
|
|
653
|
+
| `quote_token` | string | Quote token contract address |
|
|
654
|
+
| `reason_by` | string | Entity that triggered the close; empty when open |
|
|
655
|
+
| `reason_code` | string | Reason code for the close action; empty when open |
|
|
656
|
+
| `record_high_price` | string | Highest recorded price since open; used for trailing stops |
|
|
657
|
+
| `sell_param` | object | Sell transaction parameters; see `sell_param` Object below |
|
|
658
|
+
| `sell_ratio` | string | Sell ratio; empty when not set |
|
|
659
|
+
| `sell_ratio_type` | string | Sell ratio base: `buy_amount` / others |
|
|
660
|
+
| `slippage` | int | Slippage tolerance (0 = auto) |
|
|
661
|
+
| `status` | string | Order lifecycle status: `open` / `closed` |
|
|
662
|
+
| `strategy_status` | string | Strategy running status: `running` / `stopped` |
|
|
663
|
+
| `sub_order_type` | string | Sub-order type: `mix_trade` / others |
|
|
664
|
+
| `tip_fee` | string | Tip fee; SOL only |
|
|
665
|
+
| `token_balance` | string | Remaining token balance; empty when not available |
|
|
666
|
+
| `token_logo` | string | Token logo URL |
|
|
667
|
+
| `token_name` | string | Token display name |
|
|
668
|
+
| `token_price` | string | Current token price; empty when not available |
|
|
669
|
+
| `total_supply` | string | Token total supply |
|
|
670
|
+
| `version` | int | Order schema version |
|
|
671
|
+
| `wallet_address` | string | Wallet address that placed the order |
|
|
672
|
+
|
|
673
|
+
#### `condition_orders[]` — Condition Sub-Order Object
|
|
674
|
+
|
|
675
|
+
| Field | Type | Description |
|
|
676
|
+
| ------------- | ------ | ---- |
|
|
677
|
+
| `cid` | string | Condition sub-order ID (UUID) |
|
|
678
|
+
| `order_type` | string | Sub-order type: `profit_stop` / `loss_stop` / `profit_stop_trace` / `loss_stop_trace` |
|
|
679
|
+
| `side` | string | Trade side: `sell` |
|
|
680
|
+
| `price_scale` | string | Price ratio relative to open price (string); `profit_stop` / `loss_stop` required |
|
|
681
|
+
| `sell_ratio` | string | Sell ratio (string), e.g. `"100"` |
|
|
682
|
+
| `check_price` | string | Computed trigger price derived from `price_scale` and open price |
|
|
683
|
+
| `status` | string | Sub-order status: `cancel` / `success` / `failed` |
|
|
684
|
+
|
|
685
|
+
#### `order_statistic` Object
|
|
686
|
+
|
|
687
|
+
| Field | Type | Description |
|
|
688
|
+
| ---------------------- | ------ | ---- |
|
|
689
|
+
| `buy_amount` | string | Bought token amount (smallest unit) |
|
|
690
|
+
| `buy_quote_price` | string | Quote token price at buy |
|
|
691
|
+
| `buy_usdt_price` | string | USDT-denominated price at buy |
|
|
692
|
+
| `quote_profit` | string | Realized profit in quote token |
|
|
693
|
+
| `sell_amount` | string | Total token amount sold |
|
|
694
|
+
| `sell_num` | int | Total number of sell attempts |
|
|
695
|
+
| `success_sell_amount` | string | Successfully sold token amount |
|
|
696
|
+
| `success_sell_num` | int | Number of successful sells |
|
|
697
|
+
| `usdt_profit` | string | Realized profit in USDT |
|
|
698
|
+
|
|
699
|
+
#### `sell_param` Object
|
|
700
|
+
|
|
701
|
+
| Field | Type | Description |
|
|
702
|
+
| -------------------------- | ------ | ---- |
|
|
703
|
+
| `anti_mev_mode` | string | Anti-MEV mode for the sell transaction |
|
|
704
|
+
| `auto_fee` | bool | Whether auto fee is enabled for the sell |
|
|
705
|
+
| `auto_slippage` | bool | Whether auto slippage is enabled for the sell |
|
|
706
|
+
| `auto_tip` | bool | Whether auto tip is enabled |
|
|
707
|
+
| `custom_rpc` | string | Custom RPC endpoint; empty string when not set |
|
|
708
|
+
| `fee` | string | Sell transaction fee |
|
|
709
|
+
| `gas_price` | string | Gas price for the sell |
|
|
710
|
+
| `is_anti_mev` | bool | Whether anti-MEV protection is active for the sell |
|
|
711
|
+
| `max_fee_per_gas` | string | EIP-1559 max fee per gas for the sell; EVM only |
|
|
712
|
+
| `max_priority_fee_per_gas` | string | EIP-1559 max priority fee per gas for the sell; EVM only |
|
|
713
|
+
| `max_tip_fee` | string | Maximum tip fee; empty when not set |
|
|
714
|
+
| `priority_fee` | string | Priority fee for the sell; SOL / BSC only |
|
|
715
|
+
| `slippage` | int | Slippage tolerance for the sell (0 = auto) |
|
|
716
|
+
| `tip_fee` | string | Tip fee for the sell; SOL only |
|
|
608
717
|
|
|
609
718
|
---
|
|
610
719
|
|