From 9800a570676272c087864e4ceda2e3cddea8fbd8 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 21 Feb 2025 15:47:24 -0600 Subject: [PATCH] sonic support --- src/chains/evm/evm.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/chains/evm/evm.ts b/src/chains/evm/evm.ts index cdc63ff..4c7da74 100644 --- a/src/chains/evm/evm.ts +++ b/src/chains/evm/evm.ts @@ -67,6 +67,13 @@ const NETWORKS: { [key: string]: NetworkConfig } = { chainId: 80094, currencySymbol: "BERA", explorer: "https://berascan.com" + }, + sonic: { + name: "Sonic", + rpc: process.env.SONIC_RPC_URL || "https://rpc.soniclabs.com/", + chainId: 2024, + currencySymbol: "SONIC", + explorer: "https://explorer.sonic.ooo" } }; @@ -92,7 +99,7 @@ export function registerEvmTools(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, berachain)"), + network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain, sonic)"), }, async ({ address, network }) => { try { @@ -141,7 +148,7 @@ export function registerEvmTools(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, berachain)"), + network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain, sonic)"), }, async ({ address, tokenAddress, network }) => { try { @@ -195,7 +202,7 @@ export function registerEvmTools(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, berachain)"), + network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain, sonic)"), }, async ({ network }) => { try { @@ -254,7 +261,7 @@ export function registerEvmTools(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, berachain)"), + network: z.string().describe("Network name (ethereum, base, arbitrum, optimism, bsc, polygon, avalanche, berachain, sonic)"), }, async ({ toAddress, amount, network }) => { try {