@calimero-network/mero-js 24.0.0 → 24.1.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/dist/index.cjs CHANGED
@@ -11212,6 +11212,20 @@ function teeRoleOf(row) {
11212
11212
  function pickExecutingRelay(relays) {
11213
11213
  return relays.find((r) => r.canExecute && r.relayUrl !== null && r.executorAccount !== null) ?? null;
11214
11214
  }
11215
+ function joinOf(row) {
11216
+ const raw = row.join;
11217
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
11218
+ const join = raw;
11219
+ if (typeof join.state !== "string") return null;
11220
+ const refusals = Array.isArray(join.refusals) ? join.refusals.filter((r) => !!r && typeof r === "object").map((r) => ({ peer: String(r.peer ?? ""), reason: String(r.reason ?? "") })) : [];
11221
+ return {
11222
+ state: join.state,
11223
+ attempts: typeof join.attempts === "number" ? join.attempts : 0,
11224
+ refusals,
11225
+ error: typeof join.error === "string" ? join.error : null,
11226
+ reportedAt: typeof join.reported_at === "string" ? join.reported_at : null
11227
+ };
11228
+ }
11215
11229
  var ACCOUNT_HEX = /^[0-9a-f]{64}$/;
11216
11230
  function accountHexOrNull(value) {
11217
11231
  return typeof value === "string" && ACCOUNT_HEX.test(value) ? value : null;
@@ -11451,7 +11465,10 @@ var CloudClient = class {
11451
11465
  authorshipReady && relayUrl !== null && executorAccount !== null
11452
11466
  ),
11453
11467
  lastSeenAt: row.last_seen_at ?? null,
11454
- confirmedAt: row.confirmed_at ?? null
11468
+ confirmedAt: row.confirmed_at ?? null,
11469
+ admission: typeof row.admission === "string" ? row.admission : null,
11470
+ admissionHint: typeof row.admission_hint === "string" ? row.admission_hint : null,
11471
+ join: joinOf(row)
11455
11472
  };
11456
11473
  });
11457
11474
  }