polycopy 0.0.3 → 0.0.5
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/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const child_process = require("child_process");
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const paths = require("./paths-
|
|
6
|
+
const paths = require("./paths-D38j8blX.js");
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
9
9
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
package/dist/config.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const init = require("./init-
|
|
2
|
+
const init = require("./init-Bm-Q_fD_.js");
|
|
3
3
|
const grammy = require("grammy");
|
|
4
4
|
const wallet = require("@ethersproject/wallet");
|
|
5
5
|
const clobClient = require("@polymarket/clob-client");
|
|
@@ -11,7 +11,7 @@ const builderRelayerClient = require("@polymarket/builder-relayer-client");
|
|
|
11
11
|
const setPromiseInterval = require("set-promise-interval");
|
|
12
12
|
const child_process = require("child_process");
|
|
13
13
|
const fs = require("fs");
|
|
14
|
-
const paths = require("./paths-
|
|
14
|
+
const paths = require("./paths-D38j8blX.js");
|
|
15
15
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
16
16
|
function _interopNamespace(e) {
|
|
17
17
|
if (e && e.__esModule) return e;
|
|
@@ -849,6 +849,11 @@ class Trader {
|
|
|
849
849
|
return;
|
|
850
850
|
}
|
|
851
851
|
this.assetFilter.markTraded(assetId, endTime);
|
|
852
|
+
if (sellPrice === 1) {
|
|
853
|
+
init.logger.success(`买单已提交: ${buyResult.orderId}`);
|
|
854
|
+
init.logger.line("", "sellPrice = 1,成交后将自动 redeem");
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
852
857
|
this.watchAndHandle(buyResult.orderId, assetId, sellPrice, endTime, metadata.eventId);
|
|
853
858
|
}
|
|
854
859
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const readline = require("readline");
|
|
3
3
|
const fsExtra = require("fs-extra");
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const paths = require("./paths-
|
|
5
|
+
const paths = require("./paths-D38j8blX.js");
|
|
6
6
|
const grammy = require("grammy");
|
|
7
7
|
const winston = require("winston");
|
|
8
8
|
const DailyRotateFile = require("winston-daily-rotate-file");
|
|
@@ -631,7 +631,7 @@ async function runConfigWizard(existingConfig) {
|
|
|
631
631
|
const currentAdminChatId = currentTelegram?.adminChatId;
|
|
632
632
|
const adminHint = currentAdminChatId ? "回车保持,skip 清除" : "回车跳过";
|
|
633
633
|
const adminChatIdInput = await question(
|
|
634
|
-
` - 管理员 Chat ID [${currentAdminChatId || "未配置"}] (${adminHint}): `
|
|
634
|
+
` - 管理员 Chat ID [${currentAdminChatId || "未配置"}] (用于接收重要通知, ${adminHint}): `
|
|
635
635
|
);
|
|
636
636
|
let adminChatId = currentAdminChatId;
|
|
637
637
|
if (adminChatIdInput.trim().toLowerCase() === "skip") {
|
|
@@ -833,10 +833,10 @@ async function configureTrading(existingConfig) {
|
|
|
833
833
|
const defaultSellPrice = existingSellPrice ?? 1;
|
|
834
834
|
let sellPrice = defaultSellPrice;
|
|
835
835
|
while (true) {
|
|
836
|
-
const sellDisplay =
|
|
836
|
+
const sellDisplay = String(existingSellPrice ?? defaultSellPrice);
|
|
837
837
|
const minSell = buyPrice ?? 0.98;
|
|
838
838
|
const sellPriceInput = await question(
|
|
839
|
-
` - 卖价 [${sellDisplay}] (>${minSell} 且 <=1, 1
|
|
839
|
+
` - 卖价 [${sellDisplay}] (>${minSell} 且 <=1, 1=不卖出等待自动 redeem, skip=跳过): `
|
|
840
840
|
);
|
|
841
841
|
if (!sellPriceInput.trim()) {
|
|
842
842
|
sellPrice = existingSellPrice ?? defaultSellPrice;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
4
4
|
const path__default = /* @__PURE__ */ _interopDefault(path);
|
|
5
|
-
const PROJECT_ROOT = path__default.default.join(__dirname, ".."
|
|
5
|
+
const PROJECT_ROOT = path__default.default.join(__dirname, "..");
|
|
6
6
|
const LOGS_DIR = path__default.default.join(PROJECT_ROOT, "logs");
|
|
7
7
|
const LOCALSTORAGE_DIR = path__default.default.join(PROJECT_ROOT, "localstorage");
|
|
8
8
|
const PID_DIR = path__default.default.join(process.env.HOME || PROJECT_ROOT, ".polycopy");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polycopy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "polycopy test",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"config": "node dist/config.js",
|
|
14
14
|
"dev": "tsc --noEmit && vite build && node dist/index.js",
|
|
15
15
|
"cli": "node dist/cli.js",
|
|
16
|
+
"preuninstall": "node dist/cli.js stop 2>/dev/null || true",
|
|
17
|
+
"prepublishOnly": "npm run build",
|
|
16
18
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|