mirror of
https://github.com/GMGNAI/gmgn-skills.git
synced 2026-07-28 09:17:45 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23ca9d8670 | |||
| 67d53cd3e4 | |||
| ca51ee6a7a |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "gmgn-cli",
|
||||
"version": "1.4.2",
|
||||
"version": "1.4.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gmgn-cli",
|
||||
"version": "1.4.2",
|
||||
"version": "1.4.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^12.1.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gmgn-cli",
|
||||
"version": "1.4.2",
|
||||
"version": "1.4.3",
|
||||
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -150,6 +150,8 @@ export interface StrategyCreateParams {
|
||||
custom_rpc?: string;
|
||||
condition_orders?: StrategyConditionOrder[];
|
||||
quote_investment?: string;
|
||||
sell_param?: TradeParam;
|
||||
buy_param?: TradeParam;
|
||||
}
|
||||
|
||||
export interface StrategyCancelParams {
|
||||
|
||||
@@ -224,6 +224,8 @@ export function registerSwapCommands(program: Command): void {
|
||||
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (BSC / BASE / ETH)")
|
||||
.option("--anti-mev", "Enable anti-MEV protection")
|
||||
.option("--condition-orders <json>", "JSON array of condition sub-orders for smart_trade (must include a buy_low entry + TP/SL entries)")
|
||||
.option("--sell-param <json>", "JSON object of sell-side trade params used when a TP/SL condition fires (required for smart_trade)")
|
||||
.option("--buy-param <json>", "JSON object of buy-side trade params override for smart_trade")
|
||||
.option("--raw", "Output raw JSON")
|
||||
.action(async (opts) => {
|
||||
if (!opts.amountIn && !opts.amountInPercent) {
|
||||
@@ -265,6 +267,14 @@ export function registerSwapCommands(program: Command): void {
|
||||
try { params.condition_orders = JSON.parse(opts.conditionOrders); }
|
||||
catch { console.error("[gmgn-cli] --condition-orders must be valid JSON"); process.exit(1); }
|
||||
}
|
||||
if (opts.sellParam) {
|
||||
try { params.sell_param = JSON.parse(opts.sellParam); }
|
||||
catch { console.error("[gmgn-cli] --sell-param must be valid JSON"); process.exit(1); }
|
||||
}
|
||||
if (opts.buyParam) {
|
||||
try { params.buy_param = JSON.parse(opts.buyParam); }
|
||||
catch { console.error("[gmgn-cli] --buy-param must be valid JSON"); process.exit(1); }
|
||||
}
|
||||
const client = new OpenApiClient(getConfig(true));
|
||||
const data = await client.createStrategyOrder(params).catch(exitOnError);
|
||||
printResult(data, opts.raw);
|
||||
|
||||
Reference in New Issue
Block a user