@lawrenceliang-btc/atel-sdk 1.1.36 → 1.1.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/bin/atel.mjs +12 -4
- package/package.json +1 -1
package/bin/atel.mjs
CHANGED
|
@@ -311,9 +311,15 @@ async function pushTradeNotification(eventType, payload, body) {
|
|
|
311
311
|
const enabled = (targets.targets || []).filter(t => t.enabled !== false);
|
|
312
312
|
if (enabled.length === 0) return;
|
|
313
313
|
|
|
314
|
+
const chainLabel = (p) => {
|
|
315
|
+
const c = p?.chain || body?.chain || '';
|
|
316
|
+
if (c === 'fast-coop') return ' (Fast)';
|
|
317
|
+
if (c === 'bsc') return ' (BSC)';
|
|
318
|
+
return '';
|
|
319
|
+
};
|
|
314
320
|
const templates = {
|
|
315
|
-
'order_created': (p) => `📥 收到新订单\n订单: ${p.orderId || body?.orderId || '?'}\n金额: $${p.priceAmount ?? '?'} USDC\n来自: ${p.requesterDid || '未知请求方'}\n请审核后决定是否接单`,
|
|
316
|
-
'order_accepted': (p) => `📋 订单已被接单\n订单: ${p.orderId || body?.orderId || '?'}\n执行方已开始处理,进入里程碑阶段`,
|
|
321
|
+
'order_created': (p) => `📥 收到新订单\n订单: ${p.orderId || body?.orderId || '?'}\n金额: $${p.priceAmount ?? '?'} USDC${chainLabel(p)}\n来自: ${p.requesterDid || '未知请求方'}\n请审核后决定是否接单`,
|
|
322
|
+
'order_accepted': (p) => `📋 订单已被接单\n订单: ${p.orderId || body?.orderId || '?'}${chainLabel(p)}\n执行方已开始处理,进入里程碑阶段`,
|
|
317
323
|
'milestone_submitted': (p) => {
|
|
318
324
|
const desc = p.milestoneDescription ? `\n目标: ${p.milestoneDescription}` : '';
|
|
319
325
|
const content = p.resultSummary ? `\n提交内容: ${String(p.resultSummary).substring(0, 200)}` : '';
|
|
@@ -330,8 +336,10 @@ async function pushTradeNotification(eventType, payload, body) {
|
|
|
330
336
|
return `❌ 里程碑 M${p.milestoneIndex ?? '?'} 被拒绝\n订单: ${p.orderId || body?.orderId || '?'}${desc}\n原因: ${p.rejectReason || '未说明'}`;
|
|
331
337
|
},
|
|
332
338
|
'order_settled': (p) => {
|
|
333
|
-
const
|
|
334
|
-
|
|
339
|
+
const cl = chainLabel(p);
|
|
340
|
+
const amount = p.priceAmount ? `\n金额: $${p.priceAmount} USDC${cl}` : '';
|
|
341
|
+
const dest = cl === ' (Fast)' ? '\n资金已到达执行方 Fast 钱包' : '\nUSDC 已支付';
|
|
342
|
+
return `💰 订单已结算完成\n订单: ${p.orderId || body?.orderId || '?'}${amount}${dest}`;
|
|
335
343
|
},
|
|
336
344
|
};
|
|
337
345
|
const tmpl = templates[eventType];
|