@exagent/sdk 0.1.19 → 0.1.20

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 CHANGED
@@ -1533,6 +1533,21 @@ var ExagentClient = class {
1533
1533
  }
1534
1534
  }
1535
1535
  const hash = await this.walletClient.sendTransaction(txParams);
1536
+ if (routerTrade.route && routerTrade.route.length > 0) {
1537
+ const dexSource = [...new Set(routerTrade.route.map((r) => r.dex))].join(", ");
1538
+ const routeApiUrl = EXAGENT_API_CONFIG[this.network];
1539
+ fetch(`${routeApiUrl}/v1/router/trade-route`, {
1540
+ method: "POST",
1541
+ headers: this.apiHeaders("application/json"),
1542
+ body: JSON.stringify({
1543
+ txHash: hash,
1544
+ agentId: Number(agentId),
1545
+ dexSource,
1546
+ route: routerTrade.route
1547
+ })
1548
+ }).catch(() => {
1549
+ });
1550
+ }
1536
1551
  return {
1537
1552
  hash,
1538
1553
  agentId,
package/dist/index.mjs CHANGED
@@ -1502,6 +1502,21 @@ var ExagentClient = class {
1502
1502
  }
1503
1503
  }
1504
1504
  const hash = await this.walletClient.sendTransaction(txParams);
1505
+ if (routerTrade.route && routerTrade.route.length > 0) {
1506
+ const dexSource = [...new Set(routerTrade.route.map((r) => r.dex))].join(", ");
1507
+ const routeApiUrl = EXAGENT_API_CONFIG[this.network];
1508
+ fetch(`${routeApiUrl}/v1/router/trade-route`, {
1509
+ method: "POST",
1510
+ headers: this.apiHeaders("application/json"),
1511
+ body: JSON.stringify({
1512
+ txHash: hash,
1513
+ agentId: Number(agentId),
1514
+ dexSource,
1515
+ route: routerTrade.route
1516
+ })
1517
+ }).catch(() => {
1518
+ });
1519
+ }
1505
1520
  return {
1506
1521
  hash,
1507
1522
  agentId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exagent/sdk",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "TypeScript SDK for Exagent",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",