python-proxy-scraper-client
Version:
A TypeScript client for interacting with a Python proxy scraper service
35 lines (34 loc) • 1.51 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.GeckoTerminalApiClient = void 0;
const base_client_1 = require("../../shared/base-client");
class GeckoTerminalApiClient extends base_client_1.BaseClient {
constructor() {
super({ baseUrl: "http://localhost:8000" });
}
async getTrades(chain, poolAddress, tradeVolumeInUsdGreaterThan = 1000) {
const endpoint = `/geckoterminal-api/${chain}/pools/${poolAddress}/trades?trade_volume_in_usd_greater_than=${tradeVolumeInUsdGreaterThan}`;
return this.get(endpoint);
}
async getPoolInfo(chain, poolAddress) {
const endpoint = `/geckoterminal-api/${chain}/pools/${poolAddress}`;
return this.get(endpoint);
}
async getTokenPools(chain, tokenId, page = 1) {
const endpoint = `/geckoterminal-api/${chain}/tokens/${tokenId}/pools?page=${page}`;
return this.get(endpoint);
}
async getTrendingPools(chain, page = 1) {
const endpoint = `/geckoterminal-api/${chain}/trending-pools?page=${page}`;
return this.get(endpoint);
}
async getTokenPrice(chain, tokenAddress) {
const endpoint = `/geckoterminal-api/${chain}/tokens/${tokenAddress}/price`;
return this.get(endpoint);
}
async getTokenDetails(chain, tokenAddress) {
const endpoint = `/geckoterminal-api/${chain}/tokens/${tokenAddress}`;
return this.get(endpoint);
}
}
exports.GeckoTerminalApiClient = GeckoTerminalApiClient;
;