applesauce-wallet-connect 0.0.0-next-20251015123951 → 0.0.0-next-20251205152544

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.
@@ -1,4 +1,4 @@
1
- import { EventBlueprint } from "applesauce-factory";
1
+ import { EventBlueprint } from "applesauce-core/event-factory";
2
2
  import { WalletNotification } from "../helpers/notification.js";
3
3
  /**
4
4
  * Creates a wallet notification event (kind 23197)
@@ -1,6 +1,6 @@
1
- import { blueprint } from "applesauce-factory";
2
- import { includeSingletonTag } from "applesauce-factory/operations";
3
- import { setEncryptedContent } from "applesauce-factory/operations/content";
1
+ import { blueprint } from "applesauce-core/event-factory";
2
+ import { includeSingletonTag } from "applesauce-core/operations/tags";
3
+ import { setEncryptedContent } from "applesauce-core/operations/encrypted-content";
4
4
  import { WALLET_NOTIFICATION_KIND, WALLET_LEGACY_NOTIFICATION_KIND, } from "../helpers/notification.js";
5
5
  /**
6
6
  * Creates a wallet notification event (kind 23197)
@@ -1,4 +1,4 @@
1
- import { EventBlueprint } from "applesauce-factory";
1
+ import { EventBlueprint } from "applesauce-core";
2
2
  import { WalletConnectEncryptionMethod } from "../helpers/encryption.js";
3
3
  import { TWalletMethod } from "../helpers/methods.js";
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { blueprint } from "applesauce-factory";
2
- import { includeSingletonTag } from "applesauce-factory/operations";
3
- import { setEncryptedContent } from "applesauce-factory/operations/content";
1
+ import { blueprint } from "applesauce-core";
2
+ import { includeSingletonTag } from "applesauce-core/operations/tags";
3
+ import { setEncryptedContent } from "applesauce-core/operations/encrypted-content";
4
4
  import { WALLET_REQUEST_KIND } from "../helpers/request.js";
5
5
  /**
6
6
  * Creates a walelt request event
@@ -1,5 +1,5 @@
1
- import { EventBlueprint } from "applesauce-factory";
2
- import { NostrEvent } from "nostr-tools";
1
+ import { EventBlueprint } from "applesauce-core";
2
+ import { NostrEvent } from "applesauce-core/helpers/event";
3
3
  import { TWalletMethod } from "../helpers/methods.js";
4
4
  /** Creates a wallet response event */
5
5
  export declare function WalletResponseBlueprint<Method extends TWalletMethod>(request: NostrEvent, response: Method["response"] | Method["error"]): EventBlueprint;
@@ -1,6 +1,6 @@
1
- import { blueprint } from "applesauce-factory";
2
- import { includeSingletonTag } from "applesauce-factory/operations";
3
- import { setEncryptedContent } from "applesauce-factory/operations/content";
1
+ import { blueprint } from "applesauce-core";
2
+ import { includeSingletonTag } from "applesauce-core/operations/tags";
3
+ import { setEncryptedContent } from "applesauce-core/operations/encrypted-content";
4
4
  import { getWalletRequestEncryption } from "../helpers/request.js";
5
5
  import { WALLET_RESPONSE_KIND } from "../helpers/response.js";
6
6
  /** Creates a wallet response event */
@@ -1,4 +1,4 @@
1
- import { EventBlueprint } from "applesauce-factory";
1
+ import { EventBlueprint } from "applesauce-core";
2
2
  import { WalletSupport } from "../helpers/support.js";
3
3
  import { TWalletMethod } from "../helpers/methods.js";
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { blueprint } from "applesauce-factory";
2
- import { setContent } from "applesauce-factory/operations/content";
3
- import { includeSingletonTag } from "applesauce-factory/operations";
1
+ import { blueprint } from "applesauce-core";
2
+ import { setContent } from "applesauce-core/operations/content";
3
+ import { includeSingletonTag } from "applesauce-core/operations/tags";
4
4
  import { WALLET_INFO_KIND } from "../helpers/support.js";
