UNPKG

python-proxy-scraper-client

Version:

A TypeScript client for interacting with a Python proxy scraper service

84 lines (83 loc) 3.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GmGnClient = void 0; const base_client_1 = require("../../shared/base-client"); class GmGnClient extends base_client_1.BaseClient { constructor(baseUrl = 'http://localhost:8000') { super({ baseUrl }); } async getSmartMoneyWalletData(walletAddress, chain) { return this.get(`/gmgn/smart-money/${chain}/${walletAddress}`); } async getTopTraders(tokenAddress, chain) { return this.get(`/gmgn/top-traders/${chain}/${tokenAddress}`); } async getTokenSecurityAndLaunchpad(tokenAddress, chain) { return this.get(`/gmgn/token-security/${chain}/${tokenAddress}`); } async getWalletHoldings(walletAddress, chain) { return this.get(`/gmgn/wallet-holdings/${chain}/${walletAddress}`); } async getTrendingTokens(chain, timeframe = '1h') { return this.get(`/gmgn/trending/${chain}?timeframe=${timeframe}`); } async getTopBuyers(tokenAddress, chain) { return this.get(`/gmgn/top-buyers/${chain}/${tokenAddress}`); } async getTopHolders(tokenAddress, chain) { return this.get(`/gmgn/top-holders/${chain}/${tokenAddress}`); } async getMultiWindowTokenInfo(addresses, chain) { return this.post('/gmgn/mutil-window-token-info', { chain, addresses }); } async getTokenSocials(tokenAddress, chain) { return this.get(`/gmgn/mutil-window-token-link-rug-vote/${chain}/${tokenAddress}`); } async getTokenCandles(tokenAddress, chain, interval, from, to) { const queryParams = new URLSearchParams({ resolution: interval, from: from.toString(), to: to.toString(), limit: '1000' }); return this.get(`/gmgn/token-candles/${chain}/${tokenAddress}?${queryParams.toString()}`); } async getTokenWalletTagsStat(tokenAddress, chain) { return this.get(`/gmgn/token-wallet-tags-stat/${chain}/${tokenAddress}`); } async getTokenTraderStat(tokenAddress, chain) { return this.get(`/gmgn/token-trader-stat/${chain}/${tokenAddress}`); } async getTokenStats(tokenAddress, chain) { return this.get(`/gmgn/token-stats/${chain}/${tokenAddress}`); } async getTokenHolders(tokenAddress, chain, limit = 100, orderby = 'amount_percentage', direction = 'desc', tag) { const rawParams = { limit: limit.toString(), orderby, direction }; if (tag) { rawParams.tag = tag; } const params = new URLSearchParams(rawParams); return this.get(`/gmgn/token-holders/${chain}/${tokenAddress}?${params.toString()}`); } async getWalletActivity(wallet, chain, type = ['buy', 'sell'], limit = 10, cost = 10, cursor) { const params = new URLSearchParams({ wallet, limit: limit.toString(), cost: cost.toString() }); // Add activity types as separate parameters type.forEach(t => params.append('type', t)); if (cursor) { params.append('cursor', cursor); } return this.get(`/gmgn/wallet-activity/${chain}?${params.toString()}`); } } exports.GmGnClient = GmGnClient;