@synonymdev/pubky 0.17.1 → 0.18.0

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 CHANGED
@@ -182,6 +182,11 @@ const userPk = session.info.publicKey.toString(); // -> pubky<z32> identifier
182
182
  const caps = session.info.capabilities; // -> string[] permissions and paths
183
183
 
184
184
  const storage = session.storage; // -> This User's storage API (absolute paths)
185
+
186
+ // With a grant session that has read permission on `/` (`/:r`, `/:rw`, ...):
187
+ // storage used and the quota that applies.
188
+ const account = await session.grant.account();
189
+ console.log(account.usedBytes, account.quota.effective.storageQuotaMb);
185
190
  ```
186
191
 
187
192
  **Persist a grant session**
@@ -347,6 +352,28 @@ Legacy cookie auth flows can be resumed with
347
352
  `sessionStorage`, not `localStorage`, and delete it once the flow completes or
348
353
  is abandoned.
349
354
 
355
+ #### Require the signed-in identity
356
+
357
+ When the app already knows who is signed in, for example to re-authorize or to
358
+ request more capabilities, pass that user's public key as `expectedSigner`.
359
+ The link gains `spk=<z32>`, an expected-identity constraint: a signer such as
360
+ Pubky Ring opens that key or refuses the request, and `awaitApproval()`
361
+ rejects an approval issued by any other key. Switching accounts takes a fresh
362
+ sign-in without `expectedSigner`. Leave it out for a first sign-in. Sign-up
363
+ flows reject it.
364
+
365
+ ```js
366
+ const flow = await pubky.startGrantAuthFlow(caps, AuthFlowKind.signin(), {
367
+ clientId: "my-cool-app.example",
368
+ expectedSigner: session.info.publicKey.z32(),
369
+ });
370
+ ```
371
+
372
+ Signers that predate `spk` ignore it and show their usual key picker; an
373
+ approval from another key picked there is rejected. Any app can name any
374
+ public key, so signers should show prominently that the app chose the
375
+ identity; see [AUTH.md](../../../../docs/AUTH.md) for the accepted tradeoffs.
376
+
350
377
  #### Request encryption keys
351
378
 
352
379
  Apps can also ask the signer for encryption keys scoped to storage paths. Set
@@ -560,6 +587,8 @@ Path rules:
560
587
 
561
588
  - Session storage uses **absolute** paths under `/pub/` or `/priv/`.
562
589
  - Public storage uses **addressed** form `pubky<user>/pub/app/file.txt` (preferred) or `pubky://<user>/...`.
590
+ - A path is the file's plain name, such as `/pub/app/My File.txt`; the SDK percent-encodes it when it builds the HTTP URL.
591
+ - `list()` entries and `event.resource.path` carry the same plain name, which is also the form a `list()` cursor takes.
563
592
 
564
593
  **Convention:** put your app’s public data under a domain-like folder in `/pub`, e.g. `/pub/my-new-app/`.
565
594
 
@@ -654,9 +683,12 @@ interface PubkyError extends Error {
654
683
  ```
655
684
 
656
685
  `RequestError` carries a `RequestErrorData`: `reason` (`Http`, `Timeout`,
657
- `Connection`, `Body`, `Decode`, `InvalidRequest` or `Other`) and, for HTTP
658
- failures, `statusCode`. Browser Fetch may only report `Other`. A reason
659
- describes the failure, not whether retrying a write is safe.
686
+ `Connection`, `TlsVerification`, `Body`, `Decode`, `InvalidRequest` or `Other`)
687
+ and, for HTTP failures, `statusCode`. Browser Fetch may only report `Other`.
688
+ `TlsVerification` means the server certificate was rejected; after a legitimate
689
+ key rotation a stale pkarr cache looks the same, so it does not prove
690
+ interception on its own. A reason describes the failure, not whether retrying a
691
+ write is safe.
660
692
 
661
693
  ```ts
662
694
  import type { PubkyError, RequestErrorData } from "@synonymdev/pubky";
package/index.cjs CHANGED
@@ -5,6 +5,22 @@ globalThis.fetch = makeFetchCookie(originalFetch);
5
5
 
6
6
  /* @ts-self-types="./pubky.d.ts" */
7
7
 
8
+ function __pubkyRecoveredEncryptionKeys(publicKey, grantId, keys) {
9
+ return { publicKey, grantId, keys };
10
+ }
11
+
12
+ async function __pubkyImportEncryptionCryptoKey(bytes) {
13
+ try {
14
+ if (!globalThis.crypto?.subtle) {
15
+ throw new Error("WebCrypto is unavailable; use a secure context.");
16
+ }
17
+ return await globalThis.crypto.subtle.importKey(
18
+ "raw", bytes, "AES-GCM", false, ["encrypt", "decrypt"]);
19
+ } finally {
20
+ bytes.fill(0);
21
+ }
22
+ }
23
+
8
24
  const PUBKY_SESSIONS_DB_NAME = "pubky-auth";
9
25
  const PUBKY_SESSIONS_DB_VERSION = 1;
10
26
  const PUBKY_SESSIONS_STORE_NAME = "storedSessions";
@@ -553,21 +569,84 @@ async function __pubkyGrantDelegatedSign(keyId, signingInput) {
553
569
  }
554
570
 
555
571
 
556
- function __pubkyRecoveredEncryptionKeys(publicKey, grantId, keys) {
557
- return { publicKey, grantId, keys };
558
- }
559
-
560
- async function __pubkyImportEncryptionCryptoKey(bytes) {
561
- try {
562
- if (!globalThis.crypto?.subtle) {
563
- throw new Error("WebCrypto is unavailable; use a secure context.");
572
+ /**
573
+ * A user's account as returned by `session.grant.account()`.
574
+ */
575
+ class AccountInfo {
576
+ static __wrap(ptr) {
577
+ const obj = Object.create(AccountInfo.prototype);
578
+ obj.__wbg_ptr = ptr;
579
+ AccountInfoFinalization.register(obj, obj.__wbg_ptr, obj);
580
+ return obj;
581
+ }
582
+ __destroy_into_raw() {
583
+ const ptr = this.__wbg_ptr;
584
+ this.__wbg_ptr = 0;
585
+ AccountInfoFinalization.unregister(this);
586
+ return ptr;
587
+ }
588
+ free() {
589
+ const ptr = this.__destroy_into_raw();
590
+ wasm.__wbg_accountinfo_free(ptr, 0);
591
+ }
592
+ /**
593
+ * When the user signed up, as an ISO 8601 date and time without a UTC
594
+ * offset (e.g. `2026-10-22T10:11:12.123456`).
595
+ * @returns {string}
596
+ */
597
+ get createdAt() {
598
+ let deferred1_0;
599
+ let deferred1_1;
600
+ try {
601
+ const ret = wasm.accountinfo_createdAt(this.__wbg_ptr);
602
+ deferred1_0 = ret[0];
603
+ deferred1_1 = ret[1];
604
+ return getStringFromWasm0(ret[0], ret[1]);
605
+ } finally {
606
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
564
607
  }
565
- return await globalThis.crypto.subtle.importKey(
566
- "raw", bytes, "AES-GCM", false, ["encrypt", "decrypt"]);
567
- } finally {
568
- bytes.fill(0);
608
+ }
609
+ /**
610
+ * Whether the account is disabled. Disabled accounts can read and delete
611
+ * but not write.
612
+ * @returns {boolean}
613
+ */
614
+ get disabled() {
615
+ const ret = wasm.accountinfo_disabled(this.__wbg_ptr);
616
+ return ret !== 0;
617
+ }
618
+ /**
619
+ * The user this account belongs to.
620
+ * @returns {PublicKey}
621
+ */
622
+ get pubky() {
623
+ const ret = wasm.accountinfo_pubky(this.__wbg_ptr);
624
+ return PublicKey.__wrap(ret);
625
+ }
626
+ /**
627
+ * The quota that applies and the per-user overrides behind it.
628
+ *
629
+ * @returns {AccountQuota}
630
+ * @returns {AccountQuota}
631
+ */
632
+ get quota() {
633
+ const ret = wasm.accountinfo_quota(this.__wbg_ptr);
634
+ if (ret[2]) {
635
+ throw takeFromExternrefTable0(ret[1]);
636
+ }
637
+ return takeFromExternrefTable0(ret[0]);
638
+ }
639
+ /**
640
+ * Bytes of storage currently used.
641
+ * @returns {number}
642
+ */
643
+ get usedBytes() {
644
+ const ret = wasm.accountinfo_usedBytes(this.__wbg_ptr);
645
+ return ret;
569
646
  }
570
647
  }
648
+ if (Symbol.dispose) AccountInfo.prototype[Symbol.dispose] = AccountInfo.prototype.free;
649
+ exports.AccountInfo = AccountInfo;
571
650
 
572
651
  /**
573
652
  * Start and control a pubkyauth authorization flow.
@@ -1943,7 +2022,7 @@ class GrantAuthFlow {
1943
2022
  * The kind of authentication flow to perform.
1944
2023
  *
1945
2024
  * @param {GrantAuthFlowOptions} options
1946
- * Options for the grant flow: `{ clientId, relay?, xCallback? }`.
2025
+ * Options for the grant flow: `{ clientId, relay?, xCallback?, approvalFormat?, expectedSigner? }`.
1947
2026
  *
1948
2027
  * @returns {GrantAuthFlow}
1949
2028
  * A running grant auth flow. Call `authorizationUrl()` to show the deep link,
@@ -2151,6 +2230,21 @@ class GrantSession {
2151
2230
  const ptr = this.__destroy_into_raw();
2152
2231
  wasm.__wbg_grantsession_free(ptr, 0);
2153
2232
  }
2233
+ /**
2234
+ * Fetch this user's account: storage used, whether it is disabled, and
2235
+ * the quota that applies.
2236
+ *
2237
+ * Requires read permission on the root scope (`/:r`, `/:rw`, ...).
2238
+ * Path-scoped sessions surface the homeserver `403` as the standard
2239
+ * request error.
2240
+ *
2241
+ * @returns {Promise<AccountInfo>}
2242
+ * @returns {Promise<AccountInfo>}
2243
+ */
2244
+ account() {
2245
+ const ret = wasm.grantsession_account(this.__wbg_ptr);
2246
+ return ret;
2247
+ }
2154
2248
  /**
2155
2249
  * Sign JSON data and return both the custom proof and its root-signed grant.
2156
2250
  * Data follows `JSON.stringify` semantics, e.g. `undefined` properties are omitted.
@@ -3121,7 +3215,7 @@ class Pubky {
3121
3215
  * @param {string} capabilities Comma-separated caps, e.g. `"/pub/app/:rw,/pub/foo/file:r"`.
3122
3216
  * @param {AuthFlowKind} kind The kind of authentication flow to perform.
3123
3217
  * @param {GrantAuthFlowOptions} options Options for the grant flow:
3124
- * `{ clientId, relay?, xCallback?, approvalFormat? }`.
3218
+ * `{ clientId, relay?, xCallback?, approvalFormat?, expectedSigner? }`.
3125
3219
  * @returns {Promise<GrantAuthFlow>}
3126
3220
  * A running grant auth flow. Show `authorizationUrl` as QR/deeplink,
3127
3221
  * then `awaitApproval()` to obtain a grant-backed `Session`.
@@ -3252,7 +3346,7 @@ class PubkyResource {
3252
3346
  return PubkyResource.__wrap(ret[0]);
3253
3347
  }
3254
3348
  /**
3255
- * Get the absolute path (e.g., "/pub/example.txt").
3349
+ * Get the absolute path (e.g., "/pub/My File.txt").
3256
3350
  * @returns {string}
3257
3351
  */
3258
3352
  get path() {
@@ -3268,7 +3362,8 @@ class PubkyResource {
3268
3362
  }
3269
3363
  }
3270
3364
  /**
3271
- * Render as `pubky://<owner>/<path>` (deep-link/URL form).
3365
+ * Render as `pubky://<owner><path>` (deep-link form), the form listings
3366
+ * and events use.
3272
3367
  * @returns {string}
3273
3368
  */
3274
3369
  toPubkyUrl() {
@@ -3470,10 +3565,10 @@ class PublicStorage {
3470
3565
  return ret;
3471
3566
  }
3472
3567
  /**
3473
- * List a directory. Results are `pubky://…` identifier URLs.
3568
+ * List a directory. Results are `pubky://<pk><path>` entries.
3474
3569
  *
3475
3570
  * @param {Address} address Addressed directory (must end with `/`).
3476
- * @param {string|null=} cursor Optional suffix or full URL to start **after**.
3571
+ * @param {string|null=} cursor Optional suffix or entry (as returned) to start **after**.
3477
3572
  * @param {boolean=} reverse Default `false`. When `true`, newest/lexicographically-last first.
3478
3573
  * @param {number=} limit Optional result limit.
3479
3574
  * @param {boolean=} shallow Default `false`. When `true`, lists only first-level entries.
@@ -3944,11 +4039,11 @@ class SessionStorage {
3944
4039
  * List a directory (absolute session path).
3945
4040
  *
3946
4041
  * @param {Path} path Must end with `/`.
3947
- * @param {string|null=} cursor Optional last entry URL to start **after**.
4042
+ * @param {string|null=} cursor Optional last entry (as returned) to start **after**.
3948
4043
  * @param {boolean=} reverse Default `false`.
3949
4044
  * @param {number=} limit Optional result limit.
3950
4045
  * @param {boolean=} shallow Default `false`.
3951
- * @returns {Promise<string[]>} `pubky://…` entry URLs, or an empty array for an empty page.
4046
+ * @returns {Promise<string[]>} `pubky://<pk><path>` entries, or an empty array for an empty page.
3952
4047
  * @throws {PubkyError} Missing directory (404), invalid cursor (400), invalid response
3953
4048
  * entries, or shared errors (see {@link SessionStorage}).
3954
4049
  * @param {Path} path
@@ -4621,6 +4716,17 @@ class SigninGrantDeepLink {
4621
4716
  const ret = wasm.signingrantdeeplink_ephemeralPublicKey(this.__wbg_ptr);
4622
4717
  return ret;
4623
4718
  }
4719
+ /**
4720
+ * Expected identity (`spk`): the public key that must approve this
4721
+ * request, or `undefined`. Signers approve with this key or refuse.
4722
+ *
4723
+ * @returns {PublicKey|undefined}
4724
+ * @returns {PublicKey | undefined}
4725
+ */
4726
+ get expectedSigner() {
4727
+ const ret = wasm.signingrantdeeplink_expectedSigner(this.__wbg_ptr);
4728
+ return ret === 0 ? undefined : PublicKey.__wrap(ret);
4729
+ }
4624
4730
  /**
4625
4731
  * Parse a grant signin deeplink URL.
4626
4732
  *
@@ -5458,7 +5564,7 @@ function __wbg_get_imports() {
5458
5564
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
5459
5565
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
5460
5566
  },
5461
- __wbg___pubkyGrantDelegatedSign_2cb517ac273ab8a9: function(arg0, arg1, arg2, arg3) {
5567
+ __wbg___pubkyGrantDelegatedSign_41716d73c2c343e6: function(arg0, arg1, arg2, arg3) {
5462
5568
  let deferred0_0;
5463
5569
  let deferred0_1;
5464
5570
  let deferred1_0;
@@ -5475,7 +5581,7 @@ function __wbg_get_imports() {
5475
5581
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
5476
5582
  }
5477
5583
  },
5478
- __wbg___pubkyGrantEnsureDelegatedKey_56c34ce13ce7c1f7: function(arg0, arg1) {
5584
+ __wbg___pubkyGrantEnsureDelegatedKey_fb6d009c63fedb54: function(arg0, arg1) {
5479
5585
  let v0;
5480
5586
  if (arg0 !== 0) {
5481
5587
  v0 = getStringFromWasm0(arg0, arg1);
@@ -5484,7 +5590,7 @@ function __wbg_get_imports() {
5484
5590
  const ret = __pubkyGrantEnsureDelegatedKey(v0);
5485
5591
  return ret;
5486
5592
  },
5487
- __wbg___pubkyGrantLoadDelegatedPublicKey_dc300b9aa9b06496: function(arg0, arg1) {
5593
+ __wbg___pubkyGrantLoadDelegatedPublicKey_3516a6bc4e78f266: function(arg0, arg1) {
5488
5594
  let deferred0_0;
5489
5595
  let deferred0_1;
5490
5596
  try {
@@ -5496,18 +5602,18 @@ function __wbg_get_imports() {
5496
5602
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5497
5603
  }
5498
5604
  },
5499
- __wbg___pubkyRecoveredEncryptionKeys_2ab5b407cc701787: function(arg0, arg1, arg2, arg3, arg4) {
5605
+ __wbg___pubkyRecoveredEncryptionKeys_8129a9d229919061: function(arg0, arg1, arg2, arg3, arg4) {
5500
5606
  const ret = __pubkyRecoveredEncryptionKeys(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), EncryptionKeys.__wrap(arg4));
5501
5607
  return ret;
5502
5608
  },
5503
- __wbg___pubkySessionAcquire_1cc5b1d8d7b8e789: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5609
+ __wbg___pubkySessionAcquire_b810bc4be7513322: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5504
5610
  const ret = __pubkySessionAcquire(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), arg4 !== 0);
5505
5611
  return ret;
5506
5612
  }, arguments); },
5507
- __wbg___pubkySessionRelease_83fe6f3b50380e1d: function(arg0) {
5613
+ __wbg___pubkySessionRelease_f019c6fb31a86113: function(arg0) {
5508
5614
  __pubkySessionRelease(arg0 >>> 0);
5509
5615
  },
5510
- __wbg___pubkySessionStoreGet_c1c17f0b85261cfc: function(arg0, arg1) {
5616
+ __wbg___pubkySessionStoreGet_1166e2b524db1bdf: function(arg0, arg1) {
5511
5617
  let deferred0_0;
5512
5618
  let deferred0_1;
5513
5619
  try {
@@ -5519,7 +5625,7 @@ function __wbg_get_imports() {
5519
5625
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5520
5626
  }
5521
5627
  },
5522
- __wbg___pubkySessionStoreMetadata_2c9607f2edb4000c: function(arg0, arg1) {
5628
+ __wbg___pubkySessionStoreMetadata_e8097eef06412410: function(arg0, arg1) {
5523
5629
  let deferred0_0;
5524
5630
  let deferred0_1;
5525
5631
  try {
@@ -5531,23 +5637,23 @@ function __wbg_get_imports() {
5531
5637
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5532
5638
  }
5533
5639
  },
5534
- __wbg___pubkySessionStorePut_288607c1b799c745: function(arg0, arg1) {
5640
+ __wbg___pubkySessionStorePut_306972a8d5d40992: function(arg0, arg1) {
5535
5641
  const ret = __pubkySessionStorePut(arg0, arg1 >>> 0);
5536
5642
  return ret;
5537
5643
  },
5538
- __wbg___pubkySessionWait_9c78a92218de4722: function(arg0) {
5644
+ __wbg___pubkySessionWait_9431fb951145fff1: function(arg0) {
5539
5645
  const ret = __pubkySessionWait(arg0 >>> 0);
5540
5646
  return ret;
5541
5647
  },
5542
- __wbg___pubkySharedSessionLoad_daafcca70227cf8b: function(arg0) {
5648
+ __wbg___pubkySharedSessionLoad_1a7e09fe9e7a6c6e: function(arg0) {
5543
5649
  const ret = __pubkySharedSessionLoad(arg0 >>> 0);
5544
5650
  return ret;
5545
5651
  },
5546
- __wbg___pubkySharedSessionRemove_95c78eea66763eb1: function(arg0) {
5652
+ __wbg___pubkySharedSessionRemove_0d9792736173a9cd: function(arg0) {
5547
5653
  const ret = __pubkySharedSessionRemove(arg0 >>> 0);
5548
5654
  return ret;
5549
5655
  },
5550
- __wbg___pubkySharedSessionStore_07fae001cc466bcb: function(arg0, arg1) {
5656
+ __wbg___pubkySharedSessionStore_4a6f968b46c591fb: function(arg0, arg1) {
5551
5657
  const ret = __pubkySharedSessionStore(arg0 >>> 0, arg1);
5552
5658
  return ret;
5553
5659
  },
@@ -5632,6 +5738,10 @@ function __wbg_get_imports() {
5632
5738
  __wbg_abort_76dea11221098ae5: function(arg0) {
5633
5739
  arg0.abort();
5634
5740
  },
5741
+ __wbg_accountinfo_new: function(arg0) {
5742
+ const ret = AccountInfo.__wrap(arg0);
5743
+ return ret;
5744
+ },
5635
5745
  __wbg_append_8e87c13f0f08f8cd: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5636
5746
  arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
5637
5747
  }, arguments); },
@@ -5730,7 +5840,7 @@ function __wbg_get_imports() {
5730
5840
  const ret = arg0.fetch(arg1);
5731
5841
  return ret;
5732
5842
  },
5733
- __wbg_fetch_ec1f91271c53ee0f: function(arg0) {
5843
+ __wbg_fetch_d2beca3120ba8e1b: function(arg0) {
5734
5844
  const ret = fetch(arg0);
5735
5845
  return ret;
5736
5846
  },
@@ -5953,7 +6063,7 @@ function __wbg_get_imports() {
5953
6063
  const a = state0.a;
5954
6064
  state0.a = 0;
5955
6065
  try {
5956
- return wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___js_sys_4f215e94ce6fd9b5___Function_fn_wasm_bindgen_b6e7149e39ccd96a___JsValue_____wasm_bindgen_b6e7149e39ccd96a___sys__Undefined___js_sys_4f215e94ce6fd9b5___Function_fn_wasm_bindgen_b6e7149e39ccd96a___JsValue_____wasm_bindgen_b6e7149e39ccd96a___sys__Undefined_______true_(a, state0.b, arg0, arg1);
6066
+ return wasm_bindgen_328ac0967063b244___convert__closures_____invoke___js_sys_ffedb94bf63a75b7___Function_fn_wasm_bindgen_328ac0967063b244___JsValue_____wasm_bindgen_328ac0967063b244___sys__Undefined___js_sys_ffedb94bf63a75b7___Function_fn_wasm_bindgen_328ac0967063b244___JsValue_____wasm_bindgen_328ac0967063b244___sys__Undefined_______true_(a, state0.b, arg0, arg1);
5957
6067
  } finally {
5958
6068
  state0.a = a;
5959
6069
  }
@@ -6201,17 +6311,17 @@ function __wbg_get_imports() {
6201
6311
  },
6202
6312
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
6203
6313
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 128, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6204
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___wasm_bindgen_b6e7149e39ccd96a___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_b6e7149e39ccd96a___JsError___true_);
6314
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_328ac0967063b244___convert__closures_____invoke___wasm_bindgen_328ac0967063b244___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_328ac0967063b244___JsError___true_);
6205
6315
  return ret;
6206
6316
  },
6207
6317
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
6208
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 289, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6209
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___wasm_bindgen_b6e7149e39ccd96a___JsValue______true_);
6318
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 288, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6319
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_328ac0967063b244___convert__closures_____invoke___wasm_bindgen_328ac0967063b244___JsValue______true_);
6210
6320
  return ret;
6211
6321
  },
6212
6322
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
6213
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 287, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6214
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke_______true_);
6323
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 286, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6324
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_328ac0967063b244___convert__closures_____invoke_______true_);
6215
6325
  return ret;
6216
6326
  },
6217
6327
  __wbindgen_generic_0000000000000004: function(arg0) {
@@ -6249,14 +6359,14 @@ function __wbg_get_imports() {
6249
6359
  __wbindgen_generic_000000000000000a: function(arg0, arg1) {
6250
6360
  var v0 = getArrayJsValueFromWasm0(arg0, arg1);
6251
6361
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
6252
- // Cast intrinsic for `Vector(RustStruct { name: "GrantInfo", unique_crate_identifier: "pubky-wasm-c7e50de8b679e9dd" }) -> Externref`.
6362
+ // Cast intrinsic for `Vector(RustStruct { name: "GrantInfo", unique_crate_identifier: "pubky-wasm-9e9e95822c39db63" }) -> Externref`.
6253
6363
  const ret = v0;
6254
6364
  return ret;
6255
6365
  },
6256
6366
  __wbindgen_generic_000000000000000b: function(arg0, arg1) {
6257
6367
  var v0 = getArrayJsValueFromWasm0(arg0, arg1);
6258
6368
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
6259
- // Cast intrinsic for `Vector(RustStruct { name: "StoredSessionInfo", unique_crate_identifier: "pubky-wasm-c7e50de8b679e9dd" }) -> Externref`.
6369
+ // Cast intrinsic for `Vector(RustStruct { name: "StoredSessionInfo", unique_crate_identifier: "pubky-wasm-9e9e95822c39db63" }) -> Externref`.
6260
6370
  const ret = v0;
6261
6371
  return ret;
6262
6372
  },
@@ -6273,33 +6383,33 @@ function __wbg_get_imports() {
6273
6383
  return {
6274
6384
  __proto__: null,
6275
6385
  "./pubky_bg.js": import0,
6276
- "./snippets/pubky-wasm-c7e50de8b679e9dd/inline0.js": import1,
6277
- "./snippets/pubky-wasm-c7e50de8b679e9dd/inline0.js": import2,
6278
- "./snippets/pubky-wasm-c7e50de8b679e9dd/inline0.js": import3,
6279
- "./snippets/pubky-wasm-c7e50de8b679e9dd/inline0.js": import4,
6280
- "./snippets/pubky-wasm-c7e50de8b679e9dd/inline1.js": import5,
6281
- "./snippets/pubky-wasm-c7e50de8b679e9dd/inline2.js": import6,
6282
- "./snippets/pubky-wasm-c7e50de8b679e9dd/inline1.js": import7,
6386
+ "./snippets/pubky-wasm-9e9e95822c39db63/inline1.js": import1,
6387
+ "./snippets/pubky-wasm-9e9e95822c39db63/inline1.js": import2,
6388
+ "./snippets/pubky-wasm-9e9e95822c39db63/inline1.js": import3,
6389
+ "./snippets/pubky-wasm-9e9e95822c39db63/inline1.js": import4,
6390
+ "./snippets/pubky-wasm-9e9e95822c39db63/inline2.js": import5,
6391
+ "./snippets/pubky-wasm-9e9e95822c39db63/inline0.js": import6,
6392
+ "./snippets/pubky-wasm-9e9e95822c39db63/inline2.js": import7,
6283
6393
  };
6284
6394
  }
6285
6395
 
6286
- function wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke_______true_(arg0, arg1) {
6287
- wasm.wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke_______true_(arg0, arg1);
6396
+ function wasm_bindgen_328ac0967063b244___convert__closures_____invoke_______true_(arg0, arg1) {
6397
+ wasm.wasm_bindgen_328ac0967063b244___convert__closures_____invoke_______true_(arg0, arg1);
6288
6398
  }
6289
6399
 
6290
- function wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___wasm_bindgen_b6e7149e39ccd96a___JsValue______true_(arg0, arg1, arg2) {
6291
- wasm.wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___wasm_bindgen_b6e7149e39ccd96a___JsValue______true_(arg0, arg1, arg2);
6400
+ function wasm_bindgen_328ac0967063b244___convert__closures_____invoke___wasm_bindgen_328ac0967063b244___JsValue______true_(arg0, arg1, arg2) {
6401
+ wasm.wasm_bindgen_328ac0967063b244___convert__closures_____invoke___wasm_bindgen_328ac0967063b244___JsValue______true_(arg0, arg1, arg2);
6292
6402
  }
6293
6403
 
6294
- function wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___wasm_bindgen_b6e7149e39ccd96a___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_b6e7149e39ccd96a___JsError___true_(arg0, arg1, arg2) {
6295
- const ret = wasm.wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___wasm_bindgen_b6e7149e39ccd96a___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_b6e7149e39ccd96a___JsError___true_(arg0, arg1, arg2);
6404
+ function wasm_bindgen_328ac0967063b244___convert__closures_____invoke___wasm_bindgen_328ac0967063b244___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_328ac0967063b244___JsError___true_(arg0, arg1, arg2) {
6405
+ const ret = wasm.wasm_bindgen_328ac0967063b244___convert__closures_____invoke___wasm_bindgen_328ac0967063b244___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_328ac0967063b244___JsError___true_(arg0, arg1, arg2);
6296
6406
  if (ret[1]) {
6297
6407
  throw takeFromExternrefTable0(ret[0]);
6298
6408
  }
6299
6409
  }
6300
6410
 
6301
- function wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___js_sys_4f215e94ce6fd9b5___Function_fn_wasm_bindgen_b6e7149e39ccd96a___JsValue_____wasm_bindgen_b6e7149e39ccd96a___sys__Undefined___js_sys_4f215e94ce6fd9b5___Function_fn_wasm_bindgen_b6e7149e39ccd96a___JsValue_____wasm_bindgen_b6e7149e39ccd96a___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
6302
- wasm.wasm_bindgen_b6e7149e39ccd96a___convert__closures_____invoke___js_sys_4f215e94ce6fd9b5___Function_fn_wasm_bindgen_b6e7149e39ccd96a___JsValue_____wasm_bindgen_b6e7149e39ccd96a___sys__Undefined___js_sys_4f215e94ce6fd9b5___Function_fn_wasm_bindgen_b6e7149e39ccd96a___JsValue_____wasm_bindgen_b6e7149e39ccd96a___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
6411
+ function wasm_bindgen_328ac0967063b244___convert__closures_____invoke___js_sys_ffedb94bf63a75b7___Function_fn_wasm_bindgen_328ac0967063b244___JsValue_____wasm_bindgen_328ac0967063b244___sys__Undefined___js_sys_ffedb94bf63a75b7___Function_fn_wasm_bindgen_328ac0967063b244___JsValue_____wasm_bindgen_328ac0967063b244___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
6412
+ wasm.wasm_bindgen_328ac0967063b244___convert__closures_____invoke___js_sys_ffedb94bf63a75b7___Function_fn_wasm_bindgen_328ac0967063b244___JsValue_____wasm_bindgen_328ac0967063b244___sys__Undefined___js_sys_ffedb94bf63a75b7___Function_fn_wasm_bindgen_328ac0967063b244___JsValue_____wasm_bindgen_328ac0967063b244___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
6303
6413
  }
6304
6414
 
6305
6415
 
@@ -6319,6 +6429,9 @@ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
6319
6429
 
6320
6430
 
6321
6431
  const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
6432
+ const AccountInfoFinalization = (typeof FinalizationRegistry === 'undefined')
6433
+ ? { register: () => {}, unregister: () => {} }
6434
+ : new FinalizationRegistry(ptr => wasm.__wbg_accountinfo_free(ptr, 1));
6322
6435
  const AuthFlowFinalization = (typeof FinalizationRegistry === 'undefined')
6323
6436
  ? { register: () => {}, unregister: () => {} }
6324
6437
  : new FinalizationRegistry(ptr => wasm.__wbg_authflow_free(ptr, 1));