polycopy 0.2.9 → 0.3.1
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 +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -891,7 +891,7 @@ class RelayClient extends EventEmitter__default.default {
|
|
|
891
891
|
const { success, failed } = postedEvent[type];
|
|
892
892
|
if (success.length + failed.length > 0) {
|
|
893
893
|
logger.info(
|
|
894
|
-
` - ${type}: [success: ${success.length} failed: ${failed.length}
|
|
894
|
+
` - ${type}: [success: ${success.length} failed: ${failed.length} nextRetry: ${failed.filter(({ done }) => !done).length}]`
|
|
895
895
|
);
|
|
896
896
|
}
|
|
897
897
|
}
|
|
@@ -1299,7 +1299,7 @@ class Redeemer extends EventEmitter__default.default {
|
|
|
1299
1299
|
const pendingRecords = this.updateEventRecords(pendingEvents);
|
|
1300
1300
|
if (pendingRecords.length > 0) {
|
|
1301
1301
|
logger.lines(
|
|
1302
|
-
`🟡 redeem
|
|
1302
|
+
`🟡 redeem 待确认: ${pendingRecords.length} 个`,
|
|
1303
1303
|
...this.toMessages(pendingRecords)
|
|
1304
1304
|
);
|
|
1305
1305
|
}
|
|
@@ -1352,8 +1352,8 @@ class Redeemer extends EventEmitter__default.default {
|
|
|
1352
1352
|
getRecord(conditionId) {
|
|
1353
1353
|
const record = this.records.get(conditionId);
|
|
1354
1354
|
if (!record) {
|
|
1355
|
-
logger.error("no record for", conditionId);
|
|
1356
|
-
telegramService.error(`no record for: ${conditionId}`);
|
|
1355
|
+
logger.error("no redeem record for", conditionId);
|
|
1356
|
+
telegramService.error(`no redeem record for: ${conditionId}`);
|
|
1357
1357
|
}
|
|
1358
1358
|
return record;
|
|
1359
1359
|
}
|
|
@@ -1394,7 +1394,7 @@ class Redeemer extends EventEmitter__default.default {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
toMessages(eventRecords) {
|
|
1396
1396
|
return eventRecords.map(
|
|
1397
|
-
({ position, execCount, postSuccessTime }) => ` - ${position.slug} ${position.outcome}: ${position.currentValue} USDC (执行次数: ${execCount}
|
|
1397
|
+
({ position, execCount, postSuccessTime }) => ` - ${position.slug} ${position.outcome}: ${position.currentValue} USDC (执行次数: ${execCount}${postSuccessTime ? `确认时长: ${(Date.now() - postSuccessTime) / 1e3}s` : ""})`
|
|
1398
1398
|
);
|
|
1399
1399
|
}
|
|
1400
1400
|
async autoRedeem() {
|
|
@@ -1421,8 +1421,8 @@ class Redeemer extends EventEmitter__default.default {
|
|
|
1421
1421
|
record.postSuccessTime = Date.now();
|
|
1422
1422
|
}).catch((error) => {
|
|
1423
1423
|
if (relayClient.isSubmitError(error)) {
|
|
1424
|
-
logger.error("
|
|
1425
|
-
telegramService.error(`
|
|
1424
|
+
logger.error("Redeem 提交失败:", conditionId, error);
|
|
1425
|
+
telegramService.error(`Redeem 提交失败: ${conditionId}`);
|
|
1426
1426
|
}
|
|
1427
1427
|
});
|
|
1428
1428
|
}
|
|
@@ -1457,12 +1457,12 @@ class Redeemer extends EventEmitter__default.default {
|
|
|
1457
1457
|
];
|
|
1458
1458
|
logger.lines(...messages);
|
|
1459
1459
|
telegramService.info(messages.join("\n"));
|
|
1460
|
-
this.emit("redeemed");
|
|
1461
1460
|
}
|
|
1462
1461
|
const curSize = this.records.size;
|
|
1463
1462
|
if (curSize !== preSize) {
|
|
1464
1463
|
logger.info(`redeem 待确认总数: ${curSize} 个`);
|
|
1465
1464
|
}
|
|
1465
|
+
if (successRecords.length > 0) this.emit("redeemed");
|
|
1466
1466
|
}
|
|
1467
1467
|
start() {
|
|
1468
1468
|
if (this.running) return;
|