UNPKG

python-proxy-scraper-client

Version:

A TypeScript client for interacting with a Python proxy scraper service

41 lines (40 loc) 1.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BirdeyeClient = void 0; const base_client_1 = require("../../shared/base-client"); class BirdeyeClient extends base_client_1.BaseClient { constructor() { super({ baseUrl: "http://localhost:8000" }); } async getTokenSecurity(chain, tokenAddress) { const endpoint = `/birdeye/token-security/${chain}/${tokenAddress}`; return this.get(endpoint); } async getAccountInfo(chain, address) { const endpoint = `/birdeye/${chain}/account?address=${address}`; return this.get(endpoint); } async getTokenHolders(chain, tokenAddress, offset = 0, size = 10) { const endpoint = `/birdeye/${chain}/token/holders?token=${tokenAddress}&offset=${offset}&size=${size}`; return this.get(endpoint); } async getTokenStats(chain, tokenAddress, timeFrame = '24h') { const endpoint = `/birdeye/${chain}/overview/token-stats?address=${tokenAddress}&time_frame=${timeFrame}`; return this.get(endpoint); } async getTokenTransactions(chain, tokenAddress, offset = 0, limit = 10, export_data = false, page = "token") { const endpoint = `/birdeye/${chain}/amm/v2/txs/token`; return this.post(endpoint, { address: tokenAddress, offset, limit, export: export_data, page }); } async getMarketData(chain, address, sortBy = "volume24h", sortType = "desc") { const endpoint = `/birdeye/${chain}/amm/market_lite?address=${address}&sort_by=${sortBy}&sort_type=${sortType}`; return this.get(endpoint); } } exports.BirdeyeClient = BirdeyeClient;