@monolythium/core-sdk 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/crypto/index.d.cts +2 -2
- package/dist/crypto/index.d.ts +2 -2
- package/dist/index.cjs +34 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +34 -4
- package/dist/index.js.map +1 -1
- package/dist/{submission-5dQUuwtq.d.cts → submission-D9k_xppI.d.cts} +1 -1
- package/dist/{submission-5dQUuwtq.d.ts → submission-D9k_xppI.d.ts} +1 -1
- package/package.json +1 -1
package/dist/crypto/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as MlDsa65Backend } from '../submission-
|
|
2
|
-
export {
|
|
1
|
+
import { I as MlDsa65Backend } from '../submission-D9k_xppI.cjs';
|
|
2
|
+
export { j2 as ADDRESS_DERIVATION_DOMAIN, j3 as CLUSTER_MLKEM_SHAMIR, j4 as CLUSTER_MLKEM_SHAMIR_ALGO, j5 as ClusterSealKeyEntryInput, K as ClusterSealKeys, L as ClusterSealKeysSource, j6 as DKG_AEAD_TAG_LEN, j7 as DKG_NONCE_LEN, j8 as DecryptHint, j9 as ENCRYPTED_SUBMISSION_UNAVAILABLE_MESSAGE, ja as ENUM_VARIANT_INDEX_ML_DSA_65, jb as EncryptedEnvelope, jc as EncryptedSubmission, E as EncryptionKey, jd as JsonRpcCallClient, je as LythiumSealEnvelope, jf as ML_DSA_65_PUBLIC_KEY_LEN, jg as ML_DSA_65_SEED_LEN, jh as ML_DSA_65_SIGNATURE_LEN, ji as ML_DSA_65_SIGNING_KEY_LEN, jj as ML_KEM_768_CIPHERTEXT_LEN, jk as ML_KEM_768_ENCAPSULATION_KEY_LEN, jl as ML_KEM_768_SHARED_SECRET_LEN, F as MempoolClass, D as NativeEvmTxFields, jm as NativeTxExtension, jn as NativeTxExtensionDescriptor, jo as NativeTxExtensionLike, jp as NonceAad, jq as PlaintextSubmission, jr as SEAL_COMMIT_LEN, js as SEAL_DK_LEN, jt as SEAL_EK_LEN, ju as SEAL_KEM_CT_LEN, jv as SEAL_KEM_SEED_LEN, jw as SEAL_KEY_LEN, jx as SEAL_NONCE_LEN, jy as SEAL_SHARE_LEN, jz as SEAL_TAG_LEN, jA as STANDARD_ALGO_NUMBER_ML_DSA_65, jB as SealRandomSource, jC as SealRecipient, jD as SealedSubmission, jE as bincodeDecryptHint, jF as bincodeEncryptedEnvelope, jG as bincodeNonceAad, jH as bincodeSignedTransaction, jI as buildEncryptedEnvelope, jJ as buildEncryptedSubmission, jK as buildPlaintextSubmission, jL as cryptoRandomSource, jM as encodeMlDsa65Opaque, jN as encodeSealEnvelope, jO as encodeTransactionForHash, jP as encryptInnerTx, jQ as fetchEncryptionKey, jR as getClusterSealKeys, jS as mlDsa65AddressBytes, jT as mlDsa65AddressFromPublicKey, jU as outerSigDigest, jV as parseClusterSealKeys, jW as sealRosterHash, jX as sealToCluster, jY as sealTransaction, jZ as submitEncryptedEnvelope, j_ as submitPlaintextTransaction, j$ as submitSealedTransaction, k0 as submitTransactionWithPrivacy } from '../submission-D9k_xppI.cjs';
|
|
3
3
|
|
|
4
4
|
declare class BincodeWriter {
|
|
5
5
|
#private;
|
package/dist/crypto/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as MlDsa65Backend } from '../submission-
|
|
2
|
-
export {
|
|
1
|
+
import { I as MlDsa65Backend } from '../submission-D9k_xppI.js';
|
|
2
|
+
export { j2 as ADDRESS_DERIVATION_DOMAIN, j3 as CLUSTER_MLKEM_SHAMIR, j4 as CLUSTER_MLKEM_SHAMIR_ALGO, j5 as ClusterSealKeyEntryInput, K as ClusterSealKeys, L as ClusterSealKeysSource, j6 as DKG_AEAD_TAG_LEN, j7 as DKG_NONCE_LEN, j8 as DecryptHint, j9 as ENCRYPTED_SUBMISSION_UNAVAILABLE_MESSAGE, ja as ENUM_VARIANT_INDEX_ML_DSA_65, jb as EncryptedEnvelope, jc as EncryptedSubmission, E as EncryptionKey, jd as JsonRpcCallClient, je as LythiumSealEnvelope, jf as ML_DSA_65_PUBLIC_KEY_LEN, jg as ML_DSA_65_SEED_LEN, jh as ML_DSA_65_SIGNATURE_LEN, ji as ML_DSA_65_SIGNING_KEY_LEN, jj as ML_KEM_768_CIPHERTEXT_LEN, jk as ML_KEM_768_ENCAPSULATION_KEY_LEN, jl as ML_KEM_768_SHARED_SECRET_LEN, F as MempoolClass, D as NativeEvmTxFields, jm as NativeTxExtension, jn as NativeTxExtensionDescriptor, jo as NativeTxExtensionLike, jp as NonceAad, jq as PlaintextSubmission, jr as SEAL_COMMIT_LEN, js as SEAL_DK_LEN, jt as SEAL_EK_LEN, ju as SEAL_KEM_CT_LEN, jv as SEAL_KEM_SEED_LEN, jw as SEAL_KEY_LEN, jx as SEAL_NONCE_LEN, jy as SEAL_SHARE_LEN, jz as SEAL_TAG_LEN, jA as STANDARD_ALGO_NUMBER_ML_DSA_65, jB as SealRandomSource, jC as SealRecipient, jD as SealedSubmission, jE as bincodeDecryptHint, jF as bincodeEncryptedEnvelope, jG as bincodeNonceAad, jH as bincodeSignedTransaction, jI as buildEncryptedEnvelope, jJ as buildEncryptedSubmission, jK as buildPlaintextSubmission, jL as cryptoRandomSource, jM as encodeMlDsa65Opaque, jN as encodeSealEnvelope, jO as encodeTransactionForHash, jP as encryptInnerTx, jQ as fetchEncryptionKey, jR as getClusterSealKeys, jS as mlDsa65AddressBytes, jT as mlDsa65AddressFromPublicKey, jU as outerSigDigest, jV as parseClusterSealKeys, jW as sealRosterHash, jX as sealToCluster, jY as sealTransaction, jZ as submitEncryptedEnvelope, j_ as submitPlaintextTransaction, j$ as submitSealedTransaction, k0 as submitTransactionWithPrivacy } from '../submission-D9k_xppI.js';
|
|
3
3
|
|
|
4
4
|
declare class BincodeWriter {
|
|
5
5
|
#private;
|
package/dist/index.cjs
CHANGED
|
@@ -8483,7 +8483,7 @@ async function submitRequestClusterJoin(args) {
|
|
|
8483
8483
|
operatorPubkey,
|
|
8484
8484
|
bondLythoshi: args.bondLythoshi
|
|
8485
8485
|
});
|
|
8486
|
-
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex);
|
|
8486
|
+
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex, args);
|
|
8487
8487
|
}
|
|
8488
8488
|
async function submitVoteClusterAdmit(args) {
|
|
8489
8489
|
const clusterId = parseUint32(args.clusterId, "clusterId");
|
|
@@ -8510,9 +8510,29 @@ async function submitVoteClusterAdmit(args) {
|
|
|
8510
8510
|
operatorId: operatorIdHex,
|
|
8511
8511
|
voterPubkey: args.voterPubkey
|
|
8512
8512
|
});
|
|
8513
|
-
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex);
|
|
8514
|
-
}
|
|
8515
|
-
async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex) {
|
|
8513
|
+
return submitClusterJoinTx(args.client, backend, tx, clusterId, operatorIdHex, args);
|
|
8514
|
+
}
|
|
8515
|
+
async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex, options) {
|
|
8516
|
+
if (options.private !== false) {
|
|
8517
|
+
const encrypted = await buildEncryptedSubmission({
|
|
8518
|
+
client,
|
|
8519
|
+
backend,
|
|
8520
|
+
tx,
|
|
8521
|
+
clusterId: Number(clusterId),
|
|
8522
|
+
clusterSealKeys: options.clusterSealKeys,
|
|
8523
|
+
clusterSealKeysSource: options.clusterSealKeysSource,
|
|
8524
|
+
class: MempoolClass.ContractCall
|
|
8525
|
+
});
|
|
8526
|
+
assertRpcHash(await submitEncryptedEnvelope(client, encrypted.envelopeWireHex));
|
|
8527
|
+
return {
|
|
8528
|
+
txHash: encrypted.innerTxHashHex,
|
|
8529
|
+
clusterId: clusterId.toString(10),
|
|
8530
|
+
operatorIdHex,
|
|
8531
|
+
innerSighashHex: encrypted.innerSighashHex,
|
|
8532
|
+
signedTxWireBytes: encrypted.innerWireBytes,
|
|
8533
|
+
envelopeWireBytes: hexByteLength(encrypted.envelopeWireHex)
|
|
8534
|
+
};
|
|
8535
|
+
}
|
|
8516
8536
|
const plaintext = buildPlaintextSubmission({ backend, tx });
|
|
8517
8537
|
const txHash = await submitPlaintextTransaction(
|
|
8518
8538
|
client,
|
|
@@ -8527,6 +8547,16 @@ async function submitClusterJoinTx(client, backend, tx, clusterId, operatorIdHex
|
|
|
8527
8547
|
signedTxWireBytes: plaintext.innerWireBytes
|
|
8528
8548
|
};
|
|
8529
8549
|
}
|
|
8550
|
+
function hexByteLength(value) {
|
|
8551
|
+
const clean = value.startsWith("0x") || value.startsWith("0X") ? value.slice(2) : value;
|
|
8552
|
+
return clean.length / 2;
|
|
8553
|
+
}
|
|
8554
|
+
function assertRpcHash(value) {
|
|
8555
|
+
const bytes = hexToBytes2(value, "lyth_submitEncrypted tx hash");
|
|
8556
|
+
if (bytes.length !== 32) {
|
|
8557
|
+
throw new Error(`lyth_submitEncrypted tx hash must be 32 bytes, got ${bytes.length}`);
|
|
8558
|
+
}
|
|
8559
|
+
}
|
|
8530
8560
|
function adaptNativeClusterJoinRequest(request) {
|
|
8531
8561
|
return {
|
|
8532
8562
|
owner: request.owner ?? ZERO_ADDRESS,
|