@pionex/pionex-ai-kit 0.2.37 → 0.2.38
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 +12 -12
- 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;
|
|
@@ -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;
|