Skip to main content
Glama
network-service.ts1.16 kB
import { BaseService } from './base-service.js'; export class NetworkService extends BaseService { /** * Get the current address information */ async getCurrentAddressInfo() { return { address: this.address, network: this.network, explorerUrl: `${this.network.explorerUrl}/address/${this.address}`, }; } /** * Get the block information */ async getBlockInfo(height?: number) { try { const blockData = height ? await this.cometClient.block(height) : await this.cometClient.block(); // Extract the most useful information return { height: blockData.block.header.height, time: blockData.block.header.time.toISOString(), chainId: blockData.block.header.chainId, numTxs: blockData.block.txs?.length || 0, proposer: Buffer.from(blockData.block.header.proposerAddress).toString('hex').toUpperCase(), appHash: Buffer.from(blockData.block.header.appHash).toString('hex').toUpperCase(), }; } catch (error) { throw new Error(`Failed to get current block info: ${error instanceof Error ? error.message : String(error)}`); } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/allthatjazzleo/mantrachain-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server