mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 13:41:30 +00:00
26 lines
646 B
TypeScript
26 lines
646 B
TypeScript
import {
|
|
buildChannelOutboundSessionRoute,
|
|
stripChannelTargetPrefix,
|
|
type ChannelOutboundSessionRouteParams,
|
|
} from "openclaw/plugin-sdk/core";
|
|
|
|
export function resolveNostrOutboundSessionRoute(params: ChannelOutboundSessionRouteParams) {
|
|
const target = stripChannelTargetPrefix(params.target, "nostr");
|
|
if (!target) {
|
|
return null;
|
|
}
|
|
return buildChannelOutboundSessionRoute({
|
|
cfg: params.cfg,
|
|
agentId: params.agentId,
|
|
channel: "nostr",
|
|
accountId: params.accountId,
|
|
peer: {
|
|
kind: "direct",
|
|
id: target,
|
|
},
|
|
chatType: "direct",
|
|
from: `nostr:${target}`,
|
|
to: `nostr:${target}`,
|
|
});
|
|
}
|