@coffeexdev/xmtp 0.0.2 → 0.0.3

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/package.json +1 -1
  2. package/src/channel.ts +14 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffeexdev/xmtp",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "OpenClaw XMTP channel plugin for E2E encrypted wallet-to-wallet messaging",
5
5
  "keywords": [
6
6
  "channel",
package/src/channel.ts CHANGED
@@ -508,13 +508,20 @@ export const xmtpPlugin: ChannelPlugin<ResolvedXmtpAccount> = {
508
508
 
509
509
  ctx.log?.info(`[${account.accountId}] XMTP provider started (address: ${bus.getAddress()})`);
510
510
 
511
- return {
512
- stop: async () => {
513
- await bus.close();
514
- activeBuses.delete(account.accountId);
515
- ctx.log?.info(`[${account.accountId}] XMTP provider stopped`);
516
- },
517
- };
511
+ // Block until abortSignal fires — OpenClaw treats a resolved startAccount
512
+ // as "provider exited" and triggers auto-restart with backoff.
513
+ await new Promise<void>((resolve) => {
514
+ if (ctx.abortSignal?.aborted) {
515
+ resolve();
516
+ return;
517
+ }
518
+ const onAbort = () => resolve();
519
+ ctx.abortSignal?.addEventListener("abort", onAbort, { once: true });
520
+ });
521
+
522
+ await bus.close();
523
+ activeBuses.delete(account.accountId);
524
+ ctx.log?.info(`[${account.accountId}] XMTP provider stopped`);
518
525
  },
519
526
  },
520
527
  };