@synonymdev/pubky 0.4.2 → 0.5.0-rc.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 +1 -1
- package/index.cjs +112 -63
- package/index.js +125 -71
- package/package.json +2 -2
- package/pubky.d.ts +39 -4
- package/pubky_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@synonymdev/pubky",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Pubky client",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.5.0-rc.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"test-nodejs": "tape test/*.js -cov",
|
|
15
15
|
"test-browser": "browserify test/*.js -p esmify | npx tape-run",
|
|
16
16
|
"build": "cargo run --bin bundle_pubky_npm",
|
|
17
|
-
"prepublishOnly": "npm run build
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"index.cjs",
|
package/pubky.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function setLogLevel(level: string): void;
|
|
3
4
|
/**
|
|
4
5
|
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
5
6
|
* using the `passphrase`.
|
|
@@ -10,7 +11,36 @@ export function createRecoveryFile(keypair: Keypair, passphrase: string): Uint8A
|
|
|
10
11
|
* using the `passphrase`.
|
|
11
12
|
*/
|
|
12
13
|
export function decryptRecoveryFile(recovery_file: Uint8Array, passphrase: string): Keypair;
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Pkarr Config
|
|
16
|
+
*/
|
|
17
|
+
export interface PkarrConfig {
|
|
18
|
+
/**
|
|
19
|
+
* The list of relays to access the DHT with.
|
|
20
|
+
*/
|
|
21
|
+
relays: string[] | null;
|
|
22
|
+
/**
|
|
23
|
+
* The timeout for DHT requests in milliseconds.
|
|
24
|
+
* Default is 2000ms.
|
|
25
|
+
*/
|
|
26
|
+
requestTimeout: NonZeroU64 | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Pubky Client Config
|
|
31
|
+
*/
|
|
32
|
+
export interface PubkyClientConfig {
|
|
33
|
+
/**
|
|
34
|
+
* Configuration on how to access pkarr packets on the mainline DHT.
|
|
35
|
+
*/
|
|
36
|
+
pkarr: PkarrConfig | null;
|
|
37
|
+
/**
|
|
38
|
+
* The maximum age of a record in seconds.
|
|
39
|
+
* If the user pkarr record is older than this, it will be automatically refreshed.
|
|
40
|
+
*/
|
|
41
|
+
userMaxRecordAge: NonZeroU64 | null;
|
|
42
|
+
}
|
|
43
|
+
|
|
14
44
|
export class AuthRequest {
|
|
15
45
|
private constructor();
|
|
16
46
|
free(): void;
|
|
@@ -89,9 +119,9 @@ export class Client {
|
|
|
89
119
|
*/
|
|
90
120
|
republishHomeserver(keypair: Keypair, host: PublicKey): Promise<void>;
|
|
91
121
|
/**
|
|
92
|
-
* Create Client with
|
|
122
|
+
* Create a new Pubky Client with an optional configuration.
|
|
93
123
|
*/
|
|
94
|
-
constructor();
|
|
124
|
+
constructor(config_opt?: PubkyClientConfig | null);
|
|
95
125
|
/**
|
|
96
126
|
* Create a client with with configurations appropriate for local testing:
|
|
97
127
|
* - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
|
|
@@ -137,8 +167,13 @@ export class PublicKey {
|
|
|
137
167
|
free(): void;
|
|
138
168
|
/**
|
|
139
169
|
* Convert the PublicKey to Uint8Array
|
|
170
|
+
* @deprecated Use `toUint8Array` instead
|
|
140
171
|
*/
|
|
141
172
|
to_uint8array(): Uint8Array;
|
|
173
|
+
/**
|
|
174
|
+
* Convert the PublicKey to Uint8Array
|
|
175
|
+
*/
|
|
176
|
+
toUint8Array(): Uint8Array;
|
|
142
177
|
/**
|
|
143
178
|
* Returns the z-base32 encoding of this public key
|
|
144
179
|
*/
|
|
@@ -146,7 +181,7 @@ export class PublicKey {
|
|
|
146
181
|
/**
|
|
147
182
|
* @throws
|
|
148
183
|
*/
|
|
149
|
-
static from(value:
|
|
184
|
+
static from(value: string): PublicKey;
|
|
150
185
|
}
|
|
151
186
|
export class Session {
|
|
152
187
|
private constructor();
|
package/pubky_bg.wasm
CHANGED
|
Binary file
|