Skip to content

Commit

Permalink
fix script issue when no keypair bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
ngundotra committed Jan 29, 2025
1 parent b237360 commit 22cb229
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/check-langchain-tool-duplicates.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Keypair } from "@solana/web3.js";
import { SolanaAgentKit } from "../src";
import { createSolanaTools } from "../src/langchain/index";
import { Tool } from "langchain/tools";
import bs58 from "bs58";

function findDuplicateNames(tools: Tool[]): Map<string, string[]> {
const nameMap = new Map<string, string[]>();
Expand Down Expand Up @@ -42,7 +44,8 @@ function findDuplicateClasses(tools: Tool[]): Map<string, string[]> {

async function main() {
const kit = new SolanaAgentKit(
process.env.SOLANA_PRIVATE_KEY || "",
process.env.SOLANA_PRIVATE_KEY ||
bs58.encode(Buffer.from(Keypair.generate().secretKey)),
process.env.RPC_URL || "",
{ OPENAI_API_KEY: process.env.OPENAI_API_KEY || "" },
);
Expand Down

0 comments on commit 22cb229

Please sign in to comment.