nostr-double-ratchet 0.0.8 → 0.0.10
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/Invite.d.ts +10 -5
- package/dist/Invite.d.ts.map +1 -1
- package/dist/nostr-double-ratchet.es.js +1125 -1118
- package/dist/nostr-double-ratchet.umd.js +1 -1
- package/package.json +1 -1
- package/src/Invite.ts +27 -24
package/dist/Invite.d.ts
CHANGED
|
@@ -3,14 +3,13 @@ import { NostrSubscribe, Unsubscribe } from "./types";
|
|
|
3
3
|
import { Channel } from "./Channel";
|
|
4
4
|
import { EncryptFunction, DecryptFunction } from "./types";
|
|
5
5
|
/**
|
|
6
|
-
* Invite
|
|
6
|
+
* Invite is a safe way to exchange session keys and initiate secret channels.
|
|
7
|
+
*
|
|
8
|
+
* It can be shared privately as an URL (e.g. QR code) or published as a Nostr event.
|
|
7
9
|
*
|
|
8
10
|
* Even if inviter's or invitee's long-term private key (identity key) and the shared secret (link) is compromised,
|
|
9
11
|
* forward secrecy is preserved as long as the session keys are not compromised.
|
|
10
12
|
*
|
|
11
|
-
* Shared secret Nostr channel: inviter listens to it and invitees can write to it. Outside observers don't know who are communicating over it.
|
|
12
|
-
* It is vulnerable to spam, so the link should only be given to trusted invitees or used with a reasonable maxUses limit.
|
|
13
|
-
*
|
|
14
13
|
* Also make sure to keep the session key safe.
|
|
15
14
|
*/
|
|
16
15
|
export declare class Invite {
|
|
@@ -27,11 +26,17 @@ export declare class Invite {
|
|
|
27
26
|
static deserialize(json: string): Invite;
|
|
28
27
|
static fromEvent(event: VerifiedEvent): Invite;
|
|
29
28
|
static fromUser(user: string, subscribe: NostrSubscribe): Promise<Invite | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Save Invite as JSON. Includes the inviter's session private key, so don't share this.
|
|
31
|
+
*/
|
|
30
32
|
serialize(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Invite parameters are in the URL's hash so they are not sent to the server.
|
|
35
|
+
*/
|
|
31
36
|
getUrl(root?: string): string;
|
|
32
37
|
getEvent(): UnsignedEvent;
|
|
33
38
|
/**
|
|
34
|
-
* Accepts the invite and creates a new channel with the inviter.
|
|
39
|
+
* Called by the invitee. Accepts the invite and creates a new channel with the inviter.
|
|
35
40
|
*
|
|
36
41
|
* @param inviteeSecretKey - The invitee's secret key or a signing function
|
|
37
42
|
* @param nostrSubscribe - A function to subscribe to Nostr events
|
package/dist/Invite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invite.d.ts","sourceRoot":"","sources":["../src/Invite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,aAAa,
|
|
1
|
+
{"version":3,"file":"Invite.d.ts","sourceRoot":"","sources":["../src/Invite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,aAAa,EAAE,aAAa,EAAuB,MAAM,aAAa,CAAC;AACvI,OAAO,EAAqB,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG3D;;;;;;;;;GASG;AACH,qBAAa,MAAM;IAEJ,uBAAuB,EAAE,MAAM;IAC/B,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAM;IACf,wBAAwB,CAAC,EAAE,UAAU;IACrC,KAAK,CAAC,EAAE,MAAM;IACd,OAAO,CAAC,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM,EAAE;gBANhB,uBAAuB,EAAE,MAAM,EAC/B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,wBAAwB,CAAC,EAAE,UAAU,YAAA,EACrC,KAAK,CAAC,EAAE,MAAM,YAAA,EACd,OAAO,CAAC,EAAE,MAAM,YAAA,EAChB,MAAM,GAAE,MAAM,EAAO;IAGhC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAA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