Skip to main content
Glama
contractLookup.ts881 B
/** * contract lookup helpers */ import { BASE_CONTRACTS, getContract } from "../data/contracts.js"; export async function getContractData(symbol: string) { const contract = getContract(symbol); if (!contract) { return { error: `not found - available: ${Object.keys(BASE_CONTRACTS).join(", ")}` }; } return contract; } export async function getContractByAddress(address: string) { const lowerAddress = address.toLowerCase(); const contract = Object.entries(BASE_CONTRACTS).find( ([_, info]) => info.address.toLowerCase() === lowerAddress ); if (!contract) { return { address: lowerAddress, found: false, note: "address not in BaseQL registry" }; } const info: any = contract[1]; return { address: lowerAddress, symbol: info.symbol, name: info.name, decimals: info.decimals, found: true }; }

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/Jnix2007/baseql-mcp'

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