UNPKG

python-proxy-scraper-client

Version:

A TypeScript client for interacting with a Python proxy scraper service

87 lines (86 loc) 3.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const axiom_client_1 = require("./services/blockchain/axiom/axiom-client"); // Test data const TEST_DATA = { pairAddress: "3SWzHHRe3ZTEdEqF2R31qV2hinxFAYRY6uGAUzxiQN6B", userWalletAddress: "8r1dsQC5wh7U9GZD427ctw8nkiHbWGAevkkvucJaeem1", traderAddress: '2RcJ5KV2DVN5AMEstXhFLqGBgZYrGNhTadD8aNbAD2Ht', devAddress: 'Ai65QEL21pyiEY8mRdgFC2qcqHcCMUxBznGbQRCfQW6x', tokenTicker: 'PLSRESPOND' }; // Helper function to log response function logResponse(endpoint, response) { console.log(`\nTesting ${endpoint} endpoint...`); console.log('Response:', response); console.log('Type:', typeof response); } // Individual test functions async function testPairInfo(client) { const response = await client.getPairData(TEST_DATA.pairAddress, TEST_DATA.userWalletAddress); logResponse('pair-info', response); } async function testMemeTrending(client) { const response = await client.getMemeTrending(); logResponse('meme-trending', response); } async function testTopTraders(client) { const response = await client.getTopTraders(TEST_DATA.pairAddress); logResponse('top-traders', response); } async function testTransactionsFromTraders(client) { const response = await client.getTransactionsFromTraders([TEST_DATA.traderAddress], TEST_DATA.pairAddress); logResponse('transactions-from-traders', response); } async function testTokenInfo(client) { const response = await client.getTokenInfo(TEST_DATA.pairAddress); logResponse('token-info', response); } async function testDevTokensV2(client) { const response = await client.getDevTokensV2(TEST_DATA.devAddress); logResponse('dev-tokens-v2', response); } async function testTokenAnalysis(client) { const response = await client.getTokenAnalysis(TEST_DATA.devAddress, TEST_DATA.tokenTicker); logResponse('token-analysis', response); } async function testPairStats(client) { const response = await client.getPairStats(TEST_DATA.pairAddress); logResponse('pair-stats', response); } async function testPairChart(client) { const now = Date.now(); const response = await client.getPairChart(TEST_DATA.pairAddress, now - 3600000, // one hour ago now, // now now - 600000, // 10 minutes ago now - 60000, // 1 minute ago 329 // 329 bars ); logResponse('pair-chart', response); } async function testHolderData(client) { const response = await client.getHolderData(TEST_DATA.pairAddress); logResponse('holder-data', response); } // Main test function async function testAxiomEndpoints() { const client = new axiom_client_1.AxiomClient(); try { // Run all tests in sequence // await testPairInfo(client); // await testMemeTrending(client); // await testTopTraders(client); // await testTransactionsFromTraders(client); // await testTokenInfo(client); // await testDevTokensV2(client); // await testTokenAnalysis(client); // await testPairStats(client); // await testPairChart(client); // await testHolderData(client); } catch (error) { console.error('Error testing endpoints:', error); } } // Run the tests testAxiomEndpoints();