diff --git a/packages/plugin-defillama/README.md b/packages/plugin-defillama/README.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/plugin-defillama/package.json b/packages/plugin-defillama/package.json deleted file mode 100644 index 8413f4b7e15..00000000000 --- a/packages/plugin-defillama/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@elizaos/plugin-defillama", - "version": "0.1.0", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "axios": "^1.6.0", - "tsup": "^8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts" - } -} \ No newline at end of file diff --git a/packages/plugin-defillama/src/actions/get-price.action.ts b/packages/plugin-defillama/src/actions/get-price.action.ts deleted file mode 100644 index 35fb1b2bc91..00000000000 --- a/packages/plugin-defillama/src/actions/get-price.action.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createAction } from "@elizaos/core"; -import { z } from "zod"; -import { DefiLlamaProvider } from "../providers/defillama.provider"; - -export const GetPriceSchema = z.object({ - tokenId: z.string(), -}); - -export const getPriceAction = createAction({ - name: "get-price", - description: "Get current price for a token from DefiLlama", - schema: GetPriceSchema, - handler: async ({ tokenId }, { provider }) => { - const defiLlama = provider as DefiLlamaProvider; - const price = await defiLlama.getCurrentPrice(tokenId); - return { price }; - }, -}); \ No newline at end of file diff --git a/packages/plugin-defillama/src/environment.ts b/packages/plugin-defillama/src/environment.ts deleted file mode 100644 index 0d7f41870cb..00000000000 --- a/packages/plugin-defillama/src/environment.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { z } from "zod"; - -export const DefiLlamaEnvironmentSchema = z.object({ - DEFILLAMA_API_URL: z.string().default("https://coins.llama.fi"), - DEFILLAMA_TIMEOUT: z.coerce.number().default(10000), -}); - -export type DefiLlamaEnvironment = z.infer; diff --git a/packages/plugin-defillama/src/index.ts b/packages/plugin-defillama/src/index.ts deleted file mode 100644 index 60e2d2a526f..00000000000 --- a/packages/plugin-defillama/src/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { createPlugin } from "@elizaos/core"; -import { getPriceAction } from "./actions/get-price.action"; -import { DefiLlamaEnvironmentSchema } from "./environment"; -import { DefiLlamaProvider } from "./providers/defillama.provider"; - -export const DefiLlamaPlugin = createPlugin({ - name: "defillama", - version: "0.1.0", - environment: DefiLlamaEnvironmentSchema, - provider: ({ environment }) => new DefiLlamaProvider(environment), - actions: [getPriceAction], -}); - -export * from "./environment"; diff --git a/packages/plugin-defillama/src/providers/defillama.provider.ts b/packages/plugin-defillama/src/providers/defillama.provider.ts deleted file mode 100644 index a5a62c1b8d3..00000000000 --- a/packages/plugin-defillama/src/providers/defillama.provider.ts +++ /dev/null @@ -1,24 +0,0 @@ -import axios, { AxiosInstance } from "axios"; -import { DefiLlamaEnvironment } from "../environment"; - -export class DefiLlamaProvider { - private client: AxiosInstance; - - constructor(environment: DefiLlamaEnvironment) { - this.client = axios.create({ - baseURL: environment.DEFILLAMA_API_URL, - timeout: environment.DEFILLAMA_TIMEOUT, - }); - } - - async getCurrentPrice(tokenId: string): Promise { - const { data } = await this.client.get(`/prices/current/${tokenId}`); - const priceData = data.coins[tokenId]; - - if (!priceData) { - throw new Error(`No price data found for token: ${tokenId}`); - } - - return priceData.price; - } -} \ No newline at end of file diff --git a/packages/plugin-defillama/tsconfig.json b/packages/plugin-defillama/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/plugin-defillama/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-defillama/tsup.config.ts b/packages/plugin-defillama/tsup.config.ts deleted file mode 100644 index 98c2d8e4c70..00000000000 --- a/packages/plugin-defillama/tsup.config.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], - external: [ - "dotenv", - "fs", - "path", - "https", - "http", - "agentkeepalive", - ], -});