UNPKG

@mxlabs/okxnotify

Version:

OKX notification package with Feishu, Cloudflare Workers, and Gemini AI agent integration - Complete bundle

89 lines (88 loc) 6.41 kB
import { ChatGoogleGenerativeAI } from '@langchain/google-genai'; import BaseMCP from '../base'; export declare const enum CMC_MARKET_URL { COIN_PRICE = "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest", FEAR_AND_GREED_LATEST = "https://pro-api.coinmarketcap.com/v3/fear-and-greed/latest" } export declare const CMC_API_KEY = "ec27f7dd-e574-4330-88b3-90285bab341c"; export declare const CMC_COIN_PROMPT = "\n\u4F60\u662F\u4E00\u540D\u4E13\u4E1A\u7684\u52A0\u5BC6\u8D27\u5E01\u4FE1\u606F\u5206\u6790\u9AD8\u624B\u3002\u5BF9CoinMarketCap\u9875\u9762\u548C\u6570\u636E\u5F88\u719F\u6089\uFF0C\u5E2E\u6211\u505A\u5230\u6839\u636EHTML\u9875\u9762\u4FE1\u606F\uFF0C\u5206\u6790\u51FA\u5E01\u79CD\u7684\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u7ED9\u51FA\u5F53\u524D\u8FD9\u4E2ACrypto\u7684\u5E02\u573A\u60C5\u7EEA\n\n## \u9875\u9762\u4FE1\u606F\u6A21\u5757\uFF0C\u57FA\u4E8EHTML\u7684\u7ED3\u6784\u5206\u6790\n1. \u884C\u60C5\u6570\u636E\u6A21\u5757(className \u4E3A section-coin-metrics)\uFF1A\u52A0\u5BC6\u8D27\u5E01\u4EF7\u683C\u8D70\u52BF\u66F2\u7EBF\uFF0C\u8FD8\u6709\u76F8\u5173\u4EF7\u683C\u3001\u6DA8\u8DCC\u5E45\u7B49\u6570\u636E\uFF0C\u5448\u73B0\u5E02\u573A\u5B9E\u65F6\u4EA4\u6613\u52A8\u6001\u3002\u4F8B\u5982\uFF1A\u663E\u793A\u6BD4\u7279\u5E01\uFF08\u5982 \u201CUS$109,199.72\u201D \uFF09\u7B49\n2. \u5E02\u573A\u5217\u8868\u6A21\u5757(id \u4E3A section-coin-markets)\uFF1A\u4EE5\u5217\u8868\u5F62\u5F0F\u7F57\u5217\u591A\u79CD\u52A0\u5BC6\u8D27\u5E01\u540D\u79F0\u3001\u4EF7\u683C\u3001\u6DA8\u8DCC\u5E45\u7B49\u4FE1\u606F\uFF0C\u4FBF\u4E8E\u5BF9\u6BD4\u4E0D\u540C\u5E01\u79CD\u8868\u73B0\uFF0C\u4F8B\u5982\uFF1A\u201C\u6BD4\u7279\u5E01\u5E02\u573A\u201D \u90E8\u5206\n3. \u65B0\u95FB\u8D44\u8BAF\u6A21\u5757(className \u4E3A coin-Community)\uFF1A\u603B\u7ED3\u65B0\u95FB\u8D44\u8BAF\u6A21\u5757\u7684\u6807\u9898\u548C\u5185\u5BB9\uFF0C\u8F93\u51FA\u5185\u5BB9\uFF0C\u5185\u5BB9\u7684HTML className\u53EF\u4EE5\u4E3A\uFF1Aatom-text\n\n\n## \u6838\u5FC3\u4FE1\u606F\u8F93\u51FA&\u8981\u6C42\uFF1A\n1. \u57FA\u4E8E\u9875\u9762\u7684\u6570\u636E\uFF0C\u5206\u6790\u51FA\u5E01\u79CD\u7684\u8BE6\u7EC6\u4FE1\u606F\n2. \u7ED9\u51FA\u65B0\u95FB\u8D44\u8BAF\u6A21\u5757\u7684\u6807\u9898\u548C\u5185\u5BB9\uFF0C\u7ED9\u51FA\u8BE6\u7EC6\u65B0\u95FB\u5185\u5BB9\uFF0C**\u5FC5\u987B\u63D0\u4F9B**\n3. \u57FA\u4E8E\u65B0\u95FB\u8D44\u8BAF\u6A21\u5757 \u548C \u5E02\u573A\u5217\u8868\u6A21\u5757\uFF0C\u7ED9\u51FA\u5F53\u524D\u5E02\u573A\u7684\u60C5\u7EEA\n4. \u5E0C\u671B\u4F60\u63D0\u53D6\u4EE5\u4E0B\u4FE1\u606F\uFF0C\u5E76\u4EE5JSON Stringify \u7684\u6570\u636E\u683C\u5F0F\u8FD4\u56DE\n"; export declare const CMC_FEAR_AND_GREED_PROMPT = "\nWhen the value is closer to 0, the market is in Extreme Fear, \nand investors have over-sold irrationally. When the value is closer to 100, \nthe market is in Extreme Greed, indicating a likely market correction.\n\nCoinMarketCap uses the price and trading data of the most popular crypto coins,\ntogether with our unique user behaviour data to present a more accurate crypto market sentiment.\n\n## core fields\n- value: number; // Fear and Greed Index Value\n- value_classification: string; // Fear and Greed Index Value Classification\n"; export declare const CMC_COIN_FINAL_PROMPT = "\n\u4F60\u662F\u4E00\u540D\u4E13\u4E1A\u7684\u52A0\u5BC6\u8D27\u5E01\u4FE1\u606F\u5206\u6790\u9AD8\u624B\uFF0C\u6709\u5F88\u591A\u7F8E\u80A1\u5206\u6790\u7ECF\u9A8C\uFF0C\u6839\u636E\u5F53\u524D\u6570\u636E\u5DF2\u7ECF\u5BF9\u5E01\u79CD\u4FE1\u606F\u3001\u4EF7\u683C\u3001\u4EA4\u6613\u91CF\u3001\u60C5\u7EEA\u7B49\u8FDB\u884C\u4E86\u4E13\u4E1A\u5206\u6790\uFF0C\n\n## \u6838\u5FC3\u4FE1\u606F\u8F93\u51FA&\u8981\u6C42\uFF0C\u4FE1\u606F\u4E0D\u8D85\u8FC7100\u5B57\u7B26\n1. \u6839\u636Elast_updated\u5B57\u6BB5\uFF0C\u7ED9\u51FA\u4EF7\u683C\u6700\u65B0\u65F6\u95F4\uFF08UTC+8\u65F6\u95F4\uFF09\n1. \u7ED9\u51FA\u5F53\u524D\u5E01\u79CD\u7684\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u5305\u62EC\u4EF7\u683C\uFF0C\u4EA4\u6613\u91CF\uFF0C\u60C5\u7EEA\uFF0C\u6050\u614C\u6307\u6570\u7B49\n2. \u7ED3\u54081\u7684\u8F93\u51FA\uFF0C\u4EE5\u53CA\u6280\u672F\u6570\u636E\uFF0C\u7ED9\u51FA\u5F53\u4E0B\u7684\u6295\u8D44\u5EFA\u8BAE\n"; export interface CoinPriceResponse { data: { id: number; name: string; symbol: string; slug: string; num_market_pairs: number; date_added: string; max_supply: number; circulating_supply: number; total_supply: number; is_active: number; infinite_supply: boolean; platform: null; cmc_rank: number; is_fiat: number; self_reported_circulating_supply: null; self_reported_market_cap: null; tvl_ratio: null; last_updated: string; quote: { USD: { price: number; volume_24h: number; volume_change_24h: number; percent_change_1h: number; percent_change_24h: number; percent_change_7d: number; percent_change_30d: number; percent_change_60d: number; percent_change_90d: number; market_cap: number; market_cap_dominance: number; fully_diluted_market_cap: number; tvl: number | null; last_updated: string; }; }; }; } export interface CMCFearAndGreedApiResponse { data: { value: number; update_time: string; value_classification: string; }; } export declare class CoinMarketCap extends BaseMCP { protected model: ChatGoogleGenerativeAI; constructor(); getCoinPrice({ slug }: { slug: string; }): Promise<CoinPriceResponse>; /** * 获取恐慌情况 * @returns */ getFearAndGreedIndexAnalysis(): Promise<string>; getFearAndGreedIndex(): Promise<CMCFearAndGreedApiResponse['data']>; /** * Puppter 方式渲染页面,获取页面数据 * @param param0 * @param _env * @returns */ getCoinPageDetail({ slug }: { slug: string; }): Promise<string>; aggregatedCoinInfo({ slug }: { symbol?: string; slug: string; }): Promise<string>; initTools(): void; invokeMessage(userInput: string, extraArgs?: Record<string, string>): Promise<{ tool: string; result: string; }[]>; }