@unicitylabs/sphere-sdk 0.5.7 → 0.6.0-dev.1
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/connect/index.cjs.map +1 -1
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +105 -11
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +39 -12
- package/dist/core/index.d.ts +39 -12
- package/dist/core/index.js +100 -10
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +191 -497
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +191 -497
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/browser/ipfs.cjs.map +1 -1
- package/dist/impl/browser/ipfs.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +203 -509
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.d.cts +10 -20
- package/dist/impl/nodejs/index.d.ts +10 -20
- package/dist/impl/nodejs/index.js +203 -509
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +116 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -13
- package/dist/index.d.ts +40 -13
- package/dist/index.js +110 -11
- package/dist/index.js.map +1 -1
- package/dist/l1/index.cjs.map +1 -1
- package/dist/l1/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -91,16 +91,6 @@ interface TransportProvider extends BaseProvider {
|
|
|
91
91
|
* @returns true if successful, false if nametag is taken by another pubkey
|
|
92
92
|
*/
|
|
93
93
|
publishIdentityBinding?(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated Use publishIdentityBinding instead
|
|
96
|
-
* Register a nametag for this identity
|
|
97
|
-
*/
|
|
98
|
-
registerNametag?(nametag: string, chainPubkey: string, directAddress: string): Promise<boolean>;
|
|
99
|
-
/**
|
|
100
|
-
* @deprecated Use publishIdentityBinding instead
|
|
101
|
-
* Publish nametag binding
|
|
102
|
-
*/
|
|
103
|
-
publishNametag?(nametag: string, address: string): Promise<void>;
|
|
104
94
|
/**
|
|
105
95
|
* Subscribe to broadcast messages (global/channel)
|
|
106
96
|
*/
|
|
@@ -556,10 +546,14 @@ declare class NostrTransportProvider implements TransportProvider {
|
|
|
556
546
|
resolveNametagInfo(nametag: string): Promise<PeerInfo | null>;
|
|
557
547
|
/**
|
|
558
548
|
* Resolve a DIRECT://, PROXY://, or L1 address to full peer info.
|
|
559
|
-
* Performs reverse lookup
|
|
560
|
-
* Works with both new identity binding events and legacy nametag binding events.
|
|
549
|
+
* Performs reverse lookup via nostr-js-sdk with first-seen-wins anti-hijacking.
|
|
561
550
|
*/
|
|
562
551
|
resolveAddressInfo(address: string): Promise<PeerInfo | null>;
|
|
552
|
+
/**
|
|
553
|
+
* Convert a BindingInfo (from nostr-js-sdk) to PeerInfo (sphere-sdk type).
|
|
554
|
+
* Computes PROXY address from nametag if available.
|
|
555
|
+
*/
|
|
556
|
+
private bindingInfoToPeerInfo;
|
|
563
557
|
/**
|
|
564
558
|
* Resolve transport pubkey (Nostr pubkey) to full peer info.
|
|
565
559
|
* Queries binding events authored by the given pubkey.
|
|
@@ -578,18 +572,14 @@ declare class NostrTransportProvider implements TransportProvider {
|
|
|
578
572
|
recoverNametag(): Promise<string | null>;
|
|
579
573
|
/**
|
|
580
574
|
* Publish identity binding event on Nostr.
|
|
581
|
-
* Without nametag: publishes base binding (chainPubkey, l1Address, directAddress)
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
* Each HD address index has its own Nostr key → its own binding event.
|
|
575
|
+
* Without nametag: publishes base binding (chainPubkey, l1Address, directAddress)
|
|
576
|
+
* using a per-identity d-tag for address discovery.
|
|
577
|
+
* With nametag: delegates to nostr-js-sdk's publishNametagBinding which handles
|
|
578
|
+
* conflict detection (first-seen-wins), encryption, and indexed tags.
|
|
586
579
|
*
|
|
587
580
|
* @returns true if successful, false if nametag is taken by another pubkey
|
|
588
581
|
*/
|
|
589
582
|
publishIdentityBinding(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
|
|
590
|
-
/** @deprecated Use publishIdentityBinding instead */
|
|
591
|
-
publishNametag(nametag: string, address: string): Promise<void>;
|
|
592
|
-
registerNametag(nametag: string, _publicKey: string, directAddress?: string): Promise<boolean>;
|
|
593
583
|
private broadcastSubscriptions;
|
|
594
584
|
subscribeToBroadcast(tags: string[], handler: BroadcastHandler): () => void;
|
|
595
585
|
publishBroadcast(content: string, tags?: string[]): Promise<string>;
|
|
@@ -91,16 +91,6 @@ interface TransportProvider extends BaseProvider {
|
|
|
91
91
|
* @returns true if successful, false if nametag is taken by another pubkey
|
|
92
92
|
*/
|
|
93
93
|
publishIdentityBinding?(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated Use publishIdentityBinding instead
|
|
96
|
-
* Register a nametag for this identity
|
|
97
|
-
*/
|
|
98
|
-
registerNametag?(nametag: string, chainPubkey: string, directAddress: string): Promise<boolean>;
|
|
99
|
-
/**
|
|
100
|
-
* @deprecated Use publishIdentityBinding instead
|
|
101
|
-
* Publish nametag binding
|
|
102
|
-
*/
|
|
103
|
-
publishNametag?(nametag: string, address: string): Promise<void>;
|
|
104
94
|
/**
|
|
105
95
|
* Subscribe to broadcast messages (global/channel)
|
|
106
96
|
*/
|
|
@@ -556,10 +546,14 @@ declare class NostrTransportProvider implements TransportProvider {
|
|
|
556
546
|
resolveNametagInfo(nametag: string): Promise<PeerInfo | null>;
|
|
557
547
|
/**
|
|
558
548
|
* Resolve a DIRECT://, PROXY://, or L1 address to full peer info.
|
|
559
|
-
* Performs reverse lookup
|
|
560
|
-
* Works with both new identity binding events and legacy nametag binding events.
|
|
549
|
+
* Performs reverse lookup via nostr-js-sdk with first-seen-wins anti-hijacking.
|
|
561
550
|
*/
|
|
562
551
|
resolveAddressInfo(address: string): Promise<PeerInfo | null>;
|
|
552
|
+
/**
|
|
553
|
+
* Convert a BindingInfo (from nostr-js-sdk) to PeerInfo (sphere-sdk type).
|
|
554
|
+
* Computes PROXY address from nametag if available.
|
|
555
|
+
*/
|
|
556
|
+
private bindingInfoToPeerInfo;
|
|
563
557
|
/**
|
|
564
558
|
* Resolve transport pubkey (Nostr pubkey) to full peer info.
|
|
565
559
|
* Queries binding events authored by the given pubkey.
|
|
@@ -578,18 +572,14 @@ declare class NostrTransportProvider implements TransportProvider {
|
|
|
578
572
|
recoverNametag(): Promise<string | null>;
|
|
579
573
|
/**
|
|
580
574
|
* Publish identity binding event on Nostr.
|
|
581
|
-
* Without nametag: publishes base binding (chainPubkey, l1Address, directAddress)
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
* Each HD address index has its own Nostr key → its own binding event.
|
|
575
|
+
* Without nametag: publishes base binding (chainPubkey, l1Address, directAddress)
|
|
576
|
+
* using a per-identity d-tag for address discovery.
|
|
577
|
+
* With nametag: delegates to nostr-js-sdk's publishNametagBinding which handles
|
|
578
|
+
* conflict detection (first-seen-wins), encryption, and indexed tags.
|
|
586
579
|
*
|
|
587
580
|
* @returns true if successful, false if nametag is taken by another pubkey
|
|
588
581
|
*/
|
|
589
582
|
publishIdentityBinding(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
|
|
590
|
-
/** @deprecated Use publishIdentityBinding instead */
|
|
591
|
-
publishNametag(nametag: string, address: string): Promise<void>;
|
|
592
|
-
registerNametag(nametag: string, _publicKey: string, directAddress?: string): Promise<boolean>;
|
|
593
583
|
private broadcastSubscriptions;
|
|
594
584
|
subscribeToBroadcast(tags: string[], handler: BroadcastHandler): () => void;
|
|
595
585
|
publishBroadcast(content: string, tags?: string[]): Promise<string>;
|