@sanlim/mempool-mcp-server
Version:
A sample of MCP implementation using DDD structure with some APIs call.
28 lines (27 loc) • 839 B
JavaScript
export class BlocksRequestService {
client;
constructor(client) {
this.client = client;
}
async getBlocks() {
return this.client.makeRequest(`blocks`);
}
async getBlockTxids({ hash }) {
return this.client.makeRequest(`block/${hash}/txids`);
}
async getBlockTxs({ hash }) {
return this.client.makeRequest(`block/${hash}/txs`);
}
async getBlockStatus({ hash }) {
return this.client.makeRequest(`block/${hash}/status`);
}
async getBlockRaw({ hash }) {
return this.client.makeRequest(`block/${hash}/raw`);
}
async getBlockTxidByIndex({ hash, index }) {
return this.client.makeRequest(`block/${hash}/txid/${index}`);
}
async getBlockHeader({ hash }) {
return this.client.makeRequest(`block/${hash}/header`);
}
}