@openclaw/nostr 2026.5.31-beta.2 → 2026.5.31-beta.4

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/api.js CHANGED
@@ -1,7 +1,7 @@
1
- import { o as resolveNostrAccount } from "./setup-surface-CVEYWXAG.js";
1
+ import { o as resolveNostrAccount } from "./setup-surface-BqBa2C0K.js";
2
2
  import { getPluginRuntimeGatewayRequestScope } from "./runtime-api.js";
3
3
  import { n as NostrProfileSchema } from "./config-schema-DIiXiBKr.js";
4
- import { a as setNostrRuntime, i as getNostrRuntime, n as nostrPlugin, o as contentToProfile, r as publishNostrProfile, t as getNostrProfileState } from "./channel-nsm56KpS.js";
4
+ import { a as setNostrRuntime, i as getNostrRuntime, n as nostrPlugin, o as contentToProfile, r as publishNostrProfile, t as getNostrProfileState } from "./channel-Dz31pjch.js";
5
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { z } from "zod";
7
7
  import { SimplePool, verifyEvent } from "nostr-tools";
@@ -1,4 +1,4 @@
1
- import { a as resolveDefaultNostrAccountId, c as validatePrivateKey, i as listNostrAccountIds, n as nostrSetupWizard, o as resolveNostrAccount, s as normalizePubkey, t as nostrSetupAdapter } from "./setup-surface-CVEYWXAG.js";
1
+ import { a as resolveDefaultNostrAccountId, c as validatePrivateKey, i as listNostrAccountIds, n as nostrSetupWizard, o as resolveNostrAccount, s as normalizePubkey, t as nostrSetupAdapter } from "./setup-surface-BqBa2C0K.js";
2
2
  import { a as collectStatusIssuesFromLastError, i as buildChannelConfigSchema, n as NostrProfileSchema, o as createDefaultChannelRuntimeState, r as DEFAULT_ACCOUNT_ID, s as formatPairingApproveHint, t as NostrConfigSchema } from "./config-schema-DIiXiBKr.js";
3
3
  import { i as DEFAULT_RELAYS } from "./setup-adapter-DEU3o8MF.js";
4
4
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
@@ -950,7 +950,9 @@ async function startNostrBus(options) {
950
950
  };
951
951
  const relayAbort = new AbortController();
952
952
  const sub = pool.subscribeMany(relays, dmFilter, {
953
- onevent: handleEvent,
953
+ onevent: (event) => {
954
+ handleEvent(event);
955
+ },
954
956
  oneose: () => {
955
957
  for (const relay of relays) metrics.emit("relay.message.eose", 1, { relay });
956
958
  onEose?.(relays.join(", "));
@@ -981,11 +983,11 @@ async function startNostrBus(options) {
981
983
  return result;
982
984
  };
983
985
  const getProfileState = async () => {
984
- const state = await readNostrProfileState({ accountId });
986
+ const stateLocal = await readNostrProfileState({ accountId });
985
987
  return {
986
- lastPublishedAt: state?.lastPublishedAt ?? null,
987
- lastPublishedEventId: state?.lastPublishedEventId ?? null,
988
- lastPublishResults: state?.lastPublishResults ?? null
988
+ lastPublishedAt: stateLocal?.lastPublishedAt ?? null,
989
+ lastPublishedEventId: stateLocal?.lastPublishedEventId ?? null,
990
+ lastPublishResults: stateLocal?.lastPublishResults ?? null
989
991
  };
990
992
  };
991
993
  return {
@@ -1031,9 +1033,9 @@ async function sendEncryptedDm(pool, sk, toPubkey, text, relays, metrics, circui
1031
1033
  if (cb && !cb.canAttempt()) continue;
1032
1034
  const startTime = Date.now();
1033
1035
  try {
1034
- const [publishPromise] = pool.publish([relay], reply);
1035
- if (!publishPromise) throw new Error(`Failed to create publish promise for relay ${relay}`);
1036
- await publishPromise;
1036
+ const publishPromises = pool.publish([relay], reply);
1037
+ if (publishPromises.length === 0) throw new Error(`Failed to create publish promise for relay ${relay}`);
1038
+ await publishPromises[0];
1037
1039
  const latency = Date.now() - startTime;
1038
1040
  cb?.recordSuccess();
1039
1041
  healthTracker.recordSuccess(relay, latency);
@@ -1,2 +1,2 @@
1
- import { n as nostrPlugin } from "./channel-nsm56KpS.js";
1
+ import { n as nostrPlugin } from "./channel-Dz31pjch.js";
2
2
  export { nostrPlugin };
@@ -51,7 +51,7 @@ async function readJsonFile(filePath) {
51
51
  }
52
52
  async function listLegacyFiles(params) {
53
53
  const dir = path.join(params.stateDir, "nostr");
54
- let entries = [];
54
+ let entries;
55
55
  try {
56
56
  entries = await fs.readdir(dir, { withFileTypes: true });
57
57
  } catch {
package/dist/setup-api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as nostrSetupWizard, t as nostrSetupAdapter } from "./setup-surface-CVEYWXAG.js";
1
+ import { n as nostrSetupWizard, t as nostrSetupAdapter } from "./setup-surface-BqBa2C0K.js";
2
2
  export { nostrSetupAdapter, nostrSetupWizard };
@@ -51,7 +51,7 @@ const nostrSetupAdapter = createNostrSetupAdapter({
51
51
  });
52
52
  const nostrSetupWizard = createDelegatedSetupWizardProxy({
53
53
  channel,
54
- loadWizard: async () => (await import("./setup-surface-CVEYWXAG.js").then((n) => n.r)).nostrSetupWizard,
54
+ loadWizard: async () => (await import("./setup-surface-BqBa2C0K.js").then((n) => n.r)).nostrSetupWizard,
55
55
  status: { ...createStandardChannelSetupStatus({
56
56
  channelLabel: "Nostr",
57
57
  configuredLabel: t("wizard.channels.statusConfigured"),
@@ -47,8 +47,8 @@ function normalizePubkey(input) {
47
47
  const trimmed = input.trim();
48
48
  if (trimmed.startsWith("npub1")) {
49
49
  const decoded = nip19.decode(trimmed);
50
- if (decoded.type !== "npub") throw new Error("Invalid npub key");
51
- return Array.from(decoded.data).map((b) => b.toString(16).padStart(2, "0")).join("");
50
+ if (decoded.type !== "npub" || typeof decoded.data !== "string") throw new Error("Invalid npub key");
51
+ return decoded.data.toLowerCase();
52
52
  }
53
53
  if (!/^[0-9a-fA-F]{64}$/.test(trimmed)) throw new Error("Pubkey must be 64 hex characters or npub format");
54
54
  return trimmed.toLowerCase();
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@openclaw/nostr",
3
- "version": "2026.5.31-beta.2",
3
+ "version": "2026.5.31-beta.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/nostr",
9
- "version": "2026.5.31-beta.2",
9
+ "version": "2026.5.31-beta.4",
10
10
  "dependencies": {
11
11
  "nostr-tools": "2.23.5",
12
12
  "zod": "4.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.5.31-beta.2"
15
+ "openclaw": ">=2026.5.31-beta.4"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/nostr",
3
- "version": "2026.5.31-beta.2",
3
+ "version": "2026.5.31-beta.4",
4
4
  "description": "OpenClaw Nostr channel plugin for NIP-04 encrypted direct messages.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "zod": "4.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.5.31-beta.2"
15
+ "openclaw": ">=2026.5.31-beta.4"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -50,10 +50,10 @@
50
50
  "minHostVersion": ">=2026.4.10"
51
51
  },
52
52
  "compat": {
53
- "pluginApi": ">=2026.5.31-beta.2"
53
+ "pluginApi": ">=2026.5.31-beta.4"
54
54
  },
55
55
  "build": {
56
- "openclawVersion": "2026.5.31-beta.2"
56
+ "openclawVersion": "2026.5.31-beta.4"
57
57
  },
58
58
  "release": {
59
59
  "publishToClawHub": true,