Skip to content

Commit

Permalink
Rename env var
Browse files Browse the repository at this point in the history
  • Loading branch information
mgavrila committed Dec 12, 2024
1 parent c619e00 commit 47f3c6a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -253,5 +253,5 @@ AWS_S3_BUCKET=
AWS_S3_UPLOAD_PATH=

# MultiversX
MVX_SECRET_KEY= # Multiversx private key
MVX_PRIVATE_KEY= # Multiversx private key
MVX_NETWORK= # must be one of mainnet, devnet, testnet
2 changes: 1 addition & 1 deletion agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ export async function createAgent(
? flowPlugin
: 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: [],
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-multiversx/src/actions/createToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-multiversx/src/actions/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-multiversx/src/enviroment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
Expand All @@ -15,9 +15,9 @@ export async function validateMultiversxConfig(
): Promise<MultiversxConfig> {
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,
};
Expand Down

0 comments on commit 47f3c6a

Please sign in to comment.