@monolythium/core-sdk 0.4.5 → 0.4.9
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/README.md +45 -1
- package/dist/crypto/index.cjs +36 -0
- package/dist/crypto/index.cjs.map +1 -1
- package/dist/crypto/index.d.cts +2 -2
- package/dist/crypto/index.d.ts +2 -2
- package/dist/crypto/index.js +36 -1
- package/dist/crypto/index.js.map +1 -1
- package/dist/index.cjs +710 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +162 -42
- package/dist/index.d.ts +162 -42
- package/dist/index.js +663 -85
- package/dist/index.js.map +1 -1
- package/dist/{submission-D9k_xppI.d.cts → submission-7MkZky2W.d.cts} +141 -15
- package/dist/{submission-D9k_xppI.d.ts → submission-7MkZky2W.d.ts} +141 -15
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -451,7 +451,13 @@ var NODE_REGISTRY_SELECTORS = {
|
|
|
451
451
|
/** `getClusterJoinRequest(uint32,bytes32)` — CJ-1 request status view. */
|
|
452
452
|
getClusterJoinRequest: "0x" + selectorHex("getClusterJoinRequest(uint32,bytes32)"),
|
|
453
453
|
/** `formCluster(bytes,bytes,bytes)` — no-foundation cluster formation by roster consent. */
|
|
454
|
-
formCluster: "0x" + selectorHex("formCluster(bytes,bytes,bytes)")
|
|
454
|
+
formCluster: "0x" + selectorHex("formCluster(bytes,bytes,bytes)"),
|
|
455
|
+
/** `setOperatorDisplay(bytes32,string,string)` — owner-callable public display metadata. */
|
|
456
|
+
setOperatorDisplay: "0x" + selectorHex("setOperatorDisplay(bytes32,string,string)"),
|
|
457
|
+
/** `publishOperatorSealKey(bytes32,bytes)` — owner-callable LythiumSeal EK publication. */
|
|
458
|
+
publishOperatorSealKey: "0x" + selectorHex("publishOperatorSealKey(bytes32,bytes)"),
|
|
459
|
+
/** `getOperatorSealKey(bytes32)` view — returns the operator's published LythiumSeal EK. */
|
|
460
|
+
getOperatorSealKey: "0x" + selectorHex("getOperatorSealKey(bytes32)")
|
|
455
461
|
};
|
|
456
462
|
var NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES = 48;
|
|
457
463
|
var NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
|
|
@@ -459,6 +465,7 @@ var NODE_REGISTRY_BLS_PUBKEY_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
|
|
|
459
465
|
var NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES = 1952;
|
|
460
466
|
var NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES = 3309;
|
|
461
467
|
var NODE_REGISTRY_CONSENSUS_POP_BYTES = 3309;
|
|
468
|
+
var NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES = 1184;
|
|
462
469
|
var NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES = 96;
|
|
463
470
|
var NODE_REGISTRY_DKG_THRESHOLD_SIG_BYTES = NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES;
|
|
464
471
|
var NODE_REGISTRY_DKG_RESHARE_MIN_SIGNERS = 5;
|
|
@@ -469,6 +476,8 @@ var NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT = 3;
|
|
|
469
476
|
var NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT = NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT + NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT;
|
|
470
477
|
var NODE_REGISTRY_FORM_CLUSTER_THRESHOLD = 7;
|
|
471
478
|
var NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN = "PROTOCORE_NODE_REGISTRY_CLUSTER_FORM_V1\0";
|
|
479
|
+
var NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES = 128;
|
|
480
|
+
var NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES = 64;
|
|
472
481
|
var PENDING_CHANGE_KIND_CODES = {
|
|
473
482
|
add: 1,
|
|
474
483
|
remove: 2,
|
|
@@ -677,6 +686,68 @@ function encodeVoteClusterAdmitCalldata(args) {
|
|
|
677
686
|
)
|
|
678
687
|
);
|
|
679
688
|
}
|
|
689
|
+
function encodeSetOperatorDisplayCalldata(args) {
|
|
690
|
+
const peerId = expectLength2(toBytes(args.peerId), 32, "peerId");
|
|
691
|
+
const moniker = displayTextBytes(
|
|
692
|
+
args.moniker,
|
|
693
|
+
NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES,
|
|
694
|
+
"moniker"
|
|
695
|
+
);
|
|
696
|
+
const alias = displayTextBytes(args.alias, NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES, "alias");
|
|
697
|
+
const monikerPadded = padToWord(moniker);
|
|
698
|
+
const aliasPadded = padToWord(alias);
|
|
699
|
+
const monikerOffset = 3n * 32n;
|
|
700
|
+
const aliasOffset = monikerOffset + 32n + BigInt(monikerPadded.length);
|
|
701
|
+
return bytesToHex(
|
|
702
|
+
concatBytes(
|
|
703
|
+
hexToBytes(NODE_REGISTRY_SELECTORS.setOperatorDisplay),
|
|
704
|
+
peerId,
|
|
705
|
+
uint64Word(monikerOffset, "monikerOffset"),
|
|
706
|
+
uint64Word(aliasOffset, "aliasOffset"),
|
|
707
|
+
uint64Word(BigInt(moniker.length), "monikerLength"),
|
|
708
|
+
monikerPadded,
|
|
709
|
+
uint64Word(BigInt(alias.length), "aliasLength"),
|
|
710
|
+
aliasPadded
|
|
711
|
+
)
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
function encodePublishOperatorSealKeyCalldata(args) {
|
|
715
|
+
const peerId = expectLength2(toBytes(args.peerId), 32, "peerId");
|
|
716
|
+
const sealEk = expectNonZeroBytes(
|
|
717
|
+
expectLength2(toBytes(args.sealEk), NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES, "sealEk"),
|
|
718
|
+
"sealEk"
|
|
719
|
+
);
|
|
720
|
+
const sealEkPadded = padToWord(sealEk);
|
|
721
|
+
return bytesToHex(
|
|
722
|
+
concatBytes(
|
|
723
|
+
hexToBytes(NODE_REGISTRY_SELECTORS.publishOperatorSealKey),
|
|
724
|
+
peerId,
|
|
725
|
+
uint64Word(2n * 32n, "sealEkOffset"),
|
|
726
|
+
uint64Word(BigInt(sealEk.length), "sealEkLength"),
|
|
727
|
+
sealEkPadded
|
|
728
|
+
)
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
function encodeGetOperatorSealKeyCalldata(args) {
|
|
732
|
+
return bytesToHex(
|
|
733
|
+
concatBytes(
|
|
734
|
+
hexToBytes(NODE_REGISTRY_SELECTORS.getOperatorSealKey),
|
|
735
|
+
expectLength2(toBytes(args.operatorId), 32, "operatorId")
|
|
736
|
+
)
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
function decodeOperatorSealKey(returnData) {
|
|
740
|
+
const bytes = toBytes(returnData);
|
|
741
|
+
if (bytes.length === NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES) {
|
|
742
|
+
return bytesToHex(expectNonZeroBytes(bytes, "operatorSealKey"));
|
|
743
|
+
}
|
|
744
|
+
const sealEk = decodeDynamicBytesResult(
|
|
745
|
+
bytes,
|
|
746
|
+
NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES,
|
|
747
|
+
"operatorSealKey"
|
|
748
|
+
);
|
|
749
|
+
return bytesToHex(expectNonZeroBytes(sealEk, "operatorSealKey"));
|
|
750
|
+
}
|
|
680
751
|
function encodeCancelClusterJoinCalldata(args) {
|
|
681
752
|
return bytesToHex(
|
|
682
753
|
concatBytes(
|
|
@@ -1050,6 +1121,19 @@ function toBytes(value) {
|
|
|
1050
1121
|
}
|
|
1051
1122
|
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
1052
1123
|
}
|
|
1124
|
+
function displayTextBytes(value, maxBytes, name) {
|
|
1125
|
+
for (const ch of value) {
|
|
1126
|
+
const code = ch.codePointAt(0);
|
|
1127
|
+
if (code !== void 0 && (code >= 0 && code <= 31 || code >= 127 && code <= 159)) {
|
|
1128
|
+
throw new NodeRegistryError(`${name} must not contain control characters`);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
const bytes = new TextEncoder().encode(value);
|
|
1132
|
+
if (bytes.length > maxBytes) {
|
|
1133
|
+
throw new NodeRegistryError(`${name} must be <= ${maxBytes} UTF-8 bytes`);
|
|
1134
|
+
}
|
|
1135
|
+
return bytes;
|
|
1136
|
+
}
|
|
1053
1137
|
function hexToBytes(hex) {
|
|
1054
1138
|
const body = hex.startsWith("0x") || hex.startsWith("0X") ? hex.slice(2) : hex;
|
|
1055
1139
|
if (body.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(body)) {
|
|
@@ -1079,6 +1163,30 @@ function expectLength2(value, len, name) {
|
|
|
1079
1163
|
}
|
|
1080
1164
|
return value;
|
|
1081
1165
|
}
|
|
1166
|
+
function expectNonZeroBytes(value, name) {
|
|
1167
|
+
if (value.every((byte) => byte === 0)) {
|
|
1168
|
+
throw new NodeRegistryError(`${name} must not be all-zero`);
|
|
1169
|
+
}
|
|
1170
|
+
return value;
|
|
1171
|
+
}
|
|
1172
|
+
function decodeDynamicBytesResult(bytes, expectedLength, label) {
|
|
1173
|
+
if (bytes.length < 64) {
|
|
1174
|
+
throw new NodeRegistryError(`${label} return must be ABI-encoded dynamic bytes`);
|
|
1175
|
+
}
|
|
1176
|
+
const offset = uintFromWord(bytes.slice(0, 32));
|
|
1177
|
+
if (offset !== 32n) {
|
|
1178
|
+
throw new NodeRegistryError(`${label} return offset must be 0x20`);
|
|
1179
|
+
}
|
|
1180
|
+
const len = uintFromWord(bytes.slice(32, 64));
|
|
1181
|
+
if (len !== BigInt(expectedLength)) {
|
|
1182
|
+
throw new NodeRegistryError(`${label} must be ${expectedLength} bytes, got ${len}`);
|
|
1183
|
+
}
|
|
1184
|
+
const paddedLen = Math.ceil(expectedLength / 32) * 32;
|
|
1185
|
+
if (bytes.length < 64 + paddedLen) {
|
|
1186
|
+
throw new NodeRegistryError(`${label} body is truncated`);
|
|
1187
|
+
}
|
|
1188
|
+
return bytes.slice(64, 64 + expectedLength);
|
|
1189
|
+
}
|
|
1082
1190
|
|
|
1083
1191
|
// src/crypto/bytes.ts
|
|
1084
1192
|
function concatBytes2(...chunks) {
|
|
@@ -1324,6 +1432,7 @@ var MlDsa65Backend = class _MlDsa65Backend {
|
|
|
1324
1432
|
#secretKey;
|
|
1325
1433
|
#publicKey;
|
|
1326
1434
|
#addressBytes;
|
|
1435
|
+
#disposed = false;
|
|
1327
1436
|
constructor(secretKey, publicKey) {
|
|
1328
1437
|
this.#secretKey = expectBytes(secretKey, ML_DSA_65_SIGNING_KEY_LEN, "ML-DSA-65 secret key").slice();
|
|
1329
1438
|
this.#publicKey = expectBytes(publicKey, ML_DSA_65_PUBLIC_KEY_LEN, "ML-DSA-65 public key").slice();
|
|
@@ -1343,8 +1452,35 @@ var MlDsa65Backend = class _MlDsa65Backend {
|
|
|
1343
1452
|
return bytesToHex2(this.#addressBytes);
|
|
1344
1453
|
}
|
|
1345
1454
|
sign(message) {
|
|
1455
|
+
if (this.#disposed) {
|
|
1456
|
+
throw new Error("MlDsa65Backend disposed");
|
|
1457
|
+
}
|
|
1346
1458
|
return mlDsa_js.ml_dsa65.sign(message, this.#secretKey, { extraEntropy: false });
|
|
1347
1459
|
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Best-effort deterministic wipe of the in-memory secret key. Zeroes the
|
|
1462
|
+
* SDK-held `#secretKey` copy and makes any subsequent `sign()` /
|
|
1463
|
+
* `signPrehash()` / `signEvmTx()` throw `"MlDsa65Backend disposed"` rather
|
|
1464
|
+
* than signing with a zeroed key. Idempotent. Public material
|
|
1465
|
+
* (`publicKey()` / `getAddress()` / `verify()`) stays usable.
|
|
1466
|
+
*
|
|
1467
|
+
* Defense-in-depth (S1-01): narrows the post-lock residency window of the
|
|
1468
|
+
* ML-DSA-65 secret in the JS heap. `@noble/post-quantum`'s internal
|
|
1469
|
+
* transient keygen/sign buffers are out of scope; the SDK-held copy is the
|
|
1470
|
+
* meaningful residency win.
|
|
1471
|
+
*/
|
|
1472
|
+
dispose() {
|
|
1473
|
+
this.#secretKey.fill(0);
|
|
1474
|
+
this.#disposed = true;
|
|
1475
|
+
}
|
|
1476
|
+
/** Alias for {@link dispose}. */
|
|
1477
|
+
zeroize() {
|
|
1478
|
+
this.dispose();
|
|
1479
|
+
}
|
|
1480
|
+
/** Whether {@link dispose} has been called (the secret key is wiped). */
|
|
1481
|
+
get disposed() {
|
|
1482
|
+
return this.#disposed;
|
|
1483
|
+
}
|
|
1348
1484
|
signPrehash(digest) {
|
|
1349
1485
|
return this.sign(expectBytes(digest, 32, "prehash"));
|
|
1350
1486
|
}
|
|
@@ -2706,8 +2842,8 @@ var TESTNET_69420 = {
|
|
|
2706
2842
|
network: "testnet-69420",
|
|
2707
2843
|
display_name: "Monolythium Testnet",
|
|
2708
2844
|
description: "Public Monolythium testnet. Testnet state may reset without notice; do not store value on this network.",
|
|
2709
|
-
genesis_hash: "
|
|
2710
|
-
binary_sha: "
|
|
2845
|
+
genesis_hash: "0x4327b7e8d1c06eed00194152f8235acaec5ba84a01487c885d9933840dc36fa5",
|
|
2846
|
+
binary_sha: "898cf29081ec",
|
|
2711
2847
|
rpc: [
|
|
2712
2848
|
{
|
|
2713
2849
|
url: "http://178.105.12.9:8545",
|
|
@@ -2768,7 +2904,7 @@ var TESTNET_69420 = {
|
|
|
2768
2904
|
{
|
|
2769
2905
|
url: "http://162.55.54.198:8545",
|
|
2770
2906
|
provider: "monolythium-foundation",
|
|
2771
|
-
region: "
|
|
2907
|
+
region: "fsn1",
|
|
2772
2908
|
tier: "official",
|
|
2773
2909
|
notes: "operator-9"
|
|
2774
2910
|
},
|
|
@@ -2779,24 +2915,10 @@ var TESTNET_69420 = {
|
|
|
2779
2915
|
tier: "official",
|
|
2780
2916
|
notes: "operator-10"
|
|
2781
2917
|
},
|
|
2782
|
-
{
|
|
2783
|
-
url: "http://5.223.65.201:8545",
|
|
2784
|
-
provider: "monolythium-foundation",
|
|
2785
|
-
region: "sin",
|
|
2786
|
-
tier: "official",
|
|
2787
|
-
notes: "operator-11; APAC"
|
|
2788
|
-
},
|
|
2789
|
-
{
|
|
2790
|
-
url: "http://128.140.125.5:8545",
|
|
2791
|
-
provider: "monolythium-foundation",
|
|
2792
|
-
region: "fsn1",
|
|
2793
|
-
tier: "official",
|
|
2794
|
-
notes: "operator-12"
|
|
2795
|
-
},
|
|
2796
2918
|
{
|
|
2797
2919
|
url: "http://178.105.45.210:8545",
|
|
2798
2920
|
provider: "monolythium-foundation",
|
|
2799
|
-
region: "
|
|
2921
|
+
region: "fsn1",
|
|
2800
2922
|
tier: "official",
|
|
2801
2923
|
notes: "relay-1"
|
|
2802
2924
|
},
|
|
@@ -2810,52 +2932,52 @@ var TESTNET_69420 = {
|
|
|
2810
2932
|
],
|
|
2811
2933
|
p2p: [
|
|
2812
2934
|
{
|
|
2813
|
-
multiaddr: "/ip4/178.105.12.9/tcp/29898/p2p/
|
|
2935
|
+
multiaddr: "/ip4/178.105.12.9/tcp/29898/p2p/12D3KooWGgh9vYbNSqYbci8w7bg2AAaFWx7umN1ADjjcUoUTF2Za",
|
|
2814
2936
|
region: "fsn1"
|
|
2815
2937
|
},
|
|
2816
2938
|
{
|
|
2817
|
-
multiaddr: "/ip4/178.105.15.216/tcp/29898/p2p/
|
|
2939
|
+
multiaddr: "/ip4/178.105.15.216/tcp/29898/p2p/12D3KooWPUMj4vt1ee1Ug2QMJQwbDHSJ936JVaqw3iLXtAqPrq7R",
|
|
2818
2940
|
region: "fsn1"
|
|
2819
2941
|
},
|
|
2820
2942
|
{
|
|
2821
|
-
multiaddr: "/ip4/178.104.233.182/tcp/29898/p2p/
|
|
2943
|
+
multiaddr: "/ip4/178.104.233.182/tcp/29898/p2p/12D3KooWLPNJFUZhXyc1S7YvjMiKXyrNKCN3eFegDFF5UZAio7NJ",
|
|
2822
2944
|
region: "nbg1"
|
|
2823
2945
|
},
|
|
2824
2946
|
{
|
|
2825
|
-
multiaddr: "/ip4/65.108.94.1/tcp/29898/p2p/
|
|
2947
|
+
multiaddr: "/ip4/65.108.94.1/tcp/29898/p2p/12D3KooWRAuuQa5iEAzLUpLnyZ9VM53dvZMt3FPj7smDcwXn3oxz",
|
|
2826
2948
|
region: "hel1"
|
|
2827
2949
|
},
|
|
2828
2950
|
{
|
|
2829
|
-
multiaddr: "/ip4/95.216.154.155/tcp/29898/p2p/
|
|
2951
|
+
multiaddr: "/ip4/95.216.154.155/tcp/29898/p2p/12D3KooWFc9sVuCAuLxFTVy8KN5KXhyDvPjKkU98ySK81dFyStN8",
|
|
2830
2952
|
region: "hel1"
|
|
2831
2953
|
},
|
|
2832
2954
|
{
|
|
2833
|
-
multiaddr: "/ip4/87.99.145.48/tcp/29898/p2p/
|
|
2955
|
+
multiaddr: "/ip4/87.99.145.48/tcp/29898/p2p/12D3KooWL2KLRUHybGLd736nusDRTF2V1a9waeTsxKPwF78HDCmb",
|
|
2834
2956
|
region: "ash"
|
|
2835
2957
|
},
|
|
2836
2958
|
{
|
|
2837
|
-
multiaddr: "/ip4/5.223.85.76/tcp/29898/p2p/
|
|
2959
|
+
multiaddr: "/ip4/5.223.85.76/tcp/29898/p2p/12D3KooWHvobdzzEAiKcFkgdkRfr8vWGyWYfBoWS3jnPycvfwGrK",
|
|
2838
2960
|
region: "sin"
|
|
2839
2961
|
},
|
|
2840
2962
|
{
|
|
2841
|
-
multiaddr: "/ip4/142.132.180.99/tcp/29898/p2p/
|
|
2963
|
+
multiaddr: "/ip4/142.132.180.99/tcp/29898/p2p/12D3KooWBcAeWScYmDWPTjNM47CkKR4vEf44CNhDCcWuGpyY7Hko",
|
|
2842
2964
|
region: "fsn1"
|
|
2843
2965
|
},
|
|
2844
2966
|
{
|
|
2845
|
-
multiaddr: "/ip4/162.55.54.198/tcp/29898/p2p/
|
|
2846
|
-
region: "
|
|
2967
|
+
multiaddr: "/ip4/162.55.54.198/tcp/29898/p2p/12D3KooWRBA5Wzs619GuMY2NrDD6fGoLYCK2tkXff2JAZyXn7RvR",
|
|
2968
|
+
region: "fsn1"
|
|
2847
2969
|
},
|
|
2848
2970
|
{
|
|
2849
|
-
multiaddr: "/ip4/95.217.156.190/tcp/29898/p2p/
|
|
2971
|
+
multiaddr: "/ip4/95.217.156.190/tcp/29898/p2p/12D3KooWPBr8guuWoZT59AobZEBHDZqKgwHWAP3aKUzKWeGTa7Z6",
|
|
2850
2972
|
region: "hel1"
|
|
2851
2973
|
},
|
|
2852
2974
|
{
|
|
2853
|
-
multiaddr: "/ip4/
|
|
2854
|
-
region: "
|
|
2975
|
+
multiaddr: "/ip4/178.105.45.210/tcp/29898/p2p/12D3KooWQRpCMLezJmvqqpbpEu8ixGHgonqianG1aVZjw6GiStbd",
|
|
2976
|
+
region: "fsn1"
|
|
2855
2977
|
},
|
|
2856
2978
|
{
|
|
2857
|
-
multiaddr: "/ip4/
|
|
2858
|
-
region: "
|
|
2979
|
+
multiaddr: "/ip4/65.21.252.34/tcp/29898/p2p/12D3KooWRGzTwPX21Nee2c39RWuT2ayNWb6NMX19jCx8recrNeXL",
|
|
2980
|
+
region: "hel1"
|
|
2859
2981
|
}
|
|
2860
2982
|
]
|
|
2861
2983
|
};
|
|
@@ -3652,6 +3774,16 @@ var RpcClient = class _RpcClient {
|
|
|
3652
3774
|
async ethGetCode(address, block = "latest") {
|
|
3653
3775
|
return this.call("eth_getCode", [address, encodeBlockSelector(block)]);
|
|
3654
3776
|
}
|
|
3777
|
+
/** `eth_call` — read-only execution against committed state. */
|
|
3778
|
+
async ethCall(request, block = "latest") {
|
|
3779
|
+
return this.call("eth_call", [request, encodeBlockSelector(block)]);
|
|
3780
|
+
}
|
|
3781
|
+
/** `eth_estimateGas` — read-only execution-unit estimate for a call object. */
|
|
3782
|
+
async ethEstimateGas(request, block = "latest") {
|
|
3783
|
+
return parseQuantityBig(
|
|
3784
|
+
await this.call("eth_estimateGas", [request, encodeBlockSelector(block)])
|
|
3785
|
+
);
|
|
3786
|
+
}
|
|
3655
3787
|
/** Compatibility block-header read by height/tag. */
|
|
3656
3788
|
async ethGetBlockByNumber(block = "latest") {
|
|
3657
3789
|
return normalizeBlockHeader(await this.call(ethCompatMethod("getBlockByNumber"), [encodeBlockSelector(block)]));
|
|
@@ -8350,6 +8482,7 @@ function pqm1MnemonicToMlDsa65Backend(mnemonic) {
|
|
|
8350
8482
|
|
|
8351
8483
|
// src/cluster-join.ts
|
|
8352
8484
|
var DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT = REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
8485
|
+
var DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT = REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
8353
8486
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
8354
8487
|
var MAX_UINT32 = (1n << 32n) - 1n;
|
|
8355
8488
|
function deriveClusterJoinOperatorId(operatorPubkey) {
|
|
@@ -8457,6 +8590,24 @@ function buildVoteClusterAdmitTxFields(args) {
|
|
|
8457
8590
|
})
|
|
8458
8591
|
};
|
|
8459
8592
|
}
|
|
8593
|
+
function buildPublishOperatorSealKeyTxFields(args) {
|
|
8594
|
+
return {
|
|
8595
|
+
chainId: args.chainId,
|
|
8596
|
+
nonce: args.nonce,
|
|
8597
|
+
maxFeePerGas: parseBigint(args.fee.maxFeePerGas, "maxFeePerGas"),
|
|
8598
|
+
maxPriorityFeePerGas: parseBigint(args.fee.maxPriorityFeePerGas, "maxPriorityFeePerGas"),
|
|
8599
|
+
gasLimit: parseBigint(
|
|
8600
|
+
args.fee.gasLimit ?? DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT,
|
|
8601
|
+
"gasLimit"
|
|
8602
|
+
),
|
|
8603
|
+
to: nodeRegistryAddressHex(),
|
|
8604
|
+
value: 0n,
|
|
8605
|
+
input: encodePublishOperatorSealKeyCalldata({
|
|
8606
|
+
peerId: normalizeOperatorId(args.peerId),
|
|
8607
|
+
sealEk: normalizeOperatorSealEk(args.sealEk)
|
|
8608
|
+
})
|
|
8609
|
+
};
|
|
8610
|
+
}
|
|
8460
8611
|
async function submitRequestClusterJoin(args) {
|
|
8461
8612
|
const clusterId = parseUint32(args.clusterId, "clusterId");
|
|
8462
8613
|
const operatorPubkey = normalizeConsensusPubkey(args.operatorPubkey, "operatorPubkey");
|
|
@@ -8512,6 +8663,39 @@ async function submitVoteClusterAdmit(args) {
|
|
|
8512
8663
|
});
|
|
8513
8664
|
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex, args);
|
|
8514
8665
|
}
|
|
8666
|
+
async function submitPublishOperatorSealKey(args) {
|
|
8667
|
+
const operatorIdHex = normalizeOperatorId(args.peerId);
|
|
8668
|
+
const sealEk = normalizeOperatorSealEk(args.sealEk);
|
|
8669
|
+
const backend = pqm1MnemonicToMlDsa65Backend(args.mnemonic);
|
|
8670
|
+
const senderAddress = addressToTypedBech32("user", backend.addressBytes());
|
|
8671
|
+
const [chainId, nonce, quote] = await Promise.all([
|
|
8672
|
+
args.client.ethChainId(),
|
|
8673
|
+
args.client.lythGetTransactionCount(senderAddress),
|
|
8674
|
+
args.client.lythExecutionUnitPrice()
|
|
8675
|
+
]);
|
|
8676
|
+
const tx = buildPublishOperatorSealKeyTxFields({
|
|
8677
|
+
chainId,
|
|
8678
|
+
nonce,
|
|
8679
|
+
fee: resolveClusterJoinExecutionFee(quote, {
|
|
8680
|
+
...args,
|
|
8681
|
+
executionUnitLimit: args.executionUnitLimit ?? DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT
|
|
8682
|
+
}),
|
|
8683
|
+
peerId: operatorIdHex,
|
|
8684
|
+
sealEk
|
|
8685
|
+
});
|
|
8686
|
+
const plaintext = buildPlaintextSubmission({ backend, tx });
|
|
8687
|
+
const txHash = await submitPlaintextTransaction(
|
|
8688
|
+
args.client,
|
|
8689
|
+
plaintext.signedTxWireHex,
|
|
8690
|
+
plaintext.innerTxHashHex
|
|
8691
|
+
);
|
|
8692
|
+
return {
|
|
8693
|
+
txHash,
|
|
8694
|
+
operatorIdHex,
|
|
8695
|
+
innerSighashHex: plaintext.innerSighashHex,
|
|
8696
|
+
signedTxWireBytes: plaintext.innerWireBytes
|
|
8697
|
+
};
|
|
8698
|
+
}
|
|
8515
8699
|
async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex, options) {
|
|
8516
8700
|
if (options.private !== false) {
|
|
8517
8701
|
const encrypted = await buildEncryptedSubmission({
|
|
@@ -8599,6 +8783,10 @@ function normalizeOperatorId(value) {
|
|
|
8599
8783
|
const bytes = typeof value === "string" ? hexToBytes2(value, "operatorId") : value;
|
|
8600
8784
|
return bytesToHex2(expectBytes(bytes, 32, "operatorId"));
|
|
8601
8785
|
}
|
|
8786
|
+
function normalizeOperatorSealEk(value) {
|
|
8787
|
+
const bytes = typeof value === "string" ? hexToBytes2(value, "sealEk") : value;
|
|
8788
|
+
return expectBytes(bytes, NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES, "sealEk").slice();
|
|
8789
|
+
}
|
|
8602
8790
|
function parseUint32(value, label) {
|
|
8603
8791
|
const parsed = parseBigint(value, label);
|
|
8604
8792
|
if (parsed < 0n || parsed > MAX_UINT32) {
|
|
@@ -8813,15 +9001,405 @@ function expectLength4(value, len, name) {
|
|
|
8813
9001
|
}
|
|
8814
9002
|
return value;
|
|
8815
9003
|
}
|
|
9004
|
+
var TokenFactoryError = class extends Error {
|
|
9005
|
+
constructor(message) {
|
|
9006
|
+
super(message);
|
|
9007
|
+
this.name = "TokenFactoryError";
|
|
9008
|
+
}
|
|
9009
|
+
};
|
|
9010
|
+
var TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI = 3000000000000000n;
|
|
9011
|
+
var TOKEN_FACTORY_NAME_MAX_BYTES = 256;
|
|
9012
|
+
var TOKEN_FACTORY_SYMBOL_MAX_BYTES = 256;
|
|
9013
|
+
var TOKEN_FACTORY_MAX_DECIMALS = 30;
|
|
9014
|
+
var TOKEN_FACTORY_MAX_CREATOR_FEE_BPS = 1e4;
|
|
9015
|
+
var TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG = 250;
|
|
9016
|
+
var TOKEN_FACTORY_FLAGS = {
|
|
9017
|
+
MINTABLE: 1 << 0,
|
|
9018
|
+
BURNABLE: 1 << 1,
|
|
9019
|
+
PAUSABLE: 1 << 2,
|
|
9020
|
+
FIXED_SUPPLY: 1 << 3,
|
|
9021
|
+
CREATOR_FEE_OPT_IN: 1 << 4,
|
|
9022
|
+
DESTRUCTIBLE: 1 << 5
|
|
9023
|
+
};
|
|
9024
|
+
var TOKEN_FACTORY_KNOWN_FLAG_MASK = TOKEN_FACTORY_FLAGS.MINTABLE | TOKEN_FACTORY_FLAGS.BURNABLE | TOKEN_FACTORY_FLAGS.PAUSABLE | TOKEN_FACTORY_FLAGS.FIXED_SUPPLY | TOKEN_FACTORY_FLAGS.CREATOR_FEE_OPT_IN | TOKEN_FACTORY_FLAGS.DESTRUCTIBLE;
|
|
9025
|
+
var TOKEN_FACTORY_SIGS = {
|
|
9026
|
+
createToken: "createToken(string,string,uint8,uint256,uint256,uint32,uint16)",
|
|
9027
|
+
transfer: "transfer(bytes32,address,uint256)",
|
|
9028
|
+
transferFrom: "transferFrom(bytes32,address,address,uint256)",
|
|
9029
|
+
approve: "approve(bytes32,address,uint256)",
|
|
9030
|
+
increaseAllowance: "increaseAllowance(bytes32,address,uint256)",
|
|
9031
|
+
decreaseAllowance: "decreaseAllowance(bytes32,address,uint256)",
|
|
9032
|
+
balanceOf: "balanceOf(bytes32,address)",
|
|
9033
|
+
allowance: "allowance(bytes32,address,address)",
|
|
9034
|
+
totalSupply: "totalSupply(bytes32)",
|
|
9035
|
+
metadata: "metadata(bytes32)",
|
|
9036
|
+
mint: "mint(bytes32,address,uint256)",
|
|
9037
|
+
burn: "burn(bytes32,uint256)",
|
|
9038
|
+
setPaused: "setPaused(bytes32,bool)",
|
|
9039
|
+
transferOwnership: "transferOwnership(bytes32,address)",
|
|
9040
|
+
destroyToken: "destroyToken(bytes32)"
|
|
9041
|
+
};
|
|
9042
|
+
var TOKEN_FACTORY_SELECTORS = {
|
|
9043
|
+
createToken: selectorHex3(TOKEN_FACTORY_SIGS.createToken),
|
|
9044
|
+
transfer: selectorHex3(TOKEN_FACTORY_SIGS.transfer),
|
|
9045
|
+
transferFrom: selectorHex3(TOKEN_FACTORY_SIGS.transferFrom),
|
|
9046
|
+
approve: selectorHex3(TOKEN_FACTORY_SIGS.approve),
|
|
9047
|
+
increaseAllowance: selectorHex3(TOKEN_FACTORY_SIGS.increaseAllowance),
|
|
9048
|
+
decreaseAllowance: selectorHex3(TOKEN_FACTORY_SIGS.decreaseAllowance),
|
|
9049
|
+
balanceOf: selectorHex3(TOKEN_FACTORY_SIGS.balanceOf),
|
|
9050
|
+
allowance: selectorHex3(TOKEN_FACTORY_SIGS.allowance),
|
|
9051
|
+
totalSupply: selectorHex3(TOKEN_FACTORY_SIGS.totalSupply),
|
|
9052
|
+
metadata: selectorHex3(TOKEN_FACTORY_SIGS.metadata),
|
|
9053
|
+
mint: selectorHex3(TOKEN_FACTORY_SIGS.mint),
|
|
9054
|
+
burn: selectorHex3(TOKEN_FACTORY_SIGS.burn),
|
|
9055
|
+
setPaused: selectorHex3(TOKEN_FACTORY_SIGS.setPaused),
|
|
9056
|
+
transferOwnership: selectorHex3(TOKEN_FACTORY_SIGS.transferOwnership),
|
|
9057
|
+
destroyToken: selectorHex3(TOKEN_FACTORY_SIGS.destroyToken)
|
|
9058
|
+
};
|
|
9059
|
+
function tokenFactoryAddressHex() {
|
|
9060
|
+
return PRECOMPILE_ADDRESSES.TOKEN_FACTORY.toLowerCase();
|
|
9061
|
+
}
|
|
9062
|
+
function deriveTokenFactoryTokenId(creator, creatorTokenNonce) {
|
|
9063
|
+
const nonce = parseUint(creatorTokenNonce, "creatorTokenNonce", 64);
|
|
9064
|
+
return bytesToHex2(
|
|
9065
|
+
sha3_js.keccak_256(
|
|
9066
|
+
concatBytes2(
|
|
9067
|
+
new Uint8Array([TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG]),
|
|
9068
|
+
addressBytes(creator, "creator"),
|
|
9069
|
+
uint64Be(nonce)
|
|
9070
|
+
)
|
|
9071
|
+
)
|
|
9072
|
+
);
|
|
9073
|
+
}
|
|
9074
|
+
function encodeCreateTokenCalldata(args) {
|
|
9075
|
+
const name = textBytes(args.name, "name", TOKEN_FACTORY_NAME_MAX_BYTES);
|
|
9076
|
+
const symbol = textBytes(args.symbol, "symbol", TOKEN_FACTORY_SYMBOL_MAX_BYTES);
|
|
9077
|
+
const decimals = parseSmallUint(args.decimals, "decimals", TOKEN_FACTORY_MAX_DECIMALS);
|
|
9078
|
+
const initialSupply = parseUint(args.initialSupply, "initialSupply");
|
|
9079
|
+
const maxSupply = parseUint(args.maxSupply, "maxSupply");
|
|
9080
|
+
const flags = args.flags ?? 0;
|
|
9081
|
+
validateTokenFactoryFlags(flags, args.creatorFeeBps ?? 0);
|
|
9082
|
+
const creatorFeeBps = parseSmallUint(
|
|
9083
|
+
args.creatorFeeBps ?? 0,
|
|
9084
|
+
"creatorFeeBps",
|
|
9085
|
+
TOKEN_FACTORY_MAX_CREATOR_FEE_BPS
|
|
9086
|
+
);
|
|
9087
|
+
const headLen = 7 * 32;
|
|
9088
|
+
const nameTail = dynamicBytesTail(name);
|
|
9089
|
+
const symbolOffset = BigInt(headLen + nameTail.length);
|
|
9090
|
+
return bytesToHex2(
|
|
9091
|
+
concatBytes2(
|
|
9092
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.createToken, "createToken selector"),
|
|
9093
|
+
uint256Word2(BigInt(headLen), "nameOffset"),
|
|
9094
|
+
uint256Word2(symbolOffset, "symbolOffset"),
|
|
9095
|
+
uint256Word2(BigInt(decimals), "decimals"),
|
|
9096
|
+
uint256Word2(initialSupply, "initialSupply"),
|
|
9097
|
+
uint256Word2(maxSupply, "maxSupply"),
|
|
9098
|
+
uint256Word2(BigInt(flags), "flags"),
|
|
9099
|
+
uint256Word2(BigInt(creatorFeeBps), "creatorFeeBps"),
|
|
9100
|
+
nameTail,
|
|
9101
|
+
dynamicBytesTail(symbol)
|
|
9102
|
+
)
|
|
9103
|
+
);
|
|
9104
|
+
}
|
|
9105
|
+
function encodeCreateFixedSupplyMrc20Calldata(args) {
|
|
9106
|
+
let flags = TOKEN_FACTORY_FLAGS.FIXED_SUPPLY;
|
|
9107
|
+
if (args.burnable) flags |= TOKEN_FACTORY_FLAGS.BURNABLE;
|
|
9108
|
+
if (args.pausable) flags |= TOKEN_FACTORY_FLAGS.PAUSABLE;
|
|
9109
|
+
if (args.destructible) flags |= TOKEN_FACTORY_FLAGS.DESTRUCTIBLE;
|
|
9110
|
+
return encodeCreateTokenCalldata({
|
|
9111
|
+
name: args.name,
|
|
9112
|
+
symbol: args.symbol,
|
|
9113
|
+
decimals: args.decimals,
|
|
9114
|
+
initialSupply: args.supply,
|
|
9115
|
+
maxSupply: args.supply,
|
|
9116
|
+
flags,
|
|
9117
|
+
creatorFeeBps: 0
|
|
9118
|
+
});
|
|
9119
|
+
}
|
|
9120
|
+
function encodeTokenFactoryTransferCalldata(tokenId, to, amount) {
|
|
9121
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.transfer, tokenId, to, amount);
|
|
9122
|
+
}
|
|
9123
|
+
function encodeTokenFactoryTransferFromCalldata(tokenId, from, to, amount) {
|
|
9124
|
+
return bytesToHex2(
|
|
9125
|
+
concatBytes2(
|
|
9126
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.transferFrom, "transferFrom selector"),
|
|
9127
|
+
bytes32(tokenId, "tokenId"),
|
|
9128
|
+
addressWord3(from, "from"),
|
|
9129
|
+
addressWord3(to, "to"),
|
|
9130
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9131
|
+
)
|
|
9132
|
+
);
|
|
9133
|
+
}
|
|
9134
|
+
function encodeTokenFactoryApproveCalldata(tokenId, spender, amount) {
|
|
9135
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.approve, tokenId, spender, amount);
|
|
9136
|
+
}
|
|
9137
|
+
function encodeTokenFactoryIncreaseAllowanceCalldata(tokenId, spender, delta) {
|
|
9138
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.increaseAllowance, tokenId, spender, delta);
|
|
9139
|
+
}
|
|
9140
|
+
function encodeTokenFactoryDecreaseAllowanceCalldata(tokenId, spender, delta) {
|
|
9141
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.decreaseAllowance, tokenId, spender, delta);
|
|
9142
|
+
}
|
|
9143
|
+
function encodeTokenFactoryBalanceOfCalldata(tokenId, holder) {
|
|
9144
|
+
return encodeBytes32Address(TOKEN_FACTORY_SELECTORS.balanceOf, tokenId, holder);
|
|
9145
|
+
}
|
|
9146
|
+
function encodeTokenFactoryAllowanceCalldata(tokenId, owner, spender) {
|
|
9147
|
+
return bytesToHex2(
|
|
9148
|
+
concatBytes2(
|
|
9149
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.allowance, "allowance selector"),
|
|
9150
|
+
bytes32(tokenId, "tokenId"),
|
|
9151
|
+
addressWord3(owner, "owner"),
|
|
9152
|
+
addressWord3(spender, "spender")
|
|
9153
|
+
)
|
|
9154
|
+
);
|
|
9155
|
+
}
|
|
9156
|
+
function encodeTokenFactoryTotalSupplyCalldata(tokenId) {
|
|
9157
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.totalSupply, tokenId);
|
|
9158
|
+
}
|
|
9159
|
+
function encodeTokenFactoryMetadataCalldata(tokenId) {
|
|
9160
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.metadata, tokenId);
|
|
9161
|
+
}
|
|
9162
|
+
function encodeTokenFactoryMintCalldata(tokenId, to, amount) {
|
|
9163
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.mint, tokenId, to, amount);
|
|
9164
|
+
}
|
|
9165
|
+
function encodeTokenFactoryBurnCalldata(tokenId, amount) {
|
|
9166
|
+
return encodeBytes32Uint(TOKEN_FACTORY_SELECTORS.burn, tokenId, amount);
|
|
9167
|
+
}
|
|
9168
|
+
function encodeTokenFactorySetPausedCalldata(tokenId, paused) {
|
|
9169
|
+
return bytesToHex2(
|
|
9170
|
+
concatBytes2(
|
|
9171
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.setPaused, "setPaused selector"),
|
|
9172
|
+
bytes32(tokenId, "tokenId"),
|
|
9173
|
+
boolWord(paused)
|
|
9174
|
+
)
|
|
9175
|
+
);
|
|
9176
|
+
}
|
|
9177
|
+
function encodeTokenFactoryTransferOwnershipCalldata(tokenId, newOwner) {
|
|
9178
|
+
return encodeBytes32Address(TOKEN_FACTORY_SELECTORS.transferOwnership, tokenId, newOwner);
|
|
9179
|
+
}
|
|
9180
|
+
function encodeTokenFactoryDestroyCalldata(tokenId) {
|
|
9181
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.destroyToken, tokenId);
|
|
9182
|
+
}
|
|
9183
|
+
function decodeTokenFactoryTokenId(output) {
|
|
9184
|
+
return bytesToHex2(bytes32(output, "output"));
|
|
9185
|
+
}
|
|
9186
|
+
function validateTokenFactoryFlags(flags, creatorFeeBps = 0) {
|
|
9187
|
+
if (!Number.isInteger(flags) || flags < 0 || flags > 4294967295) {
|
|
9188
|
+
throw new TokenFactoryError("flags must be a uint32");
|
|
9189
|
+
}
|
|
9190
|
+
if ((flags & ~TOKEN_FACTORY_KNOWN_FLAG_MASK) !== 0) {
|
|
9191
|
+
throw new TokenFactoryError("flags contain an unknown bit");
|
|
9192
|
+
}
|
|
9193
|
+
if ((flags & TOKEN_FACTORY_FLAGS.MINTABLE) !== 0 && (flags & TOKEN_FACTORY_FLAGS.FIXED_SUPPLY) !== 0) {
|
|
9194
|
+
throw new TokenFactoryError("MINTABLE and FIXED_SUPPLY are mutually exclusive");
|
|
9195
|
+
}
|
|
9196
|
+
if ((flags & TOKEN_FACTORY_FLAGS.CREATOR_FEE_OPT_IN) !== 0) {
|
|
9197
|
+
if (creatorFeeBps <= 0) throw new TokenFactoryError("CREATOR_FEE_OPT_IN requires non-zero creatorFeeBps");
|
|
9198
|
+
} else if (creatorFeeBps !== 0) {
|
|
9199
|
+
throw new TokenFactoryError("creatorFeeBps must be 0 when CREATOR_FEE_OPT_IN is unset");
|
|
9200
|
+
}
|
|
9201
|
+
}
|
|
9202
|
+
function encodeBytes32(selector, value) {
|
|
9203
|
+
return bytesToHex2(concatBytes2(hexToBytes2(selector, "selector"), bytes32(value, "tokenId")));
|
|
9204
|
+
}
|
|
9205
|
+
function encodeBytes32Uint(selector, tokenId, amount) {
|
|
9206
|
+
return bytesToHex2(
|
|
9207
|
+
concatBytes2(
|
|
9208
|
+
hexToBytes2(selector, "selector"),
|
|
9209
|
+
bytes32(tokenId, "tokenId"),
|
|
9210
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9211
|
+
)
|
|
9212
|
+
);
|
|
9213
|
+
}
|
|
9214
|
+
function encodeBytes32Address(selector, tokenId, address) {
|
|
9215
|
+
return bytesToHex2(
|
|
9216
|
+
concatBytes2(
|
|
9217
|
+
hexToBytes2(selector, "selector"),
|
|
9218
|
+
bytes32(tokenId, "tokenId"),
|
|
9219
|
+
addressWord3(address, "address")
|
|
9220
|
+
)
|
|
9221
|
+
);
|
|
9222
|
+
}
|
|
9223
|
+
function encodeBytes32AddressUint(selector, tokenId, address, amount) {
|
|
9224
|
+
return bytesToHex2(
|
|
9225
|
+
concatBytes2(
|
|
9226
|
+
hexToBytes2(selector, "selector"),
|
|
9227
|
+
bytes32(tokenId, "tokenId"),
|
|
9228
|
+
addressWord3(address, "address"),
|
|
9229
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9230
|
+
)
|
|
9231
|
+
);
|
|
9232
|
+
}
|
|
9233
|
+
function selectorHex3(signature) {
|
|
9234
|
+
const sel = sha3_js.keccak_256(new TextEncoder().encode(signature)).slice(0, 4);
|
|
9235
|
+
return bytesToHex2(sel);
|
|
9236
|
+
}
|
|
9237
|
+
function textBytes(value, label, maxBytes) {
|
|
9238
|
+
const bytes = new TextEncoder().encode(value);
|
|
9239
|
+
if (bytes.length === 0 || bytes.length > maxBytes) {
|
|
9240
|
+
throw new TokenFactoryError(`${label} must be 1..=${maxBytes} UTF-8 bytes`);
|
|
9241
|
+
}
|
|
9242
|
+
return bytes;
|
|
9243
|
+
}
|
|
9244
|
+
function dynamicBytesTail(bytes) {
|
|
9245
|
+
return concatBytes2(uint256Word2(BigInt(bytes.length), "length"), padTo323(bytes));
|
|
9246
|
+
}
|
|
9247
|
+
function padTo323(bytes) {
|
|
9248
|
+
const padded = Math.ceil(bytes.length / 32) * 32;
|
|
9249
|
+
if (padded === bytes.length) return bytes;
|
|
9250
|
+
const out = new Uint8Array(padded);
|
|
9251
|
+
out.set(bytes);
|
|
9252
|
+
return out;
|
|
9253
|
+
}
|
|
9254
|
+
function addressWord3(value, label) {
|
|
9255
|
+
const out = new Uint8Array(32);
|
|
9256
|
+
out.set(addressBytes(value, label), 12);
|
|
9257
|
+
return out;
|
|
9258
|
+
}
|
|
9259
|
+
function addressBytes(value, label) {
|
|
9260
|
+
const bytes = toBytes5(value, label);
|
|
9261
|
+
if (bytes.length !== 20) {
|
|
9262
|
+
throw new TokenFactoryError(`${label} must be 20 bytes, got ${bytes.length}`);
|
|
9263
|
+
}
|
|
9264
|
+
return bytes;
|
|
9265
|
+
}
|
|
9266
|
+
function bytes32(value, label) {
|
|
9267
|
+
const bytes = toBytes5(value, label);
|
|
9268
|
+
if (bytes.length !== 32) {
|
|
9269
|
+
throw new TokenFactoryError(`${label} must be 32 bytes, got ${bytes.length}`);
|
|
9270
|
+
}
|
|
9271
|
+
return bytes;
|
|
9272
|
+
}
|
|
9273
|
+
function boolWord(value) {
|
|
9274
|
+
const out = new Uint8Array(32);
|
|
9275
|
+
out[31] = value ? 1 : 0;
|
|
9276
|
+
return out;
|
|
9277
|
+
}
|
|
9278
|
+
function uint256Word2(value, label) {
|
|
9279
|
+
if (value < 0n || value > (1n << 256n) - 1n) {
|
|
9280
|
+
throw new TokenFactoryError(`${label} out of uint256 range`);
|
|
9281
|
+
}
|
|
9282
|
+
const out = new Uint8Array(32);
|
|
9283
|
+
let rest = value;
|
|
9284
|
+
for (let i = 31; i >= 0 && rest > 0n; i--) {
|
|
9285
|
+
out[i] = Number(rest & 0xffn);
|
|
9286
|
+
rest >>= 8n;
|
|
9287
|
+
}
|
|
9288
|
+
return out;
|
|
9289
|
+
}
|
|
9290
|
+
function uint64Be(value) {
|
|
9291
|
+
const out = new Uint8Array(8);
|
|
9292
|
+
let rest = value;
|
|
9293
|
+
for (let i = 7; i >= 0; i--) {
|
|
9294
|
+
out[i] = Number(rest & 0xffn);
|
|
9295
|
+
rest >>= 8n;
|
|
9296
|
+
}
|
|
9297
|
+
return out;
|
|
9298
|
+
}
|
|
9299
|
+
function parseSmallUint(value, label, max) {
|
|
9300
|
+
if (!Number.isInteger(value) || value < 0 || value > max) {
|
|
9301
|
+
throw new TokenFactoryError(`${label} must be an integer in 0..=${max}`);
|
|
9302
|
+
}
|
|
9303
|
+
return value;
|
|
9304
|
+
}
|
|
9305
|
+
function parseUint(value, label, bits = 256) {
|
|
9306
|
+
let parsed;
|
|
9307
|
+
if (typeof value === "bigint") {
|
|
9308
|
+
parsed = value;
|
|
9309
|
+
} else if (typeof value === "number") {
|
|
9310
|
+
if (!Number.isSafeInteger(value)) throw new TokenFactoryError(`${label} must be a safe integer`);
|
|
9311
|
+
parsed = BigInt(value);
|
|
9312
|
+
} else if (value.startsWith("0x") || value.startsWith("0X")) {
|
|
9313
|
+
parsed = BigInt(value);
|
|
9314
|
+
} else {
|
|
9315
|
+
if (!/^[0-9]+$/.test(value)) throw new TokenFactoryError(`${label} must be a non-negative integer`);
|
|
9316
|
+
parsed = BigInt(value);
|
|
9317
|
+
}
|
|
9318
|
+
if (parsed < 0n || parsed > (1n << BigInt(bits)) - 1n) {
|
|
9319
|
+
throw new TokenFactoryError(`${label} out of uint${bits} range`);
|
|
9320
|
+
}
|
|
9321
|
+
return parsed;
|
|
9322
|
+
}
|
|
9323
|
+
function toBytes5(value, label) {
|
|
9324
|
+
if (typeof value === "string") return hexToBytes2(value, label);
|
|
9325
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9326
|
+
}
|
|
9327
|
+
|
|
9328
|
+
// src/vrf.ts
|
|
9329
|
+
var VrfCallError = class extends Error {
|
|
9330
|
+
constructor(message) {
|
|
9331
|
+
super(message);
|
|
9332
|
+
this.name = "VrfCallError";
|
|
9333
|
+
}
|
|
9334
|
+
};
|
|
9335
|
+
var VRF_OUTPUT_BYTES = 32;
|
|
9336
|
+
var VRF_DOMAIN_TAG_MAX_BYTES = 256;
|
|
9337
|
+
var VRF_HEIGHT_NOT_FINALIZED_REVERT = "vrf: height not finalized";
|
|
9338
|
+
function vrfAddressHex() {
|
|
9339
|
+
return PRECOMPILE_ADDRESSES.VRF.toLowerCase();
|
|
9340
|
+
}
|
|
9341
|
+
function encodeVrfEvaluateCalldata(blockHeight, domainTag = new Uint8Array()) {
|
|
9342
|
+
const height = parseUint64(blockHeight, "blockHeight");
|
|
9343
|
+
const tag = normalizeDomainTag(domainTag);
|
|
9344
|
+
if (tag.length > VRF_DOMAIN_TAG_MAX_BYTES) {
|
|
9345
|
+
throw new VrfCallError(`domainTag exceeds ${VRF_DOMAIN_TAG_MAX_BYTES} bytes`);
|
|
9346
|
+
}
|
|
9347
|
+
return bytesToHex2(concatBytes2(uint256Word3(height), tag));
|
|
9348
|
+
}
|
|
9349
|
+
function decodeVrfOutput(output) {
|
|
9350
|
+
const bytes = toBytes6(output, "output");
|
|
9351
|
+
if (bytes.length !== VRF_OUTPUT_BYTES) {
|
|
9352
|
+
throw new VrfCallError(`VRF output must be ${VRF_OUTPUT_BYTES} bytes, got ${bytes.length}`);
|
|
9353
|
+
}
|
|
9354
|
+
return bytes;
|
|
9355
|
+
}
|
|
9356
|
+
function normalizeDomainTag(value) {
|
|
9357
|
+
if (typeof value === "string") {
|
|
9358
|
+
if (value.startsWith("0x") || value.startsWith("0X")) return hexToBytes2(value, "domainTag");
|
|
9359
|
+
return new TextEncoder().encode(value);
|
|
9360
|
+
}
|
|
9361
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9362
|
+
}
|
|
9363
|
+
function parseUint64(value, label) {
|
|
9364
|
+
let parsed;
|
|
9365
|
+
if (typeof value === "bigint") {
|
|
9366
|
+
parsed = value;
|
|
9367
|
+
} else if (typeof value === "number") {
|
|
9368
|
+
if (!Number.isSafeInteger(value)) throw new VrfCallError(`${label} must be a safe integer`);
|
|
9369
|
+
parsed = BigInt(value);
|
|
9370
|
+
} else if (value.startsWith("0x") || value.startsWith("0X")) {
|
|
9371
|
+
parsed = BigInt(value);
|
|
9372
|
+
} else {
|
|
9373
|
+
if (!/^[0-9]+$/.test(value)) throw new VrfCallError(`${label} must be a non-negative integer`);
|
|
9374
|
+
parsed = BigInt(value);
|
|
9375
|
+
}
|
|
9376
|
+
if (parsed < 0n || parsed > (1n << 64n) - 1n) {
|
|
9377
|
+
throw new VrfCallError(`${label} out of uint64 range`);
|
|
9378
|
+
}
|
|
9379
|
+
return parsed;
|
|
9380
|
+
}
|
|
9381
|
+
function uint256Word3(value) {
|
|
9382
|
+
const out = new Uint8Array(32);
|
|
9383
|
+
let rest = value;
|
|
9384
|
+
for (let i = 31; i >= 0 && rest > 0n; i--) {
|
|
9385
|
+
out[i] = Number(rest & 0xffn);
|
|
9386
|
+
rest >>= 8n;
|
|
9387
|
+
}
|
|
9388
|
+
return out;
|
|
9389
|
+
}
|
|
9390
|
+
function toBytes6(value, label) {
|
|
9391
|
+
if (typeof value === "string") return hexToBytes2(value, label);
|
|
9392
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9393
|
+
}
|
|
8816
9394
|
var PROVER_MARKET_ADDRESS = PRECOMPILE_ADDRESSES.PROVER_MARKET;
|
|
8817
9395
|
var SERVES_GPU_PROVE = 512;
|
|
8818
9396
|
var PROVER_MARKET_SELECTORS = {
|
|
8819
|
-
createRequest: "0x" +
|
|
8820
|
-
submitBid: "0x" +
|
|
8821
|
-
closeRequest: "0x" +
|
|
8822
|
-
submitProof: "0x" +
|
|
8823
|
-
settle: "0x" +
|
|
8824
|
-
slash: "0x" +
|
|
9397
|
+
createRequest: "0x" + selectorHex4("createRequest(bytes)"),
|
|
9398
|
+
submitBid: "0x" + selectorHex4("submitBid(bytes)"),
|
|
9399
|
+
closeRequest: "0x" + selectorHex4("closeRequest(bytes)"),
|
|
9400
|
+
submitProof: "0x" + selectorHex4("submitProof(bytes)"),
|
|
9401
|
+
settle: "0x" + selectorHex4("settle(bytes)"),
|
|
9402
|
+
slash: "0x" + selectorHex4("slash(bytes)")
|
|
8825
9403
|
};
|
|
8826
9404
|
var PROVER_MARKET_EVENT_SIGS = {
|
|
8827
9405
|
proofRequested: "ProofRequested(bytes32,address,bytes32,uint128,uint64)",
|
|
@@ -8863,8 +9441,8 @@ function requestSighash(vkeyHash, inputsHash, maxFee, deadline, nonce) {
|
|
|
8863
9441
|
sha3_js.keccak_256(
|
|
8864
9442
|
concatBytes7(
|
|
8865
9443
|
new TextEncoder().encode(PROVER_MARKET_REQUEST_DOMAIN),
|
|
8866
|
-
expectLength5(
|
|
8867
|
-
expectLength5(
|
|
9444
|
+
expectLength5(toBytes7(vkeyHash), 32, "vkeyHash"),
|
|
9445
|
+
expectLength5(toBytes7(inputsHash), 32, "inputsHash"),
|
|
8868
9446
|
u128Bytes(maxFee, "maxFee"),
|
|
8869
9447
|
u64Bytes(deadline, "deadline"),
|
|
8870
9448
|
u64Bytes(nonce, "nonce")
|
|
@@ -8877,7 +9455,7 @@ function bidSighash(requestId, fee) {
|
|
|
8877
9455
|
sha3_js.keccak_256(
|
|
8878
9456
|
concatBytes7(
|
|
8879
9457
|
new TextEncoder().encode(PROVER_MARKET_BID_DOMAIN),
|
|
8880
|
-
expectLength5(
|
|
9458
|
+
expectLength5(toBytes7(requestId), 32, "requestId"),
|
|
8881
9459
|
u128Bytes(fee, "fee")
|
|
8882
9460
|
)
|
|
8883
9461
|
)
|
|
@@ -8888,16 +9466,16 @@ function submitSighash(requestId, proofHash) {
|
|
|
8888
9466
|
sha3_js.keccak_256(
|
|
8889
9467
|
concatBytes7(
|
|
8890
9468
|
new TextEncoder().encode(PROVER_MARKET_SUBMIT_DOMAIN),
|
|
8891
|
-
expectLength5(
|
|
8892
|
-
expectLength5(
|
|
9469
|
+
expectLength5(toBytes7(requestId), 32, "requestId"),
|
|
9470
|
+
expectLength5(toBytes7(proofHash), 32, "proofHash")
|
|
8893
9471
|
)
|
|
8894
9472
|
)
|
|
8895
9473
|
);
|
|
8896
9474
|
}
|
|
8897
9475
|
function encodeCreateRequestCanonical(args) {
|
|
8898
|
-
const buyer = expectLength5(
|
|
8899
|
-
const buyerPubkey =
|
|
8900
|
-
const sig =
|
|
9476
|
+
const buyer = expectLength5(toBytes7(args.buyer), 20, "buyer");
|
|
9477
|
+
const buyerPubkey = toBytes7(args.buyerPubkey);
|
|
9478
|
+
const sig = toBytes7(args.sig);
|
|
8901
9479
|
if (buyerPubkey.length === 0 || buyerPubkey.length > 65535) {
|
|
8902
9480
|
throw new ProverMarketError("buyerPubkey length out of range (1..=65535)");
|
|
8903
9481
|
}
|
|
@@ -8909,8 +9487,8 @@ function encodeCreateRequestCanonical(args) {
|
|
|
8909
9487
|
buyer,
|
|
8910
9488
|
u16Bytes(buyerPubkey.length),
|
|
8911
9489
|
buyerPubkey,
|
|
8912
|
-
expectLength5(
|
|
8913
|
-
expectLength5(
|
|
9490
|
+
expectLength5(toBytes7(args.vkeyHash), 32, "vkeyHash"),
|
|
9491
|
+
expectLength5(toBytes7(args.inputsHash), 32, "inputsHash"),
|
|
8914
9492
|
u128Bytes(args.maxFee, "maxFee"),
|
|
8915
9493
|
u64Bytes(args.deadline, "deadline"),
|
|
8916
9494
|
u64Bytes(args.nonce, "nonce"),
|
|
@@ -8920,7 +9498,7 @@ function encodeCreateRequestCanonical(args) {
|
|
|
8920
9498
|
);
|
|
8921
9499
|
}
|
|
8922
9500
|
function encodeCreateRequestCalldata(args) {
|
|
8923
|
-
const canonical =
|
|
9501
|
+
const canonical = toBytes7(encodeCreateRequestCanonical(args));
|
|
8924
9502
|
const offset = new Uint8Array(32);
|
|
8925
9503
|
offset[31] = 32;
|
|
8926
9504
|
const lenWord = new Uint8Array(32);
|
|
@@ -8934,10 +9512,10 @@ function encodeCreateRequestCalldata(args) {
|
|
|
8934
9512
|
concatBytes7(hexToBytes7(PROVER_MARKET_SELECTORS.createRequest), offset, lenWord, canonical, new Uint8Array(pad))
|
|
8935
9513
|
);
|
|
8936
9514
|
}
|
|
8937
|
-
function
|
|
9515
|
+
function selectorHex4(sig) {
|
|
8938
9516
|
return [...sha3_js.keccak_256(new TextEncoder().encode(sig)).slice(0, 4)].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
8939
9517
|
}
|
|
8940
|
-
function
|
|
9518
|
+
function toBytes7(value) {
|
|
8941
9519
|
if (typeof value === "string") return hexToBytes7(value);
|
|
8942
9520
|
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
8943
9521
|
}
|
|
@@ -9075,7 +9653,7 @@ function encodeSetAutoCompoundCalldata(enabled) {
|
|
|
9075
9653
|
);
|
|
9076
9654
|
}
|
|
9077
9655
|
function isRedemptionPrincipalUnavailableRevert(data) {
|
|
9078
|
-
return bytesToHex9(
|
|
9656
|
+
return bytesToHex9(toBytes8(data)).toLowerCase() === DELEGATION_REVERT_TAGS.redemptionPrincipalUnavailable;
|
|
9079
9657
|
}
|
|
9080
9658
|
function uint64Word3(value, name) {
|
|
9081
9659
|
const n = toBigint3(value, name);
|
|
@@ -9129,7 +9707,7 @@ function toBigint3(value, name) {
|
|
|
9129
9707
|
}
|
|
9130
9708
|
return BigInt(value);
|
|
9131
9709
|
}
|
|
9132
|
-
function
|
|
9710
|
+
function toBytes8(value) {
|
|
9133
9711
|
if (typeof value === "string") {
|
|
9134
9712
|
return hexToBytes8(value);
|
|
9135
9713
|
}
|
|
@@ -9243,8 +9821,8 @@ function encodeSetPolicyCalldata(args) {
|
|
|
9243
9821
|
}
|
|
9244
9822
|
function encodeSetPolicyClaimCalldata(args, subAccountPubkey, subAccountSig) {
|
|
9245
9823
|
const normalized = normalizeArgs(args);
|
|
9246
|
-
const pubkey =
|
|
9247
|
-
const sig =
|
|
9824
|
+
const pubkey = toBytes9(subAccountPubkey);
|
|
9825
|
+
const sig = toBytes9(subAccountSig);
|
|
9248
9826
|
if (pubkey.length !== ML_DSA_65_PUBLIC_KEY_LEN2) {
|
|
9249
9827
|
throw new SpendingPolicyError(
|
|
9250
9828
|
`subAccountPubkey must be ${ML_DSA_65_PUBLIC_KEY_LEN2} bytes, got ${pubkey.length}`
|
|
@@ -9266,7 +9844,7 @@ function encodeSetPolicyClaimCalldata(args, subAccountPubkey, subAccountSig) {
|
|
|
9266
9844
|
}
|
|
9267
9845
|
function encodeClaimPolicyByAddressCalldata(args, subAccountSig) {
|
|
9268
9846
|
const normalized = normalizeArgs(args);
|
|
9269
|
-
const sig =
|
|
9847
|
+
const sig = toBytes9(subAccountSig);
|
|
9270
9848
|
if (sig.length !== ML_DSA_65_SIGNATURE_LEN2) {
|
|
9271
9849
|
throw new SpendingPolicyError(
|
|
9272
9850
|
`subAccountSig must be ${ML_DSA_65_SIGNATURE_LEN2} bytes, got ${sig.length}`
|
|
@@ -9293,12 +9871,12 @@ function normalizeArgs(args) {
|
|
|
9293
9871
|
principal: toUserAddressBytes(args.principal, "principal"),
|
|
9294
9872
|
dailyCapLythoshi: toBigint4(args.dailyCapLythoshi, "dailyCapLythoshi"),
|
|
9295
9873
|
perTxCapLythoshi: toBigint4(args.perTxCapLythoshi, "perTxCapLythoshi"),
|
|
9296
|
-
allowRoot: expectLength6(
|
|
9297
|
-
denyRoot: expectLength6(
|
|
9874
|
+
allowRoot: expectLength6(toBytes9(args.allowRoot), 32, "allowRoot"),
|
|
9875
|
+
denyRoot: expectLength6(toBytes9(args.denyRoot), 32, "denyRoot"),
|
|
9298
9876
|
weeklyCapLythoshi: toBigint4(args.weeklyCapLythoshi ?? 0n, "weeklyCapLythoshi"),
|
|
9299
9877
|
monthlyCapLythoshi: toBigint4(args.monthlyCapLythoshi ?? 0n, "monthlyCapLythoshi"),
|
|
9300
|
-
categoryAllowRoot: args.categoryAllowRoot == null ? ZERO_WORD : expectLength6(
|
|
9301
|
-
timeWindow: args.timeWindow == null ? ZERO_WORD : expectLength6(
|
|
9878
|
+
categoryAllowRoot: args.categoryAllowRoot == null ? ZERO_WORD : expectLength6(toBytes9(args.categoryAllowRoot), 32, "categoryAllowRoot"),
|
|
9879
|
+
timeWindow: args.timeWindow == null ? ZERO_WORD : expectLength6(toBytes9(args.timeWindow), 32, "timeWindow"),
|
|
9302
9880
|
policyExpiry: toBigint4(args.policyExpiry ?? 0n, "policyExpiry")
|
|
9303
9881
|
};
|
|
9304
9882
|
}
|
|
@@ -9328,7 +9906,7 @@ function packTimeWindow(enabled, startHour, endHour) {
|
|
|
9328
9906
|
return out;
|
|
9329
9907
|
}
|
|
9330
9908
|
function decodeTimeWindow(word) {
|
|
9331
|
-
const bytes = expectLength6(
|
|
9909
|
+
const bytes = expectLength6(toBytes9(word), 32, "timeWindow");
|
|
9332
9910
|
if (bytes.every((b) => b === 0)) return null;
|
|
9333
9911
|
if (bytes[29] === 0) return null;
|
|
9334
9912
|
return [Math.min(bytes[30], 23), Math.min(bytes[31], 23)];
|
|
@@ -9371,7 +9949,7 @@ function toRawAddressBytes(value) {
|
|
|
9371
9949
|
}
|
|
9372
9950
|
return expectLength6(value instanceof Uint8Array ? value : Uint8Array.from(value), 20, "address");
|
|
9373
9951
|
}
|
|
9374
|
-
function
|
|
9952
|
+
function toBytes9(value) {
|
|
9375
9953
|
if (typeof value === "string") {
|
|
9376
9954
|
return hexToBytes9(value);
|
|
9377
9955
|
}
|
|
@@ -9453,7 +10031,7 @@ function pubkeyRegistryAddressHex() {
|
|
|
9453
10031
|
return PRECOMPILE_ADDRESSES.PUBKEY_REGISTRY.toLowerCase();
|
|
9454
10032
|
}
|
|
9455
10033
|
function encodeRegisterPubkeyCalldata(pubkey) {
|
|
9456
|
-
const bytes =
|
|
10034
|
+
const bytes = toBytes10(pubkey);
|
|
9457
10035
|
if (bytes.length !== PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN) {
|
|
9458
10036
|
throw new PubkeyRegistryError(
|
|
9459
10037
|
`pubkey must be ${PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN} bytes, got ${bytes.length}`
|
|
@@ -9462,8 +10040,8 @@ function encodeRegisterPubkeyCalldata(pubkey) {
|
|
|
9462
10040
|
return bytesToHex11(
|
|
9463
10041
|
concatBytes10(
|
|
9464
10042
|
hexToBytes10(PUBKEY_REGISTRY_SELECTORS.registerPubkey),
|
|
9465
|
-
|
|
9466
|
-
|
|
10043
|
+
uint256Word4(32n),
|
|
10044
|
+
uint256Word4(BigInt(bytes.length)),
|
|
9467
10045
|
bytes
|
|
9468
10046
|
)
|
|
9469
10047
|
);
|
|
@@ -9475,7 +10053,7 @@ function encodeHasPubkeyCalldata(address) {
|
|
|
9475
10053
|
return encodeSingleAddressCall2(PUBKEY_REGISTRY_SELECTORS.hasPubkey, address);
|
|
9476
10054
|
}
|
|
9477
10055
|
function decodeLookupPubkeyReturn(data) {
|
|
9478
|
-
const bytes =
|
|
10056
|
+
const bytes = toBytes10(data);
|
|
9479
10057
|
if (bytes.length < 96) {
|
|
9480
10058
|
throw new PubkeyRegistryError("lookup return must be at least 96 bytes");
|
|
9481
10059
|
}
|
|
@@ -9500,7 +10078,7 @@ function decodeLookupPubkeyReturn(data) {
|
|
|
9500
10078
|
};
|
|
9501
10079
|
}
|
|
9502
10080
|
function decodeHasPubkeyReturn(data) {
|
|
9503
|
-
const bytes =
|
|
10081
|
+
const bytes = toBytes10(data);
|
|
9504
10082
|
if (bytes.length !== 32) {
|
|
9505
10083
|
throw new PubkeyRegistryError("hasPubkey return must be 32 bytes");
|
|
9506
10084
|
}
|
|
@@ -9514,9 +10092,9 @@ function decodeHasPubkeyReturn(data) {
|
|
|
9514
10092
|
throw new PubkeyRegistryError("hasPubkey bool must be 0 or 1");
|
|
9515
10093
|
}
|
|
9516
10094
|
function encodeSingleAddressCall2(selector, address) {
|
|
9517
|
-
return bytesToHex11(concatBytes10(hexToBytes10(selector),
|
|
10095
|
+
return bytesToHex11(concatBytes10(hexToBytes10(selector), addressWord4(toAddressBytes(address))));
|
|
9518
10096
|
}
|
|
9519
|
-
function
|
|
10097
|
+
function addressWord4(address) {
|
|
9520
10098
|
return concatBytes10(new Uint8Array(12), address);
|
|
9521
10099
|
}
|
|
9522
10100
|
function toAddressBytes(value) {
|
|
@@ -9533,7 +10111,7 @@ function toAddressBytes(value) {
|
|
|
9533
10111
|
throw new PubkeyRegistryError(`address must be a typed mono bech32m address${detail}`);
|
|
9534
10112
|
}
|
|
9535
10113
|
}
|
|
9536
|
-
function
|
|
10114
|
+
function toBytes10(value) {
|
|
9537
10115
|
if (typeof value === "string") {
|
|
9538
10116
|
return hexToBytes10(value);
|
|
9539
10117
|
}
|
|
@@ -9562,7 +10140,7 @@ function concatBytes10(...parts) {
|
|
|
9562
10140
|
}
|
|
9563
10141
|
return out;
|
|
9564
10142
|
}
|
|
9565
|
-
function
|
|
10143
|
+
function uint256Word4(value) {
|
|
9566
10144
|
if (value < 0n || value > (1n << 256n) - 1n) {
|
|
9567
10145
|
throw new PubkeyRegistryError("uint256 value out of range");
|
|
9568
10146
|
}
|
|
@@ -9710,8 +10288,8 @@ function encodePlaceLimitOrderCalldata(args) {
|
|
|
9710
10288
|
normalized.baseTokenId,
|
|
9711
10289
|
normalized.quoteTokenId,
|
|
9712
10290
|
uint8Word2(normalized.side),
|
|
9713
|
-
|
|
9714
|
-
|
|
10291
|
+
uint256Word5(normalized.price, "price"),
|
|
10292
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9715
10293
|
uint64Word4(normalized.expiryBlock, "expiryBlock")
|
|
9716
10294
|
)
|
|
9717
10295
|
);
|
|
@@ -9724,7 +10302,7 @@ function encodePlaceMarketOrderCalldata(args) {
|
|
|
9724
10302
|
normalized.baseTokenId,
|
|
9725
10303
|
normalized.quoteTokenId,
|
|
9726
10304
|
uint8Word2(normalized.side),
|
|
9727
|
-
|
|
10305
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9728
10306
|
uint16Word2(normalized.maxSlippageBps, "maxSlippageBps")
|
|
9729
10307
|
)
|
|
9730
10308
|
);
|
|
@@ -9737,7 +10315,7 @@ function encodePlaceMarketOrderExCalldata(args) {
|
|
|
9737
10315
|
normalized.baseTokenId,
|
|
9738
10316
|
normalized.quoteTokenId,
|
|
9739
10317
|
uint8Word2(normalized.side),
|
|
9740
|
-
|
|
10318
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9741
10319
|
uint16Word2(normalized.maxSlippageBps, "maxSlippageBps"),
|
|
9742
10320
|
uint8Word2(normalized.mode)
|
|
9743
10321
|
)
|
|
@@ -9757,7 +10335,7 @@ function encodeMarketGridTuneCalldata(selector, label, args) {
|
|
|
9757
10335
|
hexToBytes2(selector, `${label} selector`),
|
|
9758
10336
|
bytes32FromHex(args.baseTokenId, "baseTokenId"),
|
|
9759
10337
|
bytes32FromHex(args.quoteTokenId, "quoteTokenId"),
|
|
9760
|
-
|
|
10338
|
+
uint256Word5(BigInt(args.newValue), "newValue")
|
|
9761
10339
|
)
|
|
9762
10340
|
);
|
|
9763
10341
|
}
|
|
@@ -10045,12 +10623,12 @@ function encodePlaceLimitOrderViaCalldata(args) {
|
|
|
10045
10623
|
return bytesToHex2(
|
|
10046
10624
|
concatBytes2(
|
|
10047
10625
|
hexToBytes2(OPERATOR_ROUTER_SELECTORS.placeLimitOrderVia, "placeLimitOrderVia selector"),
|
|
10048
|
-
|
|
10626
|
+
addressWord5(operator.bytes),
|
|
10049
10627
|
bytes32FromHex(args.base, "base"),
|
|
10050
10628
|
bytes32FromHex(args.quote, "quote"),
|
|
10051
10629
|
uint8Word2(side),
|
|
10052
|
-
|
|
10053
|
-
|
|
10630
|
+
uint256Word5(price, "price"),
|
|
10631
|
+
uint256Word5(amount, "amount"),
|
|
10054
10632
|
uint64Word4(expiresAtBlock, "expiresAtBlock")
|
|
10055
10633
|
)
|
|
10056
10634
|
);
|
|
@@ -10362,7 +10940,7 @@ function uint16Word2(value, name) {
|
|
|
10362
10940
|
out[31] = Number(value & 0xffn);
|
|
10363
10941
|
return out;
|
|
10364
10942
|
}
|
|
10365
|
-
function
|
|
10943
|
+
function uint256Word5(value, name) {
|
|
10366
10944
|
if (value < 0n || value >= 1n << 256n) {
|
|
10367
10945
|
throw new MarketActionError(`${name} must fit uint256`);
|
|
10368
10946
|
}
|
|
@@ -10374,7 +10952,7 @@ function uint256Word3(value, name) {
|
|
|
10374
10952
|
}
|
|
10375
10953
|
return out;
|
|
10376
10954
|
}
|
|
10377
|
-
function
|
|
10955
|
+
function addressWord5(addr) {
|
|
10378
10956
|
if (addr.length !== 20) {
|
|
10379
10957
|
throw new MarketActionError("address must be 20 bytes");
|
|
10380
10958
|
}
|
|
@@ -10914,7 +11492,7 @@ var MONOLYTHIUM_NETWORKS = {
|
|
|
10914
11492
|
};
|
|
10915
11493
|
|
|
10916
11494
|
// src/index.ts
|
|
10917
|
-
var version = "0.4.
|
|
11495
|
+
var version = "0.4.8";
|
|
10918
11496
|
|
|
10919
11497
|
exports.ADDRESS_HRP = ADDRESS_HRP;
|
|
10920
11498
|
exports.ADDRESS_KIND_HRPS = ADDRESS_KIND_HRPS;
|
|
@@ -10935,6 +11513,7 @@ exports.CLOB_MARKET_ID_DOMAIN_TAG = CLOB_MARKET_ID_DOMAIN_TAG;
|
|
|
10935
11513
|
exports.CLOB_SELECTORS = CLOB_SELECTORS;
|
|
10936
11514
|
exports.CLUSTER_FORMED_EVENT_SIG = CLUSTER_FORMED_EVENT_SIG;
|
|
10937
11515
|
exports.DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT = DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT;
|
|
11516
|
+
exports.DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT = DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT;
|
|
10938
11517
|
exports.DELEGATION_REVERT_TAGS = DELEGATION_REVERT_TAGS;
|
|
10939
11518
|
exports.DELEGATION_SELECTORS = DELEGATION_SELECTORS;
|
|
10940
11519
|
exports.DIVERSITY_SCORE_MAX = DIVERSITY_SCORE_MAX;
|
|
@@ -11003,6 +11582,9 @@ exports.NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN = NODE_REGISTRY_FORM_CLUSTER_M
|
|
|
11003
11582
|
exports.NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT = NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT;
|
|
11004
11583
|
exports.NODE_REGISTRY_FORM_CLUSTER_THRESHOLD = NODE_REGISTRY_FORM_CLUSTER_THRESHOLD;
|
|
11005
11584
|
exports.NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES;
|
|
11585
|
+
exports.NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES = NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES;
|
|
11586
|
+
exports.NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES = NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES;
|
|
11587
|
+
exports.NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES = NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES;
|
|
11006
11588
|
exports.NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID = NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID;
|
|
11007
11589
|
exports.NODE_REGISTRY_PUBLIC_SERVICE_MASK = NODE_REGISTRY_PUBLIC_SERVICE_MASK;
|
|
11008
11590
|
exports.NODE_REGISTRY_SELECTORS = NODE_REGISTRY_SELECTORS;
|
|
@@ -11049,9 +11631,24 @@ exports.SPENDING_POLICY_SELECTORS = SPENDING_POLICY_SELECTORS;
|
|
|
11049
11631
|
exports.SdkError = SdkError;
|
|
11050
11632
|
exports.SpendingPolicyError = SpendingPolicyError;
|
|
11051
11633
|
exports.TESTNET_69420 = TESTNET_69420;
|
|
11634
|
+
exports.TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI = TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI;
|
|
11635
|
+
exports.TOKEN_FACTORY_FLAGS = TOKEN_FACTORY_FLAGS;
|
|
11636
|
+
exports.TOKEN_FACTORY_KNOWN_FLAG_MASK = TOKEN_FACTORY_KNOWN_FLAG_MASK;
|
|
11637
|
+
exports.TOKEN_FACTORY_MAX_CREATOR_FEE_BPS = TOKEN_FACTORY_MAX_CREATOR_FEE_BPS;
|
|
11638
|
+
exports.TOKEN_FACTORY_MAX_DECIMALS = TOKEN_FACTORY_MAX_DECIMALS;
|
|
11639
|
+
exports.TOKEN_FACTORY_NAME_MAX_BYTES = TOKEN_FACTORY_NAME_MAX_BYTES;
|
|
11640
|
+
exports.TOKEN_FACTORY_SELECTORS = TOKEN_FACTORY_SELECTORS;
|
|
11641
|
+
exports.TOKEN_FACTORY_SIGS = TOKEN_FACTORY_SIGS;
|
|
11642
|
+
exports.TOKEN_FACTORY_SYMBOL_MAX_BYTES = TOKEN_FACTORY_SYMBOL_MAX_BYTES;
|
|
11643
|
+
exports.TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG = TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG;
|
|
11052
11644
|
exports.TRANSFER_DEFAULT_EXECUTION_UNIT_LIMIT = TRANSFER_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
11645
|
+
exports.TokenFactoryError = TokenFactoryError;
|
|
11053
11646
|
exports.V1_BRIDGE_ALLOWED_FEE_TOKEN = V1_BRIDGE_ALLOWED_FEE_TOKEN;
|
|
11054
11647
|
exports.V1_BRIDGE_ALLOWED_PROTOCOL = V1_BRIDGE_ALLOWED_PROTOCOL;
|
|
11648
|
+
exports.VRF_DOMAIN_TAG_MAX_BYTES = VRF_DOMAIN_TAG_MAX_BYTES;
|
|
11649
|
+
exports.VRF_HEIGHT_NOT_FINALIZED_REVERT = VRF_HEIGHT_NOT_FINALIZED_REVERT;
|
|
11650
|
+
exports.VRF_OUTPUT_BYTES = VRF_OUTPUT_BYTES;
|
|
11651
|
+
exports.VrfCallError = VrfCallError;
|
|
11055
11652
|
exports.addressBytesToHex = addressBytesToHex;
|
|
11056
11653
|
exports.addressToBech32 = addressToBech32;
|
|
11057
11654
|
exports.addressToTypedBech32 = addressToTypedBech32;
|
|
@@ -11120,6 +11717,7 @@ exports.buildPlaceLimitOrderViaPlan = buildPlaceLimitOrderViaPlan;
|
|
|
11120
11717
|
exports.buildPlaceSpotLimitOrderPlan = buildPlaceSpotLimitOrderPlan;
|
|
11121
11718
|
exports.buildPlaceSpotMarketOrderExPlan = buildPlaceSpotMarketOrderExPlan;
|
|
11122
11719
|
exports.buildPlaceSpotMarketOrderPlan = buildPlaceSpotMarketOrderPlan;
|
|
11720
|
+
exports.buildPublishOperatorSealKeyTxFields = buildPublishOperatorSealKeyTxFields;
|
|
11123
11721
|
exports.buildRequestClusterJoinTxFields = buildRequestClusterJoinTxFields;
|
|
11124
11722
|
exports.buildVoteClusterAdmitTxFields = buildVoteClusterAdmitTxFields;
|
|
11125
11723
|
exports.categoryRoot = categoryRoot;
|
|
@@ -11150,9 +11748,12 @@ exports.decodeNativeReceiptResponse = decodeNativeReceiptResponse;
|
|
|
11150
11748
|
exports.decodeNoEvmReceiptTranscript = decodeNoEvmReceiptTranscript;
|
|
11151
11749
|
exports.decodeOperatorFeeChargedEvent = decodeOperatorFeeChargedEvent;
|
|
11152
11750
|
exports.decodeOperatorNetworkMetadata = decodeOperatorNetworkMetadata;
|
|
11751
|
+
exports.decodeOperatorSealKey = decodeOperatorSealKey;
|
|
11153
11752
|
exports.decodeOracleEvent = decodeOracleEvent;
|
|
11154
11753
|
exports.decodeTimeWindow = decodeTimeWindow;
|
|
11754
|
+
exports.decodeTokenFactoryTokenId = decodeTokenFactoryTokenId;
|
|
11155
11755
|
exports.decodeTxFeedResponse = decodeTxFeedResponse;
|
|
11756
|
+
exports.decodeVrfOutput = decodeVrfOutput;
|
|
11156
11757
|
exports.delegationAddressHex = delegationAddressHex;
|
|
11157
11758
|
exports.denyRootFor = denyRootFor;
|
|
11158
11759
|
exports.deriveClobMarketId = deriveClobMarketId;
|
|
@@ -11162,6 +11763,7 @@ exports.deriveFeedId = deriveFeedId;
|
|
|
11162
11763
|
exports.deriveMrvContractAddress = deriveMrvContractAddress;
|
|
11163
11764
|
exports.deriveNativeSpotMarketId = deriveNativeSpotMarketId;
|
|
11164
11765
|
exports.deriveNativeSpotOrderId = deriveNativeSpotOrderId;
|
|
11766
|
+
exports.deriveTokenFactoryTokenId = deriveTokenFactoryTokenId;
|
|
11165
11767
|
exports.destinationRoot = destinationRoot;
|
|
11166
11768
|
exports.encodeAttestDkgReshareCalldata = encodeAttestDkgReshareCalldata;
|
|
11167
11769
|
exports.encodeBlockSelector = encodeBlockSelector;
|
|
@@ -11173,14 +11775,17 @@ exports.encodeCancelPendingChangeCalldata = encodeCancelPendingChangeCalldata;
|
|
|
11173
11775
|
exports.encodeClaimCalldata = encodeClaimCalldata;
|
|
11174
11776
|
exports.encodeClaimPolicyByAddressCalldata = encodeClaimPolicyByAddressCalldata;
|
|
11175
11777
|
exports.encodeCompleteRedemptionCalldata = encodeCompleteRedemptionCalldata;
|
|
11778
|
+
exports.encodeCreateFixedSupplyMrc20Calldata = encodeCreateFixedSupplyMrc20Calldata;
|
|
11176
11779
|
exports.encodeCreateRequestCalldata = encodeCreateRequestCalldata;
|
|
11177
11780
|
exports.encodeCreateRequestCanonical = encodeCreateRequestCanonical;
|
|
11781
|
+
exports.encodeCreateTokenCalldata = encodeCreateTokenCalldata;
|
|
11178
11782
|
exports.encodeDelegateCalldata = encodeDelegateCalldata;
|
|
11179
11783
|
exports.encodeDisableCalldata = encodeDisableCalldata;
|
|
11180
11784
|
exports.encodeEnableCalldata = encodeEnableCalldata;
|
|
11181
11785
|
exports.encodeExpireClusterJoinCalldata = encodeExpireClusterJoinCalldata;
|
|
11182
11786
|
exports.encodeFormClusterCalldata = encodeFormClusterCalldata;
|
|
11183
11787
|
exports.encodeGetClusterJoinRequestCalldata = encodeGetClusterJoinRequestCalldata;
|
|
11788
|
+
exports.encodeGetOperatorSealKeyCalldata = encodeGetOperatorSealKeyCalldata;
|
|
11184
11789
|
exports.encodeHasPubkeyCalldata = encodeHasPubkeyCalldata;
|
|
11185
11790
|
exports.encodeLockBridgeConfigCalldata = encodeLockBridgeConfigCalldata;
|
|
11186
11791
|
exports.encodeLookupPubkeyCalldata = encodeLookupPubkeyCalldata;
|
|
@@ -11237,6 +11842,7 @@ exports.encodePlaceLimitOrderCalldata = encodePlaceLimitOrderCalldata;
|
|
|
11237
11842
|
exports.encodePlaceLimitOrderViaCalldata = encodePlaceLimitOrderViaCalldata;
|
|
11238
11843
|
exports.encodePlaceMarketOrderCalldata = encodePlaceMarketOrderCalldata;
|
|
11239
11844
|
exports.encodePlaceMarketOrderExCalldata = encodePlaceMarketOrderExCalldata;
|
|
11845
|
+
exports.encodePublishOperatorSealKeyCalldata = encodePublishOperatorSealKeyCalldata;
|
|
11240
11846
|
exports.encodeRecoverOperatorNodeCalldata = encodeRecoverOperatorNodeCalldata;
|
|
11241
11847
|
exports.encodeRedelegateCalldata = encodeRedelegateCalldata;
|
|
11242
11848
|
exports.encodeRegisterPubkeyCalldata = encodeRegisterPubkeyCalldata;
|
|
@@ -11247,13 +11853,29 @@ exports.encodeSetBridgeResumeCooldownCalldata = encodeSetBridgeResumeCooldownCal
|
|
|
11247
11853
|
exports.encodeSetBridgeRouteFinalityCalldata = encodeSetBridgeRouteFinalityCalldata;
|
|
11248
11854
|
exports.encodeSetLotSizeCalldata = encodeSetLotSizeCalldata;
|
|
11249
11855
|
exports.encodeSetMinNotionalCalldata = encodeSetMinNotionalCalldata;
|
|
11856
|
+
exports.encodeSetOperatorDisplayCalldata = encodeSetOperatorDisplayCalldata;
|
|
11250
11857
|
exports.encodeSetPolicyCalldata = encodeSetPolicyCalldata;
|
|
11251
11858
|
exports.encodeSetPolicyClaimCalldata = encodeSetPolicyClaimCalldata;
|
|
11252
11859
|
exports.encodeSetTickSizeCalldata = encodeSetTickSizeCalldata;
|
|
11253
11860
|
exports.encodeSubmitBridgeProofCalldata = encodeSubmitBridgeProofCalldata;
|
|
11254
11861
|
exports.encodeSubmitPendingChangeCalldata = encodeSubmitPendingChangeCalldata;
|
|
11862
|
+
exports.encodeTokenFactoryAllowanceCalldata = encodeTokenFactoryAllowanceCalldata;
|
|
11863
|
+
exports.encodeTokenFactoryApproveCalldata = encodeTokenFactoryApproveCalldata;
|
|
11864
|
+
exports.encodeTokenFactoryBalanceOfCalldata = encodeTokenFactoryBalanceOfCalldata;
|
|
11865
|
+
exports.encodeTokenFactoryBurnCalldata = encodeTokenFactoryBurnCalldata;
|
|
11866
|
+
exports.encodeTokenFactoryDecreaseAllowanceCalldata = encodeTokenFactoryDecreaseAllowanceCalldata;
|
|
11867
|
+
exports.encodeTokenFactoryDestroyCalldata = encodeTokenFactoryDestroyCalldata;
|
|
11868
|
+
exports.encodeTokenFactoryIncreaseAllowanceCalldata = encodeTokenFactoryIncreaseAllowanceCalldata;
|
|
11869
|
+
exports.encodeTokenFactoryMetadataCalldata = encodeTokenFactoryMetadataCalldata;
|
|
11870
|
+
exports.encodeTokenFactoryMintCalldata = encodeTokenFactoryMintCalldata;
|
|
11871
|
+
exports.encodeTokenFactorySetPausedCalldata = encodeTokenFactorySetPausedCalldata;
|
|
11872
|
+
exports.encodeTokenFactoryTotalSupplyCalldata = encodeTokenFactoryTotalSupplyCalldata;
|
|
11873
|
+
exports.encodeTokenFactoryTransferCalldata = encodeTokenFactoryTransferCalldata;
|
|
11874
|
+
exports.encodeTokenFactoryTransferFromCalldata = encodeTokenFactoryTransferFromCalldata;
|
|
11875
|
+
exports.encodeTokenFactoryTransferOwnershipCalldata = encodeTokenFactoryTransferOwnershipCalldata;
|
|
11255
11876
|
exports.encodeUndelegateCalldata = encodeUndelegateCalldata;
|
|
11256
11877
|
exports.encodeVoteClusterAdmitCalldata = encodeVoteClusterAdmitCalldata;
|
|
11878
|
+
exports.encodeVrfEvaluateCalldata = encodeVrfEvaluateCalldata;
|
|
11257
11879
|
exports.exportBridgeRouteCatalogueJson = exportBridgeRouteCatalogueJson;
|
|
11258
11880
|
exports.fetchChainInfoLatest = fetchChainInfoLatest;
|
|
11259
11881
|
exports.fetchChainRegistryLatest = fetchChainRegistryLatest;
|
|
@@ -11339,9 +11961,11 @@ exports.spendingPolicyAddressHex = spendingPolicyAddressHex;
|
|
|
11339
11961
|
exports.submitMrvCallNativeTx = submitMrvCallNativeTx;
|
|
11340
11962
|
exports.submitMrvDeployNativeTx = submitMrvDeployNativeTx;
|
|
11341
11963
|
exports.submitMrvDeployPayloadNativeTx = submitMrvDeployPayloadNativeTx;
|
|
11964
|
+
exports.submitPublishOperatorSealKey = submitPublishOperatorSealKey;
|
|
11342
11965
|
exports.submitRequestClusterJoin = submitRequestClusterJoin;
|
|
11343
11966
|
exports.submitSighash = submitSighash;
|
|
11344
11967
|
exports.submitVoteClusterAdmit = submitVoteClusterAdmit;
|
|
11968
|
+
exports.tokenFactoryAddressHex = tokenFactoryAddressHex;
|
|
11345
11969
|
exports.transactionFeeExposure = transactionFeeExposure;
|
|
11346
11970
|
exports.typedBech32ToAddress = typedBech32ToAddress;
|
|
11347
11971
|
exports.validateAddress = validateAddress;
|
|
@@ -11349,6 +11973,7 @@ exports.validateBridgeRouteCatalogue = validateBridgeRouteCatalogue;
|
|
|
11349
11973
|
exports.validateMrvArtifactMetadata = validateMrvArtifactMetadata;
|
|
11350
11974
|
exports.validateMrvCallRequest = validateMrvCallRequest;
|
|
11351
11975
|
exports.validateMrvDeployRequest = validateMrvDeployRequest;
|
|
11976
|
+
exports.validateTokenFactoryFlags = validateTokenFactoryFlags;
|
|
11352
11977
|
exports.verifyNoEvmArchiveProofSignatures = verifyNoEvmArchiveProofSignatures;
|
|
11353
11978
|
exports.verifyNoEvmBlockFinalityEvidenceMultisig = verifyNoEvmBlockFinalityEvidenceMultisig;
|
|
11354
11979
|
exports.verifyNoEvmBlockFinalityEvidenceThreshold = verifyNoEvmBlockFinalityEvidenceThreshold;
|
|
@@ -11357,5 +11982,6 @@ exports.verifyNoEvmFinalityEvidenceThreshold = verifyNoEvmFinalityEvidenceThresh
|
|
|
11357
11982
|
exports.verifyNoEvmReceiptProof = verifyNoEvmReceiptProof;
|
|
11358
11983
|
exports.verifyNoEvmReceiptProofTrust = verifyNoEvmReceiptProofTrust;
|
|
11359
11984
|
exports.version = version;
|
|
11985
|
+
exports.vrfAddressHex = vrfAddressHex;
|
|
11360
11986
|
//# sourceMappingURL=index.cjs.map
|
|
11361
11987
|
//# sourceMappingURL=index.cjs.map
|