Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ ALLORA_API_KEY= # Allora API key, format: UP-f8db7d6558ab432ca0d
ALLORA_CHAIN_SLUG= # must be one of mainnet, testnet. If not specified, it will use testnet by default

# B2 Network
B2_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000 # Private key of the B2 Network account to use for the agent
B2_PRIVATE_KEY= # Private key of the B2 Network account to use for the agent

# Opacity zkTLS
OPACITY_TEAM_ID=f309ac8ae8a9a14a7e62cd1a521b1c5f
Expand Down
17 changes: 15 additions & 2 deletions packages/plugin-b2/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import { b2Plugin } from "./plugins";
import { Plugin } from "@elizaos/core";
import { transferAction } from "./actions/transfer";
import { stakeAction } from "./actions/stake";
import { unstakeAction } from "./actions/unstake";
import { withdrawAction } from "./actions/withdraw";
import { walletProvider } from "./providers";

export * from "./plugins";
const b2Plugin: Plugin = {
name: "b2",
description: "B2 Network Plugin for Eliza",
actions: [transferAction, stakeAction, unstakeAction, withdrawAction],
providers: [walletProvider],
evaluators: [],
services: [],
clients: [],
};

export default b2Plugin;
16 changes: 0 additions & 16 deletions packages/plugin-b2/src/plugins/index.ts

This file was deleted.

9 changes: 5 additions & 4 deletions packages/plugin-b2/src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
elizaLogger,
} from "@elizaos/core";
import { privateKeyToAccount } from "viem/accounts";

import {
formatUnits,
Address,
Expand All @@ -17,7 +16,9 @@ import {
http,
createPublicClient,
createWalletClient,
PublicClient
PublicClient,
Transport,
RpcSchema,
} from "viem";
import { TOKEN_ADDRESSES } from "../utils/constants";
import { b2Network } from "../utils/chains";
Expand Down Expand Up @@ -90,7 +91,7 @@ export class WalletProvider implements Provider {
return this.account.address;
}

getPublicClient(): PublicClient<HttpTransport, Chain, Account | undefined> {
getPublicClient(): PublicClient<Transport, Chain, Account | undefined, RpcSchema | undefined> {
return createPublicClient({
chain: b2Network,
transport: http(),
Expand Down Expand Up @@ -179,7 +180,7 @@ export const initWalletProvider = async (runtime: IAgentRuntime) => {
"B2_PRIVATE_KEY not found in environment variables"
);
}
return new WalletProvider(privateKey);
return new WalletProvider(privateKey as `0x${string}`);
};

export const walletProvider: Provider = {
Expand Down
Loading
Loading