@ecadlabs/tezosx-mcp 1.0.5 → 1.0.6
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/api.js
CHANGED
|
@@ -67,17 +67,18 @@ export function createApiRouter(liveConfig) {
|
|
|
67
67
|
const publicKey = await signer.publicKey();
|
|
68
68
|
const address = await signer.publicKeyHash();
|
|
69
69
|
log(`Returning existing pending keypair: ${address}`);
|
|
70
|
-
res.json({ address, publicKey });
|
|
70
|
+
res.json({ address, publicKey, secretKey: existingPending });
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
const keypair = await generateKeypair();
|
|
74
74
|
// Save to pending slot (active key stays untouched)
|
|
75
75
|
savePendingKey(keypair.secretKey);
|
|
76
76
|
log(`Generated and saved new pending keypair: ${keypair.address}`);
|
|
77
|
-
// Return
|
|
77
|
+
// Return keypair info — private key is also persisted server-side
|
|
78
78
|
res.json({
|
|
79
79
|
address: keypair.address,
|
|
80
80
|
publicKey: keypair.publicKey,
|
|
81
|
+
secretKey: keypair.secretKey,
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -39,12 +39,12 @@ const init = async () => {
|
|
|
39
39
|
log(`Network: ${networkName}`);
|
|
40
40
|
// Create shared mutable config
|
|
41
41
|
const liveConfig = createLiveConfig(networkName);
|
|
42
|
-
// Try to load config:
|
|
42
|
+
// Try to load config: env vars first, then persistent store
|
|
43
43
|
const stored = loadConfig();
|
|
44
|
-
const privateKey =
|
|
45
|
-
const spendingContract =
|
|
44
|
+
const privateKey = process.env.SPENDING_PRIVATE_KEY?.trim() || stored.spendingPrivateKey?.trim();
|
|
45
|
+
const spendingContract = process.env.SPENDING_CONTRACT?.trim() || stored.spendingContract?.trim();
|
|
46
46
|
const storedNetwork = stored.network && stored.network in NETWORKS ? stored.network : undefined;
|
|
47
|
-
const configNetwork =
|
|
47
|
+
const configNetwork = networkName || storedNetwork;
|
|
48
48
|
if (privateKey && spendingContract) {
|
|
49
49
|
if (!isValidPrivateKey(privateKey)) {
|
|
50
50
|
log('Warning: Invalid private key format. Must start with edsk, spsk, or p2sk. Wallet not configured.');
|