nostr-tools 2.3.0 → 2.3.2
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/README.md +5 -1
- package/lib/cjs/abstract-pool.js +9 -6
- package/lib/cjs/abstract-pool.js.map +2 -2
- package/lib/cjs/abstract-relay.js +9 -6
- package/lib/cjs/abstract-relay.js.map +2 -2
- package/lib/cjs/filter.js.map +2 -2
- package/lib/cjs/index.js +60 -53
- package/lib/cjs/index.js.map +3 -3
- package/lib/cjs/kinds.js.map +2 -2
- package/lib/cjs/nip04.js.map +2 -2
- package/lib/cjs/nip11.js.map +2 -2
- package/lib/cjs/nip13.js.map +2 -2
- package/lib/cjs/nip18.js.map +2 -2
- package/lib/cjs/nip19.js.map +2 -2
- package/lib/cjs/nip21.js.map +2 -2
- package/lib/cjs/nip25.js.map +2 -2
- package/lib/cjs/nip27.js.map +2 -2
- package/lib/cjs/nip28.js.map +2 -2
- package/lib/cjs/nip29.js.map +2 -2
- package/lib/cjs/nip30.js.map +2 -2
- package/lib/cjs/nip42.js.map +1 -1
- package/lib/cjs/nip44.js +51 -47
- package/lib/cjs/nip44.js.map +2 -2
- package/lib/cjs/nip46.js +20 -9
- package/lib/cjs/nip46.js.map +3 -3
- package/lib/cjs/nip47.js.map +2 -2
- package/lib/cjs/nip57.js.map +2 -2
- package/lib/cjs/nip75.js.map +1 -1
- package/lib/cjs/nip94.js.map +1 -1
- package/lib/cjs/nip96.js +3 -5
- package/lib/cjs/nip96.js.map +2 -2
- package/lib/cjs/nip98.js.map +2 -2
- package/lib/cjs/nip99.js.map +1 -1
- package/lib/cjs/pool.js +9 -6
- package/lib/cjs/pool.js.map +2 -2
- package/lib/cjs/pure.js.map +2 -2
- package/lib/cjs/references.js.map +2 -2
- package/lib/cjs/relay.js +9 -6
- package/lib/cjs/relay.js.map +2 -2
- package/lib/cjs/utils.js.map +2 -2
- package/lib/esm/abstract-pool.js +9 -6
- package/lib/esm/abstract-pool.js.map +2 -2
- package/lib/esm/abstract-relay.js +9 -6
- package/lib/esm/abstract-relay.js.map +2 -2
- package/lib/esm/filter.js.map +2 -2
- package/lib/esm/index.js +60 -53
- package/lib/esm/index.js.map +3 -3
- package/lib/esm/kinds.js.map +2 -2
- package/lib/esm/nip04.js.map +2 -2
- package/lib/esm/nip11.js.map +2 -2
- package/lib/esm/nip13.js.map +2 -2
- package/lib/esm/nip18.js.map +2 -2
- package/lib/esm/nip19.js.map +2 -2
- package/lib/esm/nip21.js.map +2 -2
- package/lib/esm/nip25.js.map +2 -2
- package/lib/esm/nip27.js.map +2 -2
- package/lib/esm/nip28.js.map +2 -2
- package/lib/esm/nip29.js.map +2 -2
- package/lib/esm/nip30.js.map +2 -2
- package/lib/esm/nip42.js.map +1 -1
- package/lib/esm/nip44.js +53 -47
- package/lib/esm/nip44.js.map +2 -2
- package/lib/esm/nip46.js +20 -9
- package/lib/esm/nip46.js.map +3 -3
- package/lib/esm/nip47.js.map +2 -2
- package/lib/esm/nip57.js.map +2 -2
- package/lib/esm/nip75.js.map +1 -1
- package/lib/esm/nip94.js.map +1 -1
- package/lib/esm/nip96.js +5 -5
- package/lib/esm/nip96.js.map +3 -3
- package/lib/esm/nip98.js.map +2 -2
- package/lib/esm/nip99.js.map +1 -1
- package/lib/esm/pool.js +9 -6
- package/lib/esm/pool.js.map +2 -2
- package/lib/esm/pure.js.map +2 -2
- package/lib/esm/references.js.map +2 -2
- package/lib/esm/relay.js +9 -6
- package/lib/esm/relay.js.map +2 -2
- package/lib/esm/utils.js.map +2 -2
- package/lib/nostr.bundle.js +60 -53
- package/lib/nostr.bundle.js.map +3 -3
- package/lib/types/abstract-relay.d.ts +1 -0
- package/lib/types/nip44.d.ts +27 -53
- package/lib/types/nip46.d.ts +2 -1
- package/lib/types/nip47.d.ts +6 -3
- package/lib/types/nip96.d.ts +2 -0
- package/lib/types/test-helpers.d.ts +0 -1
- package/lib/types/utils.d.ts +1 -0
- package/package.json +1 -1
package/lib/types/nip44.d.ts
CHANGED
|
@@ -1,58 +1,32 @@
|
|
|
1
1
|
import { utf8ToBytes } from '@noble/hashes/utils';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
chacha_key: Uint8Array;
|
|
13
|
-
chacha_nonce: Uint8Array;
|
|
14
|
-
hmac_key: Uint8Array;
|
|
15
|
-
};
|
|
16
|
-
calcPaddedLen(len: number): number;
|
|
17
|
-
writeU16BE(num: number): Uint8Array;
|
|
18
|
-
pad(plaintext: string): Uint8Array;
|
|
19
|
-
unpad(padded: Uint8Array): string;
|
|
20
|
-
hmacAad(key: Uint8Array, message: Uint8Array, aad: Uint8Array): Uint8Array;
|
|
21
|
-
decodePayload(payload: string): {
|
|
22
|
-
nonce: Uint8Array;
|
|
23
|
-
ciphertext: Uint8Array;
|
|
24
|
-
mac: Uint8Array;
|
|
25
|
-
};
|
|
2
|
+
declare class u {
|
|
3
|
+
static minPlaintextSize: number;
|
|
4
|
+
static maxPlaintextSize: number;
|
|
5
|
+
static utf8Encode: typeof utf8ToBytes;
|
|
6
|
+
static utf8Decode(bytes: Uint8Array): string;
|
|
7
|
+
static getConversationKey(privkeyA: string, pubkeyB: string): Uint8Array;
|
|
8
|
+
static getMessageKeys(conversationKey: Uint8Array, nonce: Uint8Array): {
|
|
9
|
+
chacha_key: Uint8Array;
|
|
10
|
+
chacha_nonce: Uint8Array;
|
|
11
|
+
hmac_key: Uint8Array;
|
|
26
12
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
utf8Decode(bytes: Uint8Array): string;
|
|
37
|
-
getConversationKey(privkeyA: string, pubkeyB: string): Uint8Array;
|
|
38
|
-
getMessageKeys(conversationKey: Uint8Array, nonce: Uint8Array): {
|
|
39
|
-
chacha_key: Uint8Array;
|
|
40
|
-
chacha_nonce: Uint8Array;
|
|
41
|
-
hmac_key: Uint8Array;
|
|
42
|
-
};
|
|
43
|
-
calcPaddedLen(len: number): number;
|
|
44
|
-
writeU16BE(num: number): Uint8Array;
|
|
45
|
-
pad(plaintext: string): Uint8Array;
|
|
46
|
-
unpad(padded: Uint8Array): string;
|
|
47
|
-
hmacAad(key: Uint8Array, message: Uint8Array, aad: Uint8Array): Uint8Array;
|
|
48
|
-
decodePayload(payload: string): {
|
|
49
|
-
nonce: Uint8Array;
|
|
50
|
-
ciphertext: Uint8Array;
|
|
51
|
-
mac: Uint8Array;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
encrypt: typeof encrypt;
|
|
55
|
-
decrypt: typeof decrypt;
|
|
13
|
+
static calcPaddedLen(len: number): number;
|
|
14
|
+
static writeU16BE(num: number): Uint8Array;
|
|
15
|
+
static pad(plaintext: string): Uint8Array;
|
|
16
|
+
static unpad(padded: Uint8Array): string;
|
|
17
|
+
static hmacAad(key: Uint8Array, message: Uint8Array, aad: Uint8Array): Uint8Array;
|
|
18
|
+
static decodePayload(payload: string): {
|
|
19
|
+
nonce: Uint8Array;
|
|
20
|
+
ciphertext: Uint8Array;
|
|
21
|
+
mac: Uint8Array;
|
|
56
22
|
};
|
|
23
|
+
}
|
|
24
|
+
export declare class v2 {
|
|
25
|
+
static utils: typeof u;
|
|
26
|
+
static encrypt(plaintext: string, conversationKey: Uint8Array, nonce?: Uint8Array): string;
|
|
27
|
+
static decrypt(payload: string, conversationKey: Uint8Array): string;
|
|
28
|
+
}
|
|
29
|
+
declare const _default: {
|
|
30
|
+
v2: typeof v2;
|
|
57
31
|
};
|
|
58
32
|
export default _default;
|
package/lib/types/nip46.d.ts
CHANGED
|
@@ -78,11 +78,12 @@ export declare class BunkerSigner {
|
|
|
78
78
|
* @returns A Promise that resolves to the auth_url that the client should follow to create an account.
|
|
79
79
|
*/
|
|
80
80
|
export declare function createAccount(bunker: BunkerProfile, params: BunkerSignerParams, username: string, domain: string, email?: string): Promise<BunkerSigner>;
|
|
81
|
+
export declare const fetchCustodialBunkers: typeof fetchBunkerProviders;
|
|
81
82
|
/**
|
|
82
83
|
* Fetches info on available providers that announce themselves using NIP-89 events.
|
|
83
84
|
* @returns A promise that resolves to an array of available bunker objects.
|
|
84
85
|
*/
|
|
85
|
-
export declare function
|
|
86
|
+
export declare function fetchBunkerProviders(pool: AbstractSimplePool, relays: string[]): Promise<BunkerProfile[]>;
|
|
86
87
|
export type BunkerProfile = {
|
|
87
88
|
bunkerPointer: BunkerPointer;
|
|
88
89
|
domain: string;
|
package/lib/types/nip47.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { type VerifiedEvent } from './pure.ts';
|
|
2
|
+
interface NWCConnection {
|
|
2
3
|
pubkey: string;
|
|
3
4
|
relay: string;
|
|
4
5
|
secret: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function
|
|
6
|
+
}
|
|
7
|
+
export declare function parseConnectionString(connectionString: string): NWCConnection;
|
|
8
|
+
export declare function makeNwcRequestEvent(pubkey: string, secretKey: Uint8Array, invoice: string): Promise<VerifiedEvent>;
|
|
9
|
+
export {};
|
package/lib/types/nip96.d.ts
CHANGED
package/lib/types/utils.d.ts
CHANGED