Skip to content

Commit

Permalink
fix viem/ethers issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsayo committed Jan 25, 2025
1 parent 3d05b89 commit d3d6098
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 12 deletions.
3 changes: 2 additions & 1 deletion packages/plugin-mind-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
],
"dependencies": {
"@elizaos/core": "workspace:*",
"mind-randgen-sdk": "^1.0.0"
"mind-randgen-sdk": "^1.0.0",
"viem": "2.22.2"
},
"scripts": {
"build": "tsup --format esm --dts"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Action } from "@elizaos/core";
import { type ActionExample, type HandlerCallback, type IAgentRuntime, type Memory, type State, elizaLogger } from "@elizaos/core";
import { checkColdWalletReward } from "mind-randgen-sdk";
import { isAddress, formatEther } from "ethers";
import { isAddress, formatEther } from "viem";

export const checkRewardAction: Action = {
name: "MIND_CHECK_VOTING_REWARD",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-mind-network/src/actions/registerAction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Action } from "@elizaos/core";
import { type ActionExample, type HandlerCallback, type IAgentRuntime, type Memory, type State, elizaLogger } from "@elizaos/core";
import { registerVoter } from "mind-randgen-sdk";
import { isAddress } from "ethers";
import { isAddress } from "viem";

export const registerAction: Action = {
name: "MIND_REGISTER_VOTER",
Expand Down
13 changes: 10 additions & 3 deletions packages/plugin-mind-network/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ export default defineConfig({
outDir: "dist",
sourcemap: true,
clean: true,
format: ["esm"], // Ensure you're targeting CommonJS
format: ["esm"],
external: [
"dotenv", // Externalize dotenv to prevent bundling
"fs", // Externalize fs to use Node.js built-in module
"dotenv",
"fs",
"path",
"@reflink/reflink",
"@node-llama-cpp",
"https",
"http",
"agentkeepalive",
"viem",
],
});
68 changes: 62 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3d6098

Please sign in to comment.