@elizaos/plugin-social-alpha 2.0.3-beta.5 → 2.0.3-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients.d.ts +354 -0
- package/dist/clients.d.ts.map +1 -0
- package/dist/clients.js +670 -0
- package/dist/clients.js.map +1 -0
- package/dist/config.d.ts +144 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +122 -0
- package/dist/config.js.map +1 -0
- package/dist/events.d.ts +5 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +426 -0
- package/dist/events.js.map +1 -0
- package/dist/frontend/LeaderboardView.helpers.d.ts +6 -0
- package/dist/frontend/LeaderboardView.helpers.d.ts.map +1 -0
- package/dist/frontend/LeaderboardView.helpers.js +59 -0
- package/dist/frontend/LeaderboardView.helpers.js.map +1 -0
- package/dist/frontend/SocialAlphaSpatialView.d.ts +52 -0
- package/dist/frontend/SocialAlphaSpatialView.d.ts.map +1 -0
- package/dist/frontend/SocialAlphaSpatialView.js +72 -0
- package/dist/frontend/SocialAlphaSpatialView.js.map +1 -0
- package/dist/frontend/SocialAlphaView.d.ts +35 -0
- package/dist/frontend/SocialAlphaView.d.ts.map +1 -0
- package/dist/frontend/SocialAlphaView.js +125 -0
- package/dist/frontend/SocialAlphaView.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/mockPriceService.d.ts +22 -0
- package/dist/mockPriceService.d.ts.map +1 -0
- package/dist/mockPriceService.js +21 -0
- package/dist/mockPriceService.js.map +1 -0
- package/dist/providers/socialAlphaProvider.d.ts +15 -0
- package/dist/providers/socialAlphaProvider.d.ts.map +1 -0
- package/dist/providers/socialAlphaProvider.js +261 -0
- package/dist/providers/socialAlphaProvider.js.map +1 -0
- package/dist/register-terminal-view.d.ts +15 -0
- package/dist/register-terminal-view.d.ts.map +1 -0
- package/dist/register-terminal-view.js +21 -0
- package/dist/register-terminal-view.js.map +1 -0
- package/dist/register.d.ts +10 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +5 -0
- package/dist/register.js.map +1 -0
- package/dist/reports.d.ts +57 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/reports.js +455 -0
- package/dist/reports.js.map +1 -0
- package/dist/routes.d.ts +3 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +59 -0
- package/dist/routes.js.map +1 -0
- package/dist/schemas.d.ts +151 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +258 -0
- package/dist/schemas.js.map +1 -0
- package/dist/service.d.ts +306 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +3078 -0
- package/dist/service.js.map +1 -0
- package/dist/services/balancedTrustScoreCalculator.d.ts +61 -0
- package/dist/services/balancedTrustScoreCalculator.d.ts.map +1 -0
- package/dist/services/balancedTrustScoreCalculator.js +207 -0
- package/dist/services/balancedTrustScoreCalculator.js.map +1 -0
- package/dist/services/historicalPriceService.d.ts +59 -0
- package/dist/services/historicalPriceService.d.ts.map +1 -0
- package/dist/services/historicalPriceService.js +291 -0
- package/dist/services/historicalPriceService.js.map +1 -0
- package/dist/services/index.d.ts +12 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +17 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/priceEnrichmentService.d.ts +109 -0
- package/dist/services/priceEnrichmentService.d.ts.map +1 -0
- package/dist/services/priceEnrichmentService.js +780 -0
- package/dist/services/priceEnrichmentService.js.map +1 -0
- package/dist/services/simulationActorsV2.d.ts +54 -0
- package/dist/services/simulationActorsV2.d.ts.map +1 -0
- package/dist/services/simulationActorsV2.js +362 -0
- package/dist/services/simulationActorsV2.js.map +1 -0
- package/dist/services/simulationRunner.d.ts +113 -0
- package/dist/services/simulationRunner.d.ts.map +1 -0
- package/dist/services/simulationRunner.js +771 -0
- package/dist/services/simulationRunner.js.map +1 -0
- package/dist/services/tokenSimulationService.d.ts +34 -0
- package/dist/services/tokenSimulationService.d.ts.map +1 -0
- package/dist/services/tokenSimulationService.js +297 -0
- package/dist/services/tokenSimulationService.js.map +1 -0
- package/dist/services/trustScoreOptimizer.d.ts +110 -0
- package/dist/services/trustScoreOptimizer.d.ts.map +1 -0
- package/dist/services/trustScoreOptimizer.js +635 -0
- package/dist/services/trustScoreOptimizer.js.map +1 -0
- package/dist/simulationActors.d.ts +35 -0
- package/dist/simulationActors.d.ts.map +1 -0
- package/dist/simulationActors.js +160 -0
- package/dist/simulationActors.js.map +1 -0
- package/dist/social-alpha-view-bundle.d.ts +2 -0
- package/dist/social-alpha-view-bundle.d.ts.map +1 -0
- package/dist/social-alpha-view-bundle.js +5 -0
- package/dist/social-alpha-view-bundle.js.map +1 -0
- package/dist/types.d.ts +937 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +46 -0
- package/dist/types.js.map +1 -0
- package/dist/views/brand/background/clouds_background.jpg +0 -0
- package/dist/views/brand/banners/eliza_banner.svg +20 -0
- package/dist/views/brand/banners/elizacloud_banner.svg +20 -0
- package/dist/views/brand/banners/elizaos_banner.svg +20 -0
- package/dist/views/brand/concepts/billboard_concept_1200.jpg +0 -0
- package/dist/views/brand/concepts/chibi_usb_concept_900.jpg +0 -0
- package/dist/views/brand/concepts/concept_minipc_900.jpg +0 -0
- package/dist/views/brand/concepts/concept_phone_800.jpg +0 -0
- package/dist/views/brand/concepts/concept_usbdrive_900.jpg +0 -0
- package/dist/views/brand/favicons/android-chrome-192x192.png +0 -0
- package/dist/views/brand/favicons/android-chrome-512x512.png +0 -0
- package/dist/views/brand/favicons/apple-touch-icon.png +0 -0
- package/dist/views/brand/favicons/favicon-16x16.png +0 -0
- package/dist/views/brand/favicons/favicon-32x32.png +0 -0
- package/dist/views/brand/favicons/favicon.ico +0 -0
- package/dist/views/brand/favicons/favicon.svg +17 -0
- package/dist/views/brand/logos/elizaOS_text_black.svg +3 -0
- package/dist/views/brand/logos/elizaOS_text_white.svg +3 -0
- package/dist/views/brand/logos/eliza_logotext.svg +26 -0
- package/dist/views/brand/logos/eliza_logotext_black.svg +26 -0
- package/dist/views/brand/logos/eliza_text_black.svg +3 -0
- package/dist/views/brand/logos/eliza_text_white.svg +3 -0
- package/dist/views/brand/logos/elizacloud_logotext.svg +26 -0
- package/dist/views/brand/logos/elizacloud_logotext_black.svg +26 -0
- package/dist/views/brand/logos/elizacloud_text_black.svg +3 -0
- package/dist/views/brand/logos/elizacloud_text_white.svg +3 -0
- package/dist/views/brand/logos/elizaos_logotext.svg +26 -0
- package/dist/views/brand/logos/elizaos_logotext_black.svg +26 -0
- package/dist/views/brand/logos/logo_blue_blackbg.svg +18 -0
- package/dist/views/brand/logos/logo_blue_nobg.svg +17 -0
- package/dist/views/brand/logos/logo_orange_blackbg.svg +18 -0
- package/dist/views/brand/logos/logo_orange_nobg.svg +17 -0
- package/dist/views/brand/logos/logo_white_blackbg.svg +25 -0
- package/dist/views/brand/logos/logo_white_bluebg.svg +25 -0
- package/dist/views/brand/logos/logo_white_graybg.svg +18 -0
- package/dist/views/brand/logos/logo_white_nobg.svg +24 -0
- package/dist/views/brand/logos/logo_white_orangebg.svg +25 -0
- package/dist/views/brand/ogembeds/eliza_ogembed.png +0 -0
- package/dist/views/brand/ogembeds/eliza_ogembed.svg +20 -0
- package/dist/views/brand/ogembeds/elizacloud_ogembed.png +0 -0
- package/dist/views/brand/ogembeds/elizacloud_ogembed.svg +20 -0
- package/dist/views/brand/ogembeds/elizaos_ogembed.png +0 -0
- package/dist/views/brand/ogembeds/elizaos_ogembed.svg +20 -0
- package/dist/views/bundle.js +268 -0
- package/dist/views/bundle.js.map +1 -0
- package/dist/views/site.webmanifest +19 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/clients.ts"],"sourcesContent":["import type { IAgentRuntime } from \"@elizaos/core\";\nimport BigNumber from \"bignumber.js\";\nimport * as dotenv from \"dotenv\";\nimport { BTC_ADDRESS, ETH_ADDRESS, SOL_ADDRESS } from \"./config.js\";\nimport type {\n\tDexScreenerData,\n\tDexScreenerPair,\n\tHolderData,\n\tPrices,\n\tTokenOverview,\n\tTokenSecurityData,\n\tTokenTradeData,\n\tWalletPortfolio,\n\tWalletPortfolioItem,\n} from \"./types.js\";\n\ndotenv.config();\n\n/**\n * Represents the next unique identifier for an RPC request.\n */\nlet nextRpcRequestId = 1;\n\n/**\n * Represents the valid types that can be used for query parameters in a URL.\n * It can either be a key-value pair object with string, number, boolean, null or undefined values,\n * or an instance of the URLSearchParams class.\n */\ntype QueryParams =\n\t| Record<string, string | number | boolean | null | undefined>\n\t| URLSearchParams;\n\ntype HeliusTokenAccountsParams = {\n\tlimit: number;\n\tdisplayOptions: Record<string, never>;\n\tmint: string;\n\tcursor?: string;\n};\ntype HeliusTokenAccount = {\n\towner?: string;\n\tamount?: string | number;\n};\ntype HeliusTokenAccountsResponse = {\n\tresult?: {\n\t\ttoken_accounts?: HeliusTokenAccount[];\n\t\tcursor?: string;\n\t};\n};\n\n/**\n * Interface representing retry options for a retry mechanism.\n * @typedef {Object} RetryOptions\n * @property {number} [maxRetries] - The maximum number of retries allowed.\n * @property {number} [initialDelay] - The initial delay in milliseconds before the first retry.\n * @property {number} [maxDelay] - The maximum delay in milliseconds between retries.\n * @property {number} [backoffFactor] - The factor by which the delay increases between retries.\n * @property {number[]} [retryableStatuses] - The array of HTTP status codes that are retryable.\n */\ninterface RetryOptions {\n\tmaxRetries?: number;\n\tinitialDelay?: number;\n\tmaxDelay?: number;\n\tbackoffFactor?: number;\n\tretryableStatuses?: number[];\n}\n\n/**\n * Interface for defining options that can be passed in a request.\n * @template RequestOptions\n * @property {RetryOptions} [retryOptions] - Options for retrying the request\n * @property {QueryParams} [params] - Query parameters for the request\n */\ninterface RequestOptions extends RequestInit {\n\tretryOptions?: RetryOptions;\n\tparams?: QueryParams;\n}\n\nconst DEFAULT_RETRY_OPTIONS: Required<RetryOptions> = {\n\tmaxRetries: 3,\n\tinitialDelay: 1000,\n\tmaxDelay: 30000,\n\tbackoffFactor: 2,\n\tretryableStatuses: [408, 429, 500, 502, 503, 504],\n};\n\n/**\n * Represents an error that occurred during a request.\n * @extends Error\n * @param {string} message - The error message.\n * @param {Response} [response] - The response object associated with the error.\n */\nclass RequestError extends Error {\n\t/**\n\t * Constructor for creating a RequestError instance.\n\t *\n\t * @param {string} message - The error message for the RequestError instance.\n\t * @param {Response} [response] - Optional response object associated with the error.\n\t */\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic response?: Response,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"RequestError\";\n\t}\n}\n\nconst sleep = (ms: number): Promise<void> =>\n\tnew Promise((resolve) => setTimeout(resolve, ms));\n\nconst calculateDelay = (\n\tattempt: number,\n\toptions: Required<RetryOptions>,\n): number => {\n\tconst delay = options.initialDelay * options.backoffFactor ** (attempt - 1);\n\treturn Math.min(delay, options.maxDelay);\n};\n\nconst isRetryableError = (error: unknown): boolean =>\n\t(error instanceof Error &&\n\t\t(error.name === \"TypeError\" || error.name === \"AbortError\")) ||\n\terror instanceof RequestError;\n\n/**\n * Build a URL with optional query parameters.\n *\n * @param {string} url - The base URL.\n * @param {QueryParams} [params] - Optional query parameters to be appended to the URL.\n * @return {string} The URL with query parameters appended.\n */\nconst buildUrl = (url: string, params?: QueryParams): string => {\n\tif (!params) return url;\n\n\tconst searchParams =\n\t\tparams instanceof URLSearchParams\n\t\t\t? params\n\t\t\t: new URLSearchParams(\n\t\t\t\t\tObject.entries(params)\n\t\t\t\t\t\t.filter(([_, value]) => value != null)\n\t\t\t\t\t\t.map(([key, value]) => [key, String(value)]),\n\t\t\t\t);\n\n\tconst separator = url.includes(\"?\") ? \"&\" : \"?\";\n\tconst queryString = searchParams.toString();\n\n\treturn queryString ? `${url}${separator}${queryString}` : url;\n};\n\n/**\n * HTTP utility functions for making requests and handling responses.\n * @namespace http\n */\nexport const http = {\n\tasync request(url: string, options?: RequestOptions): Promise<Response> {\n\t\tconst { params, ...fetchOptions } = options || {};\n\t\tconst fullUrl = buildUrl(url, params);\n\n\t\tconst retryOptions: Required<RetryOptions> = {\n\t\t\t...DEFAULT_RETRY_OPTIONS,\n\t\t\t...options?.retryOptions,\n\t\t};\n\n\t\tlet attempt = 1;\n\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tconst res = await fetch(fullUrl, fetchOptions);\n\n\t\t\t\tif (!res.ok) {\n\t\t\t\t\tconst errorText = await res.text();\n\t\t\t\t\tthrow new RequestError(\n\t\t\t\t\t\t`Request failed with status ${res.status}: ${errorText}`,\n\t\t\t\t\t\tres,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn res;\n\t\t\t} catch (error: unknown) {\n\t\t\t\tif (isRetryableError(error) && attempt < retryOptions.maxRetries) {\n\t\t\t\t\tconst delay = calculateDelay(attempt, retryOptions);\n\t\t\t\t\tconst errorMessage =\n\t\t\t\t\t\terror instanceof Error ? error.message : String(error);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`Request failed with error: ${errorMessage}. ` +\n\t\t\t\t\t\t\t`Retrying in ${delay}ms (attempt ${attempt}/${retryOptions.maxRetries})`,\n\t\t\t\t\t);\n\t\t\t\t\tawait sleep(delay);\n\t\t\t\t\tattempt++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconsole.error(`Request failed after ${attempt} attempts:`, error);\n\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t},\n\n\tasync json<T = unknown>(url: string, options?: RequestOptions) {\n\t\tconst res = await this.request(url, {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t...options?.headers,\n\t\t\t},\n\t\t});\n\t\treturn (await res.json()) as T;\n\t},\n\n\tget: {\n\t\tasync request(url: string, params?: QueryParams, options?: RequestInit) {\n\t\t\treturn http.request(url, {\n\t\t\t\t...options,\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tparams,\n\t\t\t});\n\t\t},\n\t\tasync json<T = unknown>(\n\t\t\turl: string,\n\t\t\tparams?: QueryParams,\n\t\t\toptions?: RequestInit,\n\t\t) {\n\t\t\treturn http.json<T>(url, {\n\t\t\t\t...options,\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tparams,\n\t\t\t});\n\t\t},\n\t},\n\n\tpost: {\n\t\tasync request(url: string, body: object, options?: RequestOptions) {\n\t\t\treturn http.request(url, {\n\t\t\t\t...options,\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: JSON.stringify(body),\n\t\t\t});\n\t\t},\n\n\t\tasync json<ReturnType = unknown, Body extends object = object>(\n\t\t\turl: string,\n\t\t\tbody: Body,\n\t\t\toptions?: RequestOptions,\n\t\t) {\n\t\t\treturn http.json<ReturnType>(url, {\n\t\t\t\t...options,\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: JSON.stringify(body),\n\t\t\t});\n\t\t},\n\t},\n\n\tasync jsonrpc<_ReturnType = unknown, Params extends object = object>(\n\t\turl: string,\n\t\tmethod: string,\n\t\tparams: Params,\n\t\theaders?: HeadersInit,\n\t) {\n\t\treturn http.post.json<_ReturnType>(\n\t\t\turl,\n\t\t\t{\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: nextRpcRequestId++,\n\t\t\t\tmethod,\n\t\t\t\tparams,\n\t\t\t},\n\t\t\t{ headers },\n\t\t);\n\t},\n\n\tasync graphql<_ReturnType = unknown, Variables extends object = object>(\n\t\turl: string,\n\t\tquery: string,\n\t\tvariables: Variables,\n\t\theaders?: HeadersInit,\n\t) {\n\t\treturn http.post.json<_ReturnType>(\n\t\t\turl,\n\t\t\t{\n\t\t\t\tquery,\n\t\t\t\tvariables,\n\t\t\t},\n\t\t\t{ headers },\n\t\t);\n\t},\n};\n\n/**\n * Options for Dexscreener.\n * @typedef {Object} DexscreenerOptions\n * @property {string|CacheOptions[\"expires\"]} [expires] - The expiration time for the cache.\n */\ntype DexscreenerOptions = {\n\texpires?: string;\n};\n\n/**\n * Client for interacting with DexScreener API.\n */\n\nexport class DexscreenerClient {\n\t/**\n\t * Constructor for the class.\n\t * @param {IAgentRuntime} runtime - The runtime passed as a parameter to the constructor.\n\t */\n\tconstructor(private runtime: IAgentRuntime) {}\n\n\t/**\n\t * Create a new DexscreenerClient instance using the provided agent runtime.\n\t *\n\t * @param {IAgentRuntime} runtime - The agent runtime to use for creating the DexscreenerClient instance.\n\t * @returns {DexscreenerClient} A new instance of DexscreenerClient.\n\t */\n\tstatic createFromRuntime(runtime: IAgentRuntime) {\n\t\treturn new DexscreenerClient(runtime);\n\t}\n\n\t/**\n\t * Makes an asynchronous HTTP request to the DexScreener API.\n\t *\n\t * @template T - The type of data expected to be returned\n\t * @param {string} path - The endpoint path for the API request\n\t * @param {QueryParams} [params] - Optional query parameters for the request\n\t * @param {DexscreenerOptions} [options] - Optional options for the request\n\t * @returns {Promise<T>} - A promise that resolves with the data returned from the API\n\t */\n\tasync request<T = unknown>(\n\t\tpath: string,\n\t\tparams?: QueryParams,\n\t\toptions?: DexscreenerOptions,\n\t) {\n\t\tconst cacheKey = [\n\t\t\t\"dexscreener\",\n\t\t\tbuildUrl(path, params), // remove first \"/\"\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(\"/\");\n\n\t\tif (options?.expires) {\n\t\t\tconst cached = await this.runtime.getCache<T>(cacheKey);\n\t\t\tif (cached) return cached;\n\t\t}\n\n\t\tconst res = await http.get.json<T>(\n\t\t\t`https://api.dexscreener.com/${path}`,\n\t\t\tparams,\n\t\t);\n\n\t\tif (options?.expires) {\n\t\t\tawait this.runtime.setCache<T>(cacheKey, res);\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/**\n\t * Asynchronously searches for DexScreener data based on the provided address.\n\t *\n\t * @param {string} address - The address to search for in DexScreener data.\n\t * @param {DexscreenerOptions} [options] - Optional parameters for the request.\n\t * @returns {Promise<DexScreenerData>} A promise that resolves with the DexScreener data.\n\t */\n\tasync search(\n\t\taddress: string,\n\t\toptions?: DexscreenerOptions,\n\t): Promise<DexScreenerData> {\n\t\ttry {\n\t\t\tconst data = await this.request<DexScreenerData>(\n\t\t\t\t\"latest/dex/search\",\n\t\t\t\t{\n\t\t\t\t\tq: address,\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tif (!data?.pairs) {\n\t\t\t\tthrow new Error(\"No DexScreener data available\");\n\t\t\t}\n\n\t\t\treturn data;\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Error fetching DexScreener data:\", error);\n\t\t\treturn {\n\t\t\t\tschemaVersion: \"1.0.0\",\n\t\t\t\tpairs: [],\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Asynchronously searches for the pair with the highest liquidity based on the given address.\n\t *\n\t * @param {string} address The address to search for liquidity pairs from.\n\t * @param {string} [chain] The chain ID to filter the liquidity pairs by.\n\t * @param {DexscreenerOptions} [options] Additional options for searching.\n\t * @returns {Promise<DexScreenerPair | null>} The pair with the highest liquidity, or null if no pairs were found.\n\t */\n\tasync searchForHighestLiquidityPair(\n\t\taddress: string,\n\t\tchain?: string,\n\t\toptions?: DexscreenerOptions,\n\t): Promise<DexScreenerPair | null> {\n\t\tlet { pairs } = await this.search(address, options);\n\n\t\tif (pairs.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (chain) {\n\t\t\tpairs = pairs.filter((pair) => pair.chainId === chain);\n\t\t}\n\n\t\t// Sort pairs by both liquidity and market cap to get the highest one\n\t\treturn pairs.sort((a, b) => {\n\t\t\tconst liquidityA = a.liquidity?.usd ?? 0;\n\t\t\tconst liquidityB = b.liquidity?.usd ?? 0;\n\t\t\treturn liquidityB < liquidityA ? -1 : 1;\n\t\t})[0];\n\t}\n}\n\n/**\n * Represents a client for interacting with the Helius API.\n */\nexport class HeliusClient {\n\tprivate runtime: IAgentRuntime;\n\n\t/**\n\t * Constructor for initializing an instance of class.\n\t *\n\t * @param apiKey - The API key to be used for authentication.\n\t * @param _runtime - The runtime environment for the agent.\n\t */\n\tconstructor(\n\t\tprivate readonly apiKey: string,\n\t\truntime: IAgentRuntime,\n\t) {\n\t\tthis.runtime = runtime;\n\t}\n\n\t/**\n\t * Creates a new HeliusClient instance using the provided IAgentRuntime.\n\t *\n\t * @param {IAgentRuntime} runtime - The IAgentRuntime to use for creating the HeliusClient.\n\t * @returns {HeliusClient} A new instance of HeliusClient.\n\t * @throws {Error} Thrown if HELIUS_API_KEY is missing from the runtime settings.\n\t */\n\tstatic createFromRuntime(runtime: IAgentRuntime) {\n\t\tconst apiKey = runtime.getSetting(\"HELIUS_API_KEY\");\n\n\t\tif (!apiKey) {\n\t\t\tthrow new Error(\"missing HELIUS_API_KEY\");\n\t\t}\n\n\t\treturn new HeliusClient(String(apiKey), runtime);\n\t}\n\n\t/**\n\t * Fetches the list of token holders for a given address asynchronously.\n\t * If the option `expires` is provided and there is a cached version available, it returns the cached data.\n\t * Otherwise, it fetches the data from the Helius API using the provided address.\n\t *\n\t * @param {string} address - The address for which to fetch the list of token holders.\n\t * @param {Object} [options] - Optional parameters.\n\t * @param {string | CacheOptions[\"expires\"]} [options.expires] - The expiration date for caching the data.\n\t *\n\t * @returns {Promise<HolderData[]>} A promise that resolves to an array of HolderData objects representing the token holders.\n\t */\n\tasync fetchHolderList(\n\t\taddress: string,\n\t\toptions?: { expires?: string },\n\t): Promise<HolderData[]> {\n\t\tif (options?.expires) {\n\t\t\tconst cached = await this.runtime.getCache<HolderData[]>(\n\t\t\t\t`helius/token-holders/${address}`,\n\t\t\t);\n\t\t\tif (cached) return cached;\n\t\t}\n\n\t\tconst allHoldersMap = new Map<string, number>();\n\t\tlet page = 1;\n\t\tconst limit = 1000;\n\t\tlet cursor: string | undefined;\n\t\tconst url = `https://mainnet.helius-rpc.com/?api-key=${this.apiKey}`;\n\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst params: HeliusTokenAccountsParams = {\n\t\t\t\t\tlimit: limit,\n\t\t\t\t\tdisplayOptions: {},\n\t\t\t\t\tmint: address,\n\t\t\t\t};\n\t\t\t\tif (cursor) {\n\t\t\t\t\tparams.cursor = cursor;\n\t\t\t\t}\n\t\t\t\tif (page > 2) break;\n\n\t\t\t\tconst data = await http.jsonrpc<\n\t\t\t\t\tHeliusTokenAccountsResponse,\n\t\t\t\t\tHeliusTokenAccountsParams\n\t\t\t\t>(url, \"getTokenAccounts\", params);\n\n\t\t\t\tif (!data?.result?.token_accounts?.length) break;\n\n\t\t\t\tdata.result.token_accounts.forEach((account) => {\n\t\t\t\t\tconst owner = account.owner;\n\t\t\t\t\tconst balance = Number.parseFloat(String(account.amount ?? 0));\n\t\t\t\t\tif (owner && Number.isFinite(balance)) {\n\t\t\t\t\t\tallHoldersMap.set(owner, (allHoldersMap.get(owner) || 0) + balance);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tcursor = data.result.cursor;\n\t\t\t\tpage++;\n\t\t\t}\n\n\t\t\tconst holders: HolderData[] = Array.from(allHoldersMap.entries()).map(\n\t\t\t\t([address, balance]) => ({\n\t\t\t\t\taddress,\n\t\t\t\t\tbalance: balance.toString(),\n\t\t\t\t}),\n\t\t\t);\n\t\t\tif (options?.expires)\n\t\t\t\tawait this.runtime.setCache<HolderData[]>(\n\t\t\t\t\t`helius/token-holders/${address}`,\n\t\t\t\t\tholders,\n\t\t\t\t);\n\n\t\t\treturn holders;\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Error fetching holder list from Helius:\", error);\n\t\t\tthrow new Error(\"Failed to fetch holder list from Helius.\");\n\t\t}\n\t}\n}\n\n/**\n * Options for Coingecko API.\n * @typedef {Object} CoingeckoOptions\n * @property {string | CacheOptions[\"expires\"]} [expires] - The expiration date for the cache.\n */\ntype CoingeckoOptions = {\n\texpires?: string;\n};\n\n/**\n * CoingeckoClient class for interacting with the Coingecko API.\n * @constructor\n * @param { string } apiKey - The API key required for accessing the Coingecko API.\n * @param { IAgentRuntime } runtime - The IAgentRuntime object for accessing runtime settings.\n */\nexport class CoingeckoClient {\n\t/**\n\t * Constructor for initializing a new instance of the class.\n\t * @param apiKey The API key used for authentication.\n\t * @param runtime The agent runtime implementation.\n\t */\n\tconstructor(\n\t\tprivate readonly apiKey: string,\n\t\tprivate readonly runtime: IAgentRuntime,\n\t) {}\n\n\t/**\n\t * Creates a new instance of CoingeckoClient using the apiKey retrieved from the provided runtime.\n\t * @param {IAgentRuntime} runtime - The runtime object that contains the COINGECKO_API_KEY setting.\n\t * @throws {Error} If COINGECKO_API_KEY setting is missing in the runtime object.\n\t * @returns {CoingeckoClient} A new instance of CoingeckoClient initialized with the apiKey and runtime.\n\t */\n\tstatic createFromRuntime(runtime: IAgentRuntime) {\n\t\tconst apiKey = runtime.getSetting(\"COINGECKO_API_KEY\");\n\n\t\tif (!apiKey) {\n\t\t\tthrow new Error(\"missing COINGECKO_API_KEY\");\n\t\t}\n\n\t\treturn new CoingeckoClient(String(apiKey), runtime);\n\t}\n\n\t/**\n\t * Makes an asynchronous HTTP request to the Coingecko API.\n\t * @template T\n\t * @param {string} path - The API endpoint to call.\n\t * @param {QueryParams} [params] - Optional query parameters to include in the request.\n\t * @param {CoingeckoOptions} [options] - Additional options for the request.\n\t * @returns {Promise<T>} The response data from the API.\n\t */\n\tasync request<T = unknown>(\n\t\tpath: string,\n\t\tparams?: QueryParams,\n\t\toptions?: CoingeckoOptions,\n\t) {\n\t\tconst cacheKey = [\"coingecko\", buildUrl(path, params)]\n\t\t\t.filter(Boolean)\n\t\t\t.join(\"/\");\n\n\t\tif (options?.expires) {\n\t\t\tconst cached = await this.runtime.getCache<T>(cacheKey);\n\t\t\tif (cached) return cached;\n\t\t}\n\n\t\tconst res = await http.get.json<T>(\n\t\t\t`https://api.coingecko.com/api/v3/${path}`,\n\t\t\tparams,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t\"x-cg-demo-api-key\": this.apiKey,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\n\t\tif (options?.expires) {\n\t\t\tawait this.runtime.setCache<T>(cacheKey, res);\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/**\n\t * Fetches prices for specified cryptocurrencies from the Coingecko API.\n\t *\n\t * @param {CoingeckoOptions} [options] The options for the Coingecko API request.\n\t * @returns {Promise<Prices>} A Promise that resolves to the prices of the specified cryptocurrencies.\n\t */\n\tasync fetchPrices(options?: CoingeckoOptions): Promise<Prices> {\n\t\tconst prices = await this.request<Prices>(\n\t\t\t\"simple/price\",\n\t\t\t{\n\t\t\t\tids: \"solana,bitcoin,ethereum\",\n\t\t\t\tvs_currencies: \"usd\",\n\t\t\t},\n\t\t\toptions,\n\t\t);\n\n\t\treturn prices;\n\t}\n\n\t/**\n\t * Asynchronously fetches global data.\n\t *\n\t * @returns {Promise} The promise containing the global data.\n\t */\n\tasync fetchGlobal() {\n\t\treturn this.request(\n\t\t\t\"global\",\n\t\t\t{},\n\t\t\t{\n\t\t\t\texpires: \"30m\",\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * Asynchronously fetches a list of coin categories.\n\t * @returns {Promise} The Promise object representing the result of the fetch operation.\n\t */\n\tasync fetchCategories() {\n\t\treturn this.request(\n\t\t\t\"coins/categories\",\n\t\t\t{},\n\t\t\t{\n\t\t\t\texpires: \"30m\",\n\t\t\t},\n\t\t);\n\t}\n}\n\n/**\n * Represents an item in a wallet token list with details such as address, name, symbol, decimals, balance, UI amount, chain ID, logo URI, price in USD, and value in USD.\n * @typedef {Object} WalletTokenListItem\n * @property {string} address - The address of the token\n * @property {string} name - The name of the token\n * @property {string} symbol - The symbol of the token\n * @property {number} decimals - The decimals of the token\n * @property {number} balance - The balance of the token\n * @property {number} uiAmount - The UI amount of the token\n * @property {string} chainId - The chain ID of the token\n * @property {string} logoURI - The logo URI of the token\n * @property {number} priceUsd - The price of the token in USD\n * @property {number} valueUsd - The value of the token in USD\n */\ntype WalletTokenListItem = {\n\taddress: string;\n\tname: string;\n\tsymbol: string;\n\tdecimals: number;\n\tbalance: number;\n\tuiAmount: number;\n\tchainId: string;\n\tlogoURI: string;\n\tpriceUsd: number;\n\tvalueUsd: number;\n};\n\n/**\n * Defines the structure of a WalletTokenList object, which includes the wallet name, total USD balance,\n * and an array of WalletTokenListItem objects.\n */\ntype WalletTokenList = {\n\twallet: string;\n\ttotalUsd: number;\n\titems: WalletTokenListItem[];\n};\n\n/**\n * Represents a type that can either be \"solana\" or \"ethereum\" for the BirdeyeXChain.\n */\ntype BirdeyeXChain = \"solana\" | \"ethereum\";\n\n/**\n * Type representing headers for BirdeyeClient.\n * @typedef {Object} BirdeyeClientHeaders\n * @property {BirdeyeXChain} [\"x-chain\"] - Optional header for BirdeyeXChain.\n */\ntype BirdeyeClientHeaders = {\n\t\"x-chain\"?: BirdeyeXChain;\n};\n\n/**\n * Options for making a Birdeye API request.\n * @typedef {Object} BirdeyeRequestOptions\n * @property {BirdeyeXChain} [chain] - The BirdeyeX chain.\n * @property {string | CacheOptions[\"expires\"]} [expires] - The expiration date for the request.\n */\n\ntype BirdeyeRequestOptions = {\n\tchain?: BirdeyeXChain;\n\texpires?: string;\n};\n\n/**\n * Class representing a client for interacting with the BirdEye API.\n */\n\nexport class BirdeyeClient {\n\tstatic readonly url = \"https://public-api.birdeye.so/\";\n\tprivate runtime: IAgentRuntime;\n\n\t/**\n\t * Send a request to the Birdeye API using the provided API key, path, query parameters, and headers.\n\t *\n\t * @param {string} apiKey - The API key for authenticating the request.\n\t * @param {string} path - The endpoint path to send the request to.\n\t * @param {QueryParams} [params] - Optional query parameters to include in the request.\n\t * @param {BirdeyeClientHeaders} [headers] - Optional additional headers to include in the request.\n\t * @returns {Promise<T>} A Promise that resolves with the data received from the API request.\n\t */\n\tstatic async request<T = unknown>(\n\t\tapiKey: string,\n\t\tpath: string,\n\t\tparams?: QueryParams,\n\t\theaders?: BirdeyeClientHeaders,\n\t): Promise<T> {\n\t\tconst res = await http.get.json<{ success: boolean; data?: T }>(\n\t\t\tBirdeyeClient.url + path,\n\t\t\tparams,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t...headers,\n\t\t\t\t\t\"X-API-KEY\": apiKey,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\n\t\tif (!res.success || !res.data) {\n\t\t\tconsole.error({ res });\n\t\t\tthrow new Error(`Birdeye request failed:${path}`);\n\t\t}\n\n\t\treturn res.data;\n\t}\n\n\t/**\n\t * Constructor for initializing a new instance.\n\t *\n\t * @param apiKey The API key to be used.\n\t * @param runtime The agent runtime for handling communication with the runtime environment.\n\t */\n\tconstructor(\n\t\tprivate readonly apiKey: string,\n\t\truntime: IAgentRuntime,\n\t) {\n\t\tthis.runtime = runtime;\n\t}\n\n\t/**\n\t * Create a new BirdeyeClient instance using the provided IAgentRuntime object.\n\t *\n\t * @param {IAgentRuntime} runtime - The IAgentRuntime object that provides access to runtime settings.\n\t * @returns {BirdeyeClient} A new instance of BirdeyeClient initialized with the provided API key and runtime.\n\t * @throws {Error} Thrown if the BIRDEYE_API_KEY setting is missing in the runtime object.\n\t */\n\tstatic createFromRuntime(runtime: IAgentRuntime) {\n\t\tconst apiKey = runtime.getSetting(\"BIRDEYE_API_KEY\");\n\n\t\tif (!apiKey) {\n\t\t\tthrow new Error(\"missing BIRDEYE_API_KEY\");\n\t\t}\n\n\t\treturn new BirdeyeClient(String(apiKey), runtime);\n\t}\n\n\t/**\n\t * Performs a request to the specified path with given query parameters and options.\n\t * @template T\n\t * @param {string} path - The path to request.\n\t * @param {QueryParams} params - The query parameters to include in the request.\n\t * @param {BirdeyeRequestOptions} [options] - Optional request options.\n\t * @param {boolean} [forceRefresh] - Flag to force refresh the cache.\n\t * @returns {Promise<T>} The response data from the request.\n\t */\n\tasync request<T = unknown>(\n\t\tpath: string,\n\t\tparams: QueryParams,\n\t\toptions?: BirdeyeRequestOptions,\n\t\tforceRefresh?: boolean,\n\t) {\n\t\tconst cacheKey = [\"birdeye\", options?.chain, buildUrl(path, params)]\n\t\t\t.filter(Boolean)\n\t\t\t.join(\"/\");\n\n\t\tif (options?.expires && !forceRefresh) {\n\t\t\tconst cached = await this.runtime.getCache<T>(cacheKey);\n\t\t\tif (cached) return cached;\n\t\t}\n\n\t\tconst response = await BirdeyeClient.request<T>(\n\t\t\tthis.apiKey,\n\t\t\tpath,\n\t\t\tparams,\n\t\t\toptions?.chain\n\t\t\t\t? {\n\t\t\t\t\t\t\"x-chain\": options.chain,\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t);\n\n\t\tif (options?.expires) {\n\t\t\tawait this.runtime.setCache<T>(cacheKey, response);\n\t\t}\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Fetches the price for a given address.\n\t *\n\t * @param {string} address - The address for which to fetch the price.\n\t * @param {BirdeyeRequestOptions} [options] - The options for the Birdeye request.\n\t * @returns {Promise<number>} The price value fetched for the given address.\n\t */\n\tasync fetchPrice(\n\t\taddress: string,\n\t\toptions?: BirdeyeRequestOptions,\n\t): Promise<number> {\n\t\tconst price = await this.request<{ value: number }>(\n\t\t\t\"defi/price\",\n\t\t\t{ address },\n\t\t\toptions,\n\t\t);\n\n\t\treturn price.value;\n\t}\n\n\t/**\n\t * Fetches the latest prices for Bitcoin, Ethereum, and Solana in USD from the DeFi API.\n\t * @returns {Promise<Prices>} The latest prices for Bitcoin, Ethereum, and Solana in USD.\n\t */\n\tasync fetchPrices(): Promise<Prices> {\n\t\tconst prices = await this.request<Record<string, { value: number }>>(\n\t\t\t\"defi/multi_price\",\n\t\t\t{ list_address: [SOL_ADDRESS, ETH_ADDRESS, BTC_ADDRESS].join(\",\") },\n\t\t\t{\n\t\t\t\tchain: \"solana\",\n\t\t\t\texpires: \"5m\",\n\t\t\t},\n\t\t);\n\n\t\treturn {\n\t\t\tbitcoin: { usd: prices[BTC_ADDRESS].value.toString() },\n\t\t\tethereum: { usd: prices[ETH_ADDRESS].value.toString() },\n\t\t\tsolana: { usd: prices[SOL_ADDRESS].value.toString() },\n\t\t};\n\t}\n\n\t/**\n\t * Fetches token overview for a specific address.\n\t *\n\t * @param {string} address The address of the token for which overview is to be fetched.\n\t * @param {BirdeyeRequestOptions} [options] Additional options for the Birdeye request.\n\t * @param {boolean} [forceRefresh=false] Flag to force refresh the data.\n\t * @returns {Promise<TokenOverview>} Promise that resolves to the token overview.\n\t */\n\tasync fetchTokenOverview(\n\t\taddress: string,\n\t\toptions?: BirdeyeRequestOptions,\n\t\tforceRefresh = false,\n\t): Promise<TokenOverview> {\n\t\tconst token = await this.request<TokenOverview>(\n\t\t\t\"defi/token_overview\",\n\t\t\t{ address },\n\t\t\toptions,\n\t\t\tforceRefresh,\n\t\t);\n\n\t\treturn token;\n\t}\n\n\t/**\n\t * Fetches token security data from the API for a given address.\n\t * @param {string} address - The address of the token for which to fetch security data.\n\t * @param {BirdeyeRequestOptions} [options] - Optional request options.\n\t * @returns {Promise<TokenSecurityData>} A promise that resolves with the token security data.\n\t */\n\tasync fetchTokenSecurity(\n\t\taddress: string,\n\t\toptions?: BirdeyeRequestOptions,\n\t): Promise<TokenSecurityData> {\n\t\tconst security = await this.request<TokenSecurityData>(\n\t\t\t\"defi/token_security\",\n\t\t\t{ address },\n\t\t\toptions,\n\t\t);\n\n\t\treturn security;\n\t}\n\n\t/**\n\t * Fetches token trade data for a specific address.\n\t * @param {string} address - The address of the token.\n\t * @param {BirdeyeRequestOptions} [options] - Optional request options.\n\t * @returns {Promise<TokenTradeData>} - A promise that resolves with the token trade data.\n\t */\n\tasync fetchTokenTradeData(\n\t\taddress: string,\n\t\toptions?: BirdeyeRequestOptions,\n\t): Promise<TokenTradeData> {\n\t\tconst tradeData = await this.request<TokenTradeData>(\n\t\t\t\"defi/v3/token/trade-data/single\",\n\t\t\t{ address },\n\t\t\toptions,\n\t\t);\n\n\t\treturn tradeData;\n\t}\n\n\t/**\n\t * Fetches the wallet token list for a given address.\n\t *\n\t * @param {string} address - The address of the wallet to fetch the token list for.\n\t * @param {BirdeyeRequestOptions} [options] - Additional options for the request.\n\t * @returns {Promise<WalletTokenList>} The wallet token list for the specified address.\n\t */\n\tasync fetchWalletTokenList(address: string, options?: BirdeyeRequestOptions) {\n\t\tconst tokenList = await this.request<WalletTokenList>(\n\t\t\t\"v1/wallet/token_list\",\n\t\t\t{ wallet: address },\n\t\t\toptions,\n\t\t);\n\n\t\treturn tokenList;\n\t}\n\n\t/**\n\t * Asynchronously fetches the portfolio value for a given address.\n\t *\n\t * @param {string} address - The address for which to fetch the portfolio value.\n\t * @param {BirdeyeRequestOptions} [options] - The optional request options.\n\t * @returns {Promise<WalletPortfolio>} - A promise that resolves to the wallet portfolio object containing total USD, total SOL, and portfolio items.\n\t * @throws {Error} - If an error occurs while fetching the portfolio value.\n\t */\n\tasync fetchPortfolioValue(\n\t\taddress: string,\n\t\toptions?: BirdeyeRequestOptions,\n\t): Promise<WalletPortfolio> {\n\t\ttry {\n\t\t\tconst portfolio: WalletPortfolio = {\n\t\t\t\ttotalUsd: \"0\",\n\t\t\t\ttotalSol: \"0\",\n\t\t\t\titems: [],\n\t\t\t};\n\n\t\t\tconst tokenList = await this.fetchWalletTokenList(address, options);\n\n\t\t\tconst totalUsd = new BigNumber(tokenList.totalUsd.toString());\n\n\t\t\tconst solPriceInUSD = new BigNumber(await this.fetchPrice(SOL_ADDRESS));\n\n\t\t\tconst items: WalletPortfolioItem[] = tokenList.items.map((item) => ({\n\t\t\t\taddress: item.address,\n\t\t\t\tname: item.name || \"Unknown\",\n\t\t\t\tsymbol: item.symbol || \"Unknown\",\n\t\t\t\tdecimals: item.decimals,\n\t\t\t\tvalueSol: new BigNumber(item.valueUsd || 0)\n\t\t\t\t\t.div(solPriceInUSD)\n\t\t\t\t\t.toFixed(6),\n\t\t\t\tpriceUsd: item.priceUsd?.toString() || \"0\",\n\t\t\t\tvalueUsd: item.valueUsd?.toString() || \"0\",\n\t\t\t\tuiAmount: item.uiAmount?.toString() || \"0\",\n\t\t\t\tbalance: item.balance?.toString() || \"0\",\n\t\t\t}));\n\n\t\t\tconst totalSol = totalUsd.div(solPriceInUSD);\n\t\t\tportfolio.totalUsd = totalUsd.toString();\n\t\t\tportfolio.totalSol = totalSol.toFixed(6);\n\t\t\tportfolio.items = items.sort((a, b) =>\n\t\t\t\tnew BigNumber(b.valueUsd).minus(new BigNumber(a.valueUsd)).toNumber(),\n\t\t\t);\n\n\t\t\treturn portfolio;\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Error fetching portfolio:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nconst units: { [key: string]: number } = {\n\tms: 1,\n\ts: 1000,\n\tm: 60 * 1000,\n\th: 60 * 60 * 1000,\n\td: 24 * 60 * 60 * 1000,\n};\n\n/**\n * Parses a time string to milliseconds.\n * @param {string} timeStr - The time string to parse (e.g. '5ms', '10s').\n * @returns {number} The time string parsed to milliseconds, or 0 if the string cannot be parsed.\n */\nfunction parseTimeToMs(timeStr: string) {\n\tconst match = timeStr.match(/^(\\d+)([a-z]+)$/i);\n\tif (!match) return 0;\n\n\tconst [_, value, unit] = match;\n\treturn units[unit.toLowerCase()] * Number.parseInt(value, 10);\n}\n\n/**\n * Parses the expiration time to milliseconds.\n *\n * @param {string | number} expires - The expiration time to be parsed.\n * @returns {number} The expiration time in milliseconds.\n */\nfunction _parseExpires(expires: string | number) {\n\treturn typeof expires === \"string\" ? parseTimeToMs(expires) : expires;\n}\n"],"mappings":"AACA,OAAO,eAAe;AACtB,YAAY,YAAY;AACxB,SAAS,aAAa,aAAa,mBAAmB;AAatD,OAAO,OAAO;AAKd,IAAI,mBAAmB;AAwDvB,MAAM,wBAAgD;AAAA,EACrD,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,UAAU;AAAA,EACV,eAAe;AAAA,EACf,mBAAmB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AACjD;AAQA,MAAM,qBAAqB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,YACC,SACO,UACN;AACD,UAAM,OAAO;AAFN;AAGP,SAAK,OAAO;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|
+
/**
|
|
2
|
+
* Configuration for the Community Trader Plugin
|
|
3
|
+
*
|
|
4
|
+
* This file centralizes all configuration options for the trading system.
|
|
5
|
+
*/
|
|
6
|
+
import type { UUID } from "./types";
|
|
7
|
+
/**
|
|
8
|
+
* Buy amount configuration
|
|
9
|
+
*/
|
|
10
|
+
export interface BuyAmountConfig {
|
|
11
|
+
baseAmount: number;
|
|
12
|
+
minAmount: number;
|
|
13
|
+
maxAmount: number;
|
|
14
|
+
trustScoreMultiplier: number;
|
|
15
|
+
convictionMultiplier: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Trading configuration
|
|
19
|
+
*/
|
|
20
|
+
export interface TradingConfig {
|
|
21
|
+
slippageBps: number;
|
|
22
|
+
forceSimulation: boolean;
|
|
23
|
+
defaultChain: string;
|
|
24
|
+
maxPositionsPerToken: number;
|
|
25
|
+
maxPositionsPerRecommender: number;
|
|
26
|
+
minLiquidityUsd: number;
|
|
27
|
+
maxMarketCapUsd: number;
|
|
28
|
+
buyAmountConfig: BuyAmountConfig;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Database configuration
|
|
32
|
+
*/
|
|
33
|
+
export interface DatabaseConfig {
|
|
34
|
+
schemaVersion: string;
|
|
35
|
+
enableCaching: boolean;
|
|
36
|
+
cacheTimeout: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Memory configuration
|
|
40
|
+
*/
|
|
41
|
+
export interface MemoryConfig {
|
|
42
|
+
embeddingModel: string;
|
|
43
|
+
embeddingDimension: number;
|
|
44
|
+
similarityThreshold: number;
|
|
45
|
+
cacheTimeout: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Default trading configuration
|
|
49
|
+
*/
|
|
50
|
+
export declare const DEFAULT_TRADING_CONFIG: TradingConfig;
|
|
51
|
+
/**
|
|
52
|
+
* Default database configuration
|
|
53
|
+
*/
|
|
54
|
+
export declare const DEFAULT_DATABASE_CONFIG: DatabaseConfig;
|
|
55
|
+
/**
|
|
56
|
+
* Default memory configuration
|
|
57
|
+
*/
|
|
58
|
+
export declare const DEFAULT_MEMORY_CONFIG: MemoryConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Conviction levels for recommendations
|
|
61
|
+
* IMPORTANT: Must match the enum in types.ts
|
|
62
|
+
*/
|
|
63
|
+
export declare enum Conviction {
|
|
64
|
+
NONE = "NONE",
|
|
65
|
+
LOW = "LOW",
|
|
66
|
+
MEDIUM = "MEDIUM",
|
|
67
|
+
HIGH = "HIGH",
|
|
68
|
+
VERY_HIGH = "VERY_HIGH",
|
|
69
|
+
NEUTRAL = "NEUTRAL"
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Recommendation types
|
|
73
|
+
* IMPORTANT: Must match the enum in types.ts
|
|
74
|
+
*/
|
|
75
|
+
export declare enum RecommendationType {
|
|
76
|
+
BUY = "BUY",
|
|
77
|
+
DONT_BUY = "DONT_BUY",
|
|
78
|
+
SELL = "SELL",
|
|
79
|
+
DONT_SELL = "DONT_SELL",
|
|
80
|
+
NONE = "NONE",
|
|
81
|
+
HOLD = "HOLD"
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Transaction types
|
|
85
|
+
* IMPORTANT: Must match the enum in types.ts
|
|
86
|
+
*/
|
|
87
|
+
export declare enum TransactionType {
|
|
88
|
+
BUY = "BUY",
|
|
89
|
+
SELL = "SELL",
|
|
90
|
+
TRANSFER_IN = "transfer_in",
|
|
91
|
+
TRANSFER_OUT = "transfer_out"
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Buy signal message interface
|
|
95
|
+
*/
|
|
96
|
+
export interface BuySignalMessage {
|
|
97
|
+
tokenAddress: string;
|
|
98
|
+
chain?: string;
|
|
99
|
+
walletAddress?: string;
|
|
100
|
+
isSimulation?: boolean;
|
|
101
|
+
entityId: UUID;
|
|
102
|
+
recommendationId?: UUID;
|
|
103
|
+
conviction?: Conviction;
|
|
104
|
+
price?: string;
|
|
105
|
+
marketCap?: string;
|
|
106
|
+
liquidity?: string;
|
|
107
|
+
type?: RecommendationType;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Sell signal message interface
|
|
111
|
+
*/
|
|
112
|
+
export interface SellSignalMessage {
|
|
113
|
+
positionId: UUID;
|
|
114
|
+
tokenAddress: string;
|
|
115
|
+
sellRecommenderId: UUID;
|
|
116
|
+
walletAddress?: string;
|
|
117
|
+
isSimulation?: boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Utility functions for configuration
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* Get conviction multiplier
|
|
124
|
+
*/
|
|
125
|
+
export declare function getConvictionMultiplier(conviction: Conviction): number;
|
|
126
|
+
/**
|
|
127
|
+
* Get liquidity multiplier
|
|
128
|
+
*/
|
|
129
|
+
export declare function getLiquidityMultiplier(liquidity: number): number;
|
|
130
|
+
/**
|
|
131
|
+
* Get market cap multiplier
|
|
132
|
+
*/
|
|
133
|
+
export declare function getMarketCapMultiplier(marketCap: number): number;
|
|
134
|
+
/**
|
|
135
|
+
* Get volume multiplier
|
|
136
|
+
*/
|
|
137
|
+
export declare function getVolumeMultiplier(volume: number): number;
|
|
138
|
+
export declare const SOLANA_NETWORK_ID = 1399811149;
|
|
139
|
+
export declare const SOL_ADDRESS = "So11111111111111111111111111111111111111112";
|
|
140
|
+
export declare const USDC_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
141
|
+
export declare const BTC_ADDRESS = "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh";
|
|
142
|
+
export declare const ETH_ADDRESS = "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs";
|
|
143
|
+
export declare const TRUST_LEADERBOARD_WORLD_SEED = "trust-leaderboard-world-v1";
|
|
144
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1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AG,MAAM,CAM1D;AAKD,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C,eAAO,MAAM,WAAW,gDAAgD,CAAC;AACzE,eAAO,MAAM,YAAY,iDAAiD,CAAC;AAC3E,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAC1E,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAE1E,eAAO,MAAM,4BAA4B,+BAA+B,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const DEFAULT_TRADING_CONFIG = {
|
|
2
|
+
slippageBps: 100,
|
|
3
|
+
// 1%
|
|
4
|
+
forceSimulation: false,
|
|
5
|
+
defaultChain: "solana",
|
|
6
|
+
maxPositionsPerToken: 3,
|
|
7
|
+
maxPositionsPerRecommender: 5,
|
|
8
|
+
minLiquidityUsd: 1e4,
|
|
9
|
+
// $10k
|
|
10
|
+
maxMarketCapUsd: 1e8,
|
|
11
|
+
// $100M
|
|
12
|
+
buyAmountConfig: {
|
|
13
|
+
baseAmount: 0.1,
|
|
14
|
+
// 0.1 SOL
|
|
15
|
+
minAmount: 0.01,
|
|
16
|
+
// 0.01 SOL
|
|
17
|
+
maxAmount: 1,
|
|
18
|
+
// 1 SOL
|
|
19
|
+
trustScoreMultiplier: 0.5,
|
|
20
|
+
convictionMultiplier: 0.3
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const DEFAULT_DATABASE_CONFIG = {
|
|
24
|
+
schemaVersion: "1.0",
|
|
25
|
+
enableCaching: true,
|
|
26
|
+
cacheTimeout: 3600
|
|
27
|
+
// 1 hour
|
|
28
|
+
};
|
|
29
|
+
const DEFAULT_MEMORY_CONFIG = {
|
|
30
|
+
embeddingModel: "text-embedding-ada-002",
|
|
31
|
+
embeddingDimension: 1536,
|
|
32
|
+
similarityThreshold: 0.7,
|
|
33
|
+
cacheTimeout: 3600
|
|
34
|
+
// 1 hour
|
|
35
|
+
};
|
|
36
|
+
var Conviction = /* @__PURE__ */ ((Conviction2) => {
|
|
37
|
+
Conviction2["NONE"] = "NONE";
|
|
38
|
+
Conviction2["LOW"] = "LOW";
|
|
39
|
+
Conviction2["MEDIUM"] = "MEDIUM";
|
|
40
|
+
Conviction2["HIGH"] = "HIGH";
|
|
41
|
+
Conviction2["VERY_HIGH"] = "VERY_HIGH";
|
|
42
|
+
Conviction2["NEUTRAL"] = "NEUTRAL";
|
|
43
|
+
return Conviction2;
|
|
44
|
+
})(Conviction || {});
|
|
45
|
+
var RecommendationType = /* @__PURE__ */ ((RecommendationType2) => {
|
|
46
|
+
RecommendationType2["BUY"] = "BUY";
|
|
47
|
+
RecommendationType2["DONT_BUY"] = "DONT_BUY";
|
|
48
|
+
RecommendationType2["SELL"] = "SELL";
|
|
49
|
+
RecommendationType2["DONT_SELL"] = "DONT_SELL";
|
|
50
|
+
RecommendationType2["NONE"] = "NONE";
|
|
51
|
+
RecommendationType2["HOLD"] = "HOLD";
|
|
52
|
+
return RecommendationType2;
|
|
53
|
+
})(RecommendationType || {});
|
|
54
|
+
var TransactionType = /* @__PURE__ */ ((TransactionType2) => {
|
|
55
|
+
TransactionType2["BUY"] = "BUY";
|
|
56
|
+
TransactionType2["SELL"] = "SELL";
|
|
57
|
+
TransactionType2["TRANSFER_IN"] = "transfer_in";
|
|
58
|
+
TransactionType2["TRANSFER_OUT"] = "transfer_out";
|
|
59
|
+
return TransactionType2;
|
|
60
|
+
})(TransactionType || {});
|
|
61
|
+
function getConvictionMultiplier(conviction) {
|
|
62
|
+
switch (conviction) {
|
|
63
|
+
case "NONE" /* NONE */:
|
|
64
|
+
return 0;
|
|
65
|
+
case "LOW" /* LOW */:
|
|
66
|
+
return 0.5;
|
|
67
|
+
case "MEDIUM" /* MEDIUM */:
|
|
68
|
+
return 1;
|
|
69
|
+
case "HIGH" /* HIGH */:
|
|
70
|
+
return 1.5;
|
|
71
|
+
case "VERY_HIGH" /* VERY_HIGH */:
|
|
72
|
+
return 2;
|
|
73
|
+
default:
|
|
74
|
+
return 1;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function getLiquidityMultiplier(liquidity) {
|
|
78
|
+
if (liquidity < 1e4) return 0.5;
|
|
79
|
+
if (liquidity < 5e4) return 0.75;
|
|
80
|
+
if (liquidity < 1e5) return 1;
|
|
81
|
+
if (liquidity < 5e5) return 1.25;
|
|
82
|
+
return 1.5;
|
|
83
|
+
}
|
|
84
|
+
function getMarketCapMultiplier(marketCap) {
|
|
85
|
+
if (marketCap < 1e5) return 1.5;
|
|
86
|
+
if (marketCap < 1e6) return 1.25;
|
|
87
|
+
if (marketCap < 1e7) return 1;
|
|
88
|
+
if (marketCap < 5e7) return 0.75;
|
|
89
|
+
return 0.5;
|
|
90
|
+
}
|
|
91
|
+
function getVolumeMultiplier(volume) {
|
|
92
|
+
if (volume < 1e4) return 0.5;
|
|
93
|
+
if (volume < 5e4) return 0.75;
|
|
94
|
+
if (volume < 1e5) return 1;
|
|
95
|
+
if (volume < 5e5) return 1.25;
|
|
96
|
+
return 1.5;
|
|
97
|
+
}
|
|
98
|
+
const SOLANA_NETWORK_ID = 1399811149;
|
|
99
|
+
const SOL_ADDRESS = "So11111111111111111111111111111111111111112";
|
|
100
|
+
const USDC_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
101
|
+
const BTC_ADDRESS = "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh";
|
|
102
|
+
const ETH_ADDRESS = "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs";
|
|
103
|
+
const TRUST_LEADERBOARD_WORLD_SEED = "trust-leaderboard-world-v1";
|
|
104
|
+
export {
|
|
105
|
+
BTC_ADDRESS,
|
|
106
|
+
Conviction,
|
|
107
|
+
DEFAULT_DATABASE_CONFIG,
|
|
108
|
+
DEFAULT_MEMORY_CONFIG,
|
|
109
|
+
DEFAULT_TRADING_CONFIG,
|
|
110
|
+
ETH_ADDRESS,
|
|
111
|
+
RecommendationType,
|
|
112
|
+
SOLANA_NETWORK_ID,
|
|
113
|
+
SOL_ADDRESS,
|
|
114
|
+
TRUST_LEADERBOARD_WORLD_SEED,
|
|
115
|
+
TransactionType,
|
|
116
|
+
USDC_ADDRESS,
|
|
117
|
+
getConvictionMultiplier,
|
|
118
|
+
getLiquidityMultiplier,
|
|
119
|
+
getMarketCapMultiplier,
|
|
120
|
+
getVolumeMultiplier
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"sourcesContent":["/**\n * Configuration for the Community Trader Plugin\n *\n * This file centralizes all configuration options for the trading system.\n */\n\nimport type { UUID } from \"./types.js\";\n\n/**\n * Buy amount configuration\n */\nexport interface BuyAmountConfig {\n\tbaseAmount: number;\n\tminAmount: number;\n\tmaxAmount: number;\n\ttrustScoreMultiplier: number;\n\tconvictionMultiplier: number;\n}\n\n/**\n * Trading configuration\n */\nexport interface TradingConfig {\n\tslippageBps: number;\n\tforceSimulation: boolean;\n\tdefaultChain: string;\n\tmaxPositionsPerToken: number;\n\tmaxPositionsPerRecommender: number;\n\tminLiquidityUsd: number;\n\tmaxMarketCapUsd: number;\n\tbuyAmountConfig: BuyAmountConfig;\n}\n\n/**\n * Database configuration\n */\nexport interface DatabaseConfig {\n\tschemaVersion: string;\n\tenableCaching: boolean;\n\tcacheTimeout: number; // in seconds\n}\n\n/**\n * Memory configuration\n */\nexport interface MemoryConfig {\n\tembeddingModel: string;\n\tembeddingDimension: number;\n\tsimilarityThreshold: number;\n\tcacheTimeout: number; // in seconds\n}\n\n/**\n * Default trading configuration\n */\nexport const DEFAULT_TRADING_CONFIG: TradingConfig = {\n\tslippageBps: 100, // 1%\n\tforceSimulation: false,\n\tdefaultChain: \"solana\",\n\tmaxPositionsPerToken: 3,\n\tmaxPositionsPerRecommender: 5,\n\tminLiquidityUsd: 10000, // $10k\n\tmaxMarketCapUsd: 100000000, // $100M\n\tbuyAmountConfig: {\n\t\tbaseAmount: 0.1, // 0.1 SOL\n\t\tminAmount: 0.01, // 0.01 SOL\n\t\tmaxAmount: 1.0, // 1 SOL\n\t\ttrustScoreMultiplier: 0.5,\n\t\tconvictionMultiplier: 0.3,\n\t},\n};\n\n/**\n * Default database configuration\n */\nexport const DEFAULT_DATABASE_CONFIG: DatabaseConfig = {\n\tschemaVersion: \"1.0\",\n\tenableCaching: true,\n\tcacheTimeout: 3600, // 1 hour\n};\n\n/**\n * Default memory configuration\n */\nexport const DEFAULT_MEMORY_CONFIG: MemoryConfig = {\n\tembeddingModel: \"text-embedding-ada-002\",\n\tembeddingDimension: 1536,\n\tsimilarityThreshold: 0.7,\n\tcacheTimeout: 3600, // 1 hour\n};\n\n/**\n * Conviction levels for recommendations\n * IMPORTANT: Must match the enum in types.ts\n */\nexport enum Conviction {\n\tNONE = \"NONE\",\n\tLOW = \"LOW\",\n\tMEDIUM = \"MEDIUM\",\n\tHIGH = \"HIGH\",\n\tVERY_HIGH = \"VERY_HIGH\",\n\tNEUTRAL = \"NEUTRAL\",\n}\n\n/**\n * Recommendation types\n * IMPORTANT: Must match the enum in types.ts\n */\nexport enum RecommendationType {\n\tBUY = \"BUY\",\n\tDONT_BUY = \"DONT_BUY\",\n\tSELL = \"SELL\",\n\tDONT_SELL = \"DONT_SELL\",\n\tNONE = \"NONE\",\n\tHOLD = \"HOLD\",\n}\n\n/**\n * Transaction types\n * IMPORTANT: Must match the enum in types.ts\n */\nexport enum TransactionType {\n\tBUY = \"BUY\",\n\tSELL = \"SELL\",\n\tTRANSFER_IN = \"transfer_in\",\n\tTRANSFER_OUT = \"transfer_out\",\n}\n\n/**\n * Buy signal message interface\n */\nexport interface BuySignalMessage {\n\ttokenAddress: string;\n\tchain?: string;\n\twalletAddress?: string;\n\tisSimulation?: boolean;\n\tentityId: UUID;\n\trecommendationId?: UUID;\n\tconviction?: Conviction;\n\tprice?: string;\n\tmarketCap?: string;\n\tliquidity?: string;\n\ttype?: RecommendationType;\n}\n\n/**\n * Sell signal message interface\n */\nexport interface SellSignalMessage {\n\tpositionId: UUID;\n\ttokenAddress: string;\n\tsellRecommenderId: UUID;\n\twalletAddress?: string;\n\tisSimulation?: boolean;\n}\n\n/**\n * Utility functions for configuration\n */\n\n/**\n * Get conviction multiplier\n */\nexport function getConvictionMultiplier(conviction: Conviction): number {\n\tswitch (conviction) {\n\t\tcase Conviction.NONE:\n\t\t\treturn 0;\n\t\tcase Conviction.LOW:\n\t\t\treturn 0.5;\n\t\tcase Conviction.MEDIUM:\n\t\t\treturn 1.0;\n\t\tcase Conviction.HIGH:\n\t\t\treturn 1.5;\n\t\tcase Conviction.VERY_HIGH:\n\t\t\treturn 2.0;\n\t\tdefault:\n\t\t\treturn 1.0;\n\t}\n}\n\n/**\n * Get liquidity multiplier\n */\nexport function getLiquidityMultiplier(liquidity: number): number {\n\tif (liquidity < 10000) return 0.5;\n\tif (liquidity < 50000) return 0.75;\n\tif (liquidity < 100000) return 1.0;\n\tif (liquidity < 500000) return 1.25;\n\treturn 1.5;\n}\n\n/**\n * Get market cap multiplier\n */\nexport function getMarketCapMultiplier(marketCap: number): number {\n\tif (marketCap < 100000) return 1.5;\n\tif (marketCap < 1000000) return 1.25;\n\tif (marketCap < 10000000) return 1.0;\n\tif (marketCap < 50000000) return 0.75;\n\treturn 0.5;\n}\n\n/**\n * Get volume multiplier\n */\nexport function getVolumeMultiplier(volume: number): number {\n\tif (volume < 10000) return 0.5;\n\tif (volume < 50000) return 0.75;\n\tif (volume < 100000) return 1.0;\n\tif (volume < 500000) return 1.25;\n\treturn 1.5;\n}\n\n// ===================== CONSTANTS =====================\n// Moved from constants.ts\n\nexport const SOLANA_NETWORK_ID = 1399811149;\n\nexport const SOL_ADDRESS = \"So11111111111111111111111111111111111111112\";\nexport const USDC_ADDRESS = \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\";\nexport const BTC_ADDRESS = \"3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh\"; // WORMHOLE\nexport const ETH_ADDRESS = \"7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs\"; // WORMHOLE\n\nexport const TRUST_LEADERBOARD_WORLD_SEED = \"trust-leaderboard-world-v1\"; // Versioned for deterministic world-id migrations.\n"],"mappings":"AAuDO,MAAM,yBAAwC;AAAA,EACpD,aAAa;AAAA;AAAA,EACb,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,iBAAiB;AAAA;AAAA,EACjB,iBAAiB;AAAA;AAAA,EACjB,iBAAiB;AAAA,IAChB,YAAY;AAAA;AAAA,IACZ,WAAW;AAAA;AAAA,IACX,WAAW;AAAA;AAAA,IACX,sBAAsB;AAAA,IACtB,sBAAsB;AAAA,EACvB;AACD;AAKO,MAAM,0BAA0C;AAAA,EACtD,eAAe;AAAA,EACf,eAAe;AAAA,EACf,cAAc;AAAA;AACf;AAKO,MAAM,wBAAsC;AAAA,EAClD,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,cAAc;AAAA;AACf;AAMO,IAAK,aAAL,kBAAKA,gBAAL;AACN,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,SAAM;AACN,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,eAAY;AACZ,EAAAA,YAAA,aAAU;AANC,SAAAA;AAAA,GAAA;AAaL,IAAK,qBAAL,kBAAKC,wBAAL;AACN,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,UAAO;AACP,EAAAA,oBAAA,eAAY;AACZ,EAAAA,oBAAA,UAAO;AACP,EAAAA,oBAAA,UAAO;AANI,SAAAA;AAAA,GAAA;AAaL,IAAK,kBAAL,kBAAKC,qBAAL;AACN,EAAAA,iBAAA,SAAM;AACN,EAAAA,iBAAA,UAAO;AACP,EAAAA,iBAAA,iBAAc;AACd,EAAAA,iBAAA,kBAAe;AAJJ,SAAAA;AAAA,GAAA;AA0CL,SAAS,wBAAwB,YAAgC;AACvE,UAAQ,YAAY;AAAA,IACnB,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO;AAAA,EACT;AACD;AAKO,SAAS,uBAAuB,WAA2B;AACjE,MAAI,YAAY,IAAO,QAAO;AAC9B,MAAI,YAAY,IAAO,QAAO;AAC9B,MAAI,YAAY,IAAQ,QAAO;AAC/B,MAAI,YAAY,IAAQ,QAAO;AAC/B,SAAO;AACR;AAKO,SAAS,uBAAuB,WAA2B;AACjE,MAAI,YAAY,IAAQ,QAAO;AAC/B,MAAI,YAAY,IAAS,QAAO;AAChC,MAAI,YAAY,IAAU,QAAO;AACjC,MAAI,YAAY,IAAU,QAAO;AACjC,SAAO;AACR;AAKO,SAAS,oBAAoB,QAAwB;AAC3D,MAAI,SAAS,IAAO,QAAO;AAC3B,MAAI,SAAS,IAAO,QAAO;AAC3B,MAAI,SAAS,IAAQ,QAAO;AAC5B,MAAI,SAAS,IAAQ,QAAO;AAC5B,SAAO;AACR;AAKO,MAAM,oBAAoB;AAE1B,MAAM,cAAc;AACpB,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,cAAc;AAEpB,MAAM,+BAA+B;","names":["Conviction","RecommendationType","TransactionType"]}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,cAAc,EAGnB,MAAM,eAAe,CAAC;AA8gBvB,eAAO,MAAM,MAAM;+CAxahB,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC;CA0ahC,CAAC"}
|