@monolythium/core-sdk 0.4.23 → 0.5.0
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 +17 -9
- package/dist/crypto/index.cjs +51 -617
- package/dist/crypto/index.cjs.map +1 -1
- package/dist/crypto/index.d.cts +116 -31
- package/dist/crypto/index.d.ts +116 -31
- package/dist/crypto/index.js +44 -564
- package/dist/crypto/index.js.map +1 -1
- package/dist/index.cjs +912 -951
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7411 -391
- package/dist/index.d.ts +7411 -391
- package/dist/index.js +876 -946
- package/dist/index.js.map +1 -1
- package/dist/ml-dsa-Drcmrw5h.d.cts +90 -0
- package/dist/ml-dsa-Drcmrw5h.d.ts +90 -0
- package/package.json +1 -1
- package/dist/submission-B4FmDnm_.d.cts +0 -7079
- package/dist/submission-B4FmDnm_.d.ts +0 -7079
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mempool transaction-class tags.
|
|
3
|
+
*
|
|
4
|
+
* The encrypted-mempool (LythiumSeal) envelope was removed at the v2
|
|
5
|
+
* re-genesis; plaintext submission is the sole submit path. This module now
|
|
6
|
+
* carries only the {@link MempoolClass} tag the node uses to classify a
|
|
7
|
+
* transaction for ordering/admission.
|
|
8
|
+
*/
|
|
9
|
+
declare const MempoolClass: {
|
|
10
|
+
readonly Transfer: 0;
|
|
11
|
+
readonly ContractCall: 1;
|
|
12
|
+
readonly PrivacyOp: 2;
|
|
13
|
+
readonly CLOBOp: 3;
|
|
14
|
+
readonly AgentOp: 4;
|
|
15
|
+
readonly FoundationOp: 5;
|
|
16
|
+
/** @deprecated Use FoundationOp. */
|
|
17
|
+
readonly GovernanceOp: 5;
|
|
18
|
+
readonly RWAOp: 6;
|
|
19
|
+
};
|
|
20
|
+
type MempoolClass = (typeof MempoolClass)[keyof typeof MempoolClass];
|
|
21
|
+
|
|
22
|
+
interface NativeEvmTxFields {
|
|
23
|
+
chainId: bigint | number | string;
|
|
24
|
+
nonce: bigint | number | string;
|
|
25
|
+
maxPriorityFeePerGas: bigint | number | string;
|
|
26
|
+
maxFeePerGas: bigint | number | string;
|
|
27
|
+
gasLimit: bigint | number | string;
|
|
28
|
+
to: Uint8Array | readonly number[] | string | null;
|
|
29
|
+
value: bigint | number | string;
|
|
30
|
+
input?: Uint8Array | readonly number[] | string;
|
|
31
|
+
extensions?: readonly NativeTxExtensionLike[];
|
|
32
|
+
}
|
|
33
|
+
interface NativeTxExtension {
|
|
34
|
+
kind: number;
|
|
35
|
+
body: Uint8Array | readonly number[] | string;
|
|
36
|
+
}
|
|
37
|
+
interface NativeTxExtensionDescriptor {
|
|
38
|
+
kind: number;
|
|
39
|
+
bodyHex: string;
|
|
40
|
+
}
|
|
41
|
+
type NativeTxExtensionLike = NativeTxExtension | NativeTxExtensionDescriptor;
|
|
42
|
+
declare function encodeTransactionForHash(fields: NativeEvmTxFields, tag: 0x01 | 0x02): Uint8Array;
|
|
43
|
+
declare function bincodeSignedTransaction(fields: NativeEvmTxFields, signature: Uint8Array | readonly number[], publicKey: Uint8Array | readonly number[]): Uint8Array;
|
|
44
|
+
|
|
45
|
+
declare const ML_DSA_65_SEED_LEN = 32;
|
|
46
|
+
declare const ML_DSA_65_SIGNING_KEY_LEN = 4032;
|
|
47
|
+
declare const ML_DSA_65_PUBLIC_KEY_LEN = 1952;
|
|
48
|
+
declare const ML_DSA_65_SIGNATURE_LEN = 3309;
|
|
49
|
+
declare const STANDARD_ALGO_NUMBER_ML_DSA_65 = 1001;
|
|
50
|
+
declare const ENUM_VARIANT_INDEX_ML_DSA_65 = 3;
|
|
51
|
+
declare const ADDRESS_DERIVATION_DOMAIN = "MONO_ADDRESS_BLAKE3_20_V1";
|
|
52
|
+
declare class MlDsa65Backend {
|
|
53
|
+
#private;
|
|
54
|
+
private constructor();
|
|
55
|
+
static fromSeed(seed: Uint8Array | readonly number[]): MlDsa65Backend;
|
|
56
|
+
publicKey(): Uint8Array;
|
|
57
|
+
addressBytes(): Uint8Array;
|
|
58
|
+
getAddress(): string;
|
|
59
|
+
sign(message: Uint8Array): Uint8Array;
|
|
60
|
+
/**
|
|
61
|
+
* Best-effort deterministic wipe of the in-memory secret key. Zeroes the
|
|
62
|
+
* SDK-held `#secretKey` copy and makes any subsequent `sign()` /
|
|
63
|
+
* `signPrehash()` / `signEvmTx()` throw `"MlDsa65Backend disposed"` rather
|
|
64
|
+
* than signing with a zeroed key. Idempotent. Public material
|
|
65
|
+
* (`publicKey()` / `getAddress()` / `verify()`) stays usable.
|
|
66
|
+
*
|
|
67
|
+
* Defense-in-depth (S1-01): narrows the post-lock residency window of the
|
|
68
|
+
* ML-DSA-65 secret in the JS heap. `@noble/post-quantum`'s internal
|
|
69
|
+
* transient keygen/sign buffers are out of scope; the SDK-held copy is the
|
|
70
|
+
* meaningful residency win.
|
|
71
|
+
*/
|
|
72
|
+
dispose(): void;
|
|
73
|
+
/** Alias for {@link dispose}. */
|
|
74
|
+
zeroize(): void;
|
|
75
|
+
/** Whether {@link dispose} has been called (the secret key is wiped). */
|
|
76
|
+
get disposed(): boolean;
|
|
77
|
+
signPrehash(digest: Uint8Array): Uint8Array;
|
|
78
|
+
verify(message: Uint8Array, signature: Uint8Array): boolean;
|
|
79
|
+
signEvmTx(fields: NativeEvmTxFields): {
|
|
80
|
+
wireHex: string;
|
|
81
|
+
wireBytes: Uint8Array;
|
|
82
|
+
sighash: Uint8Array;
|
|
83
|
+
txHash: Uint8Array;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
declare function mlDsa65AddressFromPublicKey(publicKey: Uint8Array | readonly number[]): string;
|
|
87
|
+
declare function mlDsa65AddressBytes(publicKey: Uint8Array | readonly number[]): Uint8Array;
|
|
88
|
+
declare function encodeMlDsa65Opaque(raw: Uint8Array | readonly number[]): Uint8Array;
|
|
89
|
+
|
|
90
|
+
export { ADDRESS_DERIVATION_DOMAIN as A, ENUM_VARIANT_INDEX_ML_DSA_65 as E, MempoolClass as M, type NativeEvmTxFields as N, STANDARD_ALGO_NUMBER_ML_DSA_65 as S, MlDsa65Backend as a, ML_DSA_65_PUBLIC_KEY_LEN as b, ML_DSA_65_SEED_LEN as c, ML_DSA_65_SIGNATURE_LEN as d, ML_DSA_65_SIGNING_KEY_LEN as e, type NativeTxExtension as f, type NativeTxExtensionDescriptor as g, type NativeTxExtensionLike as h, bincodeSignedTransaction as i, encodeMlDsa65Opaque as j, encodeTransactionForHash as k, mlDsa65AddressFromPublicKey as l, mlDsa65AddressBytes as m };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mempool transaction-class tags.
|
|
3
|
+
*
|
|
4
|
+
* The encrypted-mempool (LythiumSeal) envelope was removed at the v2
|
|
5
|
+
* re-genesis; plaintext submission is the sole submit path. This module now
|
|
6
|
+
* carries only the {@link MempoolClass} tag the node uses to classify a
|
|
7
|
+
* transaction for ordering/admission.
|
|
8
|
+
*/
|
|
9
|
+
declare const MempoolClass: {
|
|
10
|
+
readonly Transfer: 0;
|
|
11
|
+
readonly ContractCall: 1;
|
|
12
|
+
readonly PrivacyOp: 2;
|
|
13
|
+
readonly CLOBOp: 3;
|
|
14
|
+
readonly AgentOp: 4;
|
|
15
|
+
readonly FoundationOp: 5;
|
|
16
|
+
/** @deprecated Use FoundationOp. */
|
|
17
|
+
readonly GovernanceOp: 5;
|
|
18
|
+
readonly RWAOp: 6;
|
|
19
|
+
};
|
|
20
|
+
type MempoolClass = (typeof MempoolClass)[keyof typeof MempoolClass];
|
|
21
|
+
|
|
22
|
+
interface NativeEvmTxFields {
|
|
23
|
+
chainId: bigint | number | string;
|
|
24
|
+
nonce: bigint | number | string;
|
|
25
|
+
maxPriorityFeePerGas: bigint | number | string;
|
|
26
|
+
maxFeePerGas: bigint | number | string;
|
|
27
|
+
gasLimit: bigint | number | string;
|
|
28
|
+
to: Uint8Array | readonly number[] | string | null;
|
|
29
|
+
value: bigint | number | string;
|
|
30
|
+
input?: Uint8Array | readonly number[] | string;
|
|
31
|
+
extensions?: readonly NativeTxExtensionLike[];
|
|
32
|
+
}
|
|
33
|
+
interface NativeTxExtension {
|
|
34
|
+
kind: number;
|
|
35
|
+
body: Uint8Array | readonly number[] | string;
|
|
36
|
+
}
|
|
37
|
+
interface NativeTxExtensionDescriptor {
|
|
38
|
+
kind: number;
|
|
39
|
+
bodyHex: string;
|
|
40
|
+
}
|
|
41
|
+
type NativeTxExtensionLike = NativeTxExtension | NativeTxExtensionDescriptor;
|
|
42
|
+
declare function encodeTransactionForHash(fields: NativeEvmTxFields, tag: 0x01 | 0x02): Uint8Array;
|
|
43
|
+
declare function bincodeSignedTransaction(fields: NativeEvmTxFields, signature: Uint8Array | readonly number[], publicKey: Uint8Array | readonly number[]): Uint8Array;
|
|
44
|
+
|
|
45
|
+
declare const ML_DSA_65_SEED_LEN = 32;
|
|
46
|
+
declare const ML_DSA_65_SIGNING_KEY_LEN = 4032;
|
|
47
|
+
declare const ML_DSA_65_PUBLIC_KEY_LEN = 1952;
|
|
48
|
+
declare const ML_DSA_65_SIGNATURE_LEN = 3309;
|
|
49
|
+
declare const STANDARD_ALGO_NUMBER_ML_DSA_65 = 1001;
|
|
50
|
+
declare const ENUM_VARIANT_INDEX_ML_DSA_65 = 3;
|
|
51
|
+
declare const ADDRESS_DERIVATION_DOMAIN = "MONO_ADDRESS_BLAKE3_20_V1";
|
|
52
|
+
declare class MlDsa65Backend {
|
|
53
|
+
#private;
|
|
54
|
+
private constructor();
|
|
55
|
+
static fromSeed(seed: Uint8Array | readonly number[]): MlDsa65Backend;
|
|
56
|
+
publicKey(): Uint8Array;
|
|
57
|
+
addressBytes(): Uint8Array;
|
|
58
|
+
getAddress(): string;
|
|
59
|
+
sign(message: Uint8Array): Uint8Array;
|
|
60
|
+
/**
|
|
61
|
+
* Best-effort deterministic wipe of the in-memory secret key. Zeroes the
|
|
62
|
+
* SDK-held `#secretKey` copy and makes any subsequent `sign()` /
|
|
63
|
+
* `signPrehash()` / `signEvmTx()` throw `"MlDsa65Backend disposed"` rather
|
|
64
|
+
* than signing with a zeroed key. Idempotent. Public material
|
|
65
|
+
* (`publicKey()` / `getAddress()` / `verify()`) stays usable.
|
|
66
|
+
*
|
|
67
|
+
* Defense-in-depth (S1-01): narrows the post-lock residency window of the
|
|
68
|
+
* ML-DSA-65 secret in the JS heap. `@noble/post-quantum`'s internal
|
|
69
|
+
* transient keygen/sign buffers are out of scope; the SDK-held copy is the
|
|
70
|
+
* meaningful residency win.
|
|
71
|
+
*/
|
|
72
|
+
dispose(): void;
|
|
73
|
+
/** Alias for {@link dispose}. */
|
|
74
|
+
zeroize(): void;
|
|
75
|
+
/** Whether {@link dispose} has been called (the secret key is wiped). */
|
|
76
|
+
get disposed(): boolean;
|
|
77
|
+
signPrehash(digest: Uint8Array): Uint8Array;
|
|
78
|
+
verify(message: Uint8Array, signature: Uint8Array): boolean;
|
|
79
|
+
signEvmTx(fields: NativeEvmTxFields): {
|
|
80
|
+
wireHex: string;
|
|
81
|
+
wireBytes: Uint8Array;
|
|
82
|
+
sighash: Uint8Array;
|
|
83
|
+
txHash: Uint8Array;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
declare function mlDsa65AddressFromPublicKey(publicKey: Uint8Array | readonly number[]): string;
|
|
87
|
+
declare function mlDsa65AddressBytes(publicKey: Uint8Array | readonly number[]): Uint8Array;
|
|
88
|
+
declare function encodeMlDsa65Opaque(raw: Uint8Array | readonly number[]): Uint8Array;
|
|
89
|
+
|
|
90
|
+
export { ADDRESS_DERIVATION_DOMAIN as A, ENUM_VARIANT_INDEX_ML_DSA_65 as E, MempoolClass as M, type NativeEvmTxFields as N, STANDARD_ALGO_NUMBER_ML_DSA_65 as S, MlDsa65Backend as a, ML_DSA_65_PUBLIC_KEY_LEN as b, ML_DSA_65_SEED_LEN as c, ML_DSA_65_SIGNATURE_LEN as d, ML_DSA_65_SIGNING_KEY_LEN as e, type NativeTxExtension as f, type NativeTxExtensionDescriptor as g, type NativeTxExtensionLike as h, bincodeSignedTransaction as i, encodeMlDsa65Opaque as j, encodeTransactionForHash as k, mlDsa65AddressFromPublicKey as l, mlDsa65AddressBytes as m };
|