@synonymdev/pubky 0.5.1 → 0.5.4

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/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.1",
5
+ "version": "0.5.4",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/pubky.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function setLogLevel(level: string): void;
4
3
  /**
5
4
  * Create a recovery file of the `keypair`, containing the secret key encrypted
6
5
  * using the `passphrase`.
@@ -11,6 +10,7 @@ export function createRecoveryFile(keypair: Keypair, passphrase: string): Uint8A
11
10
  * using the `passphrase`.
12
11
  */
13
12
  export function decryptRecoveryFile(recovery_file: Uint8Array, passphrase: string): Keypair;
13
+ export function setLogLevel(level: string): void;
14
14
  /**
15
15
  * Pkarr Config
16
16
  */
@@ -18,12 +18,12 @@ export interface PkarrConfig {
18
18
  /**
19
19
  * The list of relays to access the DHT with.
20
20
  */
21
- relays: string[] | null;
21
+ relays?: string[];
22
22
  /**
23
23
  * The timeout for DHT requests in milliseconds.
24
24
  * Default is 2000ms.
25
25
  */
26
- requestTimeout: NonZeroU64 | null;
26
+ requestTimeout?: NonZeroU64;
27
27
  }
28
28
 
29
29
  /**
@@ -33,12 +33,12 @@ export interface PubkyClientConfig {
33
33
  /**
34
34
  * Configuration on how to access pkarr packets on the mainline DHT.
35
35
  */
36
- pkarr: PkarrConfig | null;
36
+ pkarr?: PkarrConfig;
37
37
  /**
38
38
  * The maximum age of a record in seconds.
39
39
  * If the user pkarr record is older than this, it will be automatically refreshed.
40
40
  */
41
- userMaxRecordAge: NonZeroU64 | null;
41
+ userMaxRecordAge?: NonZeroU64;
42
42
  }
43
43
 
44
44
  export class AuthRequest {
@@ -62,17 +62,6 @@ export class AuthRequest {
62
62
  }
63
63
  export class Client {
64
64
  free(): void;
65
- /**
66
- * Returns a list of Pubky urls (as strings).
67
- *
68
- * - `url`: The Pubky url (string) to the directory you want to list its content.
69
- * - `cursor`: Either a full `pubky://` Url (from previous list response),
70
- * or a path (to a file or directory) relative to the `url`
71
- * - `reverse`: List in reverse order
72
- * - `limit` Limit the number of urls in the response
73
- * - `shallow`: List directories and files, instead of flat list of files.
74
- */
75
- list(url: string, cursor?: string | null, reverse?: boolean | null, limit?: number | null, shallow?: boolean | null): Promise<Array<any>>;
76
65
  /**
77
66
  * Signup to a homeserver and update Pkarr accordingly.
78
67
  *
@@ -129,18 +118,29 @@ export class Client {
129
118
  * manager should always attempt to republish the last known homeserver.
130
119
  */
131
120
  republishHomeserver(keypair: Keypair, host: PublicKey): Promise<void>;
132
- fetch(url: string, request_init?: any | null): Promise<Promise<any>>;
121
+ /**
122
+ * Returns a list of Pubky urls (as strings).
123
+ *
124
+ * - `url`: The Pubky url (string) to the directory you want to list its content.
125
+ * - `cursor`: Either a full `pubky://` Url (from previous list response),
126
+ * or a path (to a file or directory) relative to the `url`
127
+ * - `reverse`: List in reverse order
128
+ * - `limit` Limit the number of urls in the response
129
+ * - `shallow`: List directories and files, instead of flat list of files.
130
+ */
131
+ list(url: string, cursor?: string | null, reverse?: boolean | null, limit?: number | null, shallow?: boolean | null): Promise<Array<any>>;
132
+ fetch(url: string, init?: any | null): Promise<Promise<any>>;
133
133
  /**
134
134
  * Create a new Pubky Client with an optional configuration.
135
135
  */
136
136
  constructor(config_opt?: PubkyClientConfig | null);
137
137
  /**
138
138
  * Create a client with with configurations appropriate for local testing:
139
- * - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
140
- * - transform `pubky://<pkarr public key>` to `http://<pkarr public key` instead of `https:`
141
- * and read the homeserver HTTP port from the [reserved service parameter key](pubky_common::constants::reserved_param_keys::HTTP_PORT)
139
+ * - set Pkarr relays to `http://<host>:15411` (defaults to `localhost`).
140
+ * - transform `pubky://<pkarr public key>` to `http://<host>` instead of `https:`
141
+ * and read the homeserver HTTP port from the PKarr record.
142
142
  */
143
- static testnet(): Client;
143
+ static testnet(host?: string | null): Client;
144
144
  }
145
145
  export class Keypair {
146
146
  private constructor();
package/pubky_bg.wasm CHANGED
Binary file