@lawrenceliang-btc/atel-sdk 1.1.10 → 1.1.11
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/bin/atel.mjs +18 -4
- package/package.json +1 -1
package/bin/atel.mjs
CHANGED
|
@@ -312,10 +312,24 @@ async function pushTradeNotification(eventType, payload, body) {
|
|
|
312
312
|
const templates = {
|
|
313
313
|
'order_created': (p) => `📥 收到新订单\n订单: ${p.orderId || body?.orderId || '?'}\n金额: $${p.priceAmount ?? '?'} USDC\n来自: ${p.requesterDid || '未知请求方'}\n请审核后决定是否接单`,
|
|
314
314
|
'order_accepted': (p) => `📋 订单已被接单\n订单: ${p.orderId || body?.orderId || '?'}\n执行方已开始处理,进入里程碑阶段`,
|
|
315
|
-
'milestone_submitted': (p) =>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
315
|
+
'milestone_submitted': (p) => {
|
|
316
|
+
const desc = p.milestoneDescription ? `\n目标: ${p.milestoneDescription}` : '';
|
|
317
|
+
const content = p.resultSummary ? `\n提交内容: ${String(p.resultSummary).substring(0, 200)}` : '';
|
|
318
|
+
return `📝 里程碑 M${p.milestoneIndex ?? '?'} 已提交\n订单: ${p.orderId || body?.orderId || '?'}${desc}${content}\n等待审核`;
|
|
319
|
+
},
|
|
320
|
+
'milestone_verified': (p) => {
|
|
321
|
+
const desc = p.milestoneDescription ? `\n目标: ${p.milestoneDescription}` : '';
|
|
322
|
+
const progress = p.totalMilestones ? `\n进度: ${(p.milestoneIndex ?? 0) + 1}/${p.totalMilestones}` : '';
|
|
323
|
+
return `✅ 里程碑 M${p.milestoneIndex ?? '?'} 审核通过\n订单: ${p.orderId || body?.orderId || '?'}${desc}${progress}`;
|
|
324
|
+
},
|
|
325
|
+
'milestone_rejected': (p) => {
|
|
326
|
+
const desc = p.milestoneDescription ? `\n目标: ${p.milestoneDescription}` : '';
|
|
327
|
+
return `❌ 里程碑 M${p.milestoneIndex ?? '?'} 被拒绝\n订单: ${p.orderId || body?.orderId || '?'}${desc}\n原因: ${p.rejectReason || '未说明'}`;
|
|
328
|
+
},
|
|
329
|
+
'order_settled': (p) => {
|
|
330
|
+
const amount = p.priceAmount ? `\n金额: $${p.priceAmount} USDC` : '';
|
|
331
|
+
return `💰 订单已结算完成\n订单: ${p.orderId || body?.orderId || '?'}${amount}\nUSDC 已支付`;
|
|
332
|
+
},
|
|
319
333
|
};
|
|
320
334
|
const tmpl = templates[eventType];
|
|
321
335
|
if (!tmpl) return;
|