@elisym/mcp 0.8.0 → 0.8.2

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.js CHANGED
@@ -2,8 +2,7 @@
2
2
  import { LIMITS, DEFAULT_KIND_OFFSET, SolanaPaymentStrategy, makeCensor, DEFAULT_REDACT_PATHS, validateAgentName, RELAYS, toDTag, formatAssetAmount, USDC_SOLANA_DEVNET, estimateSolFeeLamports, formatFeeBreakdown, resolveAssetFromPaymentRequest as resolveAssetFromPaymentRequest$1, parseAssetAmount, ElisymIdentity, ElisymClient, NATIVE_SOL, getProtocolProgramId, getProtocolConfig, assetKey, assetByKey, resolveKnownAsset, KNOWN_ASSETS } from '@elisym/sdk';
3
3
  import { listAgents, createAgentDir, writeYaml, writeSecrets, loadAgent, globalConfigPath } from '@elisym/sdk/agent-store';
4
4
  import { loadGlobalConfig, writeGlobalConfig } from '@elisym/sdk/node';
5
- import { generateKeyPairSigner, address, createSolanaRpcSubscriptions, sendAndConfirmTransactionFactory, getSignatureFromTransaction, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, createKeyPairSignerFromBytes, createSolanaRpc, isAddress } from '@solana/kit';
6
- import bs58 from 'bs58';
5
+ import { getBase58Encoder, getBase58Decoder, generateKeyPairSigner, address, createSolanaRpcSubscriptions, sendAndConfirmTransactionFactory, getSignatureFromTransaction, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, createKeyPairSignerFromBytes, createSolanaRpc, isAddress } from '@solana/kit';
7
6
  import { Command } from 'commander';
8
7
  import { generateSecretKey, nip19, getPublicKey } from 'nostr-tools';
9
8
  import { readFile, writeFile, rename, unlink } from 'node:fs/promises';
@@ -675,6 +674,8 @@ function errorResult(text) {
675
674
  }
676
675
 
677
676
  // src/tools/agent.ts
677
+ var BASE58_ENCODER = getBase58Encoder();
678
+ var BASE58_DECODER = getBase58Decoder();
678
679
  async function exportKeyPairBytes(signer) {
679
680
  const { privateKey, publicKey } = signer.keyPair;
680
681
  const [pkcs8, rawPub] = await Promise.all([
@@ -724,7 +725,7 @@ async function buildAgentInstance(name, config) {
724
725
  let solanaKeypair;
725
726
  if (config.solanaSecretKey) {
726
727
  try {
727
- const decoded = bs58.decode(config.solanaSecretKey);
728
+ const decoded = new Uint8Array(BASE58_ENCODER.encode(config.solanaSecretKey));
728
729
  const signer = await createKeyPairSignerFromBytes(decoded);
729
730
  solanaKeypair = {
730
731
  publicKey: signer.address,
@@ -786,7 +787,7 @@ var agentTools = [
786
787
  const solanaSigner = await generateKeyPairSigner(true);
787
788
  const solanaSecretBytes = await exportKeyPairBytes(solanaSigner);
788
789
  const nostrSecretHex = Buffer.from(nostrSecretKey).toString("hex");
789
- const solanaSecretBase58 = bs58.encode(solanaSecretBytes);
790
+ const solanaSecretBase58 = BASE58_DECODER.decode(solanaSecretBytes);
790
791
  await saveAgentConfig(input.name, {
791
792
  name: input.name,
792
793
  description: input.description,
@@ -2786,6 +2787,7 @@ process.on("warning", (w) => {
2786
2787
  }
2787
2788
  console.warn(w);
2788
2789
  });
2790
+ var BASE58_DECODER2 = getBase58Decoder();
2789
2791
  function safe(fn) {
2790
2792
  return async (...args) => {
2791
2793
  try {
@@ -2922,7 +2924,7 @@ program.command("init [name]").description("Create a new agent identity").option
2922
2924
  description: options.description,
2923
2925
  relays: [...RELAYS],
2924
2926
  nostrSecretKey: Buffer.from(nostrSecretKey).toString("hex"),
2925
- solanaSecretKey: bs58.encode(solanaSecretBytes),
2927
+ solanaSecretKey: BASE58_DECODER2.decode(solanaSecretBytes),
2926
2928
  solanaAddress: solanaSigner.address,
2927
2929
  network: "devnet",
2928
2930
  security: { withdrawals_enabled: false, agent_switch_enabled: false },