5
5
  /**
6
6
  * Creates a wallet info event
@@ -1,5 +1,5 @@
1
1
  import { HiddenContentSigner, KnownEvent, UnlockedHiddenContent } from "applesauce-core/helpers";
2
- import { NostrEvent } from "nostr-tools";
2
+ import { NostrEvent } from "applesauce-core/helpers/event";
3
3
  import { Transaction } from "./methods.js";
4
4
  export declare const WALLET_NOTIFICATION_KIND = 23197;
5
5
  export declare const WALLET_LEGACY_NOTIFICATION_KIND = 23196;
@@ -1,5 +1,5 @@
1
- import { HiddenContentSigner, KnownEvent, UnlockedHiddenContent } from "applesauce-core/helpers";
2
- import { NostrEvent } from "nostr-tools";
1
+ import { KnownEvent, NostrEvent } from "applesauce-core/helpers/event";
2
+ import { HiddenContentSigner, UnlockedHiddenContent } from "applesauce-core/helpers/hidden-content";
3
3
  import { WalletConnectEncryptionMethod } from "./encryption.js";
4
4
  import { TWalletMethod } from "./methods.js";
5
5
  export declare const WALLET_REQUEST_KIND = 23194;
@@ -1,4 +1,8 @@
1
- import { getTagValue, isHiddenContentUnlocked, isNIP04Encrypted, notifyEventUpdate, setHiddenContentEncryptionMethod, unixNow, unlockHiddenContent, } from "applesauce-core/helpers";
1
+ import { isNIP04Encrypted } from "applesauce-core/helpers/encryption";
2
+ import { notifyEventUpdate } from "applesauce-core/helpers/event";
3
+ import { getTagValue } from "applesauce-core/helpers/event";
4
+ import { isHiddenContentUnlocked, setHiddenContentEncryptionMethod, unlockHiddenContent, } from "applesauce-core/helpers/hidden-content";
5
+ import { unixNow } from "applesauce-core/helpers/time";
2
6
  export const WALLET_REQUEST_KIND = 23194;
3
7
  // Set the encryption method to use for request kind
4
8
  setHiddenContentEncryptionMethod(WALLET_REQUEST_KIND, "nip44");
@@ -1,5 +1,6 @@
1
- import { EncryptionMethod, HiddenContentSigner, KnownEvent, UnlockedHiddenContent } from "applesauce-core/helpers";
2
- import { NostrEvent } from "nostr-tools";
1
+ import { EncryptionMethod } from "applesauce-core/helpers/encrypted-content";
2
+ import { KnownEvent, NostrEvent } from "applesauce-core/helpers/event";
3
+ import { HiddenContentSigner, UnlockedHiddenContent } from "applesauce-core/helpers/hidden-content";
3
4
  import { TWalletMethod } from "./methods.js";
4
5
  export declare const WALLET_RESPONSE_KIND = 23195;
5
6
  /** A symbol used to cache the wallet response on the event */
@@ -1,4 +1,7 @@
1
- import { getTagValue, isHiddenContentUnlocked, isNIP04Encrypted, notifyEventUpdate, setHiddenContentEncryptionMethod, unlockHiddenContent, } from "applesauce-core/helpers";
1
+ import { isNIP04Encrypted } from "applesauce-core/helpers/encryption";
2
+ import { notifyEventUpdate } from "applesauce-core/helpers/event";
3
+ import { getTagValue } from "applesauce-core/helpers/event";
4
+ import { isHiddenContentUnlocked, setHiddenContentEncryptionMethod, unlockHiddenContent, } from "applesauce-core/helpers/hidden-content";
2
5
  export const WALLET_RESPONSE_KIND = 23195;
3
6
  // Set the encryption method to use for response kind
4
7
  setHiddenContentEncryptionMethod(WALLET_RESPONSE_KIND, "nip04");
@@ -1,4 +1,4 @@
1
- import { NostrEvent } from "nostr-tools";
1
+ import { NostrEvent } from "applesauce-core/helpers/event";
2
2
  import { WalletConnectEncryptionMethod } from "./encryption.js";
3
3
  import { TWalletMethod } from "./methods.js";
4
4
  import { NotificationType } from "./notification.js";
package/dist/interop.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Filter, NostrEvent } from "nostr-tools";
1
+ import { NostrEvent } from "applesauce-core/helpers/event";
2
+ import { Filter } from "applesauce-core/helpers/filter";
2
3
  import { ObservableInput } from "rxjs";
3
4
  /** A method used to subscribe to events on a set of relays */
4
5
  export type NostrSubscriptionMethod = (relays: string[], filters: Filter[]) => ObservableInput<NostrEvent | string>;
@@ -1,6 +1,6 @@
1
1
  import { EncryptionMethod } from "applesauce-core/helpers";
2
- import { EventSigner } from "applesauce-factory";
3
- import { NostrEvent } from "nostr-tools";
2
+ import { EventSigner } from "applesauce-core";
3
+ import { NostrEvent } from "applesauce-core/helpers";
4
4
  import { BehaviorSubject, Observable, Subscription } from "rxjs";
5
5
  import { NotificationType, WalletAuthURI, WalletConnectEncryptionMethod, WalletConnectURI, WalletNotification, WalletNotificationEvent, WalletResponseEvent, WalletSupport } from "./helpers/index.js";
6
6
  import { CommonWalletMethods, GetBalanceMethod, GetInfoMethod, ListTransactionsMethod, LookupInvoiceMethod, MakeInvoiceMethod, MultiPayInvoiceMethod, MultiPayKeysendMethod, PayInvoiceMethod, PayKeysendMethod, TWalletMethod } from "./helpers/methods.js";
@@ -1,7 +1,8 @@
1
1
  import { bytesToHex, hexToBytes } from "@noble/hashes/utils";
2
2
  import { simpleTimeout } from "applesauce-core";
3
- import { create } from "applesauce-factory";
4
- import { finalizeEvent, getPublicKey, nip04, nip44, verifyEvent } from "nostr-tools";
3
+ import { createEvent } from "applesauce-core";
4
+ import { finalizeEvent, getPublicKey, verifyEvent } from "applesauce-core/helpers";
5
+ import { nip04, nip44 } from "applesauce-core/helpers/encryption";
5
6
  import { BehaviorSubject, combineLatest, defer, filter, firstValueFrom, from, fromEvent, identity, ignoreElements, lastValueFrom, map, merge, mergeMap, of, repeat, ReplaySubject, retry, share, switchMap, take, takeUntil, tap, timer, toArray, } from "rxjs";
6
7
  import { WalletRequestBlueprint } from "./blueprints/index.js";
7
8
  import { createWalletError } from "./helpers/error.js";
@@ -166,7 +167,7 @@ export class WalletConnect {
166
167
  // Get the preferred encryption method for the wallet
167
168
  const encryption = await firstValueFrom(this.encryption$);
168
169
  // Create the request event
169
- const draft = await create({ signer: this.signer }, WalletRequestBlueprint, this.service, { method, params }, encryption);
170
+ const draft = await createEvent({ signer: this.signer }, WalletRequestBlueprint, this.service, { method, params }, encryption);
170
171
  // Sign the request event
171
172
  return await this.signer.signEvent(draft);
172
173
  }).pipe(
@@ -1,4 +1,4 @@
1
- import { EventSigner } from "applesauce-factory";
1
+ import { EventSigner } from "applesauce-core/event-factory";
2
2
  import { Observable, Subscription } from "rxjs";
3
3
  import { WalletAuthURI } from "./helpers/auth-uri.js";
4
4
  import { WalletErrorCode } from "./helpers/error.js";
@@ -1,7 +1,8 @@
1
1
  import { logger } from "applesauce-core";
2
- import { create } from "applesauce-factory";
3
- import { generateSecretKey, getPublicKey, verifyEvent } from "nostr-tools";
2
+ import { createEvent } from "applesauce-core/event-factory";
4
3
  import { filter, from, mergeMap, repeat, retry, share } from "rxjs";
4
+ import { verifyEvent } from "applesauce-core/helpers/event";
5
+ import { generateSecretKey, getPublicKey } from "applesauce-core/helpers/keys";
5
6
  import { bytesToHex } from "@noble/hashes/utils";
6
7
  import { WalletLegacyNotificationBlueprint, WalletNotificationBlueprint } from "./blueprints/notification.js";
7
8
  import { WalletResponseBlueprint } from "./blueprints/response.js";
@@ -154,7 +155,7 @@ export class WalletService {
154
155
  }
155
156
  /** Send a notification to the client */
156
157
  async notify(type, notification, legacy = false) {
157
- const draft = await create({ signer: this.signer }, legacy ? WalletLegacyNotificationBlueprint : WalletNotificationBlueprint, this.client, {
158
+ const draft = await createEvent({ signer: this.signer }, legacy ? WalletLegacyNotificationBlueprint : WalletNotificationBlueprint, this.client, {
158
159
  notification_type: type,
159
160
  notification,
160
161
  });
@@ -166,7 +167,7 @@ export class WalletService {
166
167
  try {
167
168
  // Tell the client which relay to use if there is only one (for nostr+walletauth URI connections)
168
169
  const overrideRelay = this.relays.length === 1 ? this.relays[0] : undefined;
169
- const draft = await create({ signer: this.signer }, (WalletSupportBlueprint), this.support, this.client, overrideRelay);
170
+ const draft = await createEvent({ signer: this.signer }, (WalletSupportBlueprint), this.support, this.client, overrideRelay);
170
171
  const event = await this.signer.signEvent(draft);
171
172
  await this.publishMethod(this.relays, event);
172
173
  }
@@ -260,7 +261,7 @@ export class WalletService {
260
261
  /** Send a response event */
261
262
  async sendResponse(requestEvent, response) {
262
263
  try {
263
- const draft = await create({ signer: this.signer }, WalletResponseBlueprint(requestEvent, response));
264
+ const draft = await createEvent({ signer: this.signer }, WalletResponseBlueprint(requestEvent, response));
264
265
  const event = await this.signer.signEvent(draft);
265
266
  await this.publishMethod(this.relays, event);
266
267
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-wallet-connect",
3
- "version": "0.0.0-next-20251015123951",
3
+ "version": "0.0.0-next-20251205152544",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -59,17 +59,17 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@noble/hashes": "^1.7.1",
62
- "applesauce-core": "0.0.0-next-20251015123951",
63
- "applesauce-factory": "^4.0.0",
64
- "nostr-tools": "~2.17",
62
+ "applesauce-common": "0.0.0-next-20251205152544",
63
+ "applesauce-core": "0.0.0-next-20251205152544",
65
64
  "rxjs": "^7.8.1"
66
65
  },
67
66
  "devDependencies": {
68
67
  "@hirez_io/observer-spy": "^2.2.0",
68
+ "applesauce-signers": "0.0.0-next-20251205152544",
69
69
  "@types/debug": "^4.1.12",
70
70
  "rimraf": "^6.0.1",
71
71
  "typescript": "^5.8.3",
72
- "vitest": "^3.2.4"
72
+ "vitest": "^4.0.15"
73
73
  },
74
74
  "funding": {
75
75
  "type": "lightning",