@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.mjs CHANGED
@@ -5925,6 +5925,10 @@ function teeRoleOf(row) {
5925
5925
  function pickExecutingRelay(relays) {
5926
5926
  return relays.find((r) => r.canExecute && r.relayUrl !== null && r.executorAccount !== null) ?? null;
5927
5927
  }
5928
+ var ACCOUNT_HEX = /^[0-9a-f]{64}$/;
5929
+ function accountHexOrNull(value) {
5930
+ return typeof value === "string" && ACCOUNT_HEX.test(value) ? value : null;
5931
+ }
5928
5932
  var AccountHaRefusedError = class extends HTTPError {
5929
5933
  constructor(code, status, statusText, url, headers, bodyText) {
5930
5934
  super(status, statusText, url, headers, bodyText);
@@ -6315,7 +6319,9 @@ var CloudClient = class {
6315
6319
  return (body.relays ?? []).map((row) => ({
6316
6320
  peerId: String(row.peer_id ?? ""),
6317
6321
  relayUrl: row.relay_url ?? null,
6318
- fresh: row.fresh === true
6322
+ fresh: row.fresh === true,
6323
+ executorAccount: accountHexOrNull(row.executor_account),
6324
+ assigned: row.assigned === true
6319
6325
  }));
6320
6326
  }
6321
6327
  /**
@@ -6393,7 +6399,11 @@ var CloudClient = class {
6393
6399
  * Pass merod's response object straight through. The cloud accepts core's
6394
6400
  * `signerPublicKey`/`signedPayload` casing as well as snake_case, so there is
6395
6401
  * no re-keying step — and getting that wrong used to surface as a `422`
6396
- * naming three missing fields.
6402
+ * naming three missing fields. Passing it whole also carries the `founding`
6403
+ * and `credential` merod attaches: the cloud accepts a namespace proof only
6404
+ * from a node of the account that founded the namespace, checked with those
6405
+ * two, and only when that account is linked to this login. A node that
6406
+ * predates them, or an admin that did not found the namespace, gets a `422`.
6397
6407
  *
6398
6408
  * Idempotent for the same account. A namespace already claimed by someone
6399
6409
  * else is a `409`; a replayed proof nonce is a `403`.