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 6, 2024
1 parent 34fe84e commit ab52d2c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,5 @@ APTOS_PRIVATE_KEY= # Aptos private key
APTOS_NETWORK= # must be one of mainnet, testnet

# MultiversX
MVX_WALLET_SECRET_KEY= # Multiversx private key
MVX_SECRET_KEY= # Multiversx private key
MVX_NETWORK= # must be one of mainnet, devnet, testnet
2 changes: 2 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { createNodePlugin } from "@ai16z/plugin-node";
import { solanaPlugin } from "@ai16z/plugin-solana";
import { aptosPlugin, TransferAptosToken } from "@ai16z/plugin-aptos";
import { teePlugin } from "@ai16z/plugin-tee";
import { multiversxPlugin } from '@ai16z/plugin-multiversx';
import Database from "better-sqlite3";
import fs from "fs";
import path from "path";
Expand Down Expand Up @@ -402,6 +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
].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_WALLET_SECRET_KEY");
const privateKey = runtime.getSetting("MVX_SECRET_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_WALLET_SECRET_KEY");
const privateKey = runtime.getSetting("MVX_SECRET_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_WALLET_SECRET_KEY: z
MVX_SECRET_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_WALLET_SECRET_KEY:
runtime.getSetting("MVX_WALLET_SECRET_KEY") ||
process.env.MVX_WALLET_SECRET_KEY,
MVX_SECRET_KEY:
runtime.getSetting("MVX_SECRET_KEY") ||
process.env.MVX_SECRET_KEY,
MVX_NETWORK:
runtime.getSetting("MVX_NETWORK") || process.env.MVX_NETWORK,
};
Expand Down

0 comments on commit ab52d2c

Please sign in to comment.