UNPKG

python-proxy-scraper-client

Version:

A TypeScript client for interacting with a Python proxy scraper service

77 lines (76 loc) 3.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AxiomClient = void 0; const base_client_1 = require("../../shared/base-client"); class AxiomClient extends base_client_1.BaseClient { constructor() { super({ baseUrl: "http://localhost:8000" }); } async getPairData(pairAddress, userWalletAddress) { let endpoint = `/axiom/pair-info?pair_address=${pairAddress}`; if (userWalletAddress) { endpoint += `&user_wallet_address=${userWalletAddress}`; } return this.get(endpoint); } async getMemeTrending(timePeriod = "1h") { const endpoint = `/axiom/meme-trending?time_period=${timePeriod}`; return this.get(endpoint); } async getTopTraders(pairAddress, onlyTrackedWallets = false) { const endpoint = `/axiom/top-traders-v2?pair_address=${pairAddress}&only_tracked_wallets=${onlyTrackedWallets}`; return this.get(endpoint); } async getTransactionsFromTraders(traders, pairAddress) { const endpoint = `/axiom/transactions-from-traders`; return this.post(endpoint, { traders, pair_address: pairAddress }); } async getTokenInfo(pairAddress) { const endpoint = `/axiom/token-info?pair_address=${pairAddress}`; return this.get(endpoint); } async getDevTokensV2(devAddress) { const endpoint = `/axiom/dev-tokens-v2?dev_address=${devAddress}`; return this.get(endpoint); } async getTokenAnalysis(devAddress, tokenTicker) { const endpoint = `/axiom/token-analysis?dev_address=${devAddress}&token_ticker=${tokenTicker}`; return this.get(endpoint); } async getPairStats(pairAddress) { const endpoint = `/axiom/pair-stats?pair_address=${pairAddress}`; return this.get(endpoint); } async getPairChart(pairAddress, fromTimestamp, toTimestamp, openTrading, lastTransactionTime, countBars, currency = "USD", interval = "1h", showOutliers = false, isNew = false) { const endpoint = `/axiom/pair-chart?` + `pair_address=${pairAddress}&` + `from_timestamp=${fromTimestamp}&` + `to_timestamp=${toTimestamp}&` + `open_trading=${openTrading}&` + `last_transaction_time=${lastTransactionTime}&` + `count_bars=${countBars}&` + `currency=${currency}&` + `interval=${interval}&` + `show_outliers=${showOutliers}&` + `is_new=${isNew}`; return this.get(endpoint); } async getHolderData(pairAddress, onlyTrackedWallets = false) { const endpoint = `/axiom/holder-data-v2?pair_address=${pairAddress}&only_tracked_wallets=${onlyTrackedWallets}`; return this.get(endpoint); } async getPortfolio(walletAddress, isOtherWallet = true, totalSolBalance = 0, tokenAddressToAmountMap = {}) { const endpoint = `/axiom/portfolio-v3`; return this.post(endpoint, { wallet_address: walletAddress, is_other_wallet: isOtherWallet, total_sol_balance: totalSolBalance, token_address_to_amount_map: tokenAddressToAmountMap }); } async getSearchResults(searchQuery, isOg = false, isPumpOnly = false) { const endpoint = `/axiom/search?search_query=${searchQuery}&is_og=${isOg}&is_pump_only=${isPumpOnly}`; return this.get(endpoint); } } exports.AxiomClient = AxiomClient;