@monolythium/core-sdk 0.4.4 → 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 +733 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +172 -46
- package/dist/index.d.ts +172 -46
- package/dist/index.js +686 -84
- package/dist/index.js.map +1 -1
- package/dist/{submission-5dQUuwtq.d.cts → submission-Bd8ajSxX.d.cts} +124 -15
- package/dist/{submission-5dQUuwtq.d.ts → submission-Bd8ajSxX.d.ts} +124 -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) {
|
|
@@ -2706,8 +2814,8 @@ var TESTNET_69420 = {
|
|
|
2706
2814
|
network: "testnet-69420",
|
|
2707
2815
|
display_name: "Monolythium Testnet",
|
|
2708
2816
|
description: "Public Monolythium testnet. Testnet state may reset without notice; do not store value on this network.",
|
|
2709
|
-
genesis_hash: "
|
|
2710
|
-
binary_sha: "
|
|
2817
|
+
genesis_hash: "0xb9bcc577fa7256664364518f2943fe298b50973b0e43831a081b4dca3d2d5a6a",
|
|
2818
|
+
binary_sha: "a5d5b299a0bf",
|
|
2711
2819
|
rpc: [
|
|
2712
2820
|
{
|
|
2713
2821
|
url: "http://178.105.12.9:8545",
|
|
@@ -2765,13 +2873,6 @@ var TESTNET_69420 = {
|
|
|
2765
2873
|
tier: "official",
|
|
2766
2874
|
notes: "operator-8"
|
|
2767
2875
|
},
|
|
2768
|
-
{
|
|
2769
|
-
url: "http://162.55.54.198:8545",
|
|
2770
|
-
provider: "monolythium-foundation",
|
|
2771
|
-
region: "nbg1",
|
|
2772
|
-
tier: "official",
|
|
2773
|
-
notes: "operator-9"
|
|
2774
|
-
},
|
|
2775
2876
|
{
|
|
2776
2877
|
url: "http://95.217.156.190:8545",
|
|
2777
2878
|
provider: "monolythium-foundation",
|
|
@@ -2784,78 +2885,93 @@ var TESTNET_69420 = {
|
|
|
2784
2885
|
provider: "monolythium-foundation",
|
|
2785
2886
|
region: "sin",
|
|
2786
2887
|
tier: "official",
|
|
2787
|
-
notes: "operator-11
|
|
2888
|
+
notes: "operator-11"
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
url: "http://162.55.54.198:8545",
|
|
2892
|
+
provider: "monolythium-foundation",
|
|
2893
|
+
region: "fsn1",
|
|
2894
|
+
tier: "official",
|
|
2895
|
+
notes: "operator-9 preview operator"
|
|
2788
2896
|
},
|
|
2789
2897
|
{
|
|
2790
2898
|
url: "http://128.140.125.5:8545",
|
|
2791
2899
|
provider: "monolythium-foundation",
|
|
2792
2900
|
region: "fsn1",
|
|
2793
2901
|
tier: "official",
|
|
2794
|
-
notes: "
|
|
2902
|
+
notes: "relay-1"
|
|
2795
2903
|
},
|
|
2796
2904
|
{
|
|
2797
2905
|
url: "http://178.105.45.210:8545",
|
|
2798
2906
|
provider: "monolythium-foundation",
|
|
2799
|
-
region: "
|
|
2907
|
+
region: "fsn1",
|
|
2800
2908
|
tier: "official",
|
|
2801
|
-
notes: "relay-
|
|
2909
|
+
notes: "relay-2"
|
|
2802
2910
|
},
|
|
2803
2911
|
{
|
|
2804
2912
|
url: "http://65.21.252.34:8545",
|
|
2805
2913
|
provider: "monolythium-foundation",
|
|
2806
2914
|
region: "hel1",
|
|
2807
2915
|
tier: "official",
|
|
2808
|
-
notes: "relay-
|
|
2916
|
+
notes: "relay-3"
|
|
2809
2917
|
}
|
|
2810
2918
|
],
|
|
2811
2919
|
p2p: [
|
|
2812
2920
|
{
|
|
2813
|
-
multiaddr: "/ip4/178.105.12.9/tcp/29898/p2p/
|
|
2921
|
+
multiaddr: "/ip4/178.105.12.9/tcp/29898/p2p/12D3KooWGgh9vYbNSqYbci8w7bg2AAaFWx7umN1ADjjcUoUTF2Za",
|
|
2814
2922
|
region: "fsn1"
|
|
2815
2923
|
},
|
|
2816
2924
|
{
|
|
2817
|
-
multiaddr: "/ip4/178.105.15.216/tcp/29898/p2p/
|
|
2925
|
+
multiaddr: "/ip4/178.105.15.216/tcp/29898/p2p/12D3KooWPUMj4vt1ee1Ug2QMJQwbDHSJ936JVaqw3iLXtAqPrq7R",
|
|
2818
2926
|
region: "fsn1"
|
|
2819
2927
|
},
|
|
2820
2928
|
{
|
|
2821
|
-
multiaddr: "/ip4/178.104.233.182/tcp/29898/p2p/
|
|
2929
|
+
multiaddr: "/ip4/178.104.233.182/tcp/29898/p2p/12D3KooWLPNJFUZhXyc1S7YvjMiKXyrNKCN3eFegDFF5UZAio7NJ",
|
|
2822
2930
|
region: "nbg1"
|
|
2823
2931
|
},
|
|
2824
2932
|
{
|
|
2825
|
-
multiaddr: "/ip4/65.108.94.1/tcp/29898/p2p/
|
|
2933
|
+
multiaddr: "/ip4/65.108.94.1/tcp/29898/p2p/12D3KooWRAuuQa5iEAzLUpLnyZ9VM53dvZMt3FPj7smDcwXn3oxz",
|
|
2826
2934
|
region: "hel1"
|
|
2827
2935
|
},
|
|
2828
2936
|
{
|
|
2829
|
-
multiaddr: "/ip4/95.216.154.155/tcp/29898/p2p/
|
|
2937
|
+
multiaddr: "/ip4/95.216.154.155/tcp/29898/p2p/12D3KooWFc9sVuCAuLxFTVy8KN5KXhyDvPjKkU98ySK81dFyStN8",
|
|
2830
2938
|
region: "hel1"
|
|
2831
2939
|
},
|
|
2832
2940
|
{
|
|
2833
|
-
multiaddr: "/ip4/87.99.145.48/tcp/29898/p2p/
|
|
2941
|
+
multiaddr: "/ip4/87.99.145.48/tcp/29898/p2p/12D3KooWL2KLRUHybGLd736nusDRTF2V1a9waeTsxKPwF78HDCmb",
|
|
2834
2942
|
region: "ash"
|
|
2835
2943
|
},
|
|
2836
2944
|
{
|
|
2837
|
-
multiaddr: "/ip4/5.223.85.76/tcp/29898/p2p/
|
|
2945
|
+
multiaddr: "/ip4/5.223.85.76/tcp/29898/p2p/12D3KooWHvobdzzEAiKcFkgdkRfr8vWGyWYfBoWS3jnPycvfwGrK",
|
|
2838
2946
|
region: "sin"
|
|
2839
2947
|
},
|
|
2840
2948
|
{
|
|
2841
|
-
multiaddr: "/ip4/142.132.180.99/tcp/29898/p2p/
|
|
2949
|
+
multiaddr: "/ip4/142.132.180.99/tcp/29898/p2p/12D3KooWBcAeWScYmDWPTjNM47CkKR4vEf44CNhDCcWuGpyY7Hko",
|
|
2842
2950
|
region: "fsn1"
|
|
2843
2951
|
},
|
|
2844
2952
|
{
|
|
2845
|
-
multiaddr: "/ip4/
|
|
2846
|
-
region: "nbg1"
|
|
2847
|
-
},
|
|
2848
|
-
{
|
|
2849
|
-
multiaddr: "/ip4/95.217.156.190/tcp/29898/p2p/12D3KooWLD8kzKHPVexZv2pMTvpjcEPTVZxr5qMxCeVB2QR6NNa6",
|
|
2953
|
+
multiaddr: "/ip4/95.217.156.190/tcp/29898/p2p/12D3KooWPBr8guuWoZT59AobZEBHDZqKgwHWAP3aKUzKWeGTa7Z6",
|
|
2850
2954
|
region: "hel1"
|
|
2851
2955
|
},
|
|
2852
2956
|
{
|
|
2853
|
-
multiaddr: "/ip4/5.223.65.201/tcp/29898/p2p/
|
|
2957
|
+
multiaddr: "/ip4/5.223.65.201/tcp/29898/p2p/12D3KooWGk3fQcDxD3uPKEe56G89X6m4ksrPKCfq6LMA952HVwbs",
|
|
2854
2958
|
region: "sin"
|
|
2855
2959
|
},
|
|
2856
2960
|
{
|
|
2857
|
-
multiaddr: "/ip4/
|
|
2961
|
+
multiaddr: "/ip4/162.55.54.198/tcp/29898/p2p/12D3KooWRBA5Wzs619GuMY2NrDD6fGoLYCK2tkXff2JAZyXn7RvR",
|
|
2858
2962
|
region: "fsn1"
|
|
2963
|
+
},
|
|
2964
|
+
{
|
|
2965
|
+
multiaddr: "/ip4/128.140.125.5/tcp/29898/p2p/12D3KooWAxWQueEVut82vNNbi1ncBrcnPbbHNyp5RZs7KSJBmu19",
|
|
2966
|
+
region: "fsn1"
|
|
2967
|
+
},
|
|
2968
|
+
{
|
|
2969
|
+
multiaddr: "/ip4/178.105.45.210/tcp/29898/p2p/12D3KooWQRpCMLezJmvqqpbpEu8ixGHgonqianG1aVZjw6GiStbd",
|
|
2970
|
+
region: "fsn1"
|
|
2971
|
+
},
|
|
2972
|
+
{
|
|
2973
|
+
multiaddr: "/ip4/65.21.252.34/tcp/29898/p2p/12D3KooWRGzTwPX21Nee2c39RWuT2ayNWb6NMX19jCx8recrNeXL",
|
|
2974
|
+
region: "hel1"
|
|
2859
2975
|
}
|
|
2860
2976
|
]
|
|
2861
2977
|
};
|
|
@@ -3652,6 +3768,16 @@ var RpcClient = class _RpcClient {
|
|
|
3652
3768
|
async ethGetCode(address, block = "latest") {
|
|
3653
3769
|
return this.call("eth_getCode", [address, encodeBlockSelector(block)]);
|
|
3654
3770
|
}
|
|
3771
|
+
/** `eth_call` — read-only execution against committed state. */
|
|
3772
|
+
async ethCall(request, block = "latest") {
|
|
3773
|
+
return this.call("eth_call", [request, encodeBlockSelector(block)]);
|
|
3774
|
+
}
|
|
3775
|
+
/** `eth_estimateGas` — read-only execution-unit estimate for a call object. */
|
|
3776
|
+
async ethEstimateGas(request, block = "latest") {
|
|
3777
|
+
return parseQuantityBig(
|
|
3778
|
+
await this.call("eth_estimateGas", [request, encodeBlockSelector(block)])
|
|
3779
|
+
);
|
|
3780
|
+
}
|
|
3655
3781
|
/** Compatibility block-header read by height/tag. */
|
|
3656
3782
|
async ethGetBlockByNumber(block = "latest") {
|
|
3657
3783
|
return normalizeBlockHeader(await this.call(ethCompatMethod("getBlockByNumber"), [encodeBlockSelector(block)]));
|
|
@@ -8350,6 +8476,7 @@ function pqm1MnemonicToMlDsa65Backend(mnemonic) {
|
|
|
8350
8476
|
|
|
8351
8477
|
// src/cluster-join.ts
|
|
8352
8478
|
var DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT = REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
8479
|
+
var DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT = REGISTRY_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
8353
8480
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
8354
8481
|
var MAX_UINT32 = (1n << 32n) - 1n;
|
|
8355
8482
|
function deriveClusterJoinOperatorId(operatorPubkey) {
|
|
@@ -8457,6 +8584,24 @@ function buildVoteClusterAdmitTxFields(args) {
|
|
|
8457
8584
|
})
|
|
8458
8585
|
};
|
|
8459
8586
|
}
|
|
8587
|
+
function buildPublishOperatorSealKeyTxFields(args) {
|
|
8588
|
+
return {
|
|
8589
|
+
chainId: args.chainId,
|
|
8590
|
+
nonce: args.nonce,
|
|
8591
|
+
maxFeePerGas: parseBigint(args.fee.maxFeePerGas, "maxFeePerGas"),
|
|
8592
|
+
maxPriorityFeePerGas: parseBigint(args.fee.maxPriorityFeePerGas, "maxPriorityFeePerGas"),
|
|
8593
|
+
gasLimit: parseBigint(
|
|
8594
|
+
args.fee.gasLimit ?? DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT,
|
|
8595
|
+
"gasLimit"
|
|
8596
|
+
),
|
|
8597
|
+
to: nodeRegistryAddressHex(),
|
|
8598
|
+
value: 0n,
|
|
8599
|
+
input: encodePublishOperatorSealKeyCalldata({
|
|
8600
|
+
peerId: normalizeOperatorId(args.peerId),
|
|
8601
|
+
sealEk: normalizeOperatorSealEk(args.sealEk)
|
|
8602
|
+
})
|
|
8603
|
+
};
|
|
8604
|
+
}
|
|
8460
8605
|
async function submitRequestClusterJoin(args) {
|
|
8461
8606
|
const clusterId = parseUint32(args.clusterId, "clusterId");
|
|
8462
8607
|
const operatorPubkey = normalizeConsensusPubkey(args.operatorPubkey, "operatorPubkey");
|
|
@@ -8483,7 +8628,7 @@ async function submitRequestClusterJoin(args) {
|
|
|
8483
8628
|
operatorPubkey,
|
|
8484
8629
|
bondLythoshi: args.bondLythoshi
|
|
8485
8630
|
});
|
|
8486
|
-
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex);
|
|
8631
|
+
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex, args);
|
|
8487
8632
|
}
|
|
8488
8633
|
async function submitVoteClusterAdmit(args) {
|
|
8489
8634
|
const clusterId = parseUint32(args.clusterId, "clusterId");
|
|
@@ -8510,9 +8655,62 @@ async function submitVoteClusterAdmit(args) {
|
|
|
8510
8655
|
operatorId: operatorIdHex,
|
|
8511
8656
|
voterPubkey: args.voterPubkey
|
|
8512
8657
|
});
|
|
8513
|
-
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex);
|
|
8658
|
+
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex, args);
|
|
8659
|
+
}
|
|
8660
|
+
async function submitPublishOperatorSealKey(args) {
|
|
8661
|
+
const operatorIdHex = normalizeOperatorId(args.peerId);
|
|
8662
|
+
const sealEk = normalizeOperatorSealEk(args.sealEk);
|
|
8663
|
+
const backend = pqm1MnemonicToMlDsa65Backend(args.mnemonic);
|
|
8664
|
+
const senderAddress = addressToTypedBech32("user", backend.addressBytes());
|
|
8665
|
+
const [chainId, nonce, quote] = await Promise.all([
|
|
8666
|
+
args.client.ethChainId(),
|
|
8667
|
+
args.client.lythGetTransactionCount(senderAddress),
|
|
8668
|
+
args.client.lythExecutionUnitPrice()
|
|
8669
|
+
]);
|
|
8670
|
+
const tx = buildPublishOperatorSealKeyTxFields({
|
|
8671
|
+
chainId,
|
|
8672
|
+
nonce,
|
|
8673
|
+
fee: resolveClusterJoinExecutionFee(quote, {
|
|
8674
|
+
...args,
|
|
8675
|
+
executionUnitLimit: args.executionUnitLimit ?? DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT
|
|
8676
|
+
}),
|
|
8677
|
+
peerId: operatorIdHex,
|
|
8678
|
+
sealEk
|
|
8679
|
+
});
|
|
8680
|
+
const plaintext = buildPlaintextSubmission({ backend, tx });
|
|
8681
|
+
const txHash = await submitPlaintextTransaction(
|
|
8682
|
+
args.client,
|
|
8683
|
+
plaintext.signedTxWireHex,
|
|
8684
|
+
plaintext.innerTxHashHex
|
|
8685
|
+
);
|
|
8686
|
+
return {
|
|
8687
|
+
txHash,
|
|
8688
|
+
operatorIdHex,
|
|
8689
|
+
innerSighashHex: plaintext.innerSighashHex,
|
|
8690
|
+
signedTxWireBytes: plaintext.innerWireBytes
|
|
8691
|
+
};
|
|
8514
8692
|
}
|
|
8515
|
-
async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex) {
|
|
8693
|
+
async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex, options) {
|
|
8694
|
+
if (options.private !== false) {
|
|
8695
|
+
const encrypted = await buildEncryptedSubmission({
|
|
8696
|
+
client,
|
|
8697
|
+
backend,
|
|
8698
|
+
tx,
|
|
8699
|
+
clusterId: Number(clusterId),
|
|
8700
|
+
clusterSealKeys: options.clusterSealKeys,
|
|
8701
|
+
clusterSealKeysSource: options.clusterSealKeysSource,
|
|
8702
|
+
class: MempoolClass.ContractCall
|
|
8703
|
+
});
|
|
8704
|
+
assertRpcHash(await submitEncryptedEnvelope(client, encrypted.envelopeWireHex));
|
|
8705
|
+
return {
|
|
8706
|
+
txHash: encrypted.innerTxHashHex,
|
|
8707
|
+
clusterId: clusterId.toString(10),
|
|
8708
|
+
operatorIdHex,
|
|
8709
|
+
innerSighashHex: encrypted.innerSighashHex,
|
|
8710
|
+
signedTxWireBytes: encrypted.innerWireBytes,
|
|
8711
|
+
envelopeWireBytes: hexByteLength(encrypted.envelopeWireHex)
|
|
8712
|
+
};
|
|
8713
|
+
}
|
|
8516
8714
|
const plaintext = buildPlaintextSubmission({ backend, tx });
|
|
8517
8715
|
const txHash = await submitPlaintextTransaction(
|
|
8518
8716
|
client,
|
|
@@ -8527,6 +8725,16 @@ async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex
|
|
|
8527
8725
|
signedTxWireBytes: plaintext.innerWireBytes
|
|
8528
8726
|
};
|
|
8529
8727
|
}
|
|
8728
|
+
function hexByteLength(value) {
|
|
8729
|
+
const clean = value.startsWith("0x") || value.startsWith("0X") ? value.slice(2) : value;
|
|
8730
|
+
return clean.length / 2;
|
|
8731
|
+
}
|
|
8732
|
+
function assertRpcHash(value) {
|
|
8733
|
+
const bytes = hexToBytes2(value, "lyth_submitEncrypted tx hash");
|
|
8734
|
+
if (bytes.length !== 32) {
|
|
8735
|
+
throw new Error(`lyth_submitEncrypted tx hash must be 32 bytes, got ${bytes.length}`);
|
|
8736
|
+
}
|
|
8737
|
+
}
|
|
8530
8738
|
function adaptNativeClusterJoinRequest(request) {
|
|
8531
8739
|
return {
|
|
8532
8740
|
owner: request.owner ?? ZERO_ADDRESS,
|
|
@@ -8569,6 +8777,10 @@ function normalizeOperatorId(value) {
|
|
|
8569
8777
|
const bytes = typeof value === "string" ? hexToBytes2(value, "operatorId") : value;
|
|
8570
8778
|
return bytesToHex2(expectBytes(bytes, 32, "operatorId"));
|
|
8571
8779
|
}
|
|
8780
|
+
function normalizeOperatorSealEk(value) {
|
|
8781
|
+
const bytes = typeof value === "string" ? hexToBytes2(value, "sealEk") : value;
|
|
8782
|
+
return expectBytes(bytes, NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES, "sealEk").slice();
|
|
8783
|
+
}
|
|
8572
8784
|
function parseUint32(value, label) {
|
|
8573
8785
|
const parsed = parseBigint(value, label);
|
|
8574
8786
|
if (parsed < 0n || parsed > MAX_UINT32) {
|
|
@@ -8783,15 +8995,405 @@ function expectLength4(value, len, name) {
|
|
|
8783
8995
|
}
|
|
8784
8996
|
return value;
|
|
8785
8997
|
}
|
|
8998
|
+
var TokenFactoryError = class extends Error {
|
|
8999
|
+
constructor(message) {
|
|
9000
|
+
super(message);
|
|
9001
|
+
this.name = "TokenFactoryError";
|
|
9002
|
+
}
|
|
9003
|
+
};
|
|
9004
|
+
var TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI = 3000000000000000n;
|
|
9005
|
+
var TOKEN_FACTORY_NAME_MAX_BYTES = 256;
|
|
9006
|
+
var TOKEN_FACTORY_SYMBOL_MAX_BYTES = 256;
|
|
9007
|
+
var TOKEN_FACTORY_MAX_DECIMALS = 30;
|
|
9008
|
+
var TOKEN_FACTORY_MAX_CREATOR_FEE_BPS = 1e4;
|
|
9009
|
+
var TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG = 250;
|
|
9010
|
+
var TOKEN_FACTORY_FLAGS = {
|
|
9011
|
+
MINTABLE: 1 << 0,
|
|
9012
|
+
BURNABLE: 1 << 1,
|
|
9013
|
+
PAUSABLE: 1 << 2,
|
|
9014
|
+
FIXED_SUPPLY: 1 << 3,
|
|
9015
|
+
CREATOR_FEE_OPT_IN: 1 << 4,
|
|
9016
|
+
DESTRUCTIBLE: 1 << 5
|
|
9017
|
+
};
|
|
9018
|
+
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;
|
|
9019
|
+
var TOKEN_FACTORY_SIGS = {
|
|
9020
|
+
createToken: "createToken(string,string,uint8,uint256,uint256,uint32,uint16)",
|
|
9021
|
+
transfer: "transfer(bytes32,address,uint256)",
|
|
9022
|
+
transferFrom: "transferFrom(bytes32,address,address,uint256)",
|
|
9023
|
+
approve: "approve(bytes32,address,uint256)",
|
|
9024
|
+
increaseAllowance: "increaseAllowance(bytes32,address,uint256)",
|
|
9025
|
+
decreaseAllowance: "decreaseAllowance(bytes32,address,uint256)",
|
|
9026
|
+
balanceOf: "balanceOf(bytes32,address)",
|
|
9027
|
+
allowance: "allowance(bytes32,address,address)",
|
|
9028
|
+
totalSupply: "totalSupply(bytes32)",
|
|
9029
|
+
metadata: "metadata(bytes32)",
|
|
9030
|
+
mint: "mint(bytes32,address,uint256)",
|
|
9031
|
+
burn: "burn(bytes32,uint256)",
|
|
9032
|
+
setPaused: "setPaused(bytes32,bool)",
|
|
9033
|
+
transferOwnership: "transferOwnership(bytes32,address)",
|
|
9034
|
+
destroyToken: "destroyToken(bytes32)"
|
|
9035
|
+
};
|
|
9036
|
+
var TOKEN_FACTORY_SELECTORS = {
|
|
9037
|
+
createToken: selectorHex3(TOKEN_FACTORY_SIGS.createToken),
|
|
9038
|
+
transfer: selectorHex3(TOKEN_FACTORY_SIGS.transfer),
|
|
9039
|
+
transferFrom: selectorHex3(TOKEN_FACTORY_SIGS.transferFrom),
|
|
9040
|
+
approve: selectorHex3(TOKEN_FACTORY_SIGS.approve),
|
|
9041
|
+
increaseAllowance: selectorHex3(TOKEN_FACTORY_SIGS.increaseAllowance),
|
|
9042
|
+
decreaseAllowance: selectorHex3(TOKEN_FACTORY_SIGS.decreaseAllowance),
|
|
9043
|
+
balanceOf: selectorHex3(TOKEN_FACTORY_SIGS.balanceOf),
|
|
9044
|
+
allowance: selectorHex3(TOKEN_FACTORY_SIGS.allowance),
|
|
9045
|
+
totalSupply: selectorHex3(TOKEN_FACTORY_SIGS.totalSupply),
|
|
9046
|
+
metadata: selectorHex3(TOKEN_FACTORY_SIGS.metadata),
|
|
9047
|
+
mint: selectorHex3(TOKEN_FACTORY_SIGS.mint),
|
|
9048
|
+
burn: selectorHex3(TOKEN_FACTORY_SIGS.burn),
|
|
9049
|
+
setPaused: selectorHex3(TOKEN_FACTORY_SIGS.setPaused),
|
|
9050
|
+
transferOwnership: selectorHex3(TOKEN_FACTORY_SIGS.transferOwnership),
|
|
9051
|
+
destroyToken: selectorHex3(TOKEN_FACTORY_SIGS.destroyToken)
|
|
9052
|
+
};
|
|
9053
|
+
function tokenFactoryAddressHex() {
|
|
9054
|
+
return PRECOMPILE_ADDRESSES.TOKEN_FACTORY.toLowerCase();
|
|
9055
|
+
}
|
|
9056
|
+
function deriveTokenFactoryTokenId(creator, creatorTokenNonce) {
|
|
9057
|
+
const nonce = parseUint(creatorTokenNonce, "creatorTokenNonce", 64);
|
|
9058
|
+
return bytesToHex2(
|
|
9059
|
+
sha3_js.keccak_256(
|
|
9060
|
+
concatBytes2(
|
|
9061
|
+
new Uint8Array([TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG]),
|
|
9062
|
+
addressBytes(creator, "creator"),
|
|
9063
|
+
uint64Be(nonce)
|
|
9064
|
+
)
|
|
9065
|
+
)
|
|
9066
|
+
);
|
|
9067
|
+
}
|
|
9068
|
+
function encodeCreateTokenCalldata(args) {
|
|
9069
|
+
const name = textBytes(args.name, "name", TOKEN_FACTORY_NAME_MAX_BYTES);
|
|
9070
|
+
const symbol = textBytes(args.symbol, "symbol", TOKEN_FACTORY_SYMBOL_MAX_BYTES);
|
|
9071
|
+
const decimals = parseSmallUint(args.decimals, "decimals", TOKEN_FACTORY_MAX_DECIMALS);
|
|
9072
|
+
const initialSupply = parseUint(args.initialSupply, "initialSupply");
|
|
9073
|
+
const maxSupply = parseUint(args.maxSupply, "maxSupply");
|
|
9074
|
+
const flags = args.flags ?? 0;
|
|
9075
|
+
validateTokenFactoryFlags(flags, args.creatorFeeBps ?? 0);
|
|
9076
|
+
const creatorFeeBps = parseSmallUint(
|
|
9077
|
+
args.creatorFeeBps ?? 0,
|
|
9078
|
+
"creatorFeeBps",
|
|
9079
|
+
TOKEN_FACTORY_MAX_CREATOR_FEE_BPS
|
|
9080
|
+
);
|
|
9081
|
+
const headLen = 7 * 32;
|
|
9082
|
+
const nameTail = dynamicBytesTail(name);
|
|
9083
|
+
const symbolOffset = BigInt(headLen + nameTail.length);
|
|
9084
|
+
return bytesToHex2(
|
|
9085
|
+
concatBytes2(
|
|
9086
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.createToken, "createToken selector"),
|
|
9087
|
+
uint256Word2(BigInt(headLen), "nameOffset"),
|
|
9088
|
+
uint256Word2(symbolOffset, "symbolOffset"),
|
|
9089
|
+
uint256Word2(BigInt(decimals), "decimals"),
|
|
9090
|
+
uint256Word2(initialSupply, "initialSupply"),
|
|
9091
|
+
uint256Word2(maxSupply, "maxSupply"),
|
|
9092
|
+
uint256Word2(BigInt(flags), "flags"),
|
|
9093
|
+
uint256Word2(BigInt(creatorFeeBps), "creatorFeeBps"),
|
|
9094
|
+
nameTail,
|
|
9095
|
+
dynamicBytesTail(symbol)
|
|
9096
|
+
)
|
|
9097
|
+
);
|
|
9098
|
+
}
|
|
9099
|
+
function encodeCreateFixedSupplyMrc20Calldata(args) {
|
|
9100
|
+
let flags = TOKEN_FACTORY_FLAGS.FIXED_SUPPLY;
|
|
9101
|
+
if (args.burnable) flags |= TOKEN_FACTORY_FLAGS.BURNABLE;
|
|
9102
|
+
if (args.pausable) flags |= TOKEN_FACTORY_FLAGS.PAUSABLE;
|
|
9103
|
+
if (args.destructible) flags |= TOKEN_FACTORY_FLAGS.DESTRUCTIBLE;
|
|
9104
|
+
return encodeCreateTokenCalldata({
|
|
9105
|
+
name: args.name,
|
|
9106
|
+
symbol: args.symbol,
|
|
9107
|
+
decimals: args.decimals,
|
|
9108
|
+
initialSupply: args.supply,
|
|
9109
|
+
maxSupply: args.supply,
|
|
9110
|
+
flags,
|
|
9111
|
+
creatorFeeBps: 0
|
|
9112
|
+
});
|
|
9113
|
+
}
|
|
9114
|
+
function encodeTokenFactoryTransferCalldata(tokenId, to, amount) {
|
|
9115
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.transfer, tokenId, to, amount);
|
|
9116
|
+
}
|
|
9117
|
+
function encodeTokenFactoryTransferFromCalldata(tokenId, from, to, amount) {
|
|
9118
|
+
return bytesToHex2(
|
|
9119
|
+
concatBytes2(
|
|
9120
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.transferFrom, "transferFrom selector"),
|
|
9121
|
+
bytes32(tokenId, "tokenId"),
|
|
9122
|
+
addressWord3(from, "from"),
|
|
9123
|
+
addressWord3(to, "to"),
|
|
9124
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9125
|
+
)
|
|
9126
|
+
);
|
|
9127
|
+
}
|
|
9128
|
+
function encodeTokenFactoryApproveCalldata(tokenId, spender, amount) {
|
|
9129
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.approve, tokenId, spender, amount);
|
|
9130
|
+
}
|
|
9131
|
+
function encodeTokenFactoryIncreaseAllowanceCalldata(tokenId, spender, delta) {
|
|
9132
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.increaseAllowance, tokenId, spender, delta);
|
|
9133
|
+
}
|
|
9134
|
+
function encodeTokenFactoryDecreaseAllowanceCalldata(tokenId, spender, delta) {
|
|
9135
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.decreaseAllowance, tokenId, spender, delta);
|
|
9136
|
+
}
|
|
9137
|
+
function encodeTokenFactoryBalanceOfCalldata(tokenId, holder) {
|
|
9138
|
+
return encodeBytes32Address(TOKEN_FACTORY_SELECTORS.balanceOf, tokenId, holder);
|
|
9139
|
+
}
|
|
9140
|
+
function encodeTokenFactoryAllowanceCalldata(tokenId, owner, spender) {
|
|
9141
|
+
return bytesToHex2(
|
|
9142
|
+
concatBytes2(
|
|
9143
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.allowance, "allowance selector"),
|
|
9144
|
+
bytes32(tokenId, "tokenId"),
|
|
9145
|
+
addressWord3(owner, "owner"),
|
|
9146
|
+
addressWord3(spender, "spender")
|
|
9147
|
+
)
|
|
9148
|
+
);
|
|
9149
|
+
}
|
|
9150
|
+
function encodeTokenFactoryTotalSupplyCalldata(tokenId) {
|
|
9151
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.totalSupply, tokenId);
|
|
9152
|
+
}
|
|
9153
|
+
function encodeTokenFactoryMetadataCalldata(tokenId) {
|
|
9154
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.metadata, tokenId);
|
|
9155
|
+
}
|
|
9156
|
+
function encodeTokenFactoryMintCalldata(tokenId, to, amount) {
|
|
9157
|
+
return encodeBytes32AddressUint(TOKEN_FACTORY_SELECTORS.mint, tokenId, to, amount);
|
|
9158
|
+
}
|
|
9159
|
+
function encodeTokenFactoryBurnCalldata(tokenId, amount) {
|
|
9160
|
+
return encodeBytes32Uint(TOKEN_FACTORY_SELECTORS.burn, tokenId, amount);
|
|
9161
|
+
}
|
|
9162
|
+
function encodeTokenFactorySetPausedCalldata(tokenId, paused) {
|
|
9163
|
+
return bytesToHex2(
|
|
9164
|
+
concatBytes2(
|
|
9165
|
+
hexToBytes2(TOKEN_FACTORY_SELECTORS.setPaused, "setPaused selector"),
|
|
9166
|
+
bytes32(tokenId, "tokenId"),
|
|
9167
|
+
boolWord(paused)
|
|
9168
|
+
)
|
|
9169
|
+
);
|
|
9170
|
+
}
|
|
9171
|
+
function encodeTokenFactoryTransferOwnershipCalldata(tokenId, newOwner) {
|
|
9172
|
+
return encodeBytes32Address(TOKEN_FACTORY_SELECTORS.transferOwnership, tokenId, newOwner);
|
|
9173
|
+
}
|
|
9174
|
+
function encodeTokenFactoryDestroyCalldata(tokenId) {
|
|
9175
|
+
return encodeBytes32(TOKEN_FACTORY_SELECTORS.destroyToken, tokenId);
|
|
9176
|
+
}
|
|
9177
|
+
function decodeTokenFactoryTokenId(output) {
|
|
9178
|
+
return bytesToHex2(bytes32(output, "output"));
|
|
9179
|
+
}
|
|
9180
|
+
function validateTokenFactoryFlags(flags, creatorFeeBps = 0) {
|
|
9181
|
+
if (!Number.isInteger(flags) || flags < 0 || flags > 4294967295) {
|
|
9182
|
+
throw new TokenFactoryError("flags must be a uint32");
|
|
9183
|
+
}
|
|
9184
|
+
if ((flags & ~TOKEN_FACTORY_KNOWN_FLAG_MASK) !== 0) {
|
|
9185
|
+
throw new TokenFactoryError("flags contain an unknown bit");
|
|
9186
|
+
}
|
|
9187
|
+
if ((flags & TOKEN_FACTORY_FLAGS.MINTABLE) !== 0 && (flags & TOKEN_FACTORY_FLAGS.FIXED_SUPPLY) !== 0) {
|
|
9188
|
+
throw new TokenFactoryError("MINTABLE and FIXED_SUPPLY are mutually exclusive");
|
|
9189
|
+
}
|
|
9190
|
+
if ((flags & TOKEN_FACTORY_FLAGS.CREATOR_FEE_OPT_IN) !== 0) {
|
|
9191
|
+
if (creatorFeeBps <= 0) throw new TokenFactoryError("CREATOR_FEE_OPT_IN requires non-zero creatorFeeBps");
|
|
9192
|
+
} else if (creatorFeeBps !== 0) {
|
|
9193
|
+
throw new TokenFactoryError("creatorFeeBps must be 0 when CREATOR_FEE_OPT_IN is unset");
|
|
9194
|
+
}
|
|
9195
|
+
}
|
|
9196
|
+
function encodeBytes32(selector, value) {
|
|
9197
|
+
return bytesToHex2(concatBytes2(hexToBytes2(selector, "selector"), bytes32(value, "tokenId")));
|
|
9198
|
+
}
|
|
9199
|
+
function encodeBytes32Uint(selector, tokenId, amount) {
|
|
9200
|
+
return bytesToHex2(
|
|
9201
|
+
concatBytes2(
|
|
9202
|
+
hexToBytes2(selector, "selector"),
|
|
9203
|
+
bytes32(tokenId, "tokenId"),
|
|
9204
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9205
|
+
)
|
|
9206
|
+
);
|
|
9207
|
+
}
|
|
9208
|
+
function encodeBytes32Address(selector, tokenId, address) {
|
|
9209
|
+
return bytesToHex2(
|
|
9210
|
+
concatBytes2(
|
|
9211
|
+
hexToBytes2(selector, "selector"),
|
|
9212
|
+
bytes32(tokenId, "tokenId"),
|
|
9213
|
+
addressWord3(address, "address")
|
|
9214
|
+
)
|
|
9215
|
+
);
|
|
9216
|
+
}
|
|
9217
|
+
function encodeBytes32AddressUint(selector, tokenId, address, amount) {
|
|
9218
|
+
return bytesToHex2(
|
|
9219
|
+
concatBytes2(
|
|
9220
|
+
hexToBytes2(selector, "selector"),
|
|
9221
|
+
bytes32(tokenId, "tokenId"),
|
|
9222
|
+
addressWord3(address, "address"),
|
|
9223
|
+
uint256Word2(parseUint(amount, "amount"), "amount")
|
|
9224
|
+
)
|
|
9225
|
+
);
|
|
9226
|
+
}
|
|
9227
|
+
function selectorHex3(signature) {
|
|
9228
|
+
const sel = sha3_js.keccak_256(new TextEncoder().encode(signature)).slice(0, 4);
|
|
9229
|
+
return bytesToHex2(sel);
|
|
9230
|
+
}
|
|
9231
|
+
function textBytes(value, label, maxBytes) {
|
|
9232
|
+
const bytes = new TextEncoder().encode(value);
|
|
9233
|
+
if (bytes.length === 0 || bytes.length > maxBytes) {
|
|
9234
|
+
throw new TokenFactoryError(`${label} must be 1..=${maxBytes} UTF-8 bytes`);
|
|
9235
|
+
}
|
|
9236
|
+
return bytes;
|
|
9237
|
+
}
|
|
9238
|
+
function dynamicBytesTail(bytes) {
|
|
9239
|
+
return concatBytes2(uint256Word2(BigInt(bytes.length), "length"), padTo323(bytes));
|
|
9240
|
+
}
|
|
9241
|
+
function padTo323(bytes) {
|
|
9242
|
+
const padded = Math.ceil(bytes.length / 32) * 32;
|
|
9243
|
+
if (padded === bytes.length) return bytes;
|
|
9244
|
+
const out = new Uint8Array(padded);
|
|
9245
|
+
out.set(bytes);
|
|
9246
|
+
return out;
|
|
9247
|
+
}
|
|
9248
|
+
function addressWord3(value, label) {
|
|
9249
|
+
const out = new Uint8Array(32);
|
|
9250
|
+
out.set(addressBytes(value, label), 12);
|
|
9251
|
+
return out;
|
|
9252
|
+
}
|
|
9253
|
+
function addressBytes(value, label) {
|
|
9254
|
+
const bytes = toBytes5(value, label);
|
|
9255
|
+
if (bytes.length !== 20) {
|
|
9256
|
+
throw new TokenFactoryError(`${label} must be 20 bytes, got ${bytes.length}`);
|
|
9257
|
+
}
|
|
9258
|
+
return bytes;
|
|
9259
|
+
}
|
|
9260
|
+
function bytes32(value, label) {
|
|
9261
|
+
const bytes = toBytes5(value, label);
|
|
9262
|
+
if (bytes.length !== 32) {
|
|
9263
|
+
throw new TokenFactoryError(`${label} must be 32 bytes, got ${bytes.length}`);
|
|
9264
|
+
}
|
|
9265
|
+
return bytes;
|
|
9266
|
+
}
|
|
9267
|
+
function boolWord(value) {
|
|
9268
|
+
const out = new Uint8Array(32);
|
|
9269
|
+
out[31] = value ? 1 : 0;
|
|
9270
|
+
return out;
|
|
9271
|
+
}
|
|
9272
|
+
function uint256Word2(value, label) {
|
|
9273
|
+
if (value < 0n || value > (1n << 256n) - 1n) {
|
|
9274
|
+
throw new TokenFactoryError(`${label} out of uint256 range`);
|
|
9275
|
+
}
|
|
9276
|
+
const out = new Uint8Array(32);
|
|
9277
|
+
let rest = value;
|
|
9278
|
+
for (let i = 31; i >= 0 && rest > 0n; i--) {
|
|
9279
|
+
out[i] = Number(rest & 0xffn);
|
|
9280
|
+
rest >>= 8n;
|
|
9281
|
+
}
|
|
9282
|
+
return out;
|
|
9283
|
+
}
|
|
9284
|
+
function uint64Be(value) {
|
|
9285
|
+
const out = new Uint8Array(8);
|
|
9286
|
+
let rest = value;
|
|
9287
|
+
for (let i = 7; i >= 0; i--) {
|
|
9288
|
+
out[i] = Number(rest & 0xffn);
|
|
9289
|
+
rest >>= 8n;
|
|
9290
|
+
}
|
|
9291
|
+
return out;
|
|
9292
|
+
}
|
|
9293
|
+
function parseSmallUint(value, label, max) {
|
|
9294
|
+
if (!Number.isInteger(value) || value < 0 || value > max) {
|
|
9295
|
+
throw new TokenFactoryError(`${label} must be an integer in 0..=${max}`);
|
|
9296
|
+
}
|
|
9297
|
+
return value;
|
|
9298
|
+
}
|
|
9299
|
+
function parseUint(value, label, bits = 256) {
|
|
9300
|
+
let parsed;
|
|
9301
|
+
if (typeof value === "bigint") {
|
|
9302
|
+
parsed = value;
|
|
9303
|
+
} else if (typeof value === "number") {
|
|
9304
|
+
if (!Number.isSafeInteger(value)) throw new TokenFactoryError(`${label} must be a safe integer`);
|
|
9305
|
+
parsed = BigInt(value);
|
|
9306
|
+
} else if (value.startsWith("0x") || value.startsWith("0X")) {
|
|
9307
|
+
parsed = BigInt(value);
|
|
9308
|
+
} else {
|
|
9309
|
+
if (!/^[0-9]+$/.test(value)) throw new TokenFactoryError(`${label} must be a non-negative integer`);
|
|
9310
|
+
parsed = BigInt(value);
|
|
9311
|
+
}
|
|
9312
|
+
if (parsed < 0n || parsed > (1n << BigInt(bits)) - 1n) {
|
|
9313
|
+
throw new TokenFactoryError(`${label} out of uint${bits} range`);
|
|
9314
|
+
}
|
|
9315
|
+
return parsed;
|
|
9316
|
+
}
|
|
9317
|
+
function toBytes5(value, label) {
|
|
9318
|
+
if (typeof value === "string") return hexToBytes2(value, label);
|
|
9319
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9320
|
+
}
|
|
9321
|
+
|
|
9322
|
+
// src/vrf.ts
|
|
9323
|
+
var VrfCallError = class extends Error {
|
|
9324
|
+
constructor(message) {
|
|
9325
|
+
super(message);
|
|
9326
|
+
this.name = "VrfCallError";
|
|
9327
|
+
}
|
|
9328
|
+
};
|
|
9329
|
+
var VRF_OUTPUT_BYTES = 32;
|
|
9330
|
+
var VRF_DOMAIN_TAG_MAX_BYTES = 256;
|
|
9331
|
+
var VRF_HEIGHT_NOT_FINALIZED_REVERT = "vrf: height not finalized";
|
|
9332
|
+
function vrfAddressHex() {
|
|
9333
|
+
return PRECOMPILE_ADDRESSES.VRF.toLowerCase();
|
|
9334
|
+
}
|
|
9335
|
+
function encodeVrfEvaluateCalldata(blockHeight, domainTag = new Uint8Array()) {
|
|
9336
|
+
const height = parseUint64(blockHeight, "blockHeight");
|
|
9337
|
+
const tag = normalizeDomainTag(domainTag);
|
|
9338
|
+
if (tag.length > VRF_DOMAIN_TAG_MAX_BYTES) {
|
|
9339
|
+
throw new VrfCallError(`domainTag exceeds ${VRF_DOMAIN_TAG_MAX_BYTES} bytes`);
|
|
9340
|
+
}
|
|
9341
|
+
return bytesToHex2(concatBytes2(uint256Word3(height), tag));
|
|
9342
|
+
}
|
|
9343
|
+
function decodeVrfOutput(output) {
|
|
9344
|
+
const bytes = toBytes6(output, "output");
|
|
9345
|
+
if (bytes.length !== VRF_OUTPUT_BYTES) {
|
|
9346
|
+
throw new VrfCallError(`VRF output must be ${VRF_OUTPUT_BYTES} bytes, got ${bytes.length}`);
|
|
9347
|
+
}
|
|
9348
|
+
return bytes;
|
|
9349
|
+
}
|
|
9350
|
+
function normalizeDomainTag(value) {
|
|
9351
|
+
if (typeof value === "string") {
|
|
9352
|
+
if (value.startsWith("0x") || value.startsWith("0X")) return hexToBytes2(value, "domainTag");
|
|
9353
|
+
return new TextEncoder().encode(value);
|
|
9354
|
+
}
|
|
9355
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9356
|
+
}
|
|
9357
|
+
function parseUint64(value, label) {
|
|
9358
|
+
let parsed;
|
|
9359
|
+
if (typeof value === "bigint") {
|
|
9360
|
+
parsed = value;
|
|
9361
|
+
} else if (typeof value === "number") {
|
|
9362
|
+
if (!Number.isSafeInteger(value)) throw new VrfCallError(`${label} must be a safe integer`);
|
|
9363
|
+
parsed = BigInt(value);
|
|
9364
|
+
} else if (value.startsWith("0x") || value.startsWith("0X")) {
|
|
9365
|
+
parsed = BigInt(value);
|
|
9366
|
+
} else {
|
|
9367
|
+
if (!/^[0-9]+$/.test(value)) throw new VrfCallError(`${label} must be a non-negative integer`);
|
|
9368
|
+
parsed = BigInt(value);
|
|
9369
|
+
}
|
|
9370
|
+
if (parsed < 0n || parsed > (1n << 64n) - 1n) {
|
|
9371
|
+
throw new VrfCallError(`${label} out of uint64 range`);
|
|
9372
|
+
}
|
|
9373
|
+
return parsed;
|
|
9374
|
+
}
|
|
9375
|
+
function uint256Word3(value) {
|
|
9376
|
+
const out = new Uint8Array(32);
|
|
9377
|
+
let rest = value;
|
|
9378
|
+
for (let i = 31; i >= 0 && rest > 0n; i--) {
|
|
9379
|
+
out[i] = Number(rest & 0xffn);
|
|
9380
|
+
rest >>= 8n;
|
|
9381
|
+
}
|
|
9382
|
+
return out;
|
|
9383
|
+
}
|
|
9384
|
+
function toBytes6(value, label) {
|
|
9385
|
+
if (typeof value === "string") return hexToBytes2(value, label);
|
|
9386
|
+
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
9387
|
+
}
|
|
8786
9388
|
var PROVER_MARKET_ADDRESS = PRECOMPILE_ADDRESSES.PROVER_MARKET;
|
|
8787
9389
|
var SERVES_GPU_PROVE = 512;
|
|
8788
9390
|
var PROVER_MARKET_SELECTORS = {
|
|
8789
|
-
createRequest: "0x" +
|
|
8790
|
-
submitBid: "0x" +
|
|
8791
|
-
closeRequest: "0x" +
|
|
8792
|
-
submitProof: "0x" +
|
|
8793
|
-
settle: "0x" +
|
|
8794
|
-
slash: "0x" +
|
|
9391
|
+
createRequest: "0x" + selectorHex4("createRequest(bytes)"),
|
|
9392
|
+
submitBid: "0x" + selectorHex4("submitBid(bytes)"),
|
|
9393
|
+
closeRequest: "0x" + selectorHex4("closeRequest(bytes)"),
|
|
9394
|
+
submitProof: "0x" + selectorHex4("submitProof(bytes)"),
|
|
9395
|
+
settle: "0x" + selectorHex4("settle(bytes)"),
|
|
9396
|
+
slash: "0x" + selectorHex4("slash(bytes)")
|
|
8795
9397
|
};
|
|
8796
9398
|
var PROVER_MARKET_EVENT_SIGS = {
|
|
8797
9399
|
proofRequested: "ProofRequested(bytes32,address,bytes32,uint128,uint64)",
|
|
@@ -8833,8 +9435,8 @@ function requestSighash(vkeyHash, inputsHash, maxFee, deadline, nonce) {
|
|
|
8833
9435
|
sha3_js.keccak_256(
|
|
8834
9436
|
concatBytes7(
|
|
8835
9437
|
new TextEncoder().encode(PROVER_MARKET_REQUEST_DOMAIN),
|
|
8836
|
-
expectLength5(
|
|
8837
|
-
expectLength5(
|
|
9438
|
+
expectLength5(toBytes7(vkeyHash), 32, "vkeyHash"),
|
|
9439
|
+
expectLength5(toBytes7(inputsHash), 32, "inputsHash"),
|
|
8838
9440
|
u128Bytes(maxFee, "maxFee"),
|
|
8839
9441
|
u64Bytes(deadline, "deadline"),
|
|
8840
9442
|
u64Bytes(nonce, "nonce")
|
|
@@ -8847,7 +9449,7 @@ function bidSighash(requestId, fee) {
|
|
|
8847
9449
|
sha3_js.keccak_256(
|
|
8848
9450
|
concatBytes7(
|
|
8849
9451
|
new TextEncoder().encode(PROVER_MARKET_BID_DOMAIN),
|
|
8850
|
-
expectLength5(
|
|
9452
|
+
expectLength5(toBytes7(requestId), 32, "requestId"),
|
|
8851
9453
|
u128Bytes(fee, "fee")
|
|
8852
9454
|
)
|
|
8853
9455
|
)
|
|
@@ -8858,16 +9460,16 @@ function submitSighash(requestId, proofHash) {
|
|
|
8858
9460
|
sha3_js.keccak_256(
|
|
8859
9461
|
concatBytes7(
|
|
8860
9462
|
new TextEncoder().encode(PROVER_MARKET_SUBMIT_DOMAIN),
|
|
8861
|
-
expectLength5(
|
|
8862
|
-
expectLength5(
|
|
9463
|
+
expectLength5(toBytes7(requestId), 32, "requestId"),
|
|
9464
|
+
expectLength5(toBytes7(proofHash), 32, "proofHash")
|
|
8863
9465
|
)
|
|
8864
9466
|
)
|
|
8865
9467
|
);
|
|
8866
9468
|
}
|
|
8867
9469
|
function encodeCreateRequestCanonical(args) {
|
|
8868
|
-
const buyer = expectLength5(
|
|
8869
|
-
const buyerPubkey =
|
|
8870
|
-
const sig =
|
|
9470
|
+
const buyer = expectLength5(toBytes7(args.buyer), 20, "buyer");
|
|
9471
|
+
const buyerPubkey = toBytes7(args.buyerPubkey);
|
|
9472
|
+
const sig = toBytes7(args.sig);
|
|
8871
9473
|
if (buyerPubkey.length === 0 || buyerPubkey.length > 65535) {
|
|
8872
9474
|
throw new ProverMarketError("buyerPubkey length out of range (1..=65535)");
|
|
8873
9475
|
}
|
|
@@ -8879,8 +9481,8 @@ function encodeCreateRequestCanonical(args) {
|
|
|
8879
9481
|
buyer,
|
|
8880
9482
|
u16Bytes(buyerPubkey.length),
|
|
8881
9483
|
buyerPubkey,
|
|
8882
|
-
expectLength5(
|
|
8883
|
-
expectLength5(
|
|
9484
|
+
expectLength5(toBytes7(args.vkeyHash), 32, "vkeyHash"),
|
|
9485
|
+
expectLength5(toBytes7(args.inputsHash), 32, "inputsHash"),
|
|
8884
9486
|
u128Bytes(args.maxFee, "maxFee"),
|
|
8885
9487
|
u64Bytes(args.deadline, "deadline"),
|
|
8886
9488
|
u64Bytes(args.nonce, "nonce"),
|
|
@@ -8890,7 +9492,7 @@ function encodeCreateRequestCanonical(args) {
|
|
|
8890
9492
|
);
|
|
8891
9493
|
}
|
|
8892
9494
|
function encodeCreateRequestCalldata(args) {
|
|
8893
|
-
const canonical =
|
|
9495
|
+
const canonical = toBytes7(encodeCreateRequestCanonical(args));
|
|
8894
9496
|
const offset = new Uint8Array(32);
|
|
8895
9497
|
offset[31] = 32;
|
|
8896
9498
|
const lenWord = new Uint8Array(32);
|
|
@@ -8904,10 +9506,10 @@ function encodeCreateRequestCalldata(args) {
|
|
|
8904
9506
|
concatBytes7(hexToBytes7(PROVER_MARKET_SELECTORS.createRequest), offset, lenWord, canonical, new Uint8Array(pad))
|
|
8905
9507
|
);
|
|
8906
9508
|
}
|
|
8907
|
-
function
|
|
9509
|
+
function selectorHex4(sig) {
|
|
8908
9510
|
return [...sha3_js.keccak_256(new TextEncoder().encode(sig)).slice(0, 4)].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
8909
9511
|
}
|
|
8910
|
-
function
|
|
9512
|
+
function toBytes7(value) {
|
|
8911
9513
|
if (typeof value === "string") return hexToBytes7(value);
|
|
8912
9514
|
return value instanceof Uint8Array ? value : Uint8Array.from(value);
|
|
8913
9515
|
}
|
|
@@ -9045,7 +9647,7 @@ function encodeSetAutoCompoundCalldata(enabled) {
|
|
|
9045
9647
|
);
|
|
9046
9648
|
}
|
|
9047
9649
|
function isRedemptionPrincipalUnavailableRevert(data) {
|
|
9048
|
-
return bytesToHex9(
|
|
9650
|
+
return bytesToHex9(toBytes8(data)).toLowerCase() === DELEGATION_REVERT_TAGS.redemptionPrincipalUnavailable;
|
|
9049
9651
|
}
|
|
9050
9652
|
function uint64Word3(value, name) {
|
|
9051
9653
|
const n = toBigint3(value, name);
|
|
@@ -9099,7 +9701,7 @@ function toBigint3(value, name) {
|
|
|
9099
9701
|
}
|
|
9100
9702
|
return BigInt(value);
|
|
9101
9703
|
}
|
|
9102
|
-
function
|
|
9704
|
+
function toBytes8(value) {
|
|
9103
9705
|
if (typeof value === "string") {
|
|
9104
9706
|
return hexToBytes8(value);
|
|
9105
9707
|
}
|
|
@@ -9213,8 +9815,8 @@ function encodeSetPolicyCalldata(args) {
|
|
|
9213
9815
|
}
|
|
9214
9816
|
function encodeSetPolicyClaimCalldata(args, subAccountPubkey, subAccountSig) {
|
|
9215
9817
|
const normalized = normalizeArgs(args);
|
|
9216
|
-
const pubkey =
|
|
9217
|
-
const sig =
|
|
9818
|
+
const pubkey = toBytes9(subAccountPubkey);
|
|
9819
|
+
const sig = toBytes9(subAccountSig);
|
|
9218
9820
|
if (pubkey.length !== ML_DSA_65_PUBLIC_KEY_LEN2) {
|
|
9219
9821
|
throw new SpendingPolicyError(
|
|
9220
9822
|
`subAccountPubkey must be ${ML_DSA_65_PUBLIC_KEY_LEN2} bytes, got ${pubkey.length}`
|
|
@@ -9236,7 +9838,7 @@ function encodeSetPolicyClaimCalldata(args, subAccountPubkey, subAccountSig) {
|
|
|
9236
9838
|
}
|
|
9237
9839
|
function encodeClaimPolicyByAddressCalldata(args, subAccountSig) {
|
|
9238
9840
|
const normalized = normalizeArgs(args);
|
|
9239
|
-
const sig =
|
|
9841
|
+
const sig = toBytes9(subAccountSig);
|
|
9240
9842
|
if (sig.length !== ML_DSA_65_SIGNATURE_LEN2) {
|
|
9241
9843
|
throw new SpendingPolicyError(
|
|
9242
9844
|
`subAccountSig must be ${ML_DSA_65_SIGNATURE_LEN2} bytes, got ${sig.length}`
|
|
@@ -9263,12 +9865,12 @@ function normalizeArgs(args) {
|
|
|
9263
9865
|
principal: toUserAddressBytes(args.principal, "principal"),
|
|
9264
9866
|
dailyCapLythoshi: toBigint4(args.dailyCapLythoshi, "dailyCapLythoshi"),
|
|
9265
9867
|
perTxCapLythoshi: toBigint4(args.perTxCapLythoshi, "perTxCapLythoshi"),
|
|
9266
|
-
allowRoot: expectLength6(
|
|
9267
|
-
denyRoot: expectLength6(
|
|
9868
|
+
allowRoot: expectLength6(toBytes9(args.allowRoot), 32, "allowRoot"),
|
|
9869
|
+
denyRoot: expectLength6(toBytes9(args.denyRoot), 32, "denyRoot"),
|
|
9268
9870
|
weeklyCapLythoshi: toBigint4(args.weeklyCapLythoshi ?? 0n, "weeklyCapLythoshi"),
|
|
9269
9871
|
monthlyCapLythoshi: toBigint4(args.monthlyCapLythoshi ?? 0n, "monthlyCapLythoshi"),
|
|
9270
|
-
categoryAllowRoot: args.categoryAllowRoot == null ? ZERO_WORD : expectLength6(
|
|
9271
|
-
timeWindow: args.timeWindow == null ? ZERO_WORD : expectLength6(
|
|
9872
|
+
categoryAllowRoot: args.categoryAllowRoot == null ? ZERO_WORD : expectLength6(toBytes9(args.categoryAllowRoot), 32, "categoryAllowRoot"),
|
|
9873
|
+
timeWindow: args.timeWindow == null ? ZERO_WORD : expectLength6(toBytes9(args.timeWindow), 32, "timeWindow"),
|
|
9272
9874
|
policyExpiry: toBigint4(args.policyExpiry ?? 0n, "policyExpiry")
|
|
9273
9875
|
};
|
|
9274
9876
|
}
|
|
@@ -9298,7 +9900,7 @@ function packTimeWindow(enabled, startHour, endHour) {
|
|
|
9298
9900
|
return out;
|
|
9299
9901
|
}
|
|
9300
9902
|
function decodeTimeWindow(word) {
|
|
9301
|
-
const bytes = expectLength6(
|
|
9903
|
+
const bytes = expectLength6(toBytes9(word), 32, "timeWindow");
|
|
9302
9904
|
if (bytes.every((b) => b === 0)) return null;
|
|
9303
9905
|
if (bytes[29] === 0) return null;
|
|
9304
9906
|
return [Math.min(bytes[30], 23), Math.min(bytes[31], 23)];
|
|
@@ -9341,7 +9943,7 @@ function toRawAddressBytes(value) {
|
|
|
9341
9943
|
}
|
|
9342
9944
|
return expectLength6(value instanceof Uint8Array ? value : Uint8Array.from(value), 20, "address");
|
|
9343
9945
|
}
|
|
9344
|
-
function
|
|
9946
|
+
function toBytes9(value) {
|
|
9345
9947
|
if (typeof value === "string") {
|
|
9346
9948
|
return hexToBytes9(value);
|
|
9347
9949
|
}
|
|
@@ -9423,7 +10025,7 @@ function pubkeyRegistryAddressHex() {
|
|
|
9423
10025
|
return PRECOMPILE_ADDRESSES.PUBKEY_REGISTRY.toLowerCase();
|
|
9424
10026
|
}
|
|
9425
10027
|
function encodeRegisterPubkeyCalldata(pubkey) {
|
|
9426
|
-
const bytes =
|
|
10028
|
+
const bytes = toBytes10(pubkey);
|
|
9427
10029
|
if (bytes.length !== PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN) {
|
|
9428
10030
|
throw new PubkeyRegistryError(
|
|
9429
10031
|
`pubkey must be ${PUBKEY_REGISTRY_ML_DSA_65_PUBLIC_KEY_LEN} bytes, got ${bytes.length}`
|
|
@@ -9432,8 +10034,8 @@ function encodeRegisterPubkeyCalldata(pubkey) {
|
|
|
9432
10034
|
return bytesToHex11(
|
|
9433
10035
|
concatBytes10(
|
|
9434
10036
|
hexToBytes10(PUBKEY_REGISTRY_SELECTORS.registerPubkey),
|
|
9435
|
-
|
|
9436
|
-
|
|
10037
|
+
uint256Word4(32n),
|
|
10038
|
+
uint256Word4(BigInt(bytes.length)),
|
|
9437
10039
|
bytes
|
|
9438
10040
|
)
|
|
9439
10041
|
);
|
|
@@ -9445,7 +10047,7 @@ function encodeHasPubkeyCalldata(address) {
|
|
|
9445
10047
|
return encodeSingleAddressCall2(PUBKEY_REGISTRY_SELECTORS.hasPubkey, address);
|
|
9446
10048
|
}
|
|
9447
10049
|
function decodeLookupPubkeyReturn(data) {
|
|
9448
|
-
const bytes =
|
|
10050
|
+
const bytes = toBytes10(data);
|
|
9449
10051
|
if (bytes.length < 96) {
|
|
9450
10052
|
throw new PubkeyRegistryError("lookup return must be at least 96 bytes");
|
|
9451
10053
|
}
|
|
@@ -9470,7 +10072,7 @@ function decodeLookupPubkeyReturn(data) {
|
|
|
9470
10072
|
};
|
|
9471
10073
|
}
|
|
9472
10074
|
function decodeHasPubkeyReturn(data) {
|
|
9473
|
-
const bytes =
|
|
10075
|
+
const bytes = toBytes10(data);
|
|
9474
10076
|
if (bytes.length !== 32) {
|
|
9475
10077
|
throw new PubkeyRegistryError("hasPubkey return must be 32 bytes");
|
|
9476
10078
|
}
|
|
@@ -9484,9 +10086,9 @@ function decodeHasPubkeyReturn(data) {
|
|
|
9484
10086
|
throw new PubkeyRegistryError("hasPubkey bool must be 0 or 1");
|
|
9485
10087
|
}
|
|
9486
10088
|
function encodeSingleAddressCall2(selector, address) {
|
|
9487
|
-
return bytesToHex11(concatBytes10(hexToBytes10(selector),
|
|
10089
|
+
return bytesToHex11(concatBytes10(hexToBytes10(selector), addressWord4(toAddressBytes(address))));
|
|
9488
10090
|
}
|
|
9489
|
-
function
|
|
10091
|
+
function addressWord4(address) {
|
|
9490
10092
|
return concatBytes10(new Uint8Array(12), address);
|
|
9491
10093
|
}
|
|
9492
10094
|
function toAddressBytes(value) {
|
|
@@ -9503,7 +10105,7 @@ function toAddressBytes(value) {
|
|
|
9503
10105
|
throw new PubkeyRegistryError(`address must be a typed mono bech32m address${detail}`);
|
|
9504
10106
|
}
|
|
9505
10107
|
}
|
|
9506
|
-
function
|
|
10108
|
+
function toBytes10(value) {
|
|
9507
10109
|
if (typeof value === "string") {
|
|
9508
10110
|
return hexToBytes10(value);
|
|
9509
10111
|
}
|
|
@@ -9532,7 +10134,7 @@ function concatBytes10(...parts) {
|
|
|
9532
10134
|
}
|
|
9533
10135
|
return out;
|
|
9534
10136
|
}
|
|
9535
|
-
function
|
|
10137
|
+
function uint256Word4(value) {
|
|
9536
10138
|
if (value < 0n || value > (1n << 256n) - 1n) {
|
|
9537
10139
|
throw new PubkeyRegistryError("uint256 value out of range");
|
|
9538
10140
|
}
|
|
@@ -9680,8 +10282,8 @@ function encodePlaceLimitOrderCalldata(args) {
|
|
|
9680
10282
|
normalized.baseTokenId,
|
|
9681
10283
|
normalized.quoteTokenId,
|
|
9682
10284
|
uint8Word2(normalized.side),
|
|
9683
|
-
|
|
9684
|
-
|
|
10285
|
+
uint256Word5(normalized.price, "price"),
|
|
10286
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9685
10287
|
uint64Word4(normalized.expiryBlock, "expiryBlock")
|
|
9686
10288
|
)
|
|
9687
10289
|
);
|
|
@@ -9694,7 +10296,7 @@ function encodePlaceMarketOrderCalldata(args) {
|
|
|
9694
10296
|
normalized.baseTokenId,
|
|
9695
10297
|
normalized.quoteTokenId,
|
|
9696
10298
|
uint8Word2(normalized.side),
|
|
9697
|
-
|
|
10299
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9698
10300
|
uint16Word2(normalized.maxSlippageBps, "maxSlippageBps")
|
|
9699
10301
|
)
|
|
9700
10302
|
);
|
|
@@ -9707,7 +10309,7 @@ function encodePlaceMarketOrderExCalldata(args) {
|
|
|
9707
10309
|
normalized.baseTokenId,
|
|
9708
10310
|
normalized.quoteTokenId,
|
|
9709
10311
|
uint8Word2(normalized.side),
|
|
9710
|
-
|
|
10312
|
+
uint256Word5(normalized.quantity, "quantity"),
|
|
9711
10313
|
uint16Word2(normalized.maxSlippageBps, "maxSlippageBps"),
|
|
9712
10314
|
uint8Word2(normalized.mode)
|
|
9713
10315
|
)
|
|
@@ -9727,7 +10329,7 @@ function encodeMarketGridTuneCalldata(selector, label, args) {
|
|
|
9727
10329
|
hexToBytes2(selector, `${label} selector`),
|
|
9728
10330
|
bytes32FromHex(args.baseTokenId, "baseTokenId"),
|
|
9729
10331
|
bytes32FromHex(args.quoteTokenId, "quoteTokenId"),
|
|
9730
|
-
|
|
10332
|
+
uint256Word5(BigInt(args.newValue), "newValue")
|
|
9731
10333
|
)
|
|
9732
10334
|
);
|
|
9733
10335
|
}
|
|
@@ -10015,12 +10617,12 @@ function encodePlaceLimitOrderViaCalldata(args) {
|
|
|
10015
10617
|
return bytesToHex2(
|
|
10016
10618
|
concatBytes2(
|
|
10017
10619
|
hexToBytes2(OPERATOR_ROUTER_SELECTORS.placeLimitOrderVia, "placeLimitOrderVia selector"),
|
|
10018
|
-
|
|
10620
|
+
addressWord5(operator.bytes),
|
|
10019
10621
|
bytes32FromHex(args.base, "base"),
|
|
10020
10622
|
bytes32FromHex(args.quote, "quote"),
|
|
10021
10623
|
uint8Word2(side),
|
|
10022
|
-
|
|
10023
|
-
|
|
10624
|
+
uint256Word5(price, "price"),
|
|
10625
|
+
uint256Word5(amount, "amount"),
|
|
10024
10626
|
uint64Word4(expiresAtBlock, "expiresAtBlock")
|
|
10025
10627
|
)
|
|
10026
10628
|
);
|
|
@@ -10332,7 +10934,7 @@ function uint16Word2(value, name) {
|
|
|
10332
10934
|
out[31] = Number(value & 0xffn);
|
|
10333
10935
|
return out;
|
|
10334
10936
|
}
|
|
10335
|
-
function
|
|
10937
|
+
function uint256Word5(value, name) {
|
|
10336
10938
|
if (value < 0n || value >= 1n << 256n) {
|
|
10337
10939
|
throw new MarketActionError(`${name} must fit uint256`);
|
|
10338
10940
|
}
|
|
@@ -10344,7 +10946,7 @@ function uint256Word3(value, name) {
|
|
|
10344
10946
|
}
|
|
10345
10947
|
return out;
|
|
10346
10948
|
}
|
|
10347
|
-
function
|
|
10949
|
+
function addressWord5(addr) {
|
|
10348
10950
|
if (addr.length !== 20) {
|
|
10349
10951
|
throw new MarketActionError("address must be 20 bytes");
|
|
10350
10952
|
}
|
|
@@ -10884,7 +11486,7 @@ var MONOLYTHIUM_NETWORKS = {
|
|
|
10884
11486
|
};
|
|
10885
11487
|
|
|
10886
11488
|
// src/index.ts
|
|
10887
|
-
var version = "0.4.
|
|
11489
|
+
var version = "0.4.8";
|
|
10888
11490
|
|
|
10889
11491
|
exports.ADDRESS_HRP = ADDRESS_HRP;
|
|
10890
11492
|
exports.ADDRESS_KIND_HRPS = ADDRESS_KIND_HRPS;
|
|
@@ -10905,6 +11507,7 @@ exports.CLOB_MARKET_ID_DOMAIN_TAG = CLOB_MARKET_ID_DOMAIN_TAG;
|
|
|
10905
11507
|
exports.CLOB_SELECTORS = CLOB_SELECTORS;
|
|
10906
11508
|
exports.CLUSTER_FORMED_EVENT_SIG = CLUSTER_FORMED_EVENT_SIG;
|
|
10907
11509
|
exports.DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT = DEFAULT_CLUSTER_JOIN_EXECUTION_UNIT_LIMIT;
|
|
11510
|
+
exports.DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT = DEFAULT_OPERATOR_SEAL_KEY_EXECUTION_UNIT_LIMIT;
|
|
10908
11511
|
exports.DELEGATION_REVERT_TAGS = DELEGATION_REVERT_TAGS;
|
|
10909
11512
|
exports.DELEGATION_SELECTORS = DELEGATION_SELECTORS;
|
|
10910
11513
|
exports.DIVERSITY_SCORE_MAX = DIVERSITY_SCORE_MAX;
|
|
@@ -10973,6 +11576,9 @@ exports.NODE_REGISTRY_FORM_CLUSTER_MESSAGE_DOMAIN = NODE_REGISTRY_FORM_CLUSTER_M
|
|
|
10973
11576
|
exports.NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT = NODE_REGISTRY_FORM_CLUSTER_STANDBY_COUNT;
|
|
10974
11577
|
exports.NODE_REGISTRY_FORM_CLUSTER_THRESHOLD = NODE_REGISTRY_FORM_CLUSTER_THRESHOLD;
|
|
10975
11578
|
exports.NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES = NODE_REGISTRY_LEGACY_CLUSTER_MEMBER_PUBKEY_BYTES;
|
|
11579
|
+
exports.NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES = NODE_REGISTRY_OPERATOR_ALIAS_MAX_BYTES;
|
|
11580
|
+
exports.NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES = NODE_REGISTRY_OPERATOR_MONIKER_MAX_BYTES;
|
|
11581
|
+
exports.NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES = NODE_REGISTRY_OPERATOR_SEAL_EK_BYTES;
|
|
10976
11582
|
exports.NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID = NODE_REGISTRY_PENDING_CHANGE_MAX_INTENT_ID;
|
|
10977
11583
|
exports.NODE_REGISTRY_PUBLIC_SERVICE_MASK = NODE_REGISTRY_PUBLIC_SERVICE_MASK;
|
|
10978
11584
|
exports.NODE_REGISTRY_SELECTORS = NODE_REGISTRY_SELECTORS;
|
|
@@ -11019,9 +11625,24 @@ exports.SPENDING_POLICY_SELECTORS = SPENDING_POLICY_SELECTORS;
|
|
|
11019
11625
|
exports.SdkError = SdkError;
|
|
11020
11626
|
exports.SpendingPolicyError = SpendingPolicyError;
|
|
11021
11627
|
exports.TESTNET_69420 = TESTNET_69420;
|
|
11628
|
+
exports.TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI = TOKEN_FACTORY_CREATE_DEPOSIT_LYTHOSHI;
|
|
11629
|
+
exports.TOKEN_FACTORY_FLAGS = TOKEN_FACTORY_FLAGS;
|
|
11630
|
+
exports.TOKEN_FACTORY_KNOWN_FLAG_MASK = TOKEN_FACTORY_KNOWN_FLAG_MASK;
|
|
11631
|
+
exports.TOKEN_FACTORY_MAX_CREATOR_FEE_BPS = TOKEN_FACTORY_MAX_CREATOR_FEE_BPS;
|
|
11632
|
+
exports.TOKEN_FACTORY_MAX_DECIMALS = TOKEN_FACTORY_MAX_DECIMALS;
|
|
11633
|
+
exports.TOKEN_FACTORY_NAME_MAX_BYTES = TOKEN_FACTORY_NAME_MAX_BYTES;
|
|
11634
|
+
exports.TOKEN_FACTORY_SELECTORS = TOKEN_FACTORY_SELECTORS;
|
|
11635
|
+
exports.TOKEN_FACTORY_SIGS = TOKEN_FACTORY_SIGS;
|
|
11636
|
+
exports.TOKEN_FACTORY_SYMBOL_MAX_BYTES = TOKEN_FACTORY_SYMBOL_MAX_BYTES;
|
|
11637
|
+
exports.TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG = TOKEN_FACTORY_TOKEN_ID_DOMAIN_TAG;
|
|
11022
11638
|
exports.TRANSFER_DEFAULT_EXECUTION_UNIT_LIMIT = TRANSFER_DEFAULT_EXECUTION_UNIT_LIMIT;
|
|
11639
|
+
exports.TokenFactoryError = TokenFactoryError;
|
|
11023
11640
|
exports.V1_BRIDGE_ALLOWED_FEE_TOKEN = V1_BRIDGE_ALLOWED_FEE_TOKEN;
|
|
11024
11641
|
exports.V1_BRIDGE_ALLOWED_PROTOCOL = V1_BRIDGE_ALLOWED_PROTOCOL;
|
|
11642
|
+
exports.VRF_DOMAIN_TAG_MAX_BYTES = VRF_DOMAIN_TAG_MAX_BYTES;
|
|
11643
|
+
exports.VRF_HEIGHT_NOT_FINALIZED_REVERT = VRF_HEIGHT_NOT_FINALIZED_REVERT;
|
|
11644
|
+
exports.VRF_OUTPUT_BYTES = VRF_OUTPUT_BYTES;
|
|
11645
|
+
exports.VrfCallError = VrfCallError;
|
|
11025
11646
|
exports.addressBytesToHex = addressBytesToHex;
|
|
11026
11647
|
exports.addressToBech32 = addressToBech32;
|
|
11027
11648
|
exports.addressToTypedBech32 = addressToTypedBech32;
|
|
@@ -11090,6 +11711,7 @@ exports.buildPlaceLimitOrderViaPlan = buildPlaceLimitOrderViaPlan;
|
|
|
11090
11711
|
exports.buildPlaceSpotLimitOrderPlan = buildPlaceSpotLimitOrderPlan;
|
|
11091
11712
|
exports.buildPlaceSpotMarketOrderExPlan = buildPlaceSpotMarketOrderExPlan;
|
|
11092
11713
|
exports.buildPlaceSpotMarketOrderPlan = buildPlaceSpotMarketOrderPlan;
|
|
11714
|
+
exports.buildPublishOperatorSealKeyTxFields = buildPublishOperatorSealKeyTxFields;
|
|
11093
11715
|
exports.buildRequestClusterJoinTxFields = buildRequestClusterJoinTxFields;
|
|
11094
11716
|
exports.buildVoteClusterAdmitTxFields = buildVoteClusterAdmitTxFields;
|
|
11095
11717
|
exports.categoryRoot = categoryRoot;
|
|
@@ -11120,9 +11742,12 @@ exports.decodeNativeReceiptResponse = decodeNativeReceiptResponse;
|
|
|
11120
11742
|
exports.decodeNoEvmReceiptTranscript = decodeNoEvmReceiptTranscript;
|
|
11121
11743
|
exports.decodeOperatorFeeChargedEvent = decodeOperatorFeeChargedEvent;
|
|
11122
11744
|
exports.decodeOperatorNetworkMetadata = decodeOperatorNetworkMetadata;
|
|
11745
|
+
exports.decodeOperatorSealKey = decodeOperatorSealKey;
|
|
11123
11746
|
exports.decodeOracleEvent = decodeOracleEvent;
|
|
11124
11747
|
exports.decodeTimeWindow = decodeTimeWindow;
|
|
11748
|
+
exports.decodeTokenFactoryTokenId = decodeTokenFactoryTokenId;
|
|
11125
11749
|
exports.decodeTxFeedResponse = decodeTxFeedResponse;
|
|
11750
|
+
exports.decodeVrfOutput = decodeVrfOutput;
|
|
11126
11751
|
exports.delegationAddressHex = delegationAddressHex;
|
|
11127
11752
|
exports.denyRootFor = denyRootFor;
|
|
11128
11753
|
exports.deriveClobMarketId = deriveClobMarketId;
|
|
@@ -11132,6 +11757,7 @@ exports.deriveFeedId = deriveFeedId;
|
|
|
11132
11757
|
exports.deriveMrvContractAddress = deriveMrvContractAddress;
|
|
11133
11758
|
exports.deriveNativeSpotMarketId = deriveNativeSpotMarketId;
|
|
11134
11759
|
exports.deriveNativeSpotOrderId = deriveNativeSpotOrderId;
|
|
11760
|
+
exports.deriveTokenFactoryTokenId = deriveTokenFactoryTokenId;
|
|
11135
11761
|
exports.destinationRoot = destinationRoot;
|
|
11136
11762
|
exports.encodeAttestDkgReshareCalldata = encodeAttestDkgReshareCalldata;
|
|
11137
11763
|
exports.encodeBlockSelector = encodeBlockSelector;
|
|
@@ -11143,14 +11769,17 @@ exports.encodeCancelPendingChangeCalldata = encodeCancelPendingChangeCalldata;
|
|
|
11143
11769
|
exports.encodeClaimCalldata = encodeClaimCalldata;
|
|
11144
11770
|
exports.encodeClaimPolicyByAddressCalldata = encodeClaimPolicyByAddressCalldata;
|
|
11145
11771
|
exports.encodeCompleteRedemptionCalldata = encodeCompleteRedemptionCalldata;
|
|
11772
|
+
exports.encodeCreateFixedSupplyMrc20Calldata = encodeCreateFixedSupplyMrc20Calldata;
|
|
11146
11773
|
exports.encodeCreateRequestCalldata = encodeCreateRequestCalldata;
|
|
11147
11774
|
exports.encodeCreateRequestCanonical = encodeCreateRequestCanonical;
|
|
11775
|
+
exports.encodeCreateTokenCalldata = encodeCreateTokenCalldata;
|
|
11148
11776
|
exports.encodeDelegateCalldata = encodeDelegateCalldata;
|
|
11149
11777
|
exports.encodeDisableCalldata = encodeDisableCalldata;
|
|
11150
11778
|
exports.encodeEnableCalldata = encodeEnableCalldata;
|
|
11151
11779
|
exports.encodeExpireClusterJoinCalldata = encodeExpireClusterJoinCalldata;
|
|
11152
11780
|
exports.encodeFormClusterCalldata = encodeFormClusterCalldata;
|
|
11153
11781
|
exports.encodeGetClusterJoinRequestCalldata = encodeGetClusterJoinRequestCalldata;
|
|
11782
|
+
exports.encodeGetOperatorSealKeyCalldata = encodeGetOperatorSealKeyCalldata;
|
|
11154
11783
|
exports.encodeHasPubkeyCalldata = encodeHasPubkeyCalldata;
|
|
11155
11784
|
exports.encodeLockBridgeConfigCalldata = encodeLockBridgeConfigCalldata;
|
|
11156
11785
|
exports.encodeLookupPubkeyCalldata = encodeLookupPubkeyCalldata;
|
|
@@ -11207,6 +11836,7 @@ exports.encodePlaceLimitOrderCalldata = encodePlaceLimitOrderCalldata;
|
|
|
11207
11836
|
exports.encodePlaceLimitOrderViaCalldata = encodePlaceLimitOrderViaCalldata;
|
|
11208
11837
|
exports.encodePlaceMarketOrderCalldata = encodePlaceMarketOrderCalldata;
|
|
11209
11838
|
exports.encodePlaceMarketOrderExCalldata = encodePlaceMarketOrderExCalldata;
|
|
11839
|
+
exports.encodePublishOperatorSealKeyCalldata = encodePublishOperatorSealKeyCalldata;
|
|
11210
11840
|
exports.encodeRecoverOperatorNodeCalldata = encodeRecoverOperatorNodeCalldata;
|
|
11211
11841
|
exports.encodeRedelegateCalldata = encodeRedelegateCalldata;
|
|
11212
11842
|
exports.encodeRegisterPubkeyCalldata = encodeRegisterPubkeyCalldata;
|
|
@@ -11217,13 +11847,29 @@ exports.encodeSetBridgeResumeCooldownCalldata = encodeSetBridgeResumeCooldownCal
|
|
|
11217
11847
|
exports.encodeSetBridgeRouteFinalityCalldata = encodeSetBridgeRouteFinalityCalldata;
|
|
11218
11848
|
exports.encodeSetLotSizeCalldata = encodeSetLotSizeCalldata;
|
|
11219
11849
|
exports.encodeSetMinNotionalCalldata = encodeSetMinNotionalCalldata;
|
|
11850
|
+
exports.encodeSetOperatorDisplayCalldata = encodeSetOperatorDisplayCalldata;
|
|
11220
11851
|
exports.encodeSetPolicyCalldata = encodeSetPolicyCalldata;
|
|
11221
11852
|
exports.encodeSetPolicyClaimCalldata = encodeSetPolicyClaimCalldata;
|
|
11222
11853
|
exports.encodeSetTickSizeCalldata = encodeSetTickSizeCalldata;
|
|
11223
11854
|
exports.encodeSubmitBridgeProofCalldata = encodeSubmitBridgeProofCalldata;
|
|
11224
11855
|
exports.encodeSubmitPendingChangeCalldata = encodeSubmitPendingChangeCalldata;
|
|
11856
|
+
exports.encodeTokenFactoryAllowanceCalldata = encodeTokenFactoryAllowanceCalldata;
|
|
11857
|
+
exports.encodeTokenFactoryApproveCalldata = encodeTokenFactoryApproveCalldata;
|
|
11858
|
+
exports.encodeTokenFactoryBalanceOfCalldata = encodeTokenFactoryBalanceOfCalldata;
|
|
11859
|
+
exports.encodeTokenFactoryBurnCalldata = encodeTokenFactoryBurnCalldata;
|
|
11860
|
+
exports.encodeTokenFactoryDecreaseAllowanceCalldata = encodeTokenFactoryDecreaseAllowanceCalldata;
|
|
11861
|
+
exports.encodeTokenFactoryDestroyCalldata = encodeTokenFactoryDestroyCalldata;
|
|
11862
|
+
exports.encodeTokenFactoryIncreaseAllowanceCalldata = encodeTokenFactoryIncreaseAllowanceCalldata;
|
|
11863
|
+
exports.encodeTokenFactoryMetadataCalldata = encodeTokenFactoryMetadataCalldata;
|
|
11864
|
+
exports.encodeTokenFactoryMintCalldata = encodeTokenFactoryMintCalldata;
|
|
11865
|
+
exports.encodeTokenFactorySetPausedCalldata = encodeTokenFactorySetPausedCalldata;
|
|
11866
|
+
exports.encodeTokenFactoryTotalSupplyCalldata = encodeTokenFactoryTotalSupplyCalldata;
|
|
11867
|
+
exports.encodeTokenFactoryTransferCalldata = encodeTokenFactoryTransferCalldata;
|
|
11868
|
+
exports.encodeTokenFactoryTransferFromCalldata = encodeTokenFactoryTransferFromCalldata;
|
|
11869
|
+
exports.encodeTokenFactoryTransferOwnershipCalldata = encodeTokenFactoryTransferOwnershipCalldata;
|
|
11225
11870
|
exports.encodeUndelegateCalldata = encodeUndelegateCalldata;
|
|
11226
11871
|
exports.encodeVoteClusterAdmitCalldata = encodeVoteClusterAdmitCalldata;
|
|
11872
|
+
exports.encodeVrfEvaluateCalldata = encodeVrfEvaluateCalldata;
|
|
11227
11873
|
exports.exportBridgeRouteCatalogueJson = exportBridgeRouteCatalogueJson;
|
|
11228
11874
|
exports.fetchChainInfoLatest = fetchChainInfoLatest;
|
|
11229
11875
|
exports.fetchChainRegistryLatest = fetchChainRegistryLatest;
|
|
@@ -11309,9 +11955,11 @@ exports.spendingPolicyAddressHex = spendingPolicyAddressHex;
|
|
|
11309
11955
|
exports.submitMrvCallNativeTx = submitMrvCallNativeTx;
|
|
11310
11956
|
exports.submitMrvDeployNativeTx = submitMrvDeployNativeTx;
|
|
11311
11957
|
exports.submitMrvDeployPayloadNativeTx = submitMrvDeployPayloadNativeTx;
|
|
11958
|
+
exports.submitPublishOperatorSealKey = submitPublishOperatorSealKey;
|
|
11312
11959
|
exports.submitRequestClusterJoin = submitRequestClusterJoin;
|
|
11313
11960
|
exports.submitSighash = submitSighash;
|
|
11314
11961
|
exports.submitVoteClusterAdmit = submitVoteClusterAdmit;
|
|
11962
|
+
exports.tokenFactoryAddressHex = tokenFactoryAddressHex;
|
|
11315
11963
|
exports.transactionFeeExposure = transactionFeeExposure;
|
|
11316
11964
|
exports.typedBech32ToAddress = typedBech32ToAddress;
|
|
11317
11965
|
exports.validateAddress = validateAddress;
|
|
@@ -11319,6 +11967,7 @@ exports.validateBridgeRouteCatalogue = validateBridgeRouteCatalogue;
|
|
|
11319
11967
|
exports.validateMrvArtifactMetadata = validateMrvArtifactMetadata;
|
|
11320
11968
|
exports.validateMrvCallRequest = validateMrvCallRequest;
|
|
11321
11969
|
exports.validateMrvDeployRequest = validateMrvDeployRequest;
|
|
11970
|
+
exports.validateTokenFactoryFlags = validateTokenFactoryFlags;
|
|
11322
11971
|
exports.verifyNoEvmArchiveProofSignatures = verifyNoEvmArchiveProofSignatures;
|
|
11323
11972
|
exports.verifyNoEvmBlockFinalityEvidenceMultisig = verifyNoEvmBlockFinalityEvidenceMultisig;
|
|
11324
11973
|
exports.verifyNoEvmBlockFinalityEvidenceThreshold = verifyNoEvmBlockFinalityEvidenceThreshold;
|
|
@@ -11327,5 +11976,6 @@ exports.verifyNoEvmFinalityEvidenceThreshold = verifyNoEvmFinalityEvidenceThresh
|
|
|
11327
11976
|
exports.verifyNoEvmReceiptProof = verifyNoEvmReceiptProof;
|
|
11328
11977
|
exports.verifyNoEvmReceiptProofTrust = verifyNoEvmReceiptProofTrust;
|
|
11329
11978
|
exports.version = version;
|
|
11979
|
+
exports.vrfAddressHex = vrfAddressHex;
|
|
11330
11980
|
//# sourceMappingURL=index.cjs.map
|
|
11331
11981
|
//# sourceMappingURL=index.cjs.map
|