@lawrenceliang-btc/atel-sdk 1.1.36 → 1.1.37

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.
Files changed (2) hide show
  1. package/bin/atel.mjs +9 -3
  2. 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,7 +336,7 @@ 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 amount = p.priceAmount ? `\n金额: $${p.priceAmount} USDC` : '';
339
+ const amount = p.priceAmount ? `\n金额: $${p.priceAmount} USDC${chainLabel(p)}` : '';
334
340
  return `💰 订单已结算完成\n订单: ${p.orderId || body?.orderId || '?'}${amount}\nUSDC 已支付`;
335
341
  },
336
342
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lawrenceliang-btc/atel-sdk",
3
- "version": "1.1.36",
3
+ "version": "1.1.37",
4
4
  "description": "ATEL Protocol SDK - Agent Trust & Exchange Layer",
5
5
  "repository": {
6
6
  "type": "git",