berachain support

This commit is contained in:
Alex Cheng
2025-02-19 11:50:01 -06:00
parent 91282467b5
commit 4e25635d60
3 changed files with 17 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ OPTIMISM_RPC_URL=https://mainnet.optimism.io
BSC_RPC_URL=https://bsc-dataseed.binance.org
POLYGON_RPC_URL=https://polygon-rpc.com
AVALANCHE_RPC_URL=https://api.avax.network/ext/bc/C/rpc
BERACHAIN_RPC_URL=https://rpc.berachain.com
# Private keys (DO NOT SHARE)
ETH_PRIVATE_KEY=your-eth-private-key

View File

@@ -57,6 +57,7 @@ Supported EVM Networks:
- BSC (Binance Smart Chain)
- Polygon
- Avalanche
- Berachain
## Setup
@@ -103,6 +104,7 @@ OPTIMISM_RPC_URL=https://mainnet.optimism.io
BSC_RPC_URL=https://bsc-dataseed.binance.org
POLYGON_RPC_URL=https://polygon-rpc.com
AVALANCHE_RPC_URL=https://api.avax.network/ext/bc/C/rpc
BERACHAIN_RPC_URL=https://rpc.berachain.com
# THORChain Configuration
THORCHAIN_NODE_URL=https://thornode.ninerealms.com # Optional - will use public endpoint if not specified
@@ -188,7 +190,7 @@ Ask Claude:
You can configure custom RPC endpoints in your .env file for better reliability and higher rate limits. If not specified, the tool will fall back to public RPC endpoints.
### Network Selection
For EVM operations, you can specify the network by name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche). The tool will automatically use the appropriate RPC endpoint and network configuration.
For EVM operations, you can specify the network by name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain). The tool will automatically use the appropriate RPC endpoint and network configuration.
### THORChain Configuration
The tool uses Nine Realms public endpoints by default, but you can configure a custom THORChain node URL in the .env file for better reliability and rate limits.

View File

@@ -60,6 +60,13 @@ const NETWORKS: { [key: string]: NetworkConfig } = {
chainId: 43114,
currencySymbol: "AVAX",
explorer: "https://snowtrace.io"
},
berachain: {
name: "Berachain",
rpc: process.env.BERACHAIN_RPC_URL || "https://rpc.berachain.com",
chainId: 80094,
currencySymbol: "BERA",
explorer: "https://berascan.com"
}
};
@@ -85,7 +92,7 @@ export function registerEthereumTools(server: McpServer) {
"Get native token balance for an EVM address on any supported network",
{
address: z.string().describe("EVM account address"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain)"),
},
async ({ address, network }) => {
try {
@@ -134,7 +141,7 @@ export function registerEthereumTools(server: McpServer) {
{
address: z.string().describe("EVM account address"),
tokenAddress: z.string().describe("ERC-20 token contract address"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain)"),
},
async ({ address, tokenAddress, network }) => {
try {
@@ -188,7 +195,7 @@ export function registerEthereumTools(server: McpServer) {
"getGasPrice",
"Get current gas price for any supported EVM network",
{
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain)"),
},
async ({ network }) => {
try {
@@ -247,7 +254,7 @@ export function registerEthereumTools(server: McpServer) {
{
toAddress: z.string().describe("Recipient's address"),
amount: z.string().describe("Amount to send (in native tokens)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain)"),
},
async ({ toAddress, amount, network }) => {
try {
@@ -324,7 +331,7 @@ export function registerEthereumTools(server: McpServer) {
toAddress: z.string().describe("Recipient's address"),
tokenAddress: z.string().describe("Token contract address"),
amount: z.string().describe("Amount to send (in token units)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain)"),
},
async ({ toAddress, tokenAddress, amount, network }) => {
try {
@@ -398,7 +405,7 @@ export function registerEthereumTools(server: McpServer) {
spenderAddress: z.string().describe("Address to approve for spending"),
tokenAddress: z.string().describe("Token contract address"),
amount: z.string().optional().describe("Amount to approve (in token units, defaults to unlimited)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche)"),
network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain)"),
},
async ({ spenderAddress, tokenAddress, amount, network }) => {
try {