@le-space/core 0.3.18 → 0.3.20

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.
Files changed (3) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +5 -3
  3. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -707,13 +707,14 @@ interface RelayBootstrapPublicationResult {
707
707
  interface RelayBootstrapVisibilityResult {
708
708
  itemHash: string | null;
709
709
  hash: string | null;
710
+ sender?: string | null;
710
711
  registrationId?: string;
711
712
  peerId?: string;
712
713
  multiaddrs: string[];
713
714
  browserMultiaddrs: string[];
714
715
  }
715
716
  declare function waitForRelayBootstrapRegistration(args: {
716
- sender: string;
717
+ sender?: string;
717
718
  fetch: JsonFetchLike$1;
718
719
  registrationId?: string;
719
720
  peerId?: string;
package/index.js CHANGED
@@ -2487,7 +2487,7 @@ function sleep(ms) {
2487
2487
  async function waitForRelayBootstrapRegistration(args) {
2488
2488
  const attempts = Math.max(1, Number(args.attempts ?? 10));
2489
2489
  const delayMs = Math.max(0, Number(args.delayMs ?? 2e3));
2490
- const expectedSender = args.sender.trim().toLowerCase();
2490
+ const expectedSender = args.sender?.trim().toLowerCase() || null;
2491
2491
  const expectedRegistrationId = args.registrationId?.trim() || null;
2492
2492
  const expectedPeerId = args.peerId?.trim() || null;
2493
2493
  for (let attempt = 0; attempt < attempts; attempt += 1) {
@@ -2500,8 +2500,9 @@ async function waitForRelayBootstrapRegistration(args) {
2500
2500
  });
2501
2501
  const currentPosts = selectCurrentRelayBootstrapPosts(posts);
2502
2502
  const match = currentPosts.find((post) => {
2503
- const senderMatches = post.address?.toLowerCase() === expectedSender;
2504
- if (!senderMatches) return false;
2503
+ if (expectedSender && post.address?.toLowerCase() !== expectedSender) {
2504
+ return false;
2505
+ }
2505
2506
  if (expectedRegistrationId && post.content?.registrationId === expectedRegistrationId) {
2506
2507
  return true;
2507
2508
  }
@@ -2514,6 +2515,7 @@ async function waitForRelayBootstrapRegistration(args) {
2514
2515
  return {
2515
2516
  itemHash: match.itemHash ?? null,
2516
2517
  hash: match.hash ?? null,
2518
+ sender: typeof match.address === "string" ? match.address : null,
2517
2519
  registrationId: match.content.registrationId,
2518
2520
  peerId: match.content.peerId,
2519
2521
  multiaddrs: Array.isArray(match.content.multiaddrs) ? match.content.multiaddrs : [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/core",
3
- "version": "0.3.18",
3
+ "version": "0.3.20",
4
4
  "description": "Reusable Aleph deployment, runtime, and guest lifecycle logic.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {
19
- "@le-space/aleph-bootstrap": "0.3.18",
20
- "@le-space/shared-types": "0.3.18"
19
+ "@le-space/aleph-bootstrap": "0.3.20",
20
+ "@le-space/shared-types": "0.3.20"
21
21
  }
22
22
  }