@monolythium/core-sdk 0.4.5 → 0.4.8
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 +8 -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 +8 -1
- package/dist/crypto/index.js.map +1 -1
- package/dist/index.cjs +700 -80
- 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 +653 -81
- package/dist/index.js.map +1 -1
- package/dist/{submission-D9k_xppI.d.cts → submission-Bd8ajSxX.d.cts} +124 -15
- package/dist/{submission-D9k_xppI.d.ts → submission-Bd8ajSxX.d.ts} +124 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -449,7 +449,13 @@ var NODE_REGISTRY_SELECTORS = {
|
|
|
449
449
|
/** `getClusterJoinRequest(uint32,bytes32)` — CJ-1 request status view. */
|
|
450
450
|
getClusterJoinRequest: "0x" + selectorHex("getClusterJoinRequest(uint32,bytes32)"),
|
|
451
451
|
/** `formCluster(bytes,bytes,bytes)` — no-foundation cluster formation by roster consent. */
|
|
452
|
-
formCluster: "0x" + selectorHex("formCluster(bytes,bytes,bytes)")
|
|
452
|
+
formCluster: "0x" + selectorHex("formCluster(bytes,bytes,bytes)"),
|
|
453
|
+
/** `setOperatorDisplay(bytes32,string,string)` — owner-callable public display metadata. */
|
|
454
|
+
setOperatorDisplay: "0x" + selectorHex("setOperatorDisplay(bytes32,string,string)"),
|
|
455
|
+
/** `publishOperatorSealKey(bytes32,bytes)` — owner-callable LythiumSeal EK publication. */
|
|
456
|
+
publishOperatorSealKey: "0x" + selectorHex("publishOperatorSealKey(bytes32,bytes)"),
|
|
457
|
+
/** `getOperatorSealKey(bytes32)` view — returns the operator's published LythiumSeal EK. */
|
|
458
|
+
getOperatorSealKey: "0x" + selectorHex("getOperatorSealKey(bytes32)")
|
|
453
459
|
};
|
|
454
460
|
var NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES = 48;
|
|
455
461
|
var NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
|
|
@@ -457,6 +463,7 @@ var NODE_REGISTRY_BLS_PUBKEY_BYTES = NODE_REGISTRY_CLUSTER_MEMBER_REF_BYTES;
|
|
|
457
463
|
var NODE_REGISTRY_CONSENSUS_PUBKEY_BYTES = 1952;
|
|
458
464
|
var NODE_REGISTRY_CONSENSUS_SIGNATURE_BYTES = 3309;
|
|
459
465
|
var NODE_REGISTRY_CONSENSUS_POP_BYTES = 3309;
|
|
466
|
+
var NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES = 1184;
|
|
460
467
|
var NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES = 96;
|
|
461
468
|
var NODE_REGISTRY_DKG_THRESHOLD_SIG_BYTES = NODE_REGISTRY_DKG_ATTESTATION_SIG_BYTES;
|
|
462
469
|
var NODE_REGISTRY_DKG_RESHARE_MIN_SIGNERS = 5;
|
|
@@ -467,6 +474,8 @@ var NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT = 3;
|
|
|
467
474
|
var NODE_REGISTRY_FORM_CLUSTER_MEMBER_COUNT = NODE_REGISTRY_FORM_CLUSTER_ACTIVE_COUNT + NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT;
|
|
468
475
|
var NODE_REGISTRY_FORM_CLUSTER_THRESHOLD = 7;
|
|
469
476
|
var NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN = "PROTOCORE_NODE_REGISTRY_CLUSTER_FORM_V1\0";
|
|
477
|
+
var NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES = 128;
|
|
478
|
+
var NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES = 64;
|
|
470
479
|
var PENDING_CHANGE_KIND_CODES = {
|
|
471
480
|
add: 1,
|
|
472
481
|
remove: 2,
|
|
@@ -675,6 +684,68 @@ function encodeVoteClusterAdmitCalldata(args) {
|
|
|
675
684
|
)
|
|
676
685
|
);
|
|
677
686
|
}
|
|
687
|
+
function encodeSetOperatorDisplayCalldata(args) {
|
|
688
|
+
const peerId = expectLength2(toBytes(args.peerId), 32, "peerId");
|
|
689
|
+
const moniker = displayTextBytes(
|
|
690
|
+
args.moniker,
|
|
691
|
+
NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES,
|
|
692
|
+
"moniker"
|
|
693
|
+
);
|
|
694
|
+
const alias = displayTextBytes(args.alias, NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES, "alias");
|
|
695
|
+
const monikerPadded = padToWord(moniker);
|
|
696
|
+
const aliasPadded = padToWord(alias);
|
|
697
|
+
const monikerOffset = 3n * 32n;
|
|
698
|
+
const aliasOffset = monikerOffset + 32n + BigInt(monikerPadded.length);
|
|
699
|
+
return bytesToHex(
|
|
700
|
+
concatBytes(
|
|
701
|
+
hexToBytes(NODE_REGISTRY_SELECTORS.setOperatorDisplay),
|
|
702
|
+
peerId,
|
|
703
|
+
uint64Word(monikerOffset, "monikerOffset"),
|
|
704
|
+
uint64Word(aliasOffset, "aliasOffset"),
|
|
705
|
+
uint64Word(BigInt(moniker.length), "monikerLength"),
|
|
706
|
+
monikerPadded,
|
|
707
|
+
uint64Word(BigInt(alias.length), "aliasLength"),
|
|
708
|
+
aliasPadded
|
|
709
|
+
)
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
function encodePublishOperatorSealKeyCalldata(args) {
|
|
713
|
+
const peerId = expectLength2(toBytes(args.peerId), 32, "peerId");
|
|
714
|
+
const sealEk = expectNonZeroBytes(
|
|
715
|
+
expectLength2(toBytes(args.sealEk), NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES, "sealEk"),
|
|
716
|
+
"sealEk"
|
|
717
|
+
);
|
|
718
|
+
const sealEkPadded = padToWord(sealEk);
|
|
719
|
+
return bytesToHex(
|
|
720
|
+
concatBytes(
|
|
721
|
+
hexToBytes(NODE_REGISTRY_SELECTORS.publishOperatorSealKey),
|
|
722
|
+
peerId,
|
|
723
|
+
uint64Word(2n * 32n, "sealEkOffset"),
|
|
724
|
+
uint64Word(BigInt(sealEk.length), "sealEkLength"),
|
|
725
|
+
sealEkPadded
|
|
726
|
+
)
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
function encodeGetOperatorSealKeyCalldata(args) {
|
|
730
|
+
return bytesToHex(
|
|
731
|
+
concatBytes(
|
|
732
|
+
hexToBytes(NODE_REGISTRY_SELECTORS.getOperatorSealKey),
|
|
733
|
+
expectLength2(toBytes(args.operatorId), 32, "operatorId")
|
|
734
|
+
)
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
function decodeOperatorSealKey(returnData) {
|
|
738
|
+
const bytes = toBytes(returnData);
|
|
739
|
+
if (bytes.length === NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES) {
|
|
740
|
+
return bytesToHex(expectNonZeroBytes(bytes, "operatorSealKey"));
|
|
741
|
+
}
|
|
742
|
+
const sealEk = decodeDynamicBytesResult(
|
|
743
|
+
bytes,
|
|
744
|
+
NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES,
|
|
745
|
+
"operatorSealKey"
|
|
746
|
+
);
|
|
747
|
+
return bytesToHex(expectNonZeroBytes(sealEk, "operatorSealKey"));
|
|
748
|
+
}
|
|
678
749
|
function encodeCancelClusterJoinCalldata(args) {
|
|
679
750
|
return bytesToHex(
|
|
680
751
|
concatBytes(
|
|
@@ -1048,6 +1119,19 @@ function toBytes(value) {
|
|
|
1048
1119
|
}
|
|
1049
1120
|
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
1050
1121
|
}
|
|
1122
|
+
function displayTextBytes(value, maxBytes, name) {
|
|
1123
|
+
for (const ch of value) {
|
|
1124
|
+
const code = ch.codePointAt(0);
|
|
1125
|
+
if (code !== void 0 && (code >= 0 && code <= 31 || code >= 127 && code <= 159)) {
|
|
1126
|
+
throw new NodeRegistryError(`${name} must not contain control characters`);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
const bytes = new TextEncoder().encode(value);
|
|
1130
|
+
if (bytes.length > maxBytes) {
|
|
1131
|
+
throw new NodeRegistryError(`${name} must be <= ${maxBytes} UTF-8 bytes`);
|
|
1132
|
+
}
|
|
1133
|
+
return bytes;
|
|
1134
|
+
}
|
|
1051
1135
|
function hexToBytes(hex) {
|
|
1052
1136
|
const body = hex.startsWith("0x") || hex.startsWith("0X") ? hex.slice(2) : hex;
|
|
1053
1137
|
if (body.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(body)) {
|
|
@@ -1077,6 +1161,30 @@ function expectLength2(value, len, name) {
|
|
|
1077
1161
|
}
|
|
1078
1162
|
return value;
|
|
1079
1163
|
}
|
|
1164
|
+
function expectNonZeroBytes(value, name) {
|
|
1165
|
+
if (value.every((byte) => byte === 0)) {
|
|
1166
|
+
throw new NodeRegistryError(`${name} must not be all-zero`);
|
|
1167
|
+
}
|
|
1168
|
+
return value;
|
|
1169
|
+
}
|
|
1170
|
+
function decodeDynamicBytesResult(bytes, expectedLength, label) {
|
|
1171
|
+
if (bytes.length < 64) {
|
|
1172
|
+
throw new NodeRegistryError(`${label} return must be ABI-encoded dynamic bytes`);
|
|
1173
|
+
}
|
|
1174
|
+
const offset = uintFromWord(bytes.slice(0, 32));
|
|
1175
|
+
if (offset !== 32n) {
|
|
1176
|
+
throw new NodeRegistryError(`${label} return offset must be 0x20`);
|
|
1177
|
+
}
|
|
1178
|
+
const len = uintFromWord(bytes.slice(32, 64));
|
|
1179
|
+
if (len !== BigInt(expectedLength)) {
|
|
1180
|
+
throw new NodeRegistryError(`${label} must be ${expectedLength} bytes, got ${len}`);
|
|
1181
|
+
}
|
|
1182
|
+
const paddedLen = Math.ceil(expectedLength / 32) * 32;
|
|
1183
|
+
if (bytes.length < 64 + paddedLen) {
|
|
1184
|
+
throw new NodeRegistryError(`${label} body is truncated`);
|
|
1185
|
+
}
|
|
1186
|
+
return bytes.slice(64, 64 + expectedLength);
|
|
1187
|
+
}
|
|
1080
1188
|
|
|
1081
1189
|
// src/crypto/bytes.ts
|
|
1082
1190
|
function concatBytes2(...chunks) {
|
|
@@ -2704,8 +2812,8 @@ var TESTNET_69420 = {
|
|
|
2704
2812
|
network: "testnet-69420",
|
|
2705
2813
|
display_name: "Monolythium Testnet",
|
|
2706
2814
|
description: "Public Monolythium testnet. Testnet state may reset without notice; do not store value on this network.",
|
|
2707
|
-
genesis_hash: "
|
|
2708
|
-
binary_sha: "
|
|
2815
|
+
genesis_hash: "0xb9bcc577fa7256664364518f2943fe298b50973b0e43831a081b4dca3d2d5a6a",
|
|
2816
|
+
binary_sha: "a5d5b299a0bf",
|
|
2709
2817
|
rpc: [
|
|
2710
2818
|
{
|
|
2711
2819
|
url: "http://178.105.12.9:8545",
|
|
@@ -2763,13 +2871,6 @@ var TESTNET_69420 = {
|
|
|
2763
2871
|
tier: "official",
|
|
2764
2872
|
notes: "operator-8"
|
|
2765
2873
|
},
|
|
2766
|
-
{
|
|
2767
|
-
url: "http://162.55.54.198:8545",
|
|
2768
|
-
provider: "monolythium-foundation",
|
|
2769
|
-
region: "nbg1",
|
|
2770
|
-
tier: "official",
|
|
2771
|
-
notes: "operator-9"
|
|
2772
|
-
},
|
|
2773
2874
|
{
|
|
2774
2875
|
url: "http://95.217.156.190:8545",
|
|
2775
2876
|
provider: "monolythium-foundation",
|
|
@@ -2782,78 +2883,93 @@ var TESTNET_69420 = {
|
|
|
2782
2883
|
provider: "monolythium-foundation",
|
|
2783
2884
|
region: "sin",
|
|
2784
2885
|
tier: "official",
|
|
2785
|
-
notes: "operator-11
|
|
2886
|
+
notes: "operator-11"
|
|
2887
|
+
},
|
|
2888
|
+
{
|
|
2889
|
+
url: "http://162.55.54.198:8545",
|
|
2890
|
+
provider: "monolythium-foundation",
|
|
2891
|
+
region: "fsn1",
|
|
2892
|
+
tier: "official",
|
|
2893
|
+
notes: "operator-9 preview operator"
|
|
2786
2894
|
},
|
|
2787
2895
|
{
|
|
2788
2896
|
url: "http://128.140.125.5:8545",
|
|
2789
2897
|
provider: "monolythium-foundation",
|
|
2790
2898
|
region: "fsn1",
|
|
2791
2899
|
tier: "official",
|
|
2792
|
-
notes: "
|
|
2900
|
+
notes: "relay-1"
|
|
2793
2901
|
},
|
|
2794
2902
|
{
|
|
2795
2903
|
url: "http://178.105.45.210:8545",
|
|
2796
2904
|
provider: "monolythium-foundation",
|
|
2797
|
-
region: "
|
|
2905
|
+
region: "fsn1",
|
|
2798
2906
|
tier: "official",
|
|
2799
|
-
notes: "relay-
|
|
2907
|
+
notes: "relay-2"
|
|
2800
2908
|
},
|
|
2801
2909
|
{
|
|
2802
2910
|
url: "http://65.21.252.34:8545",
|
|
2803
2911
|
provider: "monolythium-foundation",
|
|
2804
2912
|
region: "hel1",
|
|
2805
2913
|
tier: "official",
|
|
2806
|
-
notes: "relay-
|
|
2914
|
+
notes: "relay-3"
|
|
2807
2915
|
}
|
|
2808
2916
|
],
|
|
2809
2917
|
p2p: [
|
|
2810
2918
|
{
|
|
2811
|
-
multiaddr: "/ip4/178.105.12.9/tcp/29898/p2p/
|
|
2919
|
+
multiaddr: "/ip4/178.105.12.9/tcp/29898/p2p/12D3KooWGgh9vYbNSqYbci8w7bg2AAaFWx7umN1ADjjcUoUTF2Za",
|
|
2812
2920
|
region: "fsn1"
|
|
2813
2921
|
},
|
|
2814
2922
|
{
|
|
2815
|
-
multiaddr: "/ip4/178.105.15.216/tcp/29898/p2p/
|
|
2923
|
+
multiaddr: "/ip4/178.105.15.216/tcp/29898/p2p/12D3KooWPUMj4vt1ee1Ug2QMJQwbDHSJ936JVaqw3iLXtAqPrq7R",
|
|
2816
2924
|
region: "fsn1"
|
|
2817
2925
|
},
|
|
2818
2926
|
{
|
|
2819
|
-
multiaddr: "/ip4/178.104.233.182/tcp/29898/p2p/
|
|
2927
|
+
multiaddr: "/ip4/178.104.233.182/tcp/29898/p2p/12D3KooWLPNJFUZhXyc1S7YvjMiKXyrNKCN3eFegDFF5UZAio7NJ",
|
|
2820
2928
|
region: "nbg1"
|
|
2821
2929
|
},
|
|
2822
2930
|
{
|
|
2823
|
-
multiaddr: "/ip4/65.108.94.1/tcp/29898/p2p/
|
|
2931
|
+
multiaddr: "/ip4/65.108.94.1/tcp/29898/p2p/12D3KooWRAuuQa5iEAzLUpLnyZ9VM53dvZMt3FPj7smDcwXn3oxz",
|
|
2824
2932
|
region: "hel1"
|
|
2825
2933
|
},
|
|
2826
2934
|
{
|
|
2827
|
-
multiaddr: "/ip4/95.216.154.155/tcp/29898/p2p/
|
|
2935
|
+
multiaddr: "/ip4/95.216.154.155/tcp/29898/p2p/12D3KooWFc9sVuCAuLxFTVy8KN5KXhyDvPjKkU98ySK81dFyStN8",
|
|
2828
2936
|
region: "hel1"
|
|
2829
2937
|
},
|
|
2830
2938
|
{
|
|
2831
|
-
multiaddr: "/ip4/87.99.145.48/tcp/29898/p2p/
|
|
2939
|
+
multiaddr: "/ip4/87.99.145.48/tcp/29898/p2p/12D3KooWL2KLRUHybGLd736nusDRTF2V1a9waeTsxKPwF78HDCmb",
|
|
2832
2940
|
region: "ash"
|
|
2833
2941
|
},
|
|
2834
2942
|
{
|
|
2835
|
-
multiaddr: "/ip4/5.223.85.76/tcp/29898/p2p/
|
|
2943
|
+
multiaddr: "/ip4/5.223.85.76/tcp/29898/p2p/12D3KooWHvobdzzEAiKcFkgdkRfr8vWGyWYfBoWS3jnPycvfwGrK",
|
|
2836
2944
|
region: "sin"
|
|
2837
2945
|
},
|
|
2838
2946
|
{
|
|
2839
|
-
multiaddr: "/ip4/142.132.180.99/tcp/29898/p2p/
|
|
2947
|
+
multiaddr: "/ip4/142.132.180.99/tcp/29898/p2p/12D3KooWBcAeWScYmDWPTjNM47CkKR4vEf44CNhDCcWuGpyY7Hko",
|
|
2840
2948
|
region: "fsn1"
|
|
2841
2949
|
},
|
|
2842
2950
|
{
|
|
2843
|
-
multiaddr: "/ip4/
|
|
2844
|
-
region: "nbg1"
|
|
2845
|
-
},
|
|
2846
|
-
{
|
|
2847
|
-
multiaddr: "/ip4/95.217.156.190/tcp/29898/p2p/12D3KooWLD8kzKHPVexZv2pMTvpjcEPTVZxr5qMxCeVB2QR6NNa6",
|
|
2951
|
+
multiaddr: "/ip4/95.217.156.190/tcp/29898/p2p/12D3KooWPBr8guuWoZT59AobZEBHDZqKgwHWAP3aKUzKWeGTa7Z6",
|
|
2848
2952
|
region: "hel1"
|
|
2849
2953
|
},
|
|
2850
2954
|
{
|
|
2851
|
-
multiaddr: "/ip4/5.223.65.201/tcp/29898/p2p/
|
|
2955
|
+
multiaddr: "/ip4/5.223.65.201/tcp/29898/p2p/12D3KooWGk3fQcDxD3uPKEe56G89X6m4ksrPKCfq6LMA952HVwbs",
|
|
2852
2956
|
region: "sin"
|
|
2853
2957
|
},
|
|
2854
2958
|
{
|
|
2855
|
-
multiaddr: "/ip4/
|
|
2959
|
+
multiaddr: "/ip4/162.55.54.198/tcp/29898/p2p/12D3KooWRBA5Wzs619GuMY2NrDD6fGoLYCK2tkXff2JAZyXn7RvR",
|
|
2960
|
+
region: "fsn1"
|
|
2961
|
+
},
|
|
2962
|
+
{
|
|
2963
|
+
multiaddr: "/ip4/128.140.125.5/tcp/29898/p2p/12D3KooWAxWQueEVut82vNNbi1ncBrcnPbbHNyp5RZs7KSJBmu19",
|
|
2856
2964
|
region: "fsn1"
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
multiaddr: "/ip4/178.105.45.210/tcp/29898/p2p/12D3KooWQRpCMLezJmvqqpbpEu8ixGHgonqianG1aVZjw6GiStbd",
|
|
2968
|
+
region: "fsn1"
|
|
2969
|
+
},
|
|
2970
|
+
{
|
|
2971
|
+
multiaddr: "/ip4/65.21.252.34/tcp/29898/p2p/12D3KooWRGzTwPX21Nee2c39RWuT2ayNWb6NMX19jCx8recrNeXL",
|
|
2972
|
+
region: "hel1"
|
|
2857
2973
|
}
|
|
2858
2974
|
]
|
|
2859
2975
|
};
|
|
@@ -3650,6 +3766,16 @@ var RpcClient = class _RpcClient {
|
|
|
3650
3766
|
async ethGetCode(address, block = "latest") {
|
|
3651
3767
|
return this.call("eth_getCode", [address, encodeBlockSelector(block)]);
|
|
3652
3768
|
}
|
|
3769
|
+
/** `eth_call` — read-only execution against committed state. */
|
|
3770
|
+
async ethCall(request, block = "latest") {
|
|
3771
|
+
return this.call("eth_call", [request, encodeBlockSelector(block)]);
|
|
3772
|
+
}
|
|
3773
|
+
/** `eth_estimateGas` — read-only execution-unit estimate for a call object. */
|
|
3774
|
+
async ethEstimateGas(request, block = "latest") {
|
|
3775
|
+
return parseQuantityBig(
|
|
3776
|
+
await this.call("eth_estimateGas", [request, encodeBlockSelector(block)])
|
|
3777
|
+
);
|
|
3778
|
+
}
|
|
3653
3779
|
/** Compatibility block-header read by height/tag. */
|
|
3654
3780
|
async ethGetBlockByNumber(block = "latest") {
|
|
3655
3781
|
return normalizeBlockHeader(await this.call(ethCompatMethod("getBlockByNumber"), [encodeBlockSelector(block)]));
|
|
@@ -8348,6 +8474,7 @@ function pqm1MnemonicToMlDsa65Backend(mnemonic) {
|
|
|
8348
8474
|
|
|
8349
8475
|
// src/cluster-join.ts
|
|
8350
8476
|
var DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT = REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
8477
|
+
var DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT = REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
8351
8478
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
8352
8479
|
var MAX_UINT32 = (1n << 32n) - 1n;
|
|
8353
8480
|
function deriveClusterJoinOperatorId(operatorPubkey) {
|
|
@@ -8455,6 +8582,24 @@ function buildVoteClusterAdmitTxFields(args) {
|
|
|
8455
8582
|
})
|
|
8456
8583
|
};
|
|
8457
8584
|
}
|
|
8585
|
+
function buildPublishOperatorSealKeyTxFields(args) {
|
|
8586
|
+
return {
|
|
8587
|
+
chainId: args.chainId,
|
|
8588
|
+
nonce: args.nonce,
|
|
8589
|
+
maxFeePerGas: parseBigint(args.fee.maxFeePerGas, "maxFeePerGas"),
|
|
8590
|
+
maxPriorityFeePerGas: parseBigint(args.fee.maxPriorityFeePerGas, "maxPriorityFeePerGas"),
|
|
8591
|
+
gasLimit: parseBigint(
|
|
8592
|
+
args.fee.gasLimit ?? DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT,
|
|
8593
|
+
"gasLimit"
|
|
8594
|
+
),
|
|
8595
|
+
to: nodeRegistryAddressHex(),
|
|
8596
|
+
value: 0n,
|
|
8597
|
+
input: encodePublishOperatorSealKeyCalldata({
|
|
8598
|
+
peerId: normalizeOperatorId(args.peerId),
|
|
8599
|
+
sealEk: normalizeOperatorSealEk(args.sealEk)
|
|
8600
|
+
})
|
|
8601
|
+
};
|
|
8602
|
+
}
|
|
8458
8603
|
async function submitRequestClusterJoin(args) {
|
|
8459
8604
|
const clusterId = parseUint32(args.clusterId, "clusterId");
|
|
8460
8605
|
const operatorPubkey = normalizeConsensusPubkey(args.operatorPubkey, "operatorPubkey");
|
|
@@ -8510,6 +8655,39 @@ async function submitVoteClusterAdmit(args) {
|
|
|
8510
8655
|
});
|
|
8511
8656
|
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex, args);
|
|
8512
8657
|
}
|
|
8658
|
+
async function submitPublishOperatorSealKey(args) {
|
|
8659
|
+
const operatorIdHex = normalizeOperatorId(args.peerId);
|
|
8660
|
+
const sealEk = normalizeOperatorSealEk(args.sealEk);
|
|
8661
|
+
const backend = pqm1MnemonicToMlDsa65Backend(args.mnemonic);
|
|
8662
|
+
const senderAddress = addressToTypedBech32("user", backend.addressBytes());
|
|
8663
|
+
const [chainId, nonce, quote] = await Promise.all([
|
|
8664
|
+
args.client.ethChainId(),
|
|
8665
|
+
args.client.lythGetTransactionCount(senderAddress),
|
|
8666
|
+
args.client.lythExecutionUnitPrice()
|
|
8667
|
+
]);
|
|
8668
|
+
const tx = buildPublishOperatorSealKeyTxFields({
|
|
8669
|
+
chainId,
|
|
8670
|
+
nonce,
|
|
8671
|
+
fee: resolveClusterJoinExecutionFee(quote, {
|
|
8672
|
+
...args,
|
|
8673
|
+
executionUnitLimit: args.executionUnitLimit ?? DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT
|
|
8674
|
+
}),
|
|
8675
|
+
peerId: operatorIdHex,
|
|
8676
|
+
sealEk
|
|
8677
|
+
});
|
|
8678
|
+
const plaintext = buildPlaintextSubmission({ backend, tx });
|
|
8679
|
+
const txHash = await submitPlaintextTransaction(
|
|
8680
|
+
args.client,
|
|
8681
|
+
plaintext.signedTxWireHex,
|
|
8682
|
+
plaintext.innerTxHashHex
|
|
8683
|
+
);
|
|
8684
|
+
return {
|
|
8685
|
+
txHash,
|
|
8686
|
+
operatorIdHex,
|
|
8687
|
+
innerSighashHex: plaintext.innerSighashHex,
|
|
8688
|
+
signedTxWireBytes: plaintext.innerWireBytes
|
|
8689
|
+
};
|
|
8690
|
+
}
|
|
8513
8691
|
async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex, options) {
|
|
8514
8692
|
if (options.private !== false) {
|
|
8515
8693
|
const encrypted = await buildEncryptedSubmission({
|
|
@@ -8597,6 +8775,10 @@ function normalizeOperatorId(value) {
|
|
|
8597
8775
|
const bytes = typeof value === "string" ? hexToBytes2(value, "operatorId") : value;
|
|
8598
8776
|
return bytesToHex2(expectBytes(bytes, 32, "operatorId"));
|
|
8599
8777
|
}
|
|
8778
|
+
function normalizeOperatorSealEk(value) {
|
|
8779
|
+
const bytes = typeof value === "string" ? hexToBytes2(value, "sealEk") : value;
|
|
8780
|
+
return expectBytes(bytes, NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES, "sealEk").slice();
|
|
8781
|
+
}
|
|
8600
8782
|
function parseUint32(value, label) {
|
|
8601
8783
|
const parsed = parseBigint(value, label);
|
|
8602
8784
|
if (parsed < 0n || parsed > MAX_UINT32) {
|
|
@@ -8811,15 +8993,405 @@ function expectLength4(value, len, name) {
|
|
|
8811
8993
|
}
|
|
8812
8994
|
return value;
|
|
8813
8995
|
}
|
|
8996
|
+
var TokenFactoryError = class extends Error {
|
|
8997
|
+
constructor(message) {
|
|
8998
|
+
super(message);
|
|
8999
|
+
this.name = "TokenFactoryError";
|
|
9000
|
+
}
|
|
9001
|
+
};
|
|
9002
|
+
var TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI = 3000000000000000n;
|
|
9003
|
+
var TOKEN_FACTORY_NAME_MAX_BYTES = 256;
|
|
9004
|
+
var TOKEN_FACTORY_SYMBOL_MAX_BYTES = 256;
|
|
9005
|
+
var TOKEN_FACTORY_MAX_DECIMALS = 30;
|
|
9006
|
+
var TOKEN_FACTORY_MAX_CREATOR_FEE_BPS = 1e4;
|
|
9007
|
+
var TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG = 250;
|
|
9008
|
+
var TOKEN_FACTORY_FLAGS = {
|
|
9009
|
+
MINTABLE: 1 << 0,
|
|
9010
|
+
BURNABLE: 1 << 1,
|
|
9011
|
+
PAUSABLE: 1 << 2,
|
|
9012
|
+
FIXED_SUPPLY: 1 << 3,
|
|
9013
|
+
CREATOR_FEE_OPT_IN: 1 << 4,
|
|
9014
|
+
DESTRUCTIBLE: 1 << 5
|
|
9015
|
+
};
|
|
9016
|
+
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;
|
|
9017
|
+
var TOKEN_FACTORY_SIGS = {
|
|
9018
|
+
createToken: "createToken(string,string,uint8,uint256,uint256,uint32,uint16)",
|
|
9019
|
+
transfer: "transfer(bytes32,address,uint256)",
|
|
9020
|
+
transferFrom: "transferFrom(bytes32,address,address,uint256)",
|
|
9021
|
+
approve: "approve(bytes32,address,uint256)",
|
|
9022
|
+
increaseAllowance: "increaseAllowance(bytes32,address,uint256)",
|
|
9023
|
+
decreaseAllowance: "decreaseAllowance(bytes32,address,uint256)",
|
|
9024
|
+
balanceOf: "balanceOf(bytes32,address)",
|
|
9025
|
+
allowance: "allowance(bytes32,address,address)",
|
|
9026
|
+
totalSupply: "totalSupply(bytes32)",
|
|
9027
|
+
metadata: "metadata(bytes32)",
|
|
9028
|
+
mint: "mint(bytes32,address,uint256)",
|
|
9029
|
+
burn: "burn(bytes32,uint256)",
|
|
9030
|
+
setPaused: "setPaused(bytes32,bool)",
|
|
9031
|
+
transferOwnership: "transferOwnership(bytes32,address)",
|
|
9032
|
+
destroyToken: "destroyToken(bytes32)"
|
|
9033
|
+
};
|
|
9034
|
+
var TOKEN_FACTORY_SELECTORS = {
|
|
9035
|
+
createToken: selectorHex3(TOKEN_FACTORY_SIGS.createToken),
|
|
9036
|
+
transfer: selectorHex3(TOKEN_FACTORY_SIGS.transfer),
|
|
9037
|
+
transferFrom: selectorHex3(TOKEN_FACTORY_SIGS.transferFrom),
|
|
9038
|
+
approve: selectorHex3(TOKEN_FACTORY_SIGS.approve),
|
|
9039
|
+
increaseAllowance: selectorHex3(TOKEN_FACTORY_SIGS.increaseAllowance),
|
|
9040
|
+
decreaseAllowance: selectorHex3(TOKEN_FACTORY_SIGS.decreaseAllowance),
|
|
9041
|
+
balanceOf: selectorHex3(TOKEN_FACTORY_SIGS.balanceOf),
|
|
9042
|
+
allowance: selectorHex3(TOKEN_FACTORY_SIGS.allowance),
|
|
9043
|
+
totalSupply: selectorHex3(TOKEN_FACTORY_SIGS.totalSupply),
|
|
9044
|
+
metadata: selectorHex3(TOKEN_FACTORY_SIGS.metadata),
|
|
9045
|
+
mint: selectorHex3(TOKEN_FACTORY_SIGS.mint),
|
|
9046
|
+
burn: selectorHex3(TOKEN_FACTORY_SIGS.burn),
|
|
9047
|
+
setPaused: selectorHex3(TOKEN_FACTORY_SIGS.setPaused),
|
|
9048
|
+
transferOwnership: selectorHex3(TOKEN_FACTORY_SIGS.transferOwnership),
|
|
9049
|
+
destroyToken: selectorHex3(TOKEN_FACTORY_SIGS.destroyToken)
|
|
9050
|
+
};
|
|
9051
|
+
function tokenFactoryAddressHex() {
|
|
9052
|
+
return PRECOMPILE_ADDRESSES.TOKEN_FACTORY.toLowerCase();
|
|
9053
|
+
}
|
|
9054
|
+
function deriveTokenFactoryTokenId(creator, creatorTokenNonce) {
|
|
9055
|
+
const nonce = parseUint(creatorTokenNonce, "creatorTokenNonce", 64);
|
|
9056
|
+
return bytesToHex2(
|
|
9057
|
+
keccak_256(
|
|
9058
|
+
concatBytes2(
|
|
9059
|
+
new Uint8Array([TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG]),
|
|
9060
|
+
addressBytes(creator, "creator"),
|
|
9061
|
+
uint64Be(nonce)
|
|
9062
|
+
)
|
|
9063
|
+
)
|
|
9064
|
+
);
|
|
9065
|
+
}
|
|
9066
|
+
function encodeCreateTokenCalldata(args) {
|
|
9067
|
+
const name = textBytes(args.name, "name", TOKEN_FACTORY_NAME_MAX_BYTES);
|
|
9068
|
+
const symbol = textBytes(args.symbol, "symbol", TOKEN_FACTORY_SYMBOL_MAX_BYTES);
|
|
9069
|
+
const decimals = parseSmallUint(args.decimals, "decimals", TOKEN_FACTORY_MAX_DECIMALS);
|
|
9070
|
+
const initialSupply = parseUint(args.initialSupply, "initialSupply");
|
|
9071
|
+
const maxSupply = parseUint(args.maxSupply, "maxSupply");
|
|
9072
|
+
const flags = args.flags ?? 0;
|
|
9073
|
+
validateTokenFactoryFlags(flags, args.creatorFeeBps ?? 0);
|
|
9074
|
+
const creatorFeeBps = parseSmallUint(
|
|
9075
|
+
args.creatorFeeBps ?? 0,
|
|
9076
|
+
"creatorFeeBps",
|
|
9077
|
+
TOKEN_FACTORY_MAX_CREATOR_FEE_BPS
|
|
9078
|
+
);
|
|
9079
|
+
const headLen = 7 * 32;
|
|
9080
|
+
const nameTail = dynamicBytesTail(name);
|
|
9081
|
+
const symbolOffset = BigInt(headLen + nameTail.length);
|
|
9082
|
+
return bytesToHex2(
|
|
9083
|
+
concatBytes2(
|
|
9084
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.createToken, "createToken selector"),
|
|
9085
|
+
uint256Word2(BigInt(headLen), "nameOffset"),
|
|
9086
|
+
uint256Word2(symbolOffset, "symbolOffset"),
|
|
9087
|
+
uint256Word2(BigInt(decimals), "decimals"),
|
|
9088
|
+
uint256Word2(initialSupply, "initialSupply"),
|
|
9089
|
+
uint256Word2(maxSupply, "maxSupply"),
|
|
9090
|
+
uint256Word2(BigInt(flags), "flags"),
|
|
9091
|
+
uint256Word2(BigInt(creatorFeeBps), "creatorFeeBps"),
|
|
9092
|
+
nameTail,
|
|
9093
|
+
dynamicBytesTail(symbol)
|
|
9094
|
+
)
|
|
9095
|
+
);
|
|
9096
|
+
}
|
|
9097
|
+
function encodeCreateFixedSupplyMrc20Calldata(args) {
|
|
9098
|
+
let flags = TOKEN_FACTORY_FLAGS.FIXED_SUPPLY;
|
|
9099
|
+
if (args.burnable) flags |= TOKEN_FACTORY_FLAGS.BURNABLE;
|
|
9100
|
+
if (args.pausable) flags |= TOKEN_FACTORY_FLAGS.PAUSABLE;
|
|
9101
|
+
if (args.destructible) flags |= TOKEN_FACTORY_FLAGS.DESTRUCTIBLE;
|
|
9102
|
+
return encodeCreateTokenCalldata({
|
|
9103
|
+
name: args.name,
|
|
9104
|
+
symbol: args.symbol,
|
|
9105
|
+
decimals: args.decimals,
|
|
9106
|
+
initialSupply: args.supply,
|
|
9107
|
+
maxSupply: args.supply,
|
|
9108
|
+
flags,
|
|
9109
|
+
creatorFeeBps: 0
|
|
9110
|
+
});
|
|
9111
|
+
}
|
|
9112
|
+
function encodeTokenFactoryTransferCalldata(tokenId, to, amount) {
|
|
9113
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.transfer, tokenId, to, amount);
|
|
9114
|
+
}
|
|
9115
|
+
function encodeTokenFactoryTransferFromCalldata(tokenId, from, to, amount) {
|
|
9116
|
+
return bytesToHex2(
|
|
9117
|
+
concatBytes2(
|
|
9118
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.transferFrom, "transferFrom selector"),
|
|
9119
|
+
bytes32(tokenId, "tokenId"),
|
|
9120
|
+
addressWord3(from, "from"),
|
|
9121
|
+
addressWord3(to, "to"),
|
|
9122
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9123
|
+
)
|
|
9124
|
+
);
|
|
9125
|
+
}
|
|
9126
|
+
function encodeTokenFactoryApproveCalldata(tokenId, spender, amount) {
|
|
9127
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.approve, tokenId, spender, amount);
|
|
9128
|
+
}
|
|
9129
|
+
function encodeTokenFactoryIncreaseAllowanceCalldata(tokenId, spender, delta) {
|
|
9130
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.increaseAllowance, tokenId, spender, delta);
|
|
9131
|
+
}
|
|
9132
|
+
function encodeTokenFactoryDecreaseAllowanceCalldata(tokenId, spender, delta) {
|
|
9133
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.decreaseAllowance, tokenId, spender, delta);
|
|
9134
|
+
}
|
|
9135
|
+
function encodeTokenFactoryBalanceOfCalldata(tokenId, holder) {
|
|
9136
|
+
return encodeBytes32Address(TOKEN_FACTORY_SELECTORS.balanceOf, tokenId, holder);
|
|
9137
|
+
}
|
|
9138
|
+
function encodeTokenFactoryAllowanceCalldata(tokenId, owner, spender) {
|
|
9139
|
+
return bytesToHex2(
|
|
9140
|
+
concatBytes2(
|
|
9141
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.allowance, "allowance selector"),
|
|
9142
|
+
bytes32(tokenId, "tokenId"),
|
|
9143
|
+
addressWord3(owner, "owner"),
|
|
9144
|
+
addressWord3(spender, "spender")
|
|
9145
|
+
)
|
|
9146
|
+
);
|
|
9147
|
+
}
|
|
9148
|
+
function encodeTokenFactoryTotalSupplyCalldata(tokenId) {
|
|
9149
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.totalSupply, tokenId);
|
|
9150
|
+
}
|
|
9151
|
+
function encodeTokenFactoryMetadataCalldata(tokenId) {
|
|
9152
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.metadata, tokenId);
|
|
9153
|
+
}
|
|
9154
|
+
function encodeTokenFactoryMintCalldata(tokenId, to, amount) {
|
|
9155
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.mint, tokenId, to, amount);
|
|
9156
|
+
}
|
|
9157
|
+
function encodeTokenFactoryBurnCalldata(tokenId, amount) {
|
|
9158
|
+
return encodeBytes32Uint(TOKEN_FACTORY_SELECTORS.burn, tokenId, amount);
|
|
9159
|
+
}
|
|
9160
|
+
function encodeTokenFactorySetPausedCalldata(tokenId, paused) {
|
|
9161
|
+
return bytesToHex2(
|
|
9162
|
+
concatBytes2(
|
|
9163
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.setPaused, "setPaused selector"),
|
|
9164
|
+
bytes32(tokenId, "tokenId"),
|
|
9165
|
+
boolWord(paused)
|
|
9166
|
+
)
|
|
9167
|
+
);
|
|
9168
|
+
}
|
|
9169
|
+
function encodeTokenFactoryTransferOwnershipCalldata(tokenId, newOwner) {
|
|
9170
|
+
return encodeBytes32Address(TOKEN_FACTORY_SELECTORS.transferOwnership, tokenId, newOwner);
|
|
9171
|
+
}
|
|
9172
|
+
function encodeTokenFactoryDestroyCalldata(tokenId) {
|
|
9173
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.destroyToken, tokenId);
|
|
9174
|
+
}
|
|
9175
|
+
function decodeTokenFactoryTokenId(output) {
|
|
9176
|
+
return bytesToHex2(bytes32(output, "output"));
|
|
9177
|
+
}
|
|
9178
|
+
function validateTokenFactoryFlags(flags, creatorFeeBps = 0) {
|
|
9179
|
+
if (!Number.isInteger(flags) || flags < 0 || flags > 4294967295) {
|
|
9180
|
+
throw new TokenFactoryError("flags must be a uint32");
|
|
9181
|
+
}
|
|
9182
|
+
if ((flags & ~TOKEN_FACTORY_KNOWN_FLAG_MASK) !== 0) {
|
|
9183
|
+
throw new TokenFactoryError("flags contain an unknown bit");
|
|
9184
|
+
}
|
|
9185
|
+
if ((flags & TOKEN_FACTORY_FLAGS.MINTABLE) !== 0 && (flags & TOKEN_FACTORY_FLAGS.FIXED_SUPPLY) !== 0) {
|
|
9186
|
+
throw new TokenFactoryError("MINTABLE and FIXED_SUPPLY are mutually exclusive");
|
|
9187
|
+
}
|
|
9188
|
+
if ((flags & TOKEN_FACTORY_FLAGS.CREATOR_FEE_OPT_IN) !== 0) {
|
|
9189
|
+
if (creatorFeeBps <= 0) throw new TokenFactoryError("CREATOR_FEE_OPT_IN requires non-zero creatorFeeBps");
|
|
9190
|
+
} else if (creatorFeeBps !== 0) {
|
|
9191
|
+
throw new TokenFactoryError("creatorFeeBps must be 0 when CREATOR_FEE_OPT_IN is unset");
|
|
9192
|
+
}
|
|
9193
|
+
}
|
|
9194
|
+
function encodeBytes32(selector, value) {
|
|
9195
|
+
return bytesToHex2(concatBytes2(hexToBytes2(selector, "selector"), bytes32(value, "tokenId")));
|
|
9196
|
+
}
|
|
9197
|
+
function encodeBytes32Uint(selector, tokenId, amount) {
|
|
9198
|
+
return bytesToHex2(
|
|
9199
|
+
concatBytes2(
|
|
9200
|
+
hexToBytes2(selector, "selector"),
|
|
9201
|
+
bytes32(tokenId, "tokenId"),
|
|
9202
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9203
|
+
)
|
|
9204
|
+
);
|
|
9205
|
+
}
|
|
9206
|
+
function encodeBytes32Address(selector, tokenId, address) {
|
|
9207
|
+
return bytesToHex2(
|
|
9208
|
+
concatBytes2(
|
|
9209
|
+
hexToBytes2(selector, "selector"),
|
|
9210
|
+
bytes32(tokenId, "tokenId"),
|
|
9211
|
+
addressWord3(address, "address")
|
|
9212
|
+
)
|
|
9213
|
+
);
|
|
9214
|
+
}
|
|
9215
|
+
function encodeBytes32AddressUint(selector, tokenId, address, amount) {
|
|
9216
|
+
return bytesToHex2(
|
|
9217
|
+
concatBytes2(
|
|
9218
|
+
hexToBytes2(selector, "selector"),
|
|
9219
|
+
bytes32(tokenId, "tokenId"),
|
|
9220
|
+
addressWord3(address, "address"),
|
|
9221
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9222
|
+
)
|
|
9223
|
+
);
|
|
9224
|
+
}
|
|
9225
|
+
function selectorHex3(signature) {
|
|
9226
|
+
const sel = keccak_256(new TextEncoder().encode(signature)).slice(0, 4);
|
|
9227
|
+
return bytesToHex2(sel);
|
|
9228
|
+
}
|
|
9229
|
+
function textBytes(value, label, maxBytes) {
|
|
9230
|
+
const bytes = new TextEncoder().encode(value);
|
|
9231
|
+
if (bytes.length === 0 || bytes.length > maxBytes) {
|
|
9232
|
+
throw new TokenFactoryError(`${label} must be 1..=${maxBytes} UTF-8 bytes`);
|
|
9233
|
+
}
|
|
9234
|
+
return bytes;
|
|
9235
|
+
}
|
|
9236
|
+
function dynamicBytesTail(bytes) {
|
|
9237
|
+
return concatBytes2(uint256Word2(BigInt(bytes.length), "length"), padTo323(bytes));
|
|
9238
|
+
}
|
|
9239
|
+
function padTo323(bytes) {
|
|
9240
|
+
const padded = Math.ceil(bytes.length / 32) * 32;
|
|
9241
|
+
if (padded === bytes.length) return bytes;
|
|
9242
|
+
const out = new Uint8Array(padded);
|
|
9243
|
+
out.set(bytes);
|
|
9244
|
+
return out;
|
|
9245
|
+
}
|
|
9246
|
+
function addressWord3(value, label) {
|
|
9247
|
+
const out = new Uint8Array(32);
|
|
9248
|
+
out.set(addressBytes(value, label), 12);
|
|
9249
|
+
return out;
|
|
9250
|
+
}
|
|
9251
|
+
function addressBytes(value, label) {
|
|
9252
|
+
const bytes = toBytes5(value, label);
|
|
9253
|
+
if (bytes.length !== 20) {
|
|
9254
|
+
throw new TokenFactoryError(`${label} must be 20 bytes, got ${bytes.length}`);
|
|
9255
|
+
}
|
|
9256
|
+
return bytes;
|
|
9257
|
+
}
|
|
9258
|
+
function bytes32(value, label) {
|
|
9259
|
+
const bytes = toBytes5(value, label);
|
|
9260
|
+
if (bytes.length !== 32) {
|
|
9261
|
+
throw new TokenFactoryError(`${label} must be 32 bytes, got ${bytes.length}`);
|
|
9262
|
+
}
|
|
9263
|
+
return bytes;
|
|
9264
|
+
}
|
|
9265
|
+
function boolWord(value) {
|
|
9266
|
+
const out = new Uint8Array(32);
|
|
9267
|
+
out[31] = value ? 1 : 0;
|
|
9268
|
+
return out;
|
|
9269
|
+
}
|
|
9270
|
+
function uint256Word2(value, label) {
|
|
9271
|
+
if (value < 0n || value > (1n << 256n) - 1n) {
|
|
9272
|
+
throw new TokenFactoryError(`${label} out of uint256 range`);
|
|
9273
|
+
}
|
|
9274
|
+
const out = new Uint8Array(32);
|
|
9275
|
+
let rest = value;
|
|
9276
|
+
for (let i = 31; i >= 0 && rest > 0n; i--) {
|
|
9277
|
+
out[i] = Number(rest & 0xffn);
|
|
9278
|
+
rest >>= 8n;
|
|
9279
|
+
}
|
|
9280
|
+
return out;
|
|
9281
|
+
}
|
|
9282
|
+
function uint64Be(value) {
|
|
9283
|
+
const out = new Uint8Array(8);
|
|
9284
|
+
let rest = value;
|
|
9285
|
+
for (let i = 7; i >= 0; i--) {
|
|
9286
|
+
out[i] = Number(rest & 0xffn);
|
|
9287
|
+
rest >>= 8n;
|
|
9288
|
+
}
|
|
9289
|
+
return out;
|
|
9290
|
+
}
|
|
9291
|
+
function parseSmallUint(value, label, max) {
|
|
9292
|
+
if (!Number.isInteger(value) || value < 0 || value > max) {
|
|
9293
|
+
throw new TokenFactoryError(`${label} must be an integer in 0..=${max}`);
|
|
9294
|
+
}
|
|
9295
|
+
return value;
|
|
9296
|
+
}
|
|
9297
|
+
function parseUint(value, label, bits = 256) {
|
|
9298
|
+
let parsed;
|
|
9299
|
+
if (typeof value === "bigint") {
|
|
9300
|
+
parsed = value;
|
|
9301
|
+
} else if (typeof value === "number") {
|
|
9302
|
+
if (!Number.isSafeInteger(value)) throw new TokenFactoryError(`${label} must be a safe integer`);
|
|
9303
|
+
parsed = BigInt(value);
|
|
9304
|
+
} else if (value.startsWith("0x") || value.startsWith("0X")) {
|
|
9305
|
+
parsed = BigInt(value);
|
|
9306
|
+
} else {
|
|
9307
|
+
if (!/^[0-9]+$/.test(value)) throw new TokenFactoryError(`${label} must be a non-negative integer`);
|
|
9308
|
+
parsed = BigInt(value);
|
|
9309
|
+
}
|
|
9310
|
+
if (parsed < 0n || parsed > (1n << BigInt(bits)) - 1n) {
|
|
9311
|
+
throw new TokenFactoryError(`${label} out of uint${bits} range`);
|
|
9312
|
+
}
|
|
9313
|
+
return parsed;
|
|
9314
|
+
}
|
|
9315
|
+
function toBytes5(value, label) {
|
|
9316
|
+
if (typeof value === "string") return hexToBytes2(value, label);
|
|
9317
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9318
|
+
}
|
|
9319
|
+
|
|
9320
|
+
// src/vrf.ts
|
|
9321
|
+
var VrfCallError = class extends Error {
|
|
9322
|
+
constructor(message) {
|
|
9323
|
+
super(message);
|
|
9324
|
+
this.name = "VrfCallError";
|
|
9325
|
+
}
|
|
9326
|
+
};
|
|
9327
|
+
var VRF_OUTPUT_BYTES = 32;
|
|
9328
|
+
var VRF_DOMAIN_TAG_MAX_BYTES = 256;
|
|
9329
|
+
var VRF_HEIGHT_NOT_FINALIZED_REVERT = "vrf: height not finalized";
|
|
9330
|
+
function vrfAddressHex() {
|
|
9331
|
+
return PRECOMPILE_ADDRESSES.VRF.toLowerCase();
|
|
9332
|
+
}
|
|
9333
|
+
function encodeVrfEvaluateCalldata(blockHeight, domainTag = new Uint8Array()) {
|
|
9334
|
+
const height = parseUint64(blockHeight, "blockHeight");
|
|
9335
|
+
const tag = normalizeDomainTag(domainTag);
|
|
9336
|
+
if (tag.length > VRF_DOMAIN_TAG_MAX_BYTES) {
|
|
9337
|
+
throw new VrfCallError(`domainTag exceeds ${VRF_DOMAIN_TAG_MAX_BYTES} bytes`);
|
|
9338
|
+
}
|
|
9339
|
+
return bytesToHex2(concatBytes2(uint256Word3(height), tag));
|
|
9340
|
+
}
|
|
9341
|
+
function decodeVrfOutput(output) {
|
|
9342
|
+
const bytes = toBytes6(output, "output");
|
|
9343
|
+
if (bytes.length !== VRF_OUTPUT_BYTES) {
|
|
9344
|
+
throw new VrfCallError(`VRF output must be ${VRF_OUTPUT_BYTES} bytes, got ${bytes.length}`);
|
|
9345
|
+
}
|
|
9346
|
+
return bytes;
|
|
9347
|
+
}
|
|
9348
|
+
function normalizeDomainTag(value) {
|
|
9349
|
+
if (typeof value === "string") {
|
|
9350
|
+
if (value.startsWith("0x") || value.startsWith("0X")) return hexToBytes2(value, "domainTag");
|
|
9351
|
+
return new TextEncoder().encode(value);
|
|
9352
|
+
}
|
|
9353
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9354
|
+
}
|
|
9355
|
+
function parseUint64(value, label) {
|
|
9356
|
+
let parsed;
|
|
9357
|
+
if (typeof value === "bigint") {
|
|
9358
|
+
parsed = value;
|
|
9359
|
+
} else if (typeof value === "number") {
|
|
9360
|
+
if (!Number.isSafeInteger(value)) throw new VrfCallError(`${label} must be a safe integer`);
|
|
9361
|
+
parsed = BigInt(value);
|
|
9362
|
+
} else if (value.startsWith("0x") || value.startsWith("0X")) {
|
|
9363
|
+
parsed = BigInt(value);
|
|
9364
|
+
} else {
|
|
9365
|
+
if (!/^[0-9]+$/.test(value)) throw new VrfCallError(`${label} must be a non-negative integer`);
|
|
9366
|
+
parsed = BigInt(value);
|
|
9367
|
+
}
|
|
9368
|
+
if (parsed < 0n || parsed > (1n << 64n) - 1n) {
|
|
9369
|
+
throw new VrfCallError(`${label} out of uint64 range`);
|
|
9370
|
+
}
|
|
9371
|
+
return parsed;
|
|
9372
|
+
}
|
|
9373
|
+
function uint256Word3(value) {
|
|
9374
|
+
const out = new Uint8Array(32);
|
|
9375
|
+
let rest = value;
|
|
9376
|
+
for (let i = 31; i >= 0 && rest > 0n; i--) {
|
|
9377
|
+
out[i] = Number(rest & 0xffn);
|
|
9378
|
+
rest >>= 8n;
|
|
9379
|
+
}
|
|
9380
|
+
return out;
|
|
9381
|
+
}
|
|
9382
|
+
function toBytes6(value, label) {
|
|
9383
|
+
if (typeof value === "string") return hexToBytes2(value, label);
|
|
9384
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9385
|
+
}
|
|
8814
9386
|
var PROVER_MARKET_ADDRESS = PRECOMPILE_ADDRESSES.PROVER_MARKET;
|
|
8815
9387
|
var SERVES_GPU_PROVE = 512;
|
|
8816
9388
|
var PROVER_MARKET_SELECTORS = {
|
|
8817
|
-
createRequest: "0x" +
|
|
8818
|
-
submitBid: "0x" +
|
|
8819
|
-
closeRequest: "0x" +
|
|
8820
|
-
submitProof: "0x" +
|
|
8821
|
-
settle: "0x" +
|
|
8822
|
-
slash: "0x" +
|
|
9389
|
+
createRequest: "0x" + selectorHex4("createRequest(bytes)"),
|
|
9390
|
+
submitBid: "0x" + selectorHex4("submitBid(bytes)"),
|
|
9391
|
+
closeRequest: "0x" + selectorHex4("closeRequest(bytes)"),
|
|
9392
|
+
submitProof: "0x" + selectorHex4("submitProof(bytes)"),
|
|
9393
|
+
settle: "0x" + selectorHex4("settle(bytes)"),
|
|
9394
|
+
slash: "0x" + selectorHex4("slash(bytes)")
|
|
8823
9395
|
};
|
|
8824
9396
|
var PROVER_MARKET_EVENT_SIGS = {
|
|
8825
9397
|
proofRequested: "ProofRequested(bytes32,address,bytes32,uint128,uint64)",
|
|
@@ -8861,8 +9433,8 @@ function requestSighash(vkeyHash, inputsHash, maxFee, deadline, nonce) {
|
|
|
8861
9433
|
keccak_256(
|
|
8862
9434
|
concatBytes7(
|
|
8863
9435
|
new TextEncoder().encode(PROVER_MARKET_REQUEST_DOMAIN),
|
|
8864
|
-
expectLength5(
|
|
8865
|
-
expectLength5(
|
|
9436
|
+
expectLength5(toBytes7(vkeyHash), 32, "vkeyHash"),
|
|
9437
|
+
expectLength5(toBytes7(inputsHash), 32, "inputsHash"),
|
|
8866
9438
|
u128Bytes(maxFee, "maxFee"),
|
|
8867
9439
|
u64Bytes(deadline, "deadline"),
|
|
8868
9440
|
u64Bytes(nonce, "nonce")
|
|
@@ -8875,7 +9447,7 @@ function bidSighash(requestId, fee) {
|
|
|
8875
9447
|
keccak_256(
|
|
8876
9448
|
concatBytes7(
|
|
8877
9449
|
new TextEncoder().encode(PROVER_MARKET_BID_DOMAIN),
|
|
8878
|
-
expectLength5(
|
|
9450
|
+
expectLength5(toBytes7(requestId), 32, "requestId"),
|
|
8879
9451
|
u128Bytes(fee, "fee")
|
|
8880
9452
|
)
|
|
8881
9453
|
)
|
|
@@ -8886,16 +9458,16 @@ function submitSighash(requestId, proofHash) {
|
|
|
8886
9458
|
keccak_256(
|
|
8887
9459
|
concatBytes7(
|
|
8888
9460
|
new TextEncoder().encode(PROVER_MARKET_SUBMIT_DOMAIN),
|
|
8889
|
-
expectLength5(
|
|
8890
|
-
expectLength5(
|
|
9461
|
+
expectLength5(toBytes7(requestId), 32, "requestId"),
|
|
9462
|
+
expectLength5(toBytes7(proofHash), 32, "proofHash")
|
|
8891
9463
|
)
|
|
8892
9464
|
)
|
|
8893
9465
|
);
|
|
8894
9466
|
}
|
|
8895
9467
|
function encodeCreateRequestCanonical(args) {
|
|
8896
|
-
const buyer = expectLength5(
|
|
8897
|
-
const buyerPubkey =
|
|
8898
|
-
const sig =
|
|
9468
|
+
const buyer = expectLength5(toBytes7(args.buyer), 20, "buyer");
|
|
9469
|
+
const buyerPubkey = toBytes7(args.buyerPubkey);
|
|
9470
|
+
const sig = toBytes7(args.sig);
|
|
8899
9471
|
if (buyerPubkey.length === 0 || buyerPubkey.length > 65535) {
|
|
8900
9472
|
throw new ProverMarketError("buyerPubkey length out of range (1..=65535)");
|
|
8901
9473
|
}
|
|
@@ -8907,8 +9479,8 @@ function encodeCreateRequestCanonical(args) {
|
|
|
8907
9479
|
buyer,
|
|
8908
9480
|
u16Bytes(buyerPubkey.length),
|
|
8909
9481
|
buyerPubkey,
|
|
8910
|
-
expectLength5(
|
|
8911
|
-
expectLength5(
|
|
9482
|
+
expectLength5(toBytes7(args.vkeyHash), 32, "vkeyHash"),
|
|
9483
|
+
expectLength5(toBytes7(args.inputsHash), 32, "inputsHash"),
|
|
8912
9484
|
u128Bytes(args.maxFee, "maxFee"),
|
|
8913
9485
|
u64Bytes(args.deadline, "deadline"),
|
|
8914
9486
|
u64Bytes(args.nonce, "nonce"),
|
|
@@ -8918,7 +9490,7 @@ function encodeCreateRequestCanonical(args) {
|
|
|
8918
9490
|
);
|
|
8919
9491
|
}
|
|
8920
9492
|
function encodeCreateRequestCalldata(args) {
|
|
8921
|
-
const canonical =
|
|
9493
|
+
const canonical = toBytes7(encodeCreateRequestCanonical(args));
|
|
8922
9494
|
const offset = new Uint8Array(32);
|
|
8923
9495
|
offset[31] = 32;
|
|
8924
9496
|
const lenWord = new Uint8Array(32);
|
|
@@ -8932,10 +9504,10 @@ function encodeCreateRequestCalldata(args) {
|
|
|
8932
9504
|
concatBytes7(hexToBytes7(PROVER_MARKET_SELECTORS.createRequest), offset, lenWord, canonical, new Uint8Array(pad))
|
|
8933
9505
|
);
|
|
8934
9506
|
}
|
|
8935
|
-
function
|
|
9507
|
+
function selectorHex4(sig) {
|
|
8936
9508
|
return [...keccak_256(new TextEncoder().encode(sig)).slice(0, 4)].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
8937
9509
|
}
|
|
8938
|
-
function
|
|
9510
|
+
function toBytes7(value) {
|
|
8939
9511
|
if (typeof value === "string") return hexToBytes7(value);
|
|
8940
9512
|
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
8941
9513
|
}
|
|
@@ -9073,7 +9645,7 @@ function encodeSetAutoCompoundCalldata(enabled) {
|
|
|
9073
9645
|
);
|
|
9074
9646
|
}
|
|
9075
9647
|
function isRedemptionPrincipalUnavailableRevert(data) {
|
|
9076
|
-
return bytesToHex9(
|
|
9648
|
+
return bytesToHex9(toBytes8(data)).toLowerCase() === DELEGATION_REVERT_TAGS.redemptionPrincipalUnavailable;
|
|
9077
9649
|
}
|
|
9078
9650
|
function uint64Word3(value, name) {
|
|
9079
9651
|
const n = toBigint3(value, name);
|
|
@@ -9127,7 +9699,7 @@ function toBigint3(value, name) {
|
|
|
9127
9699
|
}
|
|
9128
9700
|
return BigInt(value);
|
|
9129
9701
|
}
|
|
9130
|
-
function
|
|
9702
|
+
function toBytes8(value) {
|
|
9131
9703
|
if (typeof value === "string") {
|
|
9132
9704
|
return hexToBytes8(value);
|
|
9133
9705
|
}
|
|
@@ -9241,8 +9813,8 @@ function encodeSetPolicyCalldata(args) {
|
|
|
9241
9813
|
}
|
|
9242
9814
|
function encodeSetPolicyClaimCalldata(args, subAccountPubkey, subAccountSig) {
|
|
9243
9815
|
const normalized = normalizeArgs(args);
|
|
9244
|
-
const pubkey =
|
|
9245
|
-
const sig =
|
|
9816
|
+
const pubkey = toBytes9(subAccountPubkey);
|
|
9817
|
+
const sig = toBytes9(subAccountSig);
|
|
9246
9818
|
if (pubkey.length !== ML_DSA_65_PUBLIC_KEY_LEN2) {
|
|
9247
9819
|
throw new SpendingPolicyError(
|
|
9248
9820
|
`subAccountPubkey must be ${ML_DSA_65_PUBLIC_KEY_LEN2} bytes, got ${pubkey.length}`
|
|
@@ -9264,7 +9836,7 @@ function encodeSetPolicyClaimCalldata(args, subAccountPubkey, subAccountSig) {
|
|
|
9264
9836
|
}
|
|
9265
9837
|
function encodeClaimPolicyByAddressCalldata(args, subAccountSig) {
|
|
9266
9838
|
const normalized = normalizeArgs(args);
|
|
9267
|
-
const sig =
|
|
9839
|
+
const sig = toBytes9(subAccountSig);
|
|
9268
9840
|
if (sig.length !== ML_DSA_65_SIGNATURE_LEN2) {
|
|
9269
9841
|
throw new SpendingPolicyError(
|
|
9270
9842
|
`subAccountSig must be ${ML_DSA_65_SIGNATURE_LEN2} bytes, got ${sig.length}`
|
|
@@ -9291,12 +9863,12 @@ function normalizeArgs(args) {
|
|
|
9291
9863
|
principal: toUserAddressBytes(args.principal, "principal"),
|
|
9292
9864
|
dailyCapLythoshi: toBigint4(args.dailyCapLythoshi, "dailyCapLythoshi"),
|
|
9293
9865
|
perTxCapLythoshi: toBigint4(args.perTxCapLythoshi, "perTxCapLythoshi"),
|
|
9294
|
-
allowRoot: expectLength6(
|
|
9295
|
-
denyRoot: expectLength6(
|
|
9866
|
+
allowRoot: expectLength6(toBytes9(args.allowRoot), 32, "allowRoot"),
|
|
9867
|
+
denyRoot: expectLength6(toBytes9(args.denyRoot), 32, "denyRoot"),
|
|
9296
9868
|
weeklyCapLythoshi: toBigint4(args.weeklyCapLythoshi ?? 0n, "weeklyCapLythoshi"),
|
|
9297
9869
|
monthlyCapLythoshi: toBigint4(args.monthlyCapLythoshi ?? 0n, "monthlyCapLythoshi"),
|
|
9298
|
-
categoryAllowRoot: args.categoryAllowRoot == null ? ZERO_WORD : expectLength6(
|
|
9299
|
-
timeWindow: args.timeWindow == null ? ZERO_WORD : expectLength6(
|
|
9870
|
+
categoryAllowRoot: args.categoryAllowRoot == null ? ZERO_WORD : expectLength6(toBytes9(args.categoryAllowRoot), 32, "categoryAllowRoot"),
|
|
9871
|
+
timeWindow: args.timeWindow == null ? ZERO_WORD : expectLength6(toBytes9(args.timeWindow), 32, "timeWindow"),
|
|
9300
9872
|
policyExpiry: toBigint4(args.policyExpiry ?? 0n, "policyExpiry")
|
|
9301
9873
|
};
|
|
9302
9874
|
}
|
|
@@ -9326,7 +9898,7 @@ function packTimeWindow(enabled, startHour, endHour) {
|
|
|
9326
9898
|
return out;
|
|
9327
9899
|
}
|
|
9328
9900
|
function decodeTimeWindow(word) {
|
|
9329
|
-
const bytes = expectLength6(
|
|
9901
|
+
const bytes = expectLength6(toBytes9(word), 32, "timeWindow");
|
|
9330
9902
|
if (bytes.every((b) => b === 0)) return null;
|
|
9331
9903
|
if (bytes[29] === 0) return null;
|
|
9332
9904
|
return [Math.min(bytes[30], 23), Math.min(bytes[31], 23)];
|
|
@@ -9369,7 +9941,7 @@ function toRawAddressBytes(value) {
|
|
|
9369
9941
|
}
|
|
9370
9942
|
return expectLength6(value instanceof Uint8Array ? value : Uint8Array.from(value), 20, "address");
|
|
9371
9943
|
}
|
|
9372
|
-
function
|
|
9944
|
+
function toBytes9(value) {
|
|
9373
9945
|
if (typeof value === "string") {
|
|
9374
9946
|
return hexToBytes9(value);
|
|
9375
9947
|
}
|
|
@@ -9451,7 +10023,7 @@ function pubkeyRegistryAddressHex() {
|
|
|
9451
10023
|
return PRECOMPILE_ADDRESSES.PUBKEY_REGISTRY.toLowerCase();
|
|
9452
10024
|
}
|
|
9453
10025
|
function encodeRegisterPubkeyCalldata(pubkey) {
|
|
9454
|
-
const bytes =
|
|
10026
|
+
const bytes = toBytes10(pubkey);
|
|
9455
10027
|
if (bytes.length !== PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN) {
|
|
9456
10028
|
throw new PubkeyRegistryError(
|
|
9457
10029
|
`pubkey must be ${PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN} bytes, got ${bytes.length}`
|
|
@@ -9460,8 +10032,8 @@ function encodeRegisterPubkeyCalldata(pubkey) {
|
|
|
9460
10032
|
return bytesToHex11(
|
|
9461
10033
|
concatBytes10(
|
|
9462
10034
|
hexToBytes10(PUBKEY_REGISTRY_SELECTORS.registerPubkey),
|
|
9463
|
-
|
|
9464
|
-
|
|
10035
|
+
uint256Word4(32n),
|
|
10036
|
+
uint256Word4(BigInt(bytes.length)),
|
|
9465
10037
|
bytes
|
|
9466
10038
|
)
|
|
9467
10039
|
);
|
|
@@ -9473,7 +10045,7 @@ function encodeHasPubkeyCalldata(address) {
|
|
|
9473
10045
|
return encodeSingleAddressCall2(PUBKEY_REGISTRY_SELECTORS.hasPubkey, address);
|
|
9474
10046
|
}
|
|
9475
10047
|
function decodeLookupPubkeyReturn(data) {
|
|
9476
|
-
const bytes =
|
|
10048
|
+
const bytes = toBytes10(data);
|
|
9477
10049
|
if (bytes.length < 96) {
|
|
9478
10050
|
throw new PubkeyRegistryError("lookup return must be at least 96 bytes");
|
|
9479
10051
|
}
|
|
@@ -9498,7 +10070,7 @@ function decodeLookupPubkeyReturn(data) {
|
|
|
9498
10070
|
};
|
|
9499
10071
|
}
|
|
9500
10072
|
function decodeHasPubkeyReturn(data) {
|
|
9501
|
-
const bytes =
|
|
10073
|
+
const bytes = toBytes10(data);
|
|
9502
10074
|
if (bytes.length !== 32) {
|
|
9503
10075
|
throw new PubkeyRegistryError("hasPubkey return must be 32 bytes");
|
|
9504
10076
|
}
|
|
@@ -9512,9 +10084,9 @@ function decodeHasPubkeyReturn(data) {
|
|
|
9512
10084
|
throw new PubkeyRegistryError("hasPubkey bool must be 0 or 1");
|
|
9513
10085
|
}
|
|
9514
10086
|
function encodeSingleAddressCall2(selector, address) {
|
|
9515
|
-
return bytesToHex11(concatBytes10(hexToBytes10(selector),
|
|
10087
|
+
return bytesToHex11(concatBytes10(hexToBytes10(selector), addressWord4(toAddressBytes(address))));
|
|
9516
10088
|
}
|
|
9517
|
-
function
|
|
10089
|
+
function addressWord4(address) {
|
|
9518
10090
|
return concatBytes10(new Uint8Array(12), address);
|
|
9519
10091
|
}
|
|
9520
10092
|
function toAddressBytes(value) {
|
|
@@ -9531,7 +10103,7 @@ function toAddressBytes(value) {
|
|
|
9531
10103
|
throw new PubkeyRegistryError(`address must be a typed mono bech32m address${detail}`);
|
|
9532
10104
|
}
|
|
9533
10105
|
}
|
|
9534
|
-
function
|
|
10106
|
+
function toBytes10(value) {
|
|
9535
10107
|
if (typeof value === "string") {
|
|
9536
10108
|
return hexToBytes10(value);
|
|
9537
10109
|
}
|
|
@@ -9560,7 +10132,7 @@ function concatBytes10(...parts) {
|
|
|
9560
10132
|
}
|
|
9561
10133
|
return out;
|
|
9562
10134
|
}
|
|
9563
|
-
function
|
|
10135
|
+
function uint256Word4(value) {
|
|
9564
10136
|
if (value < 0n || value > (1n << 256n) - 1n) {
|
|
9565
10137
|
throw new PubkeyRegistryError("uint256 value out of range");
|
|
9566
10138
|
}
|
|
@@ -9708,8 +10280,8 @@ function encodePlaceLimitOrderCalldata(args) {
|
|
|
9708
10280
|
normalized.baseTokenId,
|
|
9709
10281
|
normalized.quoteTokenId,
|
|
9710
10282
|
uint8Word2(normalized.side),
|
|
9711
|
-
|
|
9712
|
-
|
|
10283
|
+
uint256Word5(normalized.price, "price"),
|
|
10284
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9713
10285
|
uint64Word4(normalized.expiryBlock, "expiryBlock")
|
|
9714
10286
|
)
|
|
9715
10287
|
);
|
|
@@ -9722,7 +10294,7 @@ function encodePlaceMarketOrderCalldata(args) {
|
|
|
9722
10294
|
normalized.baseTokenId,
|
|
9723
10295
|
normalized.quoteTokenId,
|
|
9724
10296
|
uint8Word2(normalized.side),
|
|
9725
|
-
|
|
10297
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9726
10298
|
uint16Word2(normalized.maxSlippageBps, "maxSlippageBps")
|
|
9727
10299
|
)
|
|
9728
10300
|
);
|
|
@@ -9735,7 +10307,7 @@ function encodePlaceMarketOrderExCalldata(args) {
|
|
|
9735
10307
|
normalized.baseTokenId,
|
|
9736
10308
|
normalized.quoteTokenId,
|
|
9737
10309
|
uint8Word2(normalized.side),
|
|
9738
|
-
|
|
10310
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9739
10311
|
uint16Word2(normalized.maxSlippageBps, "maxSlippageBps"),
|
|
9740
10312
|
uint8Word2(normalized.mode)
|
|
9741
10313
|
)
|
|
@@ -9755,7 +10327,7 @@ function encodeMarketGridTuneCalldata(selector, label, args) {
|
|
|
9755
10327
|
hexToBytes2(selector, `${label} selector`),
|
|
9756
10328
|
bytes32FromHex(args.baseTokenId, "baseTokenId"),
|
|
9757
10329
|
bytes32FromHex(args.quoteTokenId, "quoteTokenId"),
|
|
9758
|
-
|
|
10330
|
+
uint256Word5(BigInt(args.newValue), "newValue")
|
|
9759
10331
|
)
|
|
9760
10332
|
);
|
|
9761
10333
|
}
|
|
@@ -10043,12 +10615,12 @@ function encodePlaceLimitOrderViaCalldata(args) {
|
|
|
10043
10615
|
return bytesToHex2(
|
|
10044
10616
|
concatBytes2(
|
|
10045
10617
|
hexToBytes2(OPERATOR_ROUTER_SELECTORS.placeLimitOrderVia, "placeLimitOrderVia selector"),
|
|
10046
|
-
|
|
10618
|
+
addressWord5(operator.bytes),
|
|
10047
10619
|
bytes32FromHex(args.base, "base"),
|
|
10048
10620
|
bytes32FromHex(args.quote, "quote"),
|
|
10049
10621
|
uint8Word2(side),
|
|
10050
|
-
|
|
10051
|
-
|
|
10622
|
+
uint256Word5(price, "price"),
|
|
10623
|
+
uint256Word5(amount, "amount"),
|
|
10052
10624
|
uint64Word4(expiresAtBlock, "expiresAtBlock")
|
|
10053
10625
|
)
|
|
10054
10626
|
);
|
|
@@ -10360,7 +10932,7 @@ function uint16Word2(value, name) {
|
|
|
10360
10932
|
out[31] = Number(value & 0xffn);
|
|
10361
10933
|
return out;
|
|
10362
10934
|
}
|
|
10363
|
-
function
|
|
10935
|
+
function uint256Word5(value, name) {
|
|
10364
10936
|
if (value < 0n || value >= 1n << 256n) {
|
|
10365
10937
|
throw new MarketActionError(`${name} must fit uint256`);
|
|
10366
10938
|
}
|
|
@@ -10372,7 +10944,7 @@ function uint256Word3(value, name) {
|
|
|
10372
10944
|
}
|
|
10373
10945
|
return out;
|
|
10374
10946
|
}
|
|
10375
|
-
function
|
|
10947
|
+
function addressWord5(addr) {
|
|
10376
10948
|
if (addr.length !== 20) {
|
|
10377
10949
|
throw new MarketActionError("address must be 20 bytes");
|
|
10378
10950
|
}
|
|
@@ -10912,8 +11484,8 @@ var MONOLYTHIUM_NETWORKS = {
|
|
|
10912
11484
|
};
|
|
10913
11485
|
|
|
10914
11486
|
// src/index.ts
|
|
10915
|
-
var version = "0.4.
|
|
11487
|
+
var version = "0.4.8";
|
|
10916
11488
|
|
|
10917
|
-
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 };
|
|
11489
|
+
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, DEFAULT_OPERATOR_SEAL_KEY_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_OPERATOR_ALIAS_MAX_BYTES, NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES, NODE_REGISTRY_OPERATOR_SEAL_EK_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, TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI, TOKEN_FACTORY_FLAGS, TOKEN_FACTORY_KNOWN_FLAG_MASK, TOKEN_FACTORY_MAX_CREATOR_FEE_BPS, TOKEN_FACTORY_MAX_DECIMALS, TOKEN_FACTORY_NAME_MAX_BYTES, TOKEN_FACTORY_SELECTORS, TOKEN_FACTORY_SIGS, TOKEN_FACTORY_SYMBOL_MAX_BYTES, TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG, TRANSFER_DEFAULT_EXECUTION_UNIT_LIMIT, TokenFactoryError, V1_BRIDGE_ALLOWED_FEE_TOKEN, V1_BRIDGE_ALLOWED_PROTOCOL, VRF_DOMAIN_TAG_MAX_BYTES, VRF_HEIGHT_NOT_FINALIZED_REVERT, VRF_OUTPUT_BYTES, VrfCallError, 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, buildPublishOperatorSealKeyTxFields, 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, decodeOperatorSealKey, decodeOracleEvent, decodeTimeWindow, decodeTokenFactoryTokenId, decodeTxFeedResponse, decodeVrfOutput, delegationAddressHex, denyRootFor, deriveClobMarketId, deriveClusterAnchorAddress, deriveClusterJoinOperatorId, deriveFeedId, deriveMrvContractAddress, deriveNativeSpotMarketId, deriveNativeSpotOrderId, deriveTokenFactoryTokenId, destinationRoot, encodeAttestDkgReshareCalldata, encodeBlockSelector, encodeBridgeChallengeCalldata, encodeBridgeClaimCalldata, encodeCancelClusterJoinCalldata, encodeCancelOrderCalldata, encodeCancelPendingChangeCalldata, encodeClaimCalldata, encodeClaimPolicyByAddressCalldata, encodeCompleteRedemptionCalldata, encodeCreateFixedSupplyMrc20Calldata, encodeCreateRequestCalldata, encodeCreateRequestCanonical, encodeCreateTokenCalldata, encodeDelegateCalldata, encodeDisableCalldata, encodeEnableCalldata, encodeExpireClusterJoinCalldata, encodeFormClusterCalldata, encodeGetClusterJoinRequestCalldata, encodeGetOperatorSealKeyCalldata, 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, encodePublishOperatorSealKeyCalldata, encodeRecoverOperatorNodeCalldata, encodeRedelegateCalldata, encodeRegisterPubkeyCalldata, encodeReportServiceProbeCalldata, encodeRequestClusterJoinCalldata, encodeSetAutoCompoundCalldata, encodeSetBridgeResumeCooldownCalldata, encodeSetBridgeRouteFinalityCalldata, encodeSetLotSizeCalldata, encodeSetMinNotionalCalldata, encodeSetOperatorDisplayCalldata, encodeSetPolicyCalldata, encodeSetPolicyClaimCalldata, encodeSetTickSizeCalldata, encodeSubmitBridgeProofCalldata, encodeSubmitPendingChangeCalldata, encodeTokenFactoryAllowanceCalldata, encodeTokenFactoryApproveCalldata, encodeTokenFactoryBalanceOfCalldata, encodeTokenFactoryBurnCalldata, encodeTokenFactoryDecreaseAllowanceCalldata, encodeTokenFactoryDestroyCalldata, encodeTokenFactoryIncreaseAllowanceCalldata, encodeTokenFactoryMetadataCalldata, encodeTokenFactoryMintCalldata, encodeTokenFactorySetPausedCalldata, encodeTokenFactoryTotalSupplyCalldata, encodeTokenFactoryTransferCalldata, encodeTokenFactoryTransferFromCalldata, encodeTokenFactoryTransferOwnershipCalldata, encodeUndelegateCalldata, encodeVoteClusterAdmitCalldata, encodeVrfEvaluateCalldata, 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, submitPublishOperatorSealKey, submitRequestClusterJoin, submitSighash, submitVoteClusterAdmit, tokenFactoryAddressHex, transactionFeeExposure, typedBech32ToAddress, validateAddress, validateBridgeRouteCatalogue, validateMrvArtifactMetadata, validateMrvCallRequest, validateMrvDeployRequest, validateTokenFactoryFlags, verifyNoEvmArchiveProofSignatures, verifyNoEvmBlockFinalityEvidenceMultisig, verifyNoEvmBlockFinalityEvidenceThreshold, verifyNoEvmFinalityEvidenceMultisig, verifyNoEvmFinalityEvidenceThreshold, verifyNoEvmReceiptProof, verifyNoEvmReceiptProofTrust, version, vrfAddressHex };
|
|
10918
11490
|
//# sourceMappingURL=index.js.map
|
|
10919
11491
|
//# sourceMappingURL=index.js.map
|