@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 only public info — private key stays on server
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: persistent store first, then env vars
42
+ // Try to load config: env vars first, then persistent store
43
43
  const stored = loadConfig();
44
- const privateKey = stored.spendingPrivateKey?.trim() || process.env.SPENDING_PRIVATE_KEY?.trim();
45
- const spendingContract = stored.spendingContract?.trim() || process.env.SPENDING_CONTRACT?.trim();
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 = storedNetwork || networkName;
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.');