UNPKG

applesauce-wallet-connect

Version:

NIP-47 Nostr Wallet Connect implementation for both clients and services.

22 lines (21 loc) 1.15 kB
import { blueprint } from "applesauce-factory"; import { includeSingletonTag } from "applesauce-factory/operations"; import { setEncryptedContent } from "applesauce-factory/operations/content"; import { WALLET_NOTIFICATION_KIND, WALLET_LEGACY_NOTIFICATION_KIND, } from "../helpers/notification.js"; /** * Creates a wallet notification event (kind 23197) * @param client - The service pubkey * @param notification - The notification to create an event for * @param encryption - The encryption method to use (defaults to nip44_v2) */ export function WalletNotificationBlueprint(client, notification) { return blueprint(WALLET_NOTIFICATION_KIND, setEncryptedContent(client, JSON.stringify(notification)), includeSingletonTag(["p", client])); } /** * Creates a legacy wallet notification event (kind 23196) * @param client - The service pubkey * @param notification - The notification to create an event for */ export function WalletLegacyNotificationBlueprint(client, notification) { return blueprint(WALLET_LEGACY_NOTIFICATION_KIND, setEncryptedContent(client, JSON.stringify(notification)), includeSingletonTag(["p", client])); }