@adelos/sdk 0.1.6 → 0.1.7
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/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -0
- package/dist/index.mjs +5 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -77,6 +77,8 @@ declare function generateEphemeralKeypair(): {
|
|
|
77
77
|
secretKey: ed.Bytes;
|
|
78
78
|
publicKey: ed.Bytes;
|
|
79
79
|
};
|
|
80
|
+
/** Derive Public Key from Secret Key */
|
|
81
|
+
declare function derivePublicKey(secretKey: Uint8Array): Uint8Array;
|
|
80
82
|
/** Compute Shared Secret (Sender) */
|
|
81
83
|
declare function computeSharedSecret(ephemeralSk: Uint8Array, recipientMetaPk: Uint8Array): Uint8Array;
|
|
82
84
|
/** Compute Shared Secret (Recipient) */
|
|
@@ -141,4 +143,4 @@ declare class AdelosSDK {
|
|
|
141
143
|
sendAndConfirm(signedTx: Transaction | VersionedTransaction): Promise<string>;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
export { ADELOS_CONFIG, AdelosIndexer, type AdelosOptions, AdelosSDK, MEMO_PREFIX, MEMO_PROGRAM_ID, PROGRAM_ID, REGISTRY_SEED, RPC_URL, type RegistryAccount, type RegistryInfo, STEALTH_DOMAIN, type SolanaCluster, type StealthTransaction, bytesToHex, computeSharedSecret, computeSharedSecretAsRecipient, createIndexer, deriveRegistryPda, deriveStealthPubkey, generateEphemeralKeypair, generateStealthAddress, generateStealthMemo, getDiscriminator, hexToBytes, isValidMetaPubkey, parseStealthMemo, recoverStealthSecretKey };
|
|
146
|
+
export { ADELOS_CONFIG, AdelosIndexer, type AdelosOptions, AdelosSDK, MEMO_PREFIX, MEMO_PROGRAM_ID, PROGRAM_ID, REGISTRY_SEED, RPC_URL, type RegistryAccount, type RegistryInfo, STEALTH_DOMAIN, type SolanaCluster, type StealthTransaction, bytesToHex, computeSharedSecret, computeSharedSecretAsRecipient, createIndexer, derivePublicKey, deriveRegistryPda, deriveStealthPubkey, generateEphemeralKeypair, generateStealthAddress, generateStealthMemo, getDiscriminator, hexToBytes, isValidMetaPubkey, parseStealthMemo, recoverStealthSecretKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ declare function generateEphemeralKeypair(): {
|
|
|
77
77
|
secretKey: ed.Bytes;
|
|
78
78
|
publicKey: ed.Bytes;
|
|
79
79
|
};
|
|
80
|
+
/** Derive Public Key from Secret Key */
|
|
81
|
+
declare function derivePublicKey(secretKey: Uint8Array): Uint8Array;
|
|
80
82
|
/** Compute Shared Secret (Sender) */
|
|
81
83
|
declare function computeSharedSecret(ephemeralSk: Uint8Array, recipientMetaPk: Uint8Array): Uint8Array;
|
|
82
84
|
/** Compute Shared Secret (Recipient) */
|
|
@@ -141,4 +143,4 @@ declare class AdelosSDK {
|
|
|
141
143
|
sendAndConfirm(signedTx: Transaction | VersionedTransaction): Promise<string>;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
export { ADELOS_CONFIG, AdelosIndexer, type AdelosOptions, AdelosSDK, MEMO_PREFIX, MEMO_PROGRAM_ID, PROGRAM_ID, REGISTRY_SEED, RPC_URL, type RegistryAccount, type RegistryInfo, STEALTH_DOMAIN, type SolanaCluster, type StealthTransaction, bytesToHex, computeSharedSecret, computeSharedSecretAsRecipient, createIndexer, deriveRegistryPda, deriveStealthPubkey, generateEphemeralKeypair, generateStealthAddress, generateStealthMemo, getDiscriminator, hexToBytes, isValidMetaPubkey, parseStealthMemo, recoverStealthSecretKey };
|
|
146
|
+
export { ADELOS_CONFIG, AdelosIndexer, type AdelosOptions, AdelosSDK, MEMO_PREFIX, MEMO_PROGRAM_ID, PROGRAM_ID, REGISTRY_SEED, RPC_URL, type RegistryAccount, type RegistryInfo, STEALTH_DOMAIN, type SolanaCluster, type StealthTransaction, bytesToHex, computeSharedSecret, computeSharedSecretAsRecipient, createIndexer, derivePublicKey, deriveRegistryPda, deriveStealthPubkey, generateEphemeralKeypair, generateStealthAddress, generateStealthMemo, getDiscriminator, hexToBytes, isValidMetaPubkey, parseStealthMemo, recoverStealthSecretKey };
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ __export(index_exports, {
|
|
|
43
43
|
computeSharedSecret: () => computeSharedSecret,
|
|
44
44
|
computeSharedSecretAsRecipient: () => computeSharedSecretAsRecipient,
|
|
45
45
|
createIndexer: () => createIndexer,
|
|
46
|
+
derivePublicKey: () => derivePublicKey,
|
|
46
47
|
deriveRegistryPda: () => deriveRegistryPda,
|
|
47
48
|
deriveStealthPubkey: () => deriveStealthPubkey,
|
|
48
49
|
generateEphemeralKeypair: () => generateEphemeralKeypair,
|
|
@@ -134,6 +135,10 @@ function generateEphemeralKeypair() {
|
|
|
134
135
|
const publicKey = ed.ExtendedPoint.BASE.multiply(scalar).toRawBytes();
|
|
135
136
|
return { secretKey, publicKey };
|
|
136
137
|
}
|
|
138
|
+
function derivePublicKey(secretKey) {
|
|
139
|
+
const scalar = toScalar(secretKey);
|
|
140
|
+
return ed.ExtendedPoint.BASE.multiply(scalar).toRawBytes();
|
|
141
|
+
}
|
|
137
142
|
function computeSharedSecret(ephemeralSk, recipientMetaPk) {
|
|
138
143
|
const point = ed.ExtendedPoint.fromHex(bytesToHex(recipientMetaPk));
|
|
139
144
|
const scalar = toScalar(ephemeralSk);
|
|
@@ -349,6 +354,7 @@ var AdelosSDK = class {
|
|
|
349
354
|
computeSharedSecret,
|
|
350
355
|
computeSharedSecretAsRecipient,
|
|
351
356
|
createIndexer,
|
|
357
|
+
derivePublicKey,
|
|
352
358
|
deriveRegistryPda,
|
|
353
359
|
deriveStealthPubkey,
|
|
354
360
|
generateEphemeralKeypair,
|
package/dist/index.mjs
CHANGED
|
@@ -86,6 +86,10 @@ function generateEphemeralKeypair() {
|
|
|
86
86
|
const publicKey = ed.ExtendedPoint.BASE.multiply(scalar).toRawBytes();
|
|
87
87
|
return { secretKey, publicKey };
|
|
88
88
|
}
|
|
89
|
+
function derivePublicKey(secretKey) {
|
|
90
|
+
const scalar = toScalar(secretKey);
|
|
91
|
+
return ed.ExtendedPoint.BASE.multiply(scalar).toRawBytes();
|
|
92
|
+
}
|
|
89
93
|
function computeSharedSecret(ephemeralSk, recipientMetaPk) {
|
|
90
94
|
const point = ed.ExtendedPoint.fromHex(bytesToHex(recipientMetaPk));
|
|
91
95
|
const scalar = toScalar(ephemeralSk);
|
|
@@ -300,6 +304,7 @@ export {
|
|
|
300
304
|
computeSharedSecret,
|
|
301
305
|
computeSharedSecretAsRecipient,
|
|
302
306
|
createIndexer,
|
|
307
|
+
derivePublicKey,
|
|
303
308
|
deriveRegistryPda,
|
|
304
309
|
deriveStealthPubkey,
|
|
305
310
|
generateEphemeralKeypair,
|