Skip to content

Commit

Permalink
move to @elizaos/core
Browse files Browse the repository at this point in the history
  • Loading branch information
tiero committed Dec 29, 2024
1 parent d62b560 commit ec4084b
Show file tree
Hide file tree
Showing 7 changed files with 438 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,9 @@ CRONOSZKEVM_PRIVATE_KEY=

# Fuel Ecosystem (FuelVM)
FUEL_WALLET_PRIVATE_KEY=

# Bitcoin Configuration
BITCOIN_PRIVATE_KEY= # Your Bitcoin private key in WIF format
BITCOIN_NETWORK= # Network type: bitcoin, testnet, regtest, signet, or mutinynet
ARK_SERVER_URL= # Ark protocol server URL
ARK_SERVER_PUBLIC_KEY= # Ark server public key for L2 operations
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@elizaos/plugin-3d-generation": "workspace:*",
"@elizaos/plugin-fuel": "workspace:*",
"@elizaos/plugin-avalanche": "workspace:*",
"@elizaos/plugin-bitcoin": "workspace:*",
"readline": "1.3.0",
"ws": "8.18.0",
"yargs": "17.7.2"
Expand Down
2 changes: 2 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import path from "path";
import { fileURLToPath } from "url";
import yargs from "yargs";
import net from "net";
import { bitcoinPlugin } from "@elizaos/plugin-bitcoin";

const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
const __dirname = path.dirname(__filename); // get the name of the directory
Expand Down Expand Up @@ -600,6 +601,7 @@ export async function createAgent(
getSecret(character, "AVALANCHE_PRIVATE_KEY")
? avalanchePlugin
: null,
getSecret(character, "BITCOIN_PRIVATE_KEY") ? bitcoinPlugin : null,
].filter(Boolean),
providers: [],
actions: [],
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-bitcoin/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@ai16z/plugin-bitcoin",
"name": "@elizaos/plugin-bitcoin",
"version": "0.1.0",
"description": "Bitcoin on-chain plugin for Eliza",
"main": "dist/index.js",
Expand All @@ -14,7 +14,7 @@
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@ai16z/eliza": "workspace:*",
"@elizaos/core": "workspace:*",
"@arklabs/wallet-sdk": "^0.0.1",
"node-fetch": "^2.6.9"
},
Expand Down
13 changes: 12 additions & 1 deletion packages/plugin-bitcoin/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
// @ts-ignore
const { InMemoryKey, Wallet } = await import('@arklabs/wallet-sdk')
let InMemoryKey: any;
let Wallet: any;

async function initSDK() {
const sdk = await import('@arklabs/wallet-sdk');
InMemoryKey = sdk.InMemoryKey;
Wallet = sdk.Wallet;
}

// Initialize the SDK
initSDK().catch(console.error);

export { InMemoryKey, Wallet }
3 changes: 2 additions & 1 deletion packages/plugin-bitcoin/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
format: ["cjs", "esm"],
format: ["esm"],
dts: true,
splitting: false,
sourcemap: true,
clean: true,
target: "esnext",
});
Loading

0 comments on commit ec4084b

Please sign in to comment.