@monolythium/core-sdk 0.4.1 → 0.4.2

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.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { blake3 } from '@noble/hashes/blake3.js';
2
2
  import { keccak_256, shake256 } from '@noble/hashes/sha3.js';
3
+ import { ml_kem768 } from '@noble/post-quantum/ml-kem.js';
4
+ import { chacha20poly1305 } from '@noble/ciphers/chacha.js';
5
+ import '@noble/hashes/utils.js';
3
6
  import { ml_dsa65 } from '@noble/post-quantum/ml-dsa.js';
4
7
  import { bls12_381 } from '@noble/curves/bls12-381.js';
5
8
  import { mnemonicToEntropy } from '@scure/bip39';
6
9
  import { wordlist } from '@scure/bip39/wordlists/english.js';
7
- import '@noble/post-quantum/ml-kem.js';
8
- import '@noble/ciphers/chacha.js';
9
- import '@noble/hashes/utils.js';
10
10
 
11
11
  // src/error.ts
12
12
  var SdkError = class _SdkError extends Error {
@@ -447,17 +447,26 @@ var NODE_REGISTRY_SELECTORS = {
447
447
  /** `expireClusterJoin(uint32,bytes32)` — CJ-1 public reaper/refund. */
448
448
  expireClusterJoin: "0x" + selectorHex("expireClusterJoin(uint32,bytes32)"),
449
449
  /** `getClusterJoinRequest(uint32,bytes32)` — CJ-1 request status view. */
450
- getClusterJoinRequest: "0x" + selectorHex("getClusterJoinRequest(uint32,bytes32)")
450
+ getClusterJoinRequest: "0x" + selectorHex("getClusterJoinRequest(uint32,bytes32)"),
451
+ /** `formCluster(bytes,bytes,bytes)` — no-foundation cluster formation by roster consent. */
452
+ formCluster: "0x" + selectorHex("formCluster(bytes,bytes,bytes)")
451
453
  };
452
- var NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = 48;
453
- var NODE_REGISTRY_BLS_PUBKEY_BYTES = NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES;
454
+ var NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES = 48;
455
+ var NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
456
+ var NODE_REGISTRY_BLS_PUBKEY_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
454
457
  var NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES = 1952;
458
+ var NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES = 3309;
455
459
  var NODE_REGISTRY_CONSENSUS_POP_BYTES = 3309;
456
460
  var NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES = 96;
457
461
  var NODE_REGISTRY_DKG_THRESHOLD_SIG_BYTES = NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES;
458
462
  var NODE_REGISTRY_DKG_RESHARE_MIN_SIGNERS = 5;
459
463
  var NODE_REGISTRY_DKG_RESHARE_MAX_SIGNERS = 7;
460
464
  var NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID = (1n << 56n) - 1n;
465
+ var NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT = 7;
466
+ var NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT = 3;
467
+ var NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT = NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT + NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT;
468
+ var NODE_REGISTRY_FORM_CLUSTER_THRESHOLD = 7;
469
+ var NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN = "PROTOCORE_NODE_REGISTRY_CLUSTER_FORM_V1\0";
461
470
  var PENDING_CHANGE_KIND_CODES = {
462
471
  add: 1,
463
472
  remove: 2,
@@ -693,6 +702,70 @@ function encodeGetClusterJoinRequestCalldata(args) {
693
702
  )
694
703
  );
695
704
  }
705
+ function formClusterMessage(activePubkeys, standbyPubkeys) {
706
+ const active = expectLength2(
707
+ toBytes(activePubkeys),
708
+ NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
709
+ "activePubkeys"
710
+ );
711
+ const standby = expectLength2(
712
+ toBytes(standbyPubkeys),
713
+ NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
714
+ "standbyPubkeys"
715
+ );
716
+ return blake3(
717
+ concatBytes(
718
+ new TextEncoder().encode(NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN),
719
+ u16BeBytes(NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT),
720
+ u16BeBytes(NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT),
721
+ u16BeBytes(NODE_REGISTRY_FORM_CLUSTER_THRESHOLD),
722
+ u32BeBytes(active.length),
723
+ active,
724
+ u32BeBytes(standby.length),
725
+ standby
726
+ )
727
+ );
728
+ }
729
+ function formClusterMessageHex(activePubkeys, standbyPubkeys) {
730
+ return bytesToHex(formClusterMessage(activePubkeys, standbyPubkeys));
731
+ }
732
+ function encodeFormClusterCalldata(args) {
733
+ const activePubkeys = expectLength2(
734
+ toBytes(args.activePubkeys),
735
+ NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
736
+ "activePubkeys"
737
+ );
738
+ const standbyPubkeys = expectLength2(
739
+ toBytes(args.standbyPubkeys),
740
+ NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT * NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES,
741
+ "standbyPubkeys"
742
+ );
743
+ const signatures = expectLength2(
744
+ toBytes(args.signatures),
745
+ NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT * NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES,
746
+ "signatures"
747
+ );
748
+ const activePadded = padToWord(activePubkeys);
749
+ const standbyPadded = padToWord(standbyPubkeys);
750
+ const signaturesPadded = padToWord(signatures);
751
+ const activeOffset = 3n * 32n;
752
+ const standbyOffset = activeOffset + 32n + BigInt(activePadded.length);
753
+ const signaturesOffset = standbyOffset + 32n + BigInt(standbyPadded.length);
754
+ return bytesToHex(
755
+ concatBytes(
756
+ hexToBytes(NODE_REGISTRY_SELECTORS.formCluster),
757
+ uint64Word(activeOffset, "activePubkeysOffset"),
758
+ uint64Word(standbyOffset, "standbyPubkeysOffset"),
759
+ uint64Word(signaturesOffset, "signaturesOffset"),
760
+ uint64Word(BigInt(activePubkeys.length), "activePubkeysLength"),
761
+ activePadded,
762
+ uint64Word(BigInt(standbyPubkeys.length), "standbyPubkeysLength"),
763
+ standbyPadded,
764
+ uint64Word(BigInt(signatures.length), "signaturesLength"),
765
+ signaturesPadded
766
+ )
767
+ );
768
+ }
696
769
  function decodeClusterJoinRequest(returnData) {
697
770
  const bytes = expectLength2(toBytes(returnData), 8 * 32, "clusterJoinRequest");
698
771
  const word = (i) => bytes.slice(i * 32, (i + 1) * 32);
@@ -796,7 +869,7 @@ function deriveClusterAnchorAddress(roster, threshold) {
796
869
  throw new NodeRegistryError("threshold must be a uint16");
797
870
  }
798
871
  const members = roster.map(
799
- (m, i) => expectLength2(toBytes(m), NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES, `roster[${i}]`)
872
+ (m, i) => expectLength2(toBytes(m), NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES, `roster[${i}]`)
800
873
  );
801
874
  members.sort(compareBytes);
802
875
  const parts = [
@@ -861,6 +934,16 @@ function u64BeBytes(value) {
861
934
  }
862
935
  return out;
863
936
  }
937
+ function u32BeBytes(value) {
938
+ const n = expectUint32(value, "uint32");
939
+ return Uint8Array.from([n >>> 24 & 255, n >>> 16 & 255, n >>> 8 & 255, n & 255]);
940
+ }
941
+ function u16BeBytes(value) {
942
+ if (!Number.isInteger(value) || value < 0 || value > 65535) {
943
+ throw new NodeRegistryError("uint16 value out of range");
944
+ }
945
+ return Uint8Array.from([value >>> 8 & 255, value & 255]);
946
+ }
864
947
  function compareBytes(a, b) {
865
948
  const len = Math.min(a.length, b.length);
866
949
  for (let i = 0; i < len; i++) {
@@ -1057,59 +1140,6 @@ function parseBigint(value, label) {
1057
1140
  return BigInt(value);
1058
1141
  }
1059
1142
 
1060
- // src/crypto/submission.ts
1061
- async function fetchEncryptionKey(client) {
1062
- const result = await client.call(
1063
- "lyth_getEncryptionKey",
1064
- []
1065
- );
1066
- return {
1067
- algo: result.algo ?? "ml-kem-768",
1068
- epoch: typeof result.epoch === "string" ? BigInt(result.epoch) : BigInt(result.epoch),
1069
- encapsulationKey: hexToBytes2(result.encapsulationKey, "encapsulationKey")
1070
- };
1071
- }
1072
- var ENCRYPTED_SUBMISSION_UNAVAILABLE_MESSAGE = "encrypted mempool submission unavailable until MB-3 threshold decryption is active";
1073
- async function buildEncryptedSubmission(_args) {
1074
- await Promise.resolve();
1075
- throw new Error(ENCRYPTED_SUBMISSION_UNAVAILABLE_MESSAGE);
1076
- }
1077
- async function submitEncryptedEnvelope(client, envelopeWireHex) {
1078
- return client.call("lyth_submitEncrypted", [envelopeWireHex]);
1079
- }
1080
- function buildPlaintextSubmission(args) {
1081
- const signed = args.backend.signEvmTx(args.tx);
1082
- return {
1083
- signedTxWireHex: `0x${signed.wireHex}`,
1084
- innerTxHashHex: bytesToHex2(signed.txHash),
1085
- innerSighashHex: bytesToHex2(signed.sighash),
1086
- innerWireBytes: signed.wireBytes.length
1087
- };
1088
- }
1089
- async function submitPlaintextTransaction(client, signedTxWireHex, expectedTxHashHex) {
1090
- const returned = await client.call("mesh_submitTx", [signedTxWireHex]);
1091
- const returnedBytes = hexToBytes2(returned, "mesh_submitTx tx hash");
1092
- if (returnedBytes.length !== 32) {
1093
- throw new Error(
1094
- `mesh_submitTx tx hash must be 32 bytes, got ${returnedBytes.length}`
1095
- );
1096
- }
1097
- const expectedBytes = hexToBytes2(expectedTxHashHex, "expected tx hash");
1098
- if (!bytesEqual(returnedBytes, expectedBytes)) {
1099
- throw new Error(
1100
- `mesh_submitTx returned tx hash ${bytesToHex2(returnedBytes)} but the locally computed canonical hash is ${bytesToHex2(expectedBytes)}`
1101
- );
1102
- }
1103
- return bytesToHex2(returnedBytes);
1104
- }
1105
- function bytesEqual(a, b) {
1106
- if (a.length !== b.length) return false;
1107
- for (let i = 0; i < a.length; i++) {
1108
- if (a[i] !== b[i]) return false;
1109
- }
1110
- return true;
1111
- }
1112
-
1113
1143
  // src/crypto/bincode.ts
1114
1144
  var BincodeWriter = class {
1115
1145
  #chunks = [];
@@ -1157,17 +1187,656 @@ var BincodeWriter = class {
1157
1187
  this.#chunks.push(value >> 8 * i & 255);
1158
1188
  }
1159
1189
  }
1160
- #big(value, bytes) {
1161
- let v = typeof value === "bigint" ? value : BigInt(value);
1162
- if (v < 0n || v >= 1n << BigInt(bytes * 8)) {
1163
- throw new Error(`integer out of u${bytes * 8} range`);
1164
- }
1165
- for (let i = 0; i < bytes; i++) {
1166
- this.#chunks.push(Number(v & 0xffn));
1167
- v >>= 8n;
1168
- }
1190
+ #big(value, bytes) {
1191
+ let v = typeof value === "bigint" ? value : BigInt(value);
1192
+ if (v < 0n || v >= 1n << BigInt(bytes * 8)) {
1193
+ throw new Error(`integer out of u${bytes * 8} range`);
1194
+ }
1195
+ for (let i = 0; i < bytes; i++) {
1196
+ this.#chunks.push(Number(v & 0xffn));
1197
+ v >>= 8n;
1198
+ }
1199
+ }
1200
+ };
1201
+
1202
+ // src/crypto/tx.ts
1203
+ function encodeTransactionForHash(fields, tag) {
1204
+ const n = normalizeTxFields(fields);
1205
+ return concatBytes2(
1206
+ Uint8Array.of(tag),
1207
+ bigintToBeBytes(n.chainId, 8, "chainId"),
1208
+ bigintToBeBytes(n.nonce, 8, "nonce"),
1209
+ bigintToBeBytes(n.maxPriorityFeePerGas, 32, "maxPriorityFeePerGas"),
1210
+ bigintToBeBytes(n.maxFeePerGas, 32, "maxFeePerGas"),
1211
+ bigintToBeBytes(n.gasLimit, 8, "gasLimit"),
1212
+ n.to === null ? Uint8Array.of(0) : concatBytes2(Uint8Array.of(1), n.to),
1213
+ bigintToBeBytes(n.value, 32, "value"),
1214
+ bigintToBeBytes(BigInt(n.input.length), 4, "input.length"),
1215
+ n.input,
1216
+ new Uint8Array(4),
1217
+ // access_list length
1218
+ encodeExtensionsForHash(n.extensions)
1219
+ );
1220
+ }
1221
+ function bincodeSignedTransaction(fields, signature, publicKey) {
1222
+ const n = normalizeTxFields(fields);
1223
+ const sig = expectBytes(signature, ML_DSA_65_SIGNATURE_LEN, "ML-DSA-65 signature");
1224
+ const pk = expectBytes(publicKey, ML_DSA_65_PUBLIC_KEY_LEN, "ML-DSA-65 public key");
1225
+ const w = new BincodeWriter();
1226
+ w.u64(n.chainId);
1227
+ w.u64(n.nonce);
1228
+ w.bytes(uint256Be(n.maxPriorityFeePerGas, "maxPriorityFeePerGas"));
1229
+ w.bytes(uint256Be(n.maxFeePerGas, "maxFeePerGas"));
1230
+ w.u64(n.gasLimit);
1231
+ if (n.to === null) {
1232
+ w.u8(0);
1233
+ } else {
1234
+ w.u8(1);
1235
+ w.bytes(n.to);
1236
+ }
1237
+ w.bytes(uint256Be(n.value, "value"));
1238
+ w.bytes(n.input);
1239
+ w.u64(0n);
1240
+ w.u64(BigInt(n.extensions.length));
1241
+ for (const ext of n.extensions) bincodeTypedExtensionInto(w, ext);
1242
+ bincodeMlDsa65OpaqueInto(w, sig);
1243
+ bincodeMlDsa65OpaqueInto(w, pk);
1244
+ return w.toBytes();
1245
+ }
1246
+ function normalizeTxFields(fields) {
1247
+ return {
1248
+ chainId: parseBigint(fields.chainId, "chainId"),
1249
+ nonce: parseBigint(fields.nonce, "nonce"),
1250
+ maxPriorityFeePerGas: parseBigint(fields.maxPriorityFeePerGas, "maxPriorityFeePerGas"),
1251
+ maxFeePerGas: parseBigint(fields.maxFeePerGas, "maxFeePerGas"),
1252
+ gasLimit: parseBigint(fields.gasLimit, "gasLimit"),
1253
+ to: normalizeTo(fields.to),
1254
+ value: parseBigint(fields.value, "value"),
1255
+ input: normalizeBytes(fields.input ?? new Uint8Array(0), "input"),
1256
+ extensions: normalizeExtensions(fields.extensions)
1257
+ };
1258
+ }
1259
+ function normalizeTo(value) {
1260
+ if (value === null) return null;
1261
+ const bytes = normalizeBytes(value, "to");
1262
+ return expectBytes(bytes, 20, "to");
1263
+ }
1264
+ function normalizeBytes(value, label) {
1265
+ if (typeof value === "string") return hexToBytes2(value, label);
1266
+ return value instanceof Uint8Array ? value : Uint8Array.from(value);
1267
+ }
1268
+ function normalizeExtensions(value) {
1269
+ if (value === void 0) return [];
1270
+ return value.map((ext, index) => {
1271
+ if (!Number.isInteger(ext.kind) || ext.kind < 0 || ext.kind > 255) {
1272
+ throw new Error(`extensions[${index}].kind out of u8 range`);
1273
+ }
1274
+ const body = normalizeBytes("bodyHex" in ext ? ext.bodyHex : ext.body, `extensions[${index}].body`);
1275
+ if (body.length > 4294967295) {
1276
+ throw new Error(`extensions[${index}].body exceeds u32 length`);
1277
+ }
1278
+ return { kind: ext.kind, body };
1279
+ });
1280
+ }
1281
+ function encodeExtensionsForHash(extensions) {
1282
+ const chunks = [bigintToBeBytes(BigInt(extensions.length), 4, "extensions.length")];
1283
+ for (const ext of extensions) {
1284
+ chunks.push(
1285
+ Uint8Array.of(ext.kind),
1286
+ bigintToBeBytes(BigInt(ext.body.length), 4, "extension.body.length"),
1287
+ ext.body
1288
+ );
1289
+ }
1290
+ return concatBytes2(...chunks);
1291
+ }
1292
+ function uint256Be(value, label) {
1293
+ if (value < 0n || value >= 1n << 256n) throw new Error(`${label} out of u256 range`);
1294
+ const out = new Uint8Array(32);
1295
+ let v = value;
1296
+ for (let i = 31; i >= 0; i--) {
1297
+ out[i] = Number(v & 0xffn);
1298
+ v >>= 8n;
1299
+ }
1300
+ return out;
1301
+ }
1302
+ function bincodeMlDsa65OpaqueInto(w, raw) {
1303
+ w.enumVariant(ENUM_VARIANT_INDEX_ML_DSA_65);
1304
+ w.u16(STANDARD_ALGO_NUMBER_ML_DSA_65);
1305
+ w.bytes(raw);
1306
+ }
1307
+ function bincodeTypedExtensionInto(w, ext) {
1308
+ w.u8(ext.kind);
1309
+ w.bytes(ext.body);
1310
+ }
1311
+
1312
+ // src/crypto/ml-dsa.ts
1313
+ var ML_DSA_65_SEED_LEN = 32;
1314
+ var ML_DSA_65_SIGNING_KEY_LEN = 4032;
1315
+ var ML_DSA_65_PUBLIC_KEY_LEN = 1952;
1316
+ var ML_DSA_65_SIGNATURE_LEN = 3309;
1317
+ var STANDARD_ALGO_NUMBER_ML_DSA_65 = 1001;
1318
+ var ENUM_VARIANT_INDEX_ML_DSA_65 = 5;
1319
+ var ADDRESS_DERIVATION_DOMAIN = "MONO_ADDRESS_BLAKE3_20_V1";
1320
+ var ADDRESS_DERIVATION_DOMAIN_BYTES = new TextEncoder().encode(ADDRESS_DERIVATION_DOMAIN);
1321
+ var MlDsa65Backend = class _MlDsa65Backend {
1322
+ #secretKey;
1323
+ #publicKey;
1324
+ #addressBytes;
1325
+ constructor(secretKey, publicKey) {
1326
+ this.#secretKey = expectBytes(secretKey, ML_DSA_65_SIGNING_KEY_LEN, "ML-DSA-65 secret key").slice();
1327
+ this.#publicKey = expectBytes(publicKey, ML_DSA_65_PUBLIC_KEY_LEN, "ML-DSA-65 public key").slice();
1328
+ this.#addressBytes = mlDsa65AddressBytes(this.#publicKey);
1329
+ }
1330
+ static fromSeed(seed) {
1331
+ const kp = ml_dsa65.keygen(expectBytes(seed, ML_DSA_65_SEED_LEN, "ML-DSA-65 seed"));
1332
+ return new _MlDsa65Backend(kp.secretKey, kp.publicKey);
1333
+ }
1334
+ publicKey() {
1335
+ return this.#publicKey.slice();
1336
+ }
1337
+ addressBytes() {
1338
+ return this.#addressBytes.slice();
1339
+ }
1340
+ getAddress() {
1341
+ return bytesToHex2(this.#addressBytes);
1342
+ }
1343
+ sign(message) {
1344
+ return ml_dsa65.sign(message, this.#secretKey, { extraEntropy: false });
1345
+ }
1346
+ signPrehash(digest) {
1347
+ return this.sign(expectBytes(digest, 32, "prehash"));
1348
+ }
1349
+ verify(message, signature) {
1350
+ return ml_dsa65.verify(
1351
+ expectBytes(signature, ML_DSA_65_SIGNATURE_LEN, "ML-DSA-65 signature"),
1352
+ message,
1353
+ this.#publicKey
1354
+ );
1355
+ }
1356
+ signEvmTx(fields) {
1357
+ const txHashPreimage = encodeTransactionForHash(fields, 1);
1358
+ const sighash = keccak_256(txHashPreimage);
1359
+ const signature = this.sign(sighash);
1360
+ const wireBytes = bincodeSignedTransaction(fields, signature, this.#publicKey);
1361
+ const txHash = keccak_256(
1362
+ concatBytes2(
1363
+ encodeTransactionForHash(fields, 2),
1364
+ signature,
1365
+ this.#publicKey
1366
+ )
1367
+ );
1368
+ return {
1369
+ wireHex: bytesToHex2(wireBytes).slice(2),
1370
+ wireBytes,
1371
+ sighash,
1372
+ txHash
1373
+ };
1374
+ }
1375
+ };
1376
+ function mlDsa65AddressFromPublicKey(publicKey) {
1377
+ return bytesToHex2(mlDsa65AddressBytes(publicKey));
1378
+ }
1379
+ function mlDsa65AddressBytes(publicKey) {
1380
+ const bytes = expectBytes(publicKey, ML_DSA_65_PUBLIC_KEY_LEN, "ML-DSA-65 public key");
1381
+ return blake3(concatBytes2(
1382
+ ADDRESS_DERIVATION_DOMAIN_BYTES,
1383
+ bigintToBeBytes(BigInt(STANDARD_ALGO_NUMBER_ML_DSA_65), 2, "ML-DSA-65 algo id"),
1384
+ bytes
1385
+ )).slice(0, 20);
1386
+ }
1387
+
1388
+ // src/crypto/envelope.ts
1389
+ new TextEncoder().encode("protocore/v2/mempool/dkg-mlkem768/1");
1390
+ var MempoolClass = {
1391
+ Transfer: 0,
1392
+ ContractCall: 1,
1393
+ CLOBOp: 3};
1394
+ function bincodeNonceAad(aad) {
1395
+ const w = new BincodeWriter();
1396
+ w.bytes(expectBytes(aad.sender, 20, "NonceAad.sender"));
1397
+ w.u64(aad.nonce);
1398
+ w.u64(aad.chainId);
1399
+ w.enumVariant(aad.class);
1400
+ w.u128(aad.maxFeePerGas);
1401
+ w.u128(aad.maxPriorityFeePerGas);
1402
+ w.u64(aad.gasLimit);
1403
+ return w.toBytes();
1404
+ }
1405
+ function bincodeDecryptHint(hint) {
1406
+ const w = new BincodeWriter();
1407
+ w.u64(hint.epoch);
1408
+ w.u16(hint.scheme);
1409
+ return w.toBytes();
1410
+ }
1411
+ function bincodeEncryptedEnvelope(env) {
1412
+ const w = new BincodeWriter();
1413
+ w.rawBytes(bincodeNonceAad(env.nonceAad));
1414
+ w.bytes(env.ciphertext);
1415
+ w.rawBytes(bincodeDecryptHint(env.decryptionHint));
1416
+ bincodeMlDsa65OpaqueInto2(w, expectBytes(env.senderPubkey, ML_DSA_65_PUBLIC_KEY_LEN, "senderPubkey"));
1417
+ bincodeMlDsa65OpaqueInto2(w, expectBytes(env.outerSignature, ML_DSA_65_SIGNATURE_LEN, "outerSignature"));
1418
+ w.bytes(expectBytes(env.sender, 20, "sender"));
1419
+ return w.toBytes();
1420
+ }
1421
+ function outerSigDigest(nonceAad, ciphertext, decryptionHint, senderPubkey) {
1422
+ const aad = bincodeNonceAad(nonceAad);
1423
+ const hint = bincodeDecryptHint(decryptionHint);
1424
+ return keccak_256(concatBytes2(aad, ciphertext, hint, expectBytes(senderPubkey, ML_DSA_65_PUBLIC_KEY_LEN, "senderPubkey")));
1425
+ }
1426
+ function bincodeMlDsa65OpaqueInto2(w, raw) {
1427
+ w.enumVariant(ENUM_VARIANT_INDEX_ML_DSA_65);
1428
+ w.u16(STANDARD_ALGO_NUMBER_ML_DSA_65);
1429
+ w.bytes(raw);
1430
+ }
1431
+ var SEAL_EK_LEN = 1184;
1432
+ var SEAL_KEY_LEN = 32;
1433
+ var SEAL_NONCE_LEN = 12;
1434
+ var SEAL_COMMIT_LEN = 32;
1435
+ var SEAL_SECRET_LEN = 32;
1436
+ var SEAL_SHARE_LEN = 1 + SEAL_SECRET_LEN;
1437
+ var CLUSTER_MLKEM_SHAMIR = 3;
1438
+ var COMMIT_DOMAIN = new TextEncoder().encode("lythiumseal/commit/v1");
1439
+ var KEK_DOMAIN = new TextEncoder().encode("lythiumseal/kek/v1");
1440
+ var NONCE_DOMAIN = new TextEncoder().encode("lythiumseal/nonce/v1");
1441
+ var BODY_AAD_DOMAIN = new TextEncoder().encode("lythiumseal/body/v1");
1442
+ var SHARE_AAD_DOMAIN = new TextEncoder().encode("lythiumseal/share/v1");
1443
+ var ROSTER_DOMAIN = new TextEncoder().encode("lythiumseal/roster/v1");
1444
+ function cryptoRandomSource() {
1445
+ return {
1446
+ fillBytes(dest) {
1447
+ crypto.getRandomValues(dest);
1448
+ }
1449
+ };
1450
+ }
1451
+ function u32le(n) {
1452
+ const out = new Uint8Array(4);
1453
+ out[0] = n & 255;
1454
+ out[1] = n >>> 8 & 255;
1455
+ out[2] = n >>> 16 & 255;
1456
+ out[3] = n >>> 24 & 255;
1457
+ return out;
1458
+ }
1459
+ function u64le(n) {
1460
+ const out = new Uint8Array(8);
1461
+ let v = n;
1462
+ for (let i = 0; i < 8; i++) {
1463
+ out[i] = Number(v & 0xffn);
1464
+ v >>= 8n;
1465
+ }
1466
+ return out;
1467
+ }
1468
+ function framed(field2) {
1469
+ return concatBytes2(u32le(field2.length), field2);
1470
+ }
1471
+ function keyCommitment(key) {
1472
+ return shake256(concatBytes2(framed(COMMIT_DOMAIN), key), { dkLen: SEAL_COMMIT_LEN });
1473
+ }
1474
+ function deriveKek(sharedSecret, domain, clusterId, epoch, opIndex) {
1475
+ const input = concatBytes2(
1476
+ framed(KEK_DOMAIN),
1477
+ framed(sharedSecret),
1478
+ framed(domain),
1479
+ u32le(clusterId),
1480
+ u64le(epoch),
1481
+ Uint8Array.of(opIndex)
1482
+ );
1483
+ return shake256(input, { dkLen: SEAL_KEY_LEN });
1484
+ }
1485
+ function deriveNonce(domain, context) {
1486
+ const input = concatBytes2(framed(NONCE_DOMAIN), framed(domain), framed(context));
1487
+ return shake256(input, { dkLen: SEAL_NONCE_LEN });
1488
+ }
1489
+ function bodyAad(ctx, k, n) {
1490
+ return concatBytes2(
1491
+ BODY_AAD_DOMAIN,
1492
+ u32le(ctx.clusterId),
1493
+ u64le(ctx.epoch),
1494
+ Uint8Array.of(k),
1495
+ Uint8Array.of(n),
1496
+ ctx.rosterHash
1497
+ );
1498
+ }
1499
+ function shareAad(ctx, opIndex) {
1500
+ return concatBytes2(
1501
+ SHARE_AAD_DOMAIN,
1502
+ u32le(ctx.clusterId),
1503
+ u64le(ctx.epoch),
1504
+ Uint8Array.of(opIndex),
1505
+ ctx.rosterHash
1506
+ );
1507
+ }
1508
+ function aeadSeal(key, nonce, plaintext, aad) {
1509
+ const cipher = chacha20poly1305(key, nonce, aad);
1510
+ const ct = cipher.encrypt(plaintext);
1511
+ return { nonce, ct, commitment: keyCommitment(key) };
1512
+ }
1513
+ function gfMul(a, b) {
1514
+ let product = 0;
1515
+ let x = a & 255;
1516
+ let y = b & 255;
1517
+ for (let i = 0; i < 8; i++) {
1518
+ const mask = -(y & 1) & 255;
1519
+ product ^= x & mask;
1520
+ const high = -(x >> 7 & 1) & 255;
1521
+ x = x << 1 & 255;
1522
+ x ^= 27 & high;
1523
+ y >>= 1;
1524
+ }
1525
+ return product & 255;
1526
+ }
1527
+ function polyEval(coeffs, x) {
1528
+ let acc = 0;
1529
+ for (let i = coeffs.length - 1; i >= 0; i--) {
1530
+ acc = gfMul(acc, x) ^ coeffs[i];
1531
+ }
1532
+ return acc & 255;
1533
+ }
1534
+ function shamirSplit(secret, t, n, rng) {
1535
+ const byteCoeffs = [];
1536
+ for (let j = 0; j < SEAL_SECRET_LEN; j++) {
1537
+ const c = new Uint8Array(t);
1538
+ c[0] = secret[j];
1539
+ if (t > 1) {
1540
+ const tail = new Uint8Array(t - 1);
1541
+ rng.fillBytes(tail);
1542
+ c.set(tail, 1);
1543
+ }
1544
+ byteCoeffs.push(c);
1545
+ }
1546
+ const shares = [];
1547
+ for (let k = 0; k < n; k++) {
1548
+ const x = k + 1 & 255;
1549
+ const value = new Uint8Array(SEAL_SECRET_LEN);
1550
+ for (let j = 0; j < SEAL_SECRET_LEN; j++) {
1551
+ value[j] = polyEval(byteCoeffs[j], x);
1552
+ }
1553
+ shares.push({ index: x, value });
1554
+ }
1555
+ return shares;
1556
+ }
1557
+ function shareToBytes(s) {
1558
+ const out = new Uint8Array(SEAL_SHARE_LEN);
1559
+ out[0] = s.index;
1560
+ out.set(s.value, 1);
1561
+ return out;
1562
+ }
1563
+ function sealRosterHash(keccak2562, clusterId, t, n, roster) {
1564
+ const chunks = [ROSTER_DOMAIN, u32le(clusterId), Uint8Array.of(t), Uint8Array.of(n)];
1565
+ for (const { operatorIndex, ek } of roster) {
1566
+ chunks.push(Uint8Array.of(operatorIndex), ek);
1567
+ }
1568
+ return keccak2562(concatBytes2(...chunks));
1569
+ }
1570
+ function encodeSealEnvelope(env) {
1571
+ const chunks = [];
1572
+ chunks.push(u32le(env.clusterId));
1573
+ chunks.push(u64le(env.epoch));
1574
+ chunks.push(expectBytes(env.rosterHash, 32, "rosterHash"));
1575
+ chunks.push(Uint8Array.of(env.t));
1576
+ chunks.push(Uint8Array.of(env.n));
1577
+ pushAeadBody(chunks, env.aeadBody);
1578
+ chunks.push(u64le(BigInt(env.recipients.length)));
1579
+ for (const r of env.recipients) {
1580
+ chunks.push(Uint8Array.of(r.operatorIndex));
1581
+ chunks.push(u64le(BigInt(r.kemCt.length)));
1582
+ chunks.push(r.kemCt);
1583
+ pushAeadBody(chunks, r.wrapped);
1584
+ }
1585
+ return concatBytes2(...chunks);
1586
+ }
1587
+ function pushAeadBody(chunks, body) {
1588
+ chunks.push(expectBytes(body.nonce, SEAL_NONCE_LEN, "aead nonce"));
1589
+ chunks.push(u64le(BigInt(body.ct.length)));
1590
+ chunks.push(body.ct);
1591
+ chunks.push(expectBytes(body.commitment, SEAL_COMMIT_LEN, "aead commitment"));
1592
+ }
1593
+ function sealToCluster(args) {
1594
+ const { plaintext, recipientEks, t, clusterId } = args;
1595
+ const epoch = args.epoch;
1596
+ const rosterHash = expectBytes(args.rosterHash, 32, "rosterHash");
1597
+ const rng = args.rng ?? cryptoRandomSource();
1598
+ const n = recipientEks.length;
1599
+ if (!Number.isInteger(t) || t < 1 || t > n || n < 1 || n > 255) {
1600
+ throw new Error(`invalid threshold/recipient count: t=${t} n=${n}`);
1601
+ }
1602
+ for (let i = 0; i < n; i++) {
1603
+ expectBytes(recipientEks[i], SEAL_EK_LEN, `recipientEks[${i}]`);
1604
+ }
1605
+ const ctx = { clusterId, epoch, rosterHash };
1606
+ const bodyKey = new Uint8Array(SEAL_KEY_LEN);
1607
+ rng.fillBytes(bodyKey);
1608
+ const aad = bodyAad(ctx, t, n);
1609
+ const bodyNonce = deriveNonce(new TextEncoder().encode("body"), aad);
1610
+ const aeadBody = aeadSeal(bodyKey, bodyNonce, plaintext, aad);
1611
+ const shares = shamirSplit(bodyKey, t, n, rng);
1612
+ const recipients = [];
1613
+ for (let i = 0; i < n; i++) {
1614
+ const opIndex = i + 1 & 255;
1615
+ const m = new Uint8Array(32);
1616
+ rng.fillBytes(m);
1617
+ const { cipherText: kemCt, sharedSecret } = ml_kem768.encapsulate(recipientEks[i], m);
1618
+ const kek = deriveKek(sharedSecret, rosterHash, clusterId, epoch, opIndex);
1619
+ const sAad = shareAad(ctx, opIndex);
1620
+ const wrapNonce = deriveNonce(new TextEncoder().encode("share"), sAad);
1621
+ const wrapped = aeadSeal(kek, wrapNonce, shareToBytes(shares[i]), sAad);
1622
+ recipients.push({ operatorIndex: opIndex, kemCt, wrapped });
1623
+ sharedSecret.fill(0);
1624
+ kek.fill(0);
1625
+ }
1626
+ bodyKey.fill(0);
1627
+ return {
1628
+ clusterId,
1629
+ epoch,
1630
+ rosterHash,
1631
+ t,
1632
+ n,
1633
+ aeadBody,
1634
+ recipients
1635
+ };
1636
+ }
1637
+
1638
+ // src/crypto/seal.ts
1639
+ var CLUSTER_MLKEM_SHAMIR_ALGO = "cluster-mlkem768-shamir";
1640
+ function parseClusterSealKeys(source) {
1641
+ const n = source.roster.length;
1642
+ if (n === 0) {
1643
+ throw new Error("cluster seal roster is empty");
1644
+ }
1645
+ if (source.n !== n) {
1646
+ throw new Error(`cluster seal roster n=${source.n} disagrees with ${n} entries`);
1647
+ }
1648
+ if (!Number.isInteger(source.t) || source.t < 2 || source.t > n) {
1649
+ throw new Error(`cluster seal threshold t=${source.t} out of range 2..=${n}`);
1650
+ }
1651
+ const sorted = [...source.roster].sort((a, b) => a.operatorIndex - b.operatorIndex);
1652
+ const recipientEks = [];
1653
+ const hashInput = [];
1654
+ for (let i = 0; i < n; i++) {
1655
+ const entry = sorted[i];
1656
+ if (entry.operatorIndex !== i + 1) {
1657
+ throw new Error(
1658
+ `cluster seal roster operator indices must be 1..=${n}; got ${entry.operatorIndex} at slot ${i + 1}`
1659
+ );
1660
+ }
1661
+ const ek = expectBytes(hexToBytes2(entry.mlKemEk, `operator ${entry.operatorIndex} mlKemEk`), SEAL_EK_LEN, `operator ${entry.operatorIndex} ek`);
1662
+ recipientEks.push(ek);
1663
+ hashInput.push({ operatorIndex: entry.operatorIndex, ek });
1664
+ }
1665
+ const recomputed = sealRosterHash(keccak256, source.clusterId, source.t, n, hashInput);
1666
+ if (source.rosterHash !== void 0) {
1667
+ const supplied = expectBytes(hexToBytes2(source.rosterHash, "rosterHash"), 32, "rosterHash");
1668
+ if (!bytesEqual(supplied, recomputed)) {
1669
+ throw new Error(
1670
+ `cluster seal roster hash mismatch: source ${bytesToHex2(supplied)} != recomputed ${bytesToHex2(recomputed)} (the roster hash does not commit to this ek set)`
1671
+ );
1672
+ }
1673
+ }
1674
+ return {
1675
+ algo: source.algo ?? CLUSTER_MLKEM_SHAMIR_ALGO,
1676
+ clusterId: source.clusterId,
1677
+ epoch: toBigInt(source.epoch),
1678
+ rosterHash: recomputed,
1679
+ t: source.t,
1680
+ n,
1681
+ recipientEks
1682
+ };
1683
+ }
1684
+ async function sealTransaction(args) {
1685
+ const keys = args.clusterSealKeys;
1686
+ const senderPubkey = expectBytes(args.senderPubkey, ML_DSA_65_PUBLIC_KEY_LEN, "senderPubkey");
1687
+ const senderAddress = expectBytes(args.senderAddress, 20, "senderAddress");
1688
+ const env = sealToCluster({
1689
+ plaintext: args.signedTxBincode,
1690
+ recipientEks: keys.recipientEks,
1691
+ t: keys.t,
1692
+ clusterId: keys.clusterId,
1693
+ epoch: keys.epoch,
1694
+ rosterHash: keys.rosterHash,
1695
+ rng: args.rng
1696
+ });
1697
+ const ciphertext = encodeSealEnvelope(env);
1698
+ const decryptionHint = { epoch: keys.epoch, scheme: CLUSTER_MLKEM_SHAMIR };
1699
+ const digest = outerSigDigest(args.aad, ciphertext, decryptionHint, senderPubkey);
1700
+ const outerSignature = expectBytes(
1701
+ await args.signOuterDigest(digest),
1702
+ ML_DSA_65_SIGNATURE_LEN,
1703
+ "outerSignature"
1704
+ );
1705
+ const envelope = {
1706
+ nonceAad: args.aad,
1707
+ ciphertext,
1708
+ decryptionHint,
1709
+ senderPubkey,
1710
+ outerSignature,
1711
+ sender: senderAddress
1712
+ };
1713
+ const envelopeWireBytes = bincodeEncryptedEnvelope(envelope);
1714
+ return {
1715
+ envelopeWireHex: `0x${bytesToHex2(envelopeWireBytes).slice(2)}`,
1716
+ envelopeWireBytes,
1717
+ ciphertextBytes: ciphertext.length
1718
+ };
1719
+ }
1720
+ function keccak256(input) {
1721
+ return keccak_256(input);
1722
+ }
1723
+ function toBigInt(value) {
1724
+ if (typeof value === "bigint") return value;
1725
+ return BigInt(value);
1726
+ }
1727
+ function bytesEqual(a, b) {
1728
+ if (a.length !== b.length) return false;
1729
+ for (let i = 0; i < a.length; i++) {
1730
+ if (a[i] !== b[i]) return false;
1731
+ }
1732
+ return true;
1733
+ }
1734
+
1735
+ // src/crypto/submission.ts
1736
+ async function fetchEncryptionKey(client) {
1737
+ const result = await client.call(
1738
+ "lyth_getEncryptionKey",
1739
+ []
1740
+ );
1741
+ return {
1742
+ algo: result.algo ?? "ml-kem-768",
1743
+ epoch: typeof result.epoch === "string" ? BigInt(result.epoch) : BigInt(result.epoch),
1744
+ encapsulationKey: hexToBytes2(result.encapsulationKey, "encapsulationKey")
1745
+ };
1746
+ }
1747
+ var ENCRYPTED_SUBMISSION_UNAVAILABLE_MESSAGE = "private submission requires cluster seal keys; pass clusterSealKeysSource or enable lyth_getClusterSealKeys";
1748
+ async function buildEncryptedSubmission(args) {
1749
+ const signed = args.backend.signEvmTx(args.tx);
1750
+ const clusterSealKeys = await resolveClusterSealKeys(args);
1751
+ const aad = nonceAadForTx(args.tx, args.backend.addressBytes(), args.class);
1752
+ const sealed = await sealTransaction({
1753
+ signedTxBincode: signed.wireBytes,
1754
+ clusterSealKeys,
1755
+ aad,
1756
+ senderAddress: args.backend.addressBytes(),
1757
+ senderPubkey: args.backend.publicKey(),
1758
+ signOuterDigest: (digest) => args.backend.signPrehash(digest)
1759
+ });
1760
+ return {
1761
+ envelopeWireHex: sealed.envelopeWireHex,
1762
+ innerSighashHex: bytesToHex2(signed.sighash),
1763
+ innerTxHashHex: bytesToHex2(signed.txHash),
1764
+ innerWireBytes: signed.wireBytes.length
1765
+ };
1766
+ }
1767
+ async function submitEncryptedEnvelope(client, envelopeWireHex) {
1768
+ return client.call("lyth_submitEncrypted", [envelopeWireHex]);
1769
+ }
1770
+ function buildPlaintextSubmission(args) {
1771
+ const signed = args.backend.signEvmTx(args.tx);
1772
+ return {
1773
+ signedTxWireHex: `0x${signed.wireHex}`,
1774
+ innerTxHashHex: bytesToHex2(signed.txHash),
1775
+ innerSighashHex: bytesToHex2(signed.sighash),
1776
+ innerWireBytes: signed.wireBytes.length
1777
+ };
1778
+ }
1779
+ async function submitPlaintextTransaction(client, signedTxWireHex, expectedTxHashHex) {
1780
+ const returned = await client.call("mesh_submitTx", [signedTxWireHex]);
1781
+ const returnedBytes = hexToBytes2(returned, "mesh_submitTx tx hash");
1782
+ if (returnedBytes.length !== 32) {
1783
+ throw new Error(
1784
+ `mesh_submitTx tx hash must be 32 bytes, got ${returnedBytes.length}`
1785
+ );
1786
+ }
1787
+ const expectedBytes = hexToBytes2(expectedTxHashHex, "expected tx hash");
1788
+ if (!bytesEqual2(returnedBytes, expectedBytes)) {
1789
+ throw new Error(
1790
+ `mesh_submitTx returned tx hash ${bytesToHex2(returnedBytes)} but the locally computed canonical hash is ${bytesToHex2(expectedBytes)}`
1791
+ );
1792
+ }
1793
+ return bytesToHex2(returnedBytes);
1794
+ }
1795
+ function bytesEqual2(a, b) {
1796
+ if (a.length !== b.length) return false;
1797
+ for (let i = 0; i < a.length; i++) {
1798
+ if (a[i] !== b[i]) return false;
1799
+ }
1800
+ return true;
1801
+ }
1802
+ async function resolveClusterSealKeys(args) {
1803
+ if (args.clusterSealKeys !== void 0) return args.clusterSealKeys;
1804
+ if (args.clusterSealKeysSource !== void 0) {
1805
+ return parseClusterSealKeys(args.clusterSealKeysSource);
1806
+ }
1807
+ if (args.client === void 0) {
1808
+ throw new Error(ENCRYPTED_SUBMISSION_UNAVAILABLE_MESSAGE);
1169
1809
  }
1170
- };
1810
+ const clusterId = args.clusterId ?? 0;
1811
+ const result = await args.client.call(
1812
+ "lyth_getClusterSealKeys",
1813
+ [clusterId]
1814
+ );
1815
+ return parseClusterSealKeys({ ...result, clusterId: result.clusterId ?? clusterId });
1816
+ }
1817
+ function nonceAadForTx(tx, sender, mempoolClass) {
1818
+ return {
1819
+ sender,
1820
+ nonce: parseBigint(tx.nonce, "nonce"),
1821
+ chainId: parseBigint(tx.chainId, "chainId"),
1822
+ class: mempoolClass ?? inferMempoolClass(tx),
1823
+ maxFeePerGas: parseBigint(tx.maxFeePerGas, "maxFeePerGas"),
1824
+ maxPriorityFeePerGas: parseBigint(tx.maxPriorityFeePerGas, "maxPriorityFeePerGas"),
1825
+ gasLimit: parseBigint(tx.gasLimit, "gasLimit")
1826
+ };
1827
+ }
1828
+ function inferMempoolClass(tx) {
1829
+ if (tx.to === null || hasInput(tx.input)) return MempoolClass.ContractCall;
1830
+ return MempoolClass.Transfer;
1831
+ }
1832
+ function hasInput(input) {
1833
+ if (input === void 0) return false;
1834
+ if (typeof input === "string") {
1835
+ const stripped = input.startsWith("0x") || input.startsWith("0X") ? input.slice(2) : input;
1836
+ return stripped.length > 0;
1837
+ }
1838
+ return input.length > 0;
1839
+ }
1171
1840
 
1172
1841
  // src/mrv.ts
1173
1842
  var MRV_FORMAT_VERSION = 1;
@@ -1670,6 +2339,7 @@ async function submitMrvCallNativeTx(client, backend, contractAddress, input, op
1670
2339
  }
1671
2340
  async function submitMrvEncryptedNativeTxGated(client, backend, plan, options) {
1672
2341
  const submission = await buildEncryptedSubmission({
2342
+ backend,
1673
2343
  tx: plan.tx,
1674
2344
  encryptionKey: options.encryptionKey ?? await fetchEncryptionKey(client),
1675
2345
  class: options.class
@@ -2027,192 +2697,6 @@ function isIdentifier(value) {
2027
2697
  return /^[a-z][a-z0-9_]*$/.test(value);
2028
2698
  }
2029
2699
 
2030
- // src/crypto/tx.ts
2031
- function encodeTransactionForHash(fields, tag) {
2032
- const n = normalizeTxFields(fields);
2033
- return concatBytes2(
2034
- Uint8Array.of(tag),
2035
- bigintToBeBytes(n.chainId, 8, "chainId"),
2036
- bigintToBeBytes(n.nonce, 8, "nonce"),
2037
- bigintToBeBytes(n.maxPriorityFeePerGas, 32, "maxPriorityFeePerGas"),
2038
- bigintToBeBytes(n.maxFeePerGas, 32, "maxFeePerGas"),
2039
- bigintToBeBytes(n.gasLimit, 8, "gasLimit"),
2040
- n.to === null ? Uint8Array.of(0) : concatBytes2(Uint8Array.of(1), n.to),
2041
- bigintToBeBytes(n.value, 32, "value"),
2042
- bigintToBeBytes(BigInt(n.input.length), 4, "input.length"),
2043
- n.input,
2044
- new Uint8Array(4),
2045
- // access_list length
2046
- encodeExtensionsForHash(n.extensions)
2047
- );
2048
- }
2049
- function bincodeSignedTransaction(fields, signature, publicKey) {
2050
- const n = normalizeTxFields(fields);
2051
- const sig = expectBytes(signature, ML_DSA_65_SIGNATURE_LEN, "ML-DSA-65 signature");
2052
- const pk = expectBytes(publicKey, ML_DSA_65_PUBLIC_KEY_LEN, "ML-DSA-65 public key");
2053
- const w = new BincodeWriter();
2054
- w.u64(n.chainId);
2055
- w.u64(n.nonce);
2056
- w.bytes(uint256Be(n.maxPriorityFeePerGas, "maxPriorityFeePerGas"));
2057
- w.bytes(uint256Be(n.maxFeePerGas, "maxFeePerGas"));
2058
- w.u64(n.gasLimit);
2059
- if (n.to === null) {
2060
- w.u8(0);
2061
- } else {
2062
- w.u8(1);
2063
- w.bytes(n.to);
2064
- }
2065
- w.bytes(uint256Be(n.value, "value"));
2066
- w.bytes(n.input);
2067
- w.u64(0n);
2068
- w.u64(BigInt(n.extensions.length));
2069
- for (const ext of n.extensions) bincodeTypedExtensionInto(w, ext);
2070
- bincodeMlDsa65OpaqueInto(w, sig);
2071
- bincodeMlDsa65OpaqueInto(w, pk);
2072
- return w.toBytes();
2073
- }
2074
- function normalizeTxFields(fields) {
2075
- return {
2076
- chainId: parseBigint(fields.chainId, "chainId"),
2077
- nonce: parseBigint(fields.nonce, "nonce"),
2078
- maxPriorityFeePerGas: parseBigint(fields.maxPriorityFeePerGas, "maxPriorityFeePerGas"),
2079
- maxFeePerGas: parseBigint(fields.maxFeePerGas, "maxFeePerGas"),
2080
- gasLimit: parseBigint(fields.gasLimit, "gasLimit"),
2081
- to: normalizeTo(fields.to),
2082
- value: parseBigint(fields.value, "value"),
2083
- input: normalizeBytes(fields.input ?? new Uint8Array(0), "input"),
2084
- extensions: normalizeExtensions(fields.extensions)
2085
- };
2086
- }
2087
- function normalizeTo(value) {
2088
- if (value === null) return null;
2089
- const bytes = normalizeBytes(value, "to");
2090
- return expectBytes(bytes, 20, "to");
2091
- }
2092
- function normalizeBytes(value, label) {
2093
- if (typeof value === "string") return hexToBytes2(value, label);
2094
- return value instanceof Uint8Array ? value : Uint8Array.from(value);
2095
- }
2096
- function normalizeExtensions(value) {
2097
- if (value === void 0) return [];
2098
- return value.map((ext, index) => {
2099
- if (!Number.isInteger(ext.kind) || ext.kind < 0 || ext.kind > 255) {
2100
- throw new Error(`extensions[${index}].kind out of u8 range`);
2101
- }
2102
- const body = normalizeBytes("bodyHex" in ext ? ext.bodyHex : ext.body, `extensions[${index}].body`);
2103
- if (body.length > 4294967295) {
2104
- throw new Error(`extensions[${index}].body exceeds u32 length`);
2105
- }
2106
- return { kind: ext.kind, body };
2107
- });
2108
- }
2109
- function encodeExtensionsForHash(extensions) {
2110
- const chunks = [bigintToBeBytes(BigInt(extensions.length), 4, "extensions.length")];
2111
- for (const ext of extensions) {
2112
- chunks.push(
2113
- Uint8Array.of(ext.kind),
2114
- bigintToBeBytes(BigInt(ext.body.length), 4, "extension.body.length"),
2115
- ext.body
2116
- );
2117
- }
2118
- return concatBytes2(...chunks);
2119
- }
2120
- function uint256Be(value, label) {
2121
- if (value < 0n || value >= 1n << 256n) throw new Error(`${label} out of u256 range`);
2122
- const out = new Uint8Array(32);
2123
- let v = value;
2124
- for (let i = 31; i >= 0; i--) {
2125
- out[i] = Number(v & 0xffn);
2126
- v >>= 8n;
2127
- }
2128
- return out;
2129
- }
2130
- function bincodeMlDsa65OpaqueInto(w, raw) {
2131
- w.enumVariant(ENUM_VARIANT_INDEX_ML_DSA_65);
2132
- w.u16(STANDARD_ALGO_NUMBER_ML_DSA_65);
2133
- w.bytes(raw);
2134
- }
2135
- function bincodeTypedExtensionInto(w, ext) {
2136
- w.u8(ext.kind);
2137
- w.bytes(ext.body);
2138
- }
2139
-
2140
- // src/crypto/ml-dsa.ts
2141
- var ML_DSA_65_SEED_LEN = 32;
2142
- var ML_DSA_65_SIGNING_KEY_LEN = 4032;
2143
- var ML_DSA_65_PUBLIC_KEY_LEN = 1952;
2144
- var ML_DSA_65_SIGNATURE_LEN = 3309;
2145
- var STANDARD_ALGO_NUMBER_ML_DSA_65 = 1001;
2146
- var ENUM_VARIANT_INDEX_ML_DSA_65 = 5;
2147
- var ADDRESS_DERIVATION_DOMAIN = "MONO_ADDRESS_BLAKE3_20_V1";
2148
- var ADDRESS_DERIVATION_DOMAIN_BYTES = new TextEncoder().encode(ADDRESS_DERIVATION_DOMAIN);
2149
- var MlDsa65Backend = class _MlDsa65Backend {
2150
- #secretKey;
2151
- #publicKey;
2152
- #addressBytes;
2153
- constructor(secretKey, publicKey) {
2154
- this.#secretKey = expectBytes(secretKey, ML_DSA_65_SIGNING_KEY_LEN, "ML-DSA-65 secret key").slice();
2155
- this.#publicKey = expectBytes(publicKey, ML_DSA_65_PUBLIC_KEY_LEN, "ML-DSA-65 public key").slice();
2156
- this.#addressBytes = mlDsa65AddressBytes(this.#publicKey);
2157
- }
2158
- static fromSeed(seed) {
2159
- const kp = ml_dsa65.keygen(expectBytes(seed, ML_DSA_65_SEED_LEN, "ML-DSA-65 seed"));
2160
- return new _MlDsa65Backend(kp.secretKey, kp.publicKey);
2161
- }
2162
- publicKey() {
2163
- return this.#publicKey.slice();
2164
- }
2165
- addressBytes() {
2166
- return this.#addressBytes.slice();
2167
- }
2168
- getAddress() {
2169
- return bytesToHex2(this.#addressBytes);
2170
- }
2171
- sign(message) {
2172
- return ml_dsa65.sign(message, this.#secretKey, { extraEntropy: false });
2173
- }
2174
- signPrehash(digest) {
2175
- return this.sign(expectBytes(digest, 32, "prehash"));
2176
- }
2177
- verify(message, signature) {
2178
- return ml_dsa65.verify(
2179
- expectBytes(signature, ML_DSA_65_SIGNATURE_LEN, "ML-DSA-65 signature"),
2180
- message,
2181
- this.#publicKey
2182
- );
2183
- }
2184
- signEvmTx(fields) {
2185
- const txHashPreimage = encodeTransactionForHash(fields, 1);
2186
- const sighash = keccak_256(txHashPreimage);
2187
- const signature = this.sign(sighash);
2188
- const wireBytes = bincodeSignedTransaction(fields, signature, this.#publicKey);
2189
- const txHash = keccak_256(
2190
- concatBytes2(
2191
- encodeTransactionForHash(fields, 2),
2192
- signature,
2193
- this.#publicKey
2194
- )
2195
- );
2196
- return {
2197
- wireHex: bytesToHex2(wireBytes).slice(2),
2198
- wireBytes,
2199
- sighash,
2200
- txHash
2201
- };
2202
- }
2203
- };
2204
- function mlDsa65AddressFromPublicKey(publicKey) {
2205
- return bytesToHex2(mlDsa65AddressBytes(publicKey));
2206
- }
2207
- function mlDsa65AddressBytes(publicKey) {
2208
- const bytes = expectBytes(publicKey, ML_DSA_65_PUBLIC_KEY_LEN, "ML-DSA-65 public key");
2209
- return blake3(concatBytes2(
2210
- ADDRESS_DERIVATION_DOMAIN_BYTES,
2211
- bigintToBeBytes(BigInt(STANDARD_ALGO_NUMBER_ML_DSA_65), 2, "ML-DSA-65 algo id"),
2212
- bytes
2213
- )).slice(0, 20);
2214
- }
2215
-
2216
2700
  // src/registry.ts
2217
2701
  var BLS_PUBLIC_KEY_BYTE_LENGTH = 48;
2218
2702
  var TESTNET_69420 = {
@@ -2220,8 +2704,8 @@ var TESTNET_69420 = {
2220
2704
  network: "testnet-69420",
2221
2705
  display_name: "Monolythium Testnet",
2222
2706
  description: "Public Monolythium testnet. Testnet state may reset without notice; do not store value on this network.",
2223
- genesis_hash: "0xe67cf82131fc63e335ce61afeae53299283eaa3a692830a618911aa840245031",
2224
- binary_sha: "e4697f9b",
2707
+ genesis_hash: "0x6a2bb3c8a6701bedcddc0447583bb24f34b77310e3aa77c62ca303a453e9f7ba",
2708
+ binary_sha: "c283c75d",
2225
2709
  rpc: [
2226
2710
  {
2227
2711
  url: "http://178.105.12.9:8545",
@@ -6779,7 +7263,7 @@ function verifyBoundedReceiptProof(proof) {
6779
7263
  }
6780
7264
  const actualRoot = computeNoEvmReceiptsRoot(receipts);
6781
7265
  const expectedRoot = decodeHash(proof.receiptsRoot, "receiptsRoot");
6782
- if (!bytesEqual2(expectedRoot, decodeHash(actualRoot, "computedReceiptsRoot"))) {
7266
+ if (!bytesEqual3(expectedRoot, decodeHash(actualRoot, "computedReceiptsRoot"))) {
6783
7267
  throw new NoEvmReceiptProofError(
6784
7268
  "receipts_root_mismatch",
6785
7269
  `receiptsRoot mismatch: expected ${proof.receiptsRoot}, computed ${actualRoot}`
@@ -6787,7 +7271,7 @@ function verifyBoundedReceiptProof(proof) {
6787
7271
  }
6788
7272
  const actualTargetHash = computeNoEvmTargetReceiptHash(targetReceipt);
6789
7273
  const expectedTargetHash = decodeHash(proof.targetReceiptHash, "targetReceiptHash");
6790
- if (!bytesEqual2(expectedTargetHash, decodeHash(actualTargetHash, "computedTargetReceiptHash"))) {
7274
+ if (!bytesEqual3(expectedTargetHash, decodeHash(actualTargetHash, "computedTargetReceiptHash"))) {
6791
7275
  throw new NoEvmReceiptProofError(
6792
7276
  "target_receipt_hash_mismatch",
6793
7277
  `targetReceiptHash mismatch: expected ${proof.targetReceiptHash}, computed ${actualTargetHash}`
@@ -6844,7 +7328,7 @@ function verifyCompactReceiptProof(proof) {
6844
7328
  const targetReceipt = decodeHexBytes(targetReceiptBytes, "targetReceiptBytes");
6845
7329
  const actualTargetHash = computeNoEvmTargetReceiptHash(targetReceipt);
6846
7330
  const expectedTargetHash = decodeHash(proof.targetReceiptHash, "targetReceiptHash");
6847
- if (!bytesEqual2(expectedTargetHash, decodeHash(actualTargetHash, "computedTargetReceiptHash"))) {
7331
+ if (!bytesEqual3(expectedTargetHash, decodeHash(actualTargetHash, "computedTargetReceiptHash"))) {
6848
7332
  throw new NoEvmReceiptProofError(
6849
7333
  "target_receipt_hash_mismatch",
6850
7334
  `targetReceiptHash mismatch: expected ${proof.targetReceiptHash}, computed ${actualTargetHash}`
@@ -6855,7 +7339,7 @@ function verifyCompactReceiptProof(proof) {
6855
7339
  compactProof.leafHash,
6856
7340
  "compactInclusionProof.leafHash"
6857
7341
  );
6858
- if (!bytesEqual2(expectedLeafHashBytes, actualLeafHashBytes)) {
7342
+ if (!bytesEqual3(expectedLeafHashBytes, actualLeafHashBytes)) {
6859
7343
  throw new NoEvmReceiptProofError(
6860
7344
  "compact_leaf_hash_mismatch",
6861
7345
  `compactInclusionProof.leafHash mismatch: expected ${compactProof.leafHash}, computed ${bytesToHex6(
@@ -6865,7 +7349,7 @@ function verifyCompactReceiptProof(proof) {
6865
7349
  }
6866
7350
  const compactRootBytes = decodeHash(compactProof.root, "compactInclusionProof.root");
6867
7351
  const receiptsRootBytes = decodeHash(proof.receiptsRoot, "receiptsRoot");
6868
- if (!bytesEqual2(receiptsRootBytes, compactRootBytes)) {
7352
+ if (!bytesEqual3(receiptsRootBytes, compactRootBytes)) {
6869
7353
  throw new NoEvmReceiptProofError(
6870
7354
  "compact_root_mismatch",
6871
7355
  `receiptsRoot must equal compactInclusionProof.root: receiptsRoot ${proof.receiptsRoot}, compact root ${compactProof.root}`
@@ -6888,7 +7372,7 @@ function verifyCompactReceiptProof(proof) {
6888
7372
  siblingHashes,
6889
7373
  pathSides
6890
7374
  );
6891
- if (!bytesEqual2(actualRootBytes, compactRootBytes)) {
7375
+ if (!bytesEqual3(actualRootBytes, compactRootBytes)) {
6892
7376
  throw new NoEvmReceiptProofError(
6893
7377
  "compact_path_mismatch",
6894
7378
  `compact inclusion path mismatch: expected ${compactProof.root}, computed ${bytesToHex6(
@@ -7042,7 +7526,7 @@ function validateCoveringSnapshotObject(snapshot, archiveContentHash, proofBlock
7042
7526
  "archiveProof.coveringSnapshot.checkpointTo must match blockHeight"
7043
7527
  );
7044
7528
  }
7045
- if (!bytesEqual2(checkpointContentHash, archiveContentHash)) {
7529
+ if (!bytesEqual3(checkpointContentHash, archiveContentHash)) {
7046
7530
  throw new NoEvmReceiptProofError(
7047
7531
  "invalid_proof_shape",
7048
7532
  "archiveProof.coveringSnapshot.checkpointContentHash must match archiveProof.contentHash"
@@ -7241,7 +7725,7 @@ function validateFinalityBlockReference(blockReference, round, proofBlockHash) {
7241
7725
  );
7242
7726
  if (proofBlockHash !== void 0) {
7243
7727
  const blockHash = decodeHash(proofBlockHash, "blockHash");
7244
- if (!bytesEqual2(digest, blockHash)) {
7728
+ if (!bytesEqual3(digest, blockHash)) {
7245
7729
  throw new NoEvmReceiptProofError(
7246
7730
  "invalid_proof_shape",
7247
7731
  "finalityEvidence.blockReference.digest must match blockHash"
@@ -7591,7 +8075,7 @@ function assertHashBytes(value, field2) {
7591
8075
  function isRecord3(value) {
7592
8076
  return typeof value === "object" && value !== null && !Array.isArray(value);
7593
8077
  }
7594
- function bytesEqual2(a, b) {
8078
+ function bytesEqual3(a, b) {
7595
8079
  if (a.length !== b.length) return false;
7596
8080
  let diff = 0;
7597
8081
  for (let index = 0; index < a.length; index++) {
@@ -7873,25 +8357,50 @@ function clusterJoinRequestExists(view) {
7873
8357
  return view.status !== "none" || view.owner.toLowerCase() !== ZERO_ADDRESS || view.bondLythoshi !== 0n;
7874
8358
  }
7875
8359
  async function readClusterJoinRequest(client, args) {
7876
- const data = encodeGetClusterJoinRequestCalldata({
7877
- clusterId: args.clusterId,
7878
- operatorId: normalizeOperatorId(args.operatorId)
7879
- });
7880
- const output = await client.call("eth_call", [
7881
- {
7882
- to: nodeRegistryAddressHex(),
7883
- data
7884
- },
7885
- "latest"
8360
+ const clusterId = parseUint32(args.clusterId, "clusterId");
8361
+ const operatorId = normalizeOperatorId(args.operatorId);
8362
+ const envelope = await client.call("lyth_getClusterJoinRequest", [
8363
+ Number(clusterId),
8364
+ operatorId
7886
8365
  ]);
7887
- return decodeClusterJoinRequest(output);
8366
+ return adaptNativeClusterJoinRequest(envelope.request);
7888
8367
  }
7889
8368
  async function preflightClusterJoinRequest(client, args) {
7890
8369
  try {
7891
8370
  return await readClusterJoinRequest(client, args);
7892
8371
  } catch (cause) {
7893
8372
  throw new Error(
7894
- `CJ-1 getClusterJoinRequest is not exposed or failed on the connected chain: ${errorMessage(cause)}`
8373
+ `CJ-1 lyth_getClusterJoinRequest is not exposed or failed on the connected chain: ${errorMessage(cause)}`
8374
+ );
8375
+ }
8376
+ }
8377
+ async function previewRequestClusterJoin(client, args) {
8378
+ const clusterId = parseUint32(args.clusterId, "clusterId");
8379
+ try {
8380
+ return await client.call("lyth_previewRequestClusterJoin", [{
8381
+ from: args.from,
8382
+ clusterId: Number(clusterId),
8383
+ operatorPubkey: bytesToHex2(normalizeConsensusPubkey(args.operatorPubkey, "operatorPubkey")),
8384
+ bondLythoshi: parseU256(args.bondLythoshi, "bondLythoshi").toString(10)
8385
+ }]);
8386
+ } catch (cause) {
8387
+ throw new Error(
8388
+ `CJ-1 request preview is not exposed or failed on the connected chain: ${errorMessage(cause)}`
8389
+ );
8390
+ }
8391
+ }
8392
+ async function previewVoteClusterAdmit(client, args) {
8393
+ const clusterId = parseUint32(args.clusterId, "clusterId");
8394
+ try {
8395
+ return await client.call("lyth_previewVoteClusterAdmit", [{
8396
+ from: args.from,
8397
+ clusterId: Number(clusterId),
8398
+ operatorId: normalizeOperatorId(args.operatorId),
8399
+ voterPubkey: bytesToHex2(normalizeConsensusPubkey(args.voterPubkey, "voterPubkey"))
8400
+ }]);
8401
+ } catch (cause) {
8402
+ throw new Error(
8403
+ `CJ-1 admit-vote preview is not exposed or failed on the connected chain: ${errorMessage(cause)}`
7895
8404
  );
7896
8405
  }
7897
8406
  }
@@ -7950,18 +8459,15 @@ async function submitRequestClusterJoin(args) {
7950
8459
  const clusterId = parseUint32(args.clusterId, "clusterId");
7951
8460
  const operatorPubkey = normalizeConsensusPubkey(args.operatorPubkey, "operatorPubkey");
7952
8461
  const operatorIdHex = deriveClusterJoinOperatorId(operatorPubkey);
7953
- const existing = await preflightClusterJoinRequest(args.client, {
7954
- clusterId,
7955
- operatorId: operatorIdHex
7956
- });
7957
- if (existing.status === "open") {
7958
- throw new Error("cluster join request is already open for this operator");
7959
- }
7960
- if (existing.status === "admitted") {
7961
- throw new Error("operator is already admitted for this cluster request");
7962
- }
7963
8462
  const backend = pqm1MnemonicToMlDsa65Backend(args.mnemonic);
7964
8463
  const senderAddress = addressToTypedBech32("user", backend.addressBytes());
8464
+ const preview = await previewRequestClusterJoin(args.client, {
8465
+ from: senderAddress,
8466
+ clusterId,
8467
+ operatorPubkey,
8468
+ bondLythoshi: args.bondLythoshi
8469
+ });
8470
+ assertPreviewOk("requestClusterJoin", preview);
7965
8471
  const [chainId, nonce, quote] = await Promise.all([
7966
8472
  args.client.ethChainId(),
7967
8473
  args.client.lythGetTransactionCount(senderAddress),
@@ -7980,15 +8486,15 @@ async function submitRequestClusterJoin(args) {
7980
8486
  async function submitVoteClusterAdmit(args) {
7981
8487
  const clusterId = parseUint32(args.clusterId, "clusterId");
7982
8488
  const operatorIdHex = normalizeOperatorId(args.operatorId);
7983
- const existing = await preflightClusterJoinRequest(args.client, {
7984
- clusterId,
7985
- operatorId: operatorIdHex
7986
- });
7987
- if (!clusterJoinRequestExists(existing) || existing.status !== "open") {
7988
- throw new Error("candidate cluster join request is not open for voting");
7989
- }
7990
8489
  const backend = pqm1MnemonicToMlDsa65Backend(args.mnemonic);
7991
8490
  const senderAddress = addressToTypedBech32("user", backend.addressBytes());
8491
+ const preview = await previewVoteClusterAdmit(args.client, {
8492
+ from: senderAddress,
8493
+ clusterId,
8494
+ operatorId: operatorIdHex,
8495
+ voterPubkey: args.voterPubkey
8496
+ });
8497
+ assertPreviewOk("voteClusterAdmit", preview);
7992
8498
  const [chainId, nonce, quote] = await Promise.all([
7993
8499
  args.client.ethChainId(),
7994
8500
  args.client.lythGetTransactionCount(senderAddress),
@@ -8019,6 +8525,40 @@ async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex
8019
8525
  signedTxWireBytes: plaintext.innerWireBytes
8020
8526
  };
8021
8527
  }
8528
+ function adaptNativeClusterJoinRequest(request) {
8529
+ return {
8530
+ owner: request.owner ?? ZERO_ADDRESS,
8531
+ requestEpoch: parseBigint(request.requestEpoch, "requestEpoch"),
8532
+ requestNonce: request.requestNonce === void 0 ? void 0 : parseBigint(request.requestNonce, "requestNonce"),
8533
+ snapshotThreshold: request.snapshotThreshold,
8534
+ snapshotN: request.snapshotN,
8535
+ voteCount: request.voteCount,
8536
+ statusCode: request.statusCode,
8537
+ status: clusterJoinStatus(request.status),
8538
+ bondLythoshi: parseBigint(request.bondLythoshi, "bondLythoshi"),
8539
+ sealRosterPending: request.sealRosterPending
8540
+ };
8541
+ }
8542
+ function clusterJoinStatus(status) {
8543
+ switch (status) {
8544
+ case "none":
8545
+ case "open":
8546
+ case "admitted":
8547
+ case "cancelled":
8548
+ case "expired":
8549
+ return status;
8550
+ default:
8551
+ return "unknown";
8552
+ }
8553
+ }
8554
+ function previewError(action, preview) {
8555
+ const reason = preview.reason ? `: ${preview.reason}` : "";
8556
+ const message = preview.message ? ` (${preview.message})` : "";
8557
+ return new Error(`${action} preview rejected${reason}${message}`);
8558
+ }
8559
+ function assertPreviewOk(action, preview) {
8560
+ if (!preview.ok) throw previewError(action, preview);
8561
+ }
8022
8562
  function normalizeConsensusPubkey(value, label) {
8023
8563
  const bytes = typeof value === "string" ? hexToBytes2(value, label) : value;
8024
8564
  return expectBytes(bytes, NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES, label).slice();
@@ -9012,11 +9552,6 @@ function wordToBigint(word) {
9012
9552
  }
9013
9553
  return out;
9014
9554
  }
9015
- new TextEncoder().encode("protocore/v2/mempool/dkg-mlkem768/1");
9016
- var MempoolClass = {
9017
- CLOBOp: 3};
9018
-
9019
- // src/market-actions.ts
9020
9555
  var CLOB_MARKET_ID_DOMAIN_TAG = 193;
9021
9556
  var NATIVE_MARKET_MODULE_ADDRESS_BYTES = "0x4d41524b45545f4e41544956455f4d4f445f5631";
9022
9557
  var NATIVE_MARKET_MODULE_ADDRESS = addressToTypedBech32(
@@ -10347,8 +10882,8 @@ var MONOLYTHIUM_NETWORKS = {
10347
10882
  };
10348
10883
 
10349
10884
  // src/index.ts
10350
- var version = "0.4.1";
10885
+ var version = "0.4.2";
10351
10886
 
10352
- export { ADDRESS_HRP, ADDRESS_KIND_HRPS, API_STREAM_TOPICS, AddressError, AgentActionError, ApiClient, BRIDGE_QUOTE_API_BLOCKED_REASON, BRIDGE_REVERT_TAGS, BRIDGE_SELECTORS, BRIDGE_SUBMIT_API_BLOCKED_REASON, BURN_ADDR, BridgePrecompileError, BridgeRouteCatalogueError, CHAIN_REGISTRY, CHAIN_REGISTRY_RAW_BASE, CLOB_MARKET_ID_DOMAIN_TAG, CLOB_SELECTORS, CLUSTER_FORMED_EVENT_SIG, DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT, DELEGATION_REVERT_TAGS, DELEGATION_SELECTORS, DIVERSITY_SCORE_MAX, DelegationPrecompileError, EMPTY_ROOT, EXECUTION_UNIT_PRICE_SAFETY_MULTIPLIER, FEED_ID_DOMAIN_TAG, LYTHOSHI_PER_LYTH, LYTH_DECIMALS, MAX_NATIVE_CALL_FORWARDER_REQUEST_BYTES, MAX_NATIVE_RECEIPT_EVENTS, MIN_EXECUTION_UNIT_PRICE_LYTHOSHI, ML_DSA_65_PUBLIC_KEY_LEN2 as ML_DSA_65_PUBLIC_KEY_LEN, ML_DSA_65_SIGNATURE_LEN2 as ML_DSA_65_SIGNATURE_LEN, MONOLYTHIUM_NETWORKS, MONOLYTHIUM_TESTNET_CHAIN_ID, MONOLYTHIUM_TESTNET_NETWORK_NAME, MRV_DEPLOY_PAYLOAD_VERSION, MRV_FORMAT_VERSION, MRV_MAX_ABI_SYMBOLS, MRV_MAX_CODE_BYTES, MRV_MAX_DEBUG_BYTES, MRV_MAX_MEMORY_PAGES, MRV_MAX_STORAGE_NAMESPACE_BYTES, MRV_MEMORY_PAGE_BYTES, MRV_PROFILE_MONO_RV32IM_V1, MRV_STRUCTURED_FEE_FIELDS, MRV_TX_EXTENSION_KIND, MRV_TX_EXTENSION_V1, MULTISIG_ADDRESS_DERIVATION_DOMAIN, MarketActionError, MrvValidationError, NAME_BASE_MULTIPLIER, NAME_FALLBACK_FEE_UNIT_LYTHOSHI, NAME_LABEL_MAX_LEN, NAME_LABEL_MIN_LEN, NAME_MAX_LEN, NAME_REGISTRY_SELECTORS, NATIVE_AGENT_MODULE_ADDRESS, NATIVE_AGENT_MODULE_ADDRESS_BYTES, NATIVE_CALL_FORWARDER_ARTIFACT_PROFILE, NATIVE_CALL_FORWARDER_RESPONSE_CAPACITY, NATIVE_CALL_FORWARDER_RESPONSE_OFFSET, NATIVE_DEV_HOST_API_VERSION, NATIVE_DEV_IPC_PROTOCOL_VERSION, NATIVE_DEV_MANIFEST_SCHEMA_VERSION, NATIVE_LYTH_DECIMALS, NATIVE_MARKET_EVENT_FAMILY, NATIVE_MARKET_MODULE_ADDRESS, NATIVE_MARKET_MODULE_ADDRESS_BYTES, NATIVE_MARKET_ORDER_BOOK_STREAM_TOPIC, NODE_REGISTRY_BLS_PUBKEY_BYTES, NODE_REGISTRY_CAPABILITIES, NODE_REGISTRY_CAPABILITY_MASK, NODE_REGISTRY_CONSENSUS_POP_BYTES, NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES, NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES, NODE_REGISTRY_DKG_RESHARE_MAX_SIGNERS, NODE_REGISTRY_DKG_RESHARE_MIN_SIGNERS, NODE_REGISTRY_DKG_THRESHOLD_SIG_BYTES, NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES, NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID, NODE_REGISTRY_PUBLIC_SERVICE_MASK, NODE_REGISTRY_SELECTORS, NO_EVM_ARCHIVE_PROOF_SCHEMA, NO_EVM_ARCHIVE_SIGNATURE_SCHEME, NO_EVM_FINALITY_EVIDENCE_SCHEMA, NO_EVM_FINALITY_EVIDENCE_SOURCE, NO_EVM_RECEIPTS_ROOT_DOMAIN, NO_EVM_RECEIPT_CODEC, NO_EVM_RECEIPT_PROOF_SCHEMA, NO_EVM_RECEIPT_PROOF_TYPE, NO_EVM_RECEIPT_ROOT_ALGORITHM, NameRegistryError, NoEvmReceiptProofError, NodeRegistryError, OPERATOR_ROUTER_ADDRESS, OPERATOR_ROUTER_EVENT_SIGS, OPERATOR_ROUTER_SELECTORS, OPERATOR_ROUTER_SIGS, ORACLE_EVENT_SIGS, OracleEventError, PENDING_CHANGE_KIND_CODES, PRECOMPILE_ADDRESSES, PROTOCOL_MAX_OPERATOR_FEE_BPS, PROVER_MARKET_ADDRESS, PROVER_MARKET_BID_DOMAIN, PROVER_MARKET_EVENT_SIGS, PROVER_MARKET_REQUEST_DOMAIN, PROVER_MARKET_SELECTORS, PROVER_MARKET_SUBMIT_DOMAIN, PROVER_SLASH_REASON_BAD_PROOF, PROVER_SLASH_REASON_NON_DELIVERY, PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN, PUBKEY_REGISTRY_SELECTORS, ProverMarketError, PubkeyRegistryError, REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT, RESERVED_ADDRESS_HRPS, RpcClient, SERVES_GPU_PROVE, SERVICE_PROBE_STATUS, SET_POLICY_CLAIM_DOMAIN_TAG, SPENDING_POLICY_SELECTORS, SdkError, SpendingPolicyError, TESTNET_69420, TRANSFER_DEFAULT_EXECUTION_UNIT_LIMIT, V1_BRIDGE_ALLOWED_FEE_TOKEN, V1_BRIDGE_ALLOWED_PROTOCOL, addressBytesToHex, addressToBech32, addressToTypedBech32, allowRootFor, apiEndpointFromRpcEndpoint, assertMrvCallNativeSubmissionPlan, assertMrvDeployNativeSubmissionPlan, assertMrvFeeDisplayConformance, assertMrvStructuredFeeConformance, assertNativeDevMrcTokenPlan, assertNativeDevMrvDeployPlan, assertNativeDevWalletApprovalRequest, assertNativeMarketOrderBookStreamPayload, assessBridgeRoute, bech32ToAddress, bech32ToAddressBytes, bidSighash, bridgeAddressHex, bridgeDrainRemaining, bridgeQuoteSubmitReadiness, bridgeRoutesReadiness, bridgeTransferCandidates, buildBridgeRouteCatalogue, buildCancelSpotOrderPlan, buildMrvCallNativeTxPlan, buildMrvCallPlan, buildMrvCallRequest, buildMrvDeployNativeTxPlan, buildMrvDeployPayloadNativeTxPlan, buildMrvDeployPayloadPlan, buildMrvDeployPayloadRequest, buildMrvDeployPlan, buildMrvDeployRequest, buildNativeAgentCreateEscrowForwarderInput, buildNativeAgentCreateEscrowModuleCall, buildNativeAgentModuleCallEnvelope, buildNativeAgentRecordReputationForwarderInput, buildNativeAgentRecordReputationModuleCall, buildNativeAgentSetSpendingPolicyForwarderInput, buildNativeAgentSetSpendingPolicyModuleCall, buildNativeCallForwarderArtifact, buildNativeMarketModuleCallEnvelope, buildNativeNftBuyListingForwarderInput, buildNativeNftBuyListingModuleCall, buildNativeNftCancelListingForwarderInput, buildNativeNftCancelListingModuleCall, buildNativeNftCreateListingForwarderInput, buildNativeNftCreateListingModuleCall, buildNativeNftPlaceAuctionBidForwarderInput, buildNativeNftPlaceAuctionBidModuleCall, buildNativeNftSettleAuctionForwarderInput, buildNativeNftSettleAuctionModuleCall, buildNativeNftSweepExpiredListingsForwarderInput, buildNativeNftSweepExpiredListingsModuleCall, buildNativeSpotCancelOrderForwarderInput, buildNativeSpotCancelOrderModuleCall, buildNativeSpotCreateMarketForwarderInput, buildNativeSpotCreateMarketModuleCall, buildNativeSpotLimitOrderForwarderInput, buildNativeSpotLimitOrderModuleCall, buildNativeSpotSettleLimitOrderForwarderInput, buildNativeSpotSettleLimitOrderModuleCall, buildNativeSpotSettleRoutedLimitOrderForwarderInput, buildNativeSpotSettleRoutedLimitOrderModuleCall, buildPlaceLimitOrderViaPlan, buildPlaceSpotLimitOrderPlan, buildPlaceSpotMarketOrderExPlan, buildPlaceSpotMarketOrderPlan, buildRequestClusterJoinTxFields, buildVoteClusterAdmitTxFields, categoryRoot, checkMrvFeeDisplayConformance, checkMrvStructuredFeeConformance, checkNativeDevkitCompatibility, clampPriorityTip, clobAddressHex, clusterApyPercent, clusterJoinRequestExists, compareNativeDevVersions, composeClaimBoundMessage, computeNoEvmDacFinalityMessage, computeNoEvmLeaderFinalityMessage, computeNoEvmReceiptsRoot, computeNoEvmRoundFinalityMessage, computeNoEvmTargetReceiptHash, computeQuoteLiquidity, consumeNativeEvents, decodeClusterDiversity, decodeClusterFormedEvent, decodeClusterJoinRequest, decodeHasPubkeyReturn, decodeLookupPubkeyReturn, decodeNativeAgentStateResponse, decodeNativeMarketOrderBookDeltasResponse, decodeNativeReceiptResponse, decodeNoEvmReceiptTranscript, decodeOperatorFeeChargedEvent, decodeOperatorNetworkMetadata, decodeOracleEvent, decodeTimeWindow, decodeTxFeedResponse, delegationAddressHex, denyRootFor, deriveClobMarketId, deriveClusterAnchorAddress, deriveClusterJoinOperatorId, deriveFeedId, deriveMrvContractAddress, deriveNativeSpotMarketId, deriveNativeSpotOrderId, destinationRoot, encodeAttestDkgReshareCalldata, encodeBlockSelector, encodeBridgeChallengeCalldata, encodeBridgeClaimCalldata, encodeCancelClusterJoinCalldata, encodeCancelOrderCalldata, encodeCancelPendingChangeCalldata, encodeClaimCalldata, encodeClaimPolicyByAddressCalldata, encodeCompleteRedemptionCalldata, encodeCreateRequestCalldata, encodeCreateRequestCanonical, encodeDelegateCalldata, encodeDisableCalldata, encodeEnableCalldata, encodeExpireClusterJoinCalldata, encodeGetClusterJoinRequestCalldata, encodeHasPubkeyCalldata, encodeLockBridgeConfigCalldata, encodeLookupPubkeyCalldata, encodeMrvDeployPayload, encodeNameAcceptTransferCall, encodeNameProposeTransferCall, encodeNameRegisterCall, encodeNativeAgentAcceptEscrowCall, encodeNativeAgentApproveEscrowCall, encodeNativeAgentArbiterGetCall, encodeNativeAgentAttestationGetCall, encodeNativeAgentAvailabilityGetCall, encodeNativeAgentCancelEscrowCall, encodeNativeAgentCloseAvailabilityCall, encodeNativeAgentConsentGetCall, encodeNativeAgentCounterEscrowCall, encodeNativeAgentCreateEscrowCall, encodeNativeAgentDeactivateServiceCall, encodeNativeAgentDisputeEscrowCall, encodeNativeAgentEscrowGetCall, encodeNativeAgentGrantConsentCall, encodeNativeAgentIssueAttestationCall, encodeNativeAgentIssuerGetCall, encodeNativeAgentListServiceCall, encodeNativeAgentModuleForwarderInput, encodeNativeAgentOpenAvailabilityCall, encodeNativeAgentRecordPolicySpendCall, encodeNativeAgentRecordReputationCall, encodeNativeAgentRegisterArbiterCall, encodeNativeAgentRegisterIssuerCall, encodeNativeAgentReputationGetCall, encodeNativeAgentResolveEscrowCall, encodeNativeAgentRevokeAttestationCall, encodeNativeAgentRevokeConsentCall, encodeNativeAgentServiceGetCall, encodeNativeAgentSetAvailabilityCall, encodeNativeAgentSetSpendingPolicyCall, encodeNativeAgentSpendingPolicyGetCall, encodeNativeAgentStartEscrowCall, encodeNativeAgentSubmitEscrowCall, encodeNativeMarketModuleForwarderInput, encodeNativeNftBuyListingCall, encodeNativeNftCancelListingCall, encodeNativeNftCreateListingCall, encodeNativeNftPlaceAuctionBidCall, encodeNativeNftSettleAuctionCall, encodeNativeNftSweepExpiredListingsCall, encodeNativeSpotCancelOrderCall, encodeNativeSpotCreateMarketCall, encodeNativeSpotLimitOrderCall, encodeNativeSpotSettleLimitOrderCall, encodeNativeSpotSettleRoutedLimitOrderCall, encodePlaceLimitOrderCalldata, encodePlaceLimitOrderViaCalldata, encodePlaceMarketOrderCalldata, encodePlaceMarketOrderExCalldata, encodeRecoverOperatorNodeCalldata, encodeRedelegateCalldata, encodeRegisterPubkeyCalldata, encodeReportServiceProbeCalldata, encodeRequestClusterJoinCalldata, encodeSetAutoCompoundCalldata, encodeSetBridgeResumeCooldownCalldata, encodeSetBridgeRouteFinalityCalldata, encodeSetLotSizeCalldata, encodeSetMinNotionalCalldata, encodeSetPolicyCalldata, encodeSetPolicyClaimCalldata, encodeSetTickSizeCalldata, encodeSubmitBridgeProofCalldata, encodeSubmitPendingChangeCalldata, encodeUndelegateCalldata, encodeVoteClusterAdmitCalldata, exportBridgeRouteCatalogueJson, fetchChainInfoLatest, fetchChainRegistryLatest, formatLyth, formatLythoshi, formatNativeReceiptFeeDisplay, formatOraclePrice, getChainInfo, getNoEvmReceiptTrustPolicy, getP2pSeeds, getRpcEndpoints, hexToAddressBytes, isBridgeAdminLockedRevert, isBridgeCooldownZeroRevert, isBridgeFinalityZeroRevert, isBridgeResumeCooldownActiveRevert, isConcreteServiceProbeStatus, isNativeDecodedEvent, isNativeMarketOrderBookStreamPayload, isRedemptionPrincipalUnavailableRevert, isSinglePublicServiceProbeMask, isValidNodeRegistryCapabilities, isValidPublicServiceProbeMask, mrvAddressToBech32, mrvBech32ToAddress, mrvCodeHashHex, mrvV1TransactionExtension, nameLengthModifierX10, nameRegistrationCost, nameRegistryAddressHex, nativeAgentStateFilterParams, nativeDevSchemaFieldNames, nativeDevUiStrings, nativeEventMatches, nativeEventsFilterParams, nativeEventsFromHistory, nativeEventsFromReceipt, nativeMarketEventFilter, nativeMarketEventsFromHistory, nativeMarketEventsFromReceipt, nativeMarketStateFilterParams, noEvmReceiptTrustPolicyFromChainInfo, nodeHostingClassFromByte, nodeHostingClassToByte, nodeRegistryAddressHex, normalizeAddressHex, normalizeBridgeRouteCatalogue, normalizePendingChangeKind, oracleAddressHex, oraclePriceToNumber, packTimeWindow, parseAddress, parseBridgeRouteCatalogueJson, parseChainRegistryToml, parseDkgResharePublicKeys, parseLythToLythoshi, parseNameCategory, parseNativeDecodedEvent, parseQuantity, parseQuantityBig, preflightClusterJoinRequest, proverMarketStateFromByte, pubkeyRegistryAddressHex, quoteOperatorFee, rankBridgeRoutes, rankMarketsByVolume, readClusterJoinRequest, requestSighash, requireTypedAddress, resolveClusterJoinExecutionFee, resolveExecutionFee, resolveMaxExecutionUnitPrice, resolveRegistryExecutionFee, resolveStudioHostStatus, selectBridgeTransferRoute, serviceProbeStatusLabel, setDestinationRoot, spendingPolicyAddressHex, submitMrvCallNativeTx, submitMrvDeployNativeTx, submitMrvDeployPayloadNativeTx, submitRequestClusterJoin, submitSighash, submitVoteClusterAdmit, transactionFeeExposure, typedBech32ToAddress, validateAddress, validateBridgeRouteCatalogue, validateMrvArtifactMetadata, validateMrvCallRequest, validateMrvDeployRequest, verifyNoEvmArchiveProofSignatures, verifyNoEvmBlockFinalityEvidenceMultisig, verifyNoEvmBlockFinalityEvidenceThreshold, verifyNoEvmFinalityEvidenceMultisig, verifyNoEvmFinalityEvidenceThreshold, verifyNoEvmReceiptProof, verifyNoEvmReceiptProofTrust, version };
10887
+ export { ADDRESS_HRP, ADDRESS_KIND_HRPS, API_STREAM_TOPICS, AddressError, AgentActionError, ApiClient, BRIDGE_QUOTE_API_BLOCKED_REASON, BRIDGE_REVERT_TAGS, BRIDGE_SELECTORS, BRIDGE_SUBMIT_API_BLOCKED_REASON, BURN_ADDR, BridgePrecompileError, BridgeRouteCatalogueError, CHAIN_REGISTRY, CHAIN_REGISTRY_RAW_BASE, CLOB_MARKET_ID_DOMAIN_TAG, CLOB_SELECTORS, CLUSTER_FORMED_EVENT_SIG, DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT, DELEGATION_REVERT_TAGS, DELEGATION_SELECTORS, DIVERSITY_SCORE_MAX, DelegationPrecompileError, EMPTY_ROOT, EXECUTION_UNIT_PRICE_SAFETY_MULTIPLIER, FEED_ID_DOMAIN_TAG, LYTHOSHI_PER_LYTH, LYTH_DECIMALS, MAX_NATIVE_CALL_FORWARDER_REQUEST_BYTES, MAX_NATIVE_RECEIPT_EVENTS, MIN_EXECUTION_UNIT_PRICE_LYTHOSHI, ML_DSA_65_PUBLIC_KEY_LEN2 as ML_DSA_65_PUBLIC_KEY_LEN, ML_DSA_65_SIGNATURE_LEN2 as ML_DSA_65_SIGNATURE_LEN, MONOLYTHIUM_NETWORKS, MONOLYTHIUM_TESTNET_CHAIN_ID, MONOLYTHIUM_TESTNET_NETWORK_NAME, MRV_DEPLOY_PAYLOAD_VERSION, MRV_FORMAT_VERSION, MRV_MAX_ABI_SYMBOLS, MRV_MAX_CODE_BYTES, MRV_MAX_DEBUG_BYTES, MRV_MAX_MEMORY_PAGES, MRV_MAX_STORAGE_NAMESPACE_BYTES, MRV_MEMORY_PAGE_BYTES, MRV_PROFILE_MONO_RV32IM_V1, MRV_STRUCTURED_FEE_FIELDS, MRV_TX_EXTENSION_KIND, MRV_TX_EXTENSION_V1, MULTISIG_ADDRESS_DERIVATION_DOMAIN, MarketActionError, MrvValidationError, NAME_BASE_MULTIPLIER, NAME_FALLBACK_FEE_UNIT_LYTHOSHI, NAME_LABEL_MAX_LEN, NAME_LABEL_MIN_LEN, NAME_MAX_LEN, NAME_REGISTRY_SELECTORS, NATIVE_AGENT_MODULE_ADDRESS, NATIVE_AGENT_MODULE_ADDRESS_BYTES, NATIVE_CALL_FORWARDER_ARTIFACT_PROFILE, NATIVE_CALL_FORWARDER_RESPONSE_CAPACITY, NATIVE_CALL_FORWARDER_RESPONSE_OFFSET, NATIVE_DEV_HOST_API_VERSION, NATIVE_DEV_IPC_PROTOCOL_VERSION, NATIVE_DEV_MANIFEST_SCHEMA_VERSION, NATIVE_LYTH_DECIMALS, NATIVE_MARKET_EVENT_FAMILY, NATIVE_MARKET_MODULE_ADDRESS, NATIVE_MARKET_MODULE_ADDRESS_BYTES, NATIVE_MARKET_ORDER_BOOK_STREAM_TOPIC, NODE_REGISTRY_BLS_PUBKEY_BYTES, NODE_REGISTRY_CAPABILITIES, NODE_REGISTRY_CAPABILITY_MASK, NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES, NODE_REGISTRY_CONSENSUS_POP_BYTES, NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES, NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES, NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES, NODE_REGISTRY_DKG_RESHARE_MAX_SIGNERS, NODE_REGISTRY_DKG_RESHARE_MIN_SIGNERS, NODE_REGISTRY_DKG_THRESHOLD_SIG_BYTES, NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT, NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT, NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN, NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT, NODE_REGISTRY_FORM_CLUSTER_THRESHOLD, NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES, NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID, NODE_REGISTRY_PUBLIC_SERVICE_MASK, NODE_REGISTRY_SELECTORS, NO_EVM_ARCHIVE_PROOF_SCHEMA, NO_EVM_ARCHIVE_SIGNATURE_SCHEME, NO_EVM_FINALITY_EVIDENCE_SCHEMA, NO_EVM_FINALITY_EVIDENCE_SOURCE, NO_EVM_RECEIPTS_ROOT_DOMAIN, NO_EVM_RECEIPT_CODEC, NO_EVM_RECEIPT_PROOF_SCHEMA, NO_EVM_RECEIPT_PROOF_TYPE, NO_EVM_RECEIPT_ROOT_ALGORITHM, NameRegistryError, NoEvmReceiptProofError, NodeRegistryError, OPERATOR_ROUTER_ADDRESS, OPERATOR_ROUTER_EVENT_SIGS, OPERATOR_ROUTER_SELECTORS, OPERATOR_ROUTER_SIGS, ORACLE_EVENT_SIGS, OracleEventError, PENDING_CHANGE_KIND_CODES, PRECOMPILE_ADDRESSES, PROTOCOL_MAX_OPERATOR_FEE_BPS, PROVER_MARKET_ADDRESS, PROVER_MARKET_BID_DOMAIN, PROVER_MARKET_EVENT_SIGS, PROVER_MARKET_REQUEST_DOMAIN, PROVER_MARKET_SELECTORS, PROVER_MARKET_SUBMIT_DOMAIN, PROVER_SLASH_REASON_BAD_PROOF, PROVER_SLASH_REASON_NON_DELIVERY, PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN, PUBKEY_REGISTRY_SELECTORS, ProverMarketError, PubkeyRegistryError, REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT, RESERVED_ADDRESS_HRPS, RpcClient, SERVES_GPU_PROVE, SERVICE_PROBE_STATUS, SET_POLICY_CLAIM_DOMAIN_TAG, SPENDING_POLICY_SELECTORS, SdkError, SpendingPolicyError, TESTNET_69420, TRANSFER_DEFAULT_EXECUTION_UNIT_LIMIT, V1_BRIDGE_ALLOWED_FEE_TOKEN, V1_BRIDGE_ALLOWED_PROTOCOL, addressBytesToHex, addressToBech32, addressToTypedBech32, allowRootFor, apiEndpointFromRpcEndpoint, assertMrvCallNativeSubmissionPlan, assertMrvDeployNativeSubmissionPlan, assertMrvFeeDisplayConformance, assertMrvStructuredFeeConformance, assertNativeDevMrcTokenPlan, assertNativeDevMrvDeployPlan, assertNativeDevWalletApprovalRequest, assertNativeMarketOrderBookStreamPayload, assessBridgeRoute, bech32ToAddress, bech32ToAddressBytes, bidSighash, bridgeAddressHex, bridgeDrainRemaining, bridgeQuoteSubmitReadiness, bridgeRoutesReadiness, bridgeTransferCandidates, buildBridgeRouteCatalogue, buildCancelSpotOrderPlan, buildMrvCallNativeTxPlan, buildMrvCallPlan, buildMrvCallRequest, buildMrvDeployNativeTxPlan, buildMrvDeployPayloadNativeTxPlan, buildMrvDeployPayloadPlan, buildMrvDeployPayloadRequest, buildMrvDeployPlan, buildMrvDeployRequest, buildNativeAgentCreateEscrowForwarderInput, buildNativeAgentCreateEscrowModuleCall, buildNativeAgentModuleCallEnvelope, buildNativeAgentRecordReputationForwarderInput, buildNativeAgentRecordReputationModuleCall, buildNativeAgentSetSpendingPolicyForwarderInput, buildNativeAgentSetSpendingPolicyModuleCall, buildNativeCallForwarderArtifact, buildNativeMarketModuleCallEnvelope, buildNativeNftBuyListingForwarderInput, buildNativeNftBuyListingModuleCall, buildNativeNftCancelListingForwarderInput, buildNativeNftCancelListingModuleCall, buildNativeNftCreateListingForwarderInput, buildNativeNftCreateListingModuleCall, buildNativeNftPlaceAuctionBidForwarderInput, buildNativeNftPlaceAuctionBidModuleCall, buildNativeNftSettleAuctionForwarderInput, buildNativeNftSettleAuctionModuleCall, buildNativeNftSweepExpiredListingsForwarderInput, buildNativeNftSweepExpiredListingsModuleCall, buildNativeSpotCancelOrderForwarderInput, buildNativeSpotCancelOrderModuleCall, buildNativeSpotCreateMarketForwarderInput, buildNativeSpotCreateMarketModuleCall, buildNativeSpotLimitOrderForwarderInput, buildNativeSpotLimitOrderModuleCall, buildNativeSpotSettleLimitOrderForwarderInput, buildNativeSpotSettleLimitOrderModuleCall, buildNativeSpotSettleRoutedLimitOrderForwarderInput, buildNativeSpotSettleRoutedLimitOrderModuleCall, buildPlaceLimitOrderViaPlan, buildPlaceSpotLimitOrderPlan, buildPlaceSpotMarketOrderExPlan, buildPlaceSpotMarketOrderPlan, buildRequestClusterJoinTxFields, buildVoteClusterAdmitTxFields, categoryRoot, checkMrvFeeDisplayConformance, checkMrvStructuredFeeConformance, checkNativeDevkitCompatibility, clampPriorityTip, clobAddressHex, clusterApyPercent, clusterJoinRequestExists, compareNativeDevVersions, composeClaimBoundMessage, computeNoEvmDacFinalityMessage, computeNoEvmLeaderFinalityMessage, computeNoEvmReceiptsRoot, computeNoEvmRoundFinalityMessage, computeNoEvmTargetReceiptHash, computeQuoteLiquidity, consumeNativeEvents, decodeClusterDiversity, decodeClusterFormedEvent, decodeClusterJoinRequest, decodeHasPubkeyReturn, decodeLookupPubkeyReturn, decodeNativeAgentStateResponse, decodeNativeMarketOrderBookDeltasResponse, decodeNativeReceiptResponse, decodeNoEvmReceiptTranscript, decodeOperatorFeeChargedEvent, decodeOperatorNetworkMetadata, decodeOracleEvent, decodeTimeWindow, decodeTxFeedResponse, delegationAddressHex, denyRootFor, deriveClobMarketId, deriveClusterAnchorAddress, deriveClusterJoinOperatorId, deriveFeedId, deriveMrvContractAddress, deriveNativeSpotMarketId, deriveNativeSpotOrderId, destinationRoot, encodeAttestDkgReshareCalldata, encodeBlockSelector, encodeBridgeChallengeCalldata, encodeBridgeClaimCalldata, encodeCancelClusterJoinCalldata, encodeCancelOrderCalldata, encodeCancelPendingChangeCalldata, encodeClaimCalldata, encodeClaimPolicyByAddressCalldata, encodeCompleteRedemptionCalldata, encodeCreateRequestCalldata, encodeCreateRequestCanonical, encodeDelegateCalldata, encodeDisableCalldata, encodeEnableCalldata, encodeExpireClusterJoinCalldata, encodeFormClusterCalldata, encodeGetClusterJoinRequestCalldata, encodeHasPubkeyCalldata, encodeLockBridgeConfigCalldata, encodeLookupPubkeyCalldata, encodeMrvDeployPayload, encodeNameAcceptTransferCall, encodeNameProposeTransferCall, encodeNameRegisterCall, encodeNativeAgentAcceptEscrowCall, encodeNativeAgentApproveEscrowCall, encodeNativeAgentArbiterGetCall, encodeNativeAgentAttestationGetCall, encodeNativeAgentAvailabilityGetCall, encodeNativeAgentCancelEscrowCall, encodeNativeAgentCloseAvailabilityCall, encodeNativeAgentConsentGetCall, encodeNativeAgentCounterEscrowCall, encodeNativeAgentCreateEscrowCall, encodeNativeAgentDeactivateServiceCall, encodeNativeAgentDisputeEscrowCall, encodeNativeAgentEscrowGetCall, encodeNativeAgentGrantConsentCall, encodeNativeAgentIssueAttestationCall, encodeNativeAgentIssuerGetCall, encodeNativeAgentListServiceCall, encodeNativeAgentModuleForwarderInput, encodeNativeAgentOpenAvailabilityCall, encodeNativeAgentRecordPolicySpendCall, encodeNativeAgentRecordReputationCall, encodeNativeAgentRegisterArbiterCall, encodeNativeAgentRegisterIssuerCall, encodeNativeAgentReputationGetCall, encodeNativeAgentResolveEscrowCall, encodeNativeAgentRevokeAttestationCall, encodeNativeAgentRevokeConsentCall, encodeNativeAgentServiceGetCall, encodeNativeAgentSetAvailabilityCall, encodeNativeAgentSetSpendingPolicyCall, encodeNativeAgentSpendingPolicyGetCall, encodeNativeAgentStartEscrowCall, encodeNativeAgentSubmitEscrowCall, encodeNativeMarketModuleForwarderInput, encodeNativeNftBuyListingCall, encodeNativeNftCancelListingCall, encodeNativeNftCreateListingCall, encodeNativeNftPlaceAuctionBidCall, encodeNativeNftSettleAuctionCall, encodeNativeNftSweepExpiredListingsCall, encodeNativeSpotCancelOrderCall, encodeNativeSpotCreateMarketCall, encodeNativeSpotLimitOrderCall, encodeNativeSpotSettleLimitOrderCall, encodeNativeSpotSettleRoutedLimitOrderCall, encodePlaceLimitOrderCalldata, encodePlaceLimitOrderViaCalldata, encodePlaceMarketOrderCalldata, encodePlaceMarketOrderExCalldata, encodeRecoverOperatorNodeCalldata, encodeRedelegateCalldata, encodeRegisterPubkeyCalldata, encodeReportServiceProbeCalldata, encodeRequestClusterJoinCalldata, encodeSetAutoCompoundCalldata, encodeSetBridgeResumeCooldownCalldata, encodeSetBridgeRouteFinalityCalldata, encodeSetLotSizeCalldata, encodeSetMinNotionalCalldata, encodeSetPolicyCalldata, encodeSetPolicyClaimCalldata, encodeSetTickSizeCalldata, encodeSubmitBridgeProofCalldata, encodeSubmitPendingChangeCalldata, encodeUndelegateCalldata, encodeVoteClusterAdmitCalldata, exportBridgeRouteCatalogueJson, fetchChainInfoLatest, fetchChainRegistryLatest, formClusterMessage, formClusterMessageHex, formatLyth, formatLythoshi, formatNativeReceiptFeeDisplay, formatOraclePrice, getChainInfo, getNoEvmReceiptTrustPolicy, getP2pSeeds, getRpcEndpoints, hexToAddressBytes, isBridgeAdminLockedRevert, isBridgeCooldownZeroRevert, isBridgeFinalityZeroRevert, isBridgeResumeCooldownActiveRevert, isConcreteServiceProbeStatus, isNativeDecodedEvent, isNativeMarketOrderBookStreamPayload, isRedemptionPrincipalUnavailableRevert, isSinglePublicServiceProbeMask, isValidNodeRegistryCapabilities, isValidPublicServiceProbeMask, mrvAddressToBech32, mrvBech32ToAddress, mrvCodeHashHex, mrvV1TransactionExtension, nameLengthModifierX10, nameRegistrationCost, nameRegistryAddressHex, nativeAgentStateFilterParams, nativeDevSchemaFieldNames, nativeDevUiStrings, nativeEventMatches, nativeEventsFilterParams, nativeEventsFromHistory, nativeEventsFromReceipt, nativeMarketEventFilter, nativeMarketEventsFromHistory, nativeMarketEventsFromReceipt, nativeMarketStateFilterParams, noEvmReceiptTrustPolicyFromChainInfo, nodeHostingClassFromByte, nodeHostingClassToByte, nodeRegistryAddressHex, normalizeAddressHex, normalizeBridgeRouteCatalogue, normalizePendingChangeKind, oracleAddressHex, oraclePriceToNumber, packTimeWindow, parseAddress, parseBridgeRouteCatalogueJson, parseChainRegistryToml, parseDkgResharePublicKeys, parseLythToLythoshi, parseNameCategory, parseNativeDecodedEvent, parseQuantity, parseQuantityBig, preflightClusterJoinRequest, previewRequestClusterJoin, previewVoteClusterAdmit, proverMarketStateFromByte, pubkeyRegistryAddressHex, quoteOperatorFee, rankBridgeRoutes, rankMarketsByVolume, readClusterJoinRequest, requestSighash, requireTypedAddress, resolveClusterJoinExecutionFee, resolveExecutionFee, resolveMaxExecutionUnitPrice, resolveRegistryExecutionFee, resolveStudioHostStatus, selectBridgeTransferRoute, serviceProbeStatusLabel, setDestinationRoot, spendingPolicyAddressHex, submitMrvCallNativeTx, submitMrvDeployNativeTx, submitMrvDeployPayloadNativeTx, submitRequestClusterJoin, submitSighash, submitVoteClusterAdmit, transactionFeeExposure, typedBech32ToAddress, validateAddress, validateBridgeRouteCatalogue, validateMrvArtifactMetadata, validateMrvCallRequest, validateMrvDeployRequest, verifyNoEvmArchiveProofSignatures, verifyNoEvmBlockFinalityEvidenceMultisig, verifyNoEvmBlockFinalityEvidenceThreshold, verifyNoEvmFinalityEvidenceMultisig, verifyNoEvmFinalityEvidenceThreshold, verifyNoEvmReceiptProof, verifyNoEvmReceiptProofTrust, version };
10353
10888
  //# sourceMappingURL=index.js.map
10354
10889
  //# sourceMappingURL=index.js.map