From 78ec35c57364682df1ea1b34228f15c6ecdd2eff Mon Sep 17 00:00:00 2001 From: Gavrila Andrei Date: Thu, 5 Dec 2024 19:44:24 +0200 Subject: [PATCH] Rename env var --- .env.example | 2 +- agent/src/index.ts | 2 +- packages/plugin-multiversx/src/actions/createToken.ts | 2 +- packages/plugin-multiversx/src/actions/transfer.ts | 2 +- packages/plugin-multiversx/src/enviroment.ts | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 41c6a77d08..ed509fa786 100644 --- a/.env.example +++ b/.env.example @@ -184,5 +184,5 @@ APTOS_PRIVATE_KEY= # Aptos private key APTOS_NETWORK= # must be one of mainnet, testnet # MultiversX -MVX_SECRET_KEY= # Multiversx private key +MVX_PRIVATE_KEY= # Multiversx private key MVX_NETWORK= # must be one of mainnet, devnet, testnet \ No newline at end of file diff --git a/agent/src/index.ts b/agent/src/index.ts index bb695b04ba..afbbefc9ad 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -403,7 +403,7 @@ export function createAgent( getSecret(character, "WALLET_SECRET_SALT") ? teePlugin : null, getSecret(character, "ALCHEMY_API_KEY") ? goatPlugin : null, getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null, - getSecret(character, 'MVX_SECRET_KEY') ? multiversxPlugin : null + getSecret(character, 'MVX_PRIVATE_KEY') ? multiversxPlugin : null ].filter(Boolean), providers: [], actions: [], diff --git a/packages/plugin-multiversx/src/actions/createToken.ts b/packages/plugin-multiversx/src/actions/createToken.ts index 2d74cc95b1..c84632bff5 100644 --- a/packages/plugin-multiversx/src/actions/createToken.ts +++ b/packages/plugin-multiversx/src/actions/createToken.ts @@ -102,7 +102,7 @@ export default { } try { - const privateKey = runtime.getSetting("MVX_SECRET_KEY"); + const privateKey = runtime.getSetting("MVX_PRIVATE_KEY"); const network = runtime.getSetting("MVX_NETWORK"); const walletProvider = new WalletProvider(privateKey, network); diff --git a/packages/plugin-multiversx/src/actions/transfer.ts b/packages/plugin-multiversx/src/actions/transfer.ts index 330953c2af..076cef248c 100644 --- a/packages/plugin-multiversx/src/actions/transfer.ts +++ b/packages/plugin-multiversx/src/actions/transfer.ts @@ -108,7 +108,7 @@ export default { } try { - const privateKey = runtime.getSetting("MVX_SECRET_KEY"); + const privateKey = runtime.getSetting("MVX_PRIVATE_KEY"); const network = runtime.getSetting("MVX_NETWORK"); const walletProvider = new WalletProvider(privateKey, network); diff --git a/packages/plugin-multiversx/src/enviroment.ts b/packages/plugin-multiversx/src/enviroment.ts index f2ffe582dc..b1d9b2d3e8 100644 --- a/packages/plugin-multiversx/src/enviroment.ts +++ b/packages/plugin-multiversx/src/enviroment.ts @@ -2,7 +2,7 @@ import { IAgentRuntime } from "@ai16z/eliza"; import { z } from "zod"; export const multiversxEnvSchema = z.object({ - MVX_SECRET_KEY: z + MVX_PRIVATE_KEY: z .string() .min(1, "MultiversX wallet private key is required"), MVX_NETWORK: z.enum(["mainnet", "devnet", "testnet"]), @@ -15,9 +15,9 @@ export async function validateMultiversxConfig( ): Promise { try { const config = { - MVX_SECRET_KEY: - runtime.getSetting("MVX_SECRET_KEY") || - process.env.MVX_SECRET_KEY, + MVX_PRIVATE_KEY: + runtime.getSetting("MVX_PRIVATE_KEY") || + process.env.MVX_PRIVATE_KEY, MVX_NETWORK: runtime.getSetting("MVX_NETWORK") || process.env.MVX_NETWORK, };