diff --git a/components/token_metrics/README.md b/components/token_metrics/README.md index 9abd1ec9eee07..04144710b79a3 100644 --- a/components/token_metrics/README.md +++ b/components/token_metrics/README.md @@ -1,11 +1,82 @@ # Overview -The Token Metrics API offers access to a trove of cryptocurrency data, including analytics, rankings, and predictions that leverage artificial intelligence and expert insights. With this API, you can automate investment strategies, integrate up-to-date crypto data into your applications, and stay informed with the latest market trends. When used on Pipedream, it allows you to build robust, serverless workflows that can react to various triggers and integrate with numerous services for a seamless data handling experience. +The Token Metrics API integration for Pipedream provides comprehensive access to cryptocurrency data, analytics, and AI-powered insights. This component enables seamless integration of advanced token metrics, market analysis, and trading intelligence into your automated workflows. + +Token Metrics delivers institutional-grade cryptocurrency analytics, including AI-generated reports, trading signals, fundamental and technical analysis, market metrics, and performance data across thousands of digital assets. + +# Key Features + +- **Comprehensive Token Data**: Access detailed information for thousands of cryptocurrencies including prices, market metrics, and historical data +- **AI-Powered Analytics**: Leverage AI-generated reports, trading signals, and investment analysis +- **Advanced Grading Systems**: Access TM Grades, Fundamental Grades, and Technology Grades for informed decision-making +- **Market Intelligence**: Get market metrics, correlation analysis, and scenario-based price predictions +- **Professional Indices**: Access crypto indices with holdings and performance data +- **OHLCV Data**: Retrieve hourly and daily Open, High, Low, Close, Volume data +- **Quantitative Metrics**: Advanced quantitative analysis and resistance/support levels + +# Authentication + +To use the Token Metrics API component, you'll need: + +1. A Token Metrics account with API access +2. An API key from your Token Metrics dashboard + +The API uses API key authentication via the `x-api-key` header. Your API key should be kept secure and not shared publicly. + +## Setup Instructions + +1. Sign up for a Token Metrics account at https://www.tokenmetrics.com/api +2. Navigate to your [api keys dashboard](https://app.tokenmetrics.com/en/api?tab=keys) and generate an API key +3. In Pipedream, connect the Token Metrics app using your API key +4. The API key will be automatically included in all requests via the `x-api-key` header + +# Available Components + +This component provides pre-built actions for all major Token Metrics API endpoints, covering token data, AI-powered analytics, market metrics, trading signals, grading systems, and more. All actions support filtering, pagination, and use API key authentication. # Example Use Cases -- **Crypto Alert System**: Build a workflow on Pipedream that monitors the Token Metrics API for significant changes in crypto ratings or predictions. When certain thresholds are met, use the integrated Twilio app to send SMS alerts, ensuring you or your audience stay up-to-date on important market movements. +- **Automated Trading Systems**: Monitor AI-generated trading signals and execute automated trades +- **Portfolio Management**: Track cryptocurrency portfolios with comprehensive token metrics and grades +- **Market Research**: Generate detailed investment analysis using AI reports and fundamental data +- **Risk Management**: Monitor market conditions, correlations, and implement risk strategies +- **Price Monitoring**: Track token prices and receive alerts on significant market movements + +# API Endpoint + +Base URL: `https://api.tokenmetrics.com/v2` + +All requests require the `x-api-key` header for authentication. + +# Rate Limits & Usage + +Please refer to the [Token Metrics API documentation](https://developers.tokenmetrics.com/) for current rate limits, usage guidelines, and pricing information. + +# Data Filtering & Pagination + +Actions support comprehensive filtering by token identifiers, market criteria, date ranges, and standard pagination controls. See the [Token Metrics API documentation](https://developers.tokenmetrics.com/) for specific filter options. + +# Error Handling + +The component includes comprehensive error handling for common scenarios: + +- **401 Unauthorized**: Invalid or expired API key +- **403 Forbidden**: Insufficient API key permissions +- **429 Rate Limited**: API rate limit exceeded +- **5xx Server Errors**: Token Metrics API server issues + +# Support & Resources + +## Official Token Metrics Resources + +- **API Dashboard**: [app.tokenmetrics.com/en/api](https://app.tokenmetrics.com/en/api) - Manage your API keys and access +- **API Pricing Plans**: [app.tokenmetrics.com/en/api-plans](https://app.tokenmetrics.com/en/api-plans) - View pricing and plan details +- **Token Metrics API Documentation**: [developers.tokenmetrics.com](https://developers.tokenmetrics.com/) - Complete API reference +- **API Support (Telegram)**: [t.me/tokenmetricsapi](https://t.me/tokenmetricsapi) - Developer community and support +- **Contact Us**: [tokenmetrics.com/contact-us](https://www.tokenmetrics.com/contact-us) - General support and inquiries -- **Investment Tracker**: Create a Pipedream workflow that pulls daily investment insights and portfolio analytics from the Token Metrics API and logs them to a Google Sheets document. This allows for easy tracking and historical data analysis, helping to refine investment strategies over time. +## Community & Support -- **Market Dashboard Sync**: Use Pipedream to set up a workflow where market data and analytics from the Token Metrics API are fetched periodically and pushed to a real-time dashboard built with Geckoboard. This keeps your team or clients informed with the latest crypto market trends and forecasts. +- **Pipedream Community**: For integration and workflow assistance +- **Component Issues**: Report bugs or request features via the Pipedream platform +- **Email Support**: support@tokenmetrics.com for API-related issues diff --git a/components/token_metrics/actions/get-ai-reports/get-ai-reports.mjs b/components/token_metrics/actions/get-ai-reports/get-ai-reports.mjs new file mode 100644 index 0000000000000..611d5622ee59e --- /dev/null +++ b/components/token_metrics/actions/get-ai-reports/get-ai-reports.mjs @@ -0,0 +1,68 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.AI_REPORTS; + +export default { + key: "token_metrics-get-ai-reports", + name: "Get AI Reports", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/ai-reports)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props using propDefinitions from the app + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + description: "Select Token IDs to get AI reports for. Example: `37493,3484`", + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + description: "Select token symbols to get AI reports for. Example: `APX,PAAL`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getAiReports({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved AI reports for ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-correlation/get-correlation.mjs b/components/token_metrics/actions/get-correlation/get-correlation.mjs new file mode 100644 index 0000000000000..2e4197d4c3dbe --- /dev/null +++ b/components/token_metrics/actions/get-correlation/get-correlation.mjs @@ -0,0 +1,80 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.CORRELATION; + +export default { + key: "token_metrics-get-correlation", + name: "Get Correlation", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/correlation)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + category: { + propDefinition: [ + tokenMetrics, + "category", + ], + description: "Select categories to filter results. Example: `layer-1,nft`", + }, + exchange: { + propDefinition: [ + tokenMetrics, + "exchange", + ], + description: "Select exchanges to filter results. Example: `gate,binance`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getCorrelation({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved correlation data for ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-crypto-investors/get-crypto-investors.mjs b/components/token_metrics/actions/get-crypto-investors/get-crypto-investors.mjs new file mode 100644 index 0000000000000..95646bd785da9 --- /dev/null +++ b/components/token_metrics/actions/get-crypto-investors/get-crypto-investors.mjs @@ -0,0 +1,53 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.CRYPTO_INVESTORS; + +export default { + key: "token_metrics-get-crypto-investors", + name: "Get Crypto Investors", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/crypto-investors)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getCryptoInvestors({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved ${dataLength} crypto investors${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-daily-ohlcv/get-daily-ohlcv.mjs b/components/token_metrics/actions/get-daily-ohlcv/get-daily-ohlcv.mjs new file mode 100644 index 0000000000000..638aa0edf873b --- /dev/null +++ b/components/token_metrics/actions/get-daily-ohlcv/get-daily-ohlcv.mjs @@ -0,0 +1,87 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.DAILY_OHLCV; + +export default { + key: "token_metrics-get-daily-ohlcv", + name: "Get Daily OHLCV", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/daily-ohlcv)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and screenshot + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Select crypto asset names to filter results. Example: `Bitcoin`", + }, + startDate: { + propDefinition: [ + tokenMetrics, + "startDate", + ], + description: "Start Date accepts date as a string - `YYYY-MM-DD` format. Note: The Start Date cannot be earlier than the past 30 days from the current date. Example: `2025-01-01`", + }, + endDate: { + propDefinition: [ + tokenMetrics, + "endDate", + ], + description: "End Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-01-23`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getDailyOhlcv({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved ${dataLength} daily OHLCV records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-fundamental-grades-historical/get-fundamental-grades-historical.mjs b/components/token_metrics/actions/get-fundamental-grades-historical/get-fundamental-grades-historical.mjs new file mode 100644 index 0000000000000..a7b32e6fe3e38 --- /dev/null +++ b/components/token_metrics/actions/get-fundamental-grades-historical/get-fundamental-grades-historical.mjs @@ -0,0 +1,87 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.FUNDAMENTAL_GRADES_HISTORICAL; + +export default { + key: "token_metrics-get-fundamental-grades-historical", + name: "Get Fundamental Grades Historical", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/fundamental-grade-history)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Crypto Asset Names (e.g., Bitcoin, Ethereum) to filter results. Select token names.", + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + startDate: { + propDefinition: [ + tokenMetrics, + "startDate", + ], + description: "Start Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-07-01`", + }, + endDate: { + propDefinition: [ + tokenMetrics, + "endDate", + ], + description: "End Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-07-05`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getFundamentalGradesHistorical({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved historical fundamental grades for ${dataLength} records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-fundamental-grades/get-fundamental-grades.mjs b/components/token_metrics/actions/get-fundamental-grades/get-fundamental-grades.mjs new file mode 100644 index 0000000000000..0519c28d79c88 --- /dev/null +++ b/components/token_metrics/actions/get-fundamental-grades/get-fundamental-grades.mjs @@ -0,0 +1,73 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.FUNDAMENTAL_GRADES; + +export default { + key: "token_metrics-get-fundamental-grades", + name: "Get Fundamental Grades", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/fundamental-grade)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Crypto Asset Names (e.g., Bitcoin, Ethereum) to filter results. Select token names.", + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getFundamentalGrades({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved fundamental grades for ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-hourly-ohlcv/get-hourly-ohlcv.mjs b/components/token_metrics/actions/get-hourly-ohlcv/get-hourly-ohlcv.mjs new file mode 100644 index 0000000000000..0e8240e7cba81 --- /dev/null +++ b/components/token_metrics/actions/get-hourly-ohlcv/get-hourly-ohlcv.mjs @@ -0,0 +1,87 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.HOURLY_OHLCV; + +export default { + key: "token_metrics-get-hourly-ohlcv", + name: "Get Hourly OHLCV", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/hourly-ohlcv)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and screenshot + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Select crypto asset names to filter results. Example: `Bitcoin,Ethereum`", + }, + startDate: { + propDefinition: [ + tokenMetrics, + "startDate", + ], + description: "Start Date accepts date as a string - `YYYY-MM-DD` format. Note: The Start Date cannot be earlier than the past 30 days from the current date. Example: `2025-03-01`", + }, + endDate: { + propDefinition: [ + tokenMetrics, + "endDate", + ], + description: "End Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-03-20`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getHourlyOhlcv({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved ${dataLength} hourly OHLCV records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-hourly-trading-signals/get-hourly-trading-signals.mjs b/components/token_metrics/actions/get-hourly-trading-signals/get-hourly-trading-signals.mjs new file mode 100644 index 0000000000000..3540e1153dfbd --- /dev/null +++ b/components/token_metrics/actions/get-hourly-trading-signals/get-hourly-trading-signals.mjs @@ -0,0 +1,62 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.HOURLY_TRADING_SIGNALS; + +export default { + key: "token_metrics-get-hourly-trading-signals", + name: "Get Hourly Trading Signals", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/hourly-trading-signals)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + description: "Select Token IDs to filter results", + optional: false, + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getHourlyTradingSignals({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved hourly trading signals for ${dataLength} records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-indices-holdings/get-indices-holdings.mjs b/components/token_metrics/actions/get-indices-holdings/get-indices-holdings.mjs new file mode 100644 index 0000000000000..bc7e6f2322c2e --- /dev/null +++ b/components/token_metrics/actions/get-indices-holdings/get-indices-holdings.mjs @@ -0,0 +1,44 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.INDICES_HOLDINGS; + +export default { + key: "token_metrics-get-indices-holdings", + name: "Get Indices Holdings", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/indices-holdings)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + id: { + propDefinition: [ + tokenMetrics, + "id", + ], + description: "ID of the index. Example: `1`", + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getIndicesHoldings({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved holdings for index with ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-indices-performance/get-indices-performance.mjs b/components/token_metrics/actions/get-indices-performance/get-indices-performance.mjs new file mode 100644 index 0000000000000..c77d6994780f4 --- /dev/null +++ b/components/token_metrics/actions/get-indices-performance/get-indices-performance.mjs @@ -0,0 +1,75 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.INDICES_PERFORMANCE; + +export default { + key: "token_metrics-get-indices-performance", + name: "Get Indices Performance", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/indices-performance)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + id: { + propDefinition: [ + tokenMetrics, + "id", + ], + description: "ID of the index. Example: `1`", + }, + startDate: { + propDefinition: [ + tokenMetrics, + "startDate", + ], + description: "Start Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-01-01`", + }, + endDate: { + propDefinition: [ + tokenMetrics, + "endDate", + ], + description: "End Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-06-01`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getIndicesPerformance({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved historical performance data for index with ${dataLength} data points${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-indices/get-indices.mjs b/components/token_metrics/actions/get-indices/get-indices.mjs new file mode 100644 index 0000000000000..664940f58bdd2 --- /dev/null +++ b/components/token_metrics/actions/get-indices/get-indices.mjs @@ -0,0 +1,61 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.INDICES; + +export default { + key: "token_metrics-get-indices", + name: "Get Indices", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/indices)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + indicesType: { + propDefinition: [ + tokenMetrics, + "indicesType", + ], + description: "Filter to return indices by type: 'active' for actively managed, 'passive' for passively managed", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getIndices({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved ${dataLength} crypto indices${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-market-metrics/get-market-metrics.mjs b/components/token_metrics/actions/get-market-metrics/get-market-metrics.mjs index fd525bc2b9ca8..feff32ac5c186 100644 --- a/components/token_metrics/actions/get-market-metrics/get-market-metrics.mjs +++ b/components/token_metrics/actions/get-market-metrics/get-market-metrics.mjs @@ -1,43 +1,67 @@ -import app from "../../token_metrics.app.mjs"; +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.MARKET_METRICS; export default { key: "token_metrics-get-market-metrics", name: "Get Market Metrics", - description: "Gets the market analytics from Token Metrics. [See the documentation](https://developers.tokenmetrics.com/reference/market-metrics)", - version: "0.0.1", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/market-metrics)`, + version: "0.0.2", type: "action", props: { - app, + tokenMetrics, + // Filter props based on endpoint configuration and API documentation startDate: { propDefinition: [ - app, + tokenMetrics, "startDate", ], + description: "Start Date accepts date as a string - `YYYY-MM-DD` format. Example: `2023-10-01`", }, endDate: { propDefinition: [ - app, + tokenMetrics, "endDate", ], + description: "End Date accepts date as a string - `YYYY-MM-DD` format. Example: `2023-10-10`", }, + // Pagination props limit: { propDefinition: [ - app, + tokenMetrics, "limit", ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, }, }, async run({ $ }) { - const response = await this.app.getMarketMetrics({ + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getMarketMetrics({ $, - params: { - startDate: this.startDate, - endDate: this.endDate, - limit: this.limit, - }, + params, }); - $.export("$summary", `Retrieved market metrics from ${this.startDate} to ${this.endDate}`); + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved market metrics for ${dataLength} records${filterSummary}`); return response; }, diff --git a/components/token_metrics/actions/get-moonshot-tokens/get-moonshot-tokens.mjs b/components/token_metrics/actions/get-moonshot-tokens/get-moonshot-tokens.mjs new file mode 100644 index 0000000000000..11ea5172d325f --- /dev/null +++ b/components/token_metrics/actions/get-moonshot-tokens/get-moonshot-tokens.mjs @@ -0,0 +1,61 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.MOONSHOT_TOKENS; + +export default { + key: "token_metrics-get-moonshot-tokens", + name: "Get Moonshot Tokens", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/moonshot-tokens)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and screenshot + type: { + propDefinition: [ + tokenMetrics, + "type", + ], + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getMoonshotTokens({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + const moonshotType = this.type || "active"; + $.export("$summary", `Successfully retrieved ${dataLength} ${moonshotType} moonshot tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-price/get-price.mjs b/components/token_metrics/actions/get-price/get-price.mjs new file mode 100644 index 0000000000000..6743470d961ce --- /dev/null +++ b/components/token_metrics/actions/get-price/get-price.mjs @@ -0,0 +1,57 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.PRICE; + +export default { + key: "token_metrics-get-price", + name: "Get Price", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/price)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props using propDefinitions from the app + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + description: "Select Token IDs to get prices for. Example: `3375,3306`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getPrice({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved ${dataLength} price records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-quantmetrics/get-quantmetrics.mjs b/components/token_metrics/actions/get-quantmetrics/get-quantmetrics.mjs new file mode 100644 index 0000000000000..e9a747ac4d18f --- /dev/null +++ b/components/token_metrics/actions/get-quantmetrics/get-quantmetrics.mjs @@ -0,0 +1,101 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.QUANTMETRICS; + +export default { + key: "token_metrics-get-quantmetrics", + name: "Get Quantmetrics", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/quantmetrics)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + category: { + propDefinition: [ + tokenMetrics, + "category", + ], + description: "Select categories to filter results. Example: `layer-1,nft`", + }, + exchange: { + propDefinition: [ + tokenMetrics, + "exchange", + ], + description: "Select exchanges to filter results. Example: `binance,gate`", + }, + marketCap: { + propDefinition: [ + tokenMetrics, + "marketCap", + ], + description: "Minimum MarketCap in $. Example: `1000000000`", + }, + volume: { + propDefinition: [ + tokenMetrics, + "volume", + ], + description: "Minimum 24h trading volume in $. Example: `1000000000`", + }, + fdv: { + propDefinition: [ + tokenMetrics, + "fdv", + ], + description: "Minimum fully diluted valuation in $. Example: `1000000000`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getQuantmetrics({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved quantmetrics for ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-resistance-support/get-resistance-support.mjs b/components/token_metrics/actions/get-resistance-support/get-resistance-support.mjs new file mode 100644 index 0000000000000..db0ec2d6cc924 --- /dev/null +++ b/components/token_metrics/actions/get-resistance-support/get-resistance-support.mjs @@ -0,0 +1,66 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.RESISTANCE_SUPPORT; + +export default { + key: "token_metrics-get-resistance-support", + name: "Get Resistance & Support", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/resistance-support)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getResistanceSupport({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved resistance & support data for ${dataLength} records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-scenario-analysis/get-scenario-analysis.mjs b/components/token_metrics/actions/get-scenario-analysis/get-scenario-analysis.mjs new file mode 100644 index 0000000000000..5621644a0135e --- /dev/null +++ b/components/token_metrics/actions/get-scenario-analysis/get-scenario-analysis.mjs @@ -0,0 +1,66 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.SCENARIO_ANALYSIS; + +export default { + key: "token_metrics-get-scenario-analysis", + name: "Get Scenario Analysis", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/scenario-analysis)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getScenarioAnalysis({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved scenario analysis for ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-technology-grades-historical/get-technology-grades-historical.mjs b/components/token_metrics/actions/get-technology-grades-historical/get-technology-grades-historical.mjs new file mode 100644 index 0000000000000..418c1ea50bfeb --- /dev/null +++ b/components/token_metrics/actions/get-technology-grades-historical/get-technology-grades-historical.mjs @@ -0,0 +1,87 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.TECHNOLOGY_GRADES_HISTORICAL; + +export default { + key: "token_metrics-get-technology-grades-historical", + name: "Get Technology Grades Historical", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/technology-grade-history)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Crypto Asset Names (e.g., Bitcoin, Ethereum) to filter results. Select token names.", + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + startDate: { + propDefinition: [ + tokenMetrics, + "startDate", + ], + description: "Start Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-07-01`", + }, + endDate: { + propDefinition: [ + tokenMetrics, + "endDate", + ], + description: "End Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-07-05`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getTechnologyGradesHistorical({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved historical technology grades for ${dataLength} records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-technology-grades/get-technology-grades.mjs b/components/token_metrics/actions/get-technology-grades/get-technology-grades.mjs new file mode 100644 index 0000000000000..2da867b8d65d3 --- /dev/null +++ b/components/token_metrics/actions/get-technology-grades/get-technology-grades.mjs @@ -0,0 +1,73 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.TECHNOLOGY_GRADES; + +export default { + key: "token_metrics-get-technology-grades", + name: "Get Technology Grades", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/technology-grade)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Crypto Asset Names (e.g., Bitcoin, Ethereum) to filter results. Select token names.", + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getTechnologyGrades({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved technology grades for ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-tm-grades-historical/get-tm-grades-historical.mjs b/components/token_metrics/actions/get-tm-grades-historical/get-tm-grades-historical.mjs new file mode 100644 index 0000000000000..ec6b342a1fef5 --- /dev/null +++ b/components/token_metrics/actions/get-tm-grades-historical/get-tm-grades-historical.mjs @@ -0,0 +1,87 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.TM_GRADES_HISTORICAL; + +export default { + key: "token_metrics-get-tm-grades-historical", + name: "Get TM Grades Historical", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/tm-grade-history)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Crypto Asset Names (e.g., Bitcoin, Ethereum) to filter results. Select token names.", + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + startDate: { + propDefinition: [ + tokenMetrics, + "startDate", + ], + description: "Start Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-07-01`", + }, + endDate: { + propDefinition: [ + tokenMetrics, + "endDate", + ], + description: "End Date accepts date as a string - `YYYY-MM-DD` format. Example: `2025-07-05`", + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getTmGradesHistorical({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved historical TM grades for ${dataLength} records${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-tm-grades/get-tm-grades.mjs b/components/token_metrics/actions/get-tm-grades/get-tm-grades.mjs new file mode 100644 index 0000000000000..34d0553019420 --- /dev/null +++ b/components/token_metrics/actions/get-tm-grades/get-tm-grades.mjs @@ -0,0 +1,73 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.TM_GRADES; + +export default { + key: "token_metrics-get-tm-grades", + name: "Get TM Grades", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/tm-grade)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and screenshot + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + description: "Crypto Asset Names (e.g., Bitcoin, Ethereum) to filter results. Select token names.", + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + description: "Limit the number of items in response. Defaults to 50", + default: 50, + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + min: 1, + default: 1, + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getTmGrades({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved TM grades for ${dataLength} tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-tokens/get-tokens.mjs b/components/token_metrics/actions/get-tokens/get-tokens.mjs index c7a44cd82f4ad..0ec3e626f175d 100644 --- a/components/token_metrics/actions/get-tokens/get-tokens.mjs +++ b/components/token_metrics/actions/get-tokens/get-tokens.mjs @@ -1,29 +1,84 @@ -import app from "../../token_metrics.app.mjs"; +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.TOKENS; export default { key: "token_metrics-get-tokens", name: "Get Tokens", - description: "Gets the list of coins and their associated token_id supported by Token Metrics. [See the documentation](https://developers.tokenmetrics.com/reference/tokens)", - version: "0.0.1", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/tokens)`, + version: "0.0.2", type: "action", props: { - app, + tokenMetrics, + // Dynamically add filter props based on endpoint configuration + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + tokenName: { + propDefinition: [ + tokenMetrics, + "tokenName", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + category: { + propDefinition: [ + tokenMetrics, + "category", + ], + }, + exchange: { + propDefinition: [ + tokenMetrics, + "exchange", + ], + }, + blockchainAddress: { + propDefinition: [ + tokenMetrics, + "blockchainAddress", + ], + }, + // Pagination props limit: { propDefinition: [ - app, + tokenMetrics, "limit", ], }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + }, }, async run({ $ }) { - const response = await this.app.getTokens({ + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getTokens({ $, - params: { - limit: this.limit, - }, + params, }); - $.export("$summary", "Retrieved the list of tokens successfully"); + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + $.export("$summary", `Successfully retrieved tokens list${filterSummary}`); return response; }, diff --git a/components/token_metrics/actions/get-top-market-cap-tokens/get-top-market-cap-tokens.mjs b/components/token_metrics/actions/get-top-market-cap-tokens/get-top-market-cap-tokens.mjs new file mode 100644 index 0000000000000..47f2a50336c45 --- /dev/null +++ b/components/token_metrics/actions/get-top-market-cap-tokens/get-top-market-cap-tokens.mjs @@ -0,0 +1,44 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.TOP_MARKET_CAP_TOKENS; + +export default { + key: "token_metrics-get-top-market-cap-tokens", + name: "Get Top Market Cap Tokens", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/top-market-cap-tokens)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration and API documentation + topK: { + propDefinition: [ + tokenMetrics, + "topK", + ], + description: "Specifies the number of top cryptocurrencies to retrieve, based on their market capitalization. Example: `100`", + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getTopMarketCapTokens({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + const dataLength = response.data?.length || 0; + $.export("$summary", `Successfully retrieved ${dataLength} top market cap tokens${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/actions/get-trading-signals/get-trading-signals.mjs b/components/token_metrics/actions/get-trading-signals/get-trading-signals.mjs new file mode 100644 index 0000000000000..6d29800499f81 --- /dev/null +++ b/components/token_metrics/actions/get-trading-signals/get-trading-signals.mjs @@ -0,0 +1,109 @@ +import tokenMetrics from "../../token_metrics.app.mjs"; +import { ENDPOINTS } from "../../common/constants.mjs"; +import { + buildParams, generateFilterSummary, +} from "../../common/utils.mjs"; + +const endpoint = ENDPOINTS.TRADING_SIGNALS; + +export default { + key: "token_metrics-get-trading-signals", + name: "Get Trading Signals", + description: `${endpoint.description}. [See the documentation](https://developers.tokenmetrics.com/reference/trading-signals)`, + version: "0.0.1", + type: "action", + props: { + tokenMetrics, + // Filter props based on endpoint configuration + tokenId: { + propDefinition: [ + tokenMetrics, + "tokenId", + ], + }, + startDate: { + propDefinition: [ + tokenMetrics, + "startDate", + ], + }, + endDate: { + propDefinition: [ + tokenMetrics, + "endDate", + ], + }, + symbol: { + propDefinition: [ + tokenMetrics, + "symbol", + ], + }, + category: { + propDefinition: [ + tokenMetrics, + "category", + ], + }, + exchange: { + propDefinition: [ + tokenMetrics, + "exchange", + ], + }, + marketCap: { + propDefinition: [ + tokenMetrics, + "marketCap", + ], + }, + volume: { + propDefinition: [ + tokenMetrics, + "volume", + ], + }, + fdv: { + propDefinition: [ + tokenMetrics, + "fdv", + ], + }, + signal: { + propDefinition: [ + tokenMetrics, + "signal", + ], + }, + // Pagination props + limit: { + propDefinition: [ + tokenMetrics, + "limit", + ], + }, + page: { + propDefinition: [ + tokenMetrics, + "page", + ], + }, + }, + async run({ $ }) { + // Build parameters using utility function + const params = buildParams(this, endpoint.filters); + + const response = await this.tokenMetrics.getTradingSignals({ + $, + params, + }); + + // Generate summary using utility function + const filterSummary = generateFilterSummary(this, endpoint.filters); + + // Use $ context for export + $.export("$summary", `Successfully retrieved trading signals${filterSummary}`); + + return response; + }, +}; diff --git a/components/token_metrics/common/constants.mjs b/components/token_metrics/common/constants.mjs new file mode 100644 index 0000000000000..6731e41427227 --- /dev/null +++ b/components/token_metrics/common/constants.mjs @@ -0,0 +1,368 @@ +// API endpoints configuration +export const ENDPOINTS = { + TOKENS: { + path: "/tokens", + description: "Get the list of coins and their associated TOKEN_ID supported by Token Metrics", + filters: [ + "token_id", + "token_name", + "symbol", + "category", + "exchange", + "blockchain_address", + ], + }, + TRADING_SIGNALS: { + path: "/trading-signals", + description: "Get the AI generated trading signals for long and short positions for all tokens", + filters: [ + "token_id", + "start_date", + "end_date", + "symbol", + "category", + "exchange", + "market_cap", + "volume", + "fdv", + "signal", + ], + }, + PRICE: { + path: "/price", + description: "Get token prices based on the provided token IDs", + filters: [ + "token_id", + ], + }, + HOURLY_OHLCV: { + path: "/hourly-ohlcv", + description: "Get hourly OHLCV (Open, High, Low, Close, Volume) data for tokens", + filters: [ + "token_id", + "symbol", + "token_name", + "start_date", + "end_date", + ], + }, + DAILY_OHLCV: { + path: "/daily-ohlcv", + description: "Get daily OHLCV (Open, High, Low, Close, Volume) data for tokens", + filters: [ + "token_id", + "symbol", + "token_name", + "start_date", + "end_date", + ], + }, + MOONSHOT_TOKENS: { + path: "/moonshot-tokens", + description: "Get the AI-curated token picks (Moonshots) with high breakout potential based on grades, sentiment, volume, and on-chain data to help users trade smarter and faster", + filters: [ + "type", + ], + }, + TM_GRADES: { + path: "/tm-grade", + description: "Get the latest TM Grade for a token, including trader grade change, quant grade, signals, momentum, and 24-hour percentage changes for both TM Grade and Trader Grade", + filters: [ + "token_id", + "token_name", + "symbol", + ], + }, + TM_GRADES_HISTORICAL: { + path: "/tm-grade-history", + description: "Get historical TM Grade data for a token, including trader grade change, quant grade, signals, momentum, and 24-hour percentage changes for both TM Grade and Trader Grade over time", + filters: [ + "token_id", + "token_name", + "symbol", + "start_date", + "end_date", + ], + }, + FUNDAMENTAL_GRADES: { + path: "/fundamental-grade", + description: "Get the latest Fundamental Grade insights for a token, including grade class, community score, exchange score, VC score, tokenomics score, and DeFi scanner score", + filters: [ + "token_id", + "token_name", + "symbol", + ], + }, + FUNDAMENTAL_GRADES_HISTORICAL: { + path: "/fundamental-grade-history", + description: "Get historical Fundamental Grade insights for a token, including grade class, community score, exchange score, VC score, tokenomics score, and DeFi scanner score over time", + filters: [ + "token_id", + "token_name", + "symbol", + "start_date", + "end_date", + ], + }, + TECHNOLOGY_GRADES: { + path: "/technology-grade", + description: "Get Technology Grade insights for a token, including activity score, security score, repository score, collaboration score, and DeFi scanner score", + filters: [ + "token_id", + "token_name", + "symbol", + ], + }, + TECHNOLOGY_GRADES_HISTORICAL: { + path: "/technology-grade-history", + description: "Get historical Technology Grade data for a token, including activity score, security score, repository score, collaboration score, and DeFi scanner score over time", + filters: [ + "token_id", + "token_name", + "symbol", + "start_date", + "end_date", + ], + }, + MARKET_METRICS: { + path: "/market-metrics", + description: "Get the Market Analytics from Token Metrics. They provide insight into the full Crypto Market, including the Bullish/Bearish Market indicator", + filters: [ + "start_date", + "end_date", + ], + }, + AI_REPORTS: { + path: "/ai-reports", + description: "Retrieve AI-generated reports providing comprehensive analyses of cryptocurrency tokens, including deep dives, investment analyses, and code reviews", + filters: [ + "token_id", + "symbol", + ], + }, + CRYPTO_INVESTORS: { + path: "/crypto-investors", + description: "Get the latest list of crypto investors and their scores", + filters: [], + }, + TOP_MARKET_CAP_TOKENS: { + path: "/top-market-cap-tokens", + description: "Get the list of coins for top market cap", + filters: [ + "top_k", + ], + }, + RESISTANCE_SUPPORT: { + path: "/resistance-support", + description: "Get the historical levels of resistance and support for each token", + filters: [ + "token_id", + "symbol", + ], + }, + HOURLY_TRADING_SIGNALS: { + path: "/hourly-trading-signals", + description: "Get the hourly AI generated trading signals for long and short positions for all tokens", + filters: [ + "token_id", + ], + }, + QUANTMETRICS: { + path: "/quantmetrics", + description: "Get the latest quantitative metrics for tokens. Note that Token Metrics pricing data starts on 2019-01-01 for most tokens. More historical data will be available soon", + filters: [ + "token_id", + "symbol", + "category", + "exchange", + "market_cap", + "volume", + "fdv", + ], + }, + SCENARIO_ANALYSIS: { + path: "/scenario-analysis", + description: "Get the price prediction based on different Crypto Market scenario", + filters: [ + "token_id", + "symbol", + ], + }, + CORRELATION: { + path: "/correlation", + description: "Get the Top 10 and Bottom 10 correlation of tokens with the top 100 market cap tokens", + filters: [ + "token_id", + "symbol", + "category", + "exchange", + ], + }, + INDICES: { + path: "/indices", + description: "Get active and passive crypto indices with performance and market data", + filters: [ + "indices_type", + ], + }, + INDICES_HOLDINGS: { + path: "/indices-holdings", + description: "This endpoint returns the current holdings of the given Index, along with their respective weight in %", + filters: [ + "id", + ], + }, + INDICES_PERFORMANCE: { + path: "/indices-performance", + description: "The Indices Performance endpoint provides historical performance data for a given index, including cumulative return on investment (ROI) over time. This data is useful for analyzing index trends and evaluating investment performance", + filters: [ + "id", + "start_date", + "end_date", + ], + }, +}; + +// Common filter definitions that can be reused across endpoints +export const FILTER_DEFINITIONS = { + token_id: { + type: "string", + label: "Token ID", + description: "Comma Separated Token IDs. Example: 3375,3306", + optional: true, + }, + token_name: { + type: "string", + label: "Token Name", + description: "Comma Separated Crypto Asset Names (e.g., Bitcoin, Ethereum)", + optional: true, + }, + symbol: { + type: "string", + label: "Symbol", + description: "Comma Separated Token Symbols. Example: BTC,ETH", + optional: true, + }, + category: { + type: "string", + label: "Category", + description: "Comma Separated category name. Example: yield farming,defi", + optional: true, + }, + exchange: { + type: "string", + label: "Exchange", + description: "Comma Separated exchange name. Example: binance,gate", + optional: true, + }, + blockchain_address: { + type: "string", + label: "Blockchain Address", + description: "Token addresses separated by colon. Example: binance-smart-chain:0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3", + optional: true, + }, + start_date: { + type: "string", + label: "Start Date", + description: "Start Date accepts date as a string - YYYY-MM-DD format. Example: 2023-10-01", + optional: true, + }, + end_date: { + type: "string", + label: "End Date", + description: "End Date accepts date as a string - YYYY-MM-DD format. Example: 2023-10-10", + optional: true, + }, + market_cap: { + type: "string", + label: "Market Cap", + description: "Minimum Market cap in $. Example: 100000000", + optional: true, + }, + volume: { + type: "string", + label: "Volume", + description: "Minimum 24h trading volume in $. Example: 100000000", + optional: true, + }, + fdv: { + type: "string", + label: "FDV", + description: "Minimum fully diluted valuation in $. Example: 100000000", + optional: true, + }, + signal: { + type: "string", + label: "Signal", + description: "The current signal value of the strategy. Between bullish (1), bearish (-1) or no signal (0)", + optional: true, + options: [ + { + label: "Bullish (1)", + value: "1", + }, + { + label: "No Signal (0)", + value: "0", + }, + { + label: "Bearish (-1)", + value: "-1", + }, + ], + }, + type: { + type: "string", + label: "Type", + description: "Accepts 'active' or 'past' to fetch respective moonshots. Defaults to 'active' if not provided", + optional: true, + options: [ + { + label: "Active", + value: "active", + }, + { + label: "Past", + value: "past", + }, + ], + default: "active", + }, + top_k: { + type: "integer", + label: "Top K", + description: "Specifies the number of top cryptocurrencies to retrieve, based on their market capitalization. Example: 100", + optional: true, + }, + indices_type: { + type: "string", + label: "Indices Type", + description: "Filter to return indices by type: 'active' for actively managed, 'passive' for passively managed", + optional: true, + options: [ + { + label: "Active", + value: "active", + }, + { + label: "Passive", + value: "passive", + }, + ], + }, + id: { + type: "integer", + label: "ID", + description: "ID of the index. Example: 1", + optional: false, + }, +}; + +// Common error messages +export const ERROR_MESSAGES = { + AUTHENTICATION_FAILED: "Authentication failed. Please check your API key.", + ACCESS_FORBIDDEN: "Access forbidden. Please check your API key permissions.", + RATE_LIMIT_EXCEEDED: "Rate limit exceeded. Please try again later.", + SERVER_ERROR: "Token Metrics API server error. Please try again later.", + GENERIC_ERROR: "An error occurred while making the API request", +}; diff --git a/components/token_metrics/common/utils.mjs b/components/token_metrics/common/utils.mjs new file mode 100644 index 0000000000000..a7ac023a1221d --- /dev/null +++ b/components/token_metrics/common/utils.mjs @@ -0,0 +1,60 @@ +// Build parameters object from props, filtering out undefined values +export function buildParams(props, filterKeys) { + const params = {}; + + // Add filter parameters + filterKeys.forEach((key) => { + const propKey = toCamelCase(key); + if (props[propKey]) { + // Handle arrays by joining them with commas for the API + if (Array.isArray(props[propKey])) { + params[key] = props[propKey].join(","); + } else { + params[key] = props[propKey]; + } + } + }); + + // Add pagination parameters + if (props.limit !== undefined) { + params.limit = props.limit; + } + if (props.page !== undefined) { + params.page = props.page; + } + + return params; +} + +// Convert snake_case to camelCase for prop names +export function toCamelCase(str) { + return str.replace(/_([a-z])/g, (match, letter) => letter.toUpperCase()); +} + +// Convert camelCase to snake_case for API parameters +export function toSnakeCase(str) { + return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); +} + +// Generate filter summary for execution summary +export function generateFilterSummary(props, filterKeys) { + const appliedFilters = []; + + filterKeys.forEach((key) => { + const propKey = toCamelCase(key); + const value = props[propKey]; + if (value) { + const label = key.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase()); + // Handle arrays by joining them for display + const displayValue = Array.isArray(value) + ? value.join(", ") + : value; + appliedFilters.push(`${label}: ${displayValue}`); + } + }); + + return appliedFilters.length > 0 + ? ` with filters: ${appliedFilters.join(", ")}` + : ""; +} + diff --git a/components/token_metrics/package.json b/components/token_metrics/package.json index d4419aefe9e6f..60b8d4eb1a663 100644 --- a/components/token_metrics/package.json +++ b/components/token_metrics/package.json @@ -1,11 +1,14 @@ { "name": "@pipedream/token_metrics", - "version": "0.1.0", + "version": "0.0.2", "description": "Pipedream Token Metrics Components", "main": "token_metrics.app.mjs", "keywords": [ "pipedream", - "token_metrics" + "token_metrics", + "cryptocurrency", + "blockchain", + "analytics" ], "homepage": "https://pipedream.com/apps/token_metrics", "author": "Pipedream (https://pipedream.com/)", @@ -13,6 +16,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.6.0" + "@pipedream/platform": "^3.0.3" } } diff --git a/components/token_metrics/token_metrics.app.mjs b/components/token_metrics/token_metrics.app.mjs index 7874dc5308a47..4509e8e65a4b1 100644 --- a/components/token_metrics/token_metrics.app.mjs +++ b/components/token_metrics/token_metrics.app.mjs @@ -4,64 +4,427 @@ export default { type: "app", app: "token_metrics", propDefinitions: { + limit: { + type: "integer", + label: "Limit", + description: "Limit the number of items in response", + optional: true, + default: 50, + }, + page: { + type: "integer", + label: "Page", + description: "Enables pagination and data retrieval control by skipping a specified number of items before fetching data", + optional: true, + default: 1, + }, tokenId: { - type: "string", - label: "Token ID", - description: "The ID of the token", + type: "string[]", + label: "Token IDs", + description: "Select one or more Token IDs to filter results. Example: `3375,3306`", + optional: true, + }, + symbol: { + type: "string[]", + label: "Token Symbols", + description: "Select one or more token symbols to filter results. Example: `BTC,ETH`", + optional: true, + }, + tokenName: { + type: "string[]", + label: "Token Names", + description: "Select one or more crypto asset names to filter results. Example: `Bitcoin,Ethereum`", + optional: true, + }, + category: { + type: "string[]", + label: "Categories", + description: "Select one or more categories to filter results. Example: `defi,layer-1`", + optional: true, + }, + exchange: { + type: "string[]", + label: "Exchanges", + description: "Select one or more exchanges to filter results. Example: `binance,gate`", + optional: true, }, startDate: { type: "string", label: "Start Date", - description: "Start date in the format YYYY-MM-DD", + description: "Start date in `YYYY-MM-DD` format. Example: `2023-10-01`", + optional: true, }, endDate: { type: "string", label: "End Date", - description: "End date in the format YYYY-MM-DD", + description: "End date in `YYYY-MM-DD` format. Example: `2023-10-10`", + optional: true, }, - limit: { + marketCap: { type: "string", - label: "Limit", - description: "Limit the number of items in response", + label: "Minimum Market Cap", + description: "Minimum market cap in USD. Example: `100000000`", + optional: true, + }, + volume: { + type: "string", + label: "Minimum Volume", + description: "Minimum 24h trading volume in USD. Example: `100000000`", + optional: true, + }, + fdv: { + type: "string", + label: "Minimum FDV", + description: "Minimum fully diluted valuation in USD. Example: `100000000`", + optional: true, + }, + signal: { + type: "string", + label: "Signal Type", + description: "Filter by trading signal type", + optional: true, + options: [ + { + label: "Bullish (1)", + value: "1", + }, + { + label: "No Signal (0)", + value: "0", + }, + { + label: "Bearish (-1)", + value: "-1", + }, + ], + }, + blockchainAddress: { + type: "string[]", + label: "Blockchain Addresses", + description: "Select one or more blockchain addresses to filter results. Example: `binance-smart-chain:0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3`", + optional: true, + }, + topK: { + type: "integer", + label: "Top K", + description: "Number of top cryptocurrencies to retrieve based on market capitalization. Example: `100`", + optional: true, + }, + type: { + type: "string", + label: "Type", + description: "Filter by type", optional: true, + options: [ + { + label: "Active", + value: "active", + }, + { + label: "Past", + value: "past", + }, + ], + default: "active", + }, + indicesType: { + type: "string", + label: "Indices Type", + description: "Filter indices by type: 'active' for actively managed, 'passive' for passively managed", + optional: true, + options: [ + { + label: "Active", + value: "active", + }, + { + label: "Passive", + value: "passive", + }, + ], + }, + id: { + type: "integer", + label: "ID", + description: "ID of the index. Example: `1`", + optional: false, }, }, methods: { _baseUrl() { return "https://api.tokenmetrics.com/v2"; }, - async _makeRequest(opts = {}) { - const { - $ = this, - path, - headers, - ...otherOpts - } = opts; - return axios($, { - ...otherOpts, - url: this._baseUrl() + path, - headers: { - ...headers, - "api_key": this.$auth.api_key, - }, - }); + _headers() { + return { + "x-api-key": this.$auth.api_key, + "Content-Type": "application/json", + }; }, - async getTokens(args = {}) { - return this._makeRequest({ - path: "/tokens", + async _makeRequest({ + $ = this, + path, + ...args + }) { + const config = { + url: `${this._baseUrl()}${path}`, + headers: this._headers(), ...args, - }); + }; + + return await axios($, config); }, - async getTraderGrades(args = {}) { + // Generic method for any endpoint + async makeApiCall({ + $ = this, + endpoint, + params = {}, + }) { return this._makeRequest({ - path: "/trader-grades", - ...args, + $, + path: endpoint, + method: "GET", + params, }); }, - async getMarketMetrics(args = {}) { - return this._makeRequest({ - path: "/market-metrics", - ...args, + // Specific endpoint methods (can be generated automatically) + async getTokens({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/tokens", + params, + }); + }, + async getTradingSignals({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/trading-signals", + params, + }); + }, + async getPrice({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/price", + params, + }); + }, + async getHourlyOhlcv({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/hourly-ohlcv", + params, + }); + }, + async getDailyOhlcv({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/daily-ohlcv", + params, + }); + }, + async getMoonshotTokens({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/moonshot-tokens", + params, + }); + }, + async getTmGrades({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/tm-grade", + params, + }); + }, + async getTmGradesHistorical({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/tm-grade-history", + params, + }); + }, + async getFundamentalGrades({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/fundamental-grade", + params, + }); + }, + async getFundamentalGradesHistorical({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/fundamental-grade-history", + params, + }); + }, + async getTechnologyGrades({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/technology-grade", + params, + }); + }, + async getTechnologyGradesHistorical({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/technology-grade-history", + params, + }); + }, + async getMarketMetrics({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/market-metrics", + params, + }); + }, + async getAiReports({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/ai-reports", + params, + }); + }, + async getCryptoInvestors({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/crypto-investors", + params, + }); + }, + async getTopMarketCapTokens({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/top-market-cap-tokens", + params, + }); + }, + async getResistanceSupport({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/resistance-support", + params, + }); + }, + async getHourlyTradingSignals({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/hourly-trading-signals", + params, + }); + }, + async getQuantmetrics({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/quantmetrics", + params, + }); + }, + async getScenarioAnalysis({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/scenario-analysis", + params, + }); + }, + async getCorrelation({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/correlation", + params, + }); + }, + async getIndices({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/indices", + params, + }); + }, + async getIndicesHoldings({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/indices-holdings", + params, + }); + }, + async getIndicesPerformance({ + $ = this, + params = {}, + }) { + return this.makeApiCall({ + $, + endpoint: "/indices-performance", + params, }); }, }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7845895295a9..c0be9c11415b6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14487,8 +14487,8 @@ importers: components/token_metrics: dependencies: '@pipedream/platform': - specifier: ^1.6.0 - version: 1.6.6 + specifier: ^3.0.3 + version: 3.1.0 components/tolstoy: dependencies: @@ -38891,8 +38891,6 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) - transitivePeerDependencies: - - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: