@calimero-network/mero-js 23.6.0 → 23.8.1

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
@@ -6149,6 +6149,10 @@ function teeRoleOf(row) {
6149
6149
  function pickExecutingRelay(relays) {
6150
6150
  return relays.find((r) => r.canExecute && r.relayUrl !== null && r.executorAccount !== null) ?? null;
6151
6151
  }
6152
+ var ACCOUNT_HEX = /^[0-9a-f]{64}$/;
6153
+ function accountHexOrNull(value) {
6154
+ return typeof value === "string" && ACCOUNT_HEX.test(value) ? value : null;
6155
+ }
6152
6156
  var AccountHaRefusedError = class extends HTTPError {
6153
6157
  constructor(code, status, statusText, url, headers, bodyText) {
6154
6158
  super(status, statusText, url, headers, bodyText);
@@ -6539,7 +6543,9 @@ var CloudClient = class {
6539
6543
  return (body.relays ?? []).map((row) => ({
6540
6544
  peerId: String(row.peer_id ?? ""),
6541
6545
  relayUrl: row.relay_url ?? null,
6542
- fresh: row.fresh === true
6546
+ fresh: row.fresh === true,
6547
+ executorAccount: accountHexOrNull(row.executor_account),
6548
+ assigned: row.assigned === true
6543
6549
  }));
6544
6550
  }
6545
6551
  /**
@@ -6617,7 +6623,11 @@ var CloudClient = class {
6617
6623
  * Pass merod's response object straight through. The cloud accepts core's
6618
6624
  * `signerPublicKey`/`signedPayload` casing as well as snake_case, so there is
6619
6625
  * no re-keying step — and getting that wrong used to surface as a `422`
6620
- * naming three missing fields.
6626
+ * naming three missing fields. Passing it whole also carries the `founding`
6627
+ * and `credential` merod attaches: the cloud accepts a namespace proof only
6628
+ * from a node of the account that founded the namespace, checked with those
6629
+ * two, and only when that account is linked to this login. A node that
6630
+ * predates them, or an admin that did not found the namespace, gets a `422`.
6621
6631
  *
6622
6632
  * Idempotent for the same account. A namespace already claimed by someone
6623
6633
  * else is a `409`; a replayed proof nonce is a `403`.