Skip to main content
Glama

Mempool MCP Server

BlocksRequestService.ts1.44 kB
import { IApiClient } from "../../interfaces/IApiClient.js"; import { IBlocksResponse, IBlockTxidsResponse, IBlockTxsResponse, IBlockStatusResponse, } from "../../../domain/models/responses/block/IBlocksResponse.js"; export class BlocksRequestService { constructor(private client: IApiClient) {} async getBlocks(): Promise<IBlocksResponse[] | null> { return this.client.makeRequest<IBlocksResponse[]>(`blocks`); } async getBlockTxids({ hash }: { hash: string }): Promise<IBlockTxidsResponse[] | null> { return this.client.makeRequest<IBlockTxidsResponse[]>(`block/${hash}/txids`); } async getBlockTxs({ hash }: { hash: string }): Promise<IBlockTxsResponse[] | null> { return this.client.makeRequest<IBlockTxsResponse[]>(`block/${hash}/txs`); } async getBlockStatus({ hash }: { hash: string }): Promise<IBlockStatusResponse | null> { return this.client.makeRequest<IBlockStatusResponse>(`block/${hash}/status`); } async getBlockRaw({ hash }: { hash: string }): Promise<string | null> { return this.client.makeRequest<string>(`block/${hash}/raw`); } async getBlockTxidByIndex({ hash, index }: { hash: string; index: number }): Promise<string | null> { return this.client.makeRequest<string>(`block/${hash}/txid/${index}`); } async getBlockHeader({ hash }: { hash: string }): Promise<string | null> { return this.client.makeRequest<string>(`block/${hash}/header`); } }

Latest Blog Posts

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/alexandresanlim/mempool-mcp-server'

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