@monolythium/core-sdk 0.4.14 → 0.4.16

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
@@ -452,12 +452,44 @@ var NODE_REGISTRY_SELECTORS = {
452
452
  getClusterJoinRequest: "0x" + selectorHex("getClusterJoinRequest(uint32,bytes32)"),
453
453
  /** `formCluster(bytes,bytes,bytes)` — no-foundation cluster formation by roster consent. */
454
454
  formCluster: "0x" + selectorHex("formCluster(bytes,bytes,bytes)"),
455
+ /**
456
+ * `formCluster(bytes,bytes,bytes,bytes)` — V2 formation carrying the
457
+ * 30-byte economics charter (Law §6.8); consents verify over the V2
458
+ * digest, which commits to the charter bytes.
459
+ */
460
+ formClusterV2: "0x" + selectorHex("formCluster(bytes,bytes,bytes,bytes)"),
455
461
  /** `setOperatorDisplay(bytes32,string,string)` — owner-callable public display metadata. */
456
462
  setOperatorDisplay: "0x" + selectorHex("setOperatorDisplay(bytes32,string,string)"),
457
463
  /** `publishOperatorSealKey(bytes32,bytes)` — owner-callable LythiumSeal EK publication. */
458
464
  publishOperatorSealKey: "0x" + selectorHex("publishOperatorSealKey(bytes32,bytes)"),
459
465
  /** `getOperatorSealKey(bytes32)` view — returns the operator's published LythiumSeal EK. */
460
- getOperatorSealKey: "0x" + selectorHex("getOperatorSealKey(bytes32)")
466
+ getOperatorSealKey: "0x" + selectorHex("getOperatorSealKey(bytes32)"),
467
+ /**
468
+ * `updateCharter(uint32,bytes,bytes,bytes)` — Component H live charter
469
+ * amendment (Law §6.8); re-signs a new 30-byte charter for a LIVE cluster
470
+ * with a delegator-protective cooldown. Consents verify over
471
+ * `updateCharterMessage` (NOT the formCluster digests).
472
+ */
473
+ updateCharter: "0x" + selectorHex("updateCharter(uint32,bytes,bytes,bytes)"),
474
+ /** `getPendingCharter(uint32)` view — Component H pending-amendment status. */
475
+ getPendingCharter: "0x" + selectorHex("getPendingCharter(uint32)"),
476
+ /** `commitArchiveRoot(bytes32,uint16,bytes32,uint64)` — Component B archive serve-challenge commit. */
477
+ commitArchiveRoot: "0x" + selectorHex("commitArchiveRoot(bytes32,uint16,bytes32,uint64)"),
478
+ /**
479
+ * `answerArchiveChallenge(bytes32,uint16,uint64,bytes,bytes32[])` —
480
+ * Component B answer. BLOCKER-1 (mono-core `service-rewards` d2ee4548):
481
+ * the caller-supplied `roundCertDigest` + `nonce` were REMOVED — the
482
+ * challenge seed is now the protocol-pinned per-epoch quorum-certificate
483
+ * digest and the nonce is derived from it. 5 args: peerId, shardIndex,
484
+ * epoch, leaf, proof.
485
+ */
486
+ answerArchiveChallenge: "0x" + selectorHex("answerArchiveChallenge(bytes32,uint16,uint64,bytes,bytes32[])"),
487
+ /** `setProbeAuthority(address)` — Component C foundation-gated probe-authority rotation. */
488
+ setProbeAuthority: "0x" + selectorHex("setProbeAuthority(address)"),
489
+ /** `getProbeAuthority()` view — Component C configured probe-authority address. */
490
+ getProbeAuthority: "0x" + selectorHex("getProbeAuthority()"),
491
+ /** `attestServiceProbe(bytes32,uint32,uint8,uint64)` — Component C attested score-eligibility path. */
492
+ attestServiceProbe: "0x" + selectorHex("attestServiceProbe(bytes32,uint32,uint8,uint64)")
461
493
  };
462
494
  var NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES = 48;
463
495
  var NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
@@ -476,8 +508,26 @@ var NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT = 3;
476
508
  var NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT = NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT + NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT;
477
509
  var NODE_REGISTRY_FORM_CLUSTER_THRESHOLD = 7;
478
510
  var NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN = "PROTOCORE_NODE_REGISTRY_CLUSTER_FORM_V1\0";
511
+ var NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN_V2 = "PROTOCORE_NODE_REGISTRY_CLUSTER_FORM_V2\0";
512
+ var NODE_REGISTRY_CLUSTER_CHARTER_BYTES = 30;
513
+ var NODE_REGISTRY_CLUSTER_CHARTER_DELEGATOR_FLOOR_BPS = 2e3;
514
+ var NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS = 1e4;
479
515
  var NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES = 128;
480
516
  var NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES = 64;
517
+ var NODE_REGISTRY_UPDATE_CHARTER_THRESHOLD = NODE_REGISTRY_FORM_CLUSTER_THRESHOLD;
518
+ var NODE_REGISTRY_UPDATE_CHARTER_MESSAGE_DOMAIN = "PROTOCORE_NODE_REGISTRY_CLUSTER_UPDATE_CHARTER_V1\0";
519
+ var NODE_REGISTRY_CHARTER_COOLDOWN_EPOCHS = 2;
520
+ var NODE_REGISTRY_ARCHIVE_CHALLENGE_DOMAIN = "monolythium.archive-challenge.v1";
521
+ var NODE_REGISTRY_ARCHIVE_NONCE_DOMAIN = "monolythium.archive-challenge.nonce.v1";
522
+ var NODE_REGISTRY_MERKLE_LEAF_DOMAIN = 0;
523
+ var NODE_REGISTRY_MERKLE_INNER_DOMAIN = 1;
524
+ var NODE_REGISTRY_MAX_MERKLE_PROOF_DEPTH = 40;
525
+ var NODE_REGISTRY_MIN_ARCHIVE_LEAF_COUNT = 65536n;
526
+ var NODE_REGISTRY_CHALLENGE_EPOCH_WINDOW = 2n;
527
+ var NODE_REGISTRY_ARCHIVE_KIND_EPOCH_SEED = 3;
528
+ var NODE_REGISTRY_TAG_ARCHIVE_CHALLENGE = 50;
529
+ var NODE_REGISTRY_TAG_SERVICE_SCORE = 36;
530
+ var NODE_REGISTRY_TAG_TREASURY = 31;
481
531
  var PENDING_CHANGE_KIND_CODES = {
482
532
  add: 1,
483
533
  remove: 2,
@@ -839,6 +889,438 @@ function encodeFormClusterCalldata(args) {
839
889
  )
840
890
  );
841
891
  }
892
+ function encodeClusterCharter(args) {
893
+ if (args.memberShareBps.length !== NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT) {
894
+ throw new NodeRegistryError(
895
+ `memberShareBps needs exactly ${NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT} entries, got ${args.memberShareBps.length}`
896
+ );
897
+ }
898
+ let sum = 0;
899
+ for (const bps of args.memberShareBps) {
900
+ if (!Number.isInteger(bps) || bps < 0 || bps > 65535) {
901
+ throw new NodeRegistryError(`memberShareBps entries must be u16 integers, got ${bps}`);
902
+ }
903
+ sum += bps;
904
+ }
905
+ if (sum !== NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS) {
906
+ throw new NodeRegistryError(
907
+ `memberShareBps must sum to ${NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS}, got ${sum}`
908
+ );
909
+ }
910
+ if (!Number.isInteger(args.delegatorShareBps) || args.delegatorShareBps < NODE_REGISTRY_CLUSTER_CHARTER_DELEGATOR_FLOOR_BPS || args.delegatorShareBps > NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS) {
911
+ throw new NodeRegistryError(
912
+ `delegatorShareBps must be within [${NODE_REGISTRY_CLUSTER_CHARTER_DELEGATOR_FLOOR_BPS}, ${NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS}], got ${args.delegatorShareBps}`
913
+ );
914
+ }
915
+ const expiresMs = typeof args.expiresMs === "bigint" ? args.expiresMs : BigInt(args.expiresMs);
916
+ if (expiresMs < 0n || expiresMs > 0xffffffffffffffffn) {
917
+ throw new NodeRegistryError(`expiresMs must fit in u64, got ${expiresMs}`);
918
+ }
919
+ const out = new Uint8Array(NODE_REGISTRY_CLUSTER_CHARTER_BYTES);
920
+ for (let i = 0; i < NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT; i += 1) {
921
+ out.set(u16BeBytes(args.memberShareBps[i]), 2 * i);
922
+ }
923
+ out.set(u16BeBytes(args.delegatorShareBps), 20);
924
+ out.set(u64BeBytes(expiresMs), 22);
925
+ return out;
926
+ }
927
+ function formClusterMessageV2(activePubkeys, standbyPubkeys, charter) {
928
+ const active = expectLength2(
929
+ toBytes(activePubkeys),
930
+ NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
931
+ "activePubkeys"
932
+ );
933
+ const standby = expectLength2(
934
+ toBytes(standbyPubkeys),
935
+ NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
936
+ "standbyPubkeys"
937
+ );
938
+ const charterBytes = expectLength2(
939
+ toBytes(charter),
940
+ NODE_REGISTRY_CLUSTER_CHARTER_BYTES,
941
+ "charter"
942
+ );
943
+ return blake3_js.blake3(
944
+ concatBytes(
945
+ new TextEncoder().encode(NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN_V2),
946
+ u16BeBytes(NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT),
947
+ u16BeBytes(NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT),
948
+ u16BeBytes(NODE_REGISTRY_FORM_CLUSTER_THRESHOLD),
949
+ u32BeBytes(active.length),
950
+ active,
951
+ u32BeBytes(standby.length),
952
+ standby,
953
+ u32BeBytes(charterBytes.length),
954
+ charterBytes
955
+ )
956
+ );
957
+ }
958
+ function formClusterMessageV2Hex(activePubkeys, standbyPubkeys, charter) {
959
+ return bytesToHex(formClusterMessageV2(activePubkeys, standbyPubkeys, charter));
960
+ }
961
+ function encodeFormClusterV2Calldata(args) {
962
+ const activePubkeys = expectLength2(
963
+ toBytes(args.activePubkeys),
964
+ NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
965
+ "activePubkeys"
966
+ );
967
+ const standbyPubkeys = expectLength2(
968
+ toBytes(args.standbyPubkeys),
969
+ NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
970
+ "standbyPubkeys"
971
+ );
972
+ const signatures = expectLength2(
973
+ toBytes(args.signatures),
974
+ NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT * NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES,
975
+ "signatures"
976
+ );
977
+ const charter = expectLength2(
978
+ toBytes(args.charter),
979
+ NODE_REGISTRY_CLUSTER_CHARTER_BYTES,
980
+ "charter"
981
+ );
982
+ const activePadded = padToWord(activePubkeys);
983
+ const standbyPadded = padToWord(standbyPubkeys);
984
+ const signaturesPadded = padToWord(signatures);
985
+ const charterPadded = padToWord(charter);
986
+ const activeOffset = 4n * 32n;
987
+ const standbyOffset = activeOffset + 32n + BigInt(activePadded.length);
988
+ const signaturesOffset = standbyOffset + 32n + BigInt(standbyPadded.length);
989
+ const charterOffset = signaturesOffset + 32n + BigInt(signaturesPadded.length);
990
+ return bytesToHex(
991
+ concatBytes(
992
+ hexToBytes(NODE_REGISTRY_SELECTORS.formClusterV2),
993
+ uint64Word(activeOffset, "activePubkeysOffset"),
994
+ uint64Word(standbyOffset, "standbyPubkeysOffset"),
995
+ uint64Word(signaturesOffset, "signaturesOffset"),
996
+ uint64Word(charterOffset, "charterOffset"),
997
+ uint64Word(BigInt(activePubkeys.length), "activePubkeysLength"),
998
+ activePadded,
999
+ uint64Word(BigInt(standbyPubkeys.length), "standbyPubkeysLength"),
1000
+ standbyPadded,
1001
+ uint64Word(BigInt(signatures.length), "signaturesLength"),
1002
+ signaturesPadded,
1003
+ uint64Word(BigInt(charter.length), "charterLength"),
1004
+ charterPadded
1005
+ )
1006
+ );
1007
+ }
1008
+ function decodeClusterCharter(charter) {
1009
+ const bytes = expectLength2(toBytes(charter), NODE_REGISTRY_CLUSTER_CHARTER_BYTES, "charter");
1010
+ const memberShareBps = [];
1011
+ let sum = 0;
1012
+ for (let i = 0; i < NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT; i += 1) {
1013
+ const bps = bytes[2 * i] << 8 | bytes[2 * i + 1];
1014
+ memberShareBps.push(bps);
1015
+ sum += bps;
1016
+ }
1017
+ if (sum !== NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS) {
1018
+ throw new NodeRegistryError(
1019
+ `memberShareBps must sum to ${NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS}, got ${sum}`
1020
+ );
1021
+ }
1022
+ const delegatorShareBps = bytes[20] << 8 | bytes[21];
1023
+ if (delegatorShareBps < NODE_REGISTRY_CLUSTER_CHARTER_DELEGATOR_FLOOR_BPS || delegatorShareBps > NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS) {
1024
+ throw new NodeRegistryError(
1025
+ `delegatorShareBps must be within [${NODE_REGISTRY_CLUSTER_CHARTER_DELEGATOR_FLOOR_BPS}, ${NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS}], got ${delegatorShareBps}`
1026
+ );
1027
+ }
1028
+ let expiresMs = 0n;
1029
+ for (let i = 22; i < 30; i += 1) {
1030
+ expiresMs = expiresMs << 8n | BigInt(bytes[i]);
1031
+ }
1032
+ return { memberShareBps, delegatorShareBps, expiresMs };
1033
+ }
1034
+ function updateCharterMessage(clusterId, charter) {
1035
+ const id = toUint32(clusterId, "clusterId");
1036
+ const charterBytes = expectLength2(toBytes(charter), NODE_REGISTRY_CLUSTER_CHARTER_BYTES, "charter");
1037
+ return blake3_js.blake3(
1038
+ concatBytes(
1039
+ new TextEncoder().encode(NODE_REGISTRY_UPDATE_CHARTER_MESSAGE_DOMAIN),
1040
+ u32BeBytes(id),
1041
+ u16BeBytes(NODE_REGISTRY_UPDATE_CHARTER_THRESHOLD),
1042
+ u32BeBytes(charterBytes.length),
1043
+ charterBytes
1044
+ )
1045
+ );
1046
+ }
1047
+ function updateCharterMessageHex(clusterId, charter) {
1048
+ return bytesToHex(updateCharterMessage(clusterId, charter));
1049
+ }
1050
+ function encodeUpdateCharterCalldata(args) {
1051
+ const id = toUint32(args.clusterId, "clusterId");
1052
+ const charter = expectLength2(
1053
+ toBytes(args.charter),
1054
+ NODE_REGISTRY_CLUSTER_CHARTER_BYTES,
1055
+ "charter"
1056
+ );
1057
+ const signerPubkeys = flattenFixedWidth(
1058
+ args.signerPubkeys,
1059
+ NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
1060
+ "signerPubkeys"
1061
+ );
1062
+ const signatures = flattenFixedWidth(
1063
+ args.signatures,
1064
+ NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES,
1065
+ "signatures"
1066
+ );
1067
+ const nPubkeys = signerPubkeys.length / NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES;
1068
+ const nSigs = signatures.length / NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES;
1069
+ if (nPubkeys !== nSigs) {
1070
+ throw new NodeRegistryError(
1071
+ `signerPubkeys (${nPubkeys}) and signatures (${nSigs}) counts must match`
1072
+ );
1073
+ }
1074
+ if (nPubkeys < NODE_REGISTRY_UPDATE_CHARTER_THRESHOLD || nPubkeys > NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT) {
1075
+ throw new NodeRegistryError(
1076
+ `signer count must be in [${NODE_REGISTRY_UPDATE_CHARTER_THRESHOLD}, ${NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT}], got ${nPubkeys}`
1077
+ );
1078
+ }
1079
+ const charterPadded = padToWord(charter);
1080
+ const signerPadded = padToWord(signerPubkeys);
1081
+ const sigsPadded = padToWord(signatures);
1082
+ const charterOffset = 4n * 32n;
1083
+ const signerOffset = charterOffset + 32n + BigInt(charterPadded.length);
1084
+ const sigsOffset = signerOffset + 32n + BigInt(signerPadded.length);
1085
+ return bytesToHex(
1086
+ concatBytes(
1087
+ hexToBytes(NODE_REGISTRY_SELECTORS.updateCharter),
1088
+ uint32Word(id),
1089
+ uint64Word(charterOffset, "charterOffset"),
1090
+ uint64Word(signerOffset, "signerPubkeysOffset"),
1091
+ uint64Word(sigsOffset, "signaturesOffset"),
1092
+ uint64Word(BigInt(charter.length), "charterLength"),
1093
+ charterPadded,
1094
+ uint64Word(BigInt(signerPubkeys.length), "signerPubkeysLength"),
1095
+ signerPadded,
1096
+ uint64Word(BigInt(signatures.length), "signaturesLength"),
1097
+ sigsPadded
1098
+ )
1099
+ );
1100
+ }
1101
+ function encodeGetPendingCharterCalldata(clusterId) {
1102
+ return bytesToHex(
1103
+ concatBytes(hexToBytes(NODE_REGISTRY_SELECTORS.getPendingCharter), uint32Word(toUint32(clusterId, "clusterId")))
1104
+ );
1105
+ }
1106
+ function decodePendingCharter(returnData) {
1107
+ const bytes = toBytes(returnData);
1108
+ if (bytes.length < 5 * 32) {
1109
+ throw new NodeRegistryError("getPendingCharter return shorter than the 5-word head");
1110
+ }
1111
+ const word = (i) => bytes.slice(i * 32, (i + 1) * 32);
1112
+ const present = numberFromWord(word(0), "present", 1) === 1;
1113
+ const delegatorShareBps = numberFromWord(word(1), "delegatorShareBps", 65535);
1114
+ const effectiveEpoch = u64FromWord(word(2));
1115
+ const signerCount = numberFromWord(word(3), "signerCount", 65535);
1116
+ if (!present) {
1117
+ return { present: false, delegatorShareBps: 0, effectiveEpoch, signerCount: 0, memberShareBps: [] };
1118
+ }
1119
+ const bytesOffset = Number(u64FromWord(word(4)));
1120
+ const lenAt = bytesOffset;
1121
+ if (bytes.length < lenAt + 32) {
1122
+ throw new NodeRegistryError("getPendingCharter bytes-length word out of range");
1123
+ }
1124
+ const sharesLen = Number(u64FromWord(bytes.slice(lenAt, lenAt + 32)));
1125
+ const sharesAt = lenAt + 32;
1126
+ if (sharesLen < 32 || bytes.length < sharesAt + 32) {
1127
+ throw new NodeRegistryError("getPendingCharter packed-shares word truncated");
1128
+ }
1129
+ const packed = bytes.slice(sharesAt, sharesAt + 32);
1130
+ const memberShareBps = [];
1131
+ for (let i = 0; i < NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT; i += 1) {
1132
+ const at = 12 + 2 * i;
1133
+ memberShareBps.push(packed[at] << 8 | packed[at + 1]);
1134
+ }
1135
+ return { present: true, delegatorShareBps, effectiveEpoch, signerCount, memberShareBps };
1136
+ }
1137
+ function encodeCommitArchiveRootCalldata(args) {
1138
+ const leafCount = toUint64(args.leafCount, "leafCount");
1139
+ if (leafCount < NODE_REGISTRY_MIN_ARCHIVE_LEAF_COUNT) {
1140
+ throw new NodeRegistryError(
1141
+ `leafCount must be >= ${NODE_REGISTRY_MIN_ARCHIVE_LEAF_COUNT} (MIN_ARCHIVE_LEAF_COUNT), got ${leafCount}`
1142
+ );
1143
+ }
1144
+ return bytesToHex(
1145
+ concatBytes(
1146
+ hexToBytes(NODE_REGISTRY_SELECTORS.commitArchiveRoot),
1147
+ expectLength2(toBytes(args.peerId), 32, "peerId"),
1148
+ uint16Word(args.shardIndex),
1149
+ expectLength2(toBytes(args.shardRoot), 32, "shardRoot"),
1150
+ uint64Word(leafCount, "leafCount")
1151
+ )
1152
+ );
1153
+ }
1154
+ function encodeAnswerArchiveChallengeCalldata(args) {
1155
+ const leaf = toBytes(args.leaf);
1156
+ const proof = args.proof.map((p, i) => expectLength2(toBytes(p), 32, `proof[${i}]`));
1157
+ if (proof.length > NODE_REGISTRY_MAX_MERKLE_PROOF_DEPTH) {
1158
+ throw new NodeRegistryError(
1159
+ `proof length must be <= ${NODE_REGISTRY_MAX_MERKLE_PROOF_DEPTH}, got ${proof.length}`
1160
+ );
1161
+ }
1162
+ const leafPadded = padToWord(leaf);
1163
+ const leafOffset = 5n * 32n;
1164
+ const proofOffset = leafOffset + 32n + BigInt(leafPadded.length);
1165
+ const proofTail = concatBytes(
1166
+ uint64Word(BigInt(proof.length), "proofLength"),
1167
+ ...proof
1168
+ );
1169
+ return bytesToHex(
1170
+ concatBytes(
1171
+ hexToBytes(NODE_REGISTRY_SELECTORS.answerArchiveChallenge),
1172
+ expectLength2(toBytes(args.peerId), 32, "peerId"),
1173
+ uint16Word(args.shardIndex),
1174
+ uint64Word(args.epoch, "epoch"),
1175
+ uint64Word(leafOffset, "leafOffset"),
1176
+ uint64Word(proofOffset, "proofOffset"),
1177
+ uint64Word(BigInt(leaf.length), "leafLength"),
1178
+ leafPadded,
1179
+ proofTail
1180
+ )
1181
+ );
1182
+ }
1183
+ function slotEpochChallengeSeed(epoch) {
1184
+ const buf = new Uint8Array(1 + 8 + 1);
1185
+ buf[0] = NODE_REGISTRY_TAG_ARCHIVE_CHALLENGE;
1186
+ buf.set(u64BeBytes(toUint64(epoch, "epoch")), 1);
1187
+ buf[9] = NODE_REGISTRY_ARCHIVE_KIND_EPOCH_SEED;
1188
+ return bytesToHex(sha3_js.keccak_256(buf));
1189
+ }
1190
+ function protocolNonceForEpoch(seed, epoch) {
1191
+ const s = expectLength2(toBytes(seed), 32, "seed");
1192
+ const e = toUint64(epoch, "epoch");
1193
+ const digest = blake3_js.blake3(
1194
+ concatBytes(new TextEncoder().encode(NODE_REGISTRY_ARCHIVE_NONCE_DOMAIN), u64BeBytes(e), s)
1195
+ );
1196
+ let n = 0n;
1197
+ for (let i = 0; i < 8; i += 1) {
1198
+ n = n << 8n | BigInt(digest[i]);
1199
+ }
1200
+ return n;
1201
+ }
1202
+ function deriveArchiveChallenge(seed, opHash, shardIndex, epoch, leafCount) {
1203
+ const pinnedSeed = expectLength2(toBytes(seed), 32, "seed");
1204
+ const op = expectLength2(toBytes(opHash), 32, "opHash");
1205
+ const shard = expectUint16(shardIndex, "shardIndex");
1206
+ const e = toUint64(epoch, "epoch");
1207
+ const count = toUint64(leafCount, "leafCount");
1208
+ if (count === 0n) {
1209
+ return null;
1210
+ }
1211
+ const nonce = protocolNonceForEpoch(pinnedSeed, e);
1212
+ const challengeSeed = blake3_js.blake3(
1213
+ concatBytes(
1214
+ new TextEncoder().encode(NODE_REGISTRY_ARCHIVE_CHALLENGE_DOMAIN),
1215
+ pinnedSeed,
1216
+ op,
1217
+ u16BeBytes(shard),
1218
+ u64BeBytes(e),
1219
+ u64BeBytes(nonce)
1220
+ )
1221
+ );
1222
+ let idx = 0n;
1223
+ for (let i = 0; i < 8; i += 1) {
1224
+ idx = idx << 8n | BigInt(challengeSeed[i]);
1225
+ }
1226
+ return {
1227
+ opHash: bytesToHex(op),
1228
+ shardIndex: shard,
1229
+ leafIndex: idx % count,
1230
+ seed: bytesToHex(challengeSeed)
1231
+ };
1232
+ }
1233
+ function archiveMerkleLeafHash(leaf) {
1234
+ return blake3_js.blake3(concatBytes(Uint8Array.from([NODE_REGISTRY_MERKLE_LEAF_DOMAIN]), toBytes(leaf)));
1235
+ }
1236
+ function archiveMerkleInnerHash(left, right) {
1237
+ return blake3_js.blake3(
1238
+ concatBytes(
1239
+ Uint8Array.from([NODE_REGISTRY_MERKLE_INNER_DOMAIN]),
1240
+ expectLength2(toBytes(left), 32, "left"),
1241
+ expectLength2(toBytes(right), 32, "right")
1242
+ )
1243
+ );
1244
+ }
1245
+ function encodeSetProbeAuthorityCalldata(probeAuthority) {
1246
+ return bytesToHex(
1247
+ concatBytes(
1248
+ hexToBytes(NODE_REGISTRY_SELECTORS.setProbeAuthority),
1249
+ addressWord(probeAuthority, "probeAuthority")
1250
+ )
1251
+ );
1252
+ }
1253
+ function encodeGetProbeAuthorityCalldata() {
1254
+ return NODE_REGISTRY_SELECTORS.getProbeAuthority;
1255
+ }
1256
+ function decodeProbeAuthority(returnData) {
1257
+ const bytes = expectLength2(toBytes(returnData), 32, "probeAuthority");
1258
+ return bytesToHex(bytes.slice(12, 32));
1259
+ }
1260
+ function encodeAttestServiceProbeCalldata(args) {
1261
+ if (!isValidPublicServiceProbeMask(args.serviceMask)) {
1262
+ throw new NodeRegistryError(
1263
+ `serviceMask 0x${args.serviceMask.toString(16).padStart(8, "0")} is not a valid public-service mask`
1264
+ );
1265
+ }
1266
+ if (!isConcreteServiceProbeStatus(args.status)) {
1267
+ throw new NodeRegistryError(`status ${args.status} is not a concrete service-probe outcome`);
1268
+ }
1269
+ return bytesToHex(
1270
+ concatBytes(
1271
+ hexToBytes(NODE_REGISTRY_SELECTORS.attestServiceProbe),
1272
+ expectLength2(toBytes(args.opHash), 32, "opHash"),
1273
+ uint32Word(args.serviceMask),
1274
+ uint8Word(args.status),
1275
+ uint64Word(args.epoch, "epoch")
1276
+ )
1277
+ );
1278
+ }
1279
+ function slotClusterServiceScore(clusterId) {
1280
+ return scoreSlotHex(0, u32BeBytes(toUint32(clusterId, "clusterId")));
1281
+ }
1282
+ function slotArchiveChallengePass(clusterId, epoch) {
1283
+ return scoreSlotHex(
1284
+ 1,
1285
+ concatBytes(u32BeBytes(toUint32(clusterId, "clusterId")), u64BeBytes(toUint64(epoch, "epoch")))
1286
+ );
1287
+ }
1288
+ function slotScoreServiceProbe(opHash, serviceBit) {
1289
+ if (!Number.isInteger(serviceBit) || serviceBit < 0 || serviceBit > 255) {
1290
+ throw new NodeRegistryError("serviceBit must be a u8 bit index");
1291
+ }
1292
+ return scoreSlotHex(
1293
+ 2,
1294
+ concatBytes(expectLength2(toBytes(opHash), 32, "opHash"), Uint8Array.from([serviceBit]))
1295
+ );
1296
+ }
1297
+ function serviceMaskToBitIndex(mask) {
1298
+ if (!Number.isInteger(mask) || mask <= 0 || (mask & mask - 1) !== 0) {
1299
+ return null;
1300
+ }
1301
+ let bit = 0;
1302
+ let m = mask >>> 0;
1303
+ while ((m & 1) === 0) {
1304
+ m >>>= 1;
1305
+ bit += 1;
1306
+ }
1307
+ return bit;
1308
+ }
1309
+ function decodeScoreServiceProbe(word) {
1310
+ const bytes = expectLength2(toBytes(word), 32, "scoreServiceProbeWord");
1311
+ const status = bytes[31];
1312
+ let packed = 0n;
1313
+ for (const b of bytes) {
1314
+ packed = packed << 8n | BigInt(b);
1315
+ }
1316
+ return { epoch: packed >> 8n, status };
1317
+ }
1318
+ function slotProbeAuthority() {
1319
+ const buf = new Uint8Array(1 + 32 + 1);
1320
+ buf[0] = NODE_REGISTRY_TAG_TREASURY;
1321
+ buf[33] = 10;
1322
+ return bytesToHex(sha3_js.keccak_256(buf));
1323
+ }
842
1324
  function decodeClusterJoinRequest(returnData) {
843
1325
  const bytes = expectLength2(toBytes(returnData), 8 * 32, "clusterJoinRequest");
844
1326
  const word = (i) => bytes.slice(i * 32, (i + 1) * 32);
@@ -1017,6 +1499,43 @@ function u16BeBytes(value) {
1017
1499
  }
1018
1500
  return Uint8Array.from([value >>> 8 & 255, value & 255]);
1019
1501
  }
1502
+ function expectUint16(value, name) {
1503
+ if (!Number.isInteger(value) || value < 0 || value > 65535) {
1504
+ throw new NodeRegistryError(`${name} must be a uint16`);
1505
+ }
1506
+ return value;
1507
+ }
1508
+ function uint16Word(value) {
1509
+ const out = new Uint8Array(32);
1510
+ out.set(u16BeBytes(value), 30);
1511
+ return out;
1512
+ }
1513
+ function addressWord(value, name) {
1514
+ const addr = expectLength2(toBytes(value), 20, name);
1515
+ const out = new Uint8Array(32);
1516
+ out.set(addr, 12);
1517
+ return out;
1518
+ }
1519
+ function flattenFixedWidth(value, width, name) {
1520
+ let flat;
1521
+ if (Array.isArray(value) && value.length > 0 && typeof value[0] !== "number") {
1522
+ const parts = value.map(
1523
+ (v, i) => expectLength2(toBytes(v), width, `${name}[${i}]`)
1524
+ );
1525
+ flat = concatBytes(...parts);
1526
+ } else {
1527
+ flat = toBytes(value);
1528
+ }
1529
+ if (flat.length === 0 || flat.length % width !== 0) {
1530
+ throw new NodeRegistryError(`${name} must be a non-empty multiple of ${width} bytes, got ${flat.length}`);
1531
+ }
1532
+ return flat;
1533
+ }
1534
+ function scoreSlotHex(kind, tail) {
1535
+ return bytesToHex(
1536
+ sha3_js.keccak_256(concatBytes(Uint8Array.from([NODE_REGISTRY_TAG_SERVICE_SCORE, kind]), tail))
1537
+ );
1538
+ }
1020
1539
  function compareBytes(a, b) {
1021
1540
  const len = Math.min(a.length, b.length);
1022
1541
  for (let i = 0; i < len; i++) {
@@ -3544,7 +4063,7 @@ function encodeStringAddressCall(selector, name, address) {
3544
4063
  hexToBytes4(selector),
3545
4064
  // Two head words (string offset, address) → string tail starts at 0x40.
3546
4065
  uint256Word(0x40n),
3547
- addressWord(address),
4066
+ addressWord2(address),
3548
4067
  uint256Word(BigInt(nameBytes.length)),
3549
4068
  padTo32(nameBytes)
3550
4069
  )
@@ -3568,7 +4087,7 @@ function selectorHex2(signature) {
3568
4087
  const sel = sha3_js.keccak_256(new TextEncoder().encode(signature)).slice(0, 4);
3569
4088
  return `0x${[...sel].map((b) => b.toString(16).padStart(2, "0")).join("")}`;
3570
4089
  }
3571
- function addressWord(value) {
4090
+ function addressWord2(value) {
3572
4091
  const out = new Uint8Array(32);
3573
4092
  if (value == null) return out;
3574
4093
  const bytes = toBytes2(value);
@@ -6112,7 +6631,7 @@ function encodeSetBridgeRouteFinalityCalldata(bridgeId, finalityBlocks) {
6112
6631
  function bridgeSelector(signature) {
6113
6632
  return sha3_js.keccak_256(new TextEncoder().encode(signature)).slice(0, 4);
6114
6633
  }
6115
- function addressWord2(value, name) {
6634
+ function addressWord3(value, name) {
6116
6635
  const addr = expectLength3(toBytes3(value), 20, name);
6117
6636
  const out = new Uint8Array(32);
6118
6637
  out.set(addr, 12);
@@ -6131,7 +6650,7 @@ function encodeBridgeClaimCalldata(bridgeId, depositId, recipient) {
6131
6650
  bridgeSelector("claim(bytes32,bytes32,address)"),
6132
6651
  expectLength3(toBytes3(bridgeId), 32, "bridgeId"),
6133
6652
  expectLength3(toBytes3(depositId), 32, "depositId"),
6134
- addressWord2(recipient, "recipient")
6653
+ addressWord3(recipient, "recipient")
6135
6654
  )
6136
6655
  );
6137
6656
  }
@@ -9125,8 +9644,8 @@ function encodeTokenFactoryTransferFromCalldata(tokenId, from, to, amount) {
9125
9644
  concatBytes2(
9126
9645
  hexToBytes2(TOKEN_FACTORY_SELECTORS.transferFrom, "transferFrom selector"),
9127
9646
  bytes32(tokenId, "tokenId"),
9128
- addressWord3(from, "from"),
9129
- addressWord3(to, "to"),
9647
+ addressWord4(from, "from"),
9648
+ addressWord4(to, "to"),
9130
9649
  uint256Word2(parseUint(amount, "amount"), "amount")
9131
9650
  )
9132
9651
  );
@@ -9148,8 +9667,8 @@ function encodeTokenFactoryAllowanceCalldata(tokenId, owner, spender) {
9148
9667
  concatBytes2(
9149
9668
  hexToBytes2(TOKEN_FACTORY_SELECTORS.allowance, "allowance selector"),
9150
9669
  bytes32(tokenId, "tokenId"),
9151
- addressWord3(owner, "owner"),
9152
- addressWord3(spender, "spender")
9670
+ addressWord4(owner, "owner"),
9671
+ addressWord4(spender, "spender")
9153
9672
  )
9154
9673
  );
9155
9674
  }
@@ -9216,7 +9735,7 @@ function encodeBytes32Address(selector, tokenId, address) {
9216
9735
  concatBytes2(
9217
9736
  hexToBytes2(selector, "selector"),
9218
9737
  bytes32(tokenId, "tokenId"),
9219
- addressWord3(address, "address")
9738
+ addressWord4(address, "address")
9220
9739
  )
9221
9740
  );
9222
9741
  }
@@ -9225,7 +9744,7 @@ function encodeBytes32AddressUint(selector, tokenId, address, amount) {
9225
9744
  concatBytes2(
9226
9745
  hexToBytes2(selector, "selector"),
9227
9746
  bytes32(tokenId, "tokenId"),
9228
- addressWord3(address, "address"),
9747
+ addressWord4(address, "address"),
9229
9748
  uint256Word2(parseUint(amount, "amount"), "amount")
9230
9749
  )
9231
9750
  );
@@ -9251,7 +9770,7 @@ function padTo323(bytes) {
9251
9770
  out.set(bytes);
9252
9771
  return out;
9253
9772
  }
9254
- function addressWord3(value, label) {
9773
+ function addressWord4(value, label) {
9255
9774
  const out = new Uint8Array(32);
9256
9775
  out.set(addressBytes(value, label), 12);
9257
9776
  return out;
@@ -9766,7 +10285,7 @@ function encodeDelegateCalldata(cluster, weightBps) {
9766
10285
  concatBytes8(
9767
10286
  hexToBytes8(DELEGATION_SELECTORS.delegate),
9768
10287
  uint32Word2(cluster, "cluster"),
9769
- uint16Word(weightBps, "weightBps")
10288
+ uint16Word2(weightBps, "weightBps")
9770
10289
  )
9771
10290
  );
9772
10291
  }
@@ -9784,7 +10303,7 @@ function encodeRedelegateCalldata(fromCluster, toCluster, weightBps) {
9784
10303
  hexToBytes8(DELEGATION_SELECTORS.redelegate),
9785
10304
  uint32Word2(fromCluster, "fromCluster"),
9786
10305
  uint32Word2(toCluster, "toCluster"),
9787
- uint16Word(weightBps, "weightBps")
10306
+ uint16Word2(weightBps, "weightBps")
9788
10307
  )
9789
10308
  );
9790
10309
  }
@@ -9814,7 +10333,7 @@ function uint32Word2(value, name) {
9814
10333
  }
9815
10334
  return out;
9816
10335
  }
9817
- function uint16Word(value, name) {
10336
+ function uint16Word2(value, name) {
9818
10337
  const n = toBigint3(value, name);
9819
10338
  if (n < 0n || n > 0xffffn) {
9820
10339
  throw new DelegationPrecompileError(`${name} must fit uint16`);
@@ -10225,9 +10744,9 @@ function decodeHasPubkeyReturn(data) {
10225
10744
  throw new PubkeyRegistryError("hasPubkey bool must be 0 or 1");
10226
10745
  }
10227
10746
  function encodeSingleAddressCall2(selector, address) {
10228
- return bytesToHex11(concatBytes10(hexToBytes10(selector), addressWord4(toAddressBytes(address))));
10747
+ return bytesToHex11(concatBytes10(hexToBytes10(selector), addressWord5(toAddressBytes(address))));
10229
10748
  }
10230
- function addressWord4(address) {
10749
+ function addressWord5(address) {
10231
10750
  return concatBytes10(new Uint8Array(12), address);
10232
10751
  }
10233
10752
  function toAddressBytes(value) {
@@ -10436,7 +10955,7 @@ function encodePlaceMarketOrderCalldata(args) {
10436
10955
  normalized.quoteTokenId,
10437
10956
  uint8Word2(normalized.side),
10438
10957
  uint256Word5(normalized.quantity, "quantity"),
10439
- uint16Word2(normalized.maxSlippageBps, "maxSlippageBps")
10958
+ uint16Word3(normalized.maxSlippageBps, "maxSlippageBps")
10440
10959
  )
10441
10960
  );
10442
10961
  }
@@ -10449,7 +10968,7 @@ function encodePlaceMarketOrderExCalldata(args) {
10449
10968
  normalized.quoteTokenId,
10450
10969
  uint8Word2(normalized.side),
10451
10970
  uint256Word5(normalized.quantity, "quantity"),
10452
- uint16Word2(normalized.maxSlippageBps, "maxSlippageBps"),
10971
+ uint16Word3(normalized.maxSlippageBps, "maxSlippageBps"),
10453
10972
  uint8Word2(normalized.mode)
10454
10973
  )
10455
10974
  );
@@ -10756,7 +11275,7 @@ function encodePlaceLimitOrderViaCalldata(args) {
10756
11275
  return bytesToHex2(
10757
11276
  concatBytes2(
10758
11277
  hexToBytes2(OPERATOR_ROUTER_SELECTORS.placeLimitOrderVia, "placeLimitOrderVia selector"),
10759
- addressWord5(operator.bytes),
11278
+ addressWord6(operator.bytes),
10760
11279
  bytes32FromHex(args.base, "base"),
10761
11280
  bytes32FromHex(args.quote, "quote"),
10762
11281
  uint8Word2(side),
@@ -11064,7 +11583,7 @@ function uint64Word3(value, name) {
11064
11583
  }
11065
11584
  return out;
11066
11585
  }
11067
- function uint16Word2(value, name) {
11586
+ function uint16Word3(value, name) {
11068
11587
  if (value < 0n || value > 0xffffn) {
11069
11588
  throw new MarketActionError(`${name} must fit uint16`);
11070
11589
  }
@@ -11085,7 +11604,7 @@ function uint256Word5(value, name) {
11085
11604
  }
11086
11605
  return out;
11087
11606
  }
11088
- function addressWord5(addr) {
11607
+ function addressWord6(addr) {
11089
11608
  if (addr.length !== 20) {
11090
11609
  throw new MarketActionError("address must be 20 bytes");
11091
11610
  }
@@ -11703,9 +12222,17 @@ exports.NATIVE_MARKET_EVENT_FAMILY = NATIVE_MARKET_EVENT_FAMILY;
11703
12222
  exports.NATIVE_MARKET_MODULE_ADDRESS = NATIVE_MARKET_MODULE_ADDRESS;
11704
12223
  exports.NATIVE_MARKET_MODULE_ADDRESS_BYTES = NATIVE_MARKET_MODULE_ADDRESS_BYTES;
11705
12224
  exports.NATIVE_MARKET_ORDER_BOOK_STREAM_TOPIC = NATIVE_MARKET_ORDER_BOOK_STREAM_TOPIC;
12225
+ exports.NODE_REGISTRY_ARCHIVE_CHALLENGE_DOMAIN = NODE_REGISTRY_ARCHIVE_CHALLENGE_DOMAIN;
12226
+ exports.NODE_REGISTRY_ARCHIVE_KIND_EPOCH_SEED = NODE_REGISTRY_ARCHIVE_KIND_EPOCH_SEED;
12227
+ exports.NODE_REGISTRY_ARCHIVE_NONCE_DOMAIN = NODE_REGISTRY_ARCHIVE_NONCE_DOMAIN;
11706
12228
  exports.NODE_REGISTRY_BLS_PUBKEY_BYTES = NODE_REGISTRY_BLS_PUBKEY_BYTES;
11707
12229
  exports.NODE_REGISTRY_CAPABILITIES = NODE_REGISTRY_CAPABILITIES;
11708
12230
  exports.NODE_REGISTRY_CAPABILITY_MASK = NODE_REGISTRY_CAPABILITY_MASK;
12231
+ exports.NODE_REGISTRY_CHALLENGE_EPOCH_WINDOW = NODE_REGISTRY_CHALLENGE_EPOCH_WINDOW;
12232
+ exports.NODE_REGISTRY_CHARTER_COOLDOWN_EPOCHS = NODE_REGISTRY_CHARTER_COOLDOWN_EPOCHS;
12233
+ exports.NODE_REGISTRY_CLUSTER_CHARTER_BYTES = NODE_REGISTRY_CLUSTER_CHARTER_BYTES;
12234
+ exports.NODE_REGISTRY_CLUSTER_CHARTER_DELEGATOR_FLOOR_BPS = NODE_REGISTRY_CLUSTER_CHARTER_DELEGATOR_FLOOR_BPS;
12235
+ exports.NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS = NODE_REGISTRY_CLUSTER_CHARTER_SHARE_DENOM_BPS;
11709
12236
  exports.NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
11710
12237
  exports.NODE_REGISTRY_CONSENSUS_POP_BYTES = NODE_REGISTRY_CONSENSUS_POP_BYTES;
11711
12238
  exports.NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES = NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES;
@@ -11717,15 +12244,25 @@ exports.NODE_REGISTRY_DKG_THRESHOLD_SIG_BYTES = NODE_REGISTRY_DKG_THRESHOLD_SIG_
11717
12244
  exports.NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT = NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT;
11718
12245
  exports.NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT = NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT;
11719
12246
  exports.NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN = NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN;
12247
+ exports.NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN_V2 = NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN_V2;
11720
12248
  exports.NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT = NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT;
11721
12249
  exports.NODE_REGISTRY_FORM_CLUSTER_THRESHOLD = NODE_REGISTRY_FORM_CLUSTER_THRESHOLD;
11722
12250
  exports.NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES;
12251
+ exports.NODE_REGISTRY_MAX_MERKLE_PROOF_DEPTH = NODE_REGISTRY_MAX_MERKLE_PROOF_DEPTH;
12252
+ exports.NODE_REGISTRY_MERKLE_INNER_DOMAIN = NODE_REGISTRY_MERKLE_INNER_DOMAIN;
12253
+ exports.NODE_REGISTRY_MERKLE_LEAF_DOMAIN = NODE_REGISTRY_MERKLE_LEAF_DOMAIN;
12254
+ exports.NODE_REGISTRY_MIN_ARCHIVE_LEAF_COUNT = NODE_REGISTRY_MIN_ARCHIVE_LEAF_COUNT;
11723
12255
  exports.NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES = NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES;
11724
12256
  exports.NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES = NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES;
11725
12257
  exports.NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES = NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES;
11726
12258
  exports.NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID = NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID;
11727
12259
  exports.NODE_REGISTRY_PUBLIC_SERVICE_MASK = NODE_REGISTRY_PUBLIC_SERVICE_MASK;
11728
12260
  exports.NODE_REGISTRY_SELECTORS = NODE_REGISTRY_SELECTORS;
12261
+ exports.NODE_REGISTRY_TAG_ARCHIVE_CHALLENGE = NODE_REGISTRY_TAG_ARCHIVE_CHALLENGE;
12262
+ exports.NODE_REGISTRY_TAG_SERVICE_SCORE = NODE_REGISTRY_TAG_SERVICE_SCORE;
12263
+ exports.NODE_REGISTRY_TAG_TREASURY = NODE_REGISTRY_TAG_TREASURY;
12264
+ exports.NODE_REGISTRY_UPDATE_CHARTER_MESSAGE_DOMAIN = NODE_REGISTRY_UPDATE_CHARTER_MESSAGE_DOMAIN;
12265
+ exports.NODE_REGISTRY_UPDATE_CHARTER_THRESHOLD = NODE_REGISTRY_UPDATE_CHARTER_THRESHOLD;
11729
12266
  exports.NO_EVM_ARCHIVE_PROOF_SCHEMA = NO_EVM_ARCHIVE_PROOF_SCHEMA;
11730
12267
  exports.NO_EVM_ARCHIVE_SIGNATURE_SCHEME = NO_EVM_ARCHIVE_SIGNATURE_SCHEME;
11731
12268
  exports.NO_EVM_FINALITY_EVIDENCE_SCHEMA = NO_EVM_FINALITY_EVIDENCE_SCHEMA;
@@ -11794,6 +12331,8 @@ exports.addressToBech32 = addressToBech32;
11794
12331
  exports.addressToTypedBech32 = addressToTypedBech32;
11795
12332
  exports.allowRootFor = allowRootFor;
11796
12333
  exports.apiEndpointFromRpcEndpoint = apiEndpointFromRpcEndpoint;
12334
+ exports.archiveMerkleInnerHash = archiveMerkleInnerHash;
12335
+ exports.archiveMerkleLeafHash = archiveMerkleLeafHash;
11797
12336
  exports.assembleMultisigSigned = assembleMultisigSigned;
11798
12337
  exports.assembleMultisigWitness = assembleMultisigWitness;
11799
12338
  exports.assertMrvCallNativeSubmissionPlan = assertMrvCallNativeSubmissionPlan;
@@ -11879,6 +12418,7 @@ exports.computeNoEvmRoundFinalityMessage = computeNoEvmRoundFinalityMessage;
11879
12418
  exports.computeNoEvmTargetReceiptHash = computeNoEvmTargetReceiptHash;
11880
12419
  exports.computeQuoteLiquidity = computeQuoteLiquidity;
11881
12420
  exports.consumeNativeEvents = consumeNativeEvents;
12421
+ exports.decodeClusterCharter = decodeClusterCharter;
11882
12422
  exports.decodeClusterDiversity = decodeClusterDiversity;
11883
12423
  exports.decodeClusterFormedEvent = decodeClusterFormedEvent;
11884
12424
  exports.decodeClusterJoinRequest = decodeClusterJoinRequest;
@@ -11892,12 +12432,16 @@ exports.decodeOperatorFeeChargedEvent = decodeOperatorFeeChargedEvent;
11892
12432
  exports.decodeOperatorNetworkMetadata = decodeOperatorNetworkMetadata;
11893
12433
  exports.decodeOperatorSealKey = decodeOperatorSealKey;
11894
12434
  exports.decodeOracleEvent = decodeOracleEvent;
12435
+ exports.decodePendingCharter = decodePendingCharter;
12436
+ exports.decodeProbeAuthority = decodeProbeAuthority;
12437
+ exports.decodeScoreServiceProbe = decodeScoreServiceProbe;
11895
12438
  exports.decodeTimeWindow = decodeTimeWindow;
11896
12439
  exports.decodeTokenFactoryTokenId = decodeTokenFactoryTokenId;
11897
12440
  exports.decodeTxFeedResponse = decodeTxFeedResponse;
11898
12441
  exports.decodeVrfOutput = decodeVrfOutput;
11899
12442
  exports.delegationAddressHex = delegationAddressHex;
11900
12443
  exports.denyRootFor = denyRootFor;
12444
+ exports.deriveArchiveChallenge = deriveArchiveChallenge;
11901
12445
  exports.deriveClobMarketId = deriveClobMarketId;
11902
12446
  exports.deriveClusterAnchorAddress = deriveClusterAnchorAddress;
11903
12447
  exports.deriveClusterJoinOperatorId = deriveClusterJoinOperatorId;
@@ -11909,7 +12453,9 @@ exports.deriveNativeSpotMarketId = deriveNativeSpotMarketId;
11909
12453
  exports.deriveNativeSpotOrderId = deriveNativeSpotOrderId;
11910
12454
  exports.deriveTokenFactoryTokenId = deriveTokenFactoryTokenId;
11911
12455
  exports.destinationRoot = destinationRoot;
12456
+ exports.encodeAnswerArchiveChallengeCalldata = encodeAnswerArchiveChallengeCalldata;
11912
12457
  exports.encodeAttestDkgReshareCalldata = encodeAttestDkgReshareCalldata;
12458
+ exports.encodeAttestServiceProbeCalldata = encodeAttestServiceProbeCalldata;
11913
12459
  exports.encodeBlockSelector = encodeBlockSelector;
11914
12460
  exports.encodeBridgeChallengeCalldata = encodeBridgeChallengeCalldata;
11915
12461
  exports.encodeBridgeClaimCalldata = encodeBridgeClaimCalldata;
@@ -11918,6 +12464,8 @@ exports.encodeCancelOrderCalldata = encodeCancelOrderCalldata;
11918
12464
  exports.encodeCancelPendingChangeCalldata = encodeCancelPendingChangeCalldata;
11919
12465
  exports.encodeClaimCalldata = encodeClaimCalldata;
11920
12466
  exports.encodeClaimPolicyByAddressCalldata = encodeClaimPolicyByAddressCalldata;
12467
+ exports.encodeClusterCharter = encodeClusterCharter;
12468
+ exports.encodeCommitArchiveRootCalldata = encodeCommitArchiveRootCalldata;
11921
12469
  exports.encodeCreateFixedSupplyMrc20Calldata = encodeCreateFixedSupplyMrc20Calldata;
11922
12470
  exports.encodeCreateRequestCalldata = encodeCreateRequestCalldata;
11923
12471
  exports.encodeCreateRequestCanonical = encodeCreateRequestCanonical;
@@ -11927,8 +12475,11 @@ exports.encodeDisableCalldata = encodeDisableCalldata;
11927
12475
  exports.encodeEnableCalldata = encodeEnableCalldata;
11928
12476
  exports.encodeExpireClusterJoinCalldata = encodeExpireClusterJoinCalldata;
11929
12477
  exports.encodeFormClusterCalldata = encodeFormClusterCalldata;
12478
+ exports.encodeFormClusterV2Calldata = encodeFormClusterV2Calldata;
11930
12479
  exports.encodeGetClusterJoinRequestCalldata = encodeGetClusterJoinRequestCalldata;
11931
12480
  exports.encodeGetOperatorSealKeyCalldata = encodeGetOperatorSealKeyCalldata;
12481
+ exports.encodeGetPendingCharterCalldata = encodeGetPendingCharterCalldata;
12482
+ exports.encodeGetProbeAuthorityCalldata = encodeGetProbeAuthorityCalldata;
11932
12483
  exports.encodeHasPubkeyCalldata = encodeHasPubkeyCalldata;
11933
12484
  exports.encodeLockBridgeConfigCalldata = encodeLockBridgeConfigCalldata;
11934
12485
  exports.encodeLookupPubkeyCalldata = encodeLookupPubkeyCalldata;
@@ -12000,6 +12551,7 @@ exports.encodeSetMinNotionalCalldata = encodeSetMinNotionalCalldata;
12000
12551
  exports.encodeSetOperatorDisplayCalldata = encodeSetOperatorDisplayCalldata;
12001
12552
  exports.encodeSetPolicyCalldata = encodeSetPolicyCalldata;
12002
12553
  exports.encodeSetPolicyClaimCalldata = encodeSetPolicyClaimCalldata;
12554
+ exports.encodeSetProbeAuthorityCalldata = encodeSetProbeAuthorityCalldata;
12003
12555
  exports.encodeSetTickSizeCalldata = encodeSetTickSizeCalldata;
12004
12556
  exports.encodeSubmitBridgeProofCalldata = encodeSubmitBridgeProofCalldata;
12005
12557
  exports.encodeSubmitPendingChangeCalldata = encodeSubmitPendingChangeCalldata;
@@ -12018,6 +12570,7 @@ exports.encodeTokenFactoryTransferCalldata = encodeTokenFactoryTransferCalldata;
12018
12570
  exports.encodeTokenFactoryTransferFromCalldata = encodeTokenFactoryTransferFromCalldata;
12019
12571
  exports.encodeTokenFactoryTransferOwnershipCalldata = encodeTokenFactoryTransferOwnershipCalldata;
12020
12572
  exports.encodeUndelegateCalldata = encodeUndelegateCalldata;
12573
+ exports.encodeUpdateCharterCalldata = encodeUpdateCharterCalldata;
12021
12574
  exports.encodeVoteClusterAdmitCalldata = encodeVoteClusterAdmitCalldata;
12022
12575
  exports.encodeVrfEvaluateCalldata = encodeVrfEvaluateCalldata;
12023
12576
  exports.exportBridgeRouteCatalogueJson = exportBridgeRouteCatalogueJson;
@@ -12025,6 +12578,8 @@ exports.fetchChainInfoLatest = fetchChainInfoLatest;
12025
12578
  exports.fetchChainRegistryLatest = fetchChainRegistryLatest;
12026
12579
  exports.formClusterMessage = formClusterMessage;
12027
12580
  exports.formClusterMessageHex = formClusterMessageHex;
12581
+ exports.formClusterMessageV2 = formClusterMessageV2;
12582
+ exports.formClusterMessageV2Hex = formClusterMessageV2Hex;
12028
12583
  exports.formatLyth = formatLyth;
12029
12584
  exports.formatLythoshi = formatLythoshi;
12030
12585
  exports.formatNativeReceiptFeeDisplay = formatNativeReceiptFeeDisplay;
@@ -12087,6 +12642,7 @@ exports.parseQuantityBig = parseQuantityBig;
12087
12642
  exports.preflightClusterJoinRequest = preflightClusterJoinRequest;
12088
12643
  exports.previewRequestClusterJoin = previewRequestClusterJoin;
12089
12644
  exports.previewVoteClusterAdmit = previewVoteClusterAdmit;
12645
+ exports.protocolNonceForEpoch = protocolNonceForEpoch;
12090
12646
  exports.proverMarketStateFromByte = proverMarketStateFromByte;
12091
12647
  exports.pubkeyRegistryAddressHex = pubkeyRegistryAddressHex;
12092
12648
  exports.quoteOperatorFee = quoteOperatorFee;
@@ -12101,8 +12657,14 @@ exports.resolveMaxExecutionUnitPrice = resolveMaxExecutionUnitPrice;
12101
12657
  exports.resolveRegistryExecutionFee = resolveRegistryExecutionFee;
12102
12658
  exports.resolveStudioHostStatus = resolveStudioHostStatus;
12103
12659
  exports.selectBridgeTransferRoute = selectBridgeTransferRoute;
12660
+ exports.serviceMaskToBitIndex = serviceMaskToBitIndex;
12104
12661
  exports.serviceProbeStatusLabel = serviceProbeStatusLabel;
12105
12662
  exports.setDestinationRoot = setDestinationRoot;
12663
+ exports.slotArchiveChallengePass = slotArchiveChallengePass;
12664
+ exports.slotClusterServiceScore = slotClusterServiceScore;
12665
+ exports.slotEpochChallengeSeed = slotEpochChallengeSeed;
12666
+ exports.slotProbeAuthority = slotProbeAuthority;
12667
+ exports.slotScoreServiceProbe = slotScoreServiceProbe;
12106
12668
  exports.sortMultisigMembers = sortMultisigMembers;
12107
12669
  exports.spendingPolicyAddressHex = spendingPolicyAddressHex;
12108
12670
  exports.submitMrvCallNativeTx = submitMrvCallNativeTx;
@@ -12115,6 +12677,8 @@ exports.submitVoteClusterAdmit = submitVoteClusterAdmit;
12115
12677
  exports.tokenFactoryAddressHex = tokenFactoryAddressHex;
12116
12678
  exports.transactionFeeExposure = transactionFeeExposure;
12117
12679
  exports.typedBech32ToAddress = typedBech32ToAddress;
12680
+ exports.updateCharterMessage = updateCharterMessage;
12681
+ exports.updateCharterMessageHex = updateCharterMessageHex;
12118
12682
  exports.validateAddress = validateAddress;
12119
12683
  exports.validateBridgeRouteCatalogue = validateBridgeRouteCatalogue;
12120
12684
  exports.validateMrvArtifactMetadata = validateMrvArtifactMetadata;