@pionex/pionex-ai-kit 0.2.37 → 0.2.39
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.
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1523,7 +1523,7 @@ function registerOrdersTools() {
|
|
|
1523
1523
|
},
|
|
1524
1524
|
async handler(args, { client, config }) {
|
|
1525
1525
|
if (config.readOnly) {
|
|
1526
|
-
throw new Error("Server is running in --read-only mode;
|
|
1526
|
+
throw new Error("Server is running in --read-only mode; cancel_all is disabled.");
|
|
1527
1527
|
}
|
|
1528
1528
|
const symbol = String(args.symbol);
|
|
1529
1529
|
return (await client.signedDelete("/api/v1/trade/allOrders", { symbol })).data;
|
|
@@ -2531,19 +2531,19 @@ Groups:
|
|
|
2531
2531
|
Examples:
|
|
2532
2532
|
pionex-trade-cli market depth BTC_USDT --limit 5
|
|
2533
2533
|
pionex-trade-cli market tickers --symbol BTC_USDT
|
|
2534
|
-
pionex-trade-cli market
|
|
2534
|
+
pionex-trade-cli market book_tickers --symbol BTC_USDT
|
|
2535
2535
|
pionex-trade-cli market symbols --symbols BTC_USDT
|
|
2536
2536
|
pionex-trade-cli account balance
|
|
2537
2537
|
pionex-trade-cli orders new --symbol BTC_USDT --side BUY --type MARKET --amount 10
|
|
2538
2538
|
pionex-trade-cli orders cancel --symbol BTC_USDT --order-id 123
|
|
2539
|
-
pionex-trade-cli orders
|
|
2539
|
+
pionex-trade-cli orders fills_by_order_id --symbol BTC_USDT --order-id 123
|
|
2540
2540
|
pionex-trade-cli bot futures_grid get --bu-order-id <id>
|
|
2541
2541
|
pionex-trade-cli bot futures_grid create --base BTC --quote USDT --bu-order-data-json '{"top":"110000","bottom":"90000","row":100,"grid_type":"arithmetic","trend":"long","leverage":5,"quoteInvestment":"100"}'
|
|
2542
2542
|
pionex-trade-cli earn dual symbols --base BTC
|
|
2543
|
-
pionex-trade-cli earn dual
|
|
2543
|
+
pionex-trade-cli earn dual open_products --base BTC --quote USDXO --type DUAL_BASE --currency USDT
|
|
2544
2544
|
pionex-trade-cli earn dual prices --base BTC --quote USDXO --product-ids BTC-USDXO-260402-68000-P-USDT
|
|
2545
2545
|
pionex-trade-cli earn dual invest --base BTC --product-id BTC-USDXO-260402-68000-P-USDT --currency-amount 100 --profit 0.0039
|
|
2546
|
-
pionex-trade-cli earn dual
|
|
2546
|
+
pionex-trade-cli earn dual revoke_invest --base BTC --client-dual-id my-order-001 --dry-run
|
|
2547
2547
|
pionex-trade-cli earn dual collect --base BTC --client-dual-id my-order-001 --dry-run
|
|
2548
2548
|
|
|
2549
2549
|
Global flags:
|
|
@@ -2637,7 +2637,7 @@ async function runPionexCommand(argv) {
|
|
|
2637
2637
|
process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
|
|
2638
2638
|
return;
|
|
2639
2639
|
}
|
|
2640
|
-
if (command === "
|
|
2640
|
+
if (command === "book_tickers" || command === "bookTickers") {
|
|
2641
2641
|
const symbol = typeof flags.symbol === "string" ? flags.symbol : void 0;
|
|
2642
2642
|
const type = typeof flags.type === "string" ? flags.type : void 0;
|
|
2643
2643
|
const out = await runTool("pionex_market_get_book_tickers", { symbol, type });
|
|
@@ -2716,7 +2716,7 @@ async function runPionexCommand(argv) {
|
|
|
2716
2716
|
process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
|
|
2717
2717
|
return;
|
|
2718
2718
|
}
|
|
2719
|
-
if (command === "
|
|
2719
|
+
if (command === "fills_by_order_id" || command === "fillsByOrderId") {
|
|
2720
2720
|
const symbol = typeof flags.symbol === "string" ? flags.symbol : void 0;
|
|
2721
2721
|
const orderId = flags["order-id"] != null ? Number(flags["order-id"]) : void 0;
|
|
2722
2722
|
if (!symbol || orderId == null) throw new Error("Missing required flags: --symbol --order-id");
|
|
@@ -2737,7 +2737,7 @@ async function runPionexCommand(argv) {
|
|
|
2737
2737
|
process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
|
|
2738
2738
|
return;
|
|
2739
2739
|
}
|
|
2740
|
-
if (command === "
|
|
2740
|
+
if (command === "cancel_all") {
|
|
2741
2741
|
const symbol = typeof flags.symbol === "string" ? flags.symbol : void 0;
|
|
2742
2742
|
if (!symbol) throw new Error("Missing required flag: --symbol");
|
|
2743
2743
|
const payload = { symbol };
|
|
@@ -2835,7 +2835,7 @@ async function runPionexCommand(argv) {
|
|
|
2835
2835
|
if (!earnRoute || earnRoute !== "dual") {
|
|
2836
2836
|
throw new Error(
|
|
2837
2837
|
`Missing or unknown earn route: ${earnRoute ?? "(none)"}. Use: pionex-trade-cli earn dual <command>
|
|
2838
|
-
Commands: symbols,
|
|
2838
|
+
Commands: symbols, open_products, prices, index, delivery_prices, balances, get_invests, records, invest, revoke_invest, collect`
|
|
2839
2839
|
);
|
|
2840
2840
|
}
|
|
2841
2841
|
if (!command || command === "help" || flags.help === true || flags.h === true) {
|
|
@@ -2844,22 +2844,22 @@ Usage: pionex-trade-cli earn dual <command> [--flags]
|
|
|
2844
2844
|
|
|
2845
2845
|
Public commands (no API key required):
|
|
2846
2846
|
symbols List supported trading pairs [--base BTC]
|
|
2847
|
-
|
|
2847
|
+
open_products List open products --base BTC --quote USDXO --type DUAL_BASE|DUAL_CURRENCY [--currency USDT]
|
|
2848
2848
|
(BTC/ETH: --quote USDXO; others: --quote USDT)
|
|
2849
2849
|
Product ID format: {BASE}-{QUOTE}-{YYMMDD}-{STRIKE}-{C|P}-{CURRENCY} (C=DUAL_BASE, P=DUAL_CURRENCY)
|
|
2850
2850
|
prices Get yield rates --base BTC --quote USDXO --product-ids id1,id2
|
|
2851
2851
|
(All three flags required. Always call before invest \u2014 profit value must be passed unchanged.)
|
|
2852
2852
|
index Get index price --base BTC --quote USDXO
|
|
2853
|
-
|
|
2853
|
+
delivery_prices Get delivery prices --base BTC [--quote USDXO] [--start-time ms] [--end-time ms]
|
|
2854
2854
|
|
|
2855
|
-
Auth commands (
|
|
2855
|
+
Auth commands (Enable reading permission):
|
|
2856
2856
|
balances Get Dual Investment balances [--merge]
|
|
2857
2857
|
records Get investment history --base BTC --end-time ms [--quote USDT] [--limit 20] [--start-time ms]
|
|
2858
|
-
|
|
2858
|
+
get_invests Batch query orders [--base BTC] --client-dual-ids id1,id2
|
|
2859
2859
|
|
|
2860
2860
|
Auth commands (Earn permission, write):
|
|
2861
2861
|
invest Create investment --base BTC --product-id <id> (--base-amount N | --currency-amount N) --profit N [--client-dual-id id] [--dry-run]
|
|
2862
|
-
|
|
2862
|
+
revoke_invest Revoke pending order --base BTC --product-id <id> --client-dual-id <id> [--dry-run]
|
|
2863
2863
|
collect Collect settled earnings --base BTC --client-dual-id <id> --product-id <id> [--dry-run]
|
|
2864
2864
|
|
|
2865
2865
|
Note: For BTC/ETH: --quote USDXO --currency USDT|USDC. For other bases: --quote USDT --currency USDT.
|
|
@@ -2872,7 +2872,7 @@ Note: For BTC/ETH: --quote USDXO --currency USDT|USDC. For other bases: --quote
|
|
|
2872
2872
|
process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
|
|
2873
2873
|
return;
|
|
2874
2874
|
}
|
|
2875
|
-
if (command === "
|
|
2875
|
+
if (command === "open_products" || command === "openProducts") {
|
|
2876
2876
|
const base = typeof flags.base === "string" ? flags.base : void 0;
|
|
2877
2877
|
const quote = typeof flags.quote === "string" ? flags.quote : void 0;
|
|
2878
2878
|
const type = typeof flags.type === "string" ? flags.type : void 0;
|
|
@@ -2900,7 +2900,7 @@ Note: For BTC/ETH: --quote USDXO --currency USDT|USDC. For other bases: --quote
|
|
|
2900
2900
|
process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
|
|
2901
2901
|
return;
|
|
2902
2902
|
}
|
|
2903
|
-
if (command === "
|
|
2903
|
+
if (command === "delivery_prices" || command === "deliveryPrices") {
|
|
2904
2904
|
const base = typeof flags.base === "string" ? flags.base : void 0;
|
|
2905
2905
|
if (!base) throw new Error("Missing required flag: --base");
|
|
2906
2906
|
const quote = typeof flags.quote === "string" ? flags.quote : void 0;
|
|
@@ -2916,7 +2916,7 @@ Note: For BTC/ETH: --quote USDXO --currency USDT|USDC. For other bases: --quote
|
|
|
2916
2916
|
process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
|
|
2917
2917
|
return;
|
|
2918
2918
|
}
|
|
2919
|
-
if (command === "
|
|
2919
|
+
if (command === "get_invests" || command === "getInvests") {
|
|
2920
2920
|
const base = typeof flags.base === "string" ? flags.base : void 0;
|
|
2921
2921
|
const clientDualIdsRaw = typeof flags["client-dual-ids"] === "string" ? flags["client-dual-ids"] : typeof flags.clientDualIds === "string" ? flags.clientDualIds : void 0;
|
|
2922
2922
|
const clientDualIds = clientDualIdsRaw ? clientDualIdsRaw.split(",").map((s) => s.trim()) : void 0;
|
|
@@ -2954,7 +2954,7 @@ Note: For BTC/ETH: --quote USDXO --currency USDT|USDC. For other bases: --quote
|
|
|
2954
2954
|
process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
|
|
2955
2955
|
return;
|
|
2956
2956
|
}
|
|
2957
|
-
if (command === "
|
|
2957
|
+
if (command === "revoke_invest" || command === "revokeInvest") {
|
|
2958
2958
|
const base = typeof flags.base === "string" ? flags.base : void 0;
|
|
2959
2959
|
const clientDualId = typeof flags["client-dual-id"] === "string" ? flags["client-dual-id"] : typeof flags.clientDualId === "string" ? flags.clientDualId : void 0;
|
|
2960
2960
|
const productId = typeof flags["product-id"] === "string" ? flags["product-id"] : typeof flags.productId === "string" ? flags.productId : void 0;
|