Skip to content

Commit 15d9375

Browse files
committed
fix: did few fixes renaming from ai16z to elizaos and resolved build issues
1 parent d70347c commit 15d9375

File tree

7 files changed

+135
-106
lines changed

7 files changed

+135
-106
lines changed

agent/package.json

+61-61
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
{
2-
"name": "@elizaos/agent",
3-
"version": "0.1.7-alpha.1",
4-
"main": "src/index.ts",
5-
"type": "module",
6-
"scripts": {
7-
"start": "node --loader ts-node/esm src/index.ts",
8-
"dev": "node --loader ts-node/esm src/index.ts",
9-
"check-types": "tsc --noEmit"
10-
},
11-
"nodemonConfig": {
12-
"watch": [
13-
"src",
14-
"../core/dist"
15-
],
16-
"ext": "ts,json",
17-
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts"
18-
},
19-
"dependencies": {
20-
"@elizaos/adapter-postgres": "workspace:*",
21-
"@elizaos/adapter-redis": "workspace:*",
22-
"@elizaos/adapter-sqlite": "workspace:*",
23-
"@elizaos/client-auto": "workspace:*",
24-
"@elizaos/client-direct": "workspace:*",
25-
"@elizaos/client-discord": "workspace:*",
26-
"@elizaos/client-farcaster": "workspace:*",
27-
"@elizaos/client-lens": "workspace:*",
28-
"@elizaos/client-telegram": "workspace:*",
29-
"@elizaos/client-twitter": "workspace:*",
30-
"@elizaos/client-slack": "workspace:*",
31-
"@elizaos/core": "workspace:*",
32-
"@elizaos/plugin-0g": "workspace:*",
33-
"@elizaos/plugin-aptos": "workspace:*",
34-
"@elizaos/plugin-bootstrap": "workspace:*",
35-
"@elizaos/plugin-intiface": "workspace:*",
36-
"@elizaos/plugin-coinbase": "workspace:*",
37-
"@elizaos/plugin-conflux": "workspace:*",
38-
"@elizaos/plugin-evm": "workspace:*",
39-
"@elizaos/plugin-flow": "workspace:*",
40-
"@elizaos/plugin-story": "workspace:*",
41-
"@elizaos/plugin-goat": "workspace:*",
42-
"@elizaos/plugin-icp": "workspace:*",
43-
"@elizaos/plugin-image-generation": "workspace:*",
44-
"@elizaos/plugin-nft-generation": "workspace:*",
45-
"@elizaos/plugin-node": "workspace:*",
46-
"@elizaos/plugin-solana": "workspace:*",
47-
"@elizaos/plugin-starknet": "workspace:*",
48-
"@elizaos/plugin-ton": "workspace:*",
49-
"@elizaos/plugin-sui": "workspace:*",
50-
"@elizaos/plugin-tee": "workspace:*",
51-
"@elizaos/plugin-multiversx": "workspace:*",
52-
"@elizaos/plugin-near": "workspace:*",
53-
"@elizaos/plugin-zksync-era": "workspace:*",
54-
"@ai16z/plugin-cronoszkevm": "workspace:*",
55-
"readline": "1.3.0",
56-
"ws": "8.18.0",
57-
"yargs": "17.7.2"
58-
},
59-
"devDependencies": {
60-
"ts-node": "10.9.2",
61-
"tsup": "8.3.5"
62-
}
2+
"name": "@elizaos/agent",
3+
"version": "0.1.7-alpha.1",
4+
"main": "src/index.ts",
5+
"type": "module",
6+
"scripts": {
7+
"start": "node --loader ts-node/esm src/index.ts",
8+
"dev": "node --loader ts-node/esm src/index.ts",
9+
"check-types": "tsc --noEmit"
10+
},
11+
"nodemonConfig": {
12+
"watch": [
13+
"src",
14+
"../core/dist"
15+
],
16+
"ext": "ts,json",
17+
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts"
18+
},
19+
"dependencies": {
20+
"@elizaos/adapter-postgres": "workspace:*",
21+
"@elizaos/adapter-redis": "workspace:*",
22+
"@elizaos/adapter-sqlite": "workspace:*",
23+
"@elizaos/client-auto": "workspace:*",
24+
"@elizaos/client-direct": "workspace:*",
25+
"@elizaos/client-discord": "workspace:*",
26+
"@elizaos/client-farcaster": "workspace:*",
27+
"@elizaos/client-lens": "workspace:*",
28+
"@elizaos/client-telegram": "workspace:*",
29+
"@elizaos/client-twitter": "workspace:*",
30+
"@elizaos/client-slack": "workspace:*",
31+
"@elizaos/core": "workspace:*",
32+
"@elizaos/plugin-0g": "workspace:*",
33+
"@elizaos/plugin-aptos": "workspace:*",
34+
"@elizaos/plugin-bootstrap": "workspace:*",
35+
"@elizaos/plugin-intiface": "workspace:*",
36+
"@elizaos/plugin-coinbase": "workspace:*",
37+
"@elizaos/plugin-conflux": "workspace:*",
38+
"@elizaos/plugin-evm": "workspace:*",
39+
"@elizaos/plugin-flow": "workspace:*",
40+
"@elizaos/plugin-story": "workspace:*",
41+
"@elizaos/plugin-goat": "workspace:*",
42+
"@elizaos/plugin-icp": "workspace:*",
43+
"@elizaos/plugin-image-generation": "workspace:*",
44+
"@elizaos/plugin-nft-generation": "workspace:*",
45+
"@elizaos/plugin-node": "workspace:*",
46+
"@elizaos/plugin-solana": "workspace:*",
47+
"@elizaos/plugin-starknet": "workspace:*",
48+
"@elizaos/plugin-ton": "workspace:*",
49+
"@elizaos/plugin-sui": "workspace:*",
50+
"@elizaos/plugin-tee": "workspace:*",
51+
"@elizaos/plugin-multiversx": "workspace:*",
52+
"@elizaos/plugin-near": "workspace:*",
53+
"@elizaos/plugin-zksync-era": "workspace:*",
54+
"@elizaos/plugin-cronoszkevm": "workspace:*",
55+
"readline": "1.3.0",
56+
"ws": "8.18.0",
57+
"yargs": "17.7.2"
58+
},
59+
"devDependencies": {
60+
"ts-node": "10.9.2",
61+
"tsup": "8.3.5"
62+
}
6363
}

agent/src/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import { suiPlugin } from "@elizaos/plugin-sui";
5555
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
5656
import { tonPlugin } from "@elizaos/plugin-ton";
5757
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
58-
import { cronosZkEVMPlugin } from "@ai16z/plugin-cronoszkEVM";
58+
import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkEVM";
5959
import Database from "better-sqlite3";
6060
import fs from "fs";
6161
import path from "path";
@@ -569,7 +569,9 @@ export async function createAgent(
569569
getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
570570
getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
571571
getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
572-
getSecret(character, "CRONOSZKEVM_PRIVATE_KEY") ? cronosZkEVMPlugin : null,
572+
getSecret(character, "CRONOSZKEVM_PRIVATE_KEY")
573+
? cronosZkEVMPlugin
574+
: null,
573575
getSecret(character, "TON_PRIVATE_KEY") ? tonPlugin : null,
574576
getSecret(character, "SUI_PRIVATE_KEY") ? suiPlugin : null,
575577
getSecret(character, "STORY_PRIVATE_KEY") ? storyPlugin : null,

packages/plugin-cronoszkevm/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@ai16z/plugin-cronoszkevm",
2+
"name": "@elizaos/plugin-cronoszkevm",
33
"version": "0.1.4-alpha.3",
44
"main": "dist/index.js",
55
"type": "module",
66
"types": "dist/index.d.ts",
77
"dependencies": {
8-
"@ai16z/eliza": "workspace:*",
9-
"@ai16z/plugin-trustdb": "workspace:*",
8+
"@elizaos/core": "workspace:*",
9+
"@elizaos/plugin-trustdb": "workspace:*",
1010
"tsup": "^8.3.5",
1111
"web3": "^4.15.0",
1212
"web3-plugin-zksync": "^1.0.8"

packages/plugin-cronoszkevm/src/actions/transfer.ts

+16-15
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import {
99
type Action,
1010
elizaLogger,
1111
composeContext,
12-
generateObject
13-
} from "@ai16z/eliza";
12+
generateObject,
13+
} from "@elizaos/core";
1414
import { validateCronosZkevmConfig } from "../enviroment";
1515

16-
import {Web3} from "web3";
16+
import { Web3 } from "web3";
1717
import {
1818
ZKsyncPlugin,
1919
ZKsyncWallet,
2020
types,
21-
Web3ZKsyncL2
21+
Web3ZKsyncL2,
2222
} from "web3-plugin-zksync";
2323

2424
export interface TransferContent extends Content {
@@ -29,8 +29,7 @@ export interface TransferContent extends Content {
2929

3030
export function isTransferContent(
3131
content: TransferContent
32-
): content is TransferContent {
33-
32+
): content is TransferContent {
3433
// Validate types
3534
const validTypes =
3635
typeof content.tokenAddress === "string" &&
@@ -51,7 +50,6 @@ export function isTransferContent(
5150
return validAddresses;
5251
}
5352

54-
5553
const transferTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined.
5654
5755
Here are several frequently used addresses. Use these for the corresponding tokens:
@@ -142,23 +140,27 @@ export default {
142140
const web3: Web3 = new Web3(/* optional L1 provider */);
143141

144142
web3.registerPlugin(
145-
new ZKsyncPlugin(
146-
new Web3ZKsyncL2('https://mainnet.zkevm.cronos.org'),
147-
),
143+
new ZKsyncPlugin(
144+
new Web3ZKsyncL2("https://mainnet.zkevm.cronos.org")
145+
)
148146
);
149147

150-
const smartAccount = new web3.ZKsync.SmartAccount({ address: PUBLIC_KEY, secret: "0x" + PRIVATE_KEY })
148+
const smartAccount = new web3.ZKsync.SmartAccount({
149+
address: PUBLIC_KEY,
150+
secret: "0x" + PRIVATE_KEY,
151+
});
151152

152153
const transferTx = await smartAccount.transfer({
153154
to: content.recipient,
154155
token: content.tokenAddress,
155-
amount: web3.utils.toWei(content.amount,'ether'),
156+
amount: web3.utils.toWei(content.amount, "ether"),
156157
});
157158

158159
const receipt = await transferTx.wait();
159160

160161
elizaLogger.success(
161-
"Transfer completed successfully! tx: " + receipt.transactionHash
162+
"Transfer completed successfully! tx: " +
163+
receipt.transactionHash
162164
);
163165
if (callback) {
164166
callback({
@@ -224,7 +226,6 @@ export default {
224226
text: "Successfully sent 100 ZKCRO to 0xbD8679cf79137042214fA4239b02F4022208EE82\nTransaction: 0x0b9f23e69ea91ba98926744472717960cc7018d35bc3165bdba6ae41670da0f0",
225227
},
226228
},
227-
]
229+
],
228230
] as ActionExample[][],
229231
} as Action;
230-

packages/plugin-cronoszkevm/src/enviroment.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { IAgentRuntime } from "@ai16z/eliza";
1+
import { IAgentRuntime } from "@elizaos/eliza";
22
import { z } from "zod";
33

44
export const CronosZkEVMEnvSchema = z.object({
55
CRONOSZKEVM_ADDRESS: z.string().min(1, "Cronos zkEVM address is required"),
6-
CRONOSZKEVM_PRIVATE_KEY: z.string().min(1, "Cronos zkEVM private key is required"),
6+
CRONOSZKEVM_PRIVATE_KEY: z
7+
.string()
8+
.min(1, "Cronos zkEVM private key is required"),
79
});
810

911
export type CronoszkEVMConfig = z.infer<typeof CronosZkEVMEnvSchema>;
@@ -18,7 +20,7 @@ export async function validateCronosZkevmConfig(
1820
process.env.CRONOSZKEVM_ADDRESS,
1921
CRONOSZKEVM_PRIVATE_KEY:
2022
runtime.getSetting("CRONOSZKEVM_PRIVATE_KEY") ||
21-
process.env.CRONOSZKEVM_PRIVATE_KEY
23+
process.env.CRONOSZKEVM_PRIVATE_KEY,
2224
};
2325

2426
return CronosZkEVMEnvSchema.parse(config);

packages/plugin-cronoszkevm/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Plugin } from "@ai16z/eliza";
1+
import { Plugin } from "@elizaos/core";
22

33
import transfer from "./actions/transfer";
44

0 commit comments

Comments
 (0)