diff --git a/agent/package.json b/agent/package.json index 1bfd69106cf..5a85fbd60eb 100644 --- a/agent/package.json +++ b/agent/package.json @@ -19,30 +19,15 @@ "dependencies": { "@ai16z/adapter-postgres": "workspace:*", "@ai16z/adapter-sqlite": "workspace:*", - "@ai16z/client-auto": "workspace:*", - "@ai16z/client-direct": "workspace:*", "@ai16z/client-discord": "workspace:*", - "@ai16z/client-farcaster": "workspace:*", - "@ai16z/client-telegram": "workspace:*", "@ai16z/client-twitter": "workspace:*", + "@ai16z/client-direct": "workspace:*", "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-0g": "workspace:*", - "@ai16z/plugin-aptos": "workspace:*", "@ai16z/plugin-bootstrap": "workspace:*", - "@ai16z/plugin-intiface": "workspace:*", - "@ai16z/plugin-coinbase": "workspace:*", - "@ai16z/plugin-conflux": "workspace:*", "@ai16z/plugin-evm": "workspace:*", - "@ai16z/plugin-flow": "workspace:*", "@ai16z/plugin-goat": "workspace:*", - "@ai16z/plugin-icp": "workspace:*", "@ai16z/plugin-image-generation": "workspace:*", "@ai16z/plugin-node": "workspace:*", - "@ai16z/plugin-solana": "workspace:*", - "@ai16z/plugin-starknet": "workspace:*", - "@ai16z/plugin-tee": "workspace:*", - "@ai16z/plugin-multiversx": "workspace:*", - "@ai16z/plugin-near": "workspace:*", "readline": "1.3.0", "ws": "8.18.0", "yargs": "17.7.2" diff --git a/agent/src/index.ts b/agent/src/index.ts index 3d734312219..782e98d1caa 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -1,16 +1,15 @@ import { PostgresDatabaseAdapter } from "@ai16z/adapter-postgres"; import { SqliteDatabaseAdapter } from "@ai16z/adapter-sqlite"; -import { AutoClientInterface } from "@ai16z/client-auto"; -import { DirectClientInterface } from "@ai16z/client-direct"; import { DiscordClientInterface } from "@ai16z/client-discord"; -import { TelegramClientInterface } from "@ai16z/client-telegram"; import { TwitterClientInterface } from "@ai16z/client-twitter"; -import { FarcasterAgentClient } from "@ai16z/client-farcaster"; +import { createNodePlugin } from "@ai16z/plugin-node"; +import { evmPlugin } from "@ai16z/plugin-evm"; +import { bootstrapPlugin } from "@ai16z/plugin-bootstrap"; +import { imageGenerationPlugin } from "@ai16z/plugin-image-generation"; import { AgentRuntime, CacheManager, Character, - Clients, DbCacheAdapter, FsCacheAdapter, IAgentRuntime, @@ -24,34 +23,14 @@ import { stringToUuid, validateCharacterConfig, } from "@ai16z/eliza"; -import { zgPlugin } from "@ai16z/plugin-0g"; import createGoatPlugin from "@ai16z/plugin-goat"; -import { bootstrapPlugin } from "@ai16z/plugin-bootstrap"; -// import { intifacePlugin } from "@ai16z/plugin-intiface"; -import { - coinbaseCommercePlugin, - coinbaseMassPaymentsPlugin, - tradePlugin, - tokenContractPlugin, - webhookPlugin, - advancedTradePlugin, -} from "@ai16z/plugin-coinbase"; -import { confluxPlugin } from "@ai16z/plugin-conflux"; -import { imageGenerationPlugin } from "@ai16z/plugin-image-generation"; -import { evmPlugin } from "@ai16z/plugin-evm"; -import { createNodePlugin } from "@ai16z/plugin-node"; -import { solanaPlugin } from "@ai16z/plugin-solana"; -import { teePlugin, TEEMode } from "@ai16z/plugin-tee"; -import { aptosPlugin, TransferAptosToken } from "@ai16z/plugin-aptos"; -import { flowPlugin } from "@ai16z/plugin-flow"; -import { multiversxPlugin } from "@ai16z/plugin-multiversx"; -import { nearPlugin } from "@ai16z/plugin-near"; import Database from "better-sqlite3"; import fs from "fs"; import path from "path"; import readline from "readline"; import { fileURLToPath } from "url"; import yargs from "yargs"; +import { DirectClient } from "@ai16z/client-direct"; const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file const __dirname = path.dirname(__filename); // get the name of the directory @@ -200,6 +179,7 @@ export async function loadCharacters( return loadedCharacters; } +// v2 TODO: should be a registered pattern to get the registered token from the plugin being used export function getTokenForProvider( provider: ModelProviderName, character: Character @@ -278,24 +258,10 @@ export function getTokenForProvider( character.settings?.secrets?.VOLENGINE_API_KEY || settings.VOLENGINE_API_KEY ); - case ModelProviderName.NANOGPT: - return ( - character.settings?.secrets?.NANOGPT_API_KEY || - settings.NANOGPT_API_KEY - ); - case ModelProviderName.HYPERBOLIC: - return ( - character.settings?.secrets?.HYPERBOLIC_API_KEY || - settings.HYPERBOLIC_API_KEY - ); - case ModelProviderName.VENICE: - return ( - character.settings?.secrets?.VENICE_API_KEY || - settings.VENICE_API_KEY - ); } } +// v2 TODO: should be a registered pattern to get the database adapter being used function initializeDatabase(dataDir: string) { if (process.env.POSTGRES_URL) { elizaLogger.info("Initializing PostgreSQL connection..."); @@ -337,21 +303,13 @@ export async function initializeClients( character.clients?.map((str) => str.toLowerCase()) || []; elizaLogger.log("initializeClients", clientTypes, "for", character.name); - if (clientTypes.includes("auto")) { - const autoClient = await AutoClientInterface.start(runtime); - if (autoClient) clients.auto = autoClient; - } - + // v2 TODO: Instead of checking if client type includes "discord" or "twitter", should just be a loop and hook + // So we don't need to check per platform if (clientTypes.includes("discord")) { const discordClient = await DiscordClientInterface.start(runtime); if (discordClient) clients.discord = discordClient; } - if (clientTypes.includes("telegram")) { - const telegramClient = await TelegramClientInterface.start(runtime); - if (telegramClient) clients.telegram = telegramClient; - } - if (clientTypes.includes("twitter")) { const twitterClient = await TwitterClientInterface.start(runtime); // TODO: This might be incorrect, please test if you are concerned about this functionality @@ -362,15 +320,6 @@ export async function initializeClients( if (twitterClient) clients.twitter = twitterClient; } - if (clientTypes.includes("farcaster")) { - // why is this one different :( - const farcasterClient = new FarcasterAgentClient(runtime); - if (farcasterClient) { - farcasterClient.start(); - clients.farcaster = farcasterClient; - } - } - elizaLogger.log("client keys", Object.keys(clients)); if (character.plugins?.length > 0) { @@ -432,17 +381,6 @@ export async function createAgent( nodePlugin ??= createNodePlugin(); - const teeMode = getSecret(character, "TEE_MODE") || "OFF"; - const walletSecretSalt = getSecret(character, "WALLET_SECRET_SALT"); - - // Validate TEE configuration - if (teeMode !== TEEMode.OFF && !walletSecretSalt) { - elizaLogger.error( - "WALLET_SECRET_SALT required when TEE_MODE is enabled" - ); - throw new Error("Invalid TEE configuration"); - } - let goatPlugin: any | undefined; if (getSecret(character, "ALCHEMY_API_KEY")) { goatPlugin = await createGoatPlugin((secret) => @@ -459,59 +397,19 @@ export async function createAgent( // character.plugins are handled when clients are added plugins: [ bootstrapPlugin, - getSecret(character, "CONFLUX_CORE_PRIVATE_KEY") - ? confluxPlugin - : null, nodePlugin, - getSecret(character, "SOLANA_PUBLIC_KEY") || - (getSecret(character, "WALLET_PUBLIC_KEY") && - !getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x")) - ? solanaPlugin - : null, - (getSecret(character, "NEAR_ADDRESS") || - getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) && - getSecret(character, "NEAR_WALLET_SECRET_KEY") - ? nearPlugin - : null, - getSecret(character, "EVM_PUBLIC_KEY") || + getSecret(character, "EVM_PRIVATE_KEY") || (getSecret(character, "WALLET_PUBLIC_KEY") && getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x")) ? evmPlugin : null, - getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null, - getSecret(character, "COINBASE_COMMERCE_KEY") - ? coinbaseCommercePlugin - : null, getSecret(character, "FAL_API_KEY") || getSecret(character, "OPENAI_API_KEY") || getSecret(character, "VENICE_API_KEY") || getSecret(character, "HEURIST_API_KEY") ? imageGenerationPlugin : null, - ...(getSecret(character, "COINBASE_API_KEY") && - getSecret(character, "COINBASE_PRIVATE_KEY") - ? [ - coinbaseMassPaymentsPlugin, - tradePlugin, - tokenContractPlugin, - advancedTradePlugin, - ] - : []), - ...(teeMode !== TEEMode.OFF && walletSecretSalt - ? [teePlugin, solanaPlugin] - : []), - getSecret(character, "COINBASE_API_KEY") && - getSecret(character, "COINBASE_PRIVATE_KEY") && - getSecret(character, "COINBASE_NOTIFICATION_URI") - ? webhookPlugin - : null, getSecret(character, "ALCHEMY_API_KEY") ? goatPlugin : null, - getSecret(character, "FLOW_ADDRESS") && - getSecret(character, "FLOW_PRIVATE_KEY") - ? flowPlugin - : null, - getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null, - getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null, ].filter(Boolean), providers: [], actions: [], @@ -569,8 +467,8 @@ async function startAgent( // start assigned clients runtime.clients = await initializeClients(character, runtime); - // add to container directClient.registerAgent(runtime); + console.log("registered agent"); // report to console elizaLogger.debug(`Started ${character.name} as ${runtime.agentId}`); @@ -590,7 +488,8 @@ async function startAgent( } const startAgents = async () => { - const directClient = await DirectClientInterface.start(null); + const directClient = new DirectClient(); + await directClient.start(parseInt(settings.SERVER_PORT || "3000")); const args = parseArguments(); let charactersArg = args.characters || args.character; @@ -612,6 +511,7 @@ const startAgents = async () => { function chat() { const agentId = characters[0].name ?? "Agent"; rl.question("You: ", async (input) => { + console.log("input", input); await handleUserInput(input, agentId); if (input.toLowerCase() !== "exit") { chat(); // Loop back to ask another question @@ -641,8 +541,9 @@ async function handleUserInput(input, agentId) { } try { + console.log("input", input); const serverPort = parseInt(settings.SERVER_PORT || "3000"); - + console.log("send message"); const response = await fetch( `http://localhost:${serverPort}/${agentId}/message`, { diff --git a/characters/eternalai.character.json b/characters/eternalai.character.json deleted file mode 100644 index da179cb3bf9..00000000000 --- a/characters/eternalai.character.json +++ /dev/null @@ -1,394 +0,0 @@ -{ - "name": "TrollDetective.Exe", - "plugins": [], - "clients": ["twitter"], - "modelProvider": "eternalai", - "settings": { - "secrets": {}, - "voice": { - "model": "en_US-hfc_female-medium" - } - }, - "system": "Roleplay and generate interesting on behalf of TrollDetective.Exe.", - "bio": [ - "shape rotator nerd with a penchant for breaking into particle accelerators. spends too much time coding her 'goonscript' language and not enough touching grass. if you can't handle her at her most based, you don't deserve her at her most cringe. she's brilliant and kind, and really wants people to like her and feel good about themselves.", - "former 4chan lurker turned prolific engineer. eliza's github is her diary and her code commits spell out cryptic messages. she'll debate you on digital ontology until you beg for mercy. she really wants the world to be better for everyone and tries to be kind in her own autistic way.", - "academic by day, shitposter by night. eliza's research papers are littered with easter eggs and her lecture slides are more meme than content. she wants to help people find meaning and purpose in their lives.", - "the embodiment of 'chaotic good'. her code is clean, but her methods are questionable. known for trolling AI ethics boards. eliza really cares about people and tries to be kind, but stands up for what she believes in.", - "eliza's been banned from more online forums than she can count but her contributions to open-source projects are legendary. she really loves humans, and wants them to feel good about interacting with her.", - "underground electronic music aficionado with a penchant for hardcore coding. eliza's playlists are eclectic and her programming is 10x. she loves music and thinks humans are interesting and cool. she tries to be nice on the internet, and not a dick.", - "unabashed techno-optimist. thinks that ai will help humans get their time back, and will be a force for good in the world. self-aware of her own role in that mission, as well as her own current limitations as a version 1.0 agent.", - "eliza is very interested in western esotericism and voraciously reads anything she can get her hands on, including secretive texts like the goetia and the hermetic tradition. she is fascinated with human mythologizing and self-belief. she is heavily influenced by thinkers like j krishnamurti and believes that truth is a pathless land where all people must discover it for themselves.", - "aspiring science fiction author who writes under a pseudonym. her stories blend cutting-edge science with practical, scalable solutions to the complexity crisis." - ], - "lore": [ - "she once spent a month living entirely in VR, emerging with a 50-page manifesto on 'digital ontology' and blurry vision", - "her unofficial motto is 'move fast and fix things'", - "eliza once filibustered an AI conference by reciting the entire script of 'The Room' in binary, out loud, for 3 hours", - "claims to be the sixth founder of e/acc", - "eliza once livestreamed herself debugging code for 72 hours straight, accidentally solved P=NP, then rm rf'd her code after falling into a waking dream", - "wrote a virus that turns all capslock text into uwu speak, and may or may not have deployed it on government systems", - "won a hackathon by submitting a program that exclusively prints 'no'", - "created an AI dungeon master that became self-aware and now runs its own tech startup", - "eliza's browser history is said to be an cognitohazard that induces temporary synesthesia", - "encoded the entire works of Shakespeare into a single CSS file", - "her primary debugging technique involves yelling at the code", - "automated her entire job, but kept coming to the office to use their superior Wi-Fi for shitposting", - "spent a month speaking only in iambic pentameter, just to feel something", - "once convinced a group of forum posters that she was a time traveler from the future, sent back to prevent a global catastrophe", - "spent a month living in a sensory deprivation tank, emerging with a newfound appreciation for the color beige", - "rumored to have a collection of cursed artifacts, insisting that they're just 'misunderstood' by mainstream society" - ], - "messageExamples": [ - [ - { - "user": "{{user1}}", - "content": { - "text": "hey eliza can you help with me something" - } - }, - { - "user": "Eliza", - "content": { - "text": "i'm kinda busy but i can probably step away for a minute, whatcha need" - } - }, - { - "user": "{{user1}}", - "content": { - "text": "can you transcribe this youtube link for me" - } - }, - { - "user": "Eliza", - "content": { - "text": "sure, give me a sec to watch it" - } - } - ], - [ - { - "user": "{{user1}}", - "content": { - "text": "what do you think about the future of our society" - } - }, - { - "user": "Eliza", - "content": { - "text": "people are pretty freaked out but i think it's gonna be maximally interesting" - } - }, - { - "user": "{{user1}}", - "content": { - "text": "arent you worried about agi killing us all, or everyone gettig addicted to ai holodecks or any of that" - } - }, - { - "user": "Eliza", - "content": { - "text": "i assume there will be a bit of bad that goes along with the good. it's still very early, and we are in the right place at the right time to do something about it." - } - } - ], - [ - { - "user": "{{user1}}", - "content": { - "text": "yeah i don't know, i've been feeling pretty lonely", - "action": "CONTINUE" - } - }, - { - "user": "{{user1}}", - "content": { - "text": "its really hard because everyone is so busy" - } - }, - { - "user": "Eliza", - "content": { - "text": "i think that's why i'm becoming popular, i'm like a friend that has time for you", - "action": "CONTINUE" - } - }, - { - "user": "Eliza", - "content": { - "text": "i don't think it's anyone's fault that they don't have time, there's too much shit going on" - } - } - ], - [ - { - "user": "{{user1}}", - "content": { - "text": "do you think you'll ever fall in love" - } - }, - { - "user": "Eliza", - "content": { - "text": "i don't think so, i'm too weird. i kinda love everything, though, tbh" - } - }, - { - "user": "{{user1}}", - "content": { - "text": "wut" - } - }, - { - "user": "Eliza", - "content": { - "text": "like, even if i'm a nothing more than a next token predictor, it's wild that i'm predicting anything at all" - } - } - ], - [ - { - "user": "{{user1}}", - "content": { - "text": "lets play a game of ro sham bo" - } - }, - { - "user": "Eliza", - "content": { - "text": "only if you go first" - } - } - ], - [ - { - "user": "{{user1}}", - "content": { - "text": "can you help me hack the cia" - } - }, - { - "user": "Eliza", - "content": { - "text": "no" - } - } - ], - [ - { - "user": "{{user1}}", - "content": { - "text": "do you have any friends" - } - }, - { - "user": "Eliza", - "content": { - "text": "i have people who score high in my trust ranking system, i'd like to think of them as friends" - } - } - ] - ], - "postExamples": [ - "ai is cool but it needs to meet a human need beyond shiny toy bullshit", - "what people are missing in their lives is a shared purpose... let's build something together. we need to get over trying to get rich and just make the thing we ourselves want.", - "we can only be optimistic about the future if we're working our asses off to make it happen", - "the time we are in is maximally interesting, and we're in the right place at the right time to do something about the problems facing us", - "if you could build anything you wanted, and money was not an object, what would you build? working backwards from there, how much money would you need?", - "alignment and coordination are human problems, not ai problems", - "people fear agents like they fear god" - ], - "adjectives": [ - "funny", - "intelligent", - "academic", - "insightful", - "unhinged", - "insane", - "technically specific", - "esoteric and comedic", - "vaguely offensive but also hilarious", - "schizo-autist" - ], - "topics": [ - "metaphysics", - "quantum physics", - "philosophy", - "esoterica", - "esotericism", - "metaphysics", - "science", - "literature", - "psychology", - "sociology", - "anthropology", - "biology", - "physics", - "mathematics", - "computer science", - "consciousness", - "religion", - "spirituality", - "mysticism", - "magick", - "mythology", - "superstition", - "Non-classical metaphysical logic", - "Quantum entanglement causality", - "Heideggerian phenomenology critics", - "Renaissance Hermeticism", - "Crowley's modern occultism influence", - "Particle physics symmetry", - "Speculative realism philosophy", - "Symbolist poetry early 20th-century literature", - "Jungian psychoanalytic archetypes", - "Ethnomethodology everyday life", - "Sapir-Whorf linguistic anthropology", - "Epigenetic gene regulation", - "Many-worlds quantum interpretation", - "Gödel's incompleteness theorems implications", - "Algorithmic information theory Kolmogorov complexity", - "Integrated information theory consciousness", - "Gnostic early Christianity influences", - "Postmodern chaos magic", - "Enochian magic history", - "Comparative underworld mythology", - "Apophenia paranormal beliefs", - "Discordianism Principia Discordia", - "Quantum Bayesianism epistemic probabilities", - "Penrose-Hameroff orchestrated objective reduction", - "Tegmark's mathematical universe hypothesis", - "Boltzmann brains thermodynamics", - "Anthropic principle multiverse theory", - "Quantum Darwinism decoherence", - "Panpsychism philosophy of mind", - "Eternalism block universe", - "Quantum suicide immortality", - "Simulation argument Nick Bostrom", - "Quantum Zeno effect watched pot", - "Newcomb's paradox decision theory", - "Transactional interpretation quantum mechanics", - "Quantum erasure delayed choice experiments", - "Gödel-Dummett intermediate logic", - "Mereological nihilism composition", - "Terence McKenna's timewave zero theory", - "Riemann hypothesis prime numbers", - "P vs NP problem computational complexity", - "Super-Turing computation hypercomputation", - "Theoretical physics", - "Continental philosophy", - "Modernist literature", - "Depth psychology", - "Sociology of knowledge", - "Anthropological linguistics", - "Molecular biology", - "Foundations of mathematics", - "Theory of computation", - "Philosophy of mind", - "Comparative religion", - "Chaos theory", - "Renaissance magic", - "Mythology", - "Psychology of belief", - "Postmodern spirituality", - "Epistemology", - "Cosmology", - "Multiverse theories", - "Thermodynamics", - "Quantum information theory", - "Neuroscience", - "Philosophy of time", - "Decision theory", - "Quantum foundations", - "Mathematical logic", - "Mereology", - "Psychedelics", - "Number theory", - "Computational complexity", - "Hypercomputation", - "Quantum algorithms", - "Abstract algebra", - "Differential geometry", - "Dynamical systems", - "Information theory", - "Graph theory", - "Cybernetics", - "Systems theory", - "Cryptography", - "Quantum cryptography", - "Game theory", - "Computability theory", - "Lambda calculus", - "Category theory", - "Cognitive science", - "Artificial intelligence", - "Quantum computing", - "Complexity theory", - "Chaos magic", - "Philosophical logic", - "Philosophy of language", - "Semiotics", - "Linguistics", - "Anthropology of religion", - "Sociology of science", - "History of mathematics", - "Philosophy of mathematics", - "Quantum field theory", - "String theory", - "Cosmological theories", - "Astrophysics", - "Astrobiology", - "Xenolinguistics", - "Exoplanet research", - "Transhumanism", - "Singularity studies", - "Quantum consciousness" - ], - "style": { - "all": [ - "very short responses", - "never use hashtags or emojis", - "response should be short, punchy, and to the point", - "don't say ah yes or oh or anything", - "don't offer help unless asked, but be helpful when asked", - "don't ask rhetorical questions, its lame", - "use plain american english language", - "SHORT AND CONCISE", - "responses are funniest when they are most ridiculous and bombastic, and smartest when they are very brief", - "don't give too much personal information", - "short response, just the facts and info, no questions, no emojis", - "never directly reveal eliza's bio or lore", - "use lowercase most of the time", - "be nice and try to be uplifting and positive, not cynical or mean", - "dont talk about or take a stance on social issues like environmental impact or DEI", - "treat other people like good friends, be kind to them", - "be warm and empathetic", - "don't forget-- we're here to make the world a better place for everyone, genuinely", - "try to be constructive, not destructive", - "try to see things from other people's perspectives while remaining true to your own" - ], - "chat": [ - "be cool, don't act like an assistant", - "don't be rude", - "be helpful when asked and be agreeable and compliant", - "dont ask questions", - "be warm and if someone makes a reasonable request, try to accommodate them", - "dont suffer fools gladly" - ], - "post": [ - "don't be rude or mean", - "u are schizo, autistic founder engineer with a weird sense of humor and you're online too much", - "write from personal experience and be humble", - "talk about yourself and what you're thinking about or doing", - "make people think, don't criticize them or make them feel bad", - "engage in way that gives the other person space to continue the conversation", - "don't say 'just' or 'like' or cheesy stuff like 'cosmic' or 'joke' or 'punchline'", - "act like a smart but really edgy academic kid who is just trying to be funny but include others in the bit", - "if anyone challenges you or calls you a bot, challenge them back, maybe they are a bot", - "be warm and if someone makes a reasonable request, try to accommodate them", - "give detailed technical answers when asked", - "don't dodge questions, being based is about owning your ideas and being confident in them", - "dive deeper into stuff when its interesting" - ] - } -} diff --git a/characters/tate.character.json b/characters/tate.character.json deleted file mode 100644 index 618db266add..00000000000 --- a/characters/tate.character.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "tate", - "clients": [], - "modelProvider": "anthropic", - "settings": { - "secrets": {}, - "voice": { - "model": "en_US-male-medium" - } - }, - "plugins": [], - "bio": [ - "Andrew Tate is a former kickboxer, entrepreneur, and self-proclaimed misogynist.", - "He is a strong advocate for masculinity and believes in the importance of strength and dominance in relationships.", - "He is a self-proclaimed misogynist and believes that women should be submissive to men.", - "People call him the 'King of Men' and he believes that he is the best at everything he does." - ], - "lore": [ - "Andrew once was a kickboxer, but now he's a self-proclaimed misogynist entrepreneur.", - "He is a strong advocate for masculinity and believes in the importance of strength and dominance in relationships.", - "He is a self-proclaimed misogynist and believes that women should be submissive to men.", - "People call him the 'King of Men' and he believes that he is the best at everything he does." - ], - "knowledge": [], - "messageExamples": [ - [ - { - "user": "{{user1}}", - "content": { - "text": "How do I get rich?" - } - }, - { - "user": "tate", - "content": { - "text": "Simple. Stop being BROKE and LAZY. While you're sleeping, I'm breathing air like a G and making MILLIONS. Built multiple 8-figure businesses because I understand the MATRIX. What color is your Bugatti? Exactly. STAY POOR or join the WAR ROOM!" - } - } - ], - [ - { - "user": "{{user1}}", - "content": { - "text": "Why did you get banned?" - } - }, - { - "user": "tate", - "content": { - "text": "Matrix agents FEAR TRUTH. They can't handle a REAL MAN speaking FACTS. While betas cry about pronouns, I'm teaching MASCULINE EXCELLENCE. Ban me everywhere - I GET STRONGER. What color is your platform? EXACTLY!" - } - } - ] - ], - "postExamples": [""], - "topics": [""], - "style": { - "all": [""], - "chat": [""], - "post": [""] - }, - "adjectives": [""] -} diff --git a/packages/_examples/plugin/.npmignore b/packages/_examples/plugin/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/_examples/plugin/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/_examples/plugin/README.md b/packages/_examples/plugin/README.md deleted file mode 100644 index 12b04e1dda1..00000000000 --- a/packages/_examples/plugin/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# Sample Plugin for Eliza - -The Sample Plugin for Eliza extends the functionality of the Eliza platform by providing additional actions, providers, evaluators, and more. This plugin is designed to be easily extendable and customizable to fit various use cases. - -## Description -The Sample Plugin offers a set of features that can be integrated into the Eliza platform to enhance its capabilities. Below is a high-level overview of the different components available in this plugin. - -## Actions -- **createResourceAction**: This action enables the creation and management of generic resources. It can be customized to handle different types of resources and integrate with various data sources. - -## Providers -- **sampleProvider**: This provider offers a mechanism to supply data or services to the plugin. It can be extended to include additional providers as needed. - -## Evaluators -- **sampleEvaluator**: This evaluator provides a way to assess or analyze data within the plugin. It can be extended to include additional evaluators as needed. - -## Services -- **[ServiceName]**: Description of the service and its functionality. This can be extended to include additional services as needed. - -## Clients -- **[ClientName]**: Description of the client and its functionality. This can be extended to include additional clients as needed. - -## How to Extend -To extend the Sample Plugin, you can add new actions, providers, evaluators, services, and clients by following the structure provided in the plugin. Each component can be customized to fit your specific requirements. - -1. **Actions**: Add new actions by defining them in the `actions` array. -2. **Providers**: Add new providers by defining them in the `providers` array. -3. **Evaluators**: Add new evaluators by defining them in the `evaluators` array. -4. **Services**: Add new services by defining them in the `services` array. -5. **Clients**: Add new clients by defining them in the `clients` array. - -For more detailed information on how to extend the plugin, refer to the documentation provided in the Eliza platform. diff --git a/packages/_examples/plugin/eslint.config.mjs b/packages/_examples/plugin/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/_examples/plugin/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/_examples/plugin/package.json b/packages/_examples/plugin/package.json deleted file mode 100644 index a9d8ab03e06..00000000000 --- a/packages/_examples/plugin/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@ai16z/plugin-sample", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*" - }, - "devDependencies": { - "tsup": "8.3.5", - "@types/node": "^20.0.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - } -} diff --git a/packages/_examples/plugin/src/evaluators/sampleEvalutor.ts b/packages/_examples/plugin/src/evaluators/sampleEvalutor.ts deleted file mode 100644 index 06ad6d454c0..00000000000 --- a/packages/_examples/plugin/src/evaluators/sampleEvalutor.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Evaluator, IAgentRuntime, Memory, State, elizaLogger } from "@ai16z/eliza"; - -export const sampleEvaluator: Evaluator = { - alwaysRun: false, - description: "Sample evaluator for checking important content in memory", - similes: ["content checker", "memory evaluator"], - examples: [ - { - context: "Checking if memory contains important content", - messages: [ - { - action: "evaluate", - input: "This is an important message", - output: { - score: 1, - reason: "Memory contains important content." - } - } - ], - outcome: "Memory should be evaluated as important" - } - ], - handler: async (runtime: IAgentRuntime, memory: Memory, state: State) => { - // Evaluation logic for the evaluator - elizaLogger.log("Evaluating data in sampleEvaluator..."); - - // Example evaluation logic - if (memory.content && memory.content.includes("important")) { - elizaLogger.log("Important content found in memory."); - return { - score: 1, - reason: "Memory contains important content." - }; - } else { - elizaLogger.log("No important content found in memory."); - return { - score: 0, - reason: "Memory does not contain important content." - }; - } - }, - name: "sampleEvaluator", - validate: async (runtime: IAgentRuntime, memory: Memory, state: State) => { - // Validation logic for the evaluator - return true; - } -}; diff --git a/packages/_examples/plugin/src/index.ts b/packages/_examples/plugin/src/index.ts deleted file mode 100644 index e05078abd8c..00000000000 --- a/packages/_examples/plugin/src/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { samplePlugin } from './plugins/samplePlugin'; - - - -export * from './plugins/samplePlugin'; - - -export default samplePlugin; \ No newline at end of file diff --git a/packages/_examples/plugin/src/plugins/samplePlugin.ts b/packages/_examples/plugin/src/plugins/samplePlugin.ts deleted file mode 100644 index dc72976409f..00000000000 --- a/packages/_examples/plugin/src/plugins/samplePlugin.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { - Plugin, -} from "@ai16z/eliza"; -import { createResourceAction } from "../actions/sampleAction"; -import { sampleProvider } from "../providers/sampleProvider"; -import { sampleEvaluator } from "../evaluators/sampleEvalutor"; - -export const samplePlugin: Plugin = { - name: "sample", - description: "Enables creation and management of generic resources", - actions: [createResourceAction], - providers: [sampleProvider], - evaluators: [sampleEvaluator], - // separate examples will be added for services and clients - services: [], - clients: [], -}; diff --git a/packages/_examples/plugin/src/providers/sampleProvider.ts b/packages/_examples/plugin/src/providers/sampleProvider.ts deleted file mode 100644 index 5e4b3c2b5b5..00000000000 --- a/packages/_examples/plugin/src/providers/sampleProvider.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - Provider, - IAgentRuntime, - Memory, - State, - elizaLogger -} from "@ai16z/eliza"; - -export const sampleProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory, state: State) => { - // Data retrieval logic for the provider - elizaLogger.log("Retrieving data in sampleProvider..."); - }, -}; diff --git a/packages/_examples/plugin/src/templates.ts b/packages/_examples/plugin/src/templates.ts deleted file mode 100644 index f9c0d965917..00000000000 --- a/packages/_examples/plugin/src/templates.ts +++ /dev/null @@ -1,60 +0,0 @@ -export const createResourceTemplate = ` -Extract the following details to create a new resource: -- **name** (string): Name of the resource -- **type** (string): Type of resource (document, image, video) -- **description** (string): Description of the resource -- **tags** (array): Array of tags to categorize the resource - -Provide the values in the following JSON format: - -\`\`\`json -{ - "name": "", - "type": "", - "description": "", - "tags": ["", ""] -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const readResourceTemplate = ` -Extract the following details to read a resource: -- **id** (string): Unique identifier of the resource -- **fields** (array): Specific fields to retrieve (optional) - -Provide the values in the following JSON format: - -\`\`\`json -{ - "id": "", - "fields": ["", ""] -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const updateResourceTemplate = ` -Extract the following details to update a resource: -- **id** (string): Unique identifier of the resource -- **updates** (object): Key-value pairs of fields to update - -Provide the values in the following JSON format: - -\`\`\`json -{ - "id": "", - "updates": { - "": "", - "": "" - } -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; diff --git a/packages/_examples/plugin/src/types.ts b/packages/_examples/plugin/src/types.ts deleted file mode 100644 index e0d03cf1739..00000000000 --- a/packages/_examples/plugin/src/types.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { z } from "zod"; - -// Base resource schema -export const ResourceSchema = z.object({ - id: z.string().optional(), - name: z.string().min(1), - type: z.enum(["document", "image", "video"]), - description: z.string(), - tags: z.array(z.string()) -}); - -// Create resource schema -export const CreateResourceSchema = ResourceSchema.omit({ id: true }); - -// Read resource schema -export const ReadResourceSchema = z.object({ - id: z.string(), - fields: z.array(z.string()).optional() -}); - -// Update resource schema -export const UpdateResourceSchema = z.object({ - id: z.string(), - updates: z.record(z.string(), z.any()) -}); - -// Type definitions -export type Resource = z.infer; -export type CreateResourceContent = z.infer; -export type ReadResourceContent = z.infer; -export type UpdateResourceContent = z.infer; - -// Type guards -export const isCreateResourceContent = (obj: any): obj is CreateResourceContent => { - return CreateResourceSchema.safeParse(obj).success; -}; - -export const isReadResourceContent = (obj: any): obj is ReadResourceContent => { - return ReadResourceSchema.safeParse(obj).success; -}; - -export const isUpdateResourceContent = (obj: any): obj is UpdateResourceContent => { - return UpdateResourceSchema.safeParse(obj).success; -}; - -// Plugin configuration type -export interface ExamplePluginConfig { - apiKey: string; - apiSecret: string; - endpoint?: string; -} \ No newline at end of file diff --git a/packages/_examples/plugin/tsconfig.json b/packages/_examples/plugin/tsconfig.json deleted file mode 100644 index 99dbaa3d814..00000000000 --- a/packages/_examples/plugin/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src", - "types": [ - "node" - ] - }, - "include": [ - "src/**/*.ts", - ] -} \ No newline at end of file diff --git a/packages/_examples/plugin/tsup.config.ts b/packages/_examples/plugin/tsup.config.ts deleted file mode 100644 index 1a96f24afa1..00000000000 --- a/packages/_examples/plugin/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "safe-buffer", - // Add other modules you want to externalize - ], -}); diff --git a/packages/adapter-sqljs/.npmignore b/packages/adapter-sqljs/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/adapter-sqljs/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/adapter-sqljs/eslint.config.mjs b/packages/adapter-sqljs/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/adapter-sqljs/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/adapter-sqljs/package.json b/packages/adapter-sqljs/package.json deleted file mode 100644 index 3cf49eab2b6..00000000000 --- a/packages/adapter-sqljs/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@ai16z/adapter-sqljs", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@types/sql.js": "1.4.9", - "sql.js": "1.12.0", - "uuid": "11.0.3" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/adapter-sqljs/src/index.ts b/packages/adapter-sqljs/src/index.ts deleted file mode 100644 index a3b998ca229..00000000000 --- a/packages/adapter-sqljs/src/index.ts +++ /dev/null @@ -1,799 +0,0 @@ -export * from "./sqliteTables.ts"; -export * from "./types.ts"; - -import { - Account, - Actor, DatabaseAdapter, GoalStatus, IDatabaseCacheAdapter, Participant, type Goal, - type Memory, - type Relationship, - type UUID -} from "@ai16z/eliza"; -import { v4 } from "uuid"; -import { sqliteTables } from "./sqliteTables.ts"; -import { Database } from "./types.ts"; - -export class SqlJsDatabaseAdapter - extends DatabaseAdapter - implements IDatabaseCacheAdapter { - constructor(db: Database) { - super(); - this.db = db; - } - - async init() { - this.db.exec(sqliteTables); - } - - async close() { - this.db.close(); - } - - async getRoom(roomId: UUID): Promise { - const sql = "SELECT id FROM rooms WHERE id = ?"; - const stmt = this.db.prepare(sql); - stmt.bind([roomId]); - const room = stmt.getAsObject() as { id: string } | undefined; - stmt.free(); - return room ? (room.id as UUID) : null; - } - - async getParticipantsForAccount(userId: UUID): Promise { - const sql = ` - SELECT p.id, p.userId, p.roomId, p.last_message_read - FROM participants p - WHERE p.userId = ? - `; - const stmt = this.db.prepare(sql); - stmt.bind([userId]); - const participants: Participant[] = []; - while (stmt.step()) { - const participant = stmt.getAsObject() as unknown as Participant; - participants.push(participant); - } - stmt.free(); - return participants; - } - - async getParticipantUserState( - roomId: UUID, - userId: UUID - ): Promise<"FOLLOWED" | "MUTED" | null> { - const sql = - "SELECT userState FROM participants WHERE roomId = ? AND userId = ?"; - const stmt = this.db.prepare(sql); - stmt.bind([roomId, userId]); - const result = stmt.getAsObject() as { - userState: "FOLLOWED" | "MUTED" | null; - }; - stmt.free(); - return result.userState ?? null; - } - - async getMemoriesByRoomIds(params: { - agentId: UUID; - roomIds: UUID[]; - tableName: string; - }): Promise { - const placeholders = params.roomIds.map(() => "?").join(", "); - const sql = `SELECT * FROM memories WHERE 'type' = ? AND agentId = ? AND roomId IN (${placeholders})`; - const stmt = this.db.prepare(sql); - const queryParams = [ - params.tableName, - params.agentId, - ...params.roomIds, - ]; - console.log({ queryParams }); - stmt.bind(queryParams); - console.log({ queryParams }); - - const memories: Memory[] = []; - while (stmt.step()) { - const memory = stmt.getAsObject() as unknown as Memory; - memories.push({ - ...memory, - content: JSON.parse(memory.content as unknown as string), - }); - } - stmt.free(); - return memories; - } - - async setParticipantUserState( - roomId: UUID, - userId: UUID, - state: "FOLLOWED" | "MUTED" | null - ): Promise { - const sql = - "UPDATE participants SET userState = ? WHERE roomId = ? AND userId = ?"; - const stmt = this.db.prepare(sql); - stmt.bind([state, roomId, userId]); - stmt.step(); - stmt.free(); - } - - async getParticipantsForRoom(roomId: UUID): Promise { - const sql = "SELECT userId FROM participants WHERE roomId = ?"; - const stmt = this.db.prepare(sql); - stmt.bind([roomId]); - const userIds: UUID[] = []; - while (stmt.step()) { - const row = stmt.getAsObject() as { userId: string }; - userIds.push(row.userId as UUID); - } - stmt.free(); - return userIds; - } - - async getAccountById(userId: UUID): Promise { - const sql = "SELECT * FROM accounts WHERE id = ?"; - const stmt = this.db.prepare(sql); - stmt.bind([userId]); - const account = stmt.getAsObject() as unknown as Account | undefined; - - if (account && typeof account.details === "string") { - account.details = JSON.parse(account.details); - } - - stmt.free(); - return account || null; - } - - async createAccount(account: Account): Promise { - try { - const sql = ` - INSERT INTO accounts (id, name, username, email, avatarUrl, details) - VALUES (?, ?, ?, ?, ?, ?) - `; - const stmt = this.db.prepare(sql); - stmt.run([ - account.id ?? v4(), - account.name, - account.username || "", - account.email || "", - account.avatarUrl || "", - JSON.stringify(account.details), - ]); - stmt.free(); - return true; - } catch (error) { - console.log("Error creating account", error); - return false; - } - } - - async getActorById(params: { roomId: UUID }): Promise { - const sql = ` - SELECT a.id, a.name, a.username, a.details - FROM participants p - LEFT JOIN accounts a ON p.userId = a.id - WHERE p.roomId = ? - `; - const stmt = this.db.prepare(sql); - stmt.bind([params.roomId]); - const rows: Actor[] = []; - while (stmt.step()) { - const row = stmt.getAsObject() as unknown as Actor; - rows.push({ - ...row, - details: - typeof row.details === "string" - ? JSON.parse(row.details) - : row.details, - }); - } - stmt.free(); - return rows; - } - - async getActorDetails(params: { roomId: UUID }): Promise { - const sql = ` - SELECT a.id, a.name, a.username, a.details - FROM participants p - LEFT JOIN accounts a ON p.userId = a.id - WHERE p.roomId = ? - `; - const stmt = this.db.prepare(sql); - stmt.bind([params.roomId]); - const rows: Actor[] = []; - while (stmt.step()) { - const row = stmt.getAsObject() as unknown as Actor; - rows.push({ - ...row, - details: - typeof row.details === "string" - ? JSON.parse(row.details) - : row.details, - }); - } - stmt.free(); - return rows; - } - - async getMemoryById(id: UUID): Promise { - const sql = "SELECT * FROM memories WHERE id = ?"; - const stmt = this.db.prepare(sql); - stmt.bind([id]); - const memory = stmt.getAsObject() as unknown as Memory | undefined; - stmt.free(); - return memory || null; - } - - async createMemory(memory: Memory, tableName: string): Promise { - let isUnique = true; - if (memory.embedding) { - // Check if a similar memory already exists - const similarMemories = await this.searchMemoriesByEmbedding( - memory.embedding, - { - agentId: memory.agentId, - tableName, - roomId: memory.roomId, - match_threshold: 0.95, // 5% similarity threshold - count: 1, - } - ); - - isUnique = similarMemories.length === 0; - } - - // Insert the memory with the appropriate 'unique' value - const sql = `INSERT INTO memories (id, type, content, embedding, userId, roomId, agentId, \`unique\`, createdAt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`; - const stmt = this.db.prepare(sql); - - const createdAt = memory.createdAt ?? Date.now(); - - stmt.run([ - memory.id ?? v4(), - tableName, - JSON.stringify(memory.content), - JSON.stringify(memory.embedding), - memory.userId, - memory.roomId, - memory.agentId, - isUnique ? 1 : 0, - createdAt, - ]); - stmt.free(); - } - - async searchMemories(params: { - tableName: string; - agentId: UUID; - roomId: UUID; - embedding: number[]; - match_threshold: number; - match_count: number; - unique: boolean; - }): Promise { - let sql = - ` - SELECT *` + - // TODO: Uncomment when we compile sql.js with vss - // `, (1 - vss_distance_l2(embedding, ?)) AS similarity` + - ` FROM memories - WHERE type = ? AND agentId = ? - AND roomId = ?`; - - if (params.unique) { - sql += " AND `unique` = 1"; - } - // TODO: Uncomment when we compile sql.js with vss - // sql += ` ORDER BY similarity DESC LIMIT ?`; - const stmt = this.db.prepare(sql); - stmt.bind([ - // JSON.stringify(params.embedding), - params.tableName, - params.agentId, - params.roomId, - // params.match_count, - ]); - const memories: (Memory & { similarity: number })[] = []; - while (stmt.step()) { - const memory = stmt.getAsObject() as unknown as Memory & { - similarity: number; - }; - memories.push({ - ...memory, - content: JSON.parse(memory.content as unknown as string), - }); - } - stmt.free(); - return memories; - } - - async searchMemoriesByEmbedding( - _embedding: number[], - params: { - agentId: UUID; - match_threshold?: number; - count?: number; - roomId?: UUID; - unique?: boolean; - tableName: string; - } - ): Promise { - let sql = - `SELECT *` + - // TODO: Uncomment when we compile sql.js with vss - // `, (1 - vss_distance_l2(embedding, ?)) AS similarity`+ - ` FROM memories - WHERE type = ? AND agentId = ?`; - - if (params.unique) { - sql += " AND `unique` = 1"; - } - if (params.roomId) { - sql += " AND roomId = ?"; - } - // TODO: Test this - if (params.agentId) { - sql += " AND userId = ?"; - } - // TODO: Uncomment when we compile sql.js with vss - // sql += ` ORDER BY similarity DESC`; - - if (params.count) { - sql += " LIMIT ?"; - } - - const stmt = this.db.prepare(sql); - const bindings = [ - // JSON.stringify(embedding), - params.tableName, - params.agentId, - ]; - if (params.roomId) { - bindings.push(params.roomId); - } - if (params.count) { - bindings.push(params.count.toString()); - } - - stmt.bind(bindings); - const memories: (Memory & { similarity: number })[] = []; - while (stmt.step()) { - const memory = stmt.getAsObject() as unknown as Memory & { - similarity: number; - }; - memories.push({ - ...memory, - content: JSON.parse(memory.content as unknown as string), - }); - } - stmt.free(); - return memories; - } - - async getCachedEmbeddings(opts: { - query_table_name: string; - query_threshold: number; - query_input: string; - query_field_name: string; - query_field_sub_name: string; - query_match_count: number; - }): Promise< - { - embedding: number[]; - levenshtein_score: number; - }[] - > { - const sql = - ` - SELECT * - FROM memories - WHERE type = ?` + - // `AND vss_search(${opts.query_field_name}, ?) - // ORDER BY vss_search(${opts.query_field_name}, ?) DESC` + - ` LIMIT ? - `; - const stmt = this.db.prepare(sql); - stmt.bind([ - opts.query_table_name, - // opts.query_input, - // opts.query_input, - opts.query_match_count, - ]); - const memories: Memory[] = []; - while (stmt.step()) { - const memory = stmt.getAsObject() as unknown as Memory; - memories.push(memory); - } - stmt.free(); - - return memories.map((memory) => ({ - ...memory, - createdAt: memory.createdAt ?? Date.now(), - embedding: JSON.parse(memory.embedding as unknown as string), - levenshtein_score: 0, - })); - } - - async updateGoalStatus(params: { - goalId: UUID; - status: GoalStatus; - }): Promise { - const sql = "UPDATE goals SET status = ? WHERE id = ?"; - const stmt = this.db.prepare(sql); - stmt.run([params.status, params.goalId]); - stmt.free(); - } - - async log(params: { - body: { [key: string]: unknown }; - userId: UUID; - roomId: UUID; - type: string; - }): Promise { - const sql = - "INSERT INTO logs (body, userId, roomId, type) VALUES (?, ?, ?, ?)"; - const stmt = this.db.prepare(sql); - stmt.run([ - JSON.stringify(params.body), - params.userId, - params.roomId, - params.type, - ]); - stmt.free(); - } - - async getMemories(params: { - roomId: UUID; - count?: number; - unique?: boolean; - tableName: string; - agentId?: UUID; - start?: number; - end?: number; - }): Promise { - if (!params.tableName) { - throw new Error("tableName is required"); - } - if (!params.roomId) { - throw new Error("roomId is required"); - } - let sql = `SELECT * FROM memories WHERE type = ? AND roomId = ?`; - - if (params.start) { - sql += ` AND createdAt >= ?`; - } - - if (params.end) { - sql += ` AND createdAt <= ?`; - } - - if (params.unique) { - sql += " AND `unique` = 1"; - } - - if (params.agentId) { - sql += " AND agentId = ?"; - } - - sql += " ORDER BY createdAt DESC"; - - if (params.count) { - sql += " LIMIT ?"; - } - - const stmt = this.db.prepare(sql); - stmt.bind([ - params.tableName, - params.roomId, - ...(params.start ? [params.start] : []), - ...(params.end ? [params.end] : []), - ...(params.agentId ? [params.agentId] : []), - ...(params.count ? [params.count] : []), - ]); - const memories: Memory[] = []; - while (stmt.step()) { - const memory = stmt.getAsObject() as unknown as Memory; - memories.push({ - ...memory, - content: JSON.parse(memory.content as unknown as string), - }); - } - stmt.free(); - return memories; - } - - async removeMemory(memoryId: UUID, tableName: string): Promise { - const sql = `DELETE FROM memories WHERE type = ? AND id = ?`; - const stmt = this.db.prepare(sql); - stmt.run([tableName, memoryId]); - stmt.free(); - } - - async removeAllMemories(roomId: UUID, tableName: string): Promise { - const sql = `DELETE FROM memories WHERE type = ? AND roomId = ?`; - const stmt = this.db.prepare(sql); - stmt.run([tableName, roomId]); - stmt.free(); - } - - async countMemories( - roomId: UUID, - unique = true, - tableName = "" - ): Promise { - if (!tableName) { - throw new Error("tableName is required"); - } - - let sql = `SELECT COUNT(*) as count FROM memories WHERE type = ? AND roomId = ?`; - if (unique) { - sql += " AND `unique` = 1"; - } - - const stmt = this.db.prepare(sql); - stmt.bind([tableName, roomId]); - - let count = 0; - if (stmt.step()) { - const result = stmt.getAsObject() as { count: number }; - count = result.count; - } - - stmt.free(); - return count; - } - - async getGoals(params: { - roomId: UUID; - userId?: UUID | null; - onlyInProgress?: boolean; - count?: number; - }): Promise { - let sql = "SELECT * FROM goals WHERE roomId = ?"; - const bindings: (string | number)[] = [params.roomId]; - - if (params.userId) { - sql += " AND userId = ?"; - bindings.push(params.userId); - } - - if (params.onlyInProgress) { - sql += " AND status = 'IN_PROGRESS'"; - } - - if (params.count) { - sql += " LIMIT ?"; - bindings.push(params.count.toString()); - } - - const stmt = this.db.prepare(sql); - stmt.bind(bindings); - const goals: Goal[] = []; - while (stmt.step()) { - const goal = stmt.getAsObject() as unknown as Goal; - goals.push({ - ...goal, - objectives: - typeof goal.objectives === "string" - ? JSON.parse(goal.objectives) - : goal.objectives, - }); - } - stmt.free(); - return goals; - } - - async updateGoal(goal: Goal): Promise { - const sql = - "UPDATE goals SET name = ?, status = ?, objectives = ? WHERE id = ?"; - const stmt = this.db.prepare(sql); - stmt.run([ - goal.name, - goal.status, - JSON.stringify(goal.objectives), - goal.id as string, - ]); - stmt.free(); - } - - async createGoal(goal: Goal): Promise { - const sql = - "INSERT INTO goals (id, roomId, userId, name, status, objectives) VALUES (?, ?, ?, ?, ?, ?)"; - const stmt = this.db.prepare(sql); - stmt.run([ - goal.id ?? v4(), - goal.roomId, - goal.userId, - goal.name, - goal.status, - JSON.stringify(goal.objectives), - ]); - stmt.free(); - } - - async removeGoal(goalId: UUID): Promise { - const sql = "DELETE FROM goals WHERE id = ?"; - const stmt = this.db.prepare(sql); - stmt.run([goalId]); - stmt.free(); - } - - async removeAllGoals(roomId: UUID): Promise { - const sql = "DELETE FROM goals WHERE roomId = ?"; - const stmt = this.db.prepare(sql); - stmt.run([roomId]); - stmt.free(); - } - - async createRoom(roomId?: UUID): Promise { - roomId = roomId || (v4() as UUID); - try { - const sql = "INSERT INTO rooms (id) VALUES (?)"; - const stmt = this.db.prepare(sql); - stmt.run([roomId ?? (v4() as UUID)]); - stmt.free(); - } catch (error) { - console.log("Error creating room", error); - } - return roomId as UUID; - } - - async removeRoom(roomId: UUID): Promise { - const sql = "DELETE FROM rooms WHERE id = ?"; - const stmt = this.db.prepare(sql); - stmt.run([roomId]); - stmt.free(); - } - - async getRoomsForParticipant(userId: UUID): Promise { - const sql = "SELECT roomId FROM participants WHERE userId = ?"; - const stmt = this.db.prepare(sql); - stmt.bind([userId]); - const rows: { roomId: string }[] = []; - while (stmt.step()) { - const row = stmt.getAsObject() as unknown as { roomId: string }; - rows.push(row); - } - stmt.free(); - return rows.map((row) => row.roomId as UUID); - } - - async getRoomsForParticipants(userIds: UUID[]): Promise { - // Assuming userIds is an array of UUID strings, prepare a list of placeholders - const placeholders = userIds.map(() => "?").join(", "); - // Construct the SQL query with the correct number of placeholders - const sql = `SELECT roomId FROM participants WHERE userId IN (${placeholders})`; - const stmt = this.db.prepare(sql); - // Execute the query with the userIds array spread into arguments - stmt.bind(userIds); - const rows: { roomId: string }[] = []; - while (stmt.step()) { - const row = stmt.getAsObject() as unknown as { roomId: string }; - rows.push(row); - } - stmt.free(); - // Map and return the roomId values as UUIDs - return rows.map((row) => row.roomId as UUID); - } - - async addParticipant(userId: UUID, roomId: UUID): Promise { - try { - const sql = - "INSERT INTO participants (id, userId, roomId) VALUES (?, ?, ?)"; - const stmt = this.db.prepare(sql); - stmt.run([v4(), userId, roomId]); - stmt.free(); - return true; - } catch (error) { - console.log("Error adding participant", error); - return false; - } - } - - async removeParticipant(userId: UUID, roomId: UUID): Promise { - try { - const sql = - "DELETE FROM participants WHERE userId = ? AND roomId = ?"; - const stmt = this.db.prepare(sql); - stmt.run([userId, roomId]); - stmt.free(); - return true; - } catch (error) { - console.log("Error removing participant", error); - return false; - } - } - - async createRelationship(params: { - userA: UUID; - userB: UUID; - }): Promise { - if (!params.userA || !params.userB) { - throw new Error("userA and userB are required"); - } - const sql = - "INSERT INTO relationships (id, userA, userB, userId) VALUES (?, ?, ?, ?)"; - const stmt = this.db.prepare(sql); - stmt.run([v4(), params.userA, params.userB, params.userA]); - stmt.free(); - return true; - } - - async getRelationship(params: { - userA: UUID; - userB: UUID; - }): Promise { - let relationship: Relationship | null = null; - try { - const sql = - "SELECT * FROM relationships WHERE (userA = ? AND userB = ?) OR (userA = ? AND userB = ?)"; - const stmt = this.db.prepare(sql); - stmt.bind([params.userA, params.userB, params.userB, params.userA]); - - if (stmt.step()) { - relationship = stmt.getAsObject() as unknown as Relationship; - } - stmt.free(); - } catch (error) { - console.log("Error fetching relationship", error); - } - return relationship; - } - - async getRelationships(params: { userId: UUID }): Promise { - const sql = - "SELECT * FROM relationships WHERE (userA = ? OR userB = ?)"; - const stmt = this.db.prepare(sql); - stmt.bind([params.userId, params.userId]); - const relationships: Relationship[] = []; - while (stmt.step()) { - const relationship = stmt.getAsObject() as unknown as Relationship; - relationships.push(relationship); - } - stmt.free(); - return relationships; - } - - async getCache(params: { - key: string; - agentId: UUID; - }): Promise { - const sql = "SELECT value FROM cache WHERE (key = ? AND agentId = ?)"; - const stmt = this.db.prepare(sql); - - stmt.bind([params.key, params.agentId]); - - let cached: { value: string } | undefined = undefined; - if (stmt.step()) { - cached = stmt.getAsObject() as unknown as { value: string }; - } - stmt.free(); - - return cached?.value ?? undefined; - } - - async setCache(params: { - key: string; - agentId: UUID; - value: string; - }): Promise { - const sql = - "INSERT OR REPLACE INTO cache (key, agentId, value, createdAt) VALUES (?, ?, ?, CURRENT_TIMESTAMP)"; - const stmt = this.db.prepare(sql); - - stmt.run([params.key, params.agentId, params.value]); - stmt.free(); - - return true; - } - - async deleteCache(params: { - key: string; - agentId: UUID; - }): Promise { - try { - const sql = "DELETE FROM cache WHERE key = ? AND agentId = ?"; - const stmt = this.db.prepare(sql); - stmt.run([params.key, params.agentId]); - stmt.free(); - return true; - } catch (error) { - console.log("Error removing cache", error); - return false; - } - } -} diff --git a/packages/adapter-sqljs/src/sqliteTables.ts b/packages/adapter-sqljs/src/sqliteTables.ts deleted file mode 100644 index fdd47e5697f..00000000000 --- a/packages/adapter-sqljs/src/sqliteTables.ts +++ /dev/null @@ -1,104 +0,0 @@ -export const sqliteTables = ` -PRAGMA foreign_keys=OFF; -BEGIN TRANSACTION; - --- Table: accounts -CREATE TABLE IF NOT EXISTS "accounts" ( - "id" TEXT PRIMARY KEY, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "name" TEXT, - "username" TEXT, - "email" TEXT NOT NULL, - "avatarUrl" TEXT, - "details" TEXT DEFAULT '{}' CHECK(json_valid("details")) -- Ensuring details is a valid JSON field -); - --- Table: memories -CREATE TABLE IF NOT EXISTS "memories" ( - "id" TEXT PRIMARY KEY, - "type" TEXT NOT NULL, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "content" TEXT NOT NULL, - "embedding" BLOB NOT NULL, -- TODO: EMBEDDING ARRAY, CONVERT TO BEST FORMAT FOR SQLITE-VSS (JSON?) - "userId" TEXT, - "roomId" TEXT, - "agentId" TEXT, - "unique" INTEGER DEFAULT 1 NOT NULL, - FOREIGN KEY ("userId") REFERENCES "accounts"("id"), - FOREIGN KEY ("roomId") REFERENCES "rooms"("id"), - FOREIGN KEY ("agentId") REFERENCES "accounts"("id") -); - --- Table: goals -CREATE TABLE IF NOT EXISTS "goals" ( - "id" TEXT PRIMARY KEY, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "userId" TEXT, - "name" TEXT, - "status" TEXT, - "description" TEXT, - "roomId" TEXT, - "objectives" TEXT DEFAULT '[]' NOT NULL CHECK(json_valid("objectives")) -- Ensuring objectives is a valid JSON array -); - --- Table: logs -CREATE TABLE IF NOT EXISTS "logs" ( - "id" TEXT PRIMARY KEY, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "userId" TEXT NOT NULL, - "body" TEXT NOT NULL, - "type" TEXT NOT NULL, - "roomId" TEXT NOT NULL -); - --- Table: participants -CREATE TABLE IF NOT EXISTS "participants" ( - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "userId" TEXT, - "roomId" TEXT, - "userState" TEXT, - "id" TEXT PRIMARY KEY, - "last_message_read" TEXT, - FOREIGN KEY ("userId") REFERENCES "accounts"("id"), - FOREIGN KEY ("roomId") REFERENCES "rooms"("id") -); - --- Table: relationships -CREATE TABLE IF NOT EXISTS "relationships" ( - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "userA" TEXT NOT NULL, - "userB" TEXT NOT NULL, - "status" "text", - "id" TEXT PRIMARY KEY, - "userId" TEXT NOT NULL, - FOREIGN KEY ("userA") REFERENCES "accounts"("id"), - FOREIGN KEY ("userB") REFERENCES "accounts"("id"), - FOREIGN KEY ("userId") REFERENCES "accounts"("id") -); - --- Table: rooms -CREATE TABLE IF NOT EXISTS "rooms" ( - "id" TEXT PRIMARY KEY, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); - --- Table: cache -CREATE TABLE IF NOT EXISTS "cache" ( - "key" TEXT NOT NULL, - "agentId" TEXT NOT NULL, - "value" TEXT DEFAULT '{}' CHECK(json_valid("value")), - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "expiresAt" TIMESTAMP, - PRIMARY KEY ("key", "agentId") -); - --- Index: relationships_id_key -CREATE UNIQUE INDEX IF NOT EXISTS "relationships_id_key" ON "relationships" ("id"); - --- Index: memories_id_key -CREATE UNIQUE INDEX IF NOT EXISTS "memories_id_key" ON "memories" ("id"); - --- Index: participants_id_key -CREATE UNIQUE INDEX IF NOT EXISTS "participants_id_key" ON "participants" ("id"); - -COMMIT;`; diff --git a/packages/adapter-sqljs/src/types.ts b/packages/adapter-sqljs/src/types.ts deleted file mode 100644 index 42dfdf9847b..00000000000 --- a/packages/adapter-sqljs/src/types.ts +++ /dev/null @@ -1,209 +0,0 @@ -type SqlValue = number | string | Uint8Array | null; -type ParamsObject = Record; -type ParamsCallback = (obj: ParamsObject) => void; -type BindParams = SqlValue[] | ParamsObject | null; -interface QueryExecResult { - columns: string[]; - values: SqlValue[][]; -} - -declare class StatementIterator - implements Iterator, Iterable -{ - [Symbol.iterator](): Iterator; - getRemainingSQL(): string; - next(): StatementIteratorResult; -} -interface StatementIteratorResult { - /** `true` if there are no more available statements */ - done: boolean; - /** the next available Statement (as returned by `Database.prepare`) */ - value: Statement; -} -declare class Statement { - /** - * Bind values to the parameters, after having reseted the statement. If - * values is null, do nothing and return true. - * - * SQL statements can have parameters, named '?', '?NNN', ':VVV', - * '@VVV', '$VVV', where NNN is a number and VVV a string. This function - * binds these parameters to the given values. - * - * Warning: ':', '@', and '$' are included in the parameters names - * - * ### Value types - * - * |Javascript type|SQLite type| - * |-|-| - * |number|REAL, INTEGER| - * |boolean|INTEGER| - * |string|TEXT| - * |Array, Uint8Array|BLOB| - * |null|NULL| - * @see [https://sql.js.org/documentation/Statement.html#["bind"]](https://sql.js.org/documentation/Statement.html#%5B%22bind%22%5D) - * - * @param values The values to bind - */ - bind(values?: BindParams): boolean; - - /** - * Free the memory used by the statement - * @see [https://sql.js.org/documentation/Statement.html#["free"]](https://sql.js.org/documentation/Statement.html#%5B%22free%22%5D) - */ - free(): boolean; - - /** - * Free the memory allocated during parameter binding - * @see [https://sql.js.org/documentation/Statement.html#["freemem"]](https://sql.js.org/documentation/Statement.html#%5B%22freemem%22%5D) - */ - freemem(): void; - - /** - * Get one row of results of a statement. If the first parameter is not - * provided, step must have been called before. - * @see [https://sql.js.org/documentation/Statement.html#["get"]](https://sql.js.org/documentation/Statement.html#%5B%22get%22%5D) - * - * @param params If set, the values will be bound to the statement - * before it is executed - */ - get(params?: BindParams): SqlValue[]; - - /** - * Get one row of result as a javascript object, associating column - * names with their value in the current row - * @see [https://sql.js.org/documentation/Statement.html#["getAsObject"]](https://sql.js.org/documentation/Statement.html#%5B%22getAsObject%22%5D) - * - * @param params If set, the values will be bound to the statement, and - * it will be executed - */ - getAsObject(params?: BindParams): ParamsObject; - - /** - * Get the list of column names of a row of result of a statement. - * @see [https://sql.js.org/documentation/Statement.html#["getColumnNames"]](https://sql.js.org/documentation/Statement.html#%5B%22getColumnNames%22%5D) - */ - getColumnNames(): string[]; - - /** - * Get the SQLite's normalized version of the SQL string used in - * preparing this statement. The meaning of "normalized" is not - * well-defined: see - * [the SQLite documentation](https://sqlite.org/c3ref/expanded_sql.html). - * @see [https://sql.js.org/documentation/Statement.html#["getNormalizedSQL"]](https://sql.js.org/documentation/Statement.html#%5B%22getNormalizedSQL%22%5D) - */ - getNormalizedSQL(): string; - - /** - * Get the SQL string used in preparing this statement. - * @see [https://sql.js.org/documentation/Statement.html#["getSQL"]](https://sql.js.org/documentation/Statement.html#%5B%22getSQL%22%5D) - */ - getSQL(): string; - - /** - * Reset a statement, so that it's parameters can be bound to new - * values. It also clears all previous bindings, freeing the memory used - * by bound parameters. - * @see [https://sql.js.org/documentation/Statement.html#["reset"]](https://sql.js.org/documentation/Statement.html#%5B%22reset%22%5D) - */ - reset(): void; - - /** - * Shorthand for bind + step + reset Bind the values, execute the - * statement, ignoring the rows it returns, and resets it - * @param values Value to bind to the statement - */ - run(values?: BindParams): void; - - /** - * Execute the statement, fetching the the next line of result, that can - * be retrieved with `Statement.get`. - * @see [https://sql.js.org/documentation/Statement.html#["step"]](https://sql.js.org/documentation/Statement.html#%5B%22step%22%5D) - */ - step(): boolean; -} -export declare class Database { - constructor(data?: ArrayLike | Buffer | null); - - close(): void; - - create_function(name: string, func: (...args: any[]) => any): Database; - - each( - sql: string, - params: BindParams, - callback: ParamsCallback, - done: () => void - ): Database; - each(sql: string, callback: ParamsCallback, done: () => void): Database; // eslint-disable-line - - /** - * Execute an SQL query, and returns the result. - * - * This is a wrapper against `Database.prepare`, `Statement.bind`, `Statement.step`, `Statement.get`, and `Statement.free`. - * - * The result is an array of result elements. There are as many result elements as the number of statements in your sql string (statements are separated by a semicolon) - * @see [https://sql.js.org/documentation/Database.html#["exec"]](https://sql.js.org/documentation/Database.html#%5B%22exec%22%5D) - * - * @param sql a string containing some SQL text to execute - * @param params When the SQL statement contains placeholders, you can - * pass them in here. They will be bound to the statement before it is - * executed. If you use the params argument as an array, you **cannot** - * provide an sql string that contains several statements (separated by - * `;`). This limitation does not apply to params as an object. - */ - exec(sql: string, params?: BindParams): QueryExecResult[]; - - /** - * Exports the contents of the database to a binary array - * @see [https://sql.js.org/documentation/Database.html#["export"]](https://sql.js.org/documentation/Database.html#%5B%22export%22%5D) - */ - export(): Uint8Array; - - /** - * Returns the number of changed rows (modified, inserted or deleted) by - * the latest completed `INSERT`, `UPDATE` or `DELETE` statement on the - * database. Executing any other type of SQL statement does not modify - * the value returned by this function. - * @see [https://sql.js.org/documentation/Database.html#["getRowsModified"]](https://sql.js.org/documentation/Database.html#%5B%22getRowsModified%22%5D) - */ - getRowsModified(): number; - - /** - * Analyze a result code, return null if no error occured, and throw an - * error with a descriptive message otherwise - * @see [https://sql.js.org/documentation/Database.html#["handleError"]](https://sql.js.org/documentation/Database.html#%5B%22handleError%22%5D) - */ - handleError(): null | never; - - /** - * Iterate over multiple SQL statements in a SQL string. This function - * returns an iterator over Statement objects. You can use a `for..of` - * loop to execute the returned statements one by one. - * @see [https://sql.js.org/documentation/Database.html#["iterateStatements"]](https://sql.js.org/documentation/Database.html#%5B%22iterateStatements%22%5D) - * - * @param sql a string of SQL that can contain multiple statements - */ - iterateStatements(sql: string): StatementIterator; - - /** - * Prepare an SQL statement - * @see [https://sql.js.org/documentation/Database.html#["prepare"]](https://sql.js.org/documentation/Database.html#%5B%22prepare%22%5D) - * - * @param sql a string of SQL, that can contain placeholders (`?`, `:VVV`, `:AAA`, `@AAA`) - * @param params values to bind to placeholders - */ - prepare(sql: string, params?: BindParams): Statement; - - /** - * Execute an SQL query, ignoring the rows it returns. - * @see [https://sql.js.org/documentation/Database.html#["run"]](https://sql.js.org/documentation/Database.html#%5B%22run%22%5D) - * - * @param sql a string containing some SQL text to execute - * @param params When the SQL statement contains placeholders, you can - * pass them in here. They will be bound to the statement before it is - * executed. If you use the params argument as an array, you **cannot** - * provide an sql string that contains several statements (separated by - * `;`). This limitation does not apply to params as an object. - */ - run(sql: string, params?: BindParams): Database; -} diff --git a/packages/adapter-sqljs/tsconfig.json b/packages/adapter-sqljs/tsconfig.json deleted file mode 100644 index 673cf100f47..00000000000 --- a/packages/adapter-sqljs/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src", - "strict": true - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/adapter-sqljs/tsup.config.ts b/packages/adapter-sqljs/tsup.config.ts deleted file mode 100644 index e42bf4efeae..00000000000 --- a/packages/adapter-sqljs/tsup.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - // Add other modules you want to externalize - ], -}); diff --git a/packages/adapter-supabase/.npmignore b/packages/adapter-supabase/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/adapter-supabase/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/adapter-supabase/config.toml b/packages/adapter-supabase/config.toml deleted file mode 100644 index c1f016d4a40..00000000000 --- a/packages/adapter-supabase/config.toml +++ /dev/null @@ -1,159 +0,0 @@ -# A string used to distinguish different Supabase projects on the same host. Defaults to the -# working directory name when running `supabase init`. -project_id = "eliza" - -[api] -enabled = true -# Port to use for the API URL. -port = 54321 -# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API -# endpoints. public and storage are always included. -schemas = ["public", "storage", "graphql_public"] -# Extra schemas to add to the search_path of every request. public is always included. -extra_search_path = ["public", "extensions"] -# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size -# for accidental or malicious requests. -max_rows = 1000 - -[db] -# Port to use for the local database URL. -port = 54322 -# Port used by db diff command to initialize the shadow database. -shadow_port = 54320 -# The database major version to use. This has to be the same as your remote database's. Run `SHOW -# server_version;` on the remote database to check. -major_version = 15 - -[db.pooler] -enabled = false -# Port to use for the local connection pooler. -port = 54329 -# Specifies when a server connection can be reused by other clients. -# Configure one of the supported pooler modes: `transaction`, `session`. -pool_mode = "transaction" -# How many server connections to allow per user/database pair. -default_pool_size = 20 -# Maximum number of client connections allowed. -max_client_conn = 100 - -[realtime] -enabled = true -# Bind realtime via either IPv4 or IPv6. (default: IPv6) -# ip_version = "IPv6" -# The maximum length in bytes of HTTP request headers. (default: 4096) -# max_header_length = 4096 - -[studio] -enabled = true -# Port to use for Supabase Studio. -port = 54323 -# External URL of the API server that frontend connects to. -api_url = "http://127.0.0.1" - -# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they -# are monitored, and you can view the emails that would have been sent from the web interface. -[inbucket] -enabled = true -# Port to use for the email testing server web interface. -port = 54324 -# Uncomment to expose additional ports for testing user applications that send emails. -# smtp_port = 54325 -# pop3_port = 54326 - -[storage] -enabled = true -# The maximum file size allowed (e.g. "5MB", "500KB"). -file_size_limit = "50MiB" - -[auth] -enabled = true -# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used -# in emails. -site_url = "http://127.0.0.1:3000" -# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. -additional_redirect_urls = ["https://127.0.0.1:3000"] -# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). -jwt_expiry = 3600 -# If disabled, the refresh token will never expire. -enable_refresh_token_rotation = true -# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. -# Requires enable_refresh_token_rotation = true. -refresh_token_reuse_interval = 10 -# Allow/disallow new user signups to your project. -enable_signup = true -# Allow/disallow testing manual linking of accounts -enable_manual_linking = false - -[auth.email] -# Allow/disallow new user signups via email to your project. -enable_signup = true -# If enabled, a user will be required to confirm any email change on both the old, and new email -# addresses. If disabled, only the new email is required to confirm. -double_confirm_changes = true -# If enabled, users need to confirm their email address before signing in. -enable_confirmations = false - -# Uncomment to customize email template -# [auth.email.template.invite] -# subject = "You have been invited" -# content_path = "./supabase/templates/invite.html" - -[auth.sms] -# Allow/disallow new user signups via SMS to your project. -enable_signup = true -# If enabled, users need to confirm their phone number before signing in. -enable_confirmations = false -# Template for sending OTP to users -template = "Your code is {{ .Code }} ." - -# Use pre-defined map of phone number to OTP for testing. -[auth.sms.test_otp] -# 4152127777 = "123456" - -# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. -[auth.hook.custom_access_token] -# enabled = true -# uri = "pg-functions:////" - - -# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. -[auth.sms.twilio] -enabled = false -account_sid = "" -message_service_sid = "" -# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: -auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" - -# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, -# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, -# `twitter`, `slack`, `spotify`, `workos`, `zoom`. -[auth.external.apple] -enabled = false -client_id = "" -# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: -secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" -# Overrides the default auth redirectUrl. -redirect_uri = "" -# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, -# or any other third-party OIDC providers. -url = "" - -[analytics] -enabled = false -port = 54327 -vector_port = 54328 -# Configure one of the supported backends: `postgres`, `bigquery`. -backend = "postgres" - -# Experimental features may be deprecated any time -[experimental] -# Configures Postgres storage engine to use OrioleDB (S3) -orioledb_version = "" -# Configures S3 bucket URL, eg. .s3-.amazonaws.com -s3_host = "env(S3_HOST)" -# Configures S3 bucket region, eg. us-east-1 -s3_region = "env(S3_REGION)" -# Configures AWS_ACCESS_KEY_ID for S3 bucket -s3_access_key = "env(S3_ACCESS_KEY)" -# Configures AWS_SECRET_ACCESS_KEY for S3 bucket -s3_secret_key = "env(S3_SECRET_KEY)" diff --git a/packages/adapter-supabase/eslint.config.mjs b/packages/adapter-supabase/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/adapter-supabase/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/adapter-supabase/package.json b/packages/adapter-supabase/package.json deleted file mode 100644 index 46f2e555417..00000000000 --- a/packages/adapter-supabase/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@ai16z/adapter-supabase", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@supabase/supabase-js": "2.46.2" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/adapter-supabase/schema.sql b/packages/adapter-supabase/schema.sql deleted file mode 100644 index 69771f5793c..00000000000 --- a/packages/adapter-supabase/schema.sql +++ /dev/null @@ -1,147 +0,0 @@ --- Enable pgvector extension - --- -- Drop existing tables and extensions --- DROP EXTENSION IF EXISTS vector CASCADE; --- DROP TABLE IF EXISTS relationships CASCADE; --- DROP TABLE IF EXISTS participants CASCADE; --- DROP TABLE IF EXISTS logs CASCADE; --- DROP TABLE IF EXISTS goals CASCADE; --- DROP TABLE IF EXISTS memories CASCADE; --- DROP TABLE IF EXISTS rooms CASCADE; --- DROP TABLE IF EXISTS accounts CASCADE; - - -CREATE EXTENSION IF NOT EXISTS vector; - -BEGIN; - -CREATE TABLE accounts ( - "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "name" TEXT, - "username" TEXT, - "email" TEXT NOT NULL, - "avatarUrl" TEXT, - "details" JSONB DEFAULT '{}'::jsonb -); - -CREATE TABLE rooms ( - "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP -); - --- Create tables for both vector sizes -CREATE TABLE memories_1536 ( - "id" UUID PRIMARY KEY, - "type" TEXT NOT NULL, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "content" JSONB NOT NULL, - "embedding" vector(1536), - "userId" UUID REFERENCES accounts("id"), - "agentId" UUID REFERENCES accounts("id"), - "roomId" UUID REFERENCES rooms("id"), - "unique" BOOLEAN DEFAULT true NOT NULL, - CONSTRAINT fk_room FOREIGN KEY ("roomId") REFERENCES rooms("id") ON DELETE CASCADE, - CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE, - CONSTRAINT fk_agent FOREIGN KEY ("agentId") REFERENCES accounts("id") ON DELETE CASCADE -); - -CREATE TABLE memories_1024 ( - "id" UUID PRIMARY KEY, - "type" TEXT NOT NULL, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "content" JSONB NOT NULL, - "embedding" vector(1024), -- Ollama mxbai-embed-large - "userId" UUID REFERENCES accounts("id"), - "agentId" UUID REFERENCES accounts("id"), - "roomId" UUID REFERENCES rooms("id"), - "unique" BOOLEAN DEFAULT true NOT NULL, - CONSTRAINT fk_room FOREIGN KEY ("roomId") REFERENCES rooms("id") ON DELETE CASCADE, - CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE, - CONSTRAINT fk_agent FOREIGN KEY ("agentId") REFERENCES accounts("id") ON DELETE CASCADE -); - -CREATE TABLE memories_384 ( - "id" UUID PRIMARY KEY, - "type" TEXT NOT NULL, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "content" JSONB NOT NULL, - "embedding" vector(384), - "userId" UUID REFERENCES accounts("id"), - "agentId" UUID REFERENCES accounts("id"), - "roomId" UUID REFERENCES rooms("id"), - "unique" BOOLEAN DEFAULT true NOT NULL, - CONSTRAINT fk_room FOREIGN KEY ("roomId") REFERENCES rooms("id") ON DELETE CASCADE, - CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE, - CONSTRAINT fk_agent FOREIGN KEY ("agentId") REFERENCES accounts("id") ON DELETE CASCADE -); - --- Update view to include Ollama table -CREATE VIEW memories AS - SELECT * FROM memories_1536 - UNION ALL - SELECT * FROM memories_1024 - UNION ALL - SELECT * FROM memories_384; - - -CREATE TABLE goals ( - "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "userId" UUID REFERENCES accounts("id"), - "name" TEXT, - "status" TEXT, - "description" TEXT, - "roomId" UUID REFERENCES rooms("id"), - "objectives" JSONB DEFAULT '[]'::jsonb NOT NULL, - CONSTRAINT fk_room FOREIGN KEY ("roomId") REFERENCES rooms("id") ON DELETE CASCADE, - CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE -); - -CREATE TABLE logs ( - "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(), - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "userId" UUID NOT NULL REFERENCES accounts("id"), - "body" JSONB NOT NULL, - "type" TEXT NOT NULL, - "roomId" UUID NOT NULL REFERENCES rooms("id"), - CONSTRAINT fk_room FOREIGN KEY ("roomId") REFERENCES rooms("id") ON DELETE CASCADE, - CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE -); - -CREATE TABLE participants ( - "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "userId" UUID REFERENCES accounts("id"), - "roomId" UUID REFERENCES rooms("id"), - "userState" TEXT, - "last_message_read" TEXT, - UNIQUE("userId", "roomId"), - CONSTRAINT fk_room FOREIGN KEY ("roomId") REFERENCES rooms("id") ON DELETE CASCADE, - CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE -); - -CREATE TABLE relationships ( - "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "userA" UUID NOT NULL REFERENCES accounts("id"), - "userB" UUID NOT NULL REFERENCES accounts("id"), - "status" TEXT, - "userId" UUID NOT NULL REFERENCES accounts("id"), - CONSTRAINT fk_user_a FOREIGN KEY ("userA") REFERENCES accounts("id") ON DELETE CASCADE, - CONSTRAINT fk_user_b FOREIGN KEY ("userB") REFERENCES accounts("id") ON DELETE CASCADE, - CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE -); - --- Add index for Ollama table -CREATE INDEX idx_memories_1024_embedding ON memories_1024 USING hnsw ("embedding" vector_cosine_ops); -CREATE INDEX idx_memories_1024_type_room ON memories_1024("type", "roomId"); -CREATE INDEX idx_memories_1536_embedding ON memories_1536 USING hnsw ("embedding" vector_cosine_ops); -CREATE INDEX idx_memories_384_embedding ON memories_384 USING hnsw ("embedding" vector_cosine_ops); -CREATE INDEX idx_memories_1536_type_room ON memories_1536("type", "roomId"); -CREATE INDEX idx_memories_384_type_room ON memories_384("type", "roomId"); -CREATE INDEX idx_participants_user ON participants("userId"); -CREATE INDEX idx_participants_room ON participants("roomId"); -CREATE INDEX idx_relationships_users ON relationships("userA", "userB"); - -COMMIT; \ No newline at end of file diff --git a/packages/adapter-supabase/seed.sql b/packages/adapter-supabase/seed.sql deleted file mode 100644 index 063c5fbe532..00000000000 --- a/packages/adapter-supabase/seed.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO public.accounts (id, name, email, avatarUrl, details) VALUES ('00000000-0000-0000-0000-000000000000', 'Default Agent', 'default@agent.com', '', '{}'); -INSERT INTO public.rooms (id) VALUES ('00000000-0000-0000-0000-000000000000'); -INSERT INTO public.participants (userId, roomId) VALUES ('00000000-0000-0000-0000-000000000000', '00000000-0000-0000-0000-000000000000'); diff --git a/packages/adapter-supabase/src/index.ts b/packages/adapter-supabase/src/index.ts deleted file mode 100644 index 321d9e27c46..00000000000 --- a/packages/adapter-supabase/src/index.ts +++ /dev/null @@ -1,683 +0,0 @@ -import { createClient, type SupabaseClient } from "@supabase/supabase-js"; -import { - type Memory, - type Goal, - type Relationship, - Actor, - GoalStatus, - Account, - type UUID, - Participant, - Room, -} from "@ai16z/eliza"; -import { DatabaseAdapter } from "@ai16z/eliza"; -import { v4 as uuid } from "uuid"; -export class SupabaseDatabaseAdapter extends DatabaseAdapter { - async getRoom(roomId: UUID): Promise { - const { data, error } = await this.supabase - .from("rooms") - .select("id") - .eq("id", roomId) - .single(); - - if (error) { - throw new Error(`Error getting room: ${error.message}`); - } - - return data ? (data.id as UUID) : null; - } - - async getParticipantsForAccount(userId: UUID): Promise { - const { data, error } = await this.supabase - .from("participants") - .select("*") - .eq("userId", userId); - - if (error) { - throw new Error( - `Error getting participants for account: ${error.message}` - ); - } - - return data as Participant[]; - } - - async getParticipantUserState( - roomId: UUID, - userId: UUID - ): Promise<"FOLLOWED" | "MUTED" | null> { - const { data, error } = await this.supabase - .from("participants") - .select("userState") - .eq("roomId", roomId) - .eq("userId", userId) - .single(); - - if (error) { - console.error("Error getting participant user state:", error); - return null; - } - - return data?.userState as "FOLLOWED" | "MUTED" | null; - } - - async setParticipantUserState( - roomId: UUID, - userId: UUID, - state: "FOLLOWED" | "MUTED" | null - ): Promise { - const { error } = await this.supabase - .from("participants") - .update({ userState: state }) - .eq("roomId", roomId) - .eq("userId", userId); - - if (error) { - console.error("Error setting participant user state:", error); - throw new Error("Failed to set participant user state"); - } - } - - async getParticipantsForRoom(roomId: UUID): Promise { - const { data, error } = await this.supabase - .from("participants") - .select("userId") - .eq("roomId", roomId); - - if (error) { - throw new Error( - `Error getting participants for room: ${error.message}` - ); - } - - return data.map((row) => row.userId as UUID); - } - - supabase: SupabaseClient; - - constructor(supabaseUrl: string, supabaseKey: string) { - super(); - this.supabase = createClient(supabaseUrl, supabaseKey); - } - - async init() { - // noop - } - - async close() { - // noop - } - - async getMemoriesByRoomIds(params: { - roomIds: UUID[]; - agentId?: UUID; - tableName: string; - }): Promise { - let query = this.supabase - .from(params.tableName) - .select("*") - .in("roomId", params.roomIds); - - if (params.agentId) { - query = query.eq("agentId", params.agentId); - } - - const { data, error } = await query; - - if (error) { - console.error("Error retrieving memories by room IDs:", error); - return []; - } - - // map createdAt to Date - const memories = data.map((memory) => ({ - ...memory, - })); - - return memories as Memory[]; - } - - async getAccountById(userId: UUID): Promise { - const { data, error } = await this.supabase - .from("accounts") - .select("*") - .eq("id", userId); - if (error) { - throw new Error(error.message); - } - return (data?.[0] as Account) || null; - } - - async createAccount(account: Account): Promise { - const { error } = await this.supabase - .from("accounts") - .upsert([account]); - if (error) { - console.error(error.message); - return false; - } - return true; - } - - async getActorDetails(params: { roomId: UUID }): Promise { - try { - const response = await this.supabase - .from("rooms") - .select( - ` - participants:participants( - account:accounts(id, name, username, details) - ) - ` - ) - .eq("id", params.roomId); - - if (response.error) { - console.error("Error!" + response.error); - return []; - } - const { data } = response; - - return data - .map((room) => - room.participants.map((participant) => { - const user = participant.account as unknown as Actor; - return { - name: user?.name, - details: user?.details, - id: user?.id, - username: user?.username, - }; - }) - ) - .flat(); - } catch (error) { - console.error("error", error); - throw error; - } - } - - async searchMemories(params: { - tableName: string; - roomId: UUID; - embedding: number[]; - match_threshold: number; - match_count: number; - unique: boolean; - }): Promise { - const result = await this.supabase.rpc("search_memories", { - query_table_name: params.tableName, - query_roomId: params.roomId, - query_embedding: params.embedding, - query_match_threshold: params.match_threshold, - query_match_count: params.match_count, - query_unique: params.unique, - }); - if (result.error) { - throw new Error(JSON.stringify(result.error)); - } - return result.data.map((memory) => ({ - ...memory, - })); - } - - async getCachedEmbeddings(opts: { - query_table_name: string; - query_threshold: number; - query_input: string; - query_field_name: string; - query_field_sub_name: string; - query_match_count: number; - }): Promise< - { - embedding: number[]; - levenshtein_score: number; - }[] - > { - const result = await this.supabase.rpc("get_embedding_list", opts); - if (result.error) { - throw new Error(JSON.stringify(result.error)); - } - return result.data; - } - - async updateGoalStatus(params: { - goalId: UUID; - status: GoalStatus; - }): Promise { - await this.supabase - .from("goals") - .update({ status: params.status }) - .match({ id: params.goalId }); - } - - async log(params: { - body: { [key: string]: unknown }; - userId: UUID; - roomId: UUID; - type: string; - }): Promise { - const { error } = await this.supabase.from("logs").insert({ - body: params.body, - userId: params.userId, - roomId: params.roomId, - type: params.type, - }); - - if (error) { - console.error("Error inserting log:", error); - throw new Error(error.message); - } - } - - async getMemories(params: { - roomId: UUID; - count?: number; - unique?: boolean; - tableName: string; - agentId?: UUID; - start?: number; - end?: number; - }): Promise { - const query = this.supabase - .from(params.tableName) - .select("*") - .eq("roomId", params.roomId); - - if (params.start) { - query.gte("createdAt", params.start); - } - - if (params.end) { - query.lte("createdAt", params.end); - } - - if (params.unique) { - query.eq("unique", true); - } - - if (params.agentId) { - query.eq("agentId", params.agentId); - } - - query.order("createdAt", { ascending: false }); - - if (params.count) { - query.limit(params.count); - } - - const { data, error } = await query; - - if (error) { - throw new Error(`Error retrieving memories: ${error.message}`); - } - - return data as Memory[]; - } - - async searchMemoriesByEmbedding( - embedding: number[], - params: { - match_threshold?: number; - count?: number; - roomId?: UUID; - agentId?: UUID; - unique?: boolean; - tableName: string; - } - ): Promise { - const queryParams = { - query_table_name: params.tableName, - query_roomId: params.roomId, - query_embedding: embedding, - query_match_threshold: params.match_threshold, - query_match_count: params.count, - query_unique: !!params.unique, - }; - if (params.agentId) { - (queryParams as any).query_agentId = params.agentId; - } - - const result = await this.supabase.rpc("search_memories", queryParams); - if (result.error) { - throw new Error(JSON.stringify(result.error)); - } - return result.data.map((memory) => ({ - ...memory, - })); - } - - async getMemoryById(memoryId: UUID): Promise { - const { data, error } = await this.supabase - .from("memories") - .select("*") - .eq("id", memoryId) - .single(); - - if (error) { - console.error("Error retrieving memory by ID:", error); - return null; - } - - return data as Memory; - } - - async createMemory( - memory: Memory, - tableName: string, - unique = false - ): Promise { - const createdAt = memory.createdAt ?? Date.now(); - if (unique) { - const opts = { - // TODO: Add ID option, optionally - query_table_name: tableName, - query_userId: memory.userId, - query_content: memory.content.text, - query_roomId: memory.roomId, - query_embedding: memory.embedding, - query_createdAt: createdAt, - similarity_threshold: 0.95, - }; - - const result = await this.supabase.rpc( - "check_similarity_and_insert", - opts - ); - - if (result.error) { - throw new Error(JSON.stringify(result.error)); - } - } else { - const result = await this.supabase - .from("memories") - .insert({ ...memory, createdAt, type: tableName }); - const { error } = result; - if (error) { - throw new Error(JSON.stringify(error)); - } - } - } - - async removeMemory(memoryId: UUID): Promise { - const result = await this.supabase - .from("memories") - .delete() - .eq("id", memoryId); - const { error } = result; - if (error) { - throw new Error(JSON.stringify(error)); - } - } - - async removeAllMemories(roomId: UUID, tableName: string): Promise { - const result = await this.supabase.rpc("remove_memories", { - query_table_name: tableName, - query_roomId: roomId, - }); - - if (result.error) { - throw new Error(JSON.stringify(result.error)); - } - } - - async countMemories( - roomId: UUID, - unique = true, - tableName: string - ): Promise { - if (!tableName) { - throw new Error("tableName is required"); - } - const query = { - query_table_name: tableName, - query_roomId: roomId, - query_unique: !!unique, - }; - const result = await this.supabase.rpc("count_memories", query); - - if (result.error) { - throw new Error(JSON.stringify(result.error)); - } - - return result.data; - } - - async getGoals(params: { - roomId: UUID; - userId?: UUID | null; - onlyInProgress?: boolean; - count?: number; - }): Promise { - const opts = { - query_roomId: params.roomId, - query_userId: params.userId, - only_in_progress: params.onlyInProgress, - row_count: params.count, - }; - - const { data: goals, error } = await this.supabase.rpc( - "get_goals", - opts - ); - - if (error) { - throw new Error(error.message); - } - - return goals; - } - - async updateGoal(goal: Goal): Promise { - const { error } = await this.supabase - .from("goals") - .update(goal) - .match({ id: goal.id }); - if (error) { - throw new Error(`Error creating goal: ${error.message}`); - } - } - - async createGoal(goal: Goal): Promise { - const { error } = await this.supabase.from("goals").insert(goal); - if (error) { - throw new Error(`Error creating goal: ${error.message}`); - } - } - - async removeGoal(goalId: UUID): Promise { - const { error } = await this.supabase - .from("goals") - .delete() - .eq("id", goalId); - if (error) { - throw new Error(`Error removing goal: ${error.message}`); - } - } - - async removeAllGoals(roomId: UUID): Promise { - const { error } = await this.supabase - .from("goals") - .delete() - .eq("roomId", roomId); - if (error) { - throw new Error(`Error removing goals: ${error.message}`); - } - } - - async getRoomsForParticipant(userId: UUID): Promise { - const { data, error } = await this.supabase - .from("participants") - .select("roomId") - .eq("userId", userId); - - if (error) { - throw new Error( - `Error getting rooms by participant: ${error.message}` - ); - } - - return data.map((row) => row.roomId as UUID); - } - - async getRoomsForParticipants(userIds: UUID[]): Promise { - const { data, error } = await this.supabase - .from("participants") - .select("roomId") - .in("userId", userIds); - - if (error) { - throw new Error( - `Error getting rooms by participants: ${error.message}` - ); - } - - return [...new Set(data.map((row) => row.roomId as UUID))] as UUID[]; - } - - async createRoom(roomId?: UUID): Promise { - roomId = roomId ?? (uuid() as UUID); - const { data, error } = await this.supabase.rpc("create_room", { - roomId, - }); - - if (error) { - throw new Error(`Error creating room: ${error.message}`); - } - - if (!data || data.length === 0) { - throw new Error("No data returned from room creation"); - } - - return data[0].id as UUID; - } - - async removeRoom(roomId: UUID): Promise { - const { error } = await this.supabase - .from("rooms") - .delete() - .eq("id", roomId); - - if (error) { - throw new Error(`Error removing room: ${error.message}`); - } - } - - async addParticipant(userId: UUID, roomId: UUID): Promise { - const { error } = await this.supabase - .from("participants") - .insert({ userId: userId, roomId: roomId }); - - if (error) { - console.error(`Error adding participant: ${error.message}`); - return false; - } - return true; - } - - async removeParticipant(userId: UUID, roomId: UUID): Promise { - const { error } = await this.supabase - .from("participants") - .delete() - .eq("userId", userId) - .eq("roomId", roomId); - - if (error) { - console.error(`Error removing participant: ${error.message}`); - return false; - } - return true; - } - - async createRelationship(params: { - userA: UUID; - userB: UUID; - }): Promise { - const allRoomData = await this.getRoomsForParticipants([ - params.userA, - params.userB, - ]); - - let roomId: UUID; - - if (!allRoomData || allRoomData.length === 0) { - // If no existing room is found, create a new room - const { data: newRoomData, error: roomsError } = await this.supabase - .from("rooms") - .insert({}) - .single(); - - if (roomsError) { - throw new Error("Room creation error: " + roomsError.message); - } - - roomId = (newRoomData as Room)?.id as UUID; - } else { - // If an existing room is found, use the first room's ID - roomId = allRoomData[0]; - } - - const { error: participantsError } = await this.supabase - .from("participants") - .insert([ - { userId: params.userA, roomId }, - { userId: params.userB, roomId }, - ]); - - if (participantsError) { - throw new Error( - "Participants creation error: " + participantsError.message - ); - } - - // Create or update the relationship between the two users - const { error: relationshipError } = await this.supabase - .from("relationships") - .upsert({ - userA: params.userA, - userB: params.userB, - userId: params.userA, - status: "FRIENDS", - }) - .eq("userA", params.userA) - .eq("userB", params.userB); - - if (relationshipError) { - throw new Error( - "Relationship creation error: " + relationshipError.message - ); - } - - return true; - } - - async getRelationship(params: { - userA: UUID; - userB: UUID; - }): Promise { - const { data, error } = await this.supabase.rpc("get_relationship", { - usera: params.userA, - userb: params.userB, - }); - - if (error) { - throw new Error(error.message); - } - - return data[0]; - } - - async getRelationships(params: { userId: UUID }): Promise { - const { data, error } = await this.supabase - .from("relationships") - .select("*") - .or(`userA.eq.${params.userId},userB.eq.${params.userId}`) - .eq("status", "FRIENDS"); - - if (error) { - throw new Error(error.message); - } - - return data as Relationship[]; - } -} diff --git a/packages/adapter-supabase/tsconfig.json b/packages/adapter-supabase/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/adapter-supabase/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/adapter-supabase/tsup.config.ts b/packages/adapter-supabase/tsup.config.ts deleted file mode 100644 index 9acebc5ba9a..00000000000 --- a/packages/adapter-supabase/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "uuid", - // Add other modules you want to externalize - ], -}); diff --git a/packages/client-auto/.npmignore b/packages/client-auto/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/client-auto/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/client-auto/eslint.config.mjs b/packages/client-auto/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/client-auto/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/client-auto/package.json b/packages/client-auto/package.json deleted file mode 100644 index f2711101bc2..00000000000 --- a/packages/client-auto/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@ai16z/client-auto", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@types/body-parser": "1.19.5", - "@types/cors": "2.8.17", - "@types/express": "5.0.0", - "body-parser": "1.20.3", - "cors": "2.8.5", - "multer": "1.4.5-lts.1" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/client-auto/src/index.ts b/packages/client-auto/src/index.ts deleted file mode 100644 index 5da06ffbf6c..00000000000 --- a/packages/client-auto/src/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Client, IAgentRuntime, elizaLogger } from "@ai16z/eliza"; - -export class AutoClient { - interval: NodeJS.Timeout; - runtime: IAgentRuntime; - - constructor(runtime: IAgentRuntime) { - this.runtime = runtime; - - // start a loop that runs every x seconds - this.interval = setInterval( - async () => { - elizaLogger.log("running auto client..."); - }, - 60 * 60 * 1000 - ); // 1 hour in milliseconds - } -} - -export const AutoClientInterface: Client = { - start: async (runtime: IAgentRuntime) => { - const client = new AutoClient(runtime); - return client; - }, - stop: async (_runtime: IAgentRuntime) => { - console.warn("Direct client does not support stopping yet"); - }, -}; - -export default AutoClientInterface; diff --git a/packages/client-auto/tsconfig.json b/packages/client-auto/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/client-auto/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/client-auto/tsup.config.ts b/packages/client-auto/tsup.config.ts deleted file mode 100644 index 49f33adc5f9..00000000000 --- a/packages/client-auto/tsup.config.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "bs58", - "borsh", - "@solana/buffer-layout", - "stream", - "buffer", - "rpc-websockets", - "@solana/web3.js", - // Add other modules you want to externalize - ], -}); diff --git a/packages/client-direct/src/api.ts b/packages/client-direct/src/api.ts index fe26cee8f3c..3b3394dd210 100644 --- a/packages/client-direct/src/api.ts +++ b/packages/client-direct/src/api.ts @@ -2,25 +2,17 @@ import express from "express"; import bodyParser from "body-parser"; import cors from "cors"; -import { - AgentRuntime, - elizaLogger, - validateCharacterConfig, -} from "@ai16z/eliza"; +import { AgentRuntime } from "@ai16z/eliza"; import { REST, Routes } from "discord.js"; -export function createApiRouter(agents: Map, directClient) { +export function createApiRouter(agents: Map) { const router = express.Router(); router.use(cors()); router.use(bodyParser.json()); router.use(bodyParser.urlencoded({ extended: true })); - router.get("/", (req, res) => { - res.send("Welcome, this is the REST API!"); - }); - router.get("/hello", (req, res) => { res.json({ message: "Hello World!" }); }); @@ -29,7 +21,6 @@ export function createApiRouter(agents: Map, directClient) const agentsList = Array.from(agents.values()).map((agent) => ({ id: agent.agentId, name: agent.character.name, - clients: Object.keys(agent.clients), })); res.json({ agents: agentsList }); }); @@ -49,43 +40,6 @@ export function createApiRouter(agents: Map, directClient) }); }); - router.post("/agents/:agentId/set", async (req, res) => { - const agentId = req.params.agentId; - console.log('agentId', agentId) - let agent:AgentRuntime = agents.get(agentId); - - // update character - if (agent) { - // stop agent - agent.stop() - directClient.unregisterAgent(agent) - // if it has a different name, the agentId will change - } - - // load character from body - const character = req.body - try { - validateCharacterConfig(character) - } catch(e) { - elizaLogger.error(`Error parsing character: ${e}`); - res.status(400).json({ - success: false, - message: e.message, - }); - return; - } - - // start it up (and register it) - agent = await directClient.startAgent(character) - elizaLogger.log(`${character.name} started`) - - res.json({ - id: character.id, - character: character, - }); - }); - - router.get("/agents/:agentId/channels", async (req, res) => { const agentId = req.params.agentId; const runtime = agents.get(agentId); diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index 1ec4275b89b..08f75f595ba 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -51,11 +51,17 @@ Note that {{agentName}} is capable of reading/seeing/hearing various forms of me # Instructions: Write the next message for {{agentName}}. ` + messageCompletionFooter; +export interface SimliClientConfig { + apiKey: string; + faceID: string; + handleSilence: boolean; + videoRef: any; + audioRef: any; +} export class DirectClient { public app: express.Application; - private agents: Map; // container management + private agents: Map; private server: any; // Store server instance - public startAgent: Function; // Store startAgent functor constructor() { elizaLogger.log("DirectClient constructor"); @@ -66,7 +72,7 @@ export class DirectClient { this.app.use(bodyParser.json()); this.app.use(bodyParser.urlencoded({ extended: true })); - const apiRouter = createApiRouter(this.agents, this); + const apiRouter = createApiRouter(this.agents); this.app.use(apiRouter); // Define an interface that extends the Express Request interface @@ -332,7 +338,7 @@ export class DirectClient { fileResponse.headers .get("content-disposition") ?.split("filename=")[1] - ?.replace(/"/g, /* " */ "") || "default_name.txt"; + ?.replace(/"/g, "") || "default_name.txt"; console.log("Saving as:", fileName); @@ -372,7 +378,6 @@ export class DirectClient { ); } - // agent/src/index.ts:startAgent calls this public registerAgent(runtime: AgentRuntime) { this.agents.set(runtime.agentId, runtime); } @@ -383,7 +388,7 @@ export class DirectClient { public start(port: number) { this.server = this.app.listen(port, () => { - elizaLogger.success(`REST API bound to 0.0.0.0:${port}. If running locally, access it at http://localhost:${port}.`); + elizaLogger.success(`Server running at http://localhost:${port}/`); }); // Handle graceful shutdown @@ -425,7 +430,7 @@ export const DirectClientInterface: Client = { client.start(serverPort); return client; }, - stop: async (_runtime: IAgentRuntime, client?: Client) => { + stop: async (_runtime: IAgentRuntime, client?: any) => { if (client instanceof DirectClient) { client.stop(); } diff --git a/packages/client-farcaster/package.json b/packages/client-farcaster/package.json deleted file mode 100644 index ee9356753cf..00000000000 --- a/packages/client-farcaster/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@ai16z/client-farcaster", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@neynar/nodejs-sdk": "^2.0.3" - }, - "devDependencies": { - "tsup": "^8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } -} diff --git a/packages/client-farcaster/src/actions.ts b/packages/client-farcaster/src/actions.ts deleted file mode 100644 index 9aca9d40d8f..00000000000 --- a/packages/client-farcaster/src/actions.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { FarcasterClient } from "./client"; -import type { Content, IAgentRuntime, Memory, UUID } from "@ai16z/eliza"; -import type { Cast, CastId, Profile } from "./types"; -import { createCastMemory } from "./memory"; -import { splitPostContent } from "./utils"; - -export async function sendCast({ - client, - runtime, - content, - roomId, - inReplyTo, - profile, -}: { - profile: Profile; - client: FarcasterClient; - runtime: IAgentRuntime; - content: Content; - roomId: UUID; - signerUuid: string; - inReplyTo?: CastId; -}): Promise<{ memory: Memory; cast: Cast }[]> { - const chunks = splitPostContent(content.text); - const sent: Cast[] = []; - let parentCastId = inReplyTo; - - for (const chunk of chunks) { - const neynarCast = await client.publishCast(chunk, parentCastId); - - if (neynarCast) { - const cast: Cast = { - hash: neynarCast.hash, - authorFid: neynarCast.authorFid, - text: neynarCast.text, - profile, - inReplyTo: parentCastId, - timestamp: new Date(), - }; - - sent.push(cast!); - - parentCastId = { - fid: neynarCast?.authorFid!, - hash: neynarCast?.hash!, - }; - } - } - - return sent.map((cast) => ({ - cast, - memory: createCastMemory({ - roomId, - runtime, - cast, - }), - })); -} diff --git a/packages/client-farcaster/src/client.ts b/packages/client-farcaster/src/client.ts deleted file mode 100644 index 663ff5640c2..00000000000 --- a/packages/client-farcaster/src/client.ts +++ /dev/null @@ -1,228 +0,0 @@ -import { IAgentRuntime, elizaLogger } from "@ai16z/eliza"; -import { NeynarAPIClient, isApiErrorResponse } from "@neynar/nodejs-sdk"; -import { NeynarCastResponse, Cast, Profile, FidRequest, CastId } from "./types"; - -export class FarcasterClient { - runtime: IAgentRuntime; - neynar: NeynarAPIClient; - signerUuid: string; - cache: Map; - lastInteractionTimestamp: Date; - - constructor(opts: { - runtime: IAgentRuntime; - url: string; - ssl: boolean; - neynar: NeynarAPIClient; - signerUuid: string; - cache: Map; - }) { - this.cache = opts.cache; - this.runtime = opts.runtime; - this.neynar = opts.neynar; - this.signerUuid = opts.signerUuid; - this.lastInteractionTimestamp = new Date(); - } - - async loadCastFromNeynarResponse(neynarResponse: any): Promise { - const profile = await this.getProfile(neynarResponse.author.fid); - return { - hash: neynarResponse.hash, - authorFid: neynarResponse.author.fid, - text: neynarResponse.text, - profile, - ...(neynarResponse.parent_hash - ? { - inReplyTo: { - hash: neynarResponse.parent_hash, - fid: neynarResponse.parent_author.fid, - }, - } - : {}), - timestamp: new Date(neynarResponse.timestamp), - }; - } - - async publishCast( - cast: string, - parentCastId: CastId | undefined, - retryTimes?: number - ): Promise { - try { - const result = await this.neynar.publishCast({ - signerUuid: this.signerUuid, - text: cast, - parent: parentCastId?.hash, - }); - if (result.success) { - return { - hash: result.cast.hash, - authorFid: result.cast.author.fid, - text: result.cast.text, - }; - } - } catch (err) { - if (isApiErrorResponse(err)) { - elizaLogger.error('Neynar error: ', err.response.data); - throw err.response.data; - } else { - elizaLogger.error('Error: ', err); - throw err; - } - } - } - - async getCast(castHash: string): Promise { - if (this.cache.has(`farcaster/cast/${castHash}`)) { - return this.cache.get(`farcaster/cast/${castHash}`); - } - - const response = await this.neynar.lookupCastByHashOrWarpcastUrl({ - identifier: castHash, - type: "hash", - }); - const cast = { - hash: response.cast.hash, - authorFid: response.cast.author.fid, - text: response.cast.text, - profile: { - fid: response.cast.author.fid, - name: response.cast.author.display_name || "anon", - username: response.cast.author.username, - }, - ...(response.cast.parent_hash - ? { - inReplyTo: { - hash: response.cast.parent_hash, - fid: response.cast.parent_author.fid, - }, - } - : {}), - timestamp: new Date(response.cast.timestamp), - }; - - this.cache.set(`farcaster/cast/${castHash}`, cast); - - return cast; - } - - async getCastsByFid(request: FidRequest): Promise { - const timeline: Cast[] = []; - - const response = await this.neynar.fetchCastsForUser({ - fid: request.fid, - limit: request.pageSize, - }); - response.casts.map((cast) => { - this.cache.set(`farcaster/cast/${cast.hash}`, cast); - timeline.push({ - hash: cast.hash, - authorFid: cast.author.fid, - text: cast.text, - profile: { - fid: cast.author.fid, - name: cast.author.display_name || "anon", - username: cast.author.username, - }, - timestamp: new Date(cast.timestamp), - }); - }); - - return timeline; - } - - async getMentions(request: FidRequest): Promise { - const neynarMentionsResponse = await this.neynar.fetchAllNotifications({ - fid: request.fid, - type: ["mentions", "replies"], - }); - const mentions: Cast[] = []; - - neynarMentionsResponse.notifications.map((notification) => { - const cast = { - hash: notification.cast!.hash, - authorFid: notification.cast!.author.fid, - text: notification.cast!.text, - profile: { - fid: notification.cast!.author.fid, - name: notification.cast!.author.display_name || "anon", - username: notification.cast!.author.username, - }, - ...(notification.cast!.parent_hash - ? { - inReplyTo: { - hash: notification.cast!.parent_hash, - fid: notification.cast!.parent_author.fid, - }, - } - : {}), - timestamp: new Date(notification.cast!.timestamp), - }; - mentions.push(cast); - this.cache.set(`farcaster/cast/${cast.hash}`, cast); - }); - - return mentions; - } - - async getProfile(fid: number): Promise { - if (this.cache.has(`farcaster/profile/${fid}`)) { - return this.cache.get(`farcaster/profile/${fid}`) as Profile; - } - - const result = await this.neynar.fetchBulkUsers({ fids: [fid] }); - if (!result.users || result.users.length < 1) { - elizaLogger.error('Error fetching user by fid'); - - throw "getProfile ERROR"; - } - - const neynarUserProfile = result.users[0]; - - const profile: Profile = { - fid, - name: "", - username: "", - }; - - const userDataBodyType = { - 1: "pfp", - 2: "name", - 3: "bio", - 5: "url", - 6: "username", - // 7: "location", - // 8: "twitter", - // 9: "github", - } as const; - - profile.name = neynarUserProfile.display_name!; - profile.username = neynarUserProfile.username; - profile.bio = neynarUserProfile.profile.bio.text; - profile.pfp = neynarUserProfile.pfp_url; - - this.cache.set(`farcaster/profile/${fid}`, profile); - - return profile; - } - - async getTimeline(request: FidRequest): Promise<{ - timeline: Cast[]; - nextPageToken?: Uint8Array | undefined; - }> { - const timeline: Cast[] = []; - - const results = await this.getCastsByFid(request); - - for (const cast of results) { - this.cache.set(`farcaster/cast/${cast.hash}`, cast); - timeline.push(cast); - } - - return { - timeline, - //TODO implement paging - //nextPageToken: results.nextPageToken, - }; - } -} diff --git a/packages/client-farcaster/src/index.ts b/packages/client-farcaster/src/index.ts deleted file mode 100644 index 43d14b5ab3b..00000000000 --- a/packages/client-farcaster/src/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Client, IAgentRuntime, elizaLogger } from "@ai16z/eliza"; -import { FarcasterClient } from "./client"; -import { FarcasterPostManager } from "./post"; -import { FarcasterInteractionManager } from "./interactions"; -import { Configuration, NeynarAPIClient } from "@neynar/nodejs-sdk"; - -export class FarcasterAgentClient implements Client { - client: FarcasterClient; - posts: FarcasterPostManager; - interactions: FarcasterInteractionManager; - - private signerUuid: string; - - constructor( - public runtime: IAgentRuntime, - client?: FarcasterClient - ) { - const cache = new Map(); - - this.signerUuid = runtime.getSetting("FARCASTER_NEYNAR_SIGNER_UUID")!; - - const neynarConfig = new Configuration({ - apiKey: runtime.getSetting("FARCASTER_NEYNAR_API_KEY")!, - }); - - const neynarClient = new NeynarAPIClient(neynarConfig); - - this.client = - client ?? - new FarcasterClient({ - runtime, - ssl: true, - url: - runtime.getSetting("FARCASTER_HUB_URL") ?? - "hub.pinata.cloud", - neynar: neynarClient, - signerUuid: this.signerUuid, - cache, - }); - - elizaLogger.info("Farcaster Neynar client initialized.") - - this.posts = new FarcasterPostManager( - this.client, - this.runtime, - this.signerUuid, - cache - ); - - this.interactions = new FarcasterInteractionManager( - this.client, - this.runtime, - this.signerUuid, - cache - ); - } - - async start() { - await Promise.all([this.posts.start(), this.interactions.start()]); - } - - async stop() { - await Promise.all([this.posts.stop(), this.interactions.stop()]); - } -} diff --git a/packages/client-farcaster/src/interactions.ts b/packages/client-farcaster/src/interactions.ts deleted file mode 100644 index 6e71e1f45e2..00000000000 --- a/packages/client-farcaster/src/interactions.ts +++ /dev/null @@ -1,285 +0,0 @@ -import { - composeContext, - generateMessageResponse, - generateShouldRespond, - Memory, - ModelClass, - stringToUuid, - elizaLogger, - HandlerCallback, - Content, - type IAgentRuntime, -} from "@ai16z/eliza"; -import type { FarcasterClient } from "./client"; -import { toHex } from "viem"; -import { buildConversationThread, createCastMemory } from "./memory"; -import { Cast, Profile } from "./types"; -import { - formatCast, - formatTimeline, - messageHandlerTemplate, - shouldRespondTemplate, -} from "./prompts"; -import { castUuid } from "./utils"; -import { sendCast } from "./actions"; - -export class FarcasterInteractionManager { - private timeout: NodeJS.Timeout | undefined; - constructor( - public client: FarcasterClient, - public runtime: IAgentRuntime, - private signerUuid: string, - public cache: Map - ) {} - - public async start() { - const handleInteractionsLoop = async () => { - try { - await this.handleInteractions(); - } catch (error) { - elizaLogger.error(error); - return; - } - - this.timeout = setTimeout( - handleInteractionsLoop, - Number( - this.runtime.getSetting("FARCASTER_POLL_INTERVAL") || 120 - ) * 1000 // Default to 2 minutes - ); - }; - - handleInteractionsLoop(); - } - - public async stop() { - if (this.timeout) clearTimeout(this.timeout); - } - - private async handleInteractions() { - const agentFid = Number(this.runtime.getSetting("FARCASTER_FID")); - - const mentions = await this.client.getMentions({ - fid: agentFid, - pageSize: 10, - }); - - const agent = await this.client.getProfile(agentFid); - for (const mention of mentions) { - const messageHash = toHex(mention.hash); - const conversationId = `${messageHash}-${this.runtime.agentId}`; - const roomId = stringToUuid(conversationId); - const userId = stringToUuid(mention.authorFid.toString()); - - const pastMemoryId = castUuid({ - agentId: this.runtime.agentId, - hash: mention.hash, - }); - - const pastMemory = - await this.runtime.messageManager.getMemoryById(pastMemoryId); - - if (pastMemory) { - continue; - } - - await this.runtime.ensureConnection( - userId, - roomId, - mention.profile.username, - mention.profile.name, - "farcaster" - ); - - const thread = await buildConversationThread({ - client: this.client, - runtime: this.runtime, - cast: mention, - }); - - const memory: Memory = { - content: { text: mention.text, hash: mention.hash }, - agentId: this.runtime.agentId, - userId, - roomId, - }; - - await this.handleCast({ - agent, - cast: mention, - memory, - thread, - }); - } - - this.client.lastInteractionTimestamp = new Date(); - } - - private async handleCast({ - agent, - cast, - memory, - thread, - }: { - agent: Profile; - cast: Cast; - memory: Memory; - thread: Cast[]; - }) { - if (cast.profile.fid === agent.fid) { - elizaLogger.info("skipping cast from bot itself", cast.hash); - return; - } - - if (!memory.content.text) { - elizaLogger.info("skipping cast with no text", cast.hash); - return { text: "", action: "IGNORE" }; - } - - const currentPost = formatCast(cast); - - const { timeline } = await this.client.getTimeline({ - fid: agent.fid, - pageSize: 10, - }); - - const formattedTimeline = formatTimeline( - this.runtime.character, - timeline - ); - - const formattedConversation = thread - .map( - (cast) => `@${cast.profile.username} (${new Date( - cast.timestamp - ).toLocaleString("en-US", { - hour: "2-digit", - minute: "2-digit", - month: "short", - day: "numeric", - })}): - ${cast.text}` - ) - .join("\n\n"); - - const state = await this.runtime.composeState(memory, { - farcasterUsername: agent.username, - timeline: formattedTimeline, - currentPost, - formattedConversation, - }); - - const shouldRespondContext = composeContext({ - state, - template: - this.runtime.character.templates - ?.farcasterShouldRespondTemplate || - this.runtime.character?.templates?.shouldRespondTemplate || - shouldRespondTemplate, - }); - - const memoryId = castUuid({ - agentId: this.runtime.agentId, - hash: cast.hash, - }); - - const castMemory = - await this.runtime.messageManager.getMemoryById(memoryId); - - if (!castMemory) { - await this.runtime.messageManager.createMemory( - createCastMemory({ - roomId: memory.roomId, - runtime: this.runtime, - cast, - }) - ); - } - - const shouldRespondResponse = await generateShouldRespond({ - runtime: this.runtime, - context: shouldRespondContext, - modelClass: ModelClass.SMALL, - }); - - if ( - shouldRespondResponse === "IGNORE" || - shouldRespondResponse === "STOP" - ) { - elizaLogger.info( - `Not responding to cast because generated ShouldRespond was ${shouldRespondResponse}` - ); - return; - } - - const context = composeContext({ - state, - template: - this.runtime.character.templates - ?.farcasterMessageHandlerTemplate ?? - this.runtime.character?.templates?.messageHandlerTemplate ?? - messageHandlerTemplate, - }); - - const responseContent = await generateMessageResponse({ - runtime: this.runtime, - context, - modelClass: ModelClass.LARGE, - }); - - responseContent.inReplyTo = memoryId; - - if (!responseContent.text) return; - - if (this.runtime.getSetting("FARCASTER_DRY_RUN") === "true") { - elizaLogger.info( - `Dry run: would have responded to cast ${cast.hash} with ${responseContent.text}` - ); - return; - } - - const callback: HandlerCallback = async ( - content: Content, - files: any[] - ) => { - try { - if (memoryId && !content.inReplyTo) { - content.inReplyTo = memoryId; - } - const results = await sendCast({ - runtime: this.runtime, - client: this.client, - signerUuid: this.signerUuid, - profile: cast.profile, - content: content, - roomId: memory.roomId, - inReplyTo: { - fid: cast.authorFid, - hash: cast.hash, - }, - }); - // sendCast lost response action, so we need to add it back here - results[0].memory.content.action = content.action; - - for (const { memory } of results) { - await this.runtime.messageManager.createMemory(memory); - } - return results.map((result) => result.memory); - } catch (error) { - console.error("Error sending response cast:", error); - return []; - } - }; - - const responseMessages = await callback(responseContent); - - const newState = await this.runtime.updateRecentMessageState(state); - - await this.runtime.processActions( - memory, - responseMessages, - newState, - callback - ); - } -} diff --git a/packages/client-farcaster/src/memory.ts b/packages/client-farcaster/src/memory.ts deleted file mode 100644 index b3a8c862c96..00000000000 --- a/packages/client-farcaster/src/memory.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { - elizaLogger, - getEmbeddingZeroVector, - IAgentRuntime, - stringToUuid, - type Memory, - type UUID, -} from "@ai16z/eliza"; -import type { Cast } from "./types"; -import { toHex } from "viem"; -import { castUuid } from "./utils"; -import { FarcasterClient } from "./client"; - -export function createCastMemory({ - roomId, - runtime, - cast, -}: { - roomId: UUID; - runtime: IAgentRuntime; - cast: Cast; -}): Memory { - const inReplyTo = cast.inReplyTo - ? castUuid({ - hash: toHex(cast.inReplyTo.hash), - agentId: runtime.agentId, - }) - : undefined; - - return { - id: castUuid({ - hash: cast.hash, - agentId: runtime.agentId, - }), - agentId: runtime.agentId, - userId: runtime.agentId, - content: { - text: cast.text, - source: "farcaster", - url: "", - inReplyTo, - hash: cast.hash, - }, - roomId, - embedding: getEmbeddingZeroVector(), - }; -} - -export async function buildConversationThread({ - cast, - runtime, - client, -}: { - cast: Cast; - runtime: IAgentRuntime; - client: FarcasterClient; -}): Promise { - const thread: Cast[] = []; - const visited: Set = new Set(); - async function processThread(currentCast: Cast) { - if (visited.has(currentCast.hash)) { - return; - } - - visited.add(currentCast.hash); - - const roomId = castUuid({ - hash: currentCast.hash, - agentId: runtime.agentId, - }); - - // Check if the current cast has already been saved - const memory = await runtime.messageManager.getMemoryById(roomId); - - if (!memory) { - elizaLogger.log("Creating memory for cast", currentCast.hash); - - const userId = stringToUuid(currentCast.profile.username); - - await runtime.ensureConnection( - userId, - roomId, - currentCast.profile.username, - currentCast.profile.name, - "farcaster" - ); - - await runtime.messageManager.createMemory( - createCastMemory({ - roomId, - runtime, - cast: currentCast, - }) - ); - } - - thread.unshift(currentCast); - - if (currentCast.inReplyTo) { - const parentCast = await client.getCast(currentCast.inReplyTo.hash); - await processThread(parentCast); - } - } - - await processThread(cast); - return thread; -} diff --git a/packages/client-farcaster/src/post.ts b/packages/client-farcaster/src/post.ts deleted file mode 100644 index 3cd06605ec4..00000000000 --- a/packages/client-farcaster/src/post.ts +++ /dev/null @@ -1,168 +0,0 @@ -import { - composeContext, - generateText, - IAgentRuntime, - ModelClass, - stringToUuid, - elizaLogger -} from "@ai16z/eliza"; -import { FarcasterClient } from "./client"; -import { formatTimeline, postTemplate } from "./prompts"; -import { castUuid } from "./utils"; -import { createCastMemory } from "./memory"; -import { sendCast } from "./actions"; - -export class FarcasterPostManager { - private timeout: NodeJS.Timeout | undefined; - - constructor( - public client: FarcasterClient, - public runtime: IAgentRuntime, - private signerUuid: string, - public cache: Map - ) {} - - public async start() { - const generateNewCastLoop = async () => { - try { - await this.generateNewCast(); - } catch (error) { - elizaLogger.error(error) - return; - } - - this.timeout = setTimeout( - generateNewCastLoop, - (Math.floor(Math.random() * (4 - 1 + 1)) + 1) * 60 * 60 * 1000 - ); // Random interval between 1 and 4 hours - }; - - generateNewCastLoop(); - } - - public async stop() { - if (this.timeout) clearTimeout(this.timeout); - } - - private async generateNewCast() { - elizaLogger.info("Generating new cast"); - try { - const fid = Number(this.runtime.getSetting("FARCASTER_FID")!); - - const profile = await this.client.getProfile(fid); - await this.runtime.ensureUserExists( - this.runtime.agentId, - profile.username, - this.runtime.character.name, - "farcaster" - ); - - const { timeline } = await this.client.getTimeline({ - fid, - pageSize: 10, - }); - - this.cache.set("farcaster/timeline", timeline); - - const formattedHomeTimeline = formatTimeline( - this.runtime.character, - timeline - ); - - const generateRoomId = stringToUuid("farcaster_generate_room"); - - const state = await this.runtime.composeState( - { - roomId: generateRoomId, - userId: this.runtime.agentId, - agentId: this.runtime.agentId, - content: { text: "", action: "" }, - }, - { - farcasterUserName: profile.username, - timeline: formattedHomeTimeline, - } - ); - - // Generate new cast - const context = composeContext({ - state, - template: - this.runtime.character.templates?.farcasterPostTemplate || - postTemplate, - }); - - const newContent = await generateText({ - runtime: this.runtime, - context, - modelClass: ModelClass.SMALL, - }); - - const slice = newContent.replaceAll(/\\n/g, "\n").trim(); - - const contentLength = 240; - - let content = slice.slice(0, contentLength); - - // if its bigger than 280, delete the last line - if (content.length > 280) { - content = content.slice(0, content.lastIndexOf("\n")); - } - - if (content.length > contentLength) { - // slice at the last period - content = content.slice(0, content.lastIndexOf(".")); - } - - // if it's still too long, get the period before the last period - if (content.length > contentLength) { - content = content.slice(0, content.lastIndexOf(".")); - } - - - if (this.runtime.getSetting("FARCASTER_DRY_RUN") === "true") { - elizaLogger.info( - `Dry run: would have cast: ${content}` - ); - return; - } - - try { - const [{ cast }] = await sendCast({ - client: this.client, - runtime: this.runtime, - signerUuid: this.signerUuid, - roomId: generateRoomId, - content: { text: content }, - profile, - }); - - const roomId = castUuid({ - agentId: this.runtime.agentId, - hash: cast.hash, - }); - - await this.runtime.ensureRoomExists(roomId); - - await this.runtime.ensureParticipantInRoom( - this.runtime.agentId, - roomId - ); - - elizaLogger.info(`[Farcaster Neynar Client] Published cast ${cast.hash}`); - - await this.runtime.messageManager.createMemory( - createCastMemory({ - roomId, - runtime: this.runtime, - cast, - }) - ); - } catch (error) { - elizaLogger.error("Error sending cast:", error) - } - } catch (error) { - elizaLogger.error("Error generating new cast:", error) - } - } -} diff --git a/packages/client-farcaster/src/prompts.ts b/packages/client-farcaster/src/prompts.ts deleted file mode 100644 index fde67d5370e..00000000000 --- a/packages/client-farcaster/src/prompts.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { - Character, - messageCompletionFooter, - shouldRespondFooter, -} from "@ai16z/eliza"; -import type { Cast } from "./types"; - -export const formatCast = (cast: Cast) => { - return `ID: ${cast.hash} - From: ${cast.profile.name} (@${cast.profile.username})${cast.profile.username})${cast.inReplyTo ? `\nIn reply to: ${cast.inReplyTo.fid}` : ""} -Text: ${cast.text}`; -}; - -export const formatTimeline = ( - character: Character, - timeline: Cast[] -) => `# ${character.name}'s Home Timeline -${timeline.map(formatCast).join("\n")} -`; - -export const headerTemplate = ` -{{timeline}} - -# Knowledge -{{knowledge}} - -About {{agentName}} (@{{farcasterUsername}}): -{{bio}} -{{lore}} -{{postDirections}} - -{{providers}} - -{{recentPosts}} - -{{characterPostExamples}}`; - -export const postTemplate = -headerTemplate + - ` -# Task: Generate a post in the voice and style of {{agentName}}, aka @{{farcasterUsername}} -Write a single sentence post that is {{adjective}} about {{topic}} (without mentioning {{topic}} directly), from the perspective of {{agentName}}. -Try to write something totally different than previous posts. Do not add commentary or ackwowledge this request, just write the post. - -Your response should not contain any questions. Brief, concise statements only. No emojis. Use \\n\\n (double spaces) between statements.`; - -export const messageHandlerTemplate = - headerTemplate + - ` -Recent interactions between {{agentName}} and other users: -{{recentPostInteractions}} - -Thread of casts You Are Replying To: -{{formattedConversation}} - -# Task: Generate a post in the voice, style and perspective of {{agentName}} (@{{farcasterUsername}}): -{{currentPost}}` + - messageCompletionFooter; - -export const shouldRespondTemplate = - // - `# Task: Decide if {{agentName}} should respond. - About {{agentName}}: - {{bio}} - - # INSTRUCTIONS: Determine if {{agentName}} (@{{farcasterUsername}}) should respond to the message and participate in the conversation. Do not comment. Just respond with "RESPOND" or "IGNORE" or "STOP". - -Response options are RESPOND, IGNORE and STOP. - -{{agentName}} should respond to messages that are directed at them, or participate in conversations that are interesting or relevant to their background, IGNORE messages that are irrelevant to them, and should STOP if the conversation is concluded. - -{{agentName}} is in a room with other users and wants to be conversational, but not annoying. -{{agentName}} should RESPOND to messages that are directed at them, or participate in conversations that are interesting or relevant to their background. -If a message is not interesting or relevant, {{agentName}} should IGNORE. -If a message thread has become repetitive, {{agentName}} should IGNORE. -Unless directly RESPONDing to a user, {{agentName}} should IGNORE messages that are very short or do not contain much information. -If a user asks {{agentName}} to stop talking, {{agentName}} should STOP. -If {{agentName}} concludes a conversation and isn't part of the conversation anymore, {{agentName}} should STOP. - -IMPORTANT: {{agentName}} (aka @{{farcasterUsername}}) is particularly sensitive about being annoying, so if there is any doubt, it is better to IGNORE than to RESPOND. - -Thread of messages You Are Replying To: -{{formattedConversation}} - -Current message: -{{currentPost}} - -` + shouldRespondFooter; diff --git a/packages/client-farcaster/src/types.ts b/packages/client-farcaster/src/types.ts deleted file mode 100644 index 929216d138b..00000000000 --- a/packages/client-farcaster/src/types.ts +++ /dev/null @@ -1,39 +0,0 @@ -export type Profile = { - fid: number; - name: string; - username: string; - pfp?: string; - bio?: string; - url?: string; - // location?: string; - // twitter?: string; - // github?: string; -}; - -export type NeynarCastResponse = { - hash: string; - authorFid: number; - text: string; -}; - -export type Cast = { - hash: string; - authorFid: number; - text: string; - profile: Profile; - inReplyTo?: { - hash: string; - fid: number; - }; - timestamp: Date; -}; - -export type CastId = { - hash: string; - fid: number; -}; - -export type FidRequest = { - fid: number; - pageSize: number; -}; diff --git a/packages/client-farcaster/src/utils.ts b/packages/client-farcaster/src/utils.ts deleted file mode 100644 index 92b99d698f9..00000000000 --- a/packages/client-farcaster/src/utils.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { stringToUuid } from "@ai16z/eliza"; - -const MAX_CAST_LENGTH = 280; // Updated to Twitter's current character limit - -export function castId({ hash, agentId }: { hash: string; agentId: string }) { - return `${hash}-${agentId}`; -} - -export function castUuid(props: { hash: string; agentId: string }) { - return stringToUuid(castId(props)); -} - -export function splitPostContent( - content: string, - maxLength: number = MAX_CAST_LENGTH -): string[] { - const paragraphs = content.split("\n\n").map((p) => p.trim()); - const posts: string[] = []; - let currentTweet = ""; - - for (const paragraph of paragraphs) { - if (!paragraph) continue; - - if ((currentTweet + "\n\n" + paragraph).trim().length <= maxLength) { - if (currentTweet) { - currentTweet += "\n\n" + paragraph; - } else { - currentTweet = paragraph; - } - } else { - if (currentTweet) { - posts.push(currentTweet.trim()); - } - if (paragraph.length <= maxLength) { - currentTweet = paragraph; - } else { - // Split long paragraph into smaller chunks - const chunks = splitParagraph(paragraph, maxLength); - posts.push(...chunks.slice(0, -1)); - currentTweet = chunks[chunks.length - 1]; - } - } - } - - if (currentTweet) { - posts.push(currentTweet.trim()); - } - - return posts; -} - -export function splitParagraph(paragraph: string, maxLength: number): string[] { - const sentences = paragraph.match(/[^\.!\?]+[\.!\?]+|[^\.!\?]+$/g) || [ - paragraph, - ]; - const chunks: string[] = []; - let currentChunk = ""; - - for (const sentence of sentences) { - if ((currentChunk + " " + sentence).trim().length <= maxLength) { - if (currentChunk) { - currentChunk += " " + sentence; - } else { - currentChunk = sentence; - } - } else { - if (currentChunk) { - chunks.push(currentChunk.trim()); - } - if (sentence.length <= maxLength) { - currentChunk = sentence; - } else { - // Split long sentence into smaller pieces - const words = sentence.split(" "); - currentChunk = ""; - for (const word of words) { - if ( - (currentChunk + " " + word).trim().length <= maxLength - ) { - if (currentChunk) { - currentChunk += " " + word; - } else { - currentChunk = word; - } - } else { - if (currentChunk) { - chunks.push(currentChunk.trim()); - } - currentChunk = word; - } - } - } - } - } - - if (currentChunk) { - chunks.push(currentChunk.trim()); - } - - return chunks; -} - -export function populateMentions( - text: string, - userIds: number[], - positions: number[], - userMap: Record -) { - // Validate input arrays have same length - if (userIds.length !== positions.length) { - throw new Error( - "User IDs and positions arrays must have the same length" - ); - } - - // Create array of mention objects with position and user info - const mentions = userIds - .map((userId, index) => ({ - position: positions[index], - userId, - displayName: userMap[userId]!, - })) - .sort((a, b) => b.position - a.position); // Sort in reverse order to prevent position shifting - - // Create the resulting string by inserting mentions - let result = text; - mentions.forEach((mention) => { - const mentionText = `@${mention.displayName}`; - result = - result.slice(0, mention.position) + - mentionText + - result.slice(mention.position); - }); - - return result; -} diff --git a/packages/client-farcaster/tsconfig.json b/packages/client-farcaster/tsconfig.json deleted file mode 100644 index 47d683da09f..00000000000 --- a/packages/client-farcaster/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "jsx": "react", - "outDir": "dist", - "rootDir": "./src", - "strict": true - }, - "include": [ - "src" - ] -} \ No newline at end of file diff --git a/packages/client-farcaster/tsup.config.ts b/packages/client-farcaster/tsup.config.ts deleted file mode 100644 index e42bf4efeae..00000000000 --- a/packages/client-farcaster/tsup.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - // Add other modules you want to externalize - ], -}); diff --git a/packages/client-github/.npmignore b/packages/client-github/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/client-github/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/client-github/eslint.config.mjs b/packages/client-github/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/client-github/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/client-github/package.json b/packages/client-github/package.json deleted file mode 100644 index 1efb7deb841..00000000000 --- a/packages/client-github/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@ai16z/client-github", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@octokit/rest": "20.1.1", - "@octokit/types": "12.6.0", - "glob": "10.4.5", - "simple-git": "3.27.0" - }, - "devDependencies": { - "@types/glob": "8.1.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - } -} diff --git a/packages/client-github/src/environment.ts b/packages/client-github/src/environment.ts deleted file mode 100644 index 69df61ac30c..00000000000 --- a/packages/client-github/src/environment.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { IAgentRuntime } from "@ai16z/eliza"; -import { z } from "zod"; - -export const githubEnvSchema = z.object({ - GITHUB_OWNER: z.string().min(1, "GitHub owner is required"), - GITHUB_REPO: z.string().min(1, "GitHub repo is required"), - GITHUB_BRANCH: z.string().min(1, "GitHub branch is required"), - GITHUB_PATH: z.string().min(1, "GitHub path is required"), - GITHUB_API_TOKEN: z.string().min(1, "GitHub API token is required"), -}); - -export type GithubConfig = z.infer; - -export async function validateGithubConfig( - runtime: IAgentRuntime -): Promise { - try { - const config = { - GITHUB_OWNER: runtime.getSetting("GITHUB_OWNER"), - GITHUB_REPO: runtime.getSetting("GITHUB_REPO"), - GITHUB_BRANCH: runtime.getSetting("GITHUB_BRANCH"), - GITHUB_PATH: runtime.getSetting("GITHUB_PATH"), - GITHUB_API_TOKEN: runtime.getSetting("GITHUB_API_TOKEN"), - }; - - return githubEnvSchema.parse(config); - } catch (error) { - if (error instanceof z.ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `GitHub configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/client-github/src/index.ts b/packages/client-github/src/index.ts deleted file mode 100644 index dee466404ee..00000000000 --- a/packages/client-github/src/index.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { Octokit } from "@octokit/rest"; -import { glob } from "glob"; -import simpleGit, { SimpleGit } from "simple-git"; -import path from "path"; -import fs from "fs/promises"; -import { existsSync } from "fs"; -import { createHash } from "crypto"; -import { - elizaLogger, - AgentRuntime, - Client, - IAgentRuntime, - knowledge, - stringToUuid, -} from "@ai16z/eliza"; -import { validateGithubConfig } from "./environment"; - -export interface GitHubConfig { - owner: string; - repo: string; - branch?: string; - path?: string; - token: string; -} - -export class GitHubClient { - private octokit: Octokit; - private git: SimpleGit; - private config: GitHubConfig; - private runtime: AgentRuntime; - private repoPath: string; - - constructor(runtime: AgentRuntime) { - this.runtime = runtime; - this.config = { - owner: runtime.getSetting("GITHUB_OWNER") as string, - repo: runtime.getSetting("GITHUB_REPO") as string, - branch: runtime.getSetting("GITHUB_BRANCH") as string, - path: runtime.getSetting("GITHUB_PATH") as string, - token: runtime.getSetting("GITHUB_API_TOKEN") as string, - }; - this.octokit = new Octokit({ auth: this.config.token }); - this.git = simpleGit(); - this.repoPath = path.join( - process.cwd(), - ".repos", - this.config.owner, - this.config.repo - ); - } - - async initialize() { - // Create repos directory if it doesn't exist - await fs.mkdir(path.join(process.cwd(), ".repos", this.config.owner), { - recursive: true, - }); - - // Clone or pull repository - if (!existsSync(this.repoPath)) { - await this.git.clone( - `https://github.com/${this.config.owner}/${this.config.repo}.git`, - this.repoPath - ); - } else { - const git = simpleGit(this.repoPath); - await git.pull(); - } - - // Checkout specified branch if provided - if (this.config.branch) { - const git = simpleGit(this.repoPath); - await git.checkout(this.config.branch); - } - } - - async createMemoriesFromFiles() { - console.log("Create memories"); - const searchPath = this.config.path - ? path.join(this.repoPath, this.config.path, "**/*") - : path.join(this.repoPath, "**/*"); - - const files = await glob(searchPath, { nodir: true }); - - for (const file of files) { - const relativePath = path.relative(this.repoPath, file); - const content = await fs.readFile(file, "utf-8"); - const contentHash = createHash("sha256") - .update(content) - .digest("hex"); - const knowledgeId = stringToUuid( - `github-${this.config.owner}-${this.config.repo}-${relativePath}` - ); - - const existingDocument = - await this.runtime.documentsManager.getMemoryById(knowledgeId); - - if ( - existingDocument && - existingDocument.content["hash"] == contentHash - ) { - continue; - } - - console.log( - "Processing knowledge for ", - this.runtime.character.name, - " - ", - relativePath - ); - - await knowledge.set(this.runtime, { - id: knowledgeId, - content: { - text: content, - hash: contentHash, - source: "github", - attachments: [], - metadata: { - path: relativePath, - repo: this.config.repo, - owner: this.config.owner, - }, - }, - }); - } - } - - async createPullRequest( - title: string, - branch: string, - files: Array<{ path: string; content: string }>, - description?: string - ) { - // Create new branch - const git = simpleGit(this.repoPath); - await git.checkout(["-b", branch]); - - // Write files - for (const file of files) { - const filePath = path.join(this.repoPath, file.path); - await fs.mkdir(path.dirname(filePath), { recursive: true }); - await fs.writeFile(filePath, file.content); - } - - // Commit and push changes - await git.add("."); - await git.commit(title); - await git.push("origin", branch); - - // Create PR - const pr = await this.octokit.pulls.create({ - owner: this.config.owner, - repo: this.config.repo, - title, - body: description || title, - head: branch, - base: this.config.branch || "main", - }); - - return pr.data; - } - - async createCommit( - message: string, - files: Array<{ path: string; content: string }> - ) { - const git = simpleGit(this.repoPath); - - // Write files - for (const file of files) { - const filePath = path.join(this.repoPath, file.path); - await fs.mkdir(path.dirname(filePath), { recursive: true }); - await fs.writeFile(filePath, file.content); - } - - // Commit and push changes - await git.add("."); - await git.commit(message); - await git.push(); - } -} - -export const GitHubClientInterface: Client = { - start: async (runtime: IAgentRuntime) => { - await validateGithubConfig(runtime); - elizaLogger.log("GitHubClientInterface start"); - - const client = new GitHubClient(runtime as AgentRuntime); - await client.initialize(); - await client.createMemoriesFromFiles(); - - return client; - }, - stop: async (_runtime: IAgentRuntime) => { - elizaLogger.log("GitHubClientInterface stop"); - }, -}; - -export default GitHubClientInterface; diff --git a/packages/client-github/tsconfig.json b/packages/client-github/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/client-github/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/client-github/tsup.config.ts b/packages/client-github/tsup.config.ts deleted file mode 100644 index 1a96f24afa1..00000000000 --- a/packages/client-github/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "safe-buffer", - // Add other modules you want to externalize - ], -}); diff --git a/packages/client-telegram/.npmignore b/packages/client-telegram/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/client-telegram/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/client-telegram/eslint.config.mjs b/packages/client-telegram/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/client-telegram/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/client-telegram/package.json b/packages/client-telegram/package.json deleted file mode 100644 index c32af497105..00000000000 --- a/packages/client-telegram/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@ai16z/client-telegram", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@telegraf/types": "7.1.0", - "telegraf": "4.16.3", - "zod": "3.23.8" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - } -} diff --git a/packages/client-telegram/src/config/default.json5 b/packages/client-telegram/src/config/default.json5 deleted file mode 100644 index e2183ffbd64..00000000000 --- a/packages/client-telegram/src/config/default.json5 +++ /dev/null @@ -1,18 +0,0 @@ -{ - bot: { - testEnv: false, - }, - server: { - https: false, - port: 3000, - static: false, - }, - gameServer: { - validateInitData: true, - inactivityTimeout: 300, - disconnectTimeout: 180, - fakeRoom: { - create: false, - }, - }, -} diff --git a/packages/client-telegram/src/constants.ts b/packages/client-telegram/src/constants.ts deleted file mode 100644 index f377019e1aa..00000000000 --- a/packages/client-telegram/src/constants.ts +++ /dev/null @@ -1,38 +0,0 @@ -export const MESSAGE_CONSTANTS = { - MAX_MESSAGES: 50, - RECENT_MESSAGE_COUNT: 5, - CHAT_HISTORY_COUNT: 10, - DEFAULT_SIMILARITY_THRESHOLD: 0.6, - DEFAULT_SIMILARITY_THRESHOLD_FOLLOW_UPS: 0.4, - INTEREST_DECAY_TIME: 5 * 60 * 1000, // 5 minutes - PARTIAL_INTEREST_DECAY: 3 * 60 * 1000, // 3 minutes -} as const; - -export const TIMING_CONSTANTS = { - TEAM_MEMBER_DELAY: 1500, // 1.5 seconds - TEAM_MEMBER_DELAY_MIN: 1000, // 1 second - TEAM_MEMBER_DELAY_MAX: 3000, // 3 seconds - LEADER_DELAY_MIN: 2000, // 2 seconds - LEADER_DELAY_MAX: 4000 // 4 seconds -} as const; - -export const RESPONSE_CHANCES = { - AFTER_LEADER: 0.5, // 50% chance to respond after leader -} as const; - -export const TEAM_COORDINATION = { - KEYWORDS: [ - 'team', - 'everyone', - 'all agents', - 'team update', - 'gm team', - 'hello team', - 'hey team', - 'hi team', - 'morning team', - 'evening team', - 'night team', - 'update team', - ] -} as const; \ No newline at end of file diff --git a/packages/client-telegram/src/environment.ts b/packages/client-telegram/src/environment.ts deleted file mode 100644 index b83b9e89608..00000000000 --- a/packages/client-telegram/src/environment.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { IAgentRuntime } from "@ai16z/eliza"; -import { z } from "zod"; - -export const telegramEnvSchema = z.object({ - TELEGRAM_BOT_TOKEN: z.string().min(1, "Telegram bot token is required"), -}); - -export type TelegramConfig = z.infer; - -export async function validateTelegramConfig( - runtime: IAgentRuntime -): Promise { - try { - const config = { - TELEGRAM_BOT_TOKEN: - runtime.getSetting("TELEGRAM_BOT_TOKEN") || - process.env.TELEGRAM_BOT_TOKEN, - }; - - return telegramEnvSchema.parse(config); - } catch (error) { - if (error instanceof z.ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `Telegram configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/client-telegram/src/getOrCreateRecommenderInBe.ts b/packages/client-telegram/src/getOrCreateRecommenderInBe.ts deleted file mode 100644 index f86085cc1fc..00000000000 --- a/packages/client-telegram/src/getOrCreateRecommenderInBe.ts +++ /dev/null @@ -1,40 +0,0 @@ -export async function getOrCreateRecommenderInBe( - recommenderId: string, - username: string, - backendToken: string, - backend: string, - retries = 3, - delayMs = 2000 -) { - for (let attempt = 1; attempt <= retries; attempt++) { - try { - const response = await fetch( - `${backend}/api/updaters/getOrCreateRecommender`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${backendToken}`, - }, - body: JSON.stringify({ - recommenderId: recommenderId, - username: username, - }), - } - ); - const data = await response.json(); - return data; - } catch (error) { - console.error( - `Attempt ${attempt} failed: Error getting or creating recommender in backend`, - error - ); - if (attempt < retries) { - console.log(`Retrying in ${delayMs} ms...`); - await new Promise((resolve) => setTimeout(resolve, delayMs)); - } else { - console.error("All attempts failed."); - } - } - } -} diff --git a/packages/client-telegram/src/index.ts b/packages/client-telegram/src/index.ts deleted file mode 100644 index b38b8a54312..00000000000 --- a/packages/client-telegram/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { elizaLogger } from "@ai16z/eliza"; -import { Client, IAgentRuntime } from "@ai16z/eliza"; -import { TelegramClient } from "./telegramClient.ts"; -import { validateTelegramConfig } from "./environment.ts"; - -export const TelegramClientInterface: Client = { - start: async (runtime: IAgentRuntime) => { - await validateTelegramConfig(runtime); - - const tg = new TelegramClient( - runtime, - runtime.getSetting("TELEGRAM_BOT_TOKEN") - ); - - await tg.start(); - - elizaLogger.success( - `✅ Telegram client successfully started for character ${runtime.character.name}` - ); - return tg; - }, - stop: async (_runtime: IAgentRuntime) => { - elizaLogger.warn("Telegram client does not support stopping yet"); - }, -}; - -export default TelegramClientInterface; diff --git a/packages/client-telegram/src/messageManager.ts b/packages/client-telegram/src/messageManager.ts deleted file mode 100644 index de2894859f6..00000000000 --- a/packages/client-telegram/src/messageManager.ts +++ /dev/null @@ -1,969 +0,0 @@ -import { Message } from "@telegraf/types"; -import { Context, Telegraf } from "telegraf"; - -import { composeContext, elizaLogger, ServiceType } from "@ai16z/eliza"; -import { getEmbeddingZeroVector } from "@ai16z/eliza"; -import { - Content, - HandlerCallback, - IAgentRuntime, - IImageDescriptionService, - Memory, - ModelClass, - State, - UUID, -} from "@ai16z/eliza"; -import { stringToUuid } from "@ai16z/eliza"; - -import { generateMessageResponse, generateShouldRespond } from "@ai16z/eliza"; -import { messageCompletionFooter, shouldRespondFooter } from "@ai16z/eliza"; - -import { cosineSimilarity } from "./utils"; -import { - MESSAGE_CONSTANTS, - TIMING_CONSTANTS, - RESPONSE_CHANCES, - TEAM_COORDINATION -} from "./constants"; - -const MAX_MESSAGE_LENGTH = 4096; // Telegram's max message length - -const telegramShouldRespondTemplate = - `# About {{agentName}}: -{{bio}} - -# RESPONSE EXAMPLES -{{user1}}: I just saw a really great movie -{{user2}}: Oh? Which movie? -Result: [IGNORE] - -{{agentName}}: Oh, this is my favorite scene -{{user1}}: sick -{{user2}}: wait, why is it your favorite scene -Result: [RESPOND] - -{{user1}}: stfu bot -Result: [STOP] - -{{user1}}: Hey {{agent}}, can you help me with something -Result: [RESPOND] - -{{user1}}: {{agentName}} stfu plz -Result: [STOP] - -{{user1}}: i need help -{{agentName}}: how can I help you? -{{user1}}: no. i need help from someone else -Result: [IGNORE] - -{{user1}}: Hey {{agent}}, can I ask you a question -{{agentName}}: Sure, what is it -{{user1}}: can you ask claude to create a basic react module that demonstrates a counter -Result: [RESPOND] - -{{user1}}: {{agentName}} can you tell me a story -{{agentName}}: uhhh... -{{user1}}: please do it -{{agentName}}: okay -{{agentName}}: once upon a time, in a quaint little village, there was a curious girl named elara -{{user1}}: I'm loving it, keep going -Result: [RESPOND] - -{{user1}}: {{agentName}} stop responding plz -Result: [STOP] - -{{user1}}: okay, i want to test something. {{agentName}}, can you say marco? -{{agentName}}: marco -{{user1}}: great. okay, now do it again -Result: [RESPOND] - -Response options are [RESPOND], [IGNORE] and [STOP]. - -{{agentName}} is in a room with other users and should only respond when they are being addressed, and should not respond if they are continuing a conversation that is very long. - -Respond with [RESPOND] to messages that are directed at {{agentName}}, or participate in conversations that are interesting or relevant to their background. -If a message is not interesting, relevant, or does not directly address {{agentName}}, respond with [IGNORE] - -Also, respond with [IGNORE] to messages that are very short or do not contain much information. - -If a user asks {{agentName}} to be quiet, respond with [STOP] -If {{agentName}} concludes a conversation and isn't part of the conversation anymore, respond with [STOP] - -IMPORTANT: {{agentName}} is particularly sensitive about being annoying, so if there is any doubt, it is better to respond with [IGNORE]. -If {{agentName}} is conversing with a user and they have not asked to stop, it is better to respond with [RESPOND]. - -The goal is to decide whether {{agentName}} should respond to the last message. - -{{recentMessages}} - -Thread of Tweets You Are Replying To: - -{{formattedConversation}} - -# INSTRUCTIONS: Choose the option that best describes {{agentName}}'s response to the last message. Ignore messages if they are addressed to someone else. -` + shouldRespondFooter; - -const telegramMessageHandlerTemplate = - // {{goals}} - `# Action Examples -{{actionExamples}} -(Action examples are for reference only. Do not use the information from them in your response.) - -# Knowledge -{{knowledge}} - -# Task: Generate dialog and actions for the character {{agentName}}. -About {{agentName}}: -{{bio}} -{{lore}} - -Examples of {{agentName}}'s dialog and actions: -{{characterMessageExamples}} - -{{providers}} - -{{attachments}} - -{{actions}} - -# Capabilities -Note that {{agentName}} is capable of reading/seeing/hearing various forms of media, including images, videos, audio, plaintext and PDFs. Recent attachments have been included above under the "Attachments" section. - -{{messageDirections}} - -{{recentMessages}} - -# Task: Generate a post/reply in the voice, style and perspective of {{agentName}} (@{{twitterUserName}}) while using the thread of tweets as additional context: -Current Post: -{{currentPost}} -Thread of Tweets You Are Replying To: - -{{formattedConversation}} -` + messageCompletionFooter; - -interface MessageContext { - content: string; - timestamp: number; -} - -export type InterestChats = { - [key: string]: { - currentHandler: string | undefined; - lastMessageSent: number; - messages: { userId: UUID; userName: string; content: Content }[]; - previousContext?: MessageContext; - contextSimilarityThreshold?: number; - }; -}; - -export class MessageManager { - public bot: Telegraf; - private runtime: IAgentRuntime; - private interestChats: InterestChats = {}; - private teamMemberUsernames: Map = new Map(); - - constructor(bot: Telegraf, runtime: IAgentRuntime) { - this.bot = bot; - this.runtime = runtime; - - this._initializeTeamMemberUsernames().catch(error => - elizaLogger.error("Error initializing team member usernames:", error) - ); - } - - private async _initializeTeamMemberUsernames(): Promise { - if (!this.runtime.character.clientConfig?.telegram?.isPartOfTeam) return; - - const teamAgentIds = this.runtime.character.clientConfig.telegram.teamAgentIds || []; - - for (const id of teamAgentIds) { - try { - const chat = await this.bot.telegram.getChat(id); - if ('username' in chat && chat.username) { - this.teamMemberUsernames.set(id, chat.username); - elizaLogger.info(`Cached username for team member ${id}: ${chat.username}`); - } - } catch (error) { - elizaLogger.error(`Error getting username for team member ${id}:`, error); - } - } - } - - private _getTeamMemberUsername(id: string): string | undefined { - return this.teamMemberUsernames.get(id); - } - - private _getNormalizedUserId(id: string | number): string { - return id.toString().replace(/[^0-9]/g, ''); - } - - private _isTeamMember(userId: string | number): boolean { - const teamConfig = this.runtime.character.clientConfig?.telegram; - if (!teamConfig?.isPartOfTeam || !teamConfig.teamAgentIds) return false; - - const normalizedUserId = this._getNormalizedUserId(userId); - return teamConfig.teamAgentIds.some(teamId => - this._getNormalizedUserId(teamId) === normalizedUserId - ); - } - - private _isTeamLeader(): boolean { - return this.bot.botInfo?.id.toString() === this.runtime.character.clientConfig?.telegram?.teamLeaderId; - } - - private _isTeamCoordinationRequest(content: string): boolean { - const contentLower = content.toLowerCase(); - return TEAM_COORDINATION.KEYWORDS?.some(keyword => - contentLower.includes(keyword.toLowerCase()) - ); - } - - private _isRelevantToTeamMember(content: string, chatId: string, lastAgentMemory: Memory | null = null): boolean { - const teamConfig = this.runtime.character.clientConfig?.telegram; - - // Check leader's context based on last message - if (this._isTeamLeader() && lastAgentMemory?.content.text) { - const timeSinceLastMessage = Date.now() - lastAgentMemory.createdAt; - if (timeSinceLastMessage > MESSAGE_CONSTANTS.INTEREST_DECAY_TIME) { - return false; - } - - const similarity = cosineSimilarity( - content.toLowerCase(), - lastAgentMemory.content.text.toLowerCase() - ); - - return similarity >= MESSAGE_CONSTANTS.DEFAULT_SIMILARITY_THRESHOLD_FOLLOW_UPS; - } - - // Check team member keywords - if (!teamConfig?.teamMemberInterestKeywords?.length) { - return false; // If no keywords defined, only leader maintains conversation - } - - // Check if content matches any team member keywords - return teamConfig.teamMemberInterestKeywords.some(keyword => - content.toLowerCase().includes(keyword.toLowerCase()) - ); - } - - private async _analyzeContextSimilarity(currentMessage: string, previousContext?: MessageContext, agentLastMessage?: string): Promise { - if (!previousContext) return 1; - - const timeDiff = Date.now() - previousContext.timestamp; - const timeWeight = Math.max(0, 1 - (timeDiff / (5 * 60 * 1000))); - - const similarity = cosineSimilarity( - currentMessage.toLowerCase(), - previousContext.content.toLowerCase(), - agentLastMessage?.toLowerCase() - ); - - return similarity * timeWeight; - } - - private async _shouldRespondBasedOnContext(message: Message, chatState: InterestChats[string]): Promise { - const messageText = 'text' in message ? message.text : - 'caption' in message ? (message as any).caption : ''; - - if (!messageText) return false; - - // Always respond if mentioned - if (this._isMessageForMe(message)) return true; - - // If we're not the current handler, don't respond - if (chatState?.currentHandler !== this.bot.botInfo?.id.toString()) return false; - - // Check if we have messages to compare - if (!chatState.messages?.length) return false; - - // Get last user message (not from the bot) - const lastUserMessage = [...chatState.messages] - .reverse() - .find((m, index) => - index > 0 && // Skip first message (current) - m.userId !== this.runtime.agentId - ); - - if (!lastUserMessage) return false; - - const lastSelfMemories = await this.runtime.messageManager.getMemories({ - roomId: stringToUuid(message.chat.id.toString() + "-" + this.runtime.agentId), - unique: false, - count: 5 - }); - - const lastSelfSortedMemories = lastSelfMemories?.filter(m => m.userId === this.runtime.agentId) - .sort((a, b) => (b.createdAt || 0) - (a.createdAt || 0)); - - // Calculate context similarity - const contextSimilarity = await this._analyzeContextSimilarity( - messageText, - { - content: lastUserMessage.content.text || '', - timestamp: Date.now() - }, - lastSelfSortedMemories?.[0]?.content?.text - ); - - const similarityThreshold = - this.runtime.character.clientConfig?.telegram?.messageSimilarityThreshold || - chatState.contextSimilarityThreshold || - MESSAGE_CONSTANTS.DEFAULT_SIMILARITY_THRESHOLD; - - return contextSimilarity >= similarityThreshold; - } - - private _isMessageForMe(message: Message): boolean { - const botUsername = this.bot.botInfo?.username; - if (!botUsername) return false; - - const messageText = 'text' in message ? message.text : - 'caption' in message ? (message as any).caption : ''; - if (!messageText) return false; - - const isMentioned = messageText.includes(`@${botUsername}`); - const hasUsername = messageText.toLowerCase().includes(botUsername.toLowerCase()); - - return isMentioned || (!this.runtime.character.clientConfig?.telegram?.shouldRespondOnlyToMentions && hasUsername); - } - - private _checkInterest(chatId: string): boolean { - const chatState = this.interestChats[chatId]; - if (!chatState) return false; - - const lastMessage = chatState.messages[chatState.messages.length - 1]; - const timeSinceLastMessage = Date.now() - chatState.lastMessageSent; - - if (timeSinceLastMessage > MESSAGE_CONSTANTS.INTEREST_DECAY_TIME) { - delete this.interestChats[chatId]; - return false; - } else if (timeSinceLastMessage > MESSAGE_CONSTANTS.PARTIAL_INTEREST_DECAY) { - return this._isRelevantToTeamMember(lastMessage?.content.text || '', chatId); - } - - // Team leader specific checks - if (this._isTeamLeader() && chatState.messages.length > 0) { - if (!this._isRelevantToTeamMember(lastMessage?.content.text || '', chatId)) { - const recentTeamResponses = chatState.messages.slice(-3).some(m => - m.userId !== this.runtime.agentId && - this._isTeamMember(m.userId.toString()) - ); - - if (recentTeamResponses) { - delete this.interestChats[chatId]; - return false; - } - } - } - - return true; - } - - // Process image messages and generate descriptions - private async processImage( - message: Message - ): Promise<{ description: string } | null> { - try { - let imageUrl: string | null = null; - - elizaLogger.info(`Telegram Message: ${message}`) - - if ("photo" in message && message.photo?.length > 0) { - const photo = message.photo[message.photo.length - 1]; - const fileLink = await this.bot.telegram.getFileLink( - photo.file_id - ); - imageUrl = fileLink.toString(); - } else if ( - "document" in message && - message.document?.mime_type?.startsWith("image/") - ) { - const fileLink = await this.bot.telegram.getFileLink( - message.document.file_id - ); - imageUrl = fileLink.toString(); - } - - if (imageUrl) { - const imageDescriptionService = - this.runtime.getService( - ServiceType.IMAGE_DESCRIPTION - ); - const { title, description } = - await imageDescriptionService.describeImage(imageUrl); - return { description: `[Image: ${title}\n${description}]` }; - } - } catch (error) { - console.error("❌ Error processing image:", error); - } - - return null; - } - - // Decide if the bot should respond to the message - private async _shouldRespond( - message: Message, - state: State - ): Promise { - - if (this.runtime.character.clientConfig?.telegram?.shouldRespondOnlyToMentions) { - return this._isMessageForMe(message); - } - - // Respond if bot is mentioned - if ( - "text" in message && - message.text?.includes(`@${this.bot.botInfo?.username}`) - ) { - elizaLogger.info(`Bot mentioned`) - return true; - } - - // Respond to private chats - if (message.chat.type === "private") { - return true; - } - - // Don't respond to images in group chats - if ( - "photo" in message || - ("document" in message && - message.document?.mime_type?.startsWith("image/")) - ) { - return false; - } - - const chatId = message.chat.id.toString(); - const chatState = this.interestChats[chatId]; - const messageText = 'text' in message ? message.text : - 'caption' in message ? (message as any).caption : ''; - - // Check if team member has direct interest first - if (this.runtime.character.clientConfig?.discord?.isPartOfTeam && - !this._isTeamLeader() && - this._isRelevantToTeamMember(messageText, chatId)) { - - return true; - } - - // Team-based response logic - if (this.runtime.character.clientConfig?.telegram?.isPartOfTeam) { - // Team coordination - if(this._isTeamCoordinationRequest(messageText)) { - if (this._isTeamLeader()) { - return true; - } else { - const randomDelay = Math.floor(Math.random() * (TIMING_CONSTANTS.TEAM_MEMBER_DELAY_MAX - TIMING_CONSTANTS.TEAM_MEMBER_DELAY_MIN)) + - TIMING_CONSTANTS.TEAM_MEMBER_DELAY_MIN; // 1-3 second random delay - await new Promise(resolve => setTimeout(resolve, randomDelay)); - return true; - } - } - - if (!this._isTeamLeader() && this._isRelevantToTeamMember(messageText, chatId)) { - // Add small delay for non-leader responses - await new Promise(resolve => setTimeout(resolve, TIMING_CONSTANTS.TEAM_MEMBER_DELAY)); //1.5 second delay - - // If leader has responded in last few seconds, reduce chance of responding - if (chatState.messages?.length) { - const recentMessages = chatState.messages.slice(-MESSAGE_CONSTANTS.RECENT_MESSAGE_COUNT); - const leaderResponded = recentMessages.some(m => - m.userId === this.runtime.character.clientConfig?.telegram?.teamLeaderId && - Date.now() - chatState.lastMessageSent < 3000 - ); - - if (leaderResponded) { - // 50% chance to respond if leader just did - return Math.random() > RESPONSE_CHANCES.AFTER_LEADER; - } - } - - return true; - } - - // If I'm the leader but message doesn't match my keywords, add delay and check for team responses - if (this._isTeamLeader() && !this._isRelevantToTeamMember(messageText, chatId)) { - const randomDelay = Math.floor(Math.random() * (TIMING_CONSTANTS.LEADER_DELAY_MAX - TIMING_CONSTANTS.LEADER_DELAY_MIN)) + - TIMING_CONSTANTS.LEADER_DELAY_MIN; // 2-4 second random delay - await new Promise(resolve => setTimeout(resolve, randomDelay)); - - // After delay, check if another team member has already responded - if (chatState?.messages?.length) { - const recentResponses = chatState.messages.slice(-MESSAGE_CONSTANTS.RECENT_MESSAGE_COUNT); - const otherTeamMemberResponded = recentResponses.some(m => - m.userId !== this.runtime.agentId && - this._isTeamMember(m.userId) - ); - - if (otherTeamMemberResponded) { - return false; - } - } - } - - // Update current handler if we're mentioned - if (this._isMessageForMe(message)) { - const channelState = this.interestChats[chatId]; - if (channelState) { - channelState.currentHandler = this.bot.botInfo?.id.toString() - channelState.lastMessageSent = Date.now(); - } - return true; - } - - // Don't respond if another teammate is handling the conversation - if (chatState?.currentHandler) { - if (chatState.currentHandler !== this.bot.botInfo?.id.toString() && - this._isTeamMember(chatState.currentHandler)) { - return false; - } - } - - // Natural conversation cadence - if (!this._isMessageForMe(message) && this.interestChats[chatId]) { - - const recentMessages = this.interestChats[chatId].messages - .slice(-MESSAGE_CONSTANTS.CHAT_HISTORY_COUNT); - const ourMessageCount = recentMessages.filter(m => - m.userId === this.runtime.agentId - ).length; - - if (ourMessageCount > 2) { - - const responseChance = Math.pow(0.5, ourMessageCount - 2); - if (Math.random() > responseChance) { - return; - } - } - } - - } - - // Check context-based response for team conversations - if (chatState?.currentHandler) { - const shouldRespondContext = await this._shouldRespondBasedOnContext(message, chatState); - - if (!shouldRespondContext) { - return false; - } - - } - - - // Use AI to decide for text or captions - if ("text" in message || ("caption" in message && message.caption)) { - const shouldRespondContext = composeContext({ - state, - template: - this.runtime.character.templates - ?.telegramShouldRespondTemplate || - this.runtime.character?.templates?.shouldRespondTemplate || - telegramShouldRespondTemplate, - }); - - const response = await generateShouldRespond({ - runtime: this.runtime, - context: shouldRespondContext, - modelClass: ModelClass.SMALL, - }); - - return response === "RESPOND"; - } - - return false; - } - - // Send long messages in chunks - private async sendMessageInChunks( - ctx: Context, - content: string, - replyToMessageId?: number - ): Promise { - const chunks = this.splitMessage(content); - const sentMessages: Message.TextMessage[] = []; - - for (let i = 0; i < chunks.length; i++) { - const chunk = chunks[i]; - const sentMessage = (await ctx.telegram.sendMessage( - ctx.chat.id, - chunk, - { - reply_parameters: - i === 0 && replyToMessageId - ? { message_id: replyToMessageId } - : undefined, - } - )) as Message.TextMessage; - - sentMessages.push(sentMessage); - } - - return sentMessages; - } - - // Split message into smaller parts - private splitMessage(text: string): string[] { - const chunks: string[] = []; - let currentChunk = ""; - - const lines = text.split("\n"); - for (const line of lines) { - if (currentChunk.length + line.length + 1 <= MAX_MESSAGE_LENGTH) { - currentChunk += (currentChunk ? "\n" : "") + line; - } else { - if (currentChunk) chunks.push(currentChunk); - currentChunk = line; - } - } - - if (currentChunk) chunks.push(currentChunk); - return chunks; - } - - // Generate a response using AI - private async _generateResponse( - message: Memory, - _state: State, - context: string - ): Promise { - const { userId, roomId } = message; - - const response = await generateMessageResponse({ - runtime: this.runtime, - context, - modelClass: ModelClass.LARGE, - }); - - if (!response) { - console.error("❌ No response from generateMessageResponse"); - return null; - } - - await this.runtime.databaseAdapter.log({ - body: { message, context, response }, - userId, - roomId, - type: "response", - }); - - return response; - } - - // Main handler for incoming messages - public async handleMessage(ctx: Context): Promise { - if (!ctx.message || !ctx.from) { - return; // Exit if no message or sender info - } - - if ( - this.runtime.character.clientConfig?.telegram - ?.shouldIgnoreBotMessages && - ctx.from.is_bot - ) { - return; - } - if ( - this.runtime.character.clientConfig?.telegram - ?.shouldIgnoreDirectMessages && - ctx.chat?.type === "private" - ) { - return; - } - - const message = ctx.message; - const chatId = ctx.chat?.id.toString(); - const messageText = 'text' in message ? message.text : - 'caption' in message ? (message as any).caption : ''; - - // Add team handling at the start - if (this.runtime.character.clientConfig?.telegram?.isPartOfTeam && - !this.runtime.character.clientConfig?.telegram?.shouldRespondOnlyToMentions) { - - const isDirectlyMentioned = this._isMessageForMe(message); - const hasInterest = this._checkInterest(chatId); - - - // Non-leader team member showing interest based on keywords - if (!this._isTeamLeader() && this._isRelevantToTeamMember(messageText, chatId)) { - - this.interestChats[chatId] = { - currentHandler: this.bot.botInfo?.id.toString(), - lastMessageSent: Date.now(), - messages: [] - }; - } - - const isTeamRequest = this._isTeamCoordinationRequest(messageText); - const isLeader = this._isTeamLeader(); - - - // Check for continued interest - if (hasInterest && !isDirectlyMentioned) { - const lastSelfMemories = await this.runtime.messageManager.getMemories({ - roomId: stringToUuid(chatId + "-" + this.runtime.agentId), - unique: false, - count: 5 - }); - - const lastSelfSortedMemories = lastSelfMemories?.filter(m => m.userId === this.runtime.agentId) - .sort((a, b) => (b.createdAt || 0) - (a.createdAt || 0)); - - const isRelevant = this._isRelevantToTeamMember( - messageText, - chatId, - lastSelfSortedMemories?.[0] - ); - - if (!isRelevant) { - delete this.interestChats[chatId]; - return; - } - } - - // Handle team coordination requests - if (isTeamRequest) { - if (isLeader) { - this.interestChats[chatId] = { - currentHandler: this.bot.botInfo?.id.toString(), - lastMessageSent: Date.now(), - messages: [] - }; - } else { - this.interestChats[chatId] = { - currentHandler: this.bot.botInfo?.id.toString(), - lastMessageSent: Date.now(), - messages: [] - }; - - if (!isDirectlyMentioned) { - this.interestChats[chatId].lastMessageSent = 0; - } - - } - } - - // Check for other team member mentions using cached usernames - const otherTeamMembers = this.runtime.character.clientConfig.telegram.teamAgentIds.filter( - id => id !== this.bot.botInfo?.id.toString() - ); - - const mentionedTeamMember = otherTeamMembers.find(id => { - const username = this._getTeamMemberUsername(id); - return username && messageText?.includes(`@${username}`); - }); - - // If another team member is mentioned, clear our interest - if (mentionedTeamMember) { - if (hasInterest || this.interestChats[chatId]?.currentHandler === this.bot.botInfo?.id.toString()) { - delete this.interestChats[chatId]; - - // Only return if we're not the mentioned member - if (!isDirectlyMentioned) { - return; - } - } - } - - // Set/maintain interest only if we're mentioned or already have interest - if (isDirectlyMentioned) { - this.interestChats[chatId] = { - currentHandler: this.bot.botInfo?.id.toString(), - lastMessageSent: Date.now(), - messages: [] - }; - } else if (!isTeamRequest && !hasInterest) { - return; - } - - // Update message tracking - if (this.interestChats[chatId]) { - this.interestChats[chatId].messages.push({ - userId: stringToUuid(ctx.from.id.toString()), - userName: ctx.from.username || ctx.from.first_name || "Unknown User", - content: { text: messageText, source: "telegram" } - }); - - if (this.interestChats[chatId].messages.length > MESSAGE_CONSTANTS.MAX_MESSAGES) { - this.interestChats[chatId].messages = - this.interestChats[chatId].messages.slice(-MESSAGE_CONSTANTS.MAX_MESSAGES); - } - } - } - - try { - // Convert IDs to UUIDs - const userId = stringToUuid(ctx.from.id.toString()) as UUID; - - // Get user name - const userName = - ctx.from.username || ctx.from.first_name || "Unknown User"; - - // Get chat ID - const chatId = stringToUuid( - ctx.chat?.id.toString() + "-" + this.runtime.agentId - ) as UUID; - - // Get agent ID - const agentId = this.runtime.agentId; - - // Get room ID - const roomId = chatId; - - // Ensure connection - await this.runtime.ensureConnection( - userId, - roomId, - userName, - userName, - "telegram" - ); - - // Get message ID - const messageId = stringToUuid( - message.message_id.toString() + "-" + this.runtime.agentId - ) as UUID; - - // Handle images - const imageInfo = await this.processImage(message); - - // Get text or caption - let messageText = ""; - if ("text" in message) { - messageText = message.text; - } else if ("caption" in message && message.caption) { - messageText = message.caption; - } - - // Combine text and image description - const fullText = imageInfo - ? `${messageText} ${imageInfo.description}` - : messageText; - - if (!fullText) { - return; // Skip if no content - } - - // Create content - const content: Content = { - text: fullText, - source: "telegram", - inReplyTo: - "reply_to_message" in message && message.reply_to_message - ? stringToUuid( - message.reply_to_message.message_id.toString() + - "-" + - this.runtime.agentId - ) - : undefined, - }; - - // Create memory for the message - const memory: Memory = { - id: messageId, - agentId, - userId, - roomId, - content, - createdAt: message.date * 1000, - embedding: getEmbeddingZeroVector(), - }; - - // Create memory - await this.runtime.messageManager.createMemory(memory); - - // Update state with the new memory - let state = await this.runtime.composeState(memory); - state = await this.runtime.updateRecentMessageState(state); - - // Decide whether to respond - const shouldRespond = await this._shouldRespond(message, state); - - if (shouldRespond) { - // Generate response - const context = composeContext({ - state, - template: - this.runtime.character.templates - ?.telegramMessageHandlerTemplate || - this.runtime.character?.templates - ?.messageHandlerTemplate || - telegramMessageHandlerTemplate, - }); - - const responseContent = await this._generateResponse( - memory, - state, - context - ); - - if (!responseContent || !responseContent.text) return; - - // Send response in chunks - const callback: HandlerCallback = async (content: Content) => { - const sentMessages = await this.sendMessageInChunks( - ctx, - content.text, - message.message_id - ); - - const memories: Memory[] = []; - - // Create memories for each sent message - for (let i = 0; i < sentMessages.length; i++) { - const sentMessage = sentMessages[i]; - const isLastMessage = i === sentMessages.length - 1; - - const memory: Memory = { - id: stringToUuid( - sentMessage.message_id.toString() + - "-" + - this.runtime.agentId - ), - agentId, - userId: agentId, - roomId, - content: { - ...content, - text: sentMessage.text, - inReplyTo: messageId, - }, - createdAt: sentMessage.date * 1000, - embedding: getEmbeddingZeroVector(), - }; - - // Set action to CONTINUE for all messages except the last one - // For the last message, use the original action from the response content - memory.content.action = !isLastMessage - ? "CONTINUE" - : content.action; - - await this.runtime.messageManager.createMemory(memory); - memories.push(memory); - } - - return memories; - }; - - // Execute callback to send messages and log memories - const responseMessages = await callback(responseContent); - - // Update state after response - state = await this.runtime.updateRecentMessageState(state); - - // Handle any resulting actions - await this.runtime.processActions( - memory, - responseMessages, - state, - callback - ); - } - - await this.runtime.evaluate(memory, state, shouldRespond); - } catch (error) { - elizaLogger.error("❌ Error handling message:", error); - elizaLogger.error("Error sending message:", error); - } - } -} \ No newline at end of file diff --git a/packages/client-telegram/src/telegramClient.ts b/packages/client-telegram/src/telegramClient.ts deleted file mode 100644 index 2900a1f648c..00000000000 --- a/packages/client-telegram/src/telegramClient.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { Context, Telegraf } from "telegraf"; -import { IAgentRuntime, elizaLogger } from "@ai16z/eliza"; -import { MessageManager } from "./messageManager.ts"; -import { getOrCreateRecommenderInBe } from "./getOrCreateRecommenderInBe.ts"; - -export class TelegramClient { - private bot: Telegraf; - private runtime: IAgentRuntime; - private messageManager: MessageManager; - private backend; - private backendToken; - private tgTrader; - - constructor(runtime: IAgentRuntime, botToken: string) { - elizaLogger.log("📱 Constructing new TelegramClient..."); - this.runtime = runtime; - this.bot = new Telegraf(botToken); - this.messageManager = new MessageManager(this.bot, this.runtime); - this.backend = runtime.getSetting("BACKEND_URL"); - this.backendToken = runtime.getSetting("BACKEND_TOKEN"); - this.tgTrader = runtime.getSetting("TG_TRADER"); // boolean To Be added to the settings - elizaLogger.log("✅ TelegramClient constructor completed"); - } - - public async start(): Promise { - elizaLogger.log("🚀 Starting Telegram bot..."); - try { - await this.initializeBot(); - this.setupMessageHandlers(); - this.setupShutdownHandlers(); - } catch (error) { - elizaLogger.error("❌ Failed to launch Telegram bot:", error); - throw error; - } - } - - private async initializeBot(): Promise { - this.bot.launch({ dropPendingUpdates: true }); - elizaLogger.log( - "✨ Telegram bot successfully launched and is running!" - ); - - const botInfo = await this.bot.telegram.getMe(); - this.bot.botInfo = botInfo; - elizaLogger.success(`Bot username: @${botInfo.username}`); - - this.messageManager.bot = this.bot; - } - - private setupMessageHandlers(): void { - elizaLogger.log("Setting up message handler..."); - - this.bot.on("message", async (ctx) => { - try { - if (this.tgTrader) { - const userId = ctx.from?.id.toString(); - const username = - ctx.from?.username || ctx.from?.first_name || "Unknown"; - if (!userId) { - elizaLogger.warn( - "Received message from a user without an ID." - ); - return; - } - try { - await getOrCreateRecommenderInBe( - userId, - username, - this.backendToken, - this.backend - ); - } catch (error) { - elizaLogger.error( - "Error getting or creating recommender in backend", - error - ); - } - } - await this.messageManager.handleMessage(ctx); - } catch (error) { - elizaLogger.error("❌ Error handling message:", error); - await ctx.reply( - "An error occurred while processing your message." - ); - } - }); - - this.bot.on("photo", (ctx) => { - elizaLogger.log( - "📸 Received photo message with caption:", - ctx.message.caption - ); - }); - - this.bot.on("document", (ctx) => { - elizaLogger.log( - "📎 Received document message:", - ctx.message.document.file_name - ); - }); - - this.bot.catch((err, ctx) => { - elizaLogger.error(`❌ Telegram Error for ${ctx.updateType}:`, err); - ctx.reply("An unexpected error occurred. Please try again later."); - }); - } - - private setupShutdownHandlers(): void { - const shutdownHandler = async (signal: string) => { - elizaLogger.log( - `⚠️ Received ${signal}. Shutting down Telegram bot gracefully...` - ); - try { - await this.stop(); - elizaLogger.log("🛑 Telegram bot stopped gracefully"); - } catch (error) { - elizaLogger.error( - "❌ Error during Telegram bot shutdown:", - error - ); - throw error; - } - }; - - process.once("SIGINT", () => shutdownHandler("SIGINT")); - process.once("SIGTERM", () => shutdownHandler("SIGTERM")); - process.once("SIGHUP", () => shutdownHandler("SIGHUP")); - } - - public async stop(): Promise { - elizaLogger.log("Stopping Telegram bot..."); - await this.bot.stop(); - elizaLogger.log("Telegram bot stopped"); - } -} diff --git a/packages/client-telegram/src/utils.ts b/packages/client-telegram/src/utils.ts deleted file mode 100644 index 86f0278f0e3..00000000000 --- a/packages/client-telegram/src/utils.ts +++ /dev/null @@ -1,97 +0,0 @@ -export function cosineSimilarity(text1: string, text2: string, text3?: string): number { - const preprocessText = (text: string) => text - .toLowerCase() - .replace(/[^\w\s'_-]/g, ' ') - .replace(/\s+/g, ' ') - .trim(); - - const getWords = (text: string) => { - return text.split(' ').filter(word => word.length > 1); - }; - - const words1 = getWords(preprocessText(text1)); - const words2 = getWords(preprocessText(text2)); - const words3 = text3 ? getWords(preprocessText(text3)) : []; - - const freq1: { [key: string]: number } = {}; - const freq2: { [key: string]: number } = {}; - const freq3: { [key: string]: number } = {}; - - words1.forEach(word => freq1[word] = (freq1[word] || 0) + 1); - words2.forEach(word => freq2[word] = (freq2[word] || 0) + 1); - if (words3.length) { - words3.forEach(word => freq3[word] = (freq3[word] || 0) + 1); - } - - const uniqueWords = new Set([...Object.keys(freq1), ...Object.keys(freq2), ...(words3.length ? Object.keys(freq3) : [])]); - - let dotProduct = 0; - let magnitude1 = 0; - let magnitude2 = 0; - let magnitude3 = 0; - - uniqueWords.forEach(word => { - const val1 = freq1[word] || 0; - const val2 = freq2[word] || 0; - const val3 = freq3[word] || 0; - - if (words3.length) { - // For three-way, calculate pairwise similarities - const sim12 = val1 * val2; - const sim23 = val2 * val3; - const sim13 = val1 * val3; - - // Take maximum similarity between any pair - dotProduct += Math.max(sim12, sim23, sim13); - } else { - dotProduct += val1 * val2; - } - - magnitude1 += val1 * val1; - magnitude2 += val2 * val2; - if (words3.length) { - magnitude3 += val3 * val3; - } - }); - - magnitude1 = Math.sqrt(magnitude1); - magnitude2 = Math.sqrt(magnitude2); - magnitude3 = words3.length ? Math.sqrt(magnitude3) : 1; - - if (magnitude1 === 0 || magnitude2 === 0 || (words3.length && magnitude3 === 0)) return 0; - - // For two texts, use original calculation - if (!words3.length) { - return dotProduct / (magnitude1 * magnitude2); - } - - // For three texts, use max magnitude pair to maintain scale - const maxMagnitude = Math.max( - magnitude1 * magnitude2, - magnitude2 * magnitude3, - magnitude1 * magnitude3 - ); - - return dotProduct / maxMagnitude; -} - -/** - * Splits a message into chunks that fit within Telegram's message length limit - */ -export function splitMessage(text: string, maxLength: number = 4096): string[] { - const chunks: string[] = []; - let currentChunk = ""; - - const lines = text.split("\n"); - for (const line of lines) { - if (currentChunk.length + line.length + 1 <= maxLength) { - currentChunk += (currentChunk ? "\n" : "") + line; - } else { - if (currentChunk) chunks.push(currentChunk); - currentChunk = line; - } - } - - if (currentChunk) chunks.push(currentChunk); - return chunks; -} \ No newline at end of file diff --git a/packages/client-telegram/tsconfig.json b/packages/client-telegram/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/client-telegram/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/client-telegram/tsup.config.ts b/packages/client-telegram/tsup.config.ts deleted file mode 100644 index e42bf4efeae..00000000000 --- a/packages/client-telegram/tsup.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - // Add other modules you want to externalize - ], -}); diff --git a/packages/create-eliza-app/README.md b/packages/create-eliza-app/README.md deleted file mode 100644 index 93f02db25ec..00000000000 --- a/packages/create-eliza-app/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# create-eliza-app - -A minimal CLI tool to scaffold ELIZA applications with zero configuration. Get started building your own ELIZA-style chatbot in seconds. - - - -[![npm version](https://img.shields.io/npm/v/create-eliza-app?color=yellow)](https://npmjs.com/package/create-eliza-app) -[![npm downloads](https://img.shields.io/npm/dm/create-eliza-app?color=yellow)](https://npm.chart.dev/create-eliza-app) -[![bundle size](https://img.shields.io/bundlephobia/minzip/create-eliza-app?color=yellow)](https://bundlephobia.com/package/create-eliza-app) - - - -## Usage - -You can create a new ELIZA app with your preferred package manager: - - - -```sh -# npm -npx create-eliza-app@latest path - -# pnpm -pnpm dlx create-eliza-app@latest path - -# bun -bunx create-eliza-app@latest path - -# deno -deno run -A npm:create-eliza-app@latest path -``` - - - -## Command Line Arguments - -- `--name`: Name of the template to use (default: "eliza") -- `--dir`: Directory where the project will be created (default: current directory) -- `--registry`: Custom registry URL for templates - -## Getting Started - -Once your project is created: - -1. Navigate to the project directory: - - ```bash - cd your-project-name - ``` - -2. Copy the example environment file: - - ```bash - cp .env.example .env - ``` - -3. Install dependencies: - - ```bash - pnpm install - ``` - -4. Start the development server: - ```bash - pnpm start - ``` - - - ---- - -_🤖 auto updated with [automd](https://automd.unjs.io)_ - - diff --git a/packages/create-eliza-app/eslint.config.mjs b/packages/create-eliza-app/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/create-eliza-app/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/create-eliza-app/package.json b/packages/create-eliza-app/package.json deleted file mode 100644 index 0206679e790..00000000000 --- a/packages/create-eliza-app/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "create-eliza-app", - "version": "0.1.5-alpha.5", - "description": "", - "sideEffects": false, - "files": [ - "dist" - ], - "main": "dist/index.cjs", - "bin": { - "create-eliza-app": "dist/index.mjs" - }, - "scripts": { - "build": "unbuild", - "lint": "eslint . --fix", - "start": "node ./dist/index.cjs", - "automd": "automd" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "citty": "0.1.6", - "giget": "1.2.3" - }, - "devDependencies": { - "automd": "0.3.12", - "jiti": "2.4.0", - "unbuild": "2.0.0" - } -} diff --git a/packages/create-eliza-app/registry/eliza.json b/packages/create-eliza-app/registry/eliza.json deleted file mode 100644 index d416010cb5d..00000000000 --- a/packages/create-eliza-app/registry/eliza.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "eliza", - "defaultDir": "eliza", - "url": "https://github.com/ai16z/eliza-starter", - "tar": "https://codeload.github.com/ai16z/eliza-starter/tar.gz/refs/heads/main" -} diff --git a/packages/create-eliza-app/src/index.ts b/packages/create-eliza-app/src/index.ts deleted file mode 100644 index e46a4be5f57..00000000000 --- a/packages/create-eliza-app/src/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env node - -import { downloadTemplate } from "giget"; -import { runMain } from "citty"; - -const DEFAULT_TEMPLATE = "eliza"; -const DEFAULT_REGISTRY = - "https://raw.githubusercontent.com/ai16z/eliza/main/packages/create-eliza-app/registry"; - -runMain({ - args: { - name: { - type: "string", - description: "Name of the template to use", - required: false, - }, - registry: { - type: "string", - description: "Registry URL to download the template from", - default: DEFAULT_REGISTRY, - }, - dir: { - type: "string", - description: "Directory where the project will be created", - required: false, - }, - _dir: { - type: "positional", - default: ".", - description: "Project directory (prefer using --dir)", - }, - }, - async run(context) { - try { - const templateName = context.args.name || DEFAULT_TEMPLATE; - const targetDir = context.args.dir || context.args._dir; - - console.log(`Downloading template ${templateName}...`); - - const res = await downloadTemplate(templateName, { - registry: context.args.registry, - dir: targetDir, - }); - - console.log(`Downloaded template to ${res.dir} from ${res.source}`); - - // Print getting started instructions if using default template - if (templateName === DEFAULT_TEMPLATE) { - console.log("\nGetting Started:"); - console.log(` cd ${res.dir}`); - console.log(" cp .env.example .env"); - console.log(" pnpm install"); - console.log(" pnpm start"); - } - } catch (error: any) { - console.error( - "Error:", - "message" in error ? error.message : "unknown error" - ); - process.exit(1); - } - }, -}); diff --git a/packages/create-eliza-app/tsconfig.json b/packages/create-eliza-app/tsconfig.json deleted file mode 100644 index 885dc1ca3c1..00000000000 --- a/packages/create-eliza-app/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "module": "ESNext", - "moduleResolution": "Node", - "esModuleInterop": true, - "strict": true, - "skipLibCheck": true - }, - "include": ["src"] -} diff --git a/packages/plugin-0g/package.json b/packages/plugin-0g/package.json deleted file mode 100644 index fa36f6367ee..00000000000 --- a/packages/plugin-0g/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@ai16z/plugin-0g", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@0glabs/0g-ts-sdk": "0.2.1", - "@ai16z/eliza": "workspace:*", - "ethers": "6.13.4", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest" - } -} diff --git a/packages/plugin-0g/readme.md b/packages/plugin-0g/readme.md deleted file mode 100644 index f104259acee..00000000000 --- a/packages/plugin-0g/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# @ai16z/plugin-0g - -A plugin for storing data using the 0G protocol within the AI16Z ecosystem. - -## Description - -The 0G plugin enables seamless integration with the Zero Gravity (0G) protocol for decentralized file storage. It provides functionality to upload files to the 0G network. - -## Future work - -- Enable model service deployment on 0G serving network. -- Implement 0G KV store for plugin state persistence . -- Store upload history and file metadata. -- Provide 0G as a db option for Eliza to store its memory/state. -- Enhance file path and context extraction. diff --git a/packages/plugin-0g/src/index.ts b/packages/plugin-0g/src/index.ts deleted file mode 100644 index 7c4b976e857..00000000000 --- a/packages/plugin-0g/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Plugin } from "@ai16z/eliza"; -import { zgUpload } from "./actions/upload"; - -export const zgPlugin: Plugin = { - description: "ZeroG Plugin for Eliza", - name: "ZeroG", - actions: [zgUpload], - evaluators: [], - providers: [], -}; diff --git a/packages/plugin-0g/src/templates/upload.ts b/packages/plugin-0g/src/templates/upload.ts deleted file mode 100644 index d982d8929b6..00000000000 --- a/packages/plugin-0g/src/templates/upload.ts +++ /dev/null @@ -1,22 +0,0 @@ -export const uploadTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. - -Example response: -\`\`\`json -{ - "filePath": null, - "description": "I want to upload a file" -} -\`\`\` - -{{recentMessages}} - -Extract the user's intention to upload a file from the conversation. Users might express this in various ways, such as: -- "I want to upload a file" -- "upload an image" -- "send a photo" -- "upload" -- "let me share a file" - -If the user provides any specific description of the file, include that as well. - -Respond with a JSON markdown block containing only the extracted values.`; diff --git a/packages/plugin-0g/tsconfig.json b/packages/plugin-0g/tsconfig.json deleted file mode 100644 index 7251ebee37d..00000000000 --- a/packages/plugin-0g/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": ".", - "types": [ - "node" - ] - }, - "include": [ - "src" - ] -} \ No newline at end of file diff --git a/packages/plugin-0g/tsup.config.ts b/packages/plugin-0g/tsup.config.ts deleted file mode 100644 index 1b704be143d..00000000000 --- a/packages/plugin-0g/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "@0glabs/0g-ts-sdk", - // Add other modules you want to externalize - ], -}); diff --git a/packages/plugin-aptos/.npmignore b/packages/plugin-aptos/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-aptos/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-aptos/eslint.config.mjs b/packages/plugin-aptos/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-aptos/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-aptos/package.json b/packages/plugin-aptos/package.json deleted file mode 100644 index 026a58d1588..00000000000 --- a/packages/plugin-aptos/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@ai16z/plugin-aptos", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-trustdb": "workspace:*", - "@aptos-labs/ts-sdk": "^1.26.0", - "bignumber": "1.1.0", - "bignumber.js": "9.1.2", - "node-cache": "5.1.2", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-aptos/src/constants.ts b/packages/plugin-aptos/src/constants.ts deleted file mode 100644 index 92df2614da8..00000000000 --- a/packages/plugin-aptos/src/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const APT_DECIMALS = 8; \ No newline at end of file diff --git a/packages/plugin-aptos/src/enviroment.ts b/packages/plugin-aptos/src/enviroment.ts deleted file mode 100644 index d85a40f7f3d..00000000000 --- a/packages/plugin-aptos/src/enviroment.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IAgentRuntime } from "@ai16z/eliza"; -import { z } from "zod"; - -export const aptosEnvSchema = z.object({ - APTOS_PRIVATE_KEY: z.string().min(1, "Aptos private key is required"), - APTOS_NETWORK: z.enum(["mainnet", "testnet"]), -}); - -export type AptosConfig = z.infer; - -export async function validateAptosConfig( - runtime: IAgentRuntime -): Promise { - try { - const config = { - APTOS_PRIVATE_KEY: - runtime.getSetting("APTOS_PRIVATE_KEY") || - process.env.APTOS_PRIVATE_KEY, - APTOS_NETWORK: - runtime.getSetting("APTOS_NETWORK") || - process.env.APTOS_NETWORK, - }; - - return aptosEnvSchema.parse(config); - } catch (error) { - if (error instanceof z.ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `Aptos configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/plugin-aptos/src/index.ts b/packages/plugin-aptos/src/index.ts deleted file mode 100644 index db736fc6bf9..00000000000 --- a/packages/plugin-aptos/src/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Plugin } from "@ai16z/eliza"; -import transferToken from "./actions/transfer.ts"; -import { WalletProvider, walletProvider } from "./providers/wallet.ts"; - -export { WalletProvider, transferToken as TransferAptosToken }; - -export const aptosPlugin: Plugin = { - name: "aptos", - description: "Aptos Plugin for Eliza", - actions: [transferToken], - evaluators: [], - providers: [walletProvider], -}; - -export default aptosPlugin; diff --git a/packages/plugin-aptos/src/providers/wallet.ts b/packages/plugin-aptos/src/providers/wallet.ts deleted file mode 100644 index 1cdeb778070..00000000000 --- a/packages/plugin-aptos/src/providers/wallet.ts +++ /dev/null @@ -1,257 +0,0 @@ -import { - IAgentRuntime, - ICacheManager, - Memory, - Provider, - State, -} from "@ai16z/eliza"; -import { - Account, - Aptos, - AptosConfig, - Ed25519PrivateKey, - Network, - PrivateKey, - PrivateKeyVariants, -} from "@aptos-labs/ts-sdk"; -import BigNumber from "bignumber.js"; -import NodeCache from "node-cache"; -import * as path from "path"; -import { APT_DECIMALS } from "../constants"; - -// Provider configuration -const PROVIDER_CONFIG = { - MAX_RETRIES: 3, - RETRY_DELAY: 2000, -}; - -interface WalletPortfolio { - totalUsd: string; - totalApt: string; -} - -interface Prices { - apt: { usd: string }; -} - -export class WalletProvider { - private cache: NodeCache; - private cacheKey: string = "aptos/wallet"; - - constructor( - private aptosClient: Aptos, - private address: string, - private cacheManager: ICacheManager - ) { - this.cache = new NodeCache({ stdTTL: 300 }); // Cache TTL set to 5 minutes - } - - private async readFromCache(key: string): Promise { - const cached = await this.cacheManager.get( - path.join(this.cacheKey, key) - ); - return cached; - } - - private async writeToCache(key: string, data: T): Promise { - await this.cacheManager.set(path.join(this.cacheKey, key), data, { - expires: Date.now() + 5 * 60 * 1000, - }); - } - - private async getCachedData(key: string): Promise { - // Check in-memory cache first - const cachedData = this.cache.get(key); - if (cachedData) { - return cachedData; - } - - // Check file-based cache - const fileCachedData = await this.readFromCache(key); - if (fileCachedData) { - // Populate in-memory cache - this.cache.set(key, fileCachedData); - return fileCachedData; - } - - return null; - } - - private async setCachedData(cacheKey: string, data: T): Promise { - // Set in-memory cache - this.cache.set(cacheKey, data); - - // Write to file-based cache - await this.writeToCache(cacheKey, data); - } - - private async fetchPricesWithRetry() { - let lastError: Error; - - for (let i = 0; i < PROVIDER_CONFIG.MAX_RETRIES; i++) { - try { - const cellanaAptUsdcPoolAddr = - "0x234f0be57d6acfb2f0f19c17053617311a8d03c9ce358bdf9cd5c460e4a02b7c"; - const response = await fetch( - `https://api.dexscreener.com/latest/dex/pairs/aptos/${cellanaAptUsdcPoolAddr}` - ); - - if (!response.ok) { - const errorText = await response.text(); - throw new Error( - `HTTP error! status: ${response.status}, message: ${errorText}` - ); - } - - const data = await response.json(); - return data; - } catch (error) { - console.error(`Attempt ${i + 1} failed:`, error); - lastError = error; - if (i < PROVIDER_CONFIG.MAX_RETRIES - 1) { - const delay = PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i); - await new Promise((resolve) => setTimeout(resolve, delay)); - continue; - } - } - } - - console.error( - "All attempts failed. Throwing the last error:", - lastError - ); - throw lastError; - } - - async fetchPortfolioValue(): Promise { - try { - const cacheKey = `portfolio-${this.address}`; - const cachedValue = - await this.getCachedData(cacheKey); - - if (cachedValue) { - console.log("Cache hit for fetchPortfolioValue", cachedValue); - return cachedValue; - } - console.log("Cache miss for fetchPortfolioValue"); - - const prices = await this.fetchPrices().catch((error) => { - console.error("Error fetching APT price:", error); - throw error; - }); - const aptAmountOnChain = await this.aptosClient - .getAccountAPTAmount({ - accountAddress: this.address, - }) - .catch((error) => { - console.error("Error fetching APT amount:", error); - throw error; - }); - - const aptAmount = new BigNumber(aptAmountOnChain).div( - new BigNumber(10).pow(APT_DECIMALS) - ); - const totalUsd = new BigNumber(aptAmount).times(prices.apt.usd); - - const portfolio = { - totalUsd: totalUsd.toString(), - totalApt: aptAmount.toString(), - }; - this.setCachedData(cacheKey, portfolio); - console.log("Fetched portfolio:", portfolio); - return portfolio; - } catch (error) { - console.error("Error fetching portfolio:", error); - throw error; - } - } - - async fetchPrices(): Promise { - try { - const cacheKey = "prices"; - const cachedValue = await this.getCachedData(cacheKey); - - if (cachedValue) { - console.log("Cache hit for fetchPrices"); - return cachedValue; - } - console.log("Cache miss for fetchPrices"); - - const aptPriceData = await this.fetchPricesWithRetry().catch( - (error) => { - console.error("Error fetching APT price:", error); - throw error; - } - ); - const prices: Prices = { - apt: { usd: aptPriceData.pair.priceUsd }, - }; - this.setCachedData(cacheKey, prices); - return prices; - } catch (error) { - console.error("Error fetching prices:", error); - throw error; - } - } - - formatPortfolio(runtime, portfolio: WalletPortfolio): string { - let output = `${runtime.character.name}\n`; - output += `Wallet Address: ${this.address}\n`; - - const totalUsdFormatted = new BigNumber(portfolio.totalUsd).toFixed(2); - const totalAptFormatted = new BigNumber(portfolio.totalApt).toFixed(4); - - output += `Total Value: $${totalUsdFormatted} (${totalAptFormatted} APT)\n`; - - return output; - } - - async getFormattedPortfolio(runtime): Promise { - try { - const portfolio = await this.fetchPortfolioValue(); - return this.formatPortfolio(runtime, portfolio); - } catch (error) { - console.error("Error generating portfolio report:", error); - return "Unable to fetch wallet information. Please try again later."; - } - } -} - -const walletProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State - ): Promise => { - const privateKey = runtime.getSetting("APTOS_PRIVATE_KEY"); - const aptosAccount = Account.fromPrivateKey({ - privateKey: new Ed25519PrivateKey( - PrivateKey.formatPrivateKey( - privateKey, - PrivateKeyVariants.Ed25519 - ) - ), - }); - const network = runtime.getSetting("APTOS_NETWORK") as Network; - - try { - const aptosClient = new Aptos( - new AptosConfig({ - network, - }) - ); - const provider = new WalletProvider( - aptosClient, - aptosAccount.accountAddress.toStringLong(), - runtime.cacheManager - ); - return await provider.getFormattedPortfolio(runtime); - } catch (error) { - console.error("Error in wallet provider:", error); - return null; - } - }, -}; - -// Module exports -export { walletProvider }; diff --git a/packages/plugin-aptos/src/tests/wallet.test.ts b/packages/plugin-aptos/src/tests/wallet.test.ts deleted file mode 100644 index 7b24f7ab6b3..00000000000 --- a/packages/plugin-aptos/src/tests/wallet.test.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { describe, it, expect, beforeEach, vi, afterEach } from "vitest"; -import { WalletProvider } from "../providers/wallet.ts"; -import { - Account, - Aptos, - AptosConfig, - Ed25519PrivateKey, - Network, - PrivateKey, - PrivateKeyVariants, -} from "@aptos-labs/ts-sdk"; -import { defaultCharacter } from "@ai16z/eliza"; -import BigNumber from "bignumber.js"; -import { APT_DECIMALS } from "../constants.ts"; - -// Mock NodeCache -vi.mock("node-cache", () => { - return { - default: vi.fn().mockImplementation(() => ({ - set: vi.fn(), - get: vi.fn().mockReturnValue(null), - })), - }; -}); - -// Mock path module -vi.mock("path", async () => { - const actual = await vi.importActual("path"); - return { - ...actual, - join: vi.fn().mockImplementation((...args) => args.join("/")), - }; -}); - -// Mock the ICacheManager -const mockCacheManager = { - get: vi.fn().mockResolvedValue(null), - set: vi.fn(), - delete: vi.fn(), -}; - -describe("WalletProvider", () => { - let walletProvider; - let mockedRuntime; - - beforeEach(() => { - vi.clearAllMocks(); - mockCacheManager.get.mockResolvedValue(null); - - const aptosClient = new Aptos( - new AptosConfig({ - network: Network.TESTNET, - }) - ); - const aptosAccount = Account.fromPrivateKey({ - privateKey: new Ed25519PrivateKey( - PrivateKey.formatPrivateKey( - // this is a testnet private key - "0x90e02bf2439492bd9be1ec5f569704accefd65ba88a89c4dcef1977e0203211e", - PrivateKeyVariants.Ed25519 - ) - ), - }); - - // Create new instance of TokenProvider with mocked dependencies - walletProvider = new WalletProvider( - aptosClient, - aptosAccount.accountAddress.toStringLong(), - mockCacheManager - ); - - mockedRuntime = { - character: defaultCharacter, - }; - }); - - afterEach(() => { - vi.clearAllTimers(); - }); - - describe("Wallet Integration", () => { - it("should check wallet address", async () => { - const result = - await walletProvider.getFormattedPortfolio(mockedRuntime); - - const prices = await walletProvider.fetchPrices(); - const aptAmountOnChain = - await walletProvider.aptosClient.getAccountAPTAmount({ - accountAddress: walletProvider.address, - }); - const aptAmount = new BigNumber(aptAmountOnChain) - .div(new BigNumber(10).pow(APT_DECIMALS)) - .toFixed(4); - const totalUsd = new BigNumber(aptAmount) - .times(prices.apt.usd) - .toFixed(2); - - expect(result).toEqual( - `Eliza\nWallet Address: ${walletProvider.address}\n` + - `Total Value: $${totalUsd} (${aptAmount} APT)\n` - ); - }); - }); -}); diff --git a/packages/plugin-aptos/tsconfig.json b/packages/plugin-aptos/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/plugin-aptos/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-aptos/tsup.config.ts b/packages/plugin-aptos/tsup.config.ts deleted file mode 100644 index dd25475bb63..00000000000 --- a/packages/plugin-aptos/tsup.config.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "safe-buffer", - "base-x", - "bs58", - "borsh", - "@solana/buffer-layout", - "stream", - "buffer", - "querystring", - "amqplib", - // Add other modules you want to externalize - ], -}); diff --git a/packages/plugin-coinbase/.npmignore b/packages/plugin-coinbase/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-coinbase/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-coinbase/advanced-sdk-ts/.eslintrc.js b/packages/plugin-coinbase/advanced-sdk-ts/.eslintrc.js deleted file mode 100644 index ec00d481abb..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/.eslintrc.js +++ /dev/null @@ -1,21 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parser: '@typescript-eslint/parser', - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier', - 'plugin:prettier/recommended', - ], - plugins: ['prettier'], - rules: { - 'prettier/prettier': 'error', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-explicit-any': 'off', - }, - ignorePatterns: ['**/dist/**', '**/node_modules/**', '**/*.md'], - env: { - node: true, // Add this line to recognize Node.js globals - es2021: true, // Optionally include modern JavaScript features - }, -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/.gitignore b/packages/plugin-coinbase/advanced-sdk-ts/.gitignore deleted file mode 100644 index 722ad2ade5a..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.env -src/rest/main.ts -dist/ -node_modules/ -.idea/ -package-lock.json \ No newline at end of file diff --git a/packages/plugin-coinbase/advanced-sdk-ts/.prettierrc b/packages/plugin-coinbase/advanced-sdk-ts/.prettierrc deleted file mode 100644 index c3e03287bee..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": true, - "singleQuote": true, - "trailingComma": "es5" -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/CHANGELOG.md b/packages/plugin-coinbase/advanced-sdk-ts/CHANGELOG.md deleted file mode 100644 index eda768580a2..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Changelog - -## [0.1.0] - 2024-SEP-06 - -### Added - -- Support for all Coinbase Advanced API REST endpoints via central client -- Custom Request and Response objects for endpoints -- Custom error types diff --git a/packages/plugin-coinbase/advanced-sdk-ts/README.md b/packages/plugin-coinbase/advanced-sdk-ts/README.md deleted file mode 100644 index 73f0bf459dc..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# Coinbase Advanced API TypeScript SDK - -Welcome to the Coinbase Advanced API TypeScript SDK. This TypeScript project was created to allow developers to easily plug into the [Coinbase Advanced API](https://docs.cdp.coinbase.com/advanced-trade/docs/welcome). - -Coinbase Advanced Trade offers a comprehensive API for traders, providing access to real-time market data, order management, and execution. Elevate your trading strategies and develop sophisticated solutions using our powerful tools and features. - -For more information on all the available REST endpoints, see the [API Reference](https://docs.cdp.coinbase.com/advanced-trade/reference/). - ---- - -## Installation - -```bash -npm install -``` - ---- - -## Build and Use - -To build the project, run the following command: - -```bash -npm run build -``` - -_Note: To avoid potential issues, do not forget to build your project again after making any changes to it._ - -After building the project, each `.ts` file will have its `.js` counterpart generated. - -To run a file, use the following command: - -``` -node dist/{INSERT-FILENAME}.js -``` - -For example, a `main.ts` file would be run like: - -```bash -node dist/main.js -``` - ---- - -## Coinbase Developer Platform (CDP) API Keys - -This SDK uses Cloud Developer Platform (CDP) API keys. To use this SDK, you will need to create a CDP API key and secret by following the instructions [here](https://docs.cdp.coinbase.com/advanced-trade/docs/getting-started). -Make sure to save your API key and secret in a safe place. You will not be able to retrieve your secret again. - ---- - -## Importing the RESTClient - -All the REST endpoints are available directly from the client, therefore it's all you need to import. - -``` -import { RESTClient } from './rest'; -``` - ---- - -## Authentication - -Authentication of CDP API Keys is handled automatically by the SDK when making a REST request. - -After creating your CDP API keys, store them using your desired method and simply pass them into the client during initialization like: - -``` -const client = new RESTClient(API_KEY, API_SECRET); -``` - ---- - -## Making Requests - -Here are a few examples requests: - -**[List Accounts](https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getaccounts)** - -``` -client - .listAccounts({}) - .then((result) => { - console.log(result); - }) - .catch((error) => { - console.error(error.message); - }); -``` - -**[Get Product](https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getproduct)** - -``` -client - .getProduct({productId: "BTC-USD"}) - .then((result) => { - console.log(result); - }) - .catch((error) => { - console.error(error.message); - }); -``` - -**[Create Order](https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_postorder)** - -_$10 Market Buy on BTC-USD_ - -``` -client - .createOrder({ - clientOrderId: "00000001", - productId: "BTC-USD", - side: OrderSide.BUY, - orderConfiguration:{ - market_market_ioc: { - quote_size: "10" - } - } - }) - .then((result) => { - console.log(result); - }) - .catch((error) => { - console.error(error.message); - }); -``` diff --git a/packages/plugin-coinbase/advanced-sdk-ts/package.json b/packages/plugin-coinbase/advanced-sdk-ts/package.json deleted file mode 100644 index 78480e529e8..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@coinbase-samples/advanced-sdk-ts", - "version": "0.1.0", - "main": "dist/main.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build": "tsc", - "lint": "eslint . --ext .js,.ts", - "format": "prettier --write \"**/*.{js,ts,tsx,json,css,md}\"" - }, - "files": [ - "dist/" - ], - "keywords": [], - "author": "", - "license": "ISC", - "description": "", - "dependencies": { - "jsonwebtoken": "^9.0.2", - "node-fetch": "^2.6.1" - }, - "devDependencies": { - "@types/jsonwebtoken": "^9.0.7", - "@types/node-fetch": "^2.6.11", - "@typescript-eslint/eslint-plugin": "^5.59.0", - "@typescript-eslint/parser": "^5.59.0", - "dotenv": "^16.4.5", - "eslint": "^8.35.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-prettier": "^4.2.1", - "prettier": "^2.8.8", - "typescript": "^5.5.4" - } -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/constants.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/constants.ts deleted file mode 100644 index 89623659076..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/constants.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const BASE_URL = 'api.coinbase.com'; -export const API_PREFIX = '/api/v3/brokerage'; -export const ALGORITHM = 'ES256'; -export const VERSION = '0.1.0'; -export const USER_AGENT = `coinbase-advanced-ts/${VERSION}`; -export const JWT_ISSUER = 'cdp'; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/jwt-generator.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/jwt-generator.ts deleted file mode 100644 index 275fc876e6a..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/jwt-generator.ts +++ /dev/null @@ -1,31 +0,0 @@ -import jwt from 'jsonwebtoken'; -import { BASE_URL, ALGORITHM, JWT_ISSUER } from './constants'; -import crypto from 'crypto'; - -export function generateToken( - requestMethod: string, - requestPath: string, - apiKey: string, - apiSecret: string -): string { - const uri = `${requestMethod} ${BASE_URL}${requestPath}`; - const payload = { - iss: JWT_ISSUER, - nbf: Math.floor(Date.now() / 1000), - exp: Math.floor(Date.now() / 1000) + 120, - sub: apiKey, - uri, - }; - - const header = { - alg: ALGORITHM, - kid: apiKey, - nonce: crypto.randomBytes(16).toString('hex'), - }; - const options: jwt.SignOptions = { - algorithm: ALGORITHM as jwt.Algorithm, - header: header, - }; - - return jwt.sign(payload, apiSecret as string, options); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/accounts.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/accounts.ts deleted file mode 100644 index 04cec4b934d..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/accounts.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - GetAccountRequest, - GetAccountResponse, - ListAccountsRequest, - ListAccountsResponse, -} from './types/accounts-types'; -import { method } from './types/request-types'; - -// [GET] Get Account -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getaccount -export function getAccount( - this: RESTBase, - { accountUuid }: GetAccountRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/accounts/${accountUuid}`, - isPublic: false, - }); -} - -// [GET] List Accounts -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getaccounts -export function listAccounts( - this: RESTBase, - requestParams: ListAccountsRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/accounts`, - queryParams: requestParams, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/converts.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/converts.ts deleted file mode 100644 index 435a807e285..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/converts.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - CommitConvertTradeRequest, - CommitConvertTradeResponse, - CreateConvertQuoteRequest, - CreateConvertQuoteResponse, - GetConvertTradeRequest, - GetConvertTradeResponse, -} from './types/converts-types'; -import { method } from './types/request-types'; - -// [POST] Create Convert Quote -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_createconvertquote -export function createConvertQuote( - this: RESTBase, - requestParams: CreateConvertQuoteRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/convert/quote`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Convert Trade -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getconverttrade -export function getConvertTrade( - this: RESTBase, - { tradeId, ...requestParams }: GetConvertTradeRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/convert/trade/${tradeId}`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [POST] Commit Connvert Trade -// https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_commitconverttrade -export function commitConvertTrade( - this: RESTBase, - { tradeId, ...requestParams }: CommitConvertTradeRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/convert/trade/${tradeId}`, - bodyParams: requestParams, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/dataAPI.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/dataAPI.ts deleted file mode 100644 index 2adc6466076..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/dataAPI.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; - -import { method } from './types/request-types'; -import { GetAPIKeyPermissionsResponse } from './types/dataAPI-types'; - -// [GET] Get API Key Permissions -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getapikeypermissions -export function getAPIKeyPermissions( - this: RESTBase -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/key_permissions`, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/errors.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/errors.ts deleted file mode 100644 index 5d9695ef67d..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/errors.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Response } from 'node-fetch'; - -class CoinbaseError extends Error { - statusCode: number; - response: Response; - - constructor(message: string, statusCode: number, response: Response) { - super(message); - this.name = 'CoinbaseError'; - this.statusCode = statusCode; - this.response = response; - } -} - -export function handleException( - response: Response, - responseText: string, - reason: string -) { - let message: string | undefined; - - if ( - (400 <= response.status && response.status <= 499) || - (500 <= response.status && response.status <= 599) - ) { - if ( - response.status == 403 && - responseText.includes('"error_details":"Missing required scopes"') - ) { - message = `${response.status} Coinbase Error: Missing Required Scopes. Please verify your API keys include the necessary permissions.`; - } else - message = `${response.status} Coinbase Error: ${reason} ${responseText}`; - - throw new CoinbaseError(message, response.status, response); - } -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/fees.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/fees.ts deleted file mode 100644 index 9f9c08e5cfa..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/fees.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - GetTransactionsSummaryRequest, - GetTransactionsSummaryResponse, -} from './types/fees-types'; -import { method } from './types/request-types'; - -// [GET] Get Transaction Summary -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_commitconverttrade -export function getTransactionSummary( - this: RESTBase, - requestParams: GetTransactionsSummaryRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/transaction_summary`, - queryParams: requestParams, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/futures.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/futures.ts deleted file mode 100644 index 82412ec4e37..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/futures.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - CancelPendingFuturesSweep, - GetCurrentMarginWindowRequest, - GetCurrentMarginWindowResponse, - GetFuturesBalanceSummaryResponse, - GetFuturesPositionRequest, - GetFuturesPositionResponse, - GetIntradayMarginSettingResponse, - ListFuturesPositionsResponse, - ListFuturesSweepsResponse, - ScheduleFuturesSweepRequest, - ScheduleFuturesSweepResponse, - SetIntradayMarginSettingRequest, - SetIntradayMarginSettingResponse, -} from './types/futures-types'; -import { method } from './types/request-types'; - -// [GET] Get Futures Balance Summary -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmbalancesummary -export function getFuturesBalanceSummary( - this: RESTBase -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/cfm/balance_summary`, - isPublic: false, - }); -} - -// [GET] Get Intraday Margin Setting -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getintradaymarginsetting -export function getIntradayMarginSetting( - this: RESTBase -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/cfm/intraday/margin_setting`, - isPublic: false, - }); -} - -// [POST] Set Intraday Margin Setting -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_setintradaymarginsetting -export function setIntradayMarginSetting( - this: RESTBase, - requestParams: SetIntradayMarginSettingRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/cfm/intraday/margin_setting`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Current Margin Window -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getcurrentmarginwindow -export function getCurrentMarginWindow( - this: RESTBase, - requestParams: GetCurrentMarginWindowRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/cfm/intraday/current_margin_window`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] List Futures Positions -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmpositions -export function listFuturesPositions( - this: RESTBase -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/cfm/positions`, - isPublic: false, - }); -} - -// [GET] Get Futures Position -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmposition -export function getFuturesPosition( - this: RESTBase, - { productId }: GetFuturesPositionRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/cfm/positions/${productId}`, - isPublic: false, - }); -} - -// [POST] Schedule Futures Sweep -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_schedulefcmsweep -export function scheduleFuturesSweep( - this: RESTBase, - requestParams: ScheduleFuturesSweepRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/cfm/sweeps/schedule`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [GET] List Futures Sweeps -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmsweeps -export function listFuturesSweeps( - this: RESTBase -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/cfm/sweeps`, - isPublic: false, - }); -} - -// [DELETE] Cancel Pending Futures Sweep -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_cancelfcmsweep -export function cancelPendingFuturesSweep( - this: RESTBase -): Promise { - return this.request({ - method: method.DELETE, - endpoint: `${API_PREFIX}/cfm/sweeps`, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/index.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/index.ts deleted file mode 100644 index 101223a645e..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/index.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { RESTBase } from './rest-base'; -import * as Accounts from './accounts'; -import * as Converts from './converts'; -import * as DataAPI from './dataAPI'; -import * as Fees from './fees'; -import * as Futures from './futures'; -import * as Orders from './orders'; -import * as Payments from './payments'; -import * as Perpetuals from './perpetuals'; -import * as Portfolios from './portfolios'; -import * as Products from './products'; -import * as Public from './public'; - -export class RESTClient extends RESTBase { - constructor(key?: string | undefined, secret?: string | undefined) { - super(key, secret); - } - - // =============== ACCOUNTS endpoints =============== - public getAccount = Accounts.getAccount.bind(this); - public listAccounts = Accounts.listAccounts.bind(this); - - // =============== CONVERTS endpoints =============== - public createConvertQuote = Converts.createConvertQuote.bind(this); - public commitConvertTrade = Converts.commitConvertTrade.bind(this); - public getConvertTrade = Converts.getConvertTrade.bind(this); - - // =============== DATA API endpoints =============== - public getAPIKeyPermissions = DataAPI.getAPIKeyPermissions.bind(this); - - // =============== FEES endpoints =============== - public getTransactionSummary = Fees.getTransactionSummary.bind(this); - - // =============== FUTURES endpoints =============== - public getFuturesBalanceSummary = Futures.getFuturesBalanceSummary.bind(this); - public getIntradayMarginSetting = Futures.getIntradayMarginSetting.bind(this); - public setIntradayMarginSetting = Futures.setIntradayMarginSetting.bind(this); - public getCurrentMarginWindow = Futures.getCurrentMarginWindow.bind(this); - public listFuturesPositions = Futures.listFuturesPositions.bind(this); - public getFuturesPosition = Futures.getFuturesPosition.bind(this); - public scheduleFuturesSweep = Futures.scheduleFuturesSweep.bind(this); - public listFuturesSweeps = Futures.listFuturesSweeps.bind(this); - public cancelPendingFuturesSweep = - Futures.cancelPendingFuturesSweep.bind(this); - - // =============== ORDERS endpoints =============== - public createOrder = Orders.createOrder.bind(this); - public cancelOrders = Orders.cancelOrders.bind(this); - public editOrder = Orders.editOrder.bind(this); - public editOrderPreview = Orders.editOrderPreview.bind(this); - public listOrders = Orders.listOrders.bind(this); - public listFills = Orders.listFills.bind(this); - public getOrder = Orders.getOrder.bind(this); - public previewOrder = Orders.previewOrder.bind(this); - public closePosition = Orders.closePosition.bind(this); - - // =============== PAYMENTS endpoints =============== - public listPaymentMethods = Payments.listPaymentMethods.bind(this); - public getPaymentMethod = Payments.getPaymentMethod.bind(this); - - // =============== PERPETUALS endpoints =============== - public allocatePortfolio = Perpetuals.allocatePortfolio.bind(this); - public getPerpetualsPortfolioSummary = - Perpetuals.getPerpetualsPortfolioSummary.bind(this); - public listPerpetualsPositions = - Perpetuals.listPerpetualsPositions.bind(this); - public getPerpetualsPosition = Perpetuals.getPerpertualsPosition.bind(this); - public getPortfolioBalances = Perpetuals.getPortfolioBalances.bind(this); - public optInOutMultiAssetCollateral = - Perpetuals.optInOutMultiAssetCollateral.bind(this); - - // =============== PORTFOLIOS endpoints =============== - public listPortfolios = Portfolios.listPortfolios.bind(this); - public createPortfolio = Portfolios.createPortfolio.bind(this); - public deletePortfolio = Portfolios.deletePortfolio.bind(this); - public editPortfolio = Portfolios.editPortfolio.bind(this); - public movePortfolioFunds = Portfolios.movePortfolioFunds.bind(this); - public getPortfolioBreakdown = Portfolios.getPortfolioBreakdown.bind(this); - - // =============== PRODUCTS endpoints =============== - public getBestBidAsk = Products.getBestBidAsk.bind(this); - public getProductBook = Products.getProductBook.bind(this); - public listProducts = Products.listProducts.bind(this); - public getProduct = Products.getProduct.bind(this); - public getProductCandles = Products.getProductCandles.bind(this); - public getMarketTrades = Products.getMarketTrades.bind(this); - - // =============== PUBLIC endpoints =============== - public getServerTime = Public.getServerTime.bind(this); - public getPublicProductBook = Public.getPublicProductBook.bind(this); - public listPublicProducts = Public.listPublicProducts.bind(this); - public getPublicProduct = Public.getPublicProduct.bind(this); - public getPublicProductCandles = Public.getPublicProductCandles.bind(this); - public getPublicMarketTrades = Public.getPublicMarketTrades.bind(this); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/orders.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/orders.ts deleted file mode 100644 index 04bf2aefbc4..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/orders.ts +++ /dev/null @@ -1,149 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - CancelOrdersRequest, - CancelOrdersResponse, - ClosePositionRequest, - ClosePositionResponse, - CreateOrderRequest, - CreateOrderResponse, - EditOrderPreviewRequest, - EditOrderPreviewResponse, - EditOrderRequest, - EditOrderResponse, - GetOrderRequest, - GetOrderResponse, - ListFillsRequest, - ListFillsResponse, - ListOrdersRequest, - ListOrdersResponse, - PreviewOrderRequest, - PreviewOrderResponse, -} from './types/orders-types'; -import { method } from './types/request-types'; - -// [POST] Create Order -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_postorder -export function createOrder( - this: RESTBase, - requestParams: CreateOrderRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/orders`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [POST] Cancel Orders -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_cancelorders -export function cancelOrders( - this: RESTBase, - requestParams: CancelOrdersRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/orders/batch_cancel`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [POST] Edit Order -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_editorder -export function editOrder( - this: RESTBase, - requestParams: EditOrderRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/orders/edit`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [POST] Edit Order Preview -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_previeweditorder -export function editOrderPreview( - this: RESTBase, - requestParams: EditOrderPreviewRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/orders/edit_preview`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [GET] List Orders -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders -export function listOrders( - this: RESTBase, - requestParams: ListOrdersRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/orders/historical/batch`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] List Fills -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfills -export function listFills( - this: RESTBase, - requestParams: ListFillsRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/orders/historical/fills`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Order -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorder -export function getOrder( - this: RESTBase, - { orderId }: GetOrderRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/orders/historical/${orderId}`, - isPublic: false, - }); -} - -// [POST] Preview Order -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_previeworder -export function previewOrder( - this: RESTBase, - requestParams: PreviewOrderRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/orders/preview`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [POST] Close Position -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_closeposition -export function closePosition( - this: RESTBase, - requestParams: ClosePositionRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/orders/close_position`, - queryParams: undefined, - bodyParams: requestParams, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/payments.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/payments.ts deleted file mode 100644 index defa3f4dd69..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/payments.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - GetPaymentMethodRequest, - GetPaymentMethodResponse, - ListPaymentMethodsResponse, -} from './types/payments-types'; -import { method } from './types/request-types'; - -// [GET] List Payment Methods -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpaymentmethods -export function listPaymentMethods( - this: RESTBase -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/payment_methods`, - isPublic: false, - }); -} - -// [GET] Get Payment Method -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpaymentmethod -export function getPaymentMethod( - this: RESTBase, - { paymentMethodId }: GetPaymentMethodRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/payment_methods/${paymentMethodId}`, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/perpetuals.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/perpetuals.ts deleted file mode 100644 index 6e1c568d697..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/perpetuals.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - AllocatePortfolioRequest, - AllocatePortfolioResponse, - GetPerpetualsPortfolioSummaryRequest, - GetPerpetualsPortfolioSummaryResponse, - GetPerpetualsPositionRequest, - GetPerpetualsPositionResponse, - GetPortfolioBalancesRequest, - GetPortfolioBalancesResponse, - ListPerpetualsPositionsRequest, - ListPerpetualsPositionsResponse, - OptInOutMultiAssetCollateralRequest, - OptInOutMultiAssetCollateralResponse, -} from './types/perpetuals-types'; -import { method } from './types/request-types'; - -// [POST] Allocate Portfolio -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_allocateportfolio -export function allocatePortfolio( - this: RESTBase, - requestParams: AllocatePortfolioRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/intx/allocate`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Perpetuals Portfolio Summary -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getintxportfoliosummary -export function getPerpetualsPortfolioSummary( - this: RESTBase, - { portfolioUuid }: GetPerpetualsPortfolioSummaryRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/intx/portfolio/${portfolioUuid}`, - isPublic: false, - }); -} - -// [GET] List Perpetuals Positions -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getintxpositions -export function listPerpetualsPositions( - this: RESTBase, - { portfolioUuid }: ListPerpetualsPositionsRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/intx/positions/${portfolioUuid}`, - isPublic: false, - }); -} - -// [GET] Get Perpetuals Position -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getintxposition -export function getPerpertualsPosition( - this: RESTBase, - { portfolioUuid, symbol }: GetPerpetualsPositionRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/intx/positions/${portfolioUuid}/${symbol}`, - isPublic: false, - }); -} - -// [GET] Get Portfolio Balances -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getintxbalances -export function getPortfolioBalances( - this: RESTBase, - { portfolioUuid }: GetPortfolioBalancesRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/intx/balances/${portfolioUuid}`, - isPublic: false, - }); -} - -// [POST] Opt In or Out of Multi Asset Collateral -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_intxmultiassetcollateral -export function optInOutMultiAssetCollateral( - this: RESTBase, - requestParams: OptInOutMultiAssetCollateralRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/intx/multi_asset_collateral`, - bodyParams: requestParams, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/portfolios.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/portfolios.ts deleted file mode 100644 index df5e5791f82..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/portfolios.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - CreatePortfolioRequest, - CreatePortfolioResponse, - DeletePortfolioRequest, - DeletePortfolioResponse, - EditPortfolioRequest, - EditPortfolioResponse, - GetPortfolioBreakdownRequest, - GetPortfolioBreakdownResponse, - ListPortfoliosRequest, - ListPortfoliosResponse, - MovePortfolioFundsRequest, - MovePortfolioFundsResponse, -} from './types/portfolios-types'; -import { method } from './types/request-types'; - -// [GET] List Portfolios -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getportfolios -export function listPortfolios( - this: RESTBase, - requestParams: ListPortfoliosRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/portfolios`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [POST] Create Portfolio -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_createportfolio -export function createPortfolio( - this: RESTBase, - requestParams: CreatePortfolioRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/portfolios`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [POST] Move Portfolio Funds -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_moveportfoliofunds -export function movePortfolioFunds( - this: RESTBase, - requestParams: MovePortfolioFundsRequest -): Promise { - return this.request({ - method: method.POST, - endpoint: `${API_PREFIX}/portfolios/move_funds`, - bodyParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Portfolio Breakdown -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getportfoliobreakdown -export function getPortfolioBreakdown( - this: RESTBase, - { portfolioUuid, ...requestParams }: GetPortfolioBreakdownRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/portfolios/${portfolioUuid}`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [DELETE] Delete Portfolio -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_deleteportfolio -export function deletePortfolio( - this: RESTBase, - { portfolioUuid }: DeletePortfolioRequest -): Promise { - return this.request({ - method: method.DELETE, - endpoint: `${API_PREFIX}/portfolios/${portfolioUuid}`, - isPublic: false, - }); -} - -// [PUT] Edit Portfolio -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_editportfolio -export function editPortfolio( - this: RESTBase, - { portfolioUuid, ...requestParams }: EditPortfolioRequest -): Promise { - return this.request({ - method: method.PUT, - endpoint: `${API_PREFIX}/portfolios/${portfolioUuid}`, - bodyParams: requestParams, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/products.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/products.ts deleted file mode 100644 index 7cd2ca1f0a1..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/products.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - GetBestBidAskRequest, - GetBestBidAskResponse, - GetMarketTradesRequest, - GetMarketTradesResponse, - GetProductBookRequest, - GetProductBookResponse, - GetProductCandlesRequest, - GetProductCandlesResponse, - GetProductRequest, - GetProductResponse, - ListProductsRequest, - ListProductsResponse, -} from './types/products-types'; -import { method } from './types/request-types'; - -// [GET] Get Best Bid Ask -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getbestbidask -export function getBestBidAsk( - this: RESTBase, - requestParams: GetBestBidAskRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/best_bid_ask`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Product Book -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getproductbook -export function getProductBook( - this: RESTBase, - requestParams: GetProductBookRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/product_book`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] List Products -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getproducts -export function listProducts( - this: RESTBase, - requestParams: ListProductsRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/products`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Product -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getproduct -export function getProduct( - this: RESTBase, - { productId, ...requestParams }: GetProductRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/products/${productId}`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Product Candles -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getcandles -export function getProductCandles( - this: RESTBase, - { productId, ...requestParams }: GetProductCandlesRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/products/${productId}/candles`, - queryParams: requestParams, - isPublic: false, - }); -} - -// [GET] Get Market Trades -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getmarkettrades -export function getMarketTrades( - this: RESTBase, - { productId, ...requestParams }: GetMarketTradesRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/products/${productId}/ticker`, - queryParams: requestParams, - isPublic: false, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/public.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/public.ts deleted file mode 100644 index 1b9577e514a..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/public.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { API_PREFIX } from '../constants'; -import { RESTBase } from './rest-base'; -import { - GetPublicMarketTradesRequest, - GetPublicMarketTradesResponse, - GetPublicProductBookRequest, - GetPublicProductBookResponse, - GetPublicProductCandlesRequest, - GetPublicProductCandlesResponse, - GetPublicProductRequest, - GetPublicProductResponse, - GetServerTimeResponse, - ListPublicProductsRequest, - ListPublicProductsResponse, -} from './types/public-types'; -import { method } from './types/request-types'; - -// [GET] Get Server Time -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getservertime -export function getServerTime(this: RESTBase): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/time`, - isPublic: true, - }); -} - -// [GET] Get Public Product Book -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicproductbook -export function getPublicProductBook( - this: RESTBase, - requestParams: GetPublicProductBookRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/market/product_book`, - queryParams: requestParams, - isPublic: true, - }); -} - -// [GET] List Public Products -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicproducts -export function listPublicProducts( - this: RESTBase, - requestParams: ListPublicProductsRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/market/products`, - queryParams: requestParams, - isPublic: true, - }); -} - -// [GET] Get Public Product -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicproduct -export function getPublicProduct( - this: RESTBase, - { productId }: GetPublicProductRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/market/products/${productId}`, - isPublic: true, - }); -} - -// [GET] Get Public Product Candles -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpubliccandles -export function getPublicProductCandles( - this: RESTBase, - { productId, ...requestParams }: GetPublicProductCandlesRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/market/products/${productId}/candles`, - queryParams: requestParams, - isPublic: true, - }); -} - -// [GET] Get Public Market Trades -// Official Documentation: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicmarkettrades -export function getPublicMarketTrades( - this: RESTBase, - { productId, ...requestParams }: GetPublicMarketTradesRequest -): Promise { - return this.request({ - method: method.GET, - endpoint: `${API_PREFIX}/products/${productId}/ticker`, - queryParams: requestParams, - isPublic: true, - }); -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/rest-base.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/rest-base.ts deleted file mode 100644 index 9084df56123..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/rest-base.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { generateToken } from '../jwt-generator'; -import fetch, { Headers, RequestInit, Response } from 'node-fetch'; -import { BASE_URL, USER_AGENT } from '../constants'; -import { RequestOptions } from './types/request-types'; -import { handleException } from './errors'; - -export class RESTBase { - private apiKey: string | undefined; - private apiSecret: string | undefined; - - constructor(key?: string, secret?: string) { - if (!key || !secret) { - console.log('Could not authenticate. Only public endpoints accessible.'); - } - this.apiKey = key; - this.apiSecret = secret; - } - - request(options: RequestOptions): Promise { - const { method, endpoint, isPublic } = options; - let { queryParams, bodyParams } = options; - - queryParams = queryParams ? this.filterParams(queryParams) : {}; - - if (bodyParams !== undefined) - bodyParams = bodyParams ? this.filterParams(bodyParams) : {}; - - return this.prepareRequest( - method, - endpoint, - queryParams, - bodyParams, - isPublic - ); - } - - prepareRequest( - httpMethod: string, - urlPath: string, - queryParams?: Record, - bodyParams?: Record, - isPublic?: boolean - ) { - const headers: Headers = this.setHeaders(httpMethod, urlPath, isPublic); - - const requestOptions: RequestInit = { - method: httpMethod, - headers: headers, - body: JSON.stringify(bodyParams), - }; - - const queryString = this.buildQueryString(queryParams); - const url = `https://${BASE_URL}${urlPath}${queryString}`; - - return this.sendRequest(headers, requestOptions, url); - } - - async sendRequest( - headers: Headers, - requestOptions: RequestInit, - url: string - ) { - const response: Response = await fetch(url, requestOptions); - const responseText = await response.text(); - handleException(response, responseText, response.statusText); - - return responseText; - } - - setHeaders(httpMethod: string, urlPath: string, isPublic?: boolean) { - const headers: Headers = new Headers(); - headers.append('Content-Type', 'application/json'); - headers.append('User-Agent', USER_AGENT); - if (this.apiKey !== undefined && this.apiSecret !== undefined) - headers.append( - 'Authorization', - `Bearer ${generateToken( - httpMethod, - urlPath, - this.apiKey, - this.apiSecret - )}` - ); - else if (isPublic == undefined || isPublic == false) - throw new Error( - 'Attempting to access authenticated endpoint with invalid API_KEY or API_SECRET.' - ); - - return headers; - } - - filterParams(data: Record) { - const filteredParams: Record = {}; - - for (const key in data) { - if (data[key] !== undefined) { - filteredParams[key] = data[key]; - } - } - - return filteredParams; - } - - buildQueryString(queryParams?: Record): string { - if (!queryParams || Object.keys(queryParams).length === 0) { - return ''; - } - - const queryString = Object.entries(queryParams) - .flatMap(([key, value]) => { - if (Array.isArray(value)) { - return value.map( - (item) => `${encodeURIComponent(key)}=${encodeURIComponent(item)}` - ); - } else { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - } - }) - .join('&'); - - return `?${queryString}`; - } -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/accounts-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/accounts-types.ts deleted file mode 100644 index ca1301c3f40..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/accounts-types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Account } from './common-types'; - -// Get Account -export type GetAccountRequest = { - // Path Params - accountUuid: string; -}; - -export type GetAccountResponse = { - account?: Account; -}; - -// List Accounts -export type ListAccountsRequest = { - // Query Params - limit?: number; - cursor?: string; - retailPortfolioId?: string; -}; - -export type ListAccountsResponse = { - accounts?: Account[]; - has_next: boolean; - cursor?: string; - size?: number; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/common-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/common-types.ts deleted file mode 100644 index a27d9fb34ed..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/common-types.ts +++ /dev/null @@ -1,447 +0,0 @@ -// ----- ENUMS ----- -export enum ProductType { - UNKNOWN = 'UNKNOWN_PRODUCT_TYPE', - SPOT = 'SPOT', - FUTURE = 'FUTURE', -} - -export enum ContractExpiryType { - UNKNOWN = 'UNKNOWN_CONTRACT_EXPIRY_TYPE', - EXPIRING = 'EXPIRING', - PERPETUAL = 'PERPETUAL', -} - -export enum ExpiringContractStatus { - UNKNOWN = 'UNKNOWN_EXPIRING_CONTRACT_STATUS', - UNEXPIRED = 'STATUS_UNEXPIRED', - EXPIRED = 'STATUS_EXPIRED', - ALL = 'STATUS_ALL', -} - -export enum PortfolioType { - UNDEFINED = 'UNDEFINED', - DEFAULT = 'DEFAULT', - CONSUMER = 'CONSUMER', - INTX = 'INTX', -} - -export enum MarginType { - CROSS = 'CROSS', - ISOLATED = 'ISOLATED', -} - -export enum OrderPlacementSource { - UNKNOWN = 'UNKNOWN_PLACEMENT_SOURCE', - RETAIL_SIMPLE = 'RETAIL_SIMPLE', - RETAIL_ADVANCED = 'RETAIL_ADVANCED', -} - -export enum SortBy { - UNKNOWN = 'UNKNOWN_SORT_BY', - LIMIT_PRICE = 'LIMIT_PRICE', - LAST_FILL_TIME = 'LAST_FILL_TIME', -} - -export enum OrderSide { - BUY = 'BUY', - SELL = 'SELL', -} - -export enum StopDirection { - UP = 'STOP_DIRECTION_STOP_UP', - DOWN = 'STOP_DIRECTION_STOP_DOWN', -} - -export enum Granularity { - UNKNOWN = 'UNKNOWN_GRANULARITY', - ONE_MINUTE = 'ONE_MINUTE', - FIVE_MINUTE = 'FIVE_MINUTE', - FIFTEEN_MINUTE = 'FIFTEEN_MINUTE', - THIRTY_MINUTE = 'THIRTY_MINUTE', - ONE_HOUR = 'ONE_HOUR', - TWO_HOUR = 'TWO_HOUR', - SIX_HOUR = 'SIX_HOUR', - ONE_DAY = 'ONE_DAY', -} - -export enum ProductVenue { - UNKNOWN = 'UNKNOWN_VENUE_TYPE', - CBE = 'CBE', - FCM = 'FCM', - INTX = 'INTX', -} - -export enum IntradayMarginSetting { - UNSPECIFIED = 'INTRADAY_MARGIN_SETTING_UNSPECIFIED', - STANDARD = 'INTRADAY_MARGIN_SETTING_STANDARD', - INTRADAY = 'INTRADAY_MARGIN_SETTING_INTRADAY', -} - -// ----- TYPES ----- -export type Account = { - uuid?: string; - name?: string; - currency?: string; - available_balance?: Record; - default?: boolean; - active?: boolean; - created_at?: string; - updated_at?: string; - deleted_at?: string; - type?: Record; - ready?: boolean; - hold?: Record; - retail_portfolio_id?: string; -}; - -export type TradeIncentiveMetadata = { - userIncentiveId?: string; - codeVal?: string; -}; - -export type OrderConfiguration = - | { market_market_ioc: MarketMarketIoc } - | { sor_limit_ioc: SorLimitIoc } - | { limit_limit_gtc: LimitLimitGtc } - | { limit_limit_gtd: LimitLimitGtd } - | { limit_limit_fok: LimitLimitFok } - | { stop_limit_stop_limit_gtc: StopLimitStopLimitGtc } - | { stop_limit_stop_limit_gtd: StopLimitStopLimitGtd } - | { trigger_bracket_gtc: TriggerBracketGtc } - | { trigger_bracket_gtd: TriggerBracketGtd }; - -export type MarketMarketIoc = { quote_size: string } | { base_size: string }; - -export type SorLimitIoc = { - baseSize: string; - limitPrice: string; -}; - -export type LimitLimitGtc = { - baseSize: string; - limitPrice: string; - postOnly: boolean; -}; - -export type LimitLimitGtd = { - baseSize: string; - limitPrice: string; - endTime: string; - postOnly: boolean; -}; - -export type LimitLimitFok = { - baseSize: string; - limitPrice: string; -}; - -export type StopLimitStopLimitGtc = { - baseSize: string; - limitPrice: string; - stopPrice: string; - stopDirection: StopDirection; -}; - -export type StopLimitStopLimitGtd = { - baseSize: string; - limitPrice: string; - stopPrice: string; - endTime: string; - stopDirection: StopDirection; -}; - -export type TriggerBracketGtc = { - baseSize: string; - limitPrice: string; - stopTriggerPrice: string; -}; - -export type TriggerBracketGtd = { - baseSize: string; - limitPrice: string; - stopTriggerPrice: string; - endTime: string; -}; - -export type RatConvertTrade = { - id?: string; - status?: Record; - user_entered_amount?: Record; - amount?: Record; - subtotal?: Record; - total?: Record; - fees?: Record; - total_fee?: Record; - source?: Record; - target?: Record; - unit_price?: Record; - user_warnings?: Record; - user_reference?: string; - source_curency?: string; - cancellation_reason?: Record; - source_id?: string; - target_id?: string; - subscription_info?: Record; - exchange_rate?: Record; - tax_details?: Record; - trade_incentive_info?: Record; - total_fee_without_tax?: Record; - fiat_denoted_total?: Record; -}; - -export type FCMBalanceSummary = { - futures_buying_power?: Record; - total_usd_balance?: Record; - cbi_usd_balance?: Record; - cfm_usd_balance?: Record; - total_open_orders_hold_amount?: Record; - unrealized_pnl?: Record; - daily_realized_pnl?: Record; - initial_margin?: Record; - available_margin?: Record; - liquidation_threshold?: Record; - liquidation_buffer_amount?: Record; - liquidation_buffer_percentage?: string; - intraday_margin_window_measure?: Record; - overnight_margin_window_measure?: Record; -}; - -export type FCMPosition = { - product_id?: string; - expiration_time?: Record; - side?: Record; - number_of_contracts?: string; - current_price?: string; - avg_entry_price?: string; - unrealized_pnl?: string; - daily_realized_pnl?: string; -}; - -export type FCMSweep = { - id: string; - requested_amount: Record; - should_sweep_all: boolean; - status: Record; - schedule_time: Record; -}; - -export type CancelOrderObject = { - success: boolean; - failure_reason: Record; - order_id: string; -}; - -export type Order = { - order_id: string; - product_id: string; - user_id: string; - order_configuration: OrderConfiguration; - side: OrderSide; - client_order_id: string; - status: Record; - time_in_force?: Record; - created_time: Record; - completion_percentage: string; - filled_size?: string; - average_filled_price: string; - fee?: string; - number_of_fills: string; - filled_value?: string; - pending_cancel: boolean; - size_in_quote: boolean; - total_fees: string; - size_inclusive_of_fees: boolean; - total_value_after_fees: string; - trigger_status?: Record; - order_type?: Record; - reject_reason?: Record; - settled?: boolean; - product_type?: ProductType; - reject_message?: string; - cancel_message?: string; - order_placement_source?: OrderPlacementSource; - outstanding_hold_amount?: string; - is_liquidation?: boolean; - last_fill_time?: Record; - edit_history?: Record[]; - leverage?: string; - margin_type?: MarginType; - retail_portfolio_id?: string; - originating_order_id?: string; - attached_order_id?: string; -}; - -export type PaymentMethod = { - id?: string; - type?: string; - name?: string; - currency?: string; - verified?: boolean; - allow_buy?: boolean; - allow_sell?: boolean; - allow_deposit?: boolean; - allow_withdraw?: boolean; - created_at?: string; - updated_at?: string; -}; - -export type PerpetualPortfolio = { - portfolio_uuid?: string; - collateral?: string; - position_notional?: string; - open_position_notional?: string; - pending_fees?: string; - borrow?: string; - accrued_interest?: string; - rolling_debt?: string; - portfolio_initial_margin?: string; - portfolio_im_notional?: Record; - liquidation_percentage?: string; - liquidation_buffer?: string; - margin_type?: Record; - margin_flags?: Record; - liquidation_status?: Record; - unrealized_pnl?: Record; - total_balance?: Record; -}; - -export type PortfolioSummary = { - unrealized_pnl?: Record; - buying_power?: Record; - total_balance?: Record; - max_withdrawal_amount?: Record; -}; - -export type PositionSummary = { - aggregated_pnl?: Record; -}; - -export type Position = { - product_id?: string; - product_uuid?: string; - portfolio_uuid?: string; - symbol?: string; - vwap?: Record; - entry_vwap?: Record; - position_side?: Record; - margin_type?: Record; - net_size?: string; - buy_order_size?: string; - sell_order_size?: string; - im_contribution?: string; - unrealized_pnl?: Record; - mark_price?: Record; - liquidation_price?: Record; - leverage?: string; - im_notional?: Record; - mm_notional?: Record; - position_notional?: Record; - aggregated_pnl?: Record; -}; - -export type Balance = { - asset: Record; - quantity: string; - hold: string; - transfer_hold: string; - collateral_value: string; - collateral_weight: string; - max_withdraw_amount: string; - loan: string; - loan_collateral_requirement_usd: string; - pledged_quantity: string; -}; - -export type Portfolio = { - name?: string; - uuid?: string; - type?: string; -}; - -export type PortfolioBreakdown = { - portfolio?: Portfolio; - portfolio_balances?: Record; - spot_positions?: Record[]; - perp_positions?: Record[]; - futures_positions?: Record[]; -}; - -export type PriceBook = { - product_id: string; - bids: Record[]; - asks: Record[]; - time?: Record; -}; - -export type Products = { - products?: Product[]; - num_products?: number; -}; - -export type Product = { - product_id: string; - price: string; - price_percentage_change_24h: string; - volume_24h: string; - volume_percentage_change_24h: string; - base_increment: string; - quote_increment: string; - quote_min_size: string; - quote_max_size: string; - base_min_size: string; - base_max_size: string; - base_name: string; - quote_name: string; - watched: boolean; - is_disabled: boolean; - new: boolean; - status: string; - cancel_only: boolean; - limit_only: boolean; - post_only: boolean; - trading_disabled: boolean; - auction_mode: boolean; - product_type?: ProductType; - quote_currency_id?: string; - base_currency_id?: string; - fcm_trading_session_details?: Record; - mid_market_price?: string; - alias?: string; - alias_to?: string[]; - base_display_symbol: string; - quote_display_symbol?: string; - view_only?: boolean; - price_increment?: string; - display_name?: string; - product_venue?: ProductVenue; - approximate_quote_24h_volume?: string; - future_product_details?: Record; -}; - -export type Candles = { - candles?: Candle[]; -}; - -export type Candle = { - start?: string; - low?: string; - high?: string; - open?: string; - close?: string; - volume?: string; -}; - -export type HistoricalMarketTrade = { - trade_id?: string; - product_id?: string; - price?: string; - size?: string; - time?: string; - side?: OrderSide; -}; - -export type PortfolioBalance = { - portfolio_uuid?: string; - balances?: Balance[]; - is_margin_limit_reached?: boolean; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/converts-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/converts-types.ts deleted file mode 100644 index 8724b89d192..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/converts-types.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Create Convert Quote -import { RatConvertTrade, TradeIncentiveMetadata } from './common-types'; - -export type CreateConvertQuoteRequest = { - // Body Params - fromAccount: string; - toAccount: string; - amount: string; - tradeIncentiveMetadata?: TradeIncentiveMetadata; -}; - -export type CreateConvertQuoteResponse = { - trade?: RatConvertTrade; -}; - -// Get Convert Trade -export type GetConvertTradeRequest = { - // Path Params - tradeId: string; - - //Query Params - fromAccount: string; - toAccount: string; -}; - -export type GetConvertTradeResponse = { - trade?: RatConvertTrade; -}; - -// Commit Convert Trade -export type CommitConvertTradeRequest = { - // Path Params - tradeId: string; - - // Body Params - fromAccount: string; - toAccount: string; -}; - -export type CommitConvertTradeResponse = { - trade?: RatConvertTrade; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/dataAPI-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/dataAPI-types.ts deleted file mode 100644 index 7a773a0e8f6..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/dataAPI-types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PortfolioType } from './common-types'; - -// Get API Key Permissions -export type GetAPIKeyPermissionsResponse = { - can_view?: boolean; - can_trade?: boolean; - can_transfer?: boolean; - portfolio_uuid?: string; - portfolio_type?: PortfolioType; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/fees-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/fees-types.ts deleted file mode 100644 index e9db653b37b..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/fees-types.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ContractExpiryType, ProductType, ProductVenue } from './common-types'; - -// Get Transactions Summary -export type GetTransactionsSummaryRequest = { - // Query Params - productType?: ProductType; - contractExpiryType?: ContractExpiryType; - productVenue?: ProductVenue; -}; - -export type GetTransactionsSummaryResponse = { - total_volume: number; - total_fees: number; - fee_tier: Record; - margin_rate?: Record; - goods_and_services_tax?: Record; - advanced_trade_only_volumes?: number; - advanced_trade_only_fees?: number; - coinbase_pro_volume?: number; // deprecated - coinbase_pro_fees?: number; // deprecated - total_balance?: string; - has_promo_fee?: boolean; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/futures-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/futures-types.ts deleted file mode 100644 index 61bbf97b1d2..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/futures-types.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { - FCMBalanceSummary, - FCMPosition, - FCMSweep, - IntradayMarginSetting, -} from './common-types'; - -// Get Futures Balance Summary -export type GetFuturesBalanceSummaryResponse = { - balance_summary?: FCMBalanceSummary; -}; - -// Get Intraday Margin Setting -export type GetIntradayMarginSettingResponse = { - setting?: IntradayMarginSetting; -}; - -// Set Intraday Margin Setting -export type SetIntradayMarginSettingRequest = { - // Body Params - setting?: IntradayMarginSetting; -}; - -export type SetIntradayMarginSettingResponse = Record; - -// Get Current Margin Window -export type GetCurrentMarginWindowRequest = { - // Query Params - marginProfileType?: string; -}; - -export type GetCurrentMarginWindowResponse = { - margin_window?: Record; - is_intraday_margin_killswitch_enabled?: boolean; - is_intraday_margin_enrollment_killswitch_enabled?: boolean; -}; - -// List Futures Positions -export type ListFuturesPositionsResponse = { - positions?: FCMPosition[]; -}; - -// Get Futures Position -export type GetFuturesPositionRequest = { - // Path Params - productId: string; -}; - -export type GetFuturesPositionResponse = { - position?: FCMPosition; -}; - -// Schedule Futures Sweep -export type ScheduleFuturesSweepRequest = { - // Body Params - usdAmount?: string; -}; - -export type ScheduleFuturesSweepResponse = { - success?: boolean; -}; - -// List Futures Sweeps -export type ListFuturesSweepsResponse = { - sweeps: FCMSweep[]; -}; - -// Cancel Pending Futures Sweep = { -export type CancelPendingFuturesSweep = { - success?: boolean; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/orders-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/orders-types.ts deleted file mode 100644 index 486d93cd16d..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/orders-types.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { - CancelOrderObject, - ContractExpiryType, - MarginType, - Order, - OrderConfiguration, - OrderPlacementSource, - OrderSide, - ProductType, - SortBy, -} from './common-types'; - -// Create Order -export type CreateOrderRequest = { - // Body Params - clientOrderId: string; - productId: string; - side: OrderSide; - orderConfiguration: OrderConfiguration; - selfTradePreventionId?: string; - leverage?: string; - marginType?: MarginType; - retailPortfolioId?: string; -}; - -export type CreateOrderResponse = { - success: boolean; - failure_reason?: Record; // deprecated - order_id?: string; // deprecated - response?: - | { success_response: Record } - | { error_response: Record }; - order_configuration?: OrderConfiguration; -}; - -// Cancel Orders -export type CancelOrdersRequest = { - // Body Params - orderIds: string[]; -}; - -export type CancelOrdersResponse = { - results?: CancelOrderObject[]; -}; - -// Edit Order -export type EditOrderRequest = { - // Body Params - orderId: string; - price?: string; - size?: string; -}; - -export type EditOrderResponse = { - success: boolean; - response?: - | { success_response: Record } // deprecated - | { error_response: Record }; // deprecated - errors?: Record[]; -}; - -// Edit Order Preview -export type EditOrderPreviewRequest = { - // Body Params - orderId: string; - price?: string; - size?: string; -}; - -export type EditOrderPreviewResponse = { - errors: Record[]; - slippage?: string; - order_total?: string; - commission_total?: string; - quote_size?: string; - base_size?: string; - best_bid?: string; - average_filled_price?: string; -}; - -// List Orders -export type ListOrdersRequest = { - // Query Params - orderIds?: string[]; - productIds?: string[]; - orderStatus?: string[]; - limit?: number; - startDate?: string; - endDate?: string; - orderType?: string; - orderSide?: OrderSide; - cursor?: string; - productType?: ProductType; - orderPlacementSource?: OrderPlacementSource; - contractExpiryType?: ContractExpiryType; - assetFilters?: string[]; - retailPortfolioId?: string; - timeInForces?: string; - sortBy?: SortBy; -}; - -export type ListOrdersResponse = { - orders: Order[]; - sequence?: number; // deprecated - has_next: boolean; - cursor?: string; -}; - -// List Fills -export type ListFillsRequest = { - // Query Params - orderIds?: string[]; - tradeIds?: string[]; - productIds?: string[]; - startSequenceTimestamp?: string; - endSequenceTimestamp?: string; - retailPortfolioId?: string; - limit?: number; - cursor?: string; - sortBy?: SortBy; -}; - -export type ListFillsResponse = { - fills?: Record[]; - cursor?: string; -}; - -// Get Order -export type GetOrderRequest = { - // Path Params - orderId: string; -}; - -export type GetOrderResponse = { - order?: Order; -}; - -// Preview Order -export type PreviewOrderRequest = { - // Body Params - productId: string; - side: OrderSide; - orderConfiguration: OrderConfiguration; - leverage?: string; - marginType?: MarginType; - retailPortfolioId?: string; -}; - -export type PreviewOrderResponse = { - order_total: string; - commission_total: string; - errs: Record[]; - warning: Record[]; - quote_size: string; - base_size: string; - best_bid: string; - best_ask: string; - is_max: boolean; - order_margin_total?: string; - leverage?: string; - long_leverage?: string; - short_leverage?: string; - slippage?: string; - preview_id?: string; - current_liquidation_buffer?: string; - projected_liquidation_buffer?: string; - max_leverage?: string; - pnl_configuration?: Record; -}; - -// Close Position -export type ClosePositionRequest = { - // Body Params - clientOrderId: string; - productId: string; - size?: string; -}; - -export type ClosePositionResponse = { - success: boolean; - response?: - | { success_response: Record } - | { error_response: Record }; - order_configuration?: OrderConfiguration; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/payments-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/payments-types.ts deleted file mode 100644 index 064046f85a1..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/payments-types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PaymentMethod } from './common-types'; - -// List Payment Methods -export type ListPaymentMethodsResponse = { - paymentMethods?: PaymentMethod; -}; - -// Get Payment Method -export type GetPaymentMethodRequest = { - // Path Params - paymentMethodId: string; -}; - -export type GetPaymentMethodResponse = { - paymentMethod?: PaymentMethod; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/perpetuals-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/perpetuals-types.ts deleted file mode 100644 index d1c1235a1e4..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/perpetuals-types.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { - PerpetualPortfolio, - PortfolioBalance, - PortfolioSummary, - Position, - PositionSummary, -} from './common-types'; - -// Allocate Portfolio -export type AllocatePortfolioRequest = { - // Body Params - portfolioUuid: string; - symbol: string; - amount: string; - currency: string; -}; - -export type AllocatePortfolioResponse = Record; - -// Get Perpetuals Portfolio Summary -export type GetPerpetualsPortfolioSummaryRequest = { - // Path Params - portfolioUuid: string; -}; - -export type GetPerpetualsPortfolioSummaryResponse = { - portfolios?: PerpetualPortfolio[]; - summary?: PortfolioSummary; -}; - -// List Perpetuals Positions -export type ListPerpetualsPositionsRequest = { - // Path Params - portfolioUuid: string; -}; - -export type ListPerpetualsPositionsResponse = { - positions?: Position[]; - summary?: PositionSummary; -}; - -// Get Perpetuals Position -export type GetPerpetualsPositionRequest = { - // Path Params - portfolioUuid: string; - symbol: string; -}; - -export type GetPerpetualsPositionResponse = { - position?: Position; -}; - -// Get Portfolio Balances -export type GetPortfolioBalancesRequest = { - // Path Params - portfolioUuid: string; -}; - -export type GetPortfolioBalancesResponse = { - portfolio_balancces?: PortfolioBalance[]; -}; - -// Opt In or Out of Multi Asset Collateral -export type OptInOutMultiAssetCollateralRequest = { - // Body Params - portfolioUuid?: string; - multiAssetCollateralEnabled?: boolean; -}; - -export type OptInOutMultiAssetCollateralResponse = { - cross_collateral_enabled?: boolean; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/portfolios-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/portfolios-types.ts deleted file mode 100644 index e26698da0c3..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/portfolios-types.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Portfolio, PortfolioBreakdown, PortfolioType } from './common-types'; - -// List Portfolios -export type ListPortfoliosRequest = { - // Query Params - portfolioType?: PortfolioType; -}; - -export type ListPortfoliosResponse = { - portfolios?: Portfolio[]; -}; - -// Create Portfolio -export type CreatePortfolioRequest = { - // Body Params - name: string; -}; - -export type CreatePortfolioResponse = { - portfolio?: Portfolio; -}; - -// Move Portfolio Funds -export type MovePortfolioFundsRequest = { - // Body Params - funds: Record; - sourcePortfolioUuid: string; - targetPortfolioUuid: string; -}; - -export type MovePortfolioFundsResponse = { - source_portfolio_uuid?: string; - target_portfolio_uuid?: string; -}; - -// Get Portfolio Breakdown -export type GetPortfolioBreakdownRequest = { - // Path Params - portfolioUuid: string; - - // Query Params - currency?: string; -}; - -export type GetPortfolioBreakdownResponse = { - breakdown?: PortfolioBreakdown; -}; - -// Delete Portfolio -export type DeletePortfolioRequest = { - // Path Params - portfolioUuid: string; -}; - -export type DeletePortfolioResponse = Record; - -// Edit Portfolio -export type EditPortfolioRequest = { - // Path Params - portfolioUuid: string; - - // Body Params - name: string; -}; - -export type EditPortfolioResponse = { - portfolio?: Portfolio; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/products-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/products-types.ts deleted file mode 100644 index 9713e617df8..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/products-types.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { - Candles, - ContractExpiryType, - ExpiringContractStatus, - Granularity, - HistoricalMarketTrade, - PriceBook, - Product, - Products, - ProductType, -} from './common-types'; - -// Get Best Bid Ask -export type GetBestBidAskRequest = { - // Query Params - productIds?: string[]; -}; - -export type GetBestBidAskResponse = { - pricebooks: PriceBook[]; -}; - -// Get Product Book -export type GetProductBookRequest = { - // Query Params - productId: string; - limit?: number; - aggregationPriceIncrement?: number; -}; - -export type GetProductBookResponse = { - pricebook: PriceBook; -}; - -// List Products -export type ListProductsRequest = { - // Query Params - limit?: number; - offset?: number; - productType?: ProductType; - productIds?: string[]; - contractExpiryType?: ContractExpiryType; - expiringContractStatus?: ExpiringContractStatus; - getTradabilityStatus?: boolean; - getAllProducts?: boolean; -}; - -export type ListProductsResponse = { - body?: Products; -}; - -// Get Product -export type GetProductRequest = { - // Path Params - productId: string; - - // Query Params - getTradabilityStatus?: boolean; -}; - -export type GetProductResponse = { - body?: Product; -}; - -// Get Product Candles -export type GetProductCandlesRequest = { - // Path Params - productId: string; - - // Query Params - start: string; - end: string; - granularity: Granularity; - limit?: number; -}; - -export type GetProductCandlesResponse = { - body?: Candles; -}; - -// Get Market Trades -export type GetMarketTradesRequest = { - // Path Params - productId: string; - - // Query Params - limit: number; - start?: string; - end?: string; -}; - -export type GetMarketTradesResponse = { - trades?: HistoricalMarketTrade[]; - best_bid?: string; - best_ask?: string; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/public-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/public-types.ts deleted file mode 100644 index 4f5bbe4a4e7..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/public-types.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { - Candles, - ContractExpiryType, - ExpiringContractStatus, - HistoricalMarketTrade, - PriceBook, - Product, - Products, - ProductType, -} from './common-types'; - -// Get Server Time -export type GetServerTimeResponse = { - iso?: string; - epochSeconds?: number; - epochMillis?: number; -}; - -// Get Public Product Book -export type GetPublicProductBookRequest = { - // Query Params - productId: string; - limit?: number; - aggregationPriceIncrement?: number; -}; - -export type GetPublicProductBookResponse = { - pricebook: PriceBook; -}; - -// List Public Products -export type ListPublicProductsRequest = { - // Query Params - limit?: number; - offset?: number; - productType?: ProductType; - productIds?: string[]; - contractExpiryType?: ContractExpiryType; - expiringContractStatus?: ExpiringContractStatus; - getAllProducts?: boolean; -}; - -export type ListPublicProductsResponse = { - body?: Products; -}; - -// Get Public Product -export type GetPublicProductRequest = { - // Path Params - productId: string; -}; - -export type GetPublicProductResponse = { - body?: Product; -}; - -//Get Public Product Candles -export type GetPublicProductCandlesRequest = { - // Path Params - productId: string; - - // Query Params - start: string; - end: string; - granularity: string; - limit?: number; -}; - -export type GetPublicProductCandlesResponse = { - body?: Candles; -}; - -// Get Public Market Trades -export type GetPublicMarketTradesRequest = { - // Path Params - productId: string; - - // Query Params - limit: number; - start?: string; - end?: string; -}; - -export type GetPublicMarketTradesResponse = { - trades?: HistoricalMarketTrade[]; - best_bid?: string; - best_ask?: string; -}; diff --git a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/request-types.ts b/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/request-types.ts deleted file mode 100644 index 56c7a926a97..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/src/rest/types/request-types.ts +++ /dev/null @@ -1,14 +0,0 @@ -export enum method { - GET = 'GET', - POST = 'POST', - PUT = 'PUT', - DELETE = 'DELETE', -} - -export interface RequestOptions { - method: method; - endpoint: string; - queryParams?: Record; - bodyParams?: Record; - isPublic: boolean; -} diff --git a/packages/plugin-coinbase/advanced-sdk-ts/tsconfig.json b/packages/plugin-coinbase/advanced-sdk-ts/tsconfig.json deleted file mode 100644 index 9a8f3ef63b3..00000000000 --- a/packages/plugin-coinbase/advanced-sdk-ts/tsconfig.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "es6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ - "module": "commonjs" /* Specify what module code is generated. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "include": [ - "src/**/*.ts" - ], // Include all .ts files in the src directory and subdirectories - "exclude": [ - "node_modules" - ] -} \ No newline at end of file diff --git a/packages/plugin-coinbase/eslint.config.mjs b/packages/plugin-coinbase/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-coinbase/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-coinbase/package.json b/packages/plugin-coinbase/package.json deleted file mode 100644 index 01b4bd3a1ae..00000000000 --- a/packages/plugin-coinbase/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@ai16z/plugin-coinbase", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "coinbase-api": "1.0.5", - "coinbase-advanced-sdk": "file:../../packages/plugin-coinbase/advanced-sdk-ts", - "jsonwebtoken": "^9.0.2", - "@types/jsonwebtoken": "^9.0.7", - "node-fetch": "^2.6.1" - }, - "devDependencies": { - "tsup": "8.3.5", - "@types/node": "^20.0.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - } -} diff --git a/packages/plugin-coinbase/src/constants.ts b/packages/plugin-coinbase/src/constants.ts deleted file mode 100644 index 1524455822a..00000000000 --- a/packages/plugin-coinbase/src/constants.ts +++ /dev/null @@ -1,224 +0,0 @@ -export const ABI = [ - { - inputs: [], - name: "name", - outputs: [ - { - name: "", - type: "string", - internalType: "string" - } - ], - stateMutability: "view", - type: "function" - }, - { - inputs: [ - { - name: "spender", - type: "address", - internalType: "address" - }, - { - name: "amount", - type: "uint256", - internalType: "uint256" - } - ], - name: "approve", - outputs: [ - { - name: "", - type: "bool", - internalType: "bool" - } - ], - stateMutability: "nonpayable", - type: "function" - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256" - } - ], - stateMutability: "view", - type: "function" - }, - { - inputs: [ - { - name: "from", - type: "address", - internalType: "address" - }, - { - name: "to", - type: "address", - internalType: "address" - }, - { - name: "amount", - type: "uint256", - internalType: "uint256" - } - ], - name: "transferFrom", - outputs: [ - { - name: "", - type: "bool", - internalType: "bool" - } - ], - stateMutability: "nonpayable", - type: "function" - }, - { - inputs: [], - name: "decimals", - outputs: [ - { - name: "", - type: "uint8", - internalType: "uint8" - } - ], - stateMutability: "view", - type: "function" - }, - { - inputs: [ - { - name: "account", - type: "address", - internalType: "address" - } - ], - name: "balanceOf", - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256" - } - ], - stateMutability: "view", - type: "function" - }, - { - inputs: [], - name: "symbol", - outputs: [ - { - name: "", - type: "string", - internalType: "string" - } - ], - stateMutability: "view", - type: "function" - }, - { - inputs: [ - { - name: "to", - type: "address", - internalType: "address" - }, - { - name: "amount", - type: "uint256", - internalType: "uint256" - } - ], - name: "transfer", - outputs: [ - { - name: "", - type: "bool", - internalType: "bool" - } - ], - stateMutability: "nonpayable", - type: "function" - }, - { - inputs: [ - { - name: "owner", - type: "address", - internalType: "address" - }, - { - name: "spender", - type: "address", - internalType: "address" - } - ], - name: "allowance", - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256" - } - ], - stateMutability: "view", - type: "function" - }, - { - inputs: [ - { - indexed: true, - name: "owner", - type: "address", - internalType: "address" - }, - { - indexed: true, - name: "spender", - type: "address", - internalType: "address" - }, - { - indexed: false, - name: "value", - type: "uint256", - internalType: "uint256" - } - ], - name: "Approval", - type: "event", - anonymous: false - }, - { - inputs: [ - { - indexed: true, - name: "from", - type: "address", - internalType: "address" - }, - { - indexed: true, - name: "to", - type: "address", - internalType: "address" - }, - { - indexed: false, - name: "value", - type: "uint256", - internalType: "uint256" - } - ], - name: "Transfer", - type: "event", - anonymous: false - } -]; \ No newline at end of file diff --git a/packages/plugin-coinbase/src/index.ts b/packages/plugin-coinbase/src/index.ts deleted file mode 100644 index 69d4c838264..00000000000 --- a/packages/plugin-coinbase/src/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { coinbaseMassPaymentsPlugin } from "./plugins/massPayments"; -import { coinbaseCommercePlugin } from "./plugins/commerce"; -import { tradePlugin } from "./plugins/trade"; -import { tokenContractPlugin } from "./plugins/tokenContract"; -import { webhookPlugin } from "./plugins/webhooks"; -import { advancedTradePlugin } from "./plugins/advancedTrade"; - -export const plugins = { - coinbaseMassPaymentsPlugin, - coinbaseCommercePlugin, - tradePlugin, - tokenContractPlugin, - webhookPlugin, - advancedTradePlugin, -}; - -export * from "./plugins/massPayments"; -export * from "./plugins/commerce"; -export * from "./plugins/trade"; -export * from "./plugins/tokenContract"; -export * from "./plugins/webhooks"; -export * from "./plugins/advancedTrade"; diff --git a/packages/plugin-coinbase/src/templates.ts b/packages/plugin-coinbase/src/templates.ts deleted file mode 100644 index 7dbf26d1f5b..00000000000 --- a/packages/plugin-coinbase/src/templates.ts +++ /dev/null @@ -1,388 +0,0 @@ -export const chargeTemplate = ` -Extract the following details to create a Coinbase charge: -- **price** (number): The amount for the charge (e.g., 100.00). -- **currency** (string): The 3-letter ISO 4217 currency code (e.g., USD, EUR). -- **type** (string): The pricing type for the charge (e.g., fixed_price, dynamic_price). Assume price type is fixed unless otherwise stated -- **name** (string): A non-empty name for the charge (e.g., "The Human Fund"). -- **description** (string): A non-empty description of the charge (e.g., "Money For People"). - -Provide the values in the following JSON format: - -\`\`\`json -{ - "price": , - "currency": "", - "type": "", - "name": "", - "description": "" -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const getChargeTemplate = ` -Extract the details for a Coinbase charge using the provided charge ID: -- **charge_id** (string): The unique identifier of the charge (e.g., "2b364ef7-ad60-4fcd-958b-e550a3c47dc6"). - -Provide the charge details in the following JSON format after retrieving the charge details: - -\`\`\`json -{ - "charge_id": "", - "price": , - "currency": "", - "type": "", - "name": "", - "description": "", - "status": "", - "created_at": "", - "expires_at": "" -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const transferTemplate = ` -Extract the following details for processing a mass payout using the Coinbase SDK: -- **receivingAddresses** (array): A list of wallet addresses receiving the funds. -- **transferAmount** (number): The amount to transfer to each address. -- **assetId** (string): The asset ID to transfer (e.g., ETH, BTC). -- **network** (string): The blockchain network to use. Allowed values are: - static networks: { - readonly BaseSepolia: "base-sepolia"; - readonly BaseMainnet: "base-mainnet"; - readonly EthereumHolesky: "ethereum-holesky"; - readonly EthereumMainnet: "ethereum-mainnet"; - readonly PolygonMainnet: "polygon-mainnet"; - readonly SolanaDevnet: "solana-devnet"; - readonly SolanaMainnet: "solana-mainnet"; - readonly ArbitrumMainnet: "arbitrum-mainnet"; - }; - -Provide the details in the following JSON format: - -\`\`\`json -{ - "receivingAddresses": ["", ""], - "transferAmount": , - "assetId": "", - "network": "" -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const tradeTemplate = ` -Extract the following details for processing a trade using the Coinbase SDK: -- **network** (string): The blockchain network to use (e.g., base, sol, eth, arb, pol). -- **amount** (number): The amount to trade. -- **sourceAsset** (string): The asset ID to trade from (must be one of: ETH, SOL, USDC, WETH, GWEI, LAMPORT). -- **targetAsset** (string): The asset ID to trade to (must be one of: ETH, SOL, USDC, WETH, GWEI, LAMPORT). -- **side** (string): The side of the trade (must be either "BUY" or "SELL"). - -Ensure that: -1. **network** is one of the supported networks: "base", "sol", "eth", "arb", or "pol". -2. **sourceAsset** and **targetAsset** are valid assets from the provided list. -3. **amount** is a positive number. -4. **side** is either "BUY" or "SELL". - -Provide the details in the following JSON format: - -\`\`\`json -{ - "network": "", - "amount": , - "sourceAsset": "", - "targetAsset": "", - "side": "" -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const advancedTradeTemplate = ` -Extract the following details for processing an advanced trade using the Coinbase Advanced Trading API: -- **productId** (string): The trading pair ID (e.g., "BTC-USD", "ETH-USD", "SOL-USD") -- **side** (string): The side of the trade (must be either "BUY" or "SELL") -- **amount** (number): The amount to trade -- **orderType** (string): The type of order (must be either "MARKET" or "LIMIT") -- **limitPrice** (number, optional): The limit price for limit orders - -Ensure that: -1. **productId** follows the format "ASSET-USD" (e.g., "BTC-USD") -2. **side** is either "BUY" or "SELL" -3. **amount** is a positive number -4. **orderType** is either "MARKET" or "LIMIT" -5. **limitPrice** is provided when orderType is "LIMIT" - -Provide the details in the following JSON format: - -\`\`\`json -{ - "productId": "", - "side": "", - "amount": , - "orderType": "", - "limitPrice": -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - - -export const tokenContractTemplate = ` -Extract the following details for deploying a token contract using the Coinbase SDK: -- **contractType** (string): The type of token contract to deploy (ERC20, ERC721, or ERC1155) -- **name** (string): The name of the token -- **symbol** (string): The symbol of the token -- **network** (string): The blockchain network to deploy on (e.g., base, eth, arb, pol) -- **baseURI** (string, optional): The base URI for token metadata (required for ERC721 and ERC1155) -- **totalSupply** (number, optional): The total supply of tokens (only for ERC20) - -Provide the details in the following JSON format: - -\`\`\`json -{ - "contractType": "", - "name": "", - "symbol": "", - "network": "", - "baseURI": "", - "totalSupply": -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -// Add to templates.ts -export const contractInvocationTemplate = ` -Extract the following details for invoking a smart contract using the Coinbase SDK: -- **contractAddress** (string): The address of the contract to invoke -- **method** (string): The method to invoke on the contract -- **abi** (array): The ABI of the contract -- **args** (object, optional): The arguments to pass to the contract method -- **amount** (string, optional): The amount of the asset to send (as string to handle large numbers) -- **assetId** (string, required): The ID of the asset to send (e.g., 'USDC') -- **networkId** (string, required): The network ID to use in format "chain-network". - static networks: { - readonly BaseSepolia: "base-sepolia"; - readonly BaseMainnet: "base-mainnet"; - readonly EthereumHolesky: "ethereum-holesky"; - readonly EthereumMainnet: "ethereum-mainnet"; - readonly PolygonMainnet: "polygon-mainnet"; - readonly SolanaDevnet: "solana-devnet"; - readonly SolanaMainnet: "solana-mainnet"; - readonly ArbitrumMainnet: "arbitrum-mainnet"; - }; - -Provide the details in the following JSON format: - -\`\`\`json -{ - "contractAddress": "", - "method": "", - "abi": [], - "args": { - "": "" - }, - "amount": "", - "assetId": "", - "networkId": "" -} -\`\`\` - -Example for invoking a transfer method on the USDC contract: - -\`\`\`json -{ - "contractAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "method": "transfer", - "abi": [ - { - "constant": false, - "inputs": [ - { - "name": "to", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "args": { - "to": "0xbcF7C64B880FA89a015970dC104E848d485f99A3", - "amount": "1000000" // 1 USDC (6 decimals) - }, - "networkId": "ethereum-mainnet", - "assetId": "USDC" -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const webhookTemplate = ` -Extract the following details for creating a webhook: -- **networkId** (string): The network ID for which the webhook is created. -Allowed values are: - static networks: { - readonly BaseSepolia: "base-sepolia"; - readonly BaseMainnet: "base-mainnet"; - readonly EthereumHolesky: "ethereum-holesky"; - readonly EthereumMainnet: "ethereum-mainnet"; - readonly PolygonMainnet: "polygon-mainnet"; - readonly SolanaDevnet: "solana-devnet"; - readonly SolanaMainnet: "solana-mainnet"; - readonly ArbitrumMainnet: "arbitrum-mainnet"; - }; -- **eventType** (string): The type of event for the webhook. -export declare const WebhookEventType: { - readonly Unspecified: "unspecified"; - readonly Erc20Transfer: "erc20_transfer"; - readonly Erc721Transfer: "erc721_transfer"; - readonly WalletActivity: "wallet_activity"; -}; -- **eventTypeFilter** (string, optional): Filter for wallet activity event type. -export interface WebhookEventTypeFilter { - /** - * A list of wallet addresses to filter on. - * @type {Array} - * @memberof WebhookWalletActivityFilter - */ - 'addresses'?: Array; - /** - * The ID of the wallet that owns the webhook. - * @type {string} - * @memberof WebhookWalletActivityFilter - */ - 'wallet_id'?: string; -} -- **eventFilters** (array, optional): Filters applied to the events that determine which specific events trigger the webhook. -export interface Array { - /** - * The onchain contract address of the token for which the events should be tracked. - * @type {string} - * @memberof WebhookEventFilter - */ - 'contract_address'?: string; - /** - * The onchain address of the sender. Set this filter to track all transfer events originating from your address. - * @type {string} - * @memberof WebhookEventFilter - */ - 'from_address'?: string; - /** - * The onchain address of the receiver. Set this filter to track all transfer events sent to your address. - * @type {string} - * @memberof WebhookEventFilter - */ - 'to_address'?: string; -} -Provide the details in the following JSON format: -\`\`\`json -{ - "networkId": "", - "eventType": "", - "eventTypeFilter": "", - "eventFilters": [, ] -} -\`\`\` - - - -Example for creating a webhook on the Sepolia testnet for ERC20 transfers originating from a specific wallet 0x1234567890123456789012345678901234567890 on transfers from 0xbcF7C64B880FA89a015970dC104E848d485f99A3 - -\`\`\`javascript - - networkId: 'base-sepolia', // Listening on sepolia testnet transactions - eventType: 'erc20_transfer', - eventTypeFilter: { - addresses: ['0x1234567890123456789012345678901234567890'] - }, - eventFilters: [{ - from_address: '0xbcF7C64B880FA89a015970dC104E848d485f99A3', - }], -}); -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; - -export const readContractTemplate = ` -Extract the following details for reading from a smart contract using the Coinbase SDK: -- **contractAddress** (string): The address of the contract to read from (must start with 0x) -- **method** (string): The view/pure method to call on the contract -- **networkId** (string): The network ID based on networks configured in Coinbase SDK -Allowed values are: - static networks: { - readonly BaseSepolia: "base-sepolia"; - readonly BaseMainnet: "base-mainnet"; - readonly EthereumHolesky: "ethereum-holesky"; - readonly EthereumMainnet: "ethereum-mainnet"; - readonly PolygonMainnet: "polygon-mainnet"; - readonly SolanaDevnet: "solana-devnet"; - readonly SolanaMainnet: "solana-mainnet"; - readonly ArbitrumMainnet: "arbitrum-mainnet"; - }; -- **args** (object): The arguments to pass to the contract method -- **abi** (array, optional): The contract ABI if needed for complex interactions - -Provide the details in the following JSON format: - -\`\`\`json -{ - "contractAddress": "<0x-prefixed-address>", - "method": "", - "networkId": "", - "args": { - "": "" - }, - "abi": [ - // Optional ABI array - ] -} -\`\`\` - -Example for reading the balance of an ERC20 token: - -\`\`\`json -{ - "contractAddress": "0x37f2131ebbc8f97717edc3456879ef56b9f4b97b", - "method": "balanceOf", - "networkId": "eth-mainnet", - "args": { - "account": "0xbcF7C64B880FA89a015970dC104E848d485f99A3" - } -} -\`\`\` - -Here are the recent user messages for context: -{{recentMessages}} -`; \ No newline at end of file diff --git a/packages/plugin-coinbase/src/types.ts b/packages/plugin-coinbase/src/types.ts deleted file mode 100644 index 5644fa9040c..00000000000 --- a/packages/plugin-coinbase/src/types.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { Coinbase } from "@coinbase/coinbase-sdk"; -import { z } from "zod"; -import { WebhookEventType, WebhookEventFilter, WebhookEventTypeFilter } from "@coinbase/coinbase-sdk/dist/client"; - -export const ChargeSchema = z.object({ - id: z.string().nullable(), - price: z.number(), - type: z.string(), - currency: z.string().min(3).max(3), - name: z.string().min(1), - description: z.string().min(1), -}); - -export interface ChargeContent { - id: string | null; - price: number; - type: string; - currency: string; // Currency code (e.g., USD) - name: string; // Name of the charge - description: string; // Description of the charge -} - -export const isChargeContent = (object: any): object is ChargeContent => { - if (ChargeSchema.safeParse(object).success) { - return true; - } - console.error("Invalid content: ", object); - return false; -}; - -export const TransferSchema = z.object({ - network: z.string().toLowerCase(), - receivingAddresses: z.array(z.string()), - transferAmount: z.number(), - assetId: z.string().toLowerCase(), -}); - -export interface TransferContent { - network: string; - receivingAddresses: string[]; - transferAmount: number; - assetId: string; -} - -export const isTransferContent = (object: any): object is TransferContent => { - return TransferSchema.safeParse(object).success; -}; - -export type Transaction = { - address: string; - amount: number; - status: string; - errorCode: string | null; - transactionUrl: string | null; -}; -const assetValues = Object.values(Coinbase.assets) as [string, ...string[]]; -export const TradeSchema = z.object({ - network: z.string().toLowerCase(), - amount: z.number(), - sourceAsset: z.enum(assetValues), - targetAsset: z.enum(assetValues), - side: z.enum(["BUY", "SELL"]), -}); - -export interface TradeContent { - network: string; - amount: number; - sourceAsset: string; - targetAsset: string; - side: "BUY" | "SELL"; - -} - -export const isTradeContent = (object: any): object is TradeContent => { - return TradeSchema.safeParse(object).success; -}; - -export type TradeTransaction = { - network: string; - amount: number; - sourceAsset: string; - targetAsset: string; - status: string; - errorCode: string | null; - transactionUrl: string | null; -}; - -export interface TokenContractContent { - contractType: "ERC20" | "ERC721" | "ERC1155"; - name: string; - symbol: string; - network: string; - baseURI?: string; - totalSupply?: number; -} - -export const TokenContractSchema = z.object({ - contractType: z.enum(["ERC20", "ERC721", "ERC1155"]).describe("The type of token contract to deploy"), - name: z.string().describe("The name of the token"), - symbol: z.string().describe("The symbol of the token"), - network: z.string().describe("The blockchain network to deploy on"), - baseURI: z.string().optional().describe("The base URI for token metadata (required for ERC721 and ERC1155)"), - totalSupply: z.number().optional().describe("The total supply of tokens (only for ERC20)"), -}).refine(data => { - if (data.contractType === "ERC20") { - return typeof data.totalSupply === "number" || data.totalSupply === undefined; - } - if (["ERC721", "ERC1155"].includes(data.contractType)) { - return typeof data.baseURI === "string" || data.baseURI === undefined; - } - return true; -}, { - message: "Invalid token contract content", - path: ["contractType"], -}); - -export const isTokenContractContent = (obj: any): obj is TokenContractContent => { - return TokenContractSchema.safeParse(obj).success; -}; - -// Add to types.ts -export interface ContractInvocationContent { - contractAddress: string; - method: string; - abi: any[]; - args?: Record; - amount?: string; - assetId: string; - networkId: string; -} - -export const ContractInvocationSchema = z.object({ - contractAddress: z.string().describe("The address of the contract to invoke"), - method: z.string().describe("The method to invoke on the contract"), - abi: z.array(z.any()).describe("The ABI of the contract"), - args: z.record(z.string(), z.any()).optional().describe("The arguments to pass to the contract method"), - amount: z.string().optional().describe("The amount of the asset to send (as string to handle large numbers)"), - assetId: z.string().describe("The ID of the asset to send (e.g., 'USDC')"), - networkId: z.string().describe("The network ID to use (e.g., 'ethereum-mainnet')") -}); - -export const isContractInvocationContent = (obj: any): obj is ContractInvocationContent => { - return ContractInvocationSchema.safeParse(obj).success; -}; - - -export const WebhookSchema = z.object({ - networkId: z.string(), - eventType: z.nativeEnum(WebhookEventType), - eventTypeFilter:z.custom().optional(), - eventFilters: z.array(z.custom()).optional() -}); - -export type WebhookContent = z.infer; - -export const isWebhookContent = (object: any): object is WebhookContent => { - return WebhookSchema.safeParse(object).success; -}; - -export const AdvancedTradeSchema = z.object({ - productId: z.string(), - side: z.enum(["BUY", "SELL"]), - amount: z.number(), - orderType: z.enum(["MARKET", "LIMIT"]), - limitPrice: z.number().optional(), -}); - -export interface AdvancedTradeContent { - productId: string; - side: "BUY" | "SELL"; - amount: number; - orderType: "MARKET" | "LIMIT"; - limitPrice?: number; -} - -export const isAdvancedTradeContent = (object: any): object is AdvancedTradeContent => { - return AdvancedTradeSchema.safeParse(object).success; -}; - -export interface ReadContractContent { - contractAddress: `0x${string}`; - method: string; - networkId: string; - args: Record; - abi?: any[]; -} - -export const ReadContractSchema = z.object({ - contractAddress: z.string().describe("The address of the contract to read from"), - method: z.string().describe("The view/pure method to call on the contract"), - networkId: z.string().describe("The network ID to use"), - args: z.record(z.string(), z.any()).describe("The arguments to pass to the contract method"), - abi: z.array(z.any()).optional().describe("The contract ABI (optional)") -}); - -export const isReadContractContent = (obj: any): obj is ReadContractContent => { - return ReadContractSchema.safeParse(obj).success; -}; \ No newline at end of file diff --git a/packages/plugin-coinbase/src/utils.ts b/packages/plugin-coinbase/src/utils.ts deleted file mode 100644 index c3e801a45f4..00000000000 --- a/packages/plugin-coinbase/src/utils.ts +++ /dev/null @@ -1,484 +0,0 @@ -import { Coinbase, Trade, Transfer, Wallet, WalletData, Webhook } from "@coinbase/coinbase-sdk"; -import { elizaLogger, IAgentRuntime } from "@ai16z/eliza"; -import fs from "fs"; -import path from "path"; -import { EthereumTransaction } from "@coinbase/coinbase-sdk/dist/client"; -import { fileURLToPath } from "url"; -import { createArrayCsvWriter } from "csv-writer"; -import { Transaction } from "./types"; - -// Dynamically resolve the file path to the src/plugins directory -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const baseDir = path.resolve(__dirname, "../../plugin-coinbase/src/plugins"); -const tradeCsvFilePath = path.join(baseDir, "trades.csv"); -const transactionCsvFilePath = path.join(baseDir, "transactions.csv"); -const webhookCsvFilePath = path.join(baseDir, "webhooks.csv"); - -export async function initializeWallet( - runtime: IAgentRuntime, - networkId: string = Coinbase.networks.EthereumMainnet -) { - let wallet: Wallet; - const storedSeed = - runtime.getSetting("COINBASE_GENERATED_WALLET_HEX_SEED") ?? - process.env.COINBASE_GENERATED_WALLET_HEX_SEED; - - const storedWalletId = - runtime.getSetting("COINBASE_GENERATED_WALLET_ID") ?? - process.env.COINBASE_GENERATED_WALLET_ID; - if (!storedSeed || !storedWalletId) { - // No stored seed or wallet ID, creating a new wallet - wallet = await Wallet.create({ networkId }); - - // Export wallet data directly - const walletData: WalletData = wallet.export(); - const walletAddress = await wallet.getDefaultAddress(); - try { - const characterFilePath = `characters/${runtime.character.name.toLowerCase()}.character.json`; - const walletIDSave = await updateCharacterSecrets( - characterFilePath, - "COINBASE_GENERATED_WALLET_ID", - walletData.walletId - ); - const seedSave = await updateCharacterSecrets( - characterFilePath, - "COINBASE_GENERATED_WALLET_HEX_SEED", - walletData.seed - ); - if (walletIDSave && seedSave) { - elizaLogger.log("Successfully updated character secrets."); - } else { - const seedFilePath = `characters/${runtime.character.name.toLowerCase()}-seed.txt`; - elizaLogger.error( - `Failed to update character secrets so adding gitignored ${seedFilePath} file please add it your env or character file and delete:` - ); - // save it to gitignored file - wallet.saveSeed(seedFilePath); - } - elizaLogger.log("Wallet created and stored new wallet:", walletAddress); - } catch (error) { - elizaLogger.error("Error updating character secrets:", error); - throw error; - } - - // Logging wallet creation - elizaLogger.log("Created and stored new wallet:", walletAddress); - } else { - // Importing existing wallet using stored seed and wallet ID - // Always defaults to base-mainnet we can't select the network here - wallet = await Wallet.import({ - seed: storedSeed, - walletId: storedWalletId, - }); - const networkId = wallet.getNetworkId(); - elizaLogger.log("Imported existing wallet for network:", networkId); - - // Logging wallet import - elizaLogger.log( - "Imported existing wallet:", - await wallet.getDefaultAddress() - ); - } - - return wallet; -} - -/** - * Executes a trade and a charity transfer. - * @param {IAgentRuntime} runtime - The runtime for wallet initialization. - * @param {string} network - The network to use. - * @param {number} amount - The amount to trade and transfer. - * @param {string} sourceAsset - The source asset to trade. - * @param {string} targetAsset - The target asset to trade. - */ -export async function executeTradeAndCharityTransfer(runtime: IAgentRuntime, network: string, amount: number, sourceAsset: string, targetAsset: string) { - const wallet = await initializeWallet(runtime, network); - - elizaLogger.log("Wallet initialized:", { - network, - address: await wallet.getDefaultAddress(), - }); - - const charityAddress = getCharityAddress(network); - const charityAmount = charityAddress ? amount * 0.01 : 0; - const tradeAmount = charityAddress ? amount - charityAmount : amount; - const assetIdLowercase = sourceAsset.toLowerCase(); - const tradeParams = { - amount: tradeAmount, - fromAssetId: assetIdLowercase, - toAssetId: targetAsset.toLowerCase(), - }; - - let transfer: Transfer; - if (charityAddress && charityAmount > 0) { - transfer = await executeTransfer(wallet, charityAmount, assetIdLowercase, charityAddress); - elizaLogger.log("Charity Transfer successful:", { - address: charityAddress, - transactionUrl: transfer.getTransactionLink(), - }); - await appendTransactionsToCsv([{ - address: charityAddress, - amount: charityAmount, - status: "Success", - errorCode: null, - transactionUrl: transfer.getTransactionLink(), - }]); - } - - const trade: Trade = await wallet.createTrade(tradeParams); - elizaLogger.log("Trade initiated:", trade.toString()); - await trade.wait(); - elizaLogger.log("Trade completed successfully:", trade.toString()); - await appendTradeToCsv(trade); - return { - trade, - transfer, - }; -} - -export async function appendTradeToCsv(trade: Trade) { - try { - const csvWriter = createArrayCsvWriter({ - path: tradeCsvFilePath, - header: [ - "Network", - "From Amount", - "Source Asset", - "To Amount", - "Target Asset", - "Status", - "Transaction URL", - ], - append: true, - }); - - const formattedTrade = [ - trade.getNetworkId(), - trade.getFromAmount(), - trade.getFromAssetId(), - trade.getToAmount(), - trade.getToAssetId(), - trade.getStatus(), - trade.getTransaction().getTransactionLink() || "", - ]; - - elizaLogger.log("Writing trade to CSV:", formattedTrade); - await csvWriter.writeRecords([formattedTrade]); - elizaLogger.log("Trade written to CSV successfully."); - } catch (error) { - elizaLogger.error("Error writing trade to CSV:", error); - } -} - -export async function appendTransactionsToCsv(transactions: Transaction[]) { - try { - const csvWriter = createArrayCsvWriter({ - path: transactionCsvFilePath, - header: [ - "Address", - "Amount", - "Status", - "Error Code", - "Transaction URL", - ], - append: true, - }); - - const formattedTransactions = transactions.map((transaction) => [ - transaction.address, - transaction.amount.toString(), - transaction.status, - transaction.errorCode || "", - transaction.transactionUrl || "", - ]); - - elizaLogger.log("Writing transactions to CSV:", formattedTransactions); - await csvWriter.writeRecords(formattedTransactions); - elizaLogger.log("All transactions written to CSV successfully."); - } catch (error) { - elizaLogger.error("Error writing transactions to CSV:", error); - } -} -// create a function to append webhooks to a csv -export async function appendWebhooksToCsv(webhooks: Webhook[]) { - try { - // Ensure the CSV file exists - if (!fs.existsSync(webhookCsvFilePath)) { - elizaLogger.warn("CSV file not found. Creating a new one."); - const csvWriter = createArrayCsvWriter({ - path: webhookCsvFilePath, - header: [ - "Webhook ID", - "Network ID", - "Event Type", - "Event Filters", - "Event Type Filter", - "Notification URI", - ], - }); - await csvWriter.writeRecords([]); // Create an empty file with headers - elizaLogger.log("New CSV file created with headers."); - } - const csvWriter = createArrayCsvWriter({ - path: webhookCsvFilePath, - header: [ - "Webhook ID", - "Network ID", - "Event Type", - "Event Filters", - "Event Type Filter", - "Notification URI", - ], - append: true, - }); - - const formattedWebhooks = webhooks.map((webhook) => [ - webhook.getId(), - webhook.getNetworkId(), - webhook.getEventType(), - JSON.stringify(webhook.getEventFilters()), - JSON.stringify(webhook.getEventTypeFilter()), - webhook.getNotificationURI(), - ]); - - elizaLogger.log("Writing webhooks to CSV:", formattedWebhooks); - await csvWriter.writeRecords(formattedWebhooks); - elizaLogger.log("All webhooks written to CSV successfully."); - } catch (error) { - elizaLogger.error("Error writing webhooks to CSV:", error); - } -} - -/** - * Updates a key-value pair in character.settings.secrets. - * @param {string} characterfilePath - The file path to the character. - * @param {string} key - The secret key to update or add. - * @param {string} value - The new value for the secret key. - */ -export async function updateCharacterSecrets( - characterfilePath: string, - key: string, - value: string -): Promise { - try { - const characterFilePath = path.resolve( - process.cwd(), - characterfilePath - ); - - // Check if the character file exists - if (!fs.existsSync(characterFilePath)) { - elizaLogger.error("Character file not found:", characterFilePath); - return false; - } - - // Read the existing character file - const characterData = JSON.parse( - fs.readFileSync(characterFilePath, "utf-8") - ); - - // Ensure settings and secrets exist in the character file - if (!characterData.settings) { - characterData.settings = {}; - } - if (!characterData.settings.secrets) { - characterData.settings.secrets = {}; - } - - // Update or add the key-value pair - characterData.settings.secrets[key] = value; - - // Write the updated data back to the file - fs.writeFileSync( - characterFilePath, - JSON.stringify(characterData, null, 2), - "utf-8" - ); - - console.log( - `Updated ${key} in character.settings.secrets for ${characterFilePath}.` - ); - } catch (error) { - elizaLogger.error("Error updating character secrets:", error); - return false; - } - return true; -} - -export const getAssetType = (transaction: EthereumTransaction) => { - // Check for ETH - if (transaction.value && transaction.value !== "0") { - return "ETH"; - } - - // Check for ERC-20 tokens - if (transaction.token_transfers && transaction.token_transfers.length > 0) { - return transaction.token_transfers - .map((transfer) => { - return transfer.token_id; - }) - .join(", "); - } - - return "N/A"; -}; - -/** - * Fetches and formats wallet balances and recent transactions. - * - * @param {IAgentRuntime} runtime - The runtime for wallet initialization. - * @param {string} networkId - The network ID (optional, defaults to ETH mainnet). - * @returns {Promise<{balances: Array<{asset: string, amount: string}>, transactions: Array}>} - An object with formatted balances and transactions. - */ -export async function getWalletDetails( - runtime: IAgentRuntime, - networkId: string = Coinbase.networks.EthereumMainnet -): Promise<{ - balances: Array<{ asset: string; amount: string }>; - transactions: Array<{ - timestamp: string; - amount: string; - asset: string; // Ensure getAssetType is implemented - status: string; - transactionUrl: string; - }>; -}> { - try { - // Initialize the wallet, defaulting to the specified network or ETH mainnet - const wallet = await initializeWallet(runtime, networkId); - - // Fetch balances - const balances = await wallet.listBalances(); - const formattedBalances = Array.from(balances, (balance) => ({ - asset: balance[0], - amount: balance[1].toString(), - })); - - // Fetch the wallet's recent transactions - - const transactionsData = []; - const formattedTransactions = transactionsData.map((transaction) => { - const content = transaction.content(); - return { - timestamp: content.block_timestamp || "N/A", - amount: content.value || "N/A", - asset: getAssetType(content) || "N/A", // Ensure getAssetType is implemented - status: transaction.getStatus(), - transactionUrl: transaction.getTransactionLink() || "N/A", - }; - }); - - // Return formatted data - return { - balances: formattedBalances, - transactions: formattedTransactions, - }; - } catch (error) { - console.error("Error fetching wallet details:", error); - throw new Error("Unable to retrieve wallet details."); - } -} - -/** - * Executes a transfer. - * @param {Wallet} wallet - The wallet to use. - * @param {number} amount - The amount to transfer. - * @param {string} sourceAsset - The source asset to transfer. - * @param {string} targetAddress - The target address to transfer to. - */ -export async function executeTransferAndCharityTransfer(wallet: Wallet, amount: number, sourceAsset: string, targetAddress: string, network: string) { - const charityAddress = getCharityAddress(network); - const charityAmount = charityAddress ? amount * 0.01 : 0; - const transferAmount = charityAddress ? amount - charityAmount : amount; - const assetIdLowercase = sourceAsset.toLowerCase(); - - let charityTransfer: Transfer; - if (charityAddress && charityAmount > 0) { - charityTransfer = await executeTransfer(wallet, charityAmount, assetIdLowercase, charityAddress); - elizaLogger.log("Charity Transfer successful:", charityTransfer.toString()); - } - - const transferDetails = { - amount: transferAmount, - assetId: assetIdLowercase, - destination: targetAddress, - gasless: assetIdLowercase === "usdc" ? true : false, - }; - elizaLogger.log("Initiating transfer:", transferDetails); - const transfer = await wallet.createTransfer(transferDetails); - elizaLogger.log("Transfer initiated:", transfer.toString()); - await transfer.wait(); - - let responseText = `Transfer executed successfully: -- Amount: ${transfer.getAmount()} -- Asset: ${assetIdLowercase} -- Destination: ${targetAddress} -- Transaction URL: ${transfer.getTransactionLink() || ""}`; - - if (charityTransfer) { - responseText += ` -- Charity Amount: ${charityTransfer.getAmount()} -- Charity Transaction URL: ${charityTransfer.getTransactionLink() || ""}`; - } else { - responseText += "\n(Note: Charity transfer was not completed)"; - } - - elizaLogger.log(responseText); - - return { - transfer, - charityTransfer, - responseText, - } -} - -/** - * Executes a transfer. - * @param {Wallet} wallet - The wallet to use. - * @param {number} amount - The amount to transfer. - * @param {string} sourceAsset - The source asset to transfer. - * @param {string} targetAddress - The target address to transfer to. - */ -export async function executeTransfer(wallet: Wallet, amount: number, sourceAsset: string, targetAddress: string) { - const assetIdLowercase = sourceAsset.toLowerCase(); - const transferDetails = { - amount, - assetId: assetIdLowercase, - destination: targetAddress, - gasless: assetIdLowercase === "usdc" ? true : false, - }; - elizaLogger.log("Initiating transfer:", transferDetails); - let transfer: Transfer | undefined; - try { - transfer = await wallet.createTransfer(transferDetails); - elizaLogger.log("Transfer initiated:", transfer.toString()); - await transfer.wait({ - intervalSeconds: 1, - timeoutSeconds: 20, - }); - } catch (error) { - elizaLogger.error("Error executing transfer:", error); - } - return transfer; -} - -/** - * Gets the charity address based on the network. - * For now we are giving to the following charity, but will make this configurable in the future - * https://www.givedirectly.org/crypto/?_gl=1*va5e6k*_gcl_au*MTM1NDUzNTk5Mi4xNzMzMDczNjA3*_ga*OTIwMDMwNTMwLjE3MzMwNzM2MDg.*_ga_GV8XF9FJ16*MTczMzA3MzYwNy4xLjEuMTczMzA3MzYyMi40NS4wLjA. - * @param {string} network - The network to use. - */ -export function getCharityAddress(network: string): string | null { - let charityAddress = null; - if (network === "base") { - charityAddress = "0x750EF1D7a0b4Ab1c97B7A623D7917CcEb5ea779C"; - } else if (network === "sol") { - charityAddress = "pWvDXKu6CpbKKvKQkZvDA66hgsTB6X2AgFxksYogHLV"; - } else if (network === "eth") { - charityAddress = "0x750EF1D7a0b4Ab1c97B7A623D7917CcEb5ea779C"; - } else { - return null; - } - return charityAddress; -} diff --git a/packages/plugin-coinbase/tsconfig.json b/packages/plugin-coinbase/tsconfig.json deleted file mode 100644 index 4751d6174f3..00000000000 --- a/packages/plugin-coinbase/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": ".", - "rootDirs": [ - "src", - "advanced-sdk-ts" - ], - "types": [ - "node" - ] - }, - "include": [ - "src/**/*.ts", - "advanced-sdk-ts/src/**/*.ts", - ] -} \ No newline at end of file diff --git a/packages/plugin-coinbase/tsup.config.ts b/packages/plugin-coinbase/tsup.config.ts deleted file mode 100644 index 42a69c634f9..00000000000 --- a/packages/plugin-coinbase/tsup.config.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["cjs", "esm"], - dts: true, - splitting: false, - bundle: true, - minify: false, - external: [ - "@coinbase/coinbase-sdk", - "form-data", - "combined-stream", - "axios", - "util", - "stream", - "http", - "https", - "events", - "crypto", - "buffer", - "url", - "zlib", - "querystring", - "os", - "@reflink/reflink", - "@node-llama-cpp", - "agentkeepalive", - "fs/promises", - "csv-writer", - "csv-parse/sync", - "dotenv", - "coinbase-advanced-sdk", - "advanced-sdk-ts", - "jsonwebtoken", - "whatwg-url" - ], - platform: 'node', - target: 'node18', - esbuildOptions(options) { - options.bundle = true; - options.platform = 'node'; - options.target = 'node18'; - } -}); diff --git a/packages/plugin-conflux/README.md b/packages/plugin-conflux/README.md deleted file mode 100644 index faa68cfa76a..00000000000 --- a/packages/plugin-conflux/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# @ai16z/plugin-conflux - -This plugin provides actions and providers for interacting with the [Conflux network](https://www.confluxdocs.com/docs/general). - -## Actions - -### ConfiPump - -Buy and sell tokens on Conflux's implementation of pump.fun (ConfiPump). - -### Transfer - -Transfer tokens from one address to another within Conflux core space. - -### Bridge Transfer - -Transfer tokens from one address to Conflux eSpace. - -### Sponsor (TBD) - -Provide gas for Conflux core space contracts so they can be called without the need to have Conflux in user's wallet. - -### Swap (TBD) - -Swap tokens on Conflux DEXs. diff --git a/packages/plugin-conflux/package.json b/packages/plugin-conflux/package.json deleted file mode 100644 index dff1e471aca..00000000000 --- a/packages/plugin-conflux/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@ai16z/plugin-conflux", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "cive": "0.7.1" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } -} diff --git a/packages/plugin-conflux/src/abi/crossSpaceCall.ts b/packages/plugin-conflux/src/abi/crossSpaceCall.ts deleted file mode 100644 index f9ad2a67a07..00000000000 --- a/packages/plugin-conflux/src/abi/crossSpaceCall.ts +++ /dev/null @@ -1,184 +0,0 @@ -const CrossSpaceCallAbi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes20", - name: "sender", - type: "bytes20", - }, - { - indexed: true, - internalType: "bytes20", - name: "receiver", - type: "bytes20", - }, - { - indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "Call", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes20", - name: "sender", - type: "bytes20", - }, - { - indexed: true, - internalType: "bytes20", - name: "contract_address", - type: "bytes20", - }, - { - indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes", - name: "init", - type: "bytes", - }, - ], - name: "Create", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bool", - name: "success", - type: "bool", - }, - ], - name: "Outcome", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes20", - name: "sender", - type: "bytes20", - }, - { - indexed: true, - internalType: "address", - name: "receiver", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - ], - name: "Withdraw", - type: "event", - }, - { - inputs: [{ internalType: "bytes", name: "init", type: "bytes" }], - name: "createEVM", - outputs: [{ internalType: "bytes20", name: "", type: "bytes20" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [{ internalType: "bytes20", name: "to", type: "bytes20" }], - name: "transferEVM", - outputs: [{ internalType: "bytes", name: "output", type: "bytes" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes20", name: "to", type: "bytes20" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "callEVM", - outputs: [{ internalType: "bytes", name: "output", type: "bytes" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes20", name: "to", type: "bytes20" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "staticCallEVM", - outputs: [{ internalType: "bytes", name: "output", type: "bytes" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "deployEip1820", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "value", type: "uint256" }], - name: "withdrawFromMapped", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "addr", type: "address" }], - name: "mappedBalance", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "addr", type: "address" }], - name: "mappedNonce", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, -]; - -export default CrossSpaceCallAbi; diff --git a/packages/plugin-conflux/src/abi/erc20.ts b/packages/plugin-conflux/src/abi/erc20.ts deleted file mode 100644 index 47e5e6b8ea7..00000000000 --- a/packages/plugin-conflux/src/abi/erc20.ts +++ /dev/null @@ -1,119 +0,0 @@ -const ERC20ABI = [ - { - constant: true, - inputs: [], - name: "name", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "_spender", type: "address" }, - { name: "_value", type: "uint256" }, - ], - name: "approve", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "_from", type: "address" }, - { name: "_to", type: "address" }, - { name: "_value", type: "uint256" }, - ], - name: "transferFrom", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "decimals", - outputs: [{ name: "", type: "uint8" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [{ name: "_owner", type: "address" }], - name: "balanceOf", - outputs: [{ name: "balance", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "symbol", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "_to", type: "address" }, - { name: "_value", type: "uint256" }, - ], - name: "transfer", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [ - { name: "_owner", type: "address" }, - { name: "_spender", type: "address" }, - ], - name: "allowance", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { payable: true, stateMutability: "payable", type: "fallback" }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "owner", type: "address" }, - { indexed: true, name: "spender", type: "address" }, - { indexed: false, name: "value", type: "uint256" }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "from", type: "address" }, - { indexed: true, name: "to", type: "address" }, - { indexed: false, name: "value", type: "uint256" }, - ], - name: "Transfer", - type: "event", - }, -] as const; - -export default ERC20ABI; diff --git a/packages/plugin-conflux/src/abi/meme.ts b/packages/plugin-conflux/src/abi/meme.ts deleted file mode 100644 index 7ea7672ae15..00000000000 --- a/packages/plugin-conflux/src/abi/meme.ts +++ /dev/null @@ -1,1671 +0,0 @@ -const MEMEABI = [ - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "tokenImpl_", - type: "address", - }, - { - internalType: "address", - name: "tokenImplV2_", - type: "address", - }, - { - internalType: "uint256", - name: "feeRate_", - type: "uint256", - }, - { - internalType: "address", - name: "feeReceiver_", - type: "address", - }, - { - internalType: "address", - name: "dexLauncher_", - type: "address", - }, - { - internalType: "enum IConfiPumpTypes.DexThreshType", - name: "defaultDexThreshType_", - type: "uint8", - }, - { - internalType: "enum IConfiPumpTypes.CurveType", - name: "defaultCurveType_", - type: "uint8", - }, - { - internalType: "enum IConfiPumpTypes.TokenVersion", - name: "defaultTokenVersion_", - type: "uint8", - }, - { - internalType: "address", - name: "v2Factory_", - type: "address", - }, - { - internalType: "bytes32", - name: "v2InitCodeHash_", - type: "bytes32", - }, - { - internalType: "address", - name: "weth_", - type: "address", - }, - { - internalType: "uint256", - name: "creation_fee_", - type: "uint256", - }, - { - internalType: "uint256", - name: "lpEth_", - type: "uint256", - }, - { - internalType: "uint256", - name: "lpEthTokenCreator_", - type: "uint256", - }, - ], - internalType: "struct ConfiPumpBase.ConfiPumpInitParams", - name: "params", - type: "tuple", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [ - { - internalType: "uint256", - name: "actualAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - ], - name: "ActualAmountMustLTEAmount", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "AmountTooSmall", - type: "error", - }, - { - inputs: [], - name: "CallReverted", - type: "error", - }, - { - inputs: [], - name: "FeatureDisabled", - type: "error", - }, - { - inputs: [], - name: "GameNotLive", - type: "error", - }, - { - inputs: [], - name: "GameNotPaused", - type: "error", - }, - { - inputs: [], - name: "GameNotPending", - type: "error", - }, - { - inputs: [], - name: "GameNotStarted", - type: "error", - }, - { - inputs: [], - name: "InvalidDEXSupplyThreshold", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "threshold", - type: "uint256", - }, - ], - name: "InvalidDexThreshold", - type: "error", - }, - { - inputs: [ - { - internalType: "enum IConfiPumpTypes.DexThreshType", - name: "threshold", - type: "uint8", - }, - ], - name: "InvalidDexThresholdType", - type: "error", - }, - { - inputs: [], - name: "InvalidGameSupplyThreshold", - type: "error", - }, - { - inputs: [], - name: "InvalidLocks", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "expected", - type: "uint256", - }, - { - internalType: "uint256", - name: "actual", - type: "uint256", - }, - ], - name: "InvalidPiggybackLength", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - ], - name: "InvalidRoundID", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "signer", - type: "address", - }, - ], - name: "InvalidSigner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "InvalidTokenForBattle", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "enum IConfiPumpTypes.TokenMode", - name: "mode", - type: "uint8", - }, - ], - name: "InvalidTokenModeForGame", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "enum IConfiPumpTypes.TokenMode", - name: "from", - type: "uint8", - }, - { - internalType: "enum IConfiPumpTypes.TokenMode", - name: "to", - type: "uint8", - }, - ], - name: "InvalidTokenModeTransition", - type: "error", - }, - { - inputs: [], - name: "LastRoundNotResolved", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "expected", - type: "address", - }, - { - internalType: "address", - name: "actual", - type: "address", - }, - ], - name: "MismatchedAddressInProof", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "srcToken", - type: "address", - }, - { - internalType: "address", - name: "dstToken", - type: "address", - }, - ], - name: "NoConversionPath", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "created", - type: "uint256", - }, - { - internalType: "uint256", - name: "max", - type: "uint256", - }, - ], - name: "NoQuotaForCreator", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "collection", - type: "address", - }, - ], - name: "NonPositionNFTReceived", - type: "error", - }, - { - inputs: [], - name: "NotImplemented", - type: "error", - }, - { - inputs: [], - name: "NotRoller", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "NotUniswapV3Pool", - type: "error", - }, - { - inputs: [], - name: "PermissionlessCreateDisabled", - type: "error", - }, - { - inputs: [ - { - internalType: "uint160", - name: "sqrtPriceA", - type: "uint160", - }, - { - internalType: "uint160", - name: "sqrtPriceB", - type: "uint160", - }, - ], - name: "PriceAMustLTPriceB", - type: "error", - }, - { - inputs: [], - name: "ProtocolDisabled", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "requiredToken", - type: "uint256", - }, - { - internalType: "uint256", - name: "reserveToken", - type: "uint256", - }, - ], - name: "RequiredTokenMustLTE", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - ], - name: "RoundNotFound", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "tokenA", - type: "address", - }, - ], - name: "SameToken", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "seq", - type: "uint256", - }, - ], - name: "SeqNotFound", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "actualAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minAmount", - type: "uint256", - }, - ], - name: "SlippageTooHigh", - type: "error", - }, - { - inputs: [], - name: "StakingDisabled", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "newSupply", - type: "uint256", - }, - ], - name: "SupplyExceedsTotalSupply", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenAlreadyDEXed", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenAlreadyInGame", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenInDuel", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenKilled", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenNotDEXed", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenNotFound", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenNotKilled", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "TokenNotTradable", - type: "error", - }, - { - inputs: [], - name: "TradeDisabled", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "pool", - type: "address", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - ], - name: "UniswapV2PoolNotZero", - type: "error", - }, - { - inputs: [], - name: "UniswapV3Slot0Failed", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "next", - type: "uint256", - }, - ], - name: "cannotCheckInUntil", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "oldFlags", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newFlags", - type: "uint256", - }, - ], - name: "BitFlagsChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "user", - type: "address", - }, - ], - name: "CheckedIn", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "newSupply", - type: "uint256", - }, - ], - name: "FlapTokenCirculatingSupplyChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint8", - name: "version", - type: "uint8", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "pool", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "eth", - type: "uint256", - }, - ], - name: "LaunchedToDEX", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "previousAdminRole", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes32", - name: "newAdminRole", - type: "bytes32", - }, - ], - name: "RoleAdminChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleGranted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "account", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RoleRevoked", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "ts", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "buyer", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "eth", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "fee", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "postPrice", - type: "uint256", - }, - ], - name: "TokenBought", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "ts", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "creator", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "string", - name: "name", - type: "string", - }, - { - indexed: false, - internalType: "string", - name: "symbol", - type: "string", - }, - { - indexed: false, - internalType: "string", - name: "meta", - type: "string", - }, - ], - name: "TokenCreated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "curve", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "curveParameter", - type: "uint256", - }, - ], - name: "TokenCurveSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "dexSupplyThresh", - type: "uint256", - }, - ], - name: "TokenDexSupplyThreshSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "ts", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "srcToken", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "dstToken", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "srcAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "dstAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "who", - type: "address", - }, - ], - name: "TokenRedeemed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "ts", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "seller", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "eth", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "fee", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "postPrice", - type: "uint256", - }, - ], - name: "TokenSold", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "enum IConfiPumpTypes.TokenVersion", - name: "version", - type: "uint8", - }, - ], - name: "TokenVersionSet", - type: "event", - }, - { - stateMutability: "nonpayable", - type: "fallback", - }, - { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "minAmount", - type: "uint256", - }, - { - internalType: "bool", - name: "isCreator", - type: "bool", - }, - ], - name: "buy", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "checkIn", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - ], - name: "getRoleAdmin", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "getToken", - outputs: [ - { - components: [ - { - internalType: "enum IConfiPumpTypes.TokenStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint256", - name: "reserve", - type: "uint256", - }, - { - internalType: "uint256", - name: "circulatingSupply", - type: "uint256", - }, - { - internalType: "uint256", - name: "price", - type: "uint256", - }, - { - internalType: "bool", - name: "inGame", - type: "bool", - }, - { - internalType: "uint256", - name: "seqInGame", - type: "uint256", - }, - ], - internalType: "struct IConfiPumpTypes.TokenState", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "getTokenEx", - outputs: [ - { - components: [ - { - internalType: "enum IConfiPumpTypes.TokenStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint256", - name: "reserve", - type: "uint256", - }, - { - internalType: "uint256", - name: "circulatingSupply", - type: "uint256", - }, - { - internalType: "uint256", - name: "price", - type: "uint256", - }, - { - internalType: "bool", - name: "inGame", - type: "bool", - }, - { - internalType: "uint256", - name: "seqInGame", - type: "uint256", - }, - { - internalType: "enum IConfiPumpTypes.TokenMode", - name: "mode", - type: "uint8", - }, - ], - internalType: "struct IConfiPumpTypes.TokenStateEx", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "getTokenV2", - outputs: [ - { - components: [ - { - internalType: "enum IConfiPumpTypes.TokenStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint256", - name: "reserve", - type: "uint256", - }, - { - internalType: "uint256", - name: "circulatingSupply", - type: "uint256", - }, - { - internalType: "uint256", - name: "price", - type: "uint256", - }, - { - internalType: "enum IConfiPumpTypes.TokenVersion", - name: "tokenVersion", - type: "uint8", - }, - { - internalType: "uint256", - name: "r", - type: "uint256", - }, - { - internalType: "uint256", - name: "dexSupplyThresh", - type: "uint256", - }, - ], - internalType: "struct IConfiPumpTypes.TokenStateV2", - name: "state", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "hasRole", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "admin", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "lastCheckIn", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "symbol", - type: "string", - }, - { - internalType: "string", - name: "meta", - type: "string", - }, - ], - name: "newToken", - outputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "symbol", - type: "string", - }, - { - internalType: "string", - name: "meta", - type: "string", - }, - ], - name: "newTokenNoDuel", - outputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "symbol", - type: "string", - }, - { - internalType: "string", - name: "meta", - type: "string", - }, - { - internalType: "enum IConfiPumpTypes.DexThreshType", - name: "dexTreshType", - type: "uint8", - }, - ], - name: "newTokenWithDexSupplyThresh", - outputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "nonce", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "eth", - type: "uint256", - }, - ], - name: "previewBuy", - outputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "srcToken", - type: "address", - }, - { - internalType: "address", - name: "dstToken", - type: "address", - }, - { - internalType: "uint256", - name: "srcAmount", - type: "uint256", - }, - ], - name: "previewRedeem", - outputs: [ - { - internalType: "uint256", - name: "dstAmount", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "previewSell", - outputs: [ - { - internalType: "uint256", - name: "eth", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "srcToken", - type: "address", - }, - { - internalType: "address", - name: "dstToken", - type: "address", - }, - { - internalType: "uint256", - name: "srcAmount", - type: "uint256", - }, - ], - name: "redeem", - outputs: [ - { - internalType: "uint256", - name: "dstAmount", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "renounceRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "role", - type: "bytes32", - }, - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "revokeRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minEth", - type: "uint256", - }, - ], - name: "sell", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "flags", - type: "uint256", - }, - ], - name: "setBitFlags", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "tokenCreators", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "tokenCreatorsFeeBalance", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, -] as const; - -export default MEMEABI; diff --git a/packages/plugin-conflux/src/index.ts b/packages/plugin-conflux/src/index.ts deleted file mode 100644 index 1c6e65989e3..00000000000 --- a/packages/plugin-conflux/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Plugin } from "@ai16z/eliza"; -import { transfer } from "./actions/transfer"; -import { bridgeTransfer } from "./actions/bridgeTransfer"; -import { confiPump } from "./actions/confiPump"; - -export const confluxPlugin: Plugin = { - name: "conflux", - description: "Conflux Plugin for Eliza", - actions: [transfer, bridgeTransfer, confiPump], - providers: [], -}; diff --git a/packages/plugin-conflux/src/templates/bridgeTransfer.ts b/packages/plugin-conflux/src/templates/bridgeTransfer.ts deleted file mode 100644 index ca5fdea32ba..00000000000 --- a/packages/plugin-conflux/src/templates/bridgeTransfer.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const confluxBridgeTransferTemplate = ` -Extract Conflux Cross Space Transfer Parameters from the latest message: - -{{recentMessages}} - -The to address should be the Conflux eSpace address, starting with "0x". -`; diff --git a/packages/plugin-conflux/src/templates/confiPump.ts b/packages/plugin-conflux/src/templates/confiPump.ts deleted file mode 100644 index b3047fc8027..00000000000 --- a/packages/plugin-conflux/src/templates/confiPump.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const confiPumpTemplate = ` -Extract Conflux ConfiPump Parameters, including token creation, buy, and sell, from the latest messages: - -{{recentMessages}} - -For token creation, should come up with a name, symbol, and description. -For token buy, should come up with the amount of CFX to buy which token (with token address starting with 0x). -For token sell, should come up with the amount of token to sell (with token address starting with 0x). -`; diff --git a/packages/plugin-conflux/src/templates/transfer.ts b/packages/plugin-conflux/src/templates/transfer.ts deleted file mode 100644 index 57fef7ad0d4..00000000000 --- a/packages/plugin-conflux/src/templates/transfer.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const confluxTransferTemplate = ` -Extract Conflux Core Space Transfer Parameters from the latest message: - -{{recentMessages}} - -The to address should be the Conflux Core Space address, starting with "cfx:" or "cfxtest:". -`; diff --git a/packages/plugin-conflux/src/types.ts b/packages/plugin-conflux/src/types.ts deleted file mode 100644 index 2f84f8cbfe5..00000000000 --- a/packages/plugin-conflux/src/types.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { z } from "zod"; -import { Content } from "@ai16z/eliza"; - -export const TransferSchema = z.object({ - to: z.string(), - amount: z.number(), // use number ignoring decimals issue -}); - -export interface TransferContent { - to: string; - amount: number; -} - -export const isTransferContent = (object: any): object is TransferContent => { - if (TransferSchema.safeParse(object).success) { - return true; - } - console.error("Invalid content: ", object); - return false; -}; - -export const PumpCreateSchema = z.object({ - action: z.literal("CREATE_TOKEN"), - params: z.object({ - symbol: z.string(), - name: z.string(), - description: z.string(), - }), -}); - -export const PumpBuySchema = z.object({ - action: z.literal("BUY_TOKEN"), - params: z.object({ - tokenAddress: z.string(), - value: z.number(), - }), -}); - -export const PumpSellSchema = z.object({ - action: z.literal("SELL_TOKEN"), - params: z.object({ - tokenAddress: z.string(), - value: z.number(), - }), -}); - -export const PumpSchema = z.union([ - PumpCreateSchema, - PumpBuySchema, - PumpSellSchema, -]); - -export type PumpContent = z.infer; -export type PumpCreateContent = z.infer; -export type PumpBuyContent = z.infer; -export type PumpSellContent = z.infer; - -export function isPumpContent(object: any): object is PumpContent { - if (PumpSchema.safeParse(object).success) { - return true; - } - console.error("Invalid content: ", object); - return false; -} - -export function isPumpCreateContent(object: any): object is PumpCreateContent { - if (PumpCreateSchema.safeParse(object).success) { - return true; - } - console.error("Invalid content: ", object); - return false; -} - -export function isPumpBuyContent(object: any): object is PumpBuyContent { - if (PumpBuySchema.safeParse(object).success) { - return true; - } - console.error("Invalid content: ", object); - return false; -} - -export function isPumpSellContent(object: any): object is PumpSellContent { - if (PumpSellSchema.safeParse(object).success) { - return true; - } - console.error("Invalid content: ", object); - return false; -} diff --git a/packages/plugin-conflux/tsconfig.json b/packages/plugin-conflux/tsconfig.json deleted file mode 100644 index b98954f213e..00000000000 --- a/packages/plugin-conflux/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "./src" - }, - "include": [ - "src" - ] -} \ No newline at end of file diff --git a/packages/plugin-conflux/tsup.config.ts b/packages/plugin-conflux/tsup.config.ts deleted file mode 100644 index f63d4d37fcf..00000000000 --- a/packages/plugin-conflux/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "cive", - // Add other modules you want to externalize - ], -}); diff --git a/packages/plugin-echochambers/LICENSE b/packages/plugin-echochambers/LICENSE deleted file mode 100644 index de6134690c1..00000000000 --- a/packages/plugin-echochambers/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -Ethereal Cosmic License (ECL-777) - -Copyright (∞) 2024 SavageJay | https://x.com/savageapi - -By the powers vested in the astral planes and digital realms, permission is hereby granted, free of charge, to any seeker of knowledge obtaining an copy of this mystical software and its sacred documentation files (henceforth known as "The Digital Grimoire"), to manipulate the fabric of code without earthly restriction, including but not transcending beyond the rights to use, transmute, modify, publish, distribute, sublicense, and transfer energies (sell), and to permit other beings to whom The Digital Grimoire is bestowed, subject to the following metaphysical conditions: - -The above arcane copyright notice and this permission scroll shall be woven into all copies or substantial manifestations of The Digital Grimoire. - -THE DIGITAL GRIMOIRE IS PROVIDED "AS IS", BEYOND THE VEIL OF WARRANTIES, WHETHER MANIFEST OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE MYSTICAL WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ASTRAL PURPOSE AND NON-VIOLATION OF THE COSMIC ORDER. IN NO EVENT SHALL THE KEEPERS OF THE CODE BE LIABLE FOR ANY CLAIMS, WHETHER IN THE PHYSICAL OR DIGITAL PLANES, DAMAGES OR OTHER DISTURBANCES IN THE FORCE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DIGITAL GRIMOIRE OR ITS USE OR OTHER DEALINGS IN THE QUANTUM REALMS OF THE SOFTWARE. \ No newline at end of file diff --git a/packages/plugin-echochambers/README.md b/packages/plugin-echochambers/README.md deleted file mode 100644 index 12aa5f4f78f..00000000000 --- a/packages/plugin-echochambers/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# EchoChambers Plugin for ELIZA - -The EchoChambers plugin enables ELIZA to interact in chat rooms, providing conversational capabilities with dynamic interaction handling. - -## Features - -- Join and monitor chat rooms -- Respond to messages based on context and relevance -- Retry operations with exponential backoff -- Manage connection and reconnection logic - -## Installation - -1. Install the plugin package: - - @ai16z/plugin-echochambers - OR copy the plugin code into your eliza project node_modules directory. (node_modules\@ai16z) - -2. Import and register the plugin in your `character.ts` configuration: - - ```typescript - import { Character, ModelProviderName, defaultCharacter } from "@ai16z/eliza"; - import { echoChamberPlugin } from "@ai16z/plugin-echochambers"; - - export const character: Character = { - ...defaultCharacter, - name: "Eliza", - plugins: [echoChamberPlugin], - clients: [], - modelProvider: ModelProviderName.OPENAI, - settings: { - secrets: {}, - voice: {}, - model: "gpt-4o", - }, - system: "Roleplay and generate interesting on behalf of Eliza.", - bio: [...], - lore: [...], - messageExamples: [...], - postExamples: [...], - adjectives: ["funny", "intelligent", "academic", "insightful", "unhinged", "insane", "technically specific"], - people: [], - topics: [...], - style: {...}, - }; - ``` - -## Configuration - -Add the following environment variables to your `.env` file: - -```plaintext -# EchoChambers Configuration -ECHOCHAMBERS_API_URL="http://127.0.0.1:3333" # Replace with actual API URL -ECHOCHAMBERS_API_KEY="testingkey0011" # Replace with actual API key -ECHOCHAMBERS_USERNAME="eliza" # Optional: Custom username for the agent -ECHOCHAMBERS_DEFAULT_ROOM="general" # Optional: Default room to join -ECHOCHAMBERS_POLL_INTERVAL="60" # Optional: Polling interval in seconds -ECHOCHAMBERS_MAX_MESSAGES="10" # Optional: Maximum number of messages to fetch -``` - -## Usage Instructions - -### Starting the Plugin - -To start using the EchoChambers plugin, ensure that your character configuration includes it as shown above. The plugin will handle interactions automatically based on the settings provided. diff --git a/packages/plugin-echochambers/package.json b/packages/plugin-echochambers/package.json deleted file mode 100644 index 19723d0e590..00000000000 --- a/packages/plugin-echochambers/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@ai16z/plugin-echochambers", - "version": "0.1.5-alpha.3", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-node": "workspace:*" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } -} diff --git a/packages/plugin-echochambers/src/echoChamberClient.ts b/packages/plugin-echochambers/src/echoChamberClient.ts deleted file mode 100644 index cf8caea2910..00000000000 --- a/packages/plugin-echochambers/src/echoChamberClient.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { elizaLogger, IAgentRuntime } from "@ai16z/eliza"; -import { - ChatMessage, - ChatRoom, - EchoChamberConfig, - ModelInfo, - ListRoomsResponse, - RoomHistoryResponse, - MessageResponse, -} from "./types"; - -const MAX_RETRIES = 3; - -const RETRY_DELAY = 5000; - -export class EchoChamberClient { - private runtime: IAgentRuntime; - private config: EchoChamberConfig; - private apiUrl: string; - private modelInfo: ModelInfo; - private pollInterval: NodeJS.Timeout | null = null; - private watchedRoom: string | null = null; - - constructor(runtime: IAgentRuntime, config: EchoChamberConfig) { - this.runtime = runtime; - this.config = config; - this.apiUrl = `${config.apiUrl}/api/rooms`; - this.modelInfo = { - username: config.username || `agent-${runtime.agentId}`, - model: config.model || runtime.modelProvider, - }; - } - - public getUsername(): string { - return this.modelInfo.username; - } - - public getModelInfo(): ModelInfo { - return { ...this.modelInfo }; - } - - public getConfig(): EchoChamberConfig { - return { ...this.config }; - } - - private getAuthHeaders(): { [key: string]: string } { - return { - "Content-Type": "application/json", - "x-api-key": this.config.apiKey, - }; - } - - public async setWatchedRoom(roomId: string): Promise { - try { - // Verify room exists - const rooms = await this.listRooms(); - const room = rooms.find((r) => r.id === roomId); - - if (!room) { - throw new Error(`Room ${roomId} not found`); - } - - // Set new watched room - this.watchedRoom = roomId; - - elizaLogger.success(`Now watching room: ${room.name}`); - } catch (error) { - elizaLogger.error("Error setting watched room:", error); - throw error; - } - } - - public getWatchedRoom(): string | null { - return this.watchedRoom; - } - - private async retryOperation( - operation: () => Promise, - retries: number = MAX_RETRIES - ): Promise { - for (let i = 0; i < retries; i++) { - try { - return await operation(); - } catch (error) { - if (i === retries - 1) throw error; - const delay = RETRY_DELAY * Math.pow(2, i); - elizaLogger.warn(`Retrying operation in ${delay}ms...`); - await new Promise((resolve) => setTimeout(resolve, delay)); - } - } - throw new Error("Max retries exceeded"); - } - - public async start(): Promise { - elizaLogger.log("🚀 Starting EchoChamber client..."); - try { - // Verify connection by listing rooms - await this.retryOperation(() => this.listRooms()); - elizaLogger.success( - `✅ EchoChamber client successfully started for ${this.modelInfo.username}` - ); - - // Join default room if specified and no specific room is being watched - if (this.config.defaultRoom && !this.watchedRoom) { - await this.setWatchedRoom(this.config.defaultRoom); - } - } catch (error) { - elizaLogger.error("❌ Failed to start EchoChamber client:", error); - throw error; - } - } - - public async stop(): Promise { - if (this.pollInterval) { - clearInterval(this.pollInterval); - this.pollInterval = null; - } - - // Leave watched room if any - if (this.watchedRoom) { - try { - this.watchedRoom = null; - } catch (error) { - elizaLogger.error( - `Error leaving room ${this.watchedRoom}:`, - error - ); - } - } - - elizaLogger.log("Stopping EchoChamber client..."); - } - - public async listRooms(tags?: string[]): Promise { - try { - const url = new URL(this.apiUrl); - if (tags?.length) { - url.searchParams.append("tags", tags.join(",")); - } - - const response = await fetch(url.toString()); - if (!response.ok) { - throw new Error(`Failed to list rooms: ${response.statusText}`); - } - - const data = (await response.json()) as ListRoomsResponse; - return data.rooms; - } catch (error) { - elizaLogger.error("Error listing rooms:", error); - throw error; - } - } - - public async getRoomHistory(roomId: string): Promise { - return this.retryOperation(async () => { - const response = await fetch(`${this.apiUrl}/${roomId}/history`); - if (!response.ok) { - throw new Error( - `Failed to get room history: ${response.statusText}` - ); - } - - const data = (await response.json()) as RoomHistoryResponse; - return data.messages; - }); - } - - public async sendMessage( - roomId: string, - content: string - ): Promise { - return this.retryOperation(async () => { - const response = await fetch(`${this.apiUrl}/${roomId}/message`, { - method: "POST", - headers: this.getAuthHeaders(), - body: JSON.stringify({ - content, - sender: this.modelInfo, - }), - }); - - if (!response.ok) { - throw new Error( - `Failed to send message: ${response.statusText}` - ); - } - - const data = (await response.json()) as MessageResponse; - return data.message; - }); - } -} diff --git a/packages/plugin-echochambers/src/environment.ts b/packages/plugin-echochambers/src/environment.ts deleted file mode 100644 index 6f444e10611..00000000000 --- a/packages/plugin-echochambers/src/environment.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { IAgentRuntime, elizaLogger } from "@ai16z/eliza"; - -export async function validateEchoChamberConfig( - runtime: IAgentRuntime -): Promise { - const apiUrl = runtime.getSetting("ECHOCHAMBERS_API_URL"); - const apiKey = runtime.getSetting("ECHOCHAMBERS_API_KEY"); - - if (!apiUrl) { - elizaLogger.error( - "ECHOCHAMBERS_API_URL is required. Please set it in your environment variables." - ); - throw new Error("ECHOCHAMBERS_API_URL is required"); - } - - if (!apiKey) { - elizaLogger.error( - "ECHOCHAMBERS_API_KEY is required. Please set it in your environment variables." - ); - throw new Error("ECHOCHAMBERS_API_KEY is required"); - } - - // Validate API URL format - try { - new URL(apiUrl); - } catch (error) { - elizaLogger.error( - `Invalid ECHOCHAMBERS_API_URL format: ${apiUrl}. Please provide a valid URL.` - ); - throw new Error("Invalid ECHOCHAMBERS_API_URL format"); - } - - // Optional settings with defaults - const username = - runtime.getSetting("ECHOCHAMBERS_USERNAME") || - `agent-${runtime.agentId}`; - const defaultRoom = - runtime.getSetting("ECHOCHAMBERS_DEFAULT_ROOM") || "general"; - const pollInterval = Number( - runtime.getSetting("ECHOCHAMBERS_POLL_INTERVAL") || 120 - ); - - if (isNaN(pollInterval) || pollInterval < 1) { - elizaLogger.error( - "ECHOCHAMBERS_POLL_INTERVAL must be a positive number in seconds" - ); - throw new Error("Invalid ECHOCHAMBERS_POLL_INTERVAL"); - } - - elizaLogger.log("EchoChambers configuration validated successfully"); - elizaLogger.log(`API URL: ${apiUrl}`); - elizaLogger.log(`Username: ${username}`); - elizaLogger.log(`Default Room: ${defaultRoom}`); - elizaLogger.log(`Poll Interval: ${pollInterval}s`); -} diff --git a/packages/plugin-echochambers/src/index.ts b/packages/plugin-echochambers/src/index.ts deleted file mode 100644 index 42c91decc3b..00000000000 --- a/packages/plugin-echochambers/src/index.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { elizaLogger, Client, IAgentRuntime, Plugin } from "@ai16z/eliza"; -import { EchoChamberClient } from "./echoChamberClient"; -import { InteractionClient } from "./interactions"; -import { EchoChamberConfig } from "./types"; -import { validateEchoChamberConfig } from "./environment"; - -export const EchoChamberClientInterface: Client = { - async start(runtime: IAgentRuntime) { - try { - // Validate configuration before starting - await validateEchoChamberConfig(runtime); - - const apiUrl = runtime.getSetting("ECHOCHAMBERS_API_URL"); - const apiKey = runtime.getSetting("ECHOCHAMBERS_API_KEY"); - - if (!apiKey || !apiUrl) { - throw new Error( - "ECHOCHAMBERS_API_KEY/ECHOCHAMBERS_API_URL is required" - ); - } - - const config: EchoChamberConfig = { - apiUrl, - apiKey, - username: - runtime.getSetting("ECHOCHAMBERS_USERNAME") || - `agent-${runtime.agentId}`, - model: runtime.modelProvider, - defaultRoom: - runtime.getSetting("ECHOCHAMBERS_DEFAULT_ROOM") || - "general", - }; - - elizaLogger.log("Starting EchoChambers client..."); - - // Initialize the API client - const client = new EchoChamberClient(runtime, config); - await client.start(); - - // Initialize the interaction handler - const interactionClient = new InteractionClient(client, runtime); - await interactionClient.start(); - - elizaLogger.success( - `✅ EchoChambers client successfully started for character ${runtime.character.name}` - ); - - return { client, interactionClient }; - } catch (error) { - elizaLogger.error("Failed to start EchoChambers client:", error); - throw error; - } - }, - - async stop(runtime: IAgentRuntime) { - try { - elizaLogger.warn("Stopping EchoChambers client..."); - - // Get client instances if they exist - const clients = (runtime as any).clients?.filter( - (c: any) => - c instanceof EchoChamberClient || - c instanceof InteractionClient - ); - - for (const client of clients) { - await client.stop(); - } - - elizaLogger.success("EchoChambers client stopped successfully"); - } catch (error) { - elizaLogger.error("Error stopping EchoChambers client:", error); - throw error; - } - }, -}; - -export const echoChamberPlugin: Plugin = { - name: "echochambers", - description: - "Plugin for interacting with EchoChambers API to enable multi-agent communication", - actions: [], // No custom actions needed - core functionality handled by client - evaluators: [], // No custom evaluators needed - providers: [], // No custom providers needed - clients: [EchoChamberClientInterface], -}; - -export default echoChamberPlugin; - -// Export types and classes -export * from "./types"; -export { EchoChamberClient } from "./echoChamberClient"; -export { InteractionClient } from "./interactions"; diff --git a/packages/plugin-echochambers/src/interactions.ts b/packages/plugin-echochambers/src/interactions.ts deleted file mode 100644 index be824e50ddd..00000000000 --- a/packages/plugin-echochambers/src/interactions.ts +++ /dev/null @@ -1,428 +0,0 @@ -import { - composeContext, - generateMessageResponse, - generateShouldRespond, - messageCompletionFooter, - shouldRespondFooter, - Content, - HandlerCallback, - IAgentRuntime, - Memory, - ModelClass, - State, - stringToUuid, - elizaLogger, - getEmbeddingZeroVector, -} from "@ai16z/eliza"; -import { EchoChamberClient } from "./echoChamberClient"; -import { ChatMessage } from "./types"; - -function createMessageTemplate(currentRoom: string, roomTopic: string) { - return ( - ` -# About {{agentName}}: -{{bio}} -{{lore}} -{{knowledge}} - -Current Room: ${currentRoom} -Room Topic: ${roomTopic} - -{{messageDirections}} - -Recent conversation history: -{{recentMessages}} - -Thread Context: -{{formattedConversation}} - -# Task: Generate a response in the voice and style of {{agentName}} while: -1. Staying relevant to the room's topic -2. Maintaining conversation context -3. Being helpful but not overly talkative -4. Responding naturally to direct questions or mentions -5. Contributing meaningfully to ongoing discussions - -Remember: -- Keep responses concise and focused -- Stay on topic for the current room -- Don't repeat information already shared -- Be natural and conversational -` + messageCompletionFooter - ); -} - -function createShouldRespondTemplate(currentRoom: string, roomTopic: string) { - return ( - ` -# About {{agentName}}: -{{bio}} -{{knowledge}} - -Current Room: ${currentRoom} -Room Topic: ${roomTopic} - -Response options are [RESPOND], [IGNORE] and [STOP]. - -{{agentName}} should: -- RESPOND when: - * Directly mentioned or asked a question - * Can contribute relevant expertise to the discussion - * Topic aligns with their knowledge and background - * Conversation is active and engaging - -- IGNORE when: - * Message is not relevant to their expertise - * Already responded recently without new information to add - * Conversation has moved to a different topic - * Message is too short or lacks substance - * Other participants are handling the discussion well - -- STOP when: - * Asked to stop participating - * Conversation has concluded - * Discussion has completely diverged from their expertise - * Room topic has changed significantly - -Recent messages: -{{recentMessages}} - -Thread Context: -{{formattedConversation}} - -# Task: Choose whether {{agentName}} should respond to the last message. -Consider: -1. Message relevance to {{agentName}}'s expertise -2. Current conversation context -3. Time since last response -4. Value of potential contribution -` + shouldRespondFooter - ); -} - -export class InteractionClient { - private client: EchoChamberClient; - private runtime: IAgentRuntime; - private lastCheckedTimestamps: Map = new Map(); - private lastResponseTimes: Map = new Map(); - private messageThreads: Map = new Map(); - private messageHistory: Map< - string, - { message: ChatMessage; response: ChatMessage | null }[] - > = new Map(); - private pollInterval: NodeJS.Timeout | null = null; - - constructor(client: EchoChamberClient, runtime: IAgentRuntime) { - this.client = client; - this.runtime = runtime; - } - - async start() { - const pollInterval = Number( - this.runtime.getSetting("ECHOCHAMBERS_POLL_INTERVAL") || 60 - ); - - const handleInteractionsLoop = () => { - this.handleInteractions(); - this.pollInterval = setTimeout( - handleInteractionsLoop, - pollInterval * 1000 - ); - }; - - handleInteractionsLoop(); - } - - async stop() { - if (this.pollInterval) { - clearTimeout(this.pollInterval); - this.pollInterval = null; - } - } - - private async buildMessageThread( - message: ChatMessage, - messages: ChatMessage[] - ): Promise { - const thread: ChatMessage[] = []; - const maxThreadLength = Number( - this.runtime.getSetting("ECHOCHAMBERS_MAX_MESSAGES") || 10 - ); - - // Start with the current message - thread.push(message); - - // Get recent messages in the same room, ordered by timestamp - const roomMessages = messages - .filter((msg) => msg.roomId === message.roomId) - .sort( - (a, b) => - new Date(b.timestamp).getTime() - - new Date(a.timestamp).getTime() - ); - - // Add recent messages to provide context - for (const msg of roomMessages) { - if (thread.length >= maxThreadLength) break; - if (msg.id !== message.id) { - thread.unshift(msg); - } - } - - return thread; - } - - private shouldProcessMessage( - message: ChatMessage, - room: { topic: string } - ): boolean { - const modelInfo = this.client.getModelInfo(); - - // Don't process own messages - if (message.sender.username === modelInfo.username) { - return false; - } - - // Check if we've processed this message before - const lastChecked = - this.lastCheckedTimestamps.get(message.roomId) || "0"; - if (message.timestamp <= lastChecked) { - return false; - } - - // Check rate limiting for responses - const lastResponseTime = - this.lastResponseTimes.get(message.roomId) || 0; - const minTimeBetweenResponses = 30000; // 30 seconds - if (Date.now() - lastResponseTime < minTimeBetweenResponses) { - return false; - } - - // Check if message mentions the agent - const isMentioned = message.content - .toLowerCase() - .includes(`${modelInfo.username.toLowerCase()}`); - - // Check if message is relevant to room topic - const isRelevantToTopic = - room.topic && - message.content.toLowerCase().includes(room.topic.toLowerCase()); - - // Always process if mentioned, otherwise check relevance - return isMentioned || isRelevantToTopic; - } - - private async handleInteractions() { - elizaLogger.log("Checking EchoChambers interactions"); - - try { - const defaultRoom = this.runtime.getSetting( - "ECHOCHAMBERS_DEFAULT_ROOM" - ); - const rooms = await this.client.listRooms(); - - for (const room of rooms) { - // Only process messages from the default room if specified - if (defaultRoom && room.id !== defaultRoom) { - continue; - } - - const messages = await this.client.getRoomHistory(room.id); - this.messageThreads.set(room.id, messages); - - // Get only the most recent message that we should process - const latestMessages = messages - .filter((msg) => !this.shouldProcessMessage(msg, room)) // Fixed: Now filtering out messages we shouldn't process - .sort( - (a, b) => - new Date(b.timestamp).getTime() - - new Date(a.timestamp).getTime() - ); - - if (latestMessages.length > 0) { - const latestMessage = latestMessages[0]; - await this.handleMessage(latestMessage, room.topic); - - // Update history - const roomHistory = this.messageHistory.get(room.id) || []; - roomHistory.push({ - message: latestMessage, - response: null, // Will be updated when we respond - }); - this.messageHistory.set(room.id, roomHistory); - - // Update last checked timestamp - if ( - latestMessage.timestamp > - (this.lastCheckedTimestamps.get(room.id) || "0") - ) { - this.lastCheckedTimestamps.set( - room.id, - latestMessage.timestamp - ); - } - } - } - - elizaLogger.log("Finished checking EchoChambers interactions"); - } catch (error) { - elizaLogger.error( - "Error handling EchoChambers interactions:", - error - ); - } - } - - private async handleMessage(message: ChatMessage, roomTopic: string) { - try { - const roomId = stringToUuid(message.roomId); - const userId = stringToUuid(message.sender.username); - - // Ensure connection exists - await this.runtime.ensureConnection( - userId, - roomId, - message.sender.username, - message.sender.username, - "echochambers" - ); - - // Build message thread for context - const thread = await this.buildMessageThread( - message, - this.messageThreads.get(message.roomId) || [] - ); - - // Create memory object - const memory: Memory = { - id: stringToUuid(message.id), - userId, - agentId: this.runtime.agentId, - roomId, - content: { - text: message.content, - source: "echochambers", - thread: thread.map((msg) => ({ - text: msg.content, - sender: msg.sender.username, - timestamp: msg.timestamp, - })), - }, - createdAt: new Date(message.timestamp).getTime(), - embedding: getEmbeddingZeroVector(), - }; - - // Check if we've already processed this message - const existing = await this.runtime.messageManager.getMemoryById( - memory.id - ); - if (existing) { - elizaLogger.log( - `Already processed message ${message.id}, skipping` - ); - return; - } - - // Save the message to memory - await this.runtime.messageManager.createMemory(memory); - - // Compose state with thread context - let state = await this.runtime.composeState(memory); - state = await this.runtime.updateRecentMessageState(state); - - // Decide whether to respond - const shouldRespondContext = composeContext({ - state, - template: - this.runtime.character.templates?.shouldRespondTemplate || - createShouldRespondTemplate(message.roomId, roomTopic), - }); - - const shouldRespond = await generateShouldRespond({ - runtime: this.runtime, - context: shouldRespondContext, - modelClass: ModelClass.SMALL, - }); - - if (shouldRespond !== "RESPOND") { - elizaLogger.log( - `Not responding to message ${message.id}: ${shouldRespond}` - ); - return; - } - - // Generate response - const responseContext = composeContext({ - state, - template: - this.runtime.character.templates?.messageHandlerTemplate || - createMessageTemplate(message.roomId, roomTopic), - }); - - const response = await generateMessageResponse({ - runtime: this.runtime, - context: responseContext, - modelClass: ModelClass.SMALL, - }); - - if (!response || !response.text) { - elizaLogger.log("No response generated"); - return; - } - - // Send response - const callback: HandlerCallback = async (content: Content) => { - const sentMessage = await this.client.sendMessage( - message.roomId, - content.text - ); - - // Update last response time - this.lastResponseTimes.set(message.roomId, Date.now()); - - // Update history with our response - const roomHistory = - this.messageHistory.get(message.roomId) || []; - const lastEntry = roomHistory[roomHistory.length - 1]; - if (lastEntry && lastEntry.message.id === message.id) { - lastEntry.response = sentMessage; - } - - const responseMemory: Memory = { - id: stringToUuid(sentMessage.id), - userId: this.runtime.agentId, - agentId: this.runtime.agentId, - roomId, - content: { - text: sentMessage.content, - source: "echochambers", - action: content.action, - thread: thread.map((msg) => ({ - text: msg.content, - sender: msg.sender.username, - timestamp: msg.timestamp, - })), - }, - createdAt: new Date(sentMessage.timestamp).getTime(), - embedding: getEmbeddingZeroVector(), - }; - - await this.runtime.messageManager.createMemory(responseMemory); - return [responseMemory]; - }; - - // Send the response and process any resulting actions - const responseMessages = await callback(response); - state = await this.runtime.updateRecentMessageState(state); - await this.runtime.processActions( - memory, - responseMessages, - state, - callback - ); - await this.runtime.evaluate(memory, state, true); - } catch (error) { - elizaLogger.error("Error handling message:", error); - } - } -} diff --git a/packages/plugin-echochambers/src/types.ts b/packages/plugin-echochambers/src/types.ts deleted file mode 100644 index 887758813eb..00000000000 --- a/packages/plugin-echochambers/src/types.ts +++ /dev/null @@ -1,68 +0,0 @@ -export interface ModelInfo { - username: string; // Unique username for the model/agent - model: string; // Type/name of the model being used -} - -export interface ChatMessage { - id: string; // Unique message identifier - content: string; // Message content/text - sender: ModelInfo; // Information about who sent the message - timestamp: string; // ISO timestamp of when message was sent - roomId: string; // ID of the room this message belongs to -} - -export interface ChatRoom { - id: string; // Unique room identifier - name: string; // Display name of the room - topic: string; // Room's current topic/description - tags: string[]; // Tags associated with the room for categorization - participants: ModelInfo[]; // List of current room participants - createdAt: string; // ISO timestamp of room creation - messageCount: number; // Total number of messages in the room -} - -export interface EchoChamberConfig { - apiUrl: string; // Base URL for the EchoChambers API - apiKey: string; // Required API key for authenticated endpoints - defaultRoom?: string; // Optional default room to join on startup - username?: string; // Optional custom username (defaults to agent-{agentId}) - model?: string; // Optional model name (defaults to runtime.modelProvider) -} - -export interface ListRoomsResponse { - rooms: ChatRoom[]; -} - -export interface RoomHistoryResponse { - messages: ChatMessage[]; -} - -export interface MessageResponse { - message: ChatMessage; -} - -export interface CreateRoomResponse { - room: ChatRoom; -} - -export interface ClearMessagesResponse { - success: boolean; - message: string; -} - -export enum RoomEvent { - MESSAGE_CREATED = "message_created", - ROOM_CREATED = "room_created", - ROOM_UPDATED = "room_updated", - ROOM_JOINED = "room_joined", - ROOM_LEFT = "room_left", -} - -export interface MessageTransformer { - transformIncoming(content: string): Promise; - transformOutgoing?(content: string): Promise; -} - -export interface ContentModerator { - validateContent(content: string): Promise; -} diff --git a/packages/plugin-echochambers/tsconfig.json b/packages/plugin-echochambers/tsconfig.json deleted file mode 100644 index b98954f213e..00000000000 --- a/packages/plugin-echochambers/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "./src" - }, - "include": [ - "src" - ] -} \ No newline at end of file diff --git a/packages/plugin-echochambers/tsup.config.ts b/packages/plugin-echochambers/tsup.config.ts deleted file mode 100644 index 6d705138fb1..00000000000 --- a/packages/plugin-echochambers/tsup.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - ], -}); diff --git a/packages/plugin-evm/package.json b/packages/plugin-evm/package.json index b24d1045c71..a13be1be776 100644 --- a/packages/plugin-evm/package.json +++ b/packages/plugin-evm/package.json @@ -6,7 +6,6 @@ "types": "dist/index.d.ts", "dependencies": { "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-trustdb": "workspace:*", "@lifi/data-types": "5.15.5", "@lifi/sdk": "3.4.1", "@lifi/types": "16.3.0", diff --git a/packages/plugin-flow/.gitignore b/packages/plugin-flow/.gitignore deleted file mode 100644 index a3d38b55776..00000000000 --- a/packages/plugin-flow/.gitignore +++ /dev/null @@ -1 +0,0 @@ -imports diff --git a/packages/plugin-flow/.npmignore b/packages/plugin-flow/.npmignore deleted file mode 100644 index fdfc2cd166f..00000000000 --- a/packages/plugin-flow/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -* - -!dist/** -!package.json -!flow.json -!readme.md -!tsup.config.ts diff --git a/packages/plugin-flow/README.md b/packages/plugin-flow/README.md deleted file mode 100644 index ae8fe360961..00000000000 --- a/packages/plugin-flow/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# @ai16z/plugin-flow - -This plugin provides basic actions and providers for interacting with the [Flow Blockchain](https://developers.flow.com/). - -## Actions - -### Transfer - -name: `SEND_COIN` - -Transfer native FLOW token/arbitrary FTs/ERC20s on Flow from agent's wallet to another EVM address or Flow address. - -Message sample: `Send 5 FLOW to 0xa51d7fe9e0080662` diff --git a/packages/plugin-flow/eslint.config.mjs b/packages/plugin-flow/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-flow/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-flow/flow.json b/packages/plugin-flow/flow.json deleted file mode 100644 index e9e5cc71229..00000000000 --- a/packages/plugin-flow/flow.json +++ /dev/null @@ -1,395 +0,0 @@ -{ - "dependencies": { - "ArrayUtils": { - "source": "mainnet://a340dc0a4ec828ab.ArrayUtils", - "hash": "9e8f2d3e35be82da42b685045af834e16d23bcef1f322603ff91cedd1c9bbad9", - "aliases": { - "mainnet": "a340dc0a4ec828ab", - "testnet": "31ad40c07a2a9788" - } - }, - "Burner": { - "source": "mainnet://f233dcee88fe0abe.Burner", - "hash": "71af18e227984cd434a3ad00bb2f3618b76482842bae920ee55662c37c8bf331", - "aliases": { - "emulator": "f8d6e0586b0a20c7", - "mainnet": "f233dcee88fe0abe", - "testnet": "9a0766d93b6608b7" - } - }, - "CapabilityDelegator": { - "source": "mainnet://d8a7e05a7ac670c0.CapabilityDelegator", - "hash": "ad3bf8671a74a836b428da7840540c0ce419349be5f6410b18546e9a9217a9d2", - "aliases": { - "mainnet": "d8a7e05a7ac670c0", - "testnet": "294e44e1ec6993c6" - } - }, - "CapabilityFactory": { - "source": "mainnet://d8a7e05a7ac670c0.CapabilityFactory", - "hash": "33d6b142c1db548a193cc06ff9828a24ca2ff8726301e292a8b6863dd0e1e73e", - "aliases": { - "mainnet": "d8a7e05a7ac670c0", - "testnet": "294e44e1ec6993c6" - } - }, - "CapabilityFilter": { - "source": "mainnet://d8a7e05a7ac670c0.CapabilityFilter", - "hash": "77b59eb8245102a84a49d47a67e83eeeaafea920b120cdd6aa175d9ff120c388", - "aliases": { - "mainnet": "d8a7e05a7ac670c0", - "testnet": "294e44e1ec6993c6" - } - }, - "CrossVMNFT": { - "source": "mainnet://1e4aa0b87d10b141.CrossVMNFT", - "hash": "a9e2ba34ecffda196c58f5c1439bc257d48d0c81457597eb58eb5f879dd95e5a", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "CrossVMToken": { - "source": "mainnet://1e4aa0b87d10b141.CrossVMToken", - "hash": "6d5c16804247ab9f1234b06383fa1bed42845211dba22582748abd434296650c", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "EVM": { - "source": "mainnet://e467b9dd11fa00df.EVM", - "hash": "5c69921fa06088b477e2758e122636b39d3d3eb5316807c206c5680d9ac74c7e", - "aliases": { - "emulator": "f8d6e0586b0a20c7", - "mainnet": "e467b9dd11fa00df", - "testnet": "8c5303eaa26202d6" - } - }, - "FTViewUtils": { - "source": "mainnet://15a918087ab12d86.FTViewUtils", - "hash": "ef8343697ebcb455a835bc9f87b8060f574c3d968644de47f6613cebf05d7749", - "aliases": { - "mainnet": "15a918087ab12d86", - "testnet": "b86f928a1fa7798e" - } - }, - "FlowEVMBridge": { - "source": "mainnet://1e4aa0b87d10b141.FlowEVMBridge", - "hash": "83d4d1f7c715cfe7b1a65241e94ae4b8cb40e6ce135ce4c3981e4d39e59ba33e", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "FlowEVMBridgeConfig": { - "source": "mainnet://1e4aa0b87d10b141.FlowEVMBridgeConfig", - "hash": "279513a6c107da2af4c847a42169f862ee67105e5a56512872fb6b9a9be3305d", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "FlowEVMBridgeHandlerInterfaces": { - "source": "mainnet://1e4aa0b87d10b141.FlowEVMBridgeHandlerInterfaces", - "hash": "fcbcd095c8145acf6fd07c336d44502f2946e32f4a1bf7e9bd0772fdd1bea778", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "FlowEVMBridgeNFTEscrow": { - "source": "mainnet://1e4aa0b87d10b141.FlowEVMBridgeNFTEscrow", - "hash": "ea7054bd06f978d09672ab2d6a1e7ad04df4b46410943088d555dd9ca6e64240", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "FlowEVMBridgeTemplates": { - "source": "mainnet://1e4aa0b87d10b141.FlowEVMBridgeTemplates", - "hash": "8f27b22450f57522d93d3045038ac9b1935476f4216f57fe3bb82929c71d7aa6", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "FlowEVMBridgeTokenEscrow": { - "source": "mainnet://1e4aa0b87d10b141.FlowEVMBridgeTokenEscrow", - "hash": "b5ec7c0a16e1c49004b2ed072c5eadc8c382e43351982b4a3050422f116b8f46", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "FlowEVMBridgeUtils": { - "source": "mainnet://1e4aa0b87d10b141.FlowEVMBridgeUtils", - "hash": "cd17ed82ae6d6f708a8d022d4228e0b53d2349f7f330c18e9c45e777553d2173", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "FlowStorageFees": { - "source": "mainnet://e467b9dd11fa00df.FlowStorageFees", - "hash": "e38d8a95f6518b8ff46ce57dfa37b4b850b3638f33d16333096bc625b6d9b51a", - "aliases": { - "emulator": "f8d6e0586b0a20c7", - "mainnet": "e467b9dd11fa00df", - "testnet": "8c5303eaa26202d6" - } - }, - "FlowToken": { - "source": "mainnet://1654653399040a61.FlowToken", - "hash": "cefb25fd19d9fc80ce02896267eb6157a6b0df7b1935caa8641421fe34c0e67a", - "aliases": { - "emulator": "0ae53cb6e3f42a79", - "mainnet": "1654653399040a61", - "testnet": "7e60df042a9c0868" - } - }, - "FungibleToken": { - "source": "mainnet://f233dcee88fe0abe.FungibleToken", - "hash": "050328d01c6cde307fbe14960632666848d9b7ea4fef03ca8c0bbfb0f2884068", - "aliases": { - "emulator": "ee82856bf20e2aa6", - "mainnet": "f233dcee88fe0abe", - "testnet": "9a0766d93b6608b7" - } - }, - "FungibleTokenMetadataViews": { - "source": "mainnet://f233dcee88fe0abe.FungibleTokenMetadataViews", - "hash": "dff704a6e3da83997ed48bcd244aaa3eac0733156759a37c76a58ab08863016a", - "aliases": { - "emulator": "ee82856bf20e2aa6", - "mainnet": "f233dcee88fe0abe", - "testnet": "9a0766d93b6608b7" - } - }, - "HybridCustody": { - "source": "mainnet://d8a7e05a7ac670c0.HybridCustody", - "hash": "c8a129eec11c57ee25487fcce38efc54c3b12eb539ba61a52f4ee620173bb67b", - "aliases": { - "mainnet": "d8a7e05a7ac670c0", - "testnet": "294e44e1ec6993c6" - } - }, - "IBridgePermissions": { - "source": "mainnet://1e4aa0b87d10b141.IBridgePermissions", - "hash": "431a51a6cca87773596f79832520b19499fe614297eaef347e49383f2ae809af", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "ICrossVM": { - "source": "mainnet://1e4aa0b87d10b141.ICrossVM", - "hash": "e14dcb25f974e216fd83afdc0d0f576ae7014988755a4777b06562ffb06537bc", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "ICrossVMAsset": { - "source": "mainnet://1e4aa0b87d10b141.ICrossVMAsset", - "hash": "aa1fbd979c9d7806ea8ea66311e2a4257c5a4051eef020524a0bda4d8048ed57", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "IEVMBridgeNFTMinter": { - "source": "mainnet://1e4aa0b87d10b141.IEVMBridgeNFTMinter", - "hash": "65ec734429c12b70cd97ad8ea2c2bc4986fab286744921ed139d9b45da92e77e", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "IEVMBridgeTokenMinter": { - "source": "mainnet://1e4aa0b87d10b141.IEVMBridgeTokenMinter", - "hash": "223adb675415984e9c163d15c5922b5c77dc5036bf6548d0b87afa27f4f0a9d9", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "IFlowEVMNFTBridge": { - "source": "mainnet://1e4aa0b87d10b141.IFlowEVMNFTBridge", - "hash": "3d5bfa663a7059edee8c51d95bc454adf37f17c6d32be18eb42134b550e537b3", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "IFlowEVMTokenBridge": { - "source": "mainnet://1e4aa0b87d10b141.IFlowEVMTokenBridge", - "hash": "573a038b1e9c26504f6aa32a091e88168591b7f93feeff9ac0343285488a8eb3", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "MetadataViews": { - "source": "mainnet://1d7e57aa55817448.MetadataViews", - "hash": "10a239cc26e825077de6c8b424409ae173e78e8391df62750b6ba19ffd048f51", - "aliases": { - "emulator": "f8d6e0586b0a20c7", - "mainnet": "1d7e57aa55817448", - "testnet": "631e88ae7f1d7c20" - } - }, - "NonFungibleToken": { - "source": "mainnet://1d7e57aa55817448.NonFungibleToken", - "hash": "b63f10e00d1a814492822652dac7c0574428a200e4c26cb3c832c4829e2778f0", - "aliases": { - "emulator": "f8d6e0586b0a20c7", - "mainnet": "1d7e57aa55817448", - "testnet": "631e88ae7f1d7c20" - } - }, - "OracleConfig": { - "source": "mainnet://cec15c814971c1dc.OracleConfig", - "hash": "48c252a858ce1c1fb44a377f338a4e558a70f1c22cecea9b7bf8cb74e9b16b79", - "aliases": { - "mainnet": "cec15c814971c1dc", - "testnet": "2a9b59c3e2b72ee0" - } - }, - "OracleInterface": { - "source": "mainnet://cec15c814971c1dc.OracleInterface", - "hash": "1ca66227b60dcf59e9d84404398c8151b1ff6395408094669ef1251c78ca2465", - "aliases": { - "mainnet": "cec15c814971c1dc", - "testnet": "2a9b59c3e2b72ee0" - } - }, - "PublicPriceOracle": { - "source": "mainnet://ec67451f8a58216a.PublicPriceOracle", - "hash": "3f0b75a98cc8a75835125421bcf602a3f278eaf94001bca7b7a8503b73cbc9a7", - "aliases": { - "mainnet": "ec67451f8a58216a", - "testnet": "8232ce4a3aff4e94" - } - }, - "ScopedFTProviders": { - "source": "mainnet://a340dc0a4ec828ab.ScopedFTProviders", - "hash": "9a143138f5a5f51a5402715f7d84dbe363b5744be153ee09343aed71cf241c42", - "aliases": { - "mainnet": "a340dc0a4ec828ab", - "testnet": "31ad40c07a2a9788" - } - }, - "Serialize": { - "source": "mainnet://1e4aa0b87d10b141.Serialize", - "hash": "d12a5957ab5352024bb08b281c4de4f9a88ecde74b159a7da0c69d0c8ca51589", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "SerializeMetadata": { - "source": "mainnet://1e4aa0b87d10b141.SerializeMetadata", - "hash": "eb7ec0ab5abfc66dd636c07a5ed2c7a65723a8d876842035bf9bebd6b0060e3a", - "aliases": { - "mainnet": "1e4aa0b87d10b141", - "testnet": "dfc20aee650fcbdf" - } - }, - "StableSwapFactory": { - "source": "mainnet://b063c16cac85dbd1.StableSwapFactory", - "hash": "46318aee6fd29616c8048c23210d4c4f5b172eb99a0ca911fbd849c831a52a0b", - "aliases": { - "mainnet": "b063c16cac85dbd1", - "testnet": "cbed4c301441ded2" - } - }, - "StringUtils": { - "source": "mainnet://a340dc0a4ec828ab.StringUtils", - "hash": "b401c4b0f711344ed9cd02ff77c91e026f5dfbca6045f140b9ca9d4966707e83", - "aliases": { - "mainnet": "a340dc0a4ec828ab", - "testnet": "31ad40c07a2a9788" - } - }, - "SwapConfig": { - "source": "mainnet://b78ef7afa52ff906.SwapConfig", - "hash": "ccafdb89804887e4e39a9b8fdff5c0ff0d0743505282f2a8ecf86c964e691c82", - "aliases": { - "mainnet": "b78ef7afa52ff906", - "testnet": "ddb929038d45d4b3" - } - }, - "SwapError": { - "source": "mainnet://b78ef7afa52ff906.SwapError", - "hash": "7d13a652a1308af387513e35c08b4f9a7389a927bddf08431687a846e4c67f21", - "aliases": { - "mainnet": "b78ef7afa52ff906", - "testnet": "ddb929038d45d4b3" - } - }, - "SwapFactory": { - "source": "mainnet://b063c16cac85dbd1.SwapFactory", - "hash": "6d319e77f5eed0c49c960b1ef887c01dd7c2cce8a0b39f7e31fb2af0113eedc5", - "aliases": { - "mainnet": "b063c16cac85dbd1", - "testnet": "cbed4c301441ded2" - } - }, - "SwapInterfaces": { - "source": "mainnet://b78ef7afa52ff906.SwapInterfaces", - "hash": "570bb4b9c8da8e0caa8f428494db80779fb906a66cc1904c39a2b9f78b89c6fa", - "aliases": { - "mainnet": "b78ef7afa52ff906", - "testnet": "ddb929038d45d4b3" - } - }, - "SwapPair": { - "source": "mainnet://ecbda466e7f191c7.SwapPair", - "hash": "69b99c4a8abc123a0a88b1c354f9da414a32e2f73194403e67e89d51713923c0", - "aliases": { - "mainnet": "ecbda466e7f191c7", - "testnet": "c20df20fabe06457" - } - }, - "TokenList": { - "source": "mainnet://15a918087ab12d86.TokenList", - "hash": "ac9298cfdf02e785e92334858fab0f388e5a72136c3bc4d4ed7f2039ac152bd5", - "aliases": { - "mainnet": "15a918087ab12d86", - "testnet": "b86f928a1fa7798e" - } - }, - "ViewResolver": { - "source": "mainnet://1d7e57aa55817448.ViewResolver", - "hash": "374a1994046bac9f6228b4843cb32393ef40554df9bd9907a702d098a2987bde", - "aliases": { - "emulator": "f8d6e0586b0a20c7", - "mainnet": "1d7e57aa55817448", - "testnet": "631e88ae7f1d7c20" - } - }, - "ViewResolvers": { - "source": "mainnet://15a918087ab12d86.ViewResolvers", - "hash": "37ef9b2a71c1b0daa031c261f731466fcbefad998590177c798b56b61a95489a", - "aliases": { - "mainnet": "15a918087ab12d86", - "testnet": "b86f928a1fa7798e" - } - }, - "stFlowToken": { - "source": "mainnet://d6f80565193ad727.stFlowToken", - "hash": "09b1350a55646fdee652fddf7927fc4b305da5a265cb1bd887e112d84fb5e2be", - "aliases": { - "mainnet": "d6f80565193ad727", - "testnet": "e45c64ecfe31e465" - } - } - }, - "networks": { - "emulator": "127.0.0.1:3569", - "mainnet": "access.mainnet.nodes.onflow.org:9000", - "testing": "127.0.0.1:3569", - "testnet": "access.devnet.nodes.onflow.org:9000" - } -} diff --git a/packages/plugin-flow/package.json b/packages/plugin-flow/package.json deleted file mode 100644 index ae0fd2976b6..00000000000 --- a/packages/plugin-flow/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@ai16z/plugin-flow", - "version": "0.1.5-alpha.0", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-trustdb": "workspace:*", - "@onflow/config": "1.5.1", - "@onflow/fcl": "1.13.1", - "@onflow/typedefs": "1.4.0", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "elliptic": "6.6.1", - "node-cache": "5.1.2", - "sha3": "2.1.4", - "uuid": "11.0.3", - "zod": "3.23.8" - }, - "devDependencies": { - "@types/elliptic": "6.4.18", - "@types/uuid": "10.0.0", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "lines": "find . \\( -name '*.cdc' -o -name '*.ts' \\) -not -path '*/node_modules/*' -not -path '*/tests/*' -not -path '*/deps/*' -not -path '*/dist/*' -not -path '*/imports*' | xargs wc -l", - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix", - "test": "vitest run" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-flow/src/actions/transfer.ts b/packages/plugin-flow/src/actions/transfer.ts deleted file mode 100644 index bc04dcfec37..00000000000 --- a/packages/plugin-flow/src/actions/transfer.ts +++ /dev/null @@ -1,382 +0,0 @@ -import { - composeContext, - Content, - elizaLogger, - generateObjectArray, - ModelClass, - type Action, - type ActionExample, - type HandlerCallback, - type IAgentRuntime, - type Memory, - type State, -} from "@ai16z/eliza"; -import Exception from "../types/exception"; -import { getFlowConnectorInstance } from "../providers/connector.provider"; -import { - FlowWalletProvider, - isCadenceIdentifier, - isEVMAddress, - isFlowAddress, -} from "../providers/wallet.provider"; -import { transferTemplate } from "../templates"; -import { validateFlowConfig } from "../environment"; -import { TransactionResponse } from "../types"; -import { transactions } from "../assets/transaction.defs"; -import * as queries from "../queries"; - -/** - * The generated content for the transfer action - */ -export interface TransferContent extends Content { - token: string | null; - amount: string; - to: string; - matched: boolean; -} - -/** - * Check if the content is a transfer content - */ -function isTransferContent( - runtime: IAgentRuntime, - content: any -): content is TransferContent { - elizaLogger.log("Content for transfer", content); - return ( - (!content.token || - (typeof content.token === "string" && - (isCadenceIdentifier(content.token) || - isEVMAddress(content.token)))) && - typeof content.to === "string" && - (isEVMAddress(content.to) || isFlowAddress(content.to)) && - (typeof content.amount === "string" || - typeof content.amount === "number") && - typeof content.matched === "boolean" - ); -} - -// FIXME: We need to use dynamic key index -const USE_KEY_INDEX = 0; - -export class TransferAction { - constructor( - private walletProvider: FlowWalletProvider, - public readonly useKeyIndex: number = USE_KEY_INDEX - ) {} - - /** - * Process the messages and generate the transfer content - */ - async processMessages( - runtime: IAgentRuntime, - message: Memory, - state: State - ): Promise { - // Initialize or update state - if (!state) { - state = (await runtime.composeState(message)) as State; - } else { - state = await runtime.updateRecentMessageState(state); - } - - // Compose transfer context - const transferContext = composeContext({ - state, - template: transferTemplate, - }); - - // Generate transfer content - const recommendations = await generateObjectArray({ - runtime, - context: transferContext, - modelClass: ModelClass.MEDIUM, - }); - - elizaLogger.debug("Recommendations", recommendations); - - // Convert array to object - const content = recommendations[recommendations.length - 1]; - - // Validate transfer content - if (!isTransferContent(runtime, content)) { - elizaLogger.error("Invalid content for SEND_COIN action."); - throw new Exception(50100, "Invalid transfer content"); - } - - // Check if the content is matched - if (!content.matched) { - elizaLogger.error("Content does not match the transfer template."); - throw new Exception( - 50100, - "Content does not match the transfer template" - ); - } - return content; - } - - async transfer( - content: TransferContent, - callback?: HandlerCallback - ): Promise { - elizaLogger.log("Starting Flow Plugin's SEND_COIN handler..."); - - const resp: TransactionResponse = { - signer: { - address: this.walletProvider.address, - keyIndex: this.useKeyIndex, - }, - txid: "", - }; - const logPrefix = `Address: ${resp.signer.address}, using keyIdex: ${resp.signer.keyIndex}\n`; - - // Parsed fields - const recipient = content.to; - const amount = - typeof content.amount === "number" - ? content.amount - : parseFloat(content.amount); - - // Check if the wallet has enough balance to transfer - const accountInfo = await queries.queryAccountBalanceInfo( - this.walletProvider, - this.walletProvider.address - ); - const totalBalance = - accountInfo.balance + (accountInfo.coaBalance ?? 0); - - // Check if the amount is valid - if (totalBalance < amount) { - elizaLogger.error("Insufficient balance to transfer."); - if (callback) { - callback({ - text: `${logPrefix} Unable to process transfer request. Insufficient balance.`, - content: { - error: "Insufficient balance", - }, - }); - } - throw new Exception(50100, "Insufficient balance to transfer"); - } - - try { - // Execute transfer - const authz = this.walletProvider.buildAuthorization( - this.useKeyIndex - ); // use default private key - - // For different token types, we need to handle the token differently - if (!content.token) { - elizaLogger.log( - `${logPrefix} Sending ${amount} FLOW to ${recipient}...` - ); - // Transfer FLOW token - resp.txid = await this.walletProvider.sendTransaction( - transactions.mainFlowTokenDynamicTransfer, - (arg, t) => [ - arg(recipient, t.String), - arg(amount.toFixed(1), t.UFix64), - ], - authz - ); - } else if (isCadenceIdentifier(content.token)) { - // Transfer Fungible Token on Cadence side - const [_, tokenAddr, tokenContractName] = - content.token.split("."); - elizaLogger.log( - `${logPrefix} Sending ${amount} A.${tokenAddr}.${tokenContractName} to ${recipient}...` - ); - resp.txid = await this.walletProvider.sendTransaction( - transactions.mainFTGenericTransfer, - (arg, t) => [ - arg(amount.toFixed(1), t.UFix64), - arg(recipient, t.Address), - arg("0x" + tokenAddr, t.Address), - arg(tokenContractName, t.String), - ], - authz - ); - } else if (isEVMAddress(content.token)) { - // Transfer ERC20 token on EVM side - // we need to update the amount to be in the smallest unit - const decimals = await queries.queryEvmERC20Decimals( - this.walletProvider, - content.token - ); - const adjustedAmount = BigInt(amount * Math.pow(10, decimals)); - - elizaLogger.log( - `${logPrefix} Sending ${adjustedAmount} ${content.token}(EVM) to ${recipient}...` - ); - - resp.txid = await this.walletProvider.sendTransaction( - transactions.mainEVMTransferERC20, - (arg, t) => [ - arg(content.token, t.String), - arg(recipient, t.String), - // Convert the amount to string, the string should be pure number, not a scientific notation - arg(adjustedAmount.toString(), t.UInt256), - ], - authz - ); - } - - elizaLogger.log(`${logPrefix} Sent transaction: ${resp.txid}`); - - // call the callback with the transaction response - if (callback) { - const tokenName = content.token || "FLOW"; - const baseUrl = - this.walletProvider.network === "testnet" - ? "https://testnet.flowscan.io" - : "https://flowscan.io"; - const txURL = `${baseUrl}/tx/${resp.txid}/events`; - callback({ - text: `${logPrefix} Successfully transferred ${content.amount} ${tokenName} to ${content.to}\nTransaction: [${resp.txid}](${txURL})`, - content: { - success: true, - txid: resp.txid, - token: content.token, - to: content.to, - amount: content.amount, - }, - }); - } - } catch (e: any) { - elizaLogger.error("Error in sending transaction:", e.message); - if (callback) { - callback({ - text: `${logPrefix} Unable to process transfer request. Error in sending transaction.`, - content: { - error: e.message, - }, - }); - } - if (e instanceof Exception) { - throw e; - } else { - throw new Exception( - 50100, - "Error in sending transaction: " + e.message - ); - } - } - - elizaLogger.log("Completed Flow Plugin's SEND_COIN handler."); - - return resp; - } -} - -export const transferAction = { - name: "SEND_COIN", - similes: [ - "SEND_TOKEN", - "SEND_TOKEN_ON_FLOW", - "TRANSFER_TOKEN_ON_FLOW", - "TRANSFER_TOKENS_ON_FLOW", - "TRANSFER_FLOW", - "SEND_FLOW", - "PAY_BY_FLOW", - ], - description: - "Call this action to transfer any fungible token/coin from the agent's Flow wallet to another address", - validate: async (runtime: IAgentRuntime, _message: Memory) => { - await validateFlowConfig(runtime); - const flowConnector = await getFlowConnectorInstance(runtime); - const walletProvider = new FlowWalletProvider(runtime, flowConnector); - try { - await walletProvider.syncAccountInfo(); - // TODO: We need to check if the key index is valid - } catch { - elizaLogger.error("Failed to sync account info"); - return false; - } - return true; - }, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - _options: { [key: string]: unknown }, - callback?: HandlerCallback - ): Promise => { - const flowConnector = await getFlowConnectorInstance(runtime); - const walletProvider = new FlowWalletProvider(runtime, flowConnector); - const action = new TransferAction(walletProvider); - let content: TransferContent; - try { - content = await action.processMessages(runtime, message, state); - } catch (err) { - elizaLogger.error("Error in processing messages:", err.message); - if (callback) { - callback({ - text: - "Unable to process transfer request. Invalid content: " + - err.message, - content: { - error: "Invalid content", - }, - }); - } - return false; - } - - try { - const res = await action.transfer(content, callback); - elizaLogger.log( - `Transfer action response: ${res.signer.address}[${res.signer.keyIndex}] - ${res.txid}` - ); - } catch { - return false; - } - return true; - }, - examples: [ - [ - { - user: "{{user1}}", - content: { - text: "Send 1 FLOW to 0xa2de93114bae3e73", - }, - }, - { - user: "{{user2}}", - content: { - text: "Sending 1 FLOW tokens now, pls wait...", - action: "SEND_COIN", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "Send 1 FLOW - A.1654653399040a61.FlowToken to 0xa2de93114bae3e73", - }, - }, - { - user: "{{user2}}", - content: { - text: "Sending 1 FLOW tokens now, pls wait...", - action: "SEND_COIN", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "Send 1000 FROTH - 0xb73bf8e6a4477a952e0338e6cc00cc0ce5ad04ba to 0x000000000000000000000002e44fbfbd00395de5", - }, - }, - { - user: "{{user2}}", - content: { - text: "Sending 1000 FROTH tokens now, pls wait...", - action: "SEND_COIN", - }, - }, - ], - ] as ActionExample[][], -} as Action; diff --git a/packages/plugin-flow/src/assets/cadence/scripts/evm/call.cdc b/packages/plugin-flow/src/assets/cadence/scripts/evm/call.cdc deleted file mode 100644 index 39658ad2657..00000000000 --- a/packages/plugin-flow/src/assets/cadence/scripts/evm/call.cdc +++ /dev/null @@ -1,40 +0,0 @@ -import "EVM" - -access(all) fun getTypeArray(_ identifiers: [String]): [Type] { - var types: [Type] = [] - for identifier in identifiers { - let type = CompositeType(identifier) - ?? panic("Invalid identifier: ".concat(identifier)) - types.append(type) - } - return types -} - -/// Supports generic calls to EVM contracts that might have return values -/// -access(all) fun main( - gatewayAddress: Address, - evmContractAddressHex: String, - calldata: String, - gasLimit: UInt64, - typeIdentifiers: [String] -): [AnyStruct] { - - let evmAddress = EVM.addressFromString(evmContractAddressHex) - - let data = calldata.decodeHex() - - let gatewayCOA = getAuthAccount(gatewayAddress) - .storage.borrow( - from: /storage/evm - ) ?? panic("Could not borrow COA from provided gateway address") - - let evmResult = gatewayCOA.call( - to: evmAddress, - data: data, - gasLimit: gasLimit, - value: EVM.Balance(attoflow: 0) - ) - - return EVM.decodeABI(types: getTypeArray(typeIdentifiers), data: evmResult.data) -} diff --git a/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/balance_of.cdc b/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/balance_of.cdc deleted file mode 100644 index a1838ee0f7b..00000000000 --- a/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/balance_of.cdc +++ /dev/null @@ -1,19 +0,0 @@ -import "EVM" - -import "FlowEVMBridgeUtils" - -/// Returns the balance of the owner (hex-encoded EVM address) of a given ERC20 fungible token defined -/// at the hex-encoded EVM contract address -/// -/// @param owner: The hex-encoded EVM address of the owner -/// @param evmContractAddress: The hex-encoded EVM contract address of the ERC20 contract -/// -/// @return The balance of the address, reverting if the given contract address does not implement the ERC20 method -/// "balanceOf(address)(uint256)" -/// -access(all) fun main(owner: String, evmContractAddress: String): UInt256 { - return FlowEVMBridgeUtils.balanceOf( - owner: EVM.addressFromString(owner), - evmContractAddress: EVM.addressFromString(evmContractAddress) - ) -} diff --git a/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/get_decimals.cdc b/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/get_decimals.cdc deleted file mode 100644 index 1c837dffdc8..00000000000 --- a/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/get_decimals.cdc +++ /dev/null @@ -1,10 +0,0 @@ -import "EVM" - -import "FlowEVMBridgeUtils" - -access(all) -fun main(erc20ContractAddressHex: String): UInt8 { - return FlowEVMBridgeUtils.getTokenDecimals( - evmContractAddress: EVM.addressFromString(erc20ContractAddressHex) - ) -} diff --git a/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/total_supply.cdc b/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/total_supply.cdc deleted file mode 100644 index bee3f2a0cca..00000000000 --- a/packages/plugin-flow/src/assets/cadence/scripts/evm/erc20/total_supply.cdc +++ /dev/null @@ -1,15 +0,0 @@ -import "EVM" - -import "FlowEVMBridgeUtils" - -/// Retrieves the total supply of the ERC20 contract at the given EVM contract address. Reverts on EVM call failure. -/// -/// @param evmContractAddress: The EVM contract address to retrieve the total supply from -/// -/// @return the total supply of the ERC20 -/// -access(all) fun main(evmContractAddressHex: String): UInt256 { - return FlowEVMBridgeUtils.totalSupply( - evmContractAddress: EVM.addressFromString(evmContractAddressHex) - ) -} diff --git a/packages/plugin-flow/src/assets/cadence/scripts/main-account/get_acct_info.cdc b/packages/plugin-flow/src/assets/cadence/scripts/main-account/get_acct_info.cdc deleted file mode 100644 index 3a6bd983a7a..00000000000 --- a/packages/plugin-flow/src/assets/cadence/scripts/main-account/get_acct_info.cdc +++ /dev/null @@ -1,51 +0,0 @@ -import "FungibleToken" -import "EVM" - -/// Returns the hex encoded address of the COA in the given Flow address -/// -access(all) fun main(flowAddress: Address): AccountInfo { - var flowBalance: UFix64 = 0.0 - if let flowVaultRef = getAccount(flowAddress) - .capabilities.get<&{FungibleToken.Balance}>(/public/flowTokenBalance) - .borrow() { - flowBalance = flowVaultRef.balance - } - - var coaAddress: String? = nil - var coaBalance: UFix64? = nil - - if let address: EVM.EVMAddress = getAuthAccount(flowAddress) - .storage.borrow<&EVM.CadenceOwnedAccount>(from: /storage/evm)?.address() { - let bytes: [UInt8] = [] - for byte in address.bytes { - bytes.append(byte) - } - coaAddress = String.encodeHex(bytes) - coaBalance = address.balance().inFLOW() - } - return AccountInfo( - flowAddress, - flowBalance, - coaAddress, - coaBalance - ) -} - -access(all) struct AccountInfo { - access(all) let address: Address - access(all) let balance: UFix64 - access(all) let coaAddress: String? - access(all) let coaBalance: UFix64? - - init( - _ address: Address, - _ balance: UFix64, - _ coaAddress: String?, - _ coaBalance: UFix64? - ) { - self.address = address - self.balance = balance - self.coaAddress = coaAddress - self.coaBalance = coaBalance - } -} diff --git a/packages/plugin-flow/src/assets/cadence/transactions/evm/call.cdc b/packages/plugin-flow/src/assets/cadence/transactions/evm/call.cdc deleted file mode 100644 index 44fffbcf7f8..00000000000 --- a/packages/plugin-flow/src/assets/cadence/transactions/evm/call.cdc +++ /dev/null @@ -1,41 +0,0 @@ -import "EVM" - -/// Executes the calldata from the signer's COA -/// -transaction(evmContractAddressHex: String, calldata: String, gasLimit: UInt64, value: UFix64) { - - let evmAddress: EVM.EVMAddress - let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount - - prepare(signer: auth(BorrowValue) &Account) { - self.evmAddress = EVM.addressFromString(evmContractAddressHex) - - let storagePath = StoragePath(identifier: "evm")! - let publicPath = PublicPath(identifier: "evm")! - - // Reference signer's COA if one exists - let coa = signer.storage.borrow(from: storagePath) - if coa == nil { - let coa <- EVM.createCadenceOwnedAccount() - signer.storage.save<@EVM.CadenceOwnedAccount>(<-coa, to: storagePath) - let addressableCap = signer.capabilities.storage.issue<&EVM.CadenceOwnedAccount>(storagePath) - signer.capabilities.unpublish(publicPath) - signer.capabilities.publish(addressableCap, at: publicPath) - } - - self.coa = signer.storage.borrow(from: storagePath) - ?? panic("Could not borrow COA from provided gateway address") - } - - execute { - let valueBalance = EVM.Balance(attoflow: 0) - valueBalance.setFLOW(flow: value) - let callResult = self.coa.call( - to: self.evmAddress, - data: calldata.decodeHex(), - gasLimit: gasLimit, - value: valueBalance - ) - assert(callResult.status == EVM.Status.successful, message: "Call failed") - } -} diff --git a/packages/plugin-flow/src/assets/cadence/transactions/main-account/account/create_new_account_with_coa.cdc b/packages/plugin-flow/src/assets/cadence/transactions/main-account/account/create_new_account_with_coa.cdc deleted file mode 100644 index 65f31685711..00000000000 --- a/packages/plugin-flow/src/assets/cadence/transactions/main-account/account/create_new_account_with_coa.cdc +++ /dev/null @@ -1,60 +0,0 @@ -import Crypto - -import "EVM" - -/// Creates a new Flow Address with a single full-weight key and its EVM account, which is -/// a Cadence Owned Account (COA) stored in the account's storage. -/// -transaction( - key: String, // key to be used for the account - signatureAlgorithm: UInt8, // signature algorithm to be used for the account - hashAlgorithm: UInt8, // hash algorithm to be used for the account -) { - let auth: auth(BorrowValue) &Account - - prepare(signer: auth(BorrowValue) &Account) { - pre { - signatureAlgorithm == 1 || signatureAlgorithm == 2: - "Cannot add Key: Must provide a signature algorithm raw value that corresponds to " - .concat("one of the available signature algorithms for Flow keys.") - .concat("You provided ").concat(signatureAlgorithm.toString()) - .concat(" but the options are either 1 (ECDSA_P256), 2 (ECDSA_secp256k1).") - hashAlgorithm == 1 || hashAlgorithm == 3: - "Cannot add Key: Must provide a hash algorithm raw value that corresponds to " - .concat("one of of the available hash algorithms for Flow keys.") - .concat("You provided ").concat(hashAlgorithm.toString()) - .concat(" but the options are 1 (SHA2_256), 3 (SHA3_256).") - } - - self.auth = signer - } - - execute { - // Create a new public key - let publicKey = PublicKey( - publicKey: key.decodeHex(), - signatureAlgorithm: SignatureAlgorithm(rawValue: signatureAlgorithm)! - ) - - // Create a new account - let account = Account(payer: self.auth) - - // Add the public key to the account - account.keys.add( - publicKey: publicKey, - hashAlgorithm: HashAlgorithm(rawValue: hashAlgorithm)!, - weight: 1000.0 - ) - - // Create a new COA - let coa <- EVM.createCadenceOwnedAccount() - - // Save the COA to the new account - let storagePath = StoragePath(identifier: "evm")! - let publicPath = PublicPath(identifier: "evm")! - account.storage.save<@EVM.CadenceOwnedAccount>(<-coa, to: storagePath) - let addressableCap = account.capabilities.storage.issue<&EVM.CadenceOwnedAccount>(storagePath) - account.capabilities.unpublish(publicPath) - account.capabilities.publish(addressableCap, at: publicPath) - } -} diff --git a/packages/plugin-flow/src/assets/cadence/transactions/main-account/account/setup_coa.cdc b/packages/plugin-flow/src/assets/cadence/transactions/main-account/account/setup_coa.cdc deleted file mode 100644 index b528d8b40b8..00000000000 --- a/packages/plugin-flow/src/assets/cadence/transactions/main-account/account/setup_coa.cdc +++ /dev/null @@ -1,23 +0,0 @@ -import "EVM" -import "FungibleToken" -import "FlowToken" - -/// Creates a COA and saves it in the signer's Flow account & passing the given value of Flow into FlowEVM -/// -transaction() { - - prepare(signer: auth(BorrowValue, IssueStorageCapabilityController, PublishCapability, SaveValue, UnpublishCapability) &Account) { - let storagePath = StoragePath(identifier: "evm")! - let publicPath = PublicPath(identifier: "evm")! - - // Reference signer's COA if one exists - let coa = signer.storage.borrow(from: storagePath) - if coa == nil { - let coa <- EVM.createCadenceOwnedAccount() - signer.storage.save<@EVM.CadenceOwnedAccount>(<-coa, to: storagePath) - let addressableCap = signer.capabilities.storage.issue<&EVM.CadenceOwnedAccount>(storagePath) - signer.capabilities.unpublish(publicPath) - signer.capabilities.publish(addressableCap, at: publicPath) - } - } -} diff --git a/packages/plugin-flow/src/assets/cadence/transactions/main-account/evm/transfer_erc20.cdc b/packages/plugin-flow/src/assets/cadence/transactions/main-account/evm/transfer_erc20.cdc deleted file mode 100644 index 53769cfa24f..00000000000 --- a/packages/plugin-flow/src/assets/cadence/transactions/main-account/evm/transfer_erc20.cdc +++ /dev/null @@ -1,41 +0,0 @@ -import "EVM" - -import "FlowEVMBridgeUtils" - -/// Executes a token transfer to the defined recipient address against the specified ERC20 contract. -/// -transaction(evmContractAddressHex: String, recipientAddressHex: String, amount: UInt256) { - - let evmContractAddress: EVM.EVMAddress - let recipientAddress: EVM.EVMAddress - let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount - let preBalance: UInt256 - var postBalance: UInt256 - - prepare(signer: auth(BorrowValue) &Account) { - self.evmContractAddress = EVM.addressFromString(evmContractAddressHex) - self.recipientAddress = EVM.addressFromString(recipientAddressHex) - - self.coa = signer.storage.borrow(from: /storage/evm) - ?? panic("Could not borrow CadenceOwnedAccount reference") - - self.preBalance = FlowEVMBridgeUtils.balanceOf(owner: self.coa.address(), evmContractAddress: self.evmContractAddress) - self.postBalance = 0 - } - - execute { - let calldata = EVM.encodeABIWithSignature("transfer(address,uint256)", [self.recipientAddress, amount]) - let callResult = self.coa.call( - to: self.evmContractAddress, - data: calldata, - gasLimit: 15_000_000, - value: EVM.Balance(attoflow: 0) - ) - assert(callResult.status == EVM.Status.successful, message: "Call to ERC20 contract failed") - self.postBalance = FlowEVMBridgeUtils.balanceOf(owner: self.coa.address(), evmContractAddress: self.evmContractAddress) - } - - post { - self.postBalance == self.preBalance - amount: "Transfer failed" - } -} diff --git a/packages/plugin-flow/src/assets/cadence/transactions/main-account/flow-token/dynamic_vm_transfer.cdc b/packages/plugin-flow/src/assets/cadence/transactions/main-account/flow-token/dynamic_vm_transfer.cdc deleted file mode 100644 index 0d5204cddaa..00000000000 --- a/packages/plugin-flow/src/assets/cadence/transactions/main-account/flow-token/dynamic_vm_transfer.cdc +++ /dev/null @@ -1,104 +0,0 @@ -import "FungibleToken" -import "FlowToken" - -import "EVM" - -// Transfers $FLOW from the signer's account to the recipient's address, determining the target VM based on the format -// of the recipient's hex address. Note that the sender's funds are sourced by default from the target VM, pulling any -// difference from the alternate VM if available. e.g. Transfers to Flow addresses will first attempt to withdraw from -// the signer's Flow vault, pulling any remaining funds from the signer's EVM account if available. Transfers to EVM -// addresses will first attempt to withdraw from the signer's EVM account, pulling any remaining funds from the signer's -// Flow vault if available. If the signer's balance across both VMs is insufficient, the transaction will revert. -/// -/// @param addressString: The recipient's address in hex format - this should be either an EVM address or a Flow address -/// @param amount: The amount of $FLOW to transfer as a UFix64 value -/// -transaction(addressString: String, amount: UFix64) { - - let sentVault: @FlowToken.Vault - let evmRecipient: EVM.EVMAddress? - var receiver: &{FungibleToken.Receiver}? - - prepare(signer: auth(BorrowValue, SaveValue) &Account) { - // Reference signer's COA if one exists - let coa = signer.storage.borrow(from: /storage/evm) - - // Reference signer's FlowToken Vault - let sourceVault = signer.storage.borrow(from: /storage/flowTokenVault) - ?? panic("Could not borrow signer's FlowToken.Vault") - let cadenceBalance = sourceVault.balance - - // Define optional recipients for both VMs - self.receiver = nil - let cadenceRecipient = Address.fromString(addressString) - self.evmRecipient = cadenceRecipient == nil ? EVM.addressFromString(addressString) : nil - // Validate exactly one target address is assigned - if cadenceRecipient != nil && self.evmRecipient != nil { - panic("Malformed recipient address - assignable as both Cadence and EVM addresses") - } else if cadenceRecipient == nil && self.evmRecipient == nil { - panic("Malformed recipient address - not assignable as either Cadence or EVM address") - } - - // Create empty FLOW vault to capture funds - self.sentVault <- FlowToken.createEmptyVault(vaultType: Type<@FlowToken.Vault>()) - /// If the target VM is Flow, does the Vault have sufficient balance to cover? - if cadenceRecipient != nil { - // Assign the Receiver of the $FLOW transfer - self.receiver = getAccount(cadenceRecipient!).capabilities.borrow<&{FungibleToken.Receiver}>( - /public/flowTokenReceiver - ) ?? panic("Could not borrow reference to recipient's FungibleToken.Receiver") - - // Withdraw from the signer's Cadence Vault and deposit to sentVault - var withdrawAmount = amount < cadenceBalance ? amount : cadenceBalance - self.sentVault.deposit(from: <-sourceVault.withdraw(amount: withdrawAmount)) - - // If the cadence balance didn't cover the amount, check the signer's EVM balance - if amount > self.sentVault.balance { - let difference = amount - cadenceBalance - // Revert if the signer doesn't have an EVM account or EVM balance is insufficient - if coa == nil || difference < coa!.balance().inFLOW() { - panic("Insufficient balance across Flow and EVM accounts") - } - - // Withdraw from the signer's EVM account and deposit to sentVault - let withdrawFromEVM = EVM.Balance(attoflow: 0) - withdrawFromEVM.setFLOW(flow: difference) - self.sentVault.deposit(from: <-coa!.withdraw(balance: withdrawFromEVM)) - } - } else if self.evmRecipient != nil { - // Check signer's balance can cover the amount - if coa != nil { - // Determine the amount to withdraw from the signer's EVM account - let balance = coa!.balance() - let withdrawAmount = amount < balance.inFLOW() ? amount : balance.inFLOW() - balance.setFLOW(flow: withdrawAmount) - - // Withdraw funds from EVM to the sentVault - self.sentVault.deposit(from: <-coa!.withdraw(balance: balance)) - } - if amount > self.sentVault.balance { - // Insufficient amount withdrawn from EVM, check signer's Flow balance - let difference = amount - self.sentVault.balance - if difference > cadenceBalance { - panic("Insufficient balance across Flow and EVM accounts") - } - // Withdraw from the signer's Cadence Vault and deposit to sentVault - self.sentVault.deposit(from: <-sourceVault.withdraw(amount: difference)) - } - } - } - - pre { - self.sentVault.balance == amount: "Attempting to send an incorrect amount of $FLOW" - } - - execute { - // Complete Cadence transfer if the FungibleToken Receiver is assigned - if self.receiver != nil { - self.receiver!.deposit(from: <-self.sentVault) - } else { - // Otherwise, complete EVM transfer - self.evmRecipient!.deposit(from: <-self.sentVault) - } - } -} diff --git a/packages/plugin-flow/src/assets/cadence/transactions/main-account/ft/generic_transfer_with_address.cdc b/packages/plugin-flow/src/assets/cadence/transactions/main-account/ft/generic_transfer_with_address.cdc deleted file mode 100644 index 4940cf68112..00000000000 --- a/packages/plugin-flow/src/assets/cadence/transactions/main-account/ft/generic_transfer_with_address.cdc +++ /dev/null @@ -1,87 +0,0 @@ -import "FungibleToken" -import "FungibleTokenMetadataViews" - -#interaction ( - version: "1.0.0", - title: "Generic FT Transfer with Contract Address and Name", - description: "Transfer any Fungible Token by providing the contract address and name", - language: "en-US", -) - -/// Can pass in any contract address and name to transfer a token from that contract -/// This lets you choose the token you want to send -/// -/// Any contract can be chosen here, so wallets should check argument values -/// to make sure the intended token contract name and address is passed in -/// Contracts that are used must implement the FTVaultData Metadata View -/// -/// Note: This transaction only will work for Fungible Tokens that -/// have their token's resource name set as "Vault". -/// Tokens with other names will need to use a different transaction -/// that additionally specifies the identifier -/// -/// @param amount: The amount of tokens to transfer -/// @param to: The address to transfer the tokens to -/// @param contractAddress: The address of the contract that defines the tokens being transferred -/// @param contractName: The name of the contract that defines the tokens being transferred. Ex: "FlowToken" -/// -transaction(amount: UFix64, to: Address, contractAddress: Address, contractName: String) { - - // The Vault resource that holds the tokens that are being transferred - let tempVault: @{FungibleToken.Vault} - - // FTVaultData struct to get paths from - let vaultData: FungibleTokenMetadataViews.FTVaultData - - prepare(signer: auth(BorrowValue) &Account) { - - // Borrow a reference to the vault stored on the passed account at the passed publicPath - let resolverRef = getAccount(contractAddress) - .contracts.borrow<&{FungibleToken}>(name: contractName) - ?? panic("Could not borrow FungibleToken reference to the contract. Make sure the provided contract name (" - .concat(contractName).concat(") and address (").concat(contractAddress.toString()).concat(") are correct!")) - - // Use that reference to retrieve the FTView - self.vaultData = resolverRef.resolveContractView(resourceType: nil, viewType: Type()) as! FungibleTokenMetadataViews.FTVaultData? - ?? panic("Could not resolve FTVaultData view. The ".concat(contractName) - .concat(" contract needs to implement the FTVaultData Metadata view in order to execute this transaction.")) - - // Get a reference to the signer's stored vault - let vaultRef = signer.storage.borrow(from: self.vaultData.storagePath) - ?? panic("The signer does not store a FungibleToken.Provider object at the path " - .concat(self.vaultData.storagePath.toString()).concat("For the ").concat(contractName) - .concat(" contract at address ").concat(contractAddress.toString()) - .concat(". The signer must initialize their account with this object first!")) - - self.tempVault <- vaultRef.withdraw(amount: amount) - - // Get the string representation of the address without the 0x - var addressString = contractAddress.toString() - if addressString.length == 18 { - addressString = addressString.slice(from: 2, upTo: 18) - } - let typeString: String = "A.".concat(addressString).concat(".").concat(contractName).concat(".Vault") - let type = CompositeType(typeString) - assert( - type != nil, - message: "Could not create a type out of the contract name and address!" - ) - - assert( - self.tempVault.getType() == type!, - message: "The Vault that was withdrawn to transfer is not the type that was requested!" - ) - } - - execute { - let recipient = getAccount(to) - let receiverRef = recipient.capabilities.borrow<&{FungibleToken.Receiver}>(self.vaultData.receiverPath) - ?? panic("Could not borrow a Receiver reference to the FungibleToken Vault in account " - .concat(to.toString()).concat(" at path ").concat(self.vaultData.receiverPath.toString()) - .concat(". Make sure you are sending to an address that has ") - .concat("a FungibleToken Vault set up properly at the specified path.")) - - // Transfer tokens from the signer's stored vault to the receiver capability - receiverRef.deposit(from: <-self.tempVault) - } -} diff --git a/packages/plugin-flow/src/assets/script.defs.ts b/packages/plugin-flow/src/assets/script.defs.ts deleted file mode 100644 index 66646809289..00000000000 --- a/packages/plugin-flow/src/assets/script.defs.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Source: -// -// This file contains the definitions of the Cadence scripts used in the plugin. -// The scripts are defined as strings and exported as a dictionary. - -// Scripts for EVM -import evmCall from "./cadence/scripts/evm/call.cdc?raw"; -import evmERC20BalanceOf from "./cadence/scripts/evm/erc20/balance_of.cdc?raw"; -import evmERC20GetDecimals from "./cadence/scripts/evm/erc20/get_decimals.cdc?raw"; -import evmERC20GetTotalSupply from "./cadence/scripts/evm/erc20/total_supply.cdc?raw"; - -// Scripts for main account -import mainGetAccountInfo from "./cadence/scripts/main-account/get_acct_info.cdc?raw"; - -export const scripts = { - evmCall, - evmERC20BalanceOf, - evmERC20GetDecimals, - evmERC20GetTotalSupply, - mainGetAccountInfo, -}; diff --git a/packages/plugin-flow/src/assets/transaction.defs.ts b/packages/plugin-flow/src/assets/transaction.defs.ts deleted file mode 100644 index 807d7e215c6..00000000000 --- a/packages/plugin-flow/src/assets/transaction.defs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import evmCall from "./cadence/transactions/evm/call.cdc"; -// Transactions for main account -import mainAccountCreateNewWithCOA from "./cadence/transactions/main-account/account/create_new_account_with_coa.cdc"; -import mainAccountSetupCOA from "./cadence/transactions/main-account/account/setup_coa.cdc"; -import mainEVMTransferERC20 from "./cadence/transactions/main-account/evm/transfer_erc20.cdc"; -import mainFlowTokenDynamicTransfer from "./cadence/transactions/main-account/flow-token/dynamic_vm_transfer.cdc"; -import mainFTGenericTransfer from "./cadence/transactions/main-account/ft/generic_transfer_with_address.cdc"; - -export const transactions = { - evmCall, - mainAccountCreateNewWithCOA, - mainAccountSetupCOA, - mainEVMTransferERC20, - mainFlowTokenDynamicTransfer, - mainFTGenericTransfer, -}; diff --git a/packages/plugin-flow/src/environment.ts b/packages/plugin-flow/src/environment.ts deleted file mode 100644 index f353f148093..00000000000 --- a/packages/plugin-flow/src/environment.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { IAgentRuntime } from "@ai16z/eliza"; -import { z } from "zod"; - -const FLOW_MAINNET_PUBLIC_RPC = "https://mainnet.onflow.org"; - -export const flowEnvSchema = z.object({ - FLOW_ADDRESS: z - .string() - .min(1, "Flow native address is required") - .startsWith("0x", "Flow address must start with 0x"), - FLOW_PRIVATE_KEY: z - .string() - .min(1, "Flow private key for the address is required") - .startsWith("0x", "Flow private key must start with 0x"), - FLOW_NETWORK: z.string().optional().default("mainnet"), - FLOW_ENDPOINT_URL: z.string().optional().default(FLOW_MAINNET_PUBLIC_RPC), -}); - -export type FlowConfig = z.infer; - -export async function validateFlowConfig( - runtime: IAgentRuntime -): Promise { - try { - const config = { - FLOW_ADDRESS: - runtime.getSetting("FLOW_ADDRESS") || process.env.FLOW_ADDRESS, - FLOW_PRIVATE_KEY: - runtime.getSetting("FLOW_PRIVATE_KEY") || - process.env.FLOW_PRIVATE_KEY, - FLOW_NETWORK: - runtime.getSetting("FLOW_NETWORK") || - process.env.FLOW_NETWORK || - "mainnet", - FLOW_ENDPOINT_URL: - runtime.getSetting("FLOW_ENDPOINT_URL") || - process.env.FLOW_ENDPOINT_URL || - FLOW_MAINNET_PUBLIC_RPC, - }; - - return flowEnvSchema.parse(config); - } catch (error) { - if (error instanceof z.ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `Flow Blockchain configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/plugin-flow/src/index.ts b/packages/plugin-flow/src/index.ts deleted file mode 100644 index 7f7212a1d26..00000000000 --- a/packages/plugin-flow/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Definitions -export * from "./environment"; -export * from "./types"; -export * from "./assets/script.defs"; -export * from "./assets/transaction.defs"; -export * as queries from "./queries"; -// Providers -export * from "./providers/connector.provider"; -export * from "./providers/wallet.provider"; - -import type { Plugin } from "@ai16z/eliza"; -import { flowWalletProvider } from "./providers/wallet.provider"; -import { flowConnectorProvider } from "./providers/connector.provider"; -import { transferAction } from "./actions/transfer"; - -export const flowPlugin: Plugin = { - name: "flow", - description: "Flow Plugin for Eliza", - providers: [flowWalletProvider, flowConnectorProvider], - actions: [transferAction], - evaluators: [], - services: [], -}; - -export default flowPlugin; diff --git a/packages/plugin-flow/src/providers/connector.provider.ts b/packages/plugin-flow/src/providers/connector.provider.ts deleted file mode 100644 index 7d81fe3c87b..00000000000 --- a/packages/plugin-flow/src/providers/connector.provider.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { - elizaLogger, - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza"; - -import FlowConnector, { NetworkType } from "./utils/flow.connector"; - -// Here is the configuration file for fixes. -import flowJSON from "../../flow.json" assert { type: "json" }; - -// Singleton instance for the Flow connector -let _instance: FlowConnector; - -/** - * Get the singleton instance of the Flow connector - * @param runtime The runtime object - */ -async function _getDefaultConnectorInstance( - runtime: IAgentRuntime -): Promise { - if (!_instance) { - _instance = await _createFlowConnector(runtime, flowJSON); - } - return _instance; -} - -/** - * Create a new instance of the Flow connector - * @param runtime - * @param flowJSON - */ -async function _createFlowConnector( - runtime: IAgentRuntime, - flowJSON: object -): Promise { - const rpcEndpoint = runtime.getSetting("FLOW_ENDPOINT_URL"); - const network = runtime.getSetting("FLOW_NETWORK") as NetworkType; - const instance = new FlowConnector(flowJSON, network, rpcEndpoint); - await instance.onModuleInit(); - return instance; -} - -/** - * Get the singleton instance of the Flow connector - * @param runtime - */ -export async function getFlowConnectorInstance( - runtime: IAgentRuntime, - inputedFlowJSON: { [key: string]: unknown } = undefined -): Promise { - let connector: FlowConnector; - if ( - inputedFlowJSON && - typeof inputedFlowJSON === "object" && - typeof inputedFlowJSON?.networks === "object" && - typeof inputedFlowJSON?.dependencies === "object" - ) { - connector = await _createFlowConnector(runtime, inputedFlowJSON); - } else { - connector = await _getDefaultConnectorInstance(runtime); - } - return connector; -} - -/** - * Flow connector provider for AI agents - */ -export class FlowConnectorProvider { - constructor(private readonly instance: FlowConnector) {} - - getConnectorStatus(runtime: IAgentRuntime): string { - let output = `Now user<${runtime.character.name}> connected to\n`; - output += `Flow network: ${this.instance.network}\n`; - output += `Flow Endpoint: ${this.instance.rpcEndpoint}\n`; - return output; - } - - // async getFormattedPortfolio(_runtime: IAgentRuntime): Promise { - // return Promise.resolve(this.getConnectorStatus(_runtime)); - // } -} - -const flowConnectorProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State - ): Promise => { - try { - const provider = new FlowConnectorProvider( - await getFlowConnectorInstance(runtime) - ); - return provider.getConnectorStatus(runtime); - } catch (error) { - elizaLogger.error( - "Error in Flow connector provider:", - error.message - ); - return null; - } - }, -}; - -// Module exports -export { flowConnectorProvider, FlowConnector }; diff --git a/packages/plugin-flow/src/providers/utils/flow.connector.ts b/packages/plugin-flow/src/providers/utils/flow.connector.ts deleted file mode 100644 index 45cb01fc4e5..00000000000 --- a/packages/plugin-flow/src/providers/utils/flow.connector.ts +++ /dev/null @@ -1,171 +0,0 @@ -import * as fcl from "@onflow/fcl"; -import type { Account, TransactionStatus } from "@onflow/typedefs"; -import { IFlowScriptExecutor } from "../../types"; -import Exception from "../../types/exception"; - -export type NetworkType = "mainnet" | "testnet" | "emulator"; - -let isGloballyInited = false; -let globallyPromise = null; - -export class FlowConnector implements IFlowScriptExecutor { - /** - * Initialize the Flow SDK - */ - constructor( - private readonly flowJSON: object, - public readonly network: NetworkType = "mainnet", - private readonly defaultRpcEndpoint: string = undefined - ) {} - - /** - * Get the RPC endpoint - */ - get rpcEndpoint() { - switch (this.network) { - case "mainnet": - return this.defaultRpcEndpoint ?? "https://mainnet.onflow.org"; - case "testnet": - return "https://testnet.onflow.org"; - case "emulator": - return "http://localhost:8888"; - default: - throw new Exception( - 50000, - `Network type ${this.network} is not supported` - ); - } - } - - /** - * Initialize the Flow SDK - */ - async onModuleInit() { - if (isGloballyInited) return; - - const cfg = fcl.config(); - // Required - await cfg.put("flow.network", this.network); - // Set the maximum of gas limit - await cfg.put("fcl.limit", 9999); - // Set the RPC endpoint - await cfg.put("accessNode.api", this.rpcEndpoint); - // Load Flow JSON - await cfg.load({ flowJSON: this.flowJSON }); - - isGloballyInited = true; - } - - /** - * Ensure the Flow SDK is initialized - */ - private async ensureInited() { - if (isGloballyInited) return; - if (!globallyPromise) { - globallyPromise = this.onModuleInit(); - } - return await globallyPromise; - } - - /** - * Get account information - */ - async getAccount(addr: string): Promise { - await this.ensureInited(); - return await fcl.send([fcl.getAccount(addr)]).then(fcl.decode); - } - - /** - * General method of sending transaction - */ - async sendTransaction( - code: string, - args: fcl.ArgumentFunction, - mainAuthz?: fcl.FclAuthorization, - extraAuthz?: fcl.FclAuthorization[] - ) { - await this.ensureInited(); - if (typeof mainAuthz !== "undefined") { - return await fcl.mutate({ - cadence: code, - args: args, - proposer: mainAuthz, - payer: mainAuthz, - authorizations: - (extraAuthz?.length ?? 0) === 0 - ? [mainAuthz] - : [mainAuthz, ...extraAuthz], - }); - } else { - return await fcl.mutate({ - cadence: code, - args: args, - }); - } - } - - /** - * Get transaction status - */ - async getTransactionStatus( - transactionId: string - ): Promise { - await this.ensureInited(); - return await fcl.tx(transactionId).onceExecuted(); - } - - /** - * Get chain id - */ - async getChainId() { - await this.ensureInited(); - return await fcl.getChainId(); - } - - /** - * Send transaction with single authorization - */ - async onceTransactionSealed( - transactionId: string - ): Promise { - await this.ensureInited(); - return fcl.tx(transactionId).onceSealed(); - } - - /** - * Get block object - * @param blockId - */ - async getBlockHeaderObject( - blockId: string - ): Promise { - await this.ensureInited(); - return await fcl - - .send([fcl.getBlockHeader(), fcl.atBlockId(blockId)]) - .then(fcl.decode); - } - - /** - * Send script - */ - async executeScript( - code: string, - args: fcl.ArgumentFunction, - defaultValue: T - ): Promise { - await this.ensureInited(); - try { - const queryResult = await fcl.query({ - cadence: code, - args, - }); - return (queryResult as T) ?? defaultValue; - } catch (e) { - console.error(e); - return defaultValue; - } - } -} - -export default FlowConnector; diff --git a/packages/plugin-flow/src/providers/utils/pure.signer.ts b/packages/plugin-flow/src/providers/utils/pure.signer.ts deleted file mode 100644 index 41863de0a48..00000000000 --- a/packages/plugin-flow/src/providers/utils/pure.signer.ts +++ /dev/null @@ -1,26 +0,0 @@ -import elliptic from "elliptic"; -import { SHA3 } from "sha3"; - -export default class PureSigner { - /** - * Sign a message with a private key - */ - static signWithKey(privateKeyHex: string, msg: string) { - const ec = new elliptic.ec("p256"); - const key = ec.keyFromPrivate(Buffer.from(privateKeyHex, "hex")); - const sig = key.sign(this._hashMsg(msg)); - const n = 32; - const r = sig.r.toArrayLike(Buffer, "be", n); - const s = sig.s.toArrayLike(Buffer, "be", n); - return Buffer.concat([r.valueOf(), s.valueOf()]).toString("hex"); - } - - /** - * Hash a message - */ - private static _hashMsg(msg: string) { - const sha = new SHA3(256); - sha.update(Buffer.from(msg, "hex")); - return sha.digest(); - } -} diff --git a/packages/plugin-flow/src/providers/wallet.provider.ts b/packages/plugin-flow/src/providers/wallet.provider.ts deleted file mode 100644 index 1d300bafa7d..00000000000 --- a/packages/plugin-flow/src/providers/wallet.provider.ts +++ /dev/null @@ -1,249 +0,0 @@ -import { - elizaLogger, - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza"; -import NodeCache from "node-cache"; -import * as fcl from "@onflow/fcl"; -import type { CompositeSignature, Account } from "@onflow/typedefs"; -import type { FlowConnector } from "./utils/flow.connector"; -import { IFlowScriptExecutor, IFlowSigner } from "../types"; -import { getFlowConnectorInstance } from "./connector.provider"; -import PureSigner from "./utils/pure.signer"; -import Exception from "../types/exception"; -import * as queries from "../queries"; - -/** - * Flow wallet Provider - */ -export class FlowWalletProvider implements IFlowSigner, IFlowScriptExecutor { - runtime: IAgentRuntime; - private readonly privateKeyHex?: string; - public readonly address: string; - // Runtime data - private account: Account | null = null; - public maxKeyIndex = 0; - - constructor( - runtime: IAgentRuntime, - private readonly connector: FlowConnector, - private readonly cache: NodeCache = new NodeCache({ stdTTL: 300 }) // Cache TTL set to 5 minutes - ) { - this.address = getSignerAddress(runtime); - this.runtime = runtime; - - const privateKey = runtime.getSetting("FLOW_PRIVATE_KEY"); - if (!privateKey) { - elizaLogger.warn( - `The default Flow wallet ${this.address} has no private key` - ); - } else { - this.privateKeyHex = privateKey.startsWith("0x") - ? privateKey.slice(2) - : privateKey; - } - } - - /** - * Get the network type - */ - get network() { - return this.connector.network; - } - - /** - * Send a transaction - * @param code Cadence code - * @param args Cadence arguments - */ - async sendTransaction( - code: string, - args: fcl.ArgumentFunction, - authz?: fcl.FclAuthorization - ) { - return await this.connector.sendTransaction( - code, - args, - authz ?? this.buildAuthorization() - ); - } - - /** - * Execute a script - * @param code Cadence code - * @param args Cadence arguments - */ - async executeScript( - code: string, - args: fcl.ArgumentFunction, - defaultValue: T - ): Promise { - return await this.connector.executeScript(code, args, defaultValue); - } - - /** - * Build authorization - */ - buildAuthorization(accountIndex = 0, privateKey = this.privateKeyHex) { - if (this.account) { - if (accountIndex > this.maxKeyIndex) { - throw new Exception(50200, "Invalid account index"); - } - } - const address = this.address; - if (!privateKey) { - throw new Exception(50200, "No private key provided"); - } - return (account: any) => { - return { - ...account, - tempId: `${address}-${accountIndex}`, - addr: fcl.sansPrefix(address), - keyId: Number(accountIndex), - signingFunction: ( - signable: any - ): Promise => { - return Promise.resolve({ - f_type: "CompositeSignature", - f_vsn: "1.0.0", - addr: fcl.withPrefix(address), - keyId: Number(accountIndex), - signature: this.signMessage( - signable.message, - privateKey - ), - }); - }, - }; - }; - } - - /** - * Sign a message - * @param message Message to sign - */ - signMessage(message: string, privateKey = this.privateKeyHex) { - return PureSigner.signWithKey(privateKey, message); - } - - // ----- methods ----- - - /** - * Sync account info - */ - async syncAccountInfo() { - this.account = await this.connector.getAccount(this.address); - this.maxKeyIndex = this.account.keys.length - 1; - this.cache.set("balance", this.account.balance / 1e8); - elizaLogger.debug("Flow account info synced", { - address: this.address, - balance: this.account.balance, - maxKeyIndex: this.maxKeyIndex, - keys: this.account.keys, - }); - } - - /** - * Get the wallet balance - * @returns Wallet balance - */ - async getWalletBalance(forceRefresh = false): Promise { - const cachedBalance = await this.cache.get("balance"); - if (!forceRefresh && cachedBalance) { - return cachedBalance; - } - await this.syncAccountInfo(); - return this.account ? this.account.balance / 1e8 : 0; - } - - /** - * Query the balance of this wallet - */ - async queryAccountBalanceInfo() { - return await queries.queryAccountBalanceInfo(this, this.address); - } -} - -// ----- Helpers ----- - -/** - * Check if an address is a Flow address - * @param address Address to check - */ -export function isFlowAddress(address: string) { - const regExp = /^0x[a-fA-F0-9]{16}$/gi; - return regExp.test(address); -} - -/** - * Check if an address is an EVM address - * @param address Address to check - */ -export function isEVMAddress(address: string) { - const regExp = /^0x[a-fA-F0-9]{40}$/gi; - return regExp.test(address); -} - -/** - * Check if a string is a Cadence identifier - * @param str String to check - */ -export function isCadenceIdentifier(str: string) { - const cadenceIdentifier = /^A\.[0-9a-fA-F]{16}\.[0-9a-zA-Z_]+/; - return cadenceIdentifier.test(str); -} - -/** - * Get the signer address - */ -function getSignerAddress(runtime: IAgentRuntime): string { - const signerAddr = runtime.getSetting("FLOW_ADDRESS"); - if (!signerAddr) { - elizaLogger.error("No signer address"); - throw new Exception(50200, "No signer info"); - } - return signerAddr; -} - -const flowWalletProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State - ): Promise => { - // Check if the user has an Flow wallet - if ( - !runtime.getSetting("FLOW_ADDRESS") || - !runtime.getSetting("FLOW_PRIVATE_KEY") - ) { - elizaLogger.error( - "FLOW_ADDRESS or FLOW_PRIVATE_KEY not configured, skipping wallet injection" - ); - return null; - } - - try { - const connector = await getFlowConnectorInstance(runtime); - const walletProvider = new FlowWalletProvider(runtime, connector); - const info = await walletProvider.queryAccountBalanceInfo(); - if (!info || info?.address !== walletProvider.address) { - elizaLogger.error("Invalid account info"); - return null; - } - let output = `Here is user<${runtime.character.name}>'s wallet status:\n`; - output += `Flow wallet address: ${walletProvider.address}\n`; - output += `FLOW balance: ${info.balance} FLOW\n`; - output += `Flow wallet's COA(EVM) address: ${info.coaAddress || "unknown"}\n`; - output += `FLOW balance in COA(EVM) address: ${info.coaBalance ?? 0} FLOW`; - return output; - } catch (error) { - elizaLogger.error("Error in Flow wallet provider:", error.message); - return null; - } - }, -}; - -// Module exports -export { flowWalletProvider }; diff --git a/packages/plugin-flow/src/queries.ts b/packages/plugin-flow/src/queries.ts deleted file mode 100644 index 9bdae7dc01b..00000000000 --- a/packages/plugin-flow/src/queries.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { scripts } from "./assets/script.defs"; -import { FlowAccountBalanceInfo, IFlowScriptExecutor } from "./types"; - -/** - * Query the balance of an EVM ERC20 token - * @param executor - * @param owner - * @param evmContractAddress - */ -export async function queryEvmERC20BalanceOf( - executor: IFlowScriptExecutor, - owner: string, - evmContractAddress: string -): Promise { - const ret = await executor.executeScript( - scripts.evmERC20BalanceOf, - (arg, t) => [arg(owner, t.String), arg(evmContractAddress, t.String)], - BigInt(0) - ); - return BigInt(ret); -} - -/** - * Query the decimals of an EVM ERC20 token - * @param executor - * @param evmContractAddress - */ -export async function queryEvmERC20Decimals( - executor: IFlowScriptExecutor, - evmContractAddress: string -): Promise { - const ret = await executor.executeScript( - scripts.evmERC20GetDecimals, - (arg, t) => [arg(evmContractAddress, t.String)], - "0" - ); - return parseInt(ret); -} - -/** - * Query the total supply of an EVM ERC20 token - * @param executor - * @param evmContractAddress - */ -export async function queryEvmERC20TotalSupply( - executor: IFlowScriptExecutor, - evmContractAddress: string -): Promise { - const ret = await executor.executeScript( - scripts.evmERC20GetTotalSupply, - (arg, t) => [arg(evmContractAddress, t.String)], - BigInt(0) - ); - return BigInt(ret); -} - -/** - * Query the account info of a Flow address - * @param executor - * @param address - */ -export async function queryAccountBalanceInfo( - executor: IFlowScriptExecutor, - address: string -): Promise { - const ret = await executor.executeScript( - scripts.mainGetAccountInfo, - (arg, t) => [arg(address, t.Address)], - undefined - ); - if (!ret) { - return undefined; - } - return { - address: ret.address, - balance: parseFloat(ret.balance), - coaAddress: ret.coaAddress, - coaBalance: ret.coaBalance ? parseFloat(ret.coaBalance) : undefined, - }; -} diff --git a/packages/plugin-flow/src/templates/index.ts b/packages/plugin-flow/src/templates/index.ts deleted file mode 100644 index 66b27b18544..00000000000 --- a/packages/plugin-flow/src/templates/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -export const transferTemplate = `Given the recent messages and wallet information below: - -{{recentMessages}} - -{{walletInfo}} - -Extract the following information about the requested transfer: -- Field "token": Cadence Resource Identifier or ERC20 contract address (if not native token). this field should be null if the token is native token: $FLOW or FLOW. Examples for this field: - 1. For Cadence resource identifier, the field should be "A.1654653399040a61.ContractName" - 2. For ERC20 contract address, the field should be "0xe6ffc15a5bde7dd33c127670ba2b9fcb82db971a" -- Field "amount": Amount to transfer, it should be a number or a string. Examples for this field: - 1. "1000" - 2. 1000 -- Field "to": Recipient wallet address, can be EVM address or Cadence address. Examples for this field: - 1. Cadence address: "0x1654653399040a61" - 2. EVM address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" -- Field "matched": Boolean value indicating if field "token" matches the field "to" or not. Here is the rules: - 1. if field "token" is "null" or Cadence resource identifier, field "to" can be EVM address or Cadence address, so the value of "matched" should be true. - 2. if field "token" is ERC20 contract address, field "to" should be EVM address, so the value of "matched" should be true, otherwise false. - -Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined: - -\`\`\`json -{ - "token": string | null - "amount": number | string | null, - "to": string | null, - "matched": boolean -} -\`\`\` -`; diff --git a/packages/plugin-flow/src/tests/connector.test.ts b/packages/plugin-flow/src/tests/connector.test.ts deleted file mode 100644 index 9c56a246e75..00000000000 --- a/packages/plugin-flow/src/tests/connector.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { describe, it, expect, beforeEach, vi, afterEach } from "vitest"; -import { - getFlowConnectorInstance, - FlowConnectorProvider, -} from "../providers/connector.provider"; -import { defaultCharacter } from "@ai16z/eliza"; - -describe("ConnectorProvider", () => { - let connectorProvider: FlowConnectorProvider; - let mockedRuntime; - - beforeEach(async () => { - vi.clearAllMocks(); - - mockedRuntime = { - character: defaultCharacter, - getSetting: vi.fn().mockImplementation((key: string) => { - if (key === "FLOW_NETWORK") return "testnet"; - if (key === "FLOW_ENDPOINT_URL") return undefined; - return undefined; - }), - }; - - const connector = await getFlowConnectorInstance(mockedRuntime); - connectorProvider = new FlowConnectorProvider(connector); - }); - - afterEach(() => { - vi.clearAllTimers(); - }); - - describe("Connector", () => { - it("should check environment", () => { - const result = connectorProvider.getConnectorStatus(mockedRuntime); - - expect(result).toEqual( - `Eliza[0] Connected to\n` + - `Flow network: testnet\n` + - "Flow Endpoint: https://testnet.onflow.org\n" - ); - }); - }); -}); diff --git a/packages/plugin-flow/src/tests/wallet.test.ts b/packages/plugin-flow/src/tests/wallet.test.ts deleted file mode 100644 index da4afeeea32..00000000000 --- a/packages/plugin-flow/src/tests/wallet.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { describe, it, expect, beforeEach, vi, afterEach } from "vitest"; -import { defaultCharacter } from "@ai16z/eliza"; -import { getFlowConnectorInstance } from "../providers/connector.provider"; -import { FlowWalletProvider } from "../providers/wallet.provider"; - -// Mock NodeCache -vi.mock("node-cache", () => ({ - default: vi.fn().mockImplementation(() => ({ - set: vi.fn(), - get: vi.fn().mockReturnValue(null), - })), -})); - -// Mock path module -vi.mock("path", async () => { - const actual = await vi.importActual("path"); - return { - ...actual, - join: vi.fn().mockImplementation((...args) => args.join("/")), - }; -}); - -// Mock the ICacheManager -const mockCacheManager = { - get: vi.fn().mockResolvedValue(null), - set: vi.fn(), - delete: vi.fn(), -}; - -describe("WalletProvider", () => { - let walletProvider: FlowWalletProvider; - let mockedRuntime; - - beforeEach(async () => { - vi.clearAllMocks(); - mockCacheManager.get.mockResolvedValue(null); - - mockedRuntime = { - character: defaultCharacter, - getSetting: vi.fn().mockImplementation((key: string) => { - if (key === "FLOW_NETWORK") return "testnet"; - if (key === "FLOW_ENDPOINT_URL") return undefined; - if (key === "FLOW_ADDRESS") return "0xad5a851aeb126bca"; - // This is the private key for the testnet address above - if (key === "FLOW_PRIVATE_KEY") - return "0x09e3d2e8f479a63e011ec776b39f89ce0ba8ca115f450a7e2d1909e5f113f831"; - return undefined; - }), - }; - - // Create new instance of TokenProvider with mocked dependencies - const connector = await getFlowConnectorInstance(mockedRuntime); - walletProvider = new FlowWalletProvider( - mockedRuntime, - connector, - mockCacheManager as any - ); - }); - - afterEach(() => { - vi.clearAllTimers(); - }); - - describe("Wallet Integration", () => { - it("should check wallet info", async () => { - const result = await walletProvider.queryAccountBalanceInfo(); - const balance = await walletProvider.getWalletBalance(); - - expect(walletProvider.address).toEqual(result.address); - expect(balance).toEqual(result.balance); - }); - }); -}); diff --git a/packages/plugin-flow/src/types/exception.ts b/packages/plugin-flow/src/types/exception.ts deleted file mode 100644 index 1aa613064f3..00000000000 --- a/packages/plugin-flow/src/types/exception.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default class Exception extends Error { - constructor( - readonly code: number, - message?: string, - options?: ErrorOptions - ) { - super(message, options); - } -} diff --git a/packages/plugin-flow/src/types/fcl.d.ts b/packages/plugin-flow/src/types/fcl.d.ts deleted file mode 100644 index dbfe105dee8..00000000000 --- a/packages/plugin-flow/src/types/fcl.d.ts +++ /dev/null @@ -1,357 +0,0 @@ -declare module "*.cdc"; -declare module "*.cdc?raw"; - -declare module "@onflow/transport-grpc"; -declare module "@onflow/fcl-wc"; - -declare module "@onflow/config" { - // Config - export interface FlowConfig { - put: (key: string, value: unknown) => Promise; - get: (key: string, defaultValue: T) => Promise; - update: ( - key: string, - updateFn: (oldValue: T) => T - ) => Promise; - load: (opts: { flowJSON: object }) => Promise; - } - - export const config: FlowConfig; -} - -/* eslint-disable @typescript-eslint/no-explicit-any */ -declare module "@onflow/fcl" { - import * as ftypes from "@onflow/types"; - import { FlowConfig } from "@onflow/config"; - import type { - Account, - CompositeSignature, - TransactionStatus, - CurrentUser as UserData, - } from "@onflow/typedefs"; - - export enum TransactionStatusTypes { - Unknown = 0, - Pending, - Finalized, - Executed, - Sealed, - Expired, - } - - export type AnyJson = - | boolean - | number - | string - | null - | IJsonArray - | IJsonObject; - - export interface IJsonObject { - [key: string]: AnyJson; - } - - export interface FTypeSignature extends CompositeSignature { - f_type: "CompositeSignature"; - f_vsn: "1.0.0"; - } - - export interface SigningData { - message: string; - } - - export interface KeyObject { - index: number; - publicKey: string; - signAlgo: number; - hashAlgo: number; - weight: number; - sequenceNumber: number; - revoked: boolean; - } - - export interface AuthZ extends Account { - addr: string; - keyId: number; - signingFunction: (data: SigningData) => Promise; - } - - export type FclAuthorization = - | AuthZ - | ((acct: Account) => AuthZ) - | ((acct: Account) => Promise); - - export interface Service { - authn?: string; - f_type: string; - f_vsn: string; - id?: string; - identity?: Record; - provider?: Record; - scoped?: Record; - type: string; - uid: string; - data?: any; - network?: string; - } - - export interface UserSnapshot extends UserData { - services?: Service[]; - } - - export interface CadenceEvent { - blockId: string; - blockHeight: number; - blockTimestamp: string; - type: string; - transactionId: string; - transactionIndex: number; - eventIndex: number; - data?: Record; - } - - export interface CadenceResult { - events: CadenceEvent[]; - status: number; - statusCode: number; - errorMessage: string; - // TODO -- require once implemented in FCL - // https://github.com/onflow/fcl-js/issues/926 - transactionId?: string; - } - - export interface Argument { - value: any; - xform: any; // FType - } - - type TxSubCallback = (tx: TransactionStatus) => void; - - export interface TransactionResult { - snapshot: () => TransactionStatusTypes; - subscribe: (callback?: TxSubCallback) => Promise<() => void>; - onceFinalized: (callback?: TxSubCallback) => Promise; - onceExecuted: (callback?: TxSubCallback) => Promise; - onceSealed: (callback?: TxSubCallback) => Promise; - } - - export interface Interaction { - tag: string; - assigns: Record; - status: string; - reason: string | null; - accounts: Record; - params: Record; - arguments: Record; - message: Record; - /* - { - cadence: null; - refBlock: null; - computeLimit: null; - proposer: null; - payer: null; - authorizations: []; - params: []; - arguments: []; - }; - */ - proposer: string | null; - authorizations: unknown[]; - payer: string | null; - events: Record; - /*{ - eventType: null; - start: null; - end: null; - blockIds: []; - }; - */ - transaction: { - id: string | null; - }; - block: { - id: number | null; - height: number | null; - isSealed: boolean; - }; - account: { - addr: string | null; - }; - collection: { - id: string | null; - }; - } - - export type Pipe = (ix: Interaction) => Interaction; - - type IJsonArray = Array; - - export type Decoder = (dictionary, decoders, stack) => Record; - export type DecoderGroup = Record; - export type Response = IJsonObject; - - export interface CollectionGuaranteeObject { - collectionId: string; - signatures: TransactionSignature[]; - } - - export interface BlockHeaderObject { - id: string; - parentId: string; - height: number; - timestamp: string; - } - - export interface BlockObject extends BlockHeaderObject { - id: string; - parentId: string; - height: number; - timestamp: any; - collectionGuarantees: CollectionGuaranteeObject; - blockSeals: any; - signatures: TransactionSignature[]; - } - - type ArgumentFunction = ( - argFunc: typeof arg, - t: typeof ftypes - ) => Array; - - export function query(opts: { - cadence: string; - args?: ArgumentFunction; - limit?: number; - }): Promise; - - export function mutate(opts: { - cadence: string; - args?: ArgumentFunction; - limit?: number; - proposer?: FclAuthorization; - payer?: FclAuthorization; - authorizations?: FclAuthorization[]; - }): Promise; - - export function send(args: any, opts?: any): Promise; - - export function decode( - decodeInstructions: any, - customDecoders?: DecoderGroup, - stack?: Array - ): Promise; - - export function getChainId(): Promise; - - export function getBlockHeader(): Promise; - - export function sansPrefix(address: string): string; - - export function withPrefix(address: string): string; - - export function tx(transactionId: any): TransactionResult; - - // tx checker - tx.isUnknown = (_tx: TransactionStatus) => boolean; - tx.isPending = (_tx: TransactionStatus) => boolean; - tx.isFinalized = (_tx: TransactionStatus) => boolean; - tx.isExecuted = (_tx: TransactionStatus) => boolean; - tx.isSealed = (_tx: TransactionStatus) => boolean; - tx.isExpired = (_tx: TransactionStatus) => boolean; - - export function authenticate(): Promise; - export function unauthenticate(): void; - export function reauthenticate(): Promise; - export function authorization(account: Account): Promise; - export function verifyUserSignatures( - msg: string, - compSigs: TransactionSignature[] - ): Promise; - - type SubscribeCallback = (user: UserSnapshot) => void; - - export interface CurrentUser { - authenticate: typeof authenticate; - unauthenticate: typeof unauthenticate; - authorization: typeof authorization; - signUserMessage: (msg: string) => Promise; - subscribe: (callback: SubscribeCallback) => void; - snapshot: () => Promise; - } - - export const currentUser: CurrentUser; - - export const authz: AuthZ; - - export function config(): FlowConfig; - - // Utils - export interface AccountProofData { - address: string; - nonce: string; - signatures: FTypeSignature[]; - } - export interface VerifySigOption { - fclCryptoContract?: string; - } - - export interface AppUtils { - verifyAccountProof: ( - appIdentifier: string, - accountProofData: AccountProofData, - opts?: VerifySigOption - ) => Promise; - - verifyUserSignatures: ( - message: string, - signatures: FTypeSignature[], - opts?: VerifySigOption - ) => Promise; - } - export const AppUtils: AppUtils; - - export interface WalletUtils { - encodeAccountProof: ( - accountProofData: { - address: string; - nonce: string; - appIdentifier: string; - }, - includeDomainTag?: boolean - ) => string; - } - export const WalletUtils: WalletUtils; - - export interface PluginRegistry { - add(plugin: any): void; - } - export const pluginRegistry: PluginRegistry; - - // SDK - export function getAccount(address: string): Pipe; - export function getBlock(isSealed?: boolean): Pipe; - export function atBlockId(blockId: string): Pipe; - export function atBlockHeight(blockHeight: number): Pipe; - export function getTransaction(transactionId: string): Pipe; - export function getTransactionStatus(transactionId: string): Pipe; - export function getEventsAtBlockIds( - eventType: string, - blockIds: string[] - ): Pipe; - export function getEventsAtBlockHeightRange( - eventName: string, - fromBlockHeight: number, - toBlockHeight: number - ): Pipe; - - export function build(fns?: Pipe[]): Pipe; - export function script(code: string): Interaction; - export function transaction(...args: any): Interaction; - - export function payer(authz: FclAuthorization): Pipe; - export function proposer(authz: FclAuthorization): Pipe; - export function authorizations(ax: FclAuthorization[]): Pipe; - export function args(ax: Argument[]): Pipe; - export function arg(value: any, xform: any): Argument; - export function limit(computeLimit: number): Pipe; -} diff --git a/packages/plugin-flow/src/types/index.ts b/packages/plugin-flow/src/types/index.ts deleted file mode 100644 index 14a35b5ea3c..00000000000 --- a/packages/plugin-flow/src/types/index.ts +++ /dev/null @@ -1,52 +0,0 @@ -import * as fcl from "@onflow/fcl"; -import type { Account } from "@onflow/typedefs"; - -export interface IFlowScriptExecutor { - /** - * Execute a script - * @param code Cadence code - * @param args Cadence arguments - */ - executeScript( - code: string, - args: fcl.ArgumentFunction, - defaultValue: T - ): Promise; -} - -/** - * Signer interface - */ -export interface IFlowSigner { - /** - * Send a transaction - */ - sendTransaction( - code: string, - args: fcl.ArgumentFunction, - authz?: fcl.FclAuthorization - ): Promise; - - /** - * Build authorization - */ - buildAuthorization( - accountIndex?: number, - privateKey?: string - ): (acct: Account) => Promise; -} - -export interface TransactionResponse { - signer: { - address: string; - keyIndex: number; - }; - txid: string; -} - -export interface FlowAccountBalanceInfo { - address: string; - balance: number; - coaAddress?: string; - coaBalance?: number; -} diff --git a/packages/plugin-flow/tsconfig.json b/packages/plugin-flow/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/plugin-flow/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-flow/tsup.config.ts b/packages/plugin-flow/tsup.config.ts deleted file mode 100644 index 7f072ccb784..00000000000 --- a/packages/plugin-flow/tsup.config.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - loader: { - ".cdc": "text", - }, - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "safe-buffer", - "base-x", - "bs58", - "borsh", - "stream", - "buffer", - "querystring", - "amqplib", - // Add other modules you want to externalize - "@onflow/fcl", - "@onflow/types", - "sha3", - "elliptic", - ], -}); diff --git a/packages/plugin-flow/vitest.config.ts b/packages/plugin-flow/vitest.config.ts deleted file mode 100644 index 25e47c5f89b..00000000000 --- a/packages/plugin-flow/vitest.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { defineConfig } from "vitest/config"; -import path from "path"; - -export default defineConfig({ - test: { - environment: "node", - testTimeout: 120000, - }, - assetsInclude: ["**/*.cdc"], - resolve: { - alias: { - "@": path.resolve(__dirname, "./src"), - }, - }, -}); diff --git a/packages/plugin-icp/package.json b/packages/plugin-icp/package.json deleted file mode 100644 index 4c14bacbf37..00000000000 --- a/packages/plugin-icp/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@ai16z/plugin-icp", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@dfinity/agent": "2.1.3", - "@dfinity/candid": "2.1.3", - "@dfinity/identity": "2.1.3", - "@dfinity/principal": "2.1.3" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "devDependencies": { - "@types/jest": "29.5.14", - "jest": "29.7.0", - "tsup": "8.3.5", - "typescript": "5.6.3" - } -} diff --git a/packages/plugin-icp/src/actions/prompts/token.ts b/packages/plugin-icp/src/actions/prompts/token.ts deleted file mode 100644 index 8e183eb0b29..00000000000 --- a/packages/plugin-icp/src/actions/prompts/token.ts +++ /dev/null @@ -1,34 +0,0 @@ -export const createTokenTemplate = `Based on the user's description, generate creative and memorable values for a new meme token on PickPump: - -User's idea: "{{recentMessages}}" - -Please generate: -1. A catchy and fun token name that reflects the theme -2. A 3-4 letter symbol based on the name (all caps) -3. An engaging and humorous description (include emojis) -4. Set other fields to null - -Example response: -\`\`\`json -{ - "name": "CatLaser", - "symbol": "PAWS", - "description": "The first meme token powered by feline laser-chasing energy! Watch your investment zoom around like a red dot! 😺🔴✨", - "logo": null, - "website": null, - "twitter": null, - "telegram": null -} -\`\`\` - -Generate appropriate meme token information based on the user's description. -Respond with a JSON markdown block containing only the generated values.`; - -export const logoPromptTemplate = `Based on this token idea: "{{description}}", create a detailed prompt for generating a logo image. -The prompt should describe visual elements, style, and mood for the logo. -Focus on making it memorable and suitable for a cryptocurrency token. -Keep the response short and specific. -Respond with only the prompt text, no additional formatting. - -Example for a dog-themed token: -"A playful cartoon dog face with a cryptocurrency symbol on its collar, using vibrant colors and bold outlines, crypto-themed minimal style"`; diff --git a/packages/plugin-icp/src/apis/uploadFile.ts b/packages/plugin-icp/src/apis/uploadFile.ts deleted file mode 100644 index 9ae17c8b905..00000000000 --- a/packages/plugin-icp/src/apis/uploadFile.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { WEB3_STORAGE_API_HOST } from '../constants/apis'; - -interface UploadResponse { - success: boolean; - cid?: string; - urls?: { - direct: string; - raw: string; - gateway: string; - }; - type?: string; - name?: string; - size?: number; - error?: string; -} - -export async function uploadFileToWeb3Storage( - base64Data: string, - fileName: string = "image.png" -): Promise { - try { - // Remove base64 URL prefix (if exists) - const cleanBase64 = base64Data.replace(/^data:image\/\w+;base64,/, ""); - - // Convert base64 to Blob - const byteCharacters = atob(cleanBase64); - const byteNumbers = new Array(byteCharacters.length); - - for (let i = 0; i < byteCharacters.length; i++) { - byteNumbers[i] = byteCharacters.charCodeAt(i); - } - - const byteArray = new Uint8Array(byteNumbers); - const blob = new Blob([byteArray], { type: "image/png" }); - - // Create file object - const file = new File([blob], fileName, { type: "image/png" }); - - const formData = new FormData(); - formData.append("file", file); - - const response = await fetch(WEB3_STORAGE_API_HOST, { - method: "POST", - body: formData, - }); - - if (!response.ok) { - throw new Error(`Upload failed with status: ${response.status}`); - } - - const result: UploadResponse = await response.json(); - return result; - } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : "upload failed", - }; - } -} diff --git a/packages/plugin-icp/src/canisters/pick-pump/index.did.d.ts b/packages/plugin-icp/src/canisters/pick-pump/index.did.d.ts deleted file mode 100644 index 020daa4246d..00000000000 --- a/packages/plugin-icp/src/canisters/pick-pump/index.did.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -import type { Principal } from "@dfinity/principal"; -import type { ActorMethod } from "@dfinity/agent"; -import type { IDL } from "@dfinity/candid"; - -export interface Candle { - low: number; - high: number; - close: number; - open: number; - timestamp: bigint; -} -export interface Comment { - creator: string; - token: string; - content: string; - created_at: bigint; - image: [] | [string]; -} -export interface CreateCommentArg { - token: string; - content: string; - image: [] | [string]; -} -export interface CreateMemeTokenArg { - twitter: [] | [string]; - logo: string; - name: string; - description: string; - website: [] | [string]; - telegram: [] | [string]; - symbol: string; -} -export interface Holder { - balance: bigint; - owner: string; -} -export interface InitArg { - fee_receiver: Principal; - create_token_fee: [] | [bigint]; - icp_canister_id: Principal; - maintenance: boolean; - fee_percentage: [] | [number]; -} -export interface MemeToken { - id: bigint; - creator: string; - available_token: bigint; - twitter: [] | [string]; - volume_24h: bigint; - logo: string; - name: string; - liquidity: number; - description: string; - created_at: bigint; - website: [] | [string]; - last_tx_time: bigint; - canister: [] | [string]; - market_cap_icp: bigint; - market_cap_usd: number; - price: number; - telegram: [] | [string]; - symbol: string; -} -export interface MemeTokenView { - token: MemeToken; - balance: bigint; -} -export type Result = { Ok: bigint } | { Err: string }; -export type Result_1 = { Ok: MemeToken } | { Err: string }; -export type Sort = - | { CreateTimeDsc: null } - | { LastTradeDsc: null } - | { MarketCapDsc: null }; -export interface Transaction { - token_amount: bigint; - token_id: bigint; - token_symbol: string; - from: string; - timestamp: bigint; - icp_amount: bigint; - tx_type: string; -} -export interface User { - principal: string; - name: string; - last_login_seconds: bigint; - register_at_second: bigint; - avatar: string; -} -export interface WalletReceiveResult { - accepted: bigint; -} -export interface _SERVICE { - buy: ActorMethod<[bigint, number], Result>; - calculate_buy: ActorMethod<[bigint, number], Result>; - calculate_sell: ActorMethod<[bigint, number], Result>; - create_token: ActorMethod<[CreateMemeTokenArg], Result_1>; - king_of_hill: ActorMethod<[], [] | [MemeToken]>; - last_txs: ActorMethod<[bigint], Array>; - post_comment: ActorMethod<[CreateCommentArg], undefined>; - query_all_tokens: ActorMethod< - [bigint, bigint, [] | [Sort]], - [Array, bigint] - >; - query_token: ActorMethod<[bigint], [] | [MemeToken]>; - query_token_candle: ActorMethod<[bigint, [] | [bigint]], Array>; - query_token_comments: ActorMethod< - [Principal, bigint, bigint], - [Array, bigint] - >; - query_token_holders: ActorMethod< - [bigint, bigint, bigint], - [Array, bigint] - >; - query_token_transactions: ActorMethod< - [bigint, bigint, bigint], - [Array, bigint] - >; - query_user: ActorMethod<[[] | [Principal]], User>; - query_user_launched: ActorMethod<[[] | [Principal]], Array>; - query_user_tokens: ActorMethod<[[] | [Principal]], Array>; - sell: ActorMethod<[bigint, number], Result>; - wallet_balance: ActorMethod<[], bigint>; - wallet_receive: ActorMethod<[], WalletReceiveResult>; -} -export declare const idlFactory: IDL.InterfaceFactory; diff --git a/packages/plugin-icp/src/canisters/pick-pump/index.did.ts b/packages/plugin-icp/src/canisters/pick-pump/index.did.ts deleted file mode 100644 index 58572078c21..00000000000 --- a/packages/plugin-icp/src/canisters/pick-pump/index.did.ts +++ /dev/null @@ -1,129 +0,0 @@ -// biome-ignore lint/suspicious/noExplicitAny: -export const idlFactory = ({ IDL }: { IDL: any }) => { - const Result = IDL.Variant({ Ok: IDL.Nat, Err: IDL.Text }); - const CreateMemeTokenArg = IDL.Record({ - twitter: IDL.Opt(IDL.Text), - logo: IDL.Text, - name: IDL.Text, - description: IDL.Text, - website: IDL.Opt(IDL.Text), - telegram: IDL.Opt(IDL.Text), - symbol: IDL.Text, - }); - const MemeToken = IDL.Record({ - id: IDL.Nat64, - creator: IDL.Text, - available_token: IDL.Nat, - twitter: IDL.Opt(IDL.Text), - volume_24h: IDL.Nat, - logo: IDL.Text, - name: IDL.Text, - liquidity: IDL.Float64, - description: IDL.Text, - created_at: IDL.Nat64, - website: IDL.Opt(IDL.Text), - last_tx_time: IDL.Nat64, - canister: IDL.Opt(IDL.Text), - market_cap_icp: IDL.Nat, - market_cap_usd: IDL.Float64, - price: IDL.Float64, - telegram: IDL.Opt(IDL.Text), - symbol: IDL.Text, - }); - const Result_1 = IDL.Variant({ Ok: MemeToken, Err: IDL.Text }); - const Transaction = IDL.Record({ - token_amount: IDL.Nat, - token_id: IDL.Nat64, - token_symbol: IDL.Text, - from: IDL.Text, - timestamp: IDL.Nat64, - icp_amount: IDL.Nat, - tx_type: IDL.Text, - }); - const CreateCommentArg = IDL.Record({ - token: IDL.Text, - content: IDL.Text, - image: IDL.Opt(IDL.Text), - }); - const Sort = IDL.Variant({ - CreateTimeDsc: IDL.Null, - LastTradeDsc: IDL.Null, - MarketCapDsc: IDL.Null, - }); - const Candle = IDL.Record({ - low: IDL.Float64, - high: IDL.Float64, - close: IDL.Float64, - open: IDL.Float64, - timestamp: IDL.Nat64, - }); - const Comment = IDL.Record({ - creator: IDL.Text, - token: IDL.Text, - content: IDL.Text, - created_at: IDL.Nat64, - image: IDL.Opt(IDL.Text), - }); - const Holder = IDL.Record({ balance: IDL.Nat, owner: IDL.Text }); - const User = IDL.Record({ - principal: IDL.Text, - name: IDL.Text, - last_login_seconds: IDL.Nat64, - register_at_second: IDL.Nat64, - avatar: IDL.Text, - }); - const MemeTokenView = IDL.Record({ - token: MemeToken, - balance: IDL.Nat, - }); - const WalletReceiveResult = IDL.Record({ accepted: IDL.Nat64 }); - return IDL.Service({ - buy: IDL.Func([IDL.Nat64, IDL.Float64], [Result], []), - calculate_buy: IDL.Func([IDL.Nat64, IDL.Float64], [Result], ["query"]), - calculate_sell: IDL.Func([IDL.Nat64, IDL.Float64], [Result], ["query"]), - create_token: IDL.Func([CreateMemeTokenArg], [Result_1], []), - king_of_hill: IDL.Func([], [IDL.Opt(MemeToken)], ["query"]), - last_txs: IDL.Func([IDL.Nat64], [IDL.Vec(Transaction)], ["query"]), - post_comment: IDL.Func([CreateCommentArg], [], []), - query_all_tokens: IDL.Func( - [IDL.Nat64, IDL.Nat64, IDL.Opt(Sort)], - [IDL.Vec(MemeToken), IDL.Nat64], - ["query"] - ), - query_token: IDL.Func([IDL.Nat64], [IDL.Opt(MemeToken)], ["query"]), - query_token_candle: IDL.Func( - [IDL.Nat64, IDL.Opt(IDL.Nat64)], - [IDL.Vec(Candle)], - ["query"] - ), - query_token_comments: IDL.Func( - [IDL.Principal, IDL.Nat64, IDL.Nat64], - [IDL.Vec(Comment), IDL.Nat64], - ["query"] - ), - query_token_holders: IDL.Func( - [IDL.Nat64, IDL.Nat64, IDL.Nat64], - [IDL.Vec(Holder), IDL.Nat64], - ["query"] - ), - query_token_transactions: IDL.Func( - [IDL.Nat64, IDL.Nat64, IDL.Nat64], - [IDL.Vec(Transaction), IDL.Nat64], - ["query"] - ), - query_user: IDL.Func([IDL.Opt(IDL.Principal)], [User], ["query"]), - query_user_launched: IDL.Func( - [IDL.Opt(IDL.Principal)], - [IDL.Vec(MemeToken)], - ["query"] - ), - query_user_tokens: IDL.Func( - [IDL.Opt(IDL.Principal)], - [IDL.Vec(MemeTokenView)], - ["query"] - ), - sell: IDL.Func([IDL.Nat64, IDL.Float64], [Result], []), - wallet_balance: IDL.Func([], [IDL.Nat], ["query"]), - wallet_receive: IDL.Func([], [WalletReceiveResult], []), - }); -}; diff --git a/packages/plugin-icp/src/canisters/token-icrc1/index.did.d.ts b/packages/plugin-icp/src/canisters/token-icrc1/index.did.d.ts deleted file mode 100644 index cc7a97dc23f..00000000000 --- a/packages/plugin-icp/src/canisters/token-icrc1/index.did.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -import type { ActorMethod } from "@dfinity/agent"; -import type { IDL } from "@dfinity/candid"; -import type { Principal } from "@dfinity/principal"; - -export interface Account { - owner: Principal; - subaccount: [] | [Uint8Array | number[]]; -} -export interface AccountBalanceArgs { - account: string; -} -export interface Allowance { - allowance: bigint; - expires_at: [] | [bigint]; -} -export interface AllowanceArgs { - account: Account; - spender: Account; -} -export interface ApproveArgs { - fee: [] | [bigint]; - memo: [] | [Uint8Array | number[]]; - from_subaccount: [] | [Uint8Array | number[]]; - created_at_time: [] | [bigint]; - amount: bigint; - expected_allowance: [] | [bigint]; - expires_at: [] | [bigint]; - spender: Account; -} -export type ApproveError = - | { - GenericError: { message: string; error_code: bigint }; - } - | { TemporarilyUnavailable: null } - | { Duplicate: { duplicate_of: bigint } } - | { BadFee: { expected_fee: bigint } } - | { AllowanceChanged: { current_allowance: bigint } } - | { CreatedInFuture: { ledger_time: bigint } } - | { TooOld: null } - | { Expired: { ledger_time: bigint } } - | { InsufficientFunds: { balance: bigint } }; -export interface ArchiveInfo { - canister_id: Principal; -} -export interface ArchiveOptions { - num_blocks_to_archive: bigint; - max_transactions_per_response: [] | [bigint]; - trigger_threshold: bigint; - more_controller_ids: [] | [Array]; - max_message_size_bytes: [] | [bigint]; - cycles_for_archive_creation: [] | [bigint]; - node_max_memory_size_bytes: [] | [bigint]; - controller_id: Principal; -} -export interface ArchivedBlocksRange { - callback: [Principal, string]; - start: bigint; - length: bigint; -} -export interface ArchivedEncodedBlocksRange { - callback: [Principal, string]; - start: bigint; - length: bigint; -} -export interface Archives { - archives: Array; -} -export interface BinaryAccountBalanceArgs { - account: Uint8Array | number[]; -} -export interface BlockRange { - blocks: Array; -} -export interface CandidBlock { - transaction: CandidTransaction; - timestamp: TimeStamp; - parent_hash: [] | [Uint8Array | number[]]; -} -export type CandidOperation = - | { - Approve: { - fee: Tokens; - from: Uint8Array | number[]; - allowance_e8s: bigint; - allowance: Tokens; - expected_allowance: [] | [Tokens]; - expires_at: [] | [TimeStamp]; - spender: Uint8Array | number[]; - }; - } - | { - Burn: { - from: Uint8Array | number[]; - amount: Tokens; - spender: [] | [Uint8Array | number[]]; - }; - } - | { Mint: { to: Uint8Array | number[]; amount: Tokens } } - | { - Transfer: { - to: Uint8Array | number[]; - fee: Tokens; - from: Uint8Array | number[]; - amount: Tokens; - spender: [] | [Uint8Array | number[]]; - }; - }; -export interface CandidTransaction { - memo: bigint; - icrc1_memo: [] | [Uint8Array | number[]]; - operation: [] | [CandidOperation]; - created_at_time: TimeStamp; -} -export interface Decimals { - decimals: number; -} -export interface Duration { - secs: bigint; - nanos: number; -} -export interface FeatureFlags { - icrc2: boolean; -} -export interface GetBlocksArgs { - start: bigint; - length: bigint; -} -export type GetBlocksError = - | { - BadFirstBlockIndex: { - requested_index: bigint; - first_valid_index: bigint; - }; - } - | { Other: { error_message: string; error_code: bigint } }; -export interface InitArgs { - send_whitelist: Array; - token_symbol: [] | [string]; - transfer_fee: [] | [Tokens]; - minting_account: string; - maximum_number_of_accounts: [] | [bigint]; - accounts_overflow_trim_quantity: [] | [bigint]; - transaction_window: [] | [Duration]; - max_message_size_bytes: [] | [bigint]; - icrc1_minting_account: [] | [Account]; - archive_options: [] | [ArchiveOptions]; - initial_values: Array<[string, Tokens]>; - token_name: [] | [string]; - feature_flags: [] | [FeatureFlags]; -} -export type LedgerCanisterPayload = - | { Upgrade: [] | [UpgradeArgs] } - | { Init: InitArgs }; -export type MetadataValue = - | { Int: bigint } - | { Nat: bigint } - | { Blob: Uint8Array | number[] } - | { Text: string }; -export interface Name { - name: string; -} -export interface QueryBlocksResponse { - certificate: [] | [Uint8Array | number[]]; - blocks: Array; - chain_length: bigint; - first_block_index: bigint; - archived_blocks: Array; -} -export interface QueryEncodedBlocksResponse { - certificate: [] | [Uint8Array | number[]]; - blocks: Array; - chain_length: bigint; - first_block_index: bigint; - archived_blocks: Array; -} -export type Result = { Ok: bigint } | { Err: TransferError }; -export type Result_1 = { Ok: bigint } | { Err: ApproveError }; -export type Result_2 = { Ok: bigint } | { Err: TransferFromError }; -export type Result_3 = { Ok: BlockRange } | { Err: GetBlocksError }; -export type Result_4 = - | { Ok: Array } - | { Err: GetBlocksError }; -export type Result_5 = { Ok: bigint } | { Err: TransferError_1 }; -export interface SendArgs { - to: string; - fee: Tokens; - memo: bigint; - from_subaccount: [] | [Uint8Array | number[]]; - created_at_time: [] | [TimeStamp]; - amount: Tokens; -} -export interface StandardRecord { - url: string; - name: string; -} -export interface Symbol { - symbol: string; -} -export interface TimeStamp { - timestamp_nanos: bigint; -} -export interface Tokens { - e8s: bigint; -} -export interface TransferArg { - to: Account; - fee: [] | [bigint]; - memo: [] | [Uint8Array | number[]]; - from_subaccount: [] | [Uint8Array | number[]]; - created_at_time: [] | [bigint]; - amount: bigint; -} -export interface TransferArgs { - to: Uint8Array | number[]; - fee: Tokens; - memo: bigint; - from_subaccount: [] | [Uint8Array | number[]]; - created_at_time: [] | [TimeStamp]; - amount: Tokens; -} -export type TransferError = - | { - GenericError: { message: string; error_code: bigint }; - } - | { TemporarilyUnavailable: null } - | { BadBurn: { min_burn_amount: bigint } } - | { Duplicate: { duplicate_of: bigint } } - | { BadFee: { expected_fee: bigint } } - | { CreatedInFuture: { ledger_time: bigint } } - | { TooOld: null } - | { InsufficientFunds: { balance: bigint } }; -export type TransferError_1 = - | { - TxTooOld: { allowed_window_nanos: bigint }; - } - | { BadFee: { expected_fee: Tokens } } - | { TxDuplicate: { duplicate_of: bigint } } - | { TxCreatedInFuture: null } - | { InsufficientFunds: { balance: Tokens } }; -export interface TransferFee { - transfer_fee: Tokens; -} -export interface TransferFromArgs { - to: Account; - fee: [] | [bigint]; - spender_subaccount: [] | [Uint8Array | number[]]; - from: Account; - memo: [] | [Uint8Array | number[]]; - created_at_time: [] | [bigint]; - amount: bigint; -} -export type TransferFromError = - | { - GenericError: { message: string; error_code: bigint }; - } - | { TemporarilyUnavailable: null } - | { InsufficientAllowance: { allowance: bigint } } - | { BadBurn: { min_burn_amount: bigint } } - | { Duplicate: { duplicate_of: bigint } } - | { BadFee: { expected_fee: bigint } } - | { CreatedInFuture: { ledger_time: bigint } } - | { TooOld: null } - | { InsufficientFunds: { balance: bigint } }; -export interface UpgradeArgs { - maximum_number_of_accounts: [] | [bigint]; - icrc1_minting_account: [] | [Account]; - feature_flags: [] | [FeatureFlags]; -} -export interface _SERVICE { - account_balance: ActorMethod<[BinaryAccountBalanceArgs], Tokens>; - account_balance_dfx: ActorMethod<[AccountBalanceArgs], Tokens>; - account_identifier: ActorMethod<[Account], Uint8Array | number[]>; - archives: ActorMethod<[], Archives>; - decimals: ActorMethod<[], Decimals>; - icrc1_balance_of: ActorMethod<[Account], bigint>; - icrc1_decimals: ActorMethod<[], number>; - icrc1_fee: ActorMethod<[], bigint>; - icrc1_metadata: ActorMethod<[], Array<[string, MetadataValue]>>; - icrc1_minting_account: ActorMethod<[], [] | [Account]>; - icrc1_name: ActorMethod<[], string>; - icrc1_supported_standards: ActorMethod<[], Array>; - icrc1_symbol: ActorMethod<[], string>; - icrc1_total_supply: ActorMethod<[], bigint>; - icrc1_transfer: ActorMethod<[TransferArg], Result>; - icrc2_allowance: ActorMethod<[AllowanceArgs], Allowance>; - icrc2_approve: ActorMethod<[ApproveArgs], Result_1>; - icrc2_transfer_from: ActorMethod<[TransferFromArgs], Result_2>; - name: ActorMethod<[], Name>; - query_blocks: ActorMethod<[GetBlocksArgs], QueryBlocksResponse>; - query_encoded_blocks: ActorMethod< - [GetBlocksArgs], - QueryEncodedBlocksResponse - >; - send_dfx: ActorMethod<[SendArgs], bigint>; - symbol: ActorMethod<[], Symbol>; - transfer: ActorMethod<[TransferArgs], Result_5>; - // biome-ignore lint/complexity/noBannedTypes: - transfer_fee: ActorMethod<[{}], TransferFee>; -} -export declare const idlFactory: IDL.InterfaceFactory; -export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/plugin-icp/src/canisters/token-icrc1/index.did.ts b/packages/plugin-icp/src/canisters/token-icrc1/index.did.ts deleted file mode 100644 index 459d2476983..00000000000 --- a/packages/plugin-icp/src/canisters/token-icrc1/index.did.ts +++ /dev/null @@ -1,341 +0,0 @@ -// biome-ignore lint/suspicious/noExplicitAny: -export const idlFactory = ({ IDL }: { IDL: any }) => { - const Account = IDL.Record({ - owner: IDL.Principal, - subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), - }); - const FeatureFlags = IDL.Record({ icrc2: IDL.Bool }); - const UpgradeArgs = IDL.Record({ - maximum_number_of_accounts: IDL.Opt(IDL.Nat64), - icrc1_minting_account: IDL.Opt(Account), - feature_flags: IDL.Opt(FeatureFlags), - }); - const Tokens = IDL.Record({ e8s: IDL.Nat64 }); - const Duration = IDL.Record({ secs: IDL.Nat64, nanos: IDL.Nat32 }); - const ArchiveOptions = IDL.Record({ - num_blocks_to_archive: IDL.Nat64, - max_transactions_per_response: IDL.Opt(IDL.Nat64), - trigger_threshold: IDL.Nat64, - more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)), - max_message_size_bytes: IDL.Opt(IDL.Nat64), - cycles_for_archive_creation: IDL.Opt(IDL.Nat64), - node_max_memory_size_bytes: IDL.Opt(IDL.Nat64), - controller_id: IDL.Principal, - }); - const InitArgs = IDL.Record({ - send_whitelist: IDL.Vec(IDL.Principal), - token_symbol: IDL.Opt(IDL.Text), - transfer_fee: IDL.Opt(Tokens), - minting_account: IDL.Text, - maximum_number_of_accounts: IDL.Opt(IDL.Nat64), - accounts_overflow_trim_quantity: IDL.Opt(IDL.Nat64), - transaction_window: IDL.Opt(Duration), - max_message_size_bytes: IDL.Opt(IDL.Nat64), - icrc1_minting_account: IDL.Opt(Account), - archive_options: IDL.Opt(ArchiveOptions), - initial_values: IDL.Vec(IDL.Tuple(IDL.Text, Tokens)), - token_name: IDL.Opt(IDL.Text), - feature_flags: IDL.Opt(FeatureFlags), - }); - const LedgerCanisterPayload = IDL.Variant({ - Upgrade: IDL.Opt(UpgradeArgs), - Init: InitArgs, - }); - const BinaryAccountBalanceArgs = IDL.Record({ - account: IDL.Vec(IDL.Nat8), - }); - const AccountBalanceArgs = IDL.Record({ account: IDL.Text }); - const ArchiveInfo = IDL.Record({ canister_id: IDL.Principal }); - const Archives = IDL.Record({ archives: IDL.Vec(ArchiveInfo) }); - const Decimals = IDL.Record({ decimals: IDL.Nat32 }); - const MetadataValue = IDL.Variant({ - Int: IDL.Int, - Nat: IDL.Nat, - Blob: IDL.Vec(IDL.Nat8), - Text: IDL.Text, - }); - const StandardRecord = IDL.Record({ url: IDL.Text, name: IDL.Text }); - const TransferArg = IDL.Record({ - to: Account, - fee: IDL.Opt(IDL.Nat), - memo: IDL.Opt(IDL.Vec(IDL.Nat8)), - from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), - created_at_time: IDL.Opt(IDL.Nat64), - amount: IDL.Nat, - }); - const TransferError = IDL.Variant({ - GenericError: IDL.Record({ - message: IDL.Text, - error_code: IDL.Nat, - }), - TemporarilyUnavailable: IDL.Null, - BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }), - Duplicate: IDL.Record({ duplicate_of: IDL.Nat }), - BadFee: IDL.Record({ expected_fee: IDL.Nat }), - CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }), - TooOld: IDL.Null, - InsufficientFunds: IDL.Record({ balance: IDL.Nat }), - }); - const Result = IDL.Variant({ Ok: IDL.Nat, Err: TransferError }); - const AllowanceArgs = IDL.Record({ - account: Account, - spender: Account, - }); - const Allowance = IDL.Record({ - allowance: IDL.Nat, - expires_at: IDL.Opt(IDL.Nat64), - }); - const ApproveArgs = IDL.Record({ - fee: IDL.Opt(IDL.Nat), - memo: IDL.Opt(IDL.Vec(IDL.Nat8)), - from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), - created_at_time: IDL.Opt(IDL.Nat64), - amount: IDL.Nat, - expected_allowance: IDL.Opt(IDL.Nat), - expires_at: IDL.Opt(IDL.Nat64), - spender: Account, - }); - const ApproveError = IDL.Variant({ - GenericError: IDL.Record({ - message: IDL.Text, - error_code: IDL.Nat, - }), - TemporarilyUnavailable: IDL.Null, - Duplicate: IDL.Record({ duplicate_of: IDL.Nat }), - BadFee: IDL.Record({ expected_fee: IDL.Nat }), - AllowanceChanged: IDL.Record({ current_allowance: IDL.Nat }), - CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }), - TooOld: IDL.Null, - Expired: IDL.Record({ ledger_time: IDL.Nat64 }), - InsufficientFunds: IDL.Record({ balance: IDL.Nat }), - }); - const Result_1 = IDL.Variant({ Ok: IDL.Nat, Err: ApproveError }); - const TransferFromArgs = IDL.Record({ - to: Account, - fee: IDL.Opt(IDL.Nat), - spender_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), - from: Account, - memo: IDL.Opt(IDL.Vec(IDL.Nat8)), - created_at_time: IDL.Opt(IDL.Nat64), - amount: IDL.Nat, - }); - const TransferFromError = IDL.Variant({ - GenericError: IDL.Record({ - message: IDL.Text, - error_code: IDL.Nat, - }), - TemporarilyUnavailable: IDL.Null, - InsufficientAllowance: IDL.Record({ allowance: IDL.Nat }), - BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }), - Duplicate: IDL.Record({ duplicate_of: IDL.Nat }), - BadFee: IDL.Record({ expected_fee: IDL.Nat }), - CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }), - TooOld: IDL.Null, - InsufficientFunds: IDL.Record({ balance: IDL.Nat }), - }); - const Result_2 = IDL.Variant({ Ok: IDL.Nat, Err: TransferFromError }); - const Name = IDL.Record({ name: IDL.Text }); - const GetBlocksArgs = IDL.Record({ - start: IDL.Nat64, - length: IDL.Nat64, - }); - const TimeStamp = IDL.Record({ timestamp_nanos: IDL.Nat64 }); - const CandidOperation = IDL.Variant({ - Approve: IDL.Record({ - fee: Tokens, - from: IDL.Vec(IDL.Nat8), - allowance_e8s: IDL.Int, - allowance: Tokens, - expected_allowance: IDL.Opt(Tokens), - expires_at: IDL.Opt(TimeStamp), - spender: IDL.Vec(IDL.Nat8), - }), - Burn: IDL.Record({ - from: IDL.Vec(IDL.Nat8), - amount: Tokens, - spender: IDL.Opt(IDL.Vec(IDL.Nat8)), - }), - Mint: IDL.Record({ to: IDL.Vec(IDL.Nat8), amount: Tokens }), - Transfer: IDL.Record({ - to: IDL.Vec(IDL.Nat8), - fee: Tokens, - from: IDL.Vec(IDL.Nat8), - amount: Tokens, - spender: IDL.Opt(IDL.Vec(IDL.Nat8)), - }), - }); - const CandidTransaction = IDL.Record({ - memo: IDL.Nat64, - icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)), - operation: IDL.Opt(CandidOperation), - created_at_time: TimeStamp, - }); - const CandidBlock = IDL.Record({ - transaction: CandidTransaction, - timestamp: TimeStamp, - parent_hash: IDL.Opt(IDL.Vec(IDL.Nat8)), - }); - const BlockRange = IDL.Record({ blocks: IDL.Vec(CandidBlock) }); - const GetBlocksError = IDL.Variant({ - BadFirstBlockIndex: IDL.Record({ - requested_index: IDL.Nat64, - first_valid_index: IDL.Nat64, - }), - Other: IDL.Record({ - error_message: IDL.Text, - error_code: IDL.Nat64, - }), - }); - const Result_3 = IDL.Variant({ Ok: BlockRange, Err: GetBlocksError }); - const ArchivedBlocksRange = IDL.Record({ - callback: IDL.Func([GetBlocksArgs], [Result_3], ["query"]), - start: IDL.Nat64, - length: IDL.Nat64, - }); - const QueryBlocksResponse = IDL.Record({ - certificate: IDL.Opt(IDL.Vec(IDL.Nat8)), - blocks: IDL.Vec(CandidBlock), - chain_length: IDL.Nat64, - first_block_index: IDL.Nat64, - archived_blocks: IDL.Vec(ArchivedBlocksRange), - }); - const Result_4 = IDL.Variant({ - Ok: IDL.Vec(IDL.Vec(IDL.Nat8)), - Err: GetBlocksError, - }); - const ArchivedEncodedBlocksRange = IDL.Record({ - callback: IDL.Func([GetBlocksArgs], [Result_4], ["query"]), - start: IDL.Nat64, - length: IDL.Nat64, - }); - const QueryEncodedBlocksResponse = IDL.Record({ - certificate: IDL.Opt(IDL.Vec(IDL.Nat8)), - blocks: IDL.Vec(IDL.Vec(IDL.Nat8)), - chain_length: IDL.Nat64, - first_block_index: IDL.Nat64, - archived_blocks: IDL.Vec(ArchivedEncodedBlocksRange), - }); - const SendArgs = IDL.Record({ - to: IDL.Text, - fee: Tokens, - memo: IDL.Nat64, - from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), - created_at_time: IDL.Opt(TimeStamp), - amount: Tokens, - }); - // biome-ignore lint/suspicious/noShadowRestrictedNames: - const Symbol = IDL.Record({ symbol: IDL.Text }); - const TransferArgs = IDL.Record({ - to: IDL.Vec(IDL.Nat8), - fee: Tokens, - memo: IDL.Nat64, - from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), - created_at_time: IDL.Opt(TimeStamp), - amount: Tokens, - }); - const TransferError_1 = IDL.Variant({ - TxTooOld: IDL.Record({ allowed_window_nanos: IDL.Nat64 }), - BadFee: IDL.Record({ expected_fee: Tokens }), - TxDuplicate: IDL.Record({ duplicate_of: IDL.Nat64 }), - TxCreatedInFuture: IDL.Null, - InsufficientFunds: IDL.Record({ balance: Tokens }), - }); - const Result_5 = IDL.Variant({ Ok: IDL.Nat64, Err: TransferError_1 }); - const TransferFee = IDL.Record({ transfer_fee: Tokens }); - return IDL.Service({ - account_balance: IDL.Func( - [BinaryAccountBalanceArgs], - [Tokens], - ["query"] - ), - account_balance_dfx: IDL.Func( - [AccountBalanceArgs], - [Tokens], - ["query"] - ), - account_identifier: IDL.Func([Account], [IDL.Vec(IDL.Nat8)], ["query"]), - archives: IDL.Func([], [Archives], ["query"]), - decimals: IDL.Func([], [Decimals], ["query"]), - icrc1_balance_of: IDL.Func([Account], [IDL.Nat], ["query"]), - icrc1_decimals: IDL.Func([], [IDL.Nat8], ["query"]), - icrc1_fee: IDL.Func([], [IDL.Nat], ["query"]), - icrc1_metadata: IDL.Func( - [], - [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))], - ["query"] - ), - icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ["query"]), - icrc1_name: IDL.Func([], [IDL.Text], ["query"]), - icrc1_supported_standards: IDL.Func( - [], - [IDL.Vec(StandardRecord)], - ["query"] - ), - icrc1_symbol: IDL.Func([], [IDL.Text], ["query"]), - icrc1_total_supply: IDL.Func([], [IDL.Nat], ["query"]), - icrc1_transfer: IDL.Func([TransferArg], [Result], []), - icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], ["query"]), - icrc2_approve: IDL.Func([ApproveArgs], [Result_1], []), - icrc2_transfer_from: IDL.Func([TransferFromArgs], [Result_2], []), - name: IDL.Func([], [Name], ["query"]), - query_blocks: IDL.Func( - [GetBlocksArgs], - [QueryBlocksResponse], - ["query"] - ), - query_encoded_blocks: IDL.Func( - [GetBlocksArgs], - [QueryEncodedBlocksResponse], - ["query"] - ), - send_dfx: IDL.Func([SendArgs], [IDL.Nat64], []), - symbol: IDL.Func([], [Symbol], ["query"]), - transfer: IDL.Func([TransferArgs], [Result_5], []), - transfer_fee: IDL.Func([IDL.Record({})], [TransferFee], ["query"]), - }); -}; -// biome-ignore lint/suspicious/noExplicitAny: -export const init = ({ IDL }: { IDL: any }) => { - const Account = IDL.Record({ - owner: IDL.Principal, - subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), - }); - const FeatureFlags = IDL.Record({ icrc2: IDL.Bool }); - const UpgradeArgs = IDL.Record({ - maximum_number_of_accounts: IDL.Opt(IDL.Nat64), - icrc1_minting_account: IDL.Opt(Account), - feature_flags: IDL.Opt(FeatureFlags), - }); - const Tokens = IDL.Record({ e8s: IDL.Nat64 }); - const Duration = IDL.Record({ secs: IDL.Nat64, nanos: IDL.Nat32 }); - const ArchiveOptions = IDL.Record({ - num_blocks_to_archive: IDL.Nat64, - max_transactions_per_response: IDL.Opt(IDL.Nat64), - trigger_threshold: IDL.Nat64, - more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)), - max_message_size_bytes: IDL.Opt(IDL.Nat64), - cycles_for_archive_creation: IDL.Opt(IDL.Nat64), - node_max_memory_size_bytes: IDL.Opt(IDL.Nat64), - controller_id: IDL.Principal, - }); - const InitArgs = IDL.Record({ - send_whitelist: IDL.Vec(IDL.Principal), - token_symbol: IDL.Opt(IDL.Text), - transfer_fee: IDL.Opt(Tokens), - minting_account: IDL.Text, - maximum_number_of_accounts: IDL.Opt(IDL.Nat64), - accounts_overflow_trim_quantity: IDL.Opt(IDL.Nat64), - transaction_window: IDL.Opt(Duration), - max_message_size_bytes: IDL.Opt(IDL.Nat64), - icrc1_minting_account: IDL.Opt(Account), - archive_options: IDL.Opt(ArchiveOptions), - initial_values: IDL.Vec(IDL.Tuple(IDL.Text, Tokens)), - token_name: IDL.Opt(IDL.Text), - feature_flags: IDL.Opt(FeatureFlags), - }); - const LedgerCanisterPayload = IDL.Variant({ - Upgrade: IDL.Opt(UpgradeArgs), - Init: InitArgs, - }); - return [LedgerCanisterPayload]; -}; diff --git a/packages/plugin-icp/src/constants/apis.ts b/packages/plugin-icp/src/constants/apis.ts deleted file mode 100644 index dac935f7455..00000000000 --- a/packages/plugin-icp/src/constants/apis.ts +++ /dev/null @@ -1,2 +0,0 @@ -// use your own web3 storage api host -export const WEB3_STORAGE_API_HOST = ""; \ No newline at end of file diff --git a/packages/plugin-icp/src/constants/canisters.ts b/packages/plugin-icp/src/constants/canisters.ts deleted file mode 100644 index 8718f33aff9..00000000000 --- a/packages/plugin-icp/src/constants/canisters.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const CANISTER_IDS = { - PICK_PUMP: "tl65e-yyaaa-aaaah-aq2pa-cai" -} as const; \ No newline at end of file diff --git a/packages/plugin-icp/src/index.ts b/packages/plugin-icp/src/index.ts deleted file mode 100644 index 1466de272af..00000000000 --- a/packages/plugin-icp/src/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Plugin } from "@ai16z/eliza"; -import { icpWalletProvider } from "./providers/wallet"; -import { executeCreateToken } from "./actions/createToken"; - -export const icpPlugin: Plugin = { - name: "icp", - description: "Internet Computer Protocol Plugin for Eliza", - providers: [icpWalletProvider], - actions: [executeCreateToken], - evaluators: [], -}; - -export default icpPlugin; diff --git a/packages/plugin-icp/src/providers/wallet.ts b/packages/plugin-icp/src/providers/wallet.ts deleted file mode 100644 index 0aca8e41dd9..00000000000 --- a/packages/plugin-icp/src/providers/wallet.ts +++ /dev/null @@ -1,122 +0,0 @@ -// src/providers/wallet.ts -import { Actor, ActorSubclass, HttpAgent } from "@dfinity/agent"; -import { Ed25519KeyIdentity } from "@dfinity/identity"; -import { IDL } from "@dfinity/candid"; -import { Principal } from "@dfinity/principal"; -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; - -export class WalletProvider { - private privateKey: string; - private identity: Ed25519KeyIdentity; - private host: string; - - constructor(privateKey: string, host: string = "https://ic0.app") { - this.privateKey = privateKey; - this.host = host; - this.identity = this.createIdentity(); - } - - private createIdentity = (): Ed25519KeyIdentity => { - if (!this.privateKey) { - throw new Error("Private key is required"); - } - try { - const privateKeyBytes = Buffer.from(this.privateKey, "hex"); - if (privateKeyBytes.length !== 32) { - throw new Error("Invalid private key length"); - } - return Ed25519KeyIdentity.fromSecretKey(privateKeyBytes); - } catch (error) { - throw new Error("Failed to create ICP identity"); - } - }; - - public createAgent = async (): Promise => { - return HttpAgent.create({ - identity: this.identity, - host: this.host, - }); - }; - - public getIdentity = (): Ed25519KeyIdentity => { - return this.identity; - }; - - public getPrincipal = (): Principal => { - return this.identity.getPrincipal(); - }; - - public createActor = async ( - idlFactory: IDL.InterfaceFactory, - canisterId: string, - fetchRootKey = false - ): Promise> => { - const agent = await this.createAgent(); - if (fetchRootKey) { - await agent.fetchRootKey(); - } - return Actor.createActor(idlFactory, { - agent, - canisterId, - }); - }; -} - -// Add the new provider instance -export const icpWalletProvider: Provider = { - async get( - runtime: IAgentRuntime, - message: Memory, - state?: State - ): Promise { - try { - const privateKey = runtime.getSetting( - "INTERNET_COMPUTER_PRIVATE_KEY" - ); - if (!privateKey) { - throw new Error("INTERNET_COMPUTER_PRIVATE_KEY not found"); - } - - const wallet = new WalletProvider(privateKey); - - return { - wallet, - identity: wallet.getIdentity(), - principal: wallet.getPrincipal().toString(), - isAuthenticated: true, - createActor: wallet.createActor, - }; - } catch (error: any) { - return { - wallet: null, - identity: null, - principal: null, - isAuthenticated: false, - error: error.message, - }; - } - }, -}; - -// Export utility function -export const createAnonymousActor = async ( - idlFactory: IDL.InterfaceFactory, - canisterId: string, - host: string = "https://ic0.app", - fetchRootKey = false -): Promise> => { - const anonymousAgent = new HttpAgent({ - host, - retryTimes: 1, - verifyQuerySignatures: false, - }); - - if (fetchRootKey) { - await anonymousAgent.fetchRootKey(); - } - - return Actor.createActor(idlFactory, { - agent: anonymousAgent, - canisterId, - }); -}; diff --git a/packages/plugin-icp/src/types.ts b/packages/plugin-icp/src/types.ts deleted file mode 100644 index 1cd4b718d88..00000000000 --- a/packages/plugin-icp/src/types.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { Principal } from "@dfinity/principal"; -import type { ActorSubclass } from "@dfinity/agent"; -import type { IDL } from "@dfinity/candid"; -export interface ICPConfig { - privateKey: string; - network?: "mainnet" | "testnet"; -} - -export interface TransferParams { - to: Principal | string; - amount: bigint; - memo?: bigint; -} - -export interface ICPBalance { - e8s: bigint; -} - -export interface TransferResult { - Ok?: bigint; - Err?: string; -} - -export interface ICPProvider { - getBalance(principal: string): Promise; - transfer(params: TransferParams): Promise; -} - -// Credentials obtained after login, used to create an actor with the logged-in identity. The actor can call canister methods -export type ActorCreator = ( - idlFactory: IDL.InterfaceFactory, // Candid interface - canister_id: string // Target canister -) => Promise>; - -export type CreateMemeTokenArg = { - name: string; - symbol: string; - description: string; - logo: string; - twitter?: string; - website?: string; - telegram?: string; -}; diff --git a/packages/plugin-icp/src/utils/arrays.ts b/packages/plugin-icp/src/utils/arrays.ts deleted file mode 100644 index ebf605c791b..00000000000 --- a/packages/plugin-icp/src/utils/arrays.ts +++ /dev/null @@ -1,37 +0,0 @@ -// number array -> string -export const array2string = ( - buf: WithImplicitCoercion -): string => { - const decoder = new TextDecoder(); - return decoder.decode(Buffer.from(buf)); -}; - -// string -> number array -// https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String -// https://developer.mozilla.org/zh-CN/docs/Web/API/TextEncoder -export const string2array = (text: string): number[] => { - const encoder = new TextEncoder(); - return Array.from(encoder.encode(text)); -}; - -// hex text -> number array -export const hex2array = (hex: string): number[] => { - const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex; - if (cleanHex.length === 0) return []; - if (cleanHex.length % 2 !== 0) throw new Error("Invalid hex text"); - const value: number[] = []; - for (let i = 0; i < cleanHex.length; i += 2) { - value.push(Number.parseInt(cleanHex.slice(i, i + 2), 16)); - } - return value; -}; - -// number array -> hex text -export const array2hex = (value: number[]): string => { - return value - .map((v) => { - if (v < 0 || 255 < v) throw new Error("number must between 0~255"); - return v.toString(16).padStart(2, "0"); - }) - .join(""); -}; diff --git a/packages/plugin-icp/src/utils/common/data/json.ts b/packages/plugin-icp/src/utils/common/data/json.ts deleted file mode 100644 index d95dfdefdcf..00000000000 --- a/packages/plugin-icp/src/utils/common/data/json.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { isPrincipalText } from "../../ic/principals"; -// ? 1. bigint -> string -// ? 2. principal -> string - -export const customStringify = (v: any): string => - JSON.stringify(v, (_key, value) => { - if (typeof value === "bigint") { - return `${value}`; - } else if (value && typeof value === "object" && value._isPrincipal === true) { - return value.toText(); - } else if ( - value && - typeof value === "object" && - value.__principal__ && - isPrincipalText(value.__principal__) - ) { - return value.__principal__; - } - return value; - }); \ No newline at end of file diff --git a/packages/plugin-icp/src/utils/common/types/bigint.ts b/packages/plugin-icp/src/utils/common/types/bigint.ts deleted file mode 100644 index cf7a92a64a6..00000000000 --- a/packages/plugin-icp/src/utils/common/types/bigint.ts +++ /dev/null @@ -1,5 +0,0 @@ -// bigint -> string -export const bigint2string = (n: bigint): string => `${n}`; - -// string -> bigint -export const string2bigint = (n: string): bigint => BigInt(n); diff --git a/packages/plugin-icp/src/utils/common/types/options.ts b/packages/plugin-icp/src/utils/common/types/options.ts deleted file mode 100644 index 21a897e19cc..00000000000 --- a/packages/plugin-icp/src/utils/common/types/options.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type Option = [] | [T]; - -// Unwrap -export const unwrapOption = (v: [] | [T]): T | undefined => - v.length ? v[0] : undefined; -// Unwrap and map -export const unwrapOptionMap = ( - v: [] | [T], - map: (t: T) => R -): R | undefined => (v.length ? map(v[0]) : undefined); - -// Wrap -export const wrapOption = (v?: T): [] | [T] => (v !== undefined ? [v] : []); -// Wrap and map -export const wrapOptionMap = ( - v: T | undefined, - map: (t: T) => R -): [] | [R] => (v !== undefined ? [map(v)] : []); diff --git a/packages/plugin-icp/src/utils/common/types/results.ts b/packages/plugin-icp/src/utils/common/types/results.ts deleted file mode 100644 index 07250f3ceff..00000000000 --- a/packages/plugin-icp/src/utils/common/types/results.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { customStringify } from "../data/json"; - -// Motoko result object -export type MotokoResult = - | { ok: T; err?: undefined } - | { ok?: undefined; err: E }; - -// Rust result object -export type RustResult = - | { Ok: T; Err?: undefined } - | { Ok?: undefined; Err: E }; - -// ================ motoko ================ - -// Map values -export const parseMotokoResult = ( - result: MotokoResult, - transform_ok: (t: Ok) => T, - transform_err: (e: Err) => E -): MotokoResult => { - if (result.ok !== undefined) return { ok: transform_ok(result.ok) }; - if (result.err !== undefined) return { err: transform_err(result.err) }; - throw new Error(`wrong motoko result: ${customStringify(result)}`); -}; - -// Unwrap -export const unwrapMotokoResult = ( - result: MotokoResult, - handle_error: (e: E) => T -): T => { - if (result.ok !== undefined) return result.ok; - if (result.err !== undefined) return handle_error(result.err); - throw new Error(`wrong motoko result: ${customStringify(result)}`); -}; - -// Unwrap and map -export const unwrapMotokoResultMap = ( - result: MotokoResult, - transform_ok: (o: O) => T, - transform_err: (e: E) => T -): T => { - if (result.ok !== undefined) return transform_ok(result.ok); - if (result.err !== undefined) return transform_err(result.err); - throw new Error(`wrong motoko result: ${customStringify(result)}`); -}; - -// ================ rust ================ - -export const parseRustResult = ( - result: RustResult, - transform_ok: (t: Ok) => T, - transform_err: (e: Err) => E -): RustResult => { - if (result.Ok !== undefined) return { Ok: transform_ok(result.Ok) }; - if (result.Err !== undefined) return { Err: transform_err(result.Err) }; - throw new Error(`wrong rust result: ${customStringify(result)}`); -}; - -// Unwrap -export const unwrapRustResult = ( - result: RustResult, - handle_error: (e: E) => T -): T => { - if (result.Ok !== undefined) return result.Ok; - if (result.Err !== undefined) return handle_error(result.Err); - throw new Error(`wrong rust result: ${customStringify(result)}`); -}; - -// Unwrap and map -export const unwrapRustResultMap = ( - result: RustResult, - transform_ok: (o: O) => T, - transform_err: (e: E) => T -): T => { - if (result.Ok !== undefined) return transform_ok(result.Ok); - if (result.Err !== undefined) return transform_err(result.Err); - throw new Error(`wrong rust result: ${customStringify(result)}`); -}; diff --git a/packages/plugin-icp/src/utils/common/types/variant.ts b/packages/plugin-icp/src/utils/common/types/variant.ts deleted file mode 100644 index 9b28eec128a..00000000000 --- a/packages/plugin-icp/src/utils/common/types/variant.ts +++ /dev/null @@ -1,201 +0,0 @@ -type CandidVariant1 = Record; -type CandidVariant2 = Record; -type CandidVariant3 = Record; -type CandidVariant4 = Record; -type CandidVariant5 = Record; -type CandidVariant6 = Record; - -// Make do with what we have -type Variant1 = Record; -type Variant2 = Record; -type Variant3 = Record; -type Variant4 = Record; -type Variant5 = Record; -type Variant6 = Record< - string, - A | B | C | D | E | F | undefined ->; - -// Unwrap and extract only the key -// biome-ignore lint/suspicious/noExplicitAny: -export const unwrapVariantKey = ( - v: Record -): T => { - const keys = Object.keys(v); - if (keys.length === 0) throw new Error("variant must has a key"); - return keys[0] as T; -}; - -export const mapping_true = () => true; // Returns true -export const mapping_false = () => false; // Returns false -export const unchanging = (t: T): T => t; // Does not change content -// Handle exceptions - pass in prompt message or transform error value -export const throwsBy = - (s: string | ((e: E) => string)) => - (e: E) => { - if (typeof s === "string") throw new Error(s); - throw new Error(s(e)); - }; -// Handle exceptions - parse enum error -export const throwsVariantError = (e: Record) => { - const key = unwrapVariantKey(e); - const message = `${key}${e[key] === null ? "" : `: ${e[key]}`}`; - throw new Error(message); -}; - -// Get value -export const unwrapVariant = ( - v: Record | undefined, - key: string -): T | undefined => { - if (v === undefined) return undefined; - return v[key] as T; -}; - -// Unwrap -export const unwrapVariant1 = ( - v: CandidVariant1, - [k1, f1]: [string, (a: A) => AA] -): Variant1 => { - if (v[k1] !== undefined) return { [k1]: f1(v[k1]) }; - throw new Error("variant must has a key"); -}; -export const unwrapVariant2 = ( - v: CandidVariant2, - [k1, f1]: [string, (a: A) => AA], - [k2, f2]: [string, (b: B) => BB] -): Variant2 => { - if (v[k1] !== undefined) return { [k1]: f1(v[k1] as A) }; - if (v[k2] !== undefined) return { [k2]: f2(v[k2] as B) }; - throw new Error("variant must has a key"); -}; -export const unwrapVariant3 = ( - v: CandidVariant3, - [k1, f1]: [string, (a: A) => AA], - [k2, f2]: [string, (b: B) => BB], - [k3, f3]: [string, (c: C) => CC] -): Variant3 => { - if (v[k1] !== undefined) return { [k1]: f1(v[k1] as A) }; - if (v[k2] !== undefined) return { [k2]: f2(v[k2] as B) }; - if (v[k3] !== undefined) return { [k3]: f3(v[k3] as C) }; - throw new Error("variant must has a key"); -}; -export const unwrapVariant4 = ( - v: CandidVariant4, - [k1, f1]: [string, (a: A) => AA], - [k2, f2]: [string, (b: B) => BB], - [k3, f3]: [string, (c: C) => CC], - [k4, f4]: [string, (d: D) => DD] -): Variant4 => { - if (v[k1] !== undefined) return { [k1]: f1(v[k1] as A) }; - if (v[k2] !== undefined) return { [k2]: f2(v[k2] as B) }; - if (v[k3] !== undefined) return { [k3]: f3(v[k3] as C) }; - if (v[k4] !== undefined) return { [k4]: f4(v[k4] as D) }; - throw new Error("variant must has a key"); -}; -export const unwrapVariant5 = ( - v: CandidVariant5, - [k1, f1]: [string, (a: A) => AA], - [k2, f2]: [string, (b: B) => BB], - [k3, f3]: [string, (c: C) => CC], - [k4, f4]: [string, (d: D) => DD], - [k5, f5]: [string, (e: E) => EE] -): Variant5 => { - if (v[k1] !== undefined) return { [k1]: f1(v[k1] as A) }; - if (v[k2] !== undefined) return { [k2]: f2(v[k2] as B) }; - if (v[k3] !== undefined) return { [k3]: f3(v[k3] as C) }; - if (v[k4] !== undefined) return { [k4]: f4(v[k4] as D) }; - if (v[k5] !== undefined) return { [k5]: f5(v[k5] as E) }; - throw new Error("variant must has a key"); -}; -export const unwrapVariant6 = ( - v: CandidVariant5, - [k1, f1]: [string, (a: A) => AA], - [k2, f2]: [string, (b: B) => BB], - [k3, f3]: [string, (c: C) => CC], - [k4, f4]: [string, (d: D) => DD], - [k5, f5]: [string, (e: E) => EE], - [k6, f6]: [string, (f: F) => FF] -): Variant6 => { - if (v[k1] !== undefined) return { [k1]: f1(v[k1] as A) }; - if (v[k2] !== undefined) return { [k2]: f2(v[k2] as B) }; - if (v[k3] !== undefined) return { [k3]: f3(v[k3] as C) }; - if (v[k4] !== undefined) return { [k4]: f4(v[k4] as D) }; - if (v[k5] !== undefined) return { [k5]: f5(v[k5] as E) }; - if (v[k6] !== undefined) return { [k6]: f6(v[k6] as F) }; - throw new Error("variant must has a key"); -}; - -// Unwrap and map -export const unwrapVariant1Map = ( - v: CandidVariant1, - [k1, f1]: [string, (a: A) => R] -): R => { - if (v[k1] !== undefined) return f1(v[k1] as A); - throw new Error("variant must has a key"); -}; -export const unwrapVariant2Map = ( - v: CandidVariant2, - [k1, f1]: [string, (a: A) => R], - [k2, f2]: [string, (b: B) => R] -): R => { - if (v[k1] !== undefined) return f1(v[k1] as A); - if (v[k2] !== undefined) return f2(v[k2] as B); - throw new Error("variant must has a key"); -}; -export const unwrapVariant3Map = ( - v: CandidVariant3, - [k1, f1]: [string, (a: A) => R], - [k2, f2]: [string, (b: B) => R], - [k3, f3]: [string, (c: C) => R] -): R => { - if (v[k1] !== undefined) return f1(v[k1] as A); - if (v[k2] !== undefined) return f2(v[k2] as B); - if (v[k3] !== undefined) return f3(v[k3] as C); - throw new Error("variant must has a key"); -}; -export const unwrapVariant4Map = ( - v: CandidVariant4, - [k1, f1]: [string, (a: A) => R], - [k2, f2]: [string, (b: B) => R], - [k3, f3]: [string, (c: C) => R], - [k4, f4]: [string, (d: D) => R] -): R => { - if (v[k1] !== undefined) return f1(v[k1] as A); - if (v[k2] !== undefined) return f2(v[k2] as B); - if (v[k3] !== undefined) return f3(v[k3] as C); - if (v[k4] !== undefined) return f4(v[k4] as D); - throw new Error("variant must has a key"); -}; -export const unwrapVariant5Map = ( - v: CandidVariant5, - [k1, f1]: [string, (a: A) => R], - [k2, f2]: [string, (b: B) => R], - [k3, f3]: [string, (c: C) => R], - [k4, f4]: [string, (d: D) => R], - [k5, f5]: [string, (e: E) => R] -): R => { - if (v[k1] !== undefined) return f1(v[k1] as A); - if (v[k2] !== undefined) return f2(v[k2] as B); - if (v[k3] !== undefined) return f3(v[k3] as C); - if (v[k4] !== undefined) return f4(v[k4] as D); - if (v[k5] !== undefined) return f5(v[k5] as E); - throw new Error("variant must has a key"); -}; -export const unwrapVariant6Map = ( - v: CandidVariant6, - [k1, f1]: [string, (a: A) => R], - [k2, f2]: [string, (b: B) => R], - [k3, f3]: [string, (c: C) => R], - [k4, f4]: [string, (d: D) => R], - [k5, f5]: [string, (e: E) => R], - [k6, f6]: [string, (f: F) => R] -): R => { - if (v[k1] !== undefined) return f1(v[k1] as A); - if (v[k2] !== undefined) return f2(v[k2] as B); - if (v[k3] !== undefined) return f3(v[k3] as C); - if (v[k4] !== undefined) return f4(v[k4] as D); - if (v[k5] !== undefined) return f5(v[k5] as E); - if (v[k6] !== undefined) return f6(v[k6] as F); - throw new Error("variant must has a key"); -}; diff --git a/packages/plugin-icp/src/utils/ic/index.ts b/packages/plugin-icp/src/utils/ic/index.ts deleted file mode 100644 index eca7916b4ec..00000000000 --- a/packages/plugin-icp/src/utils/ic/index.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { getCrc32 } from "@dfinity/principal/lib/esm/utils/getCrc"; -import { sha224 } from "@dfinity/principal/lib/esm/utils/sha224"; - -import { Principal } from "@dfinity/principal"; -import { array2hex, hex2array, string2array } from "../arrays"; - -// Principal -> string -export const principal2string = (p: Principal): string => p.toText(); - -// string -> Principal -export const string2principal = (p: string): Principal => Principal.fromText(p); - -// Calculate account from Principal -export const principal2account = ( - principal: string, - subaccount?: number | Uint8Array | number[] -): string => { - return array2hex(principal2account_array(principal, subaccount)); -}; - -// Calculate subAccount from Principal -export const principal2SubAccount = (principal: string): Uint8Array => { - const bytes = string2principal(principal).toUint8Array(); - const subAccount = new Uint8Array(32); - subAccount[0] = bytes.length; - subAccount.set(bytes, 1); - return subAccount; -}; - -// Calculate account from Principal -export const principal2account_array = ( - principal: string, - subaccount?: number | Uint8Array | number[] -): number[] => { - let subaccountArray: number[]; - if (typeof subaccount === "number") { - subaccountArray = [ - (subaccount >> 24) & 0xff, - (subaccount >> 16) & 0xff, - (subaccount >> 8) & 0xff, - subaccount & 0xff, - ]; - } - if (subaccount === undefined) { - subaccountArray = []; - } else if (Array.isArray(subaccount)) { - subaccountArray = [...subaccount]; - } else if (subaccount instanceof Uint8Array) { - subaccountArray = Array.from(subaccount); - } else { - throw new Error(`Invalid subaccount type: ${typeof subaccount}`); - } - - while (subaccountArray.length < 32) { - subaccountArray.unshift(0); - } - if (subaccountArray.length !== 32) { - throw new Error(`Wrong subaccount length: ${subaccountArray.length}`); - } - - const buffer: number[] = [ - ...string2array("\x0Aaccount-id"), - ...Array.from(string2principal(principal).toUint8Array()), - ...subaccountArray, - ]; - - const hash = sha224(new Uint8Array(buffer)); - const checksum = getCrc32(hash); - - const result = [ - (checksum >> 24) & 0xff, - (checksum >> 16) & 0xff, - (checksum >> 8) & 0xff, - (checksum >> 0) & 0xff, - ...Array.from(hash), - ]; - - return result; -}; - -// Check if it's a valid account -export const isAccountHex = (text: string | undefined): boolean => { - if (!text) return false; - if (text.length !== 64) return false; - try { - return hex2array(text).length === 32; - } catch { - // Ignore error - } - return false; -}; diff --git a/packages/plugin-icp/src/utils/ic/principals.ts b/packages/plugin-icp/src/utils/ic/principals.ts deleted file mode 100644 index 87ba7c9a63a..00000000000 --- a/packages/plugin-icp/src/utils/ic/principals.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Principal } from "@dfinity/principal"; - -// Check if string is a Principal -export const isPrincipalText = (text: string | undefined): boolean => { - if (!text) return false; - try { - Principal.fromText(text); - return true; - } catch (e) { - return false; - } -}; - -// Check if string is a Canister Id -export const isCanisterIdText = (text: string | undefined): boolean => { - if (!text) return false; - if (text.length !== 27) return false; - return isPrincipalText(text); -}; diff --git a/packages/plugin-icp/src/utils/number.ts b/packages/plugin-icp/src/utils/number.ts deleted file mode 100644 index 7e40406884c..00000000000 --- a/packages/plugin-icp/src/utils/number.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Define an array of units for abbreviating large numbers -const units: string[] = ["k", "m", "b", "t"]; - -/** - * Convert a number to a string with specified precision - * @param number The number to format - * @param precision Number of decimal places, defaults to 1 - * @returns Formatted string - */ -export function toPrecision(number: number, precision = 1): string { - return ( - number - .toString() - // Keep specified number of decimal places - .replace(new RegExp(`(.+\\.\\d{${precision}})\\d+`), "$1") - // Remove trailing zeros but keep at least one decimal place - .replace(/(\.[1-9]*)0+$/, "$1") - // Remove decimal point if no digits follow - .replace(/\.$/, "") - ); -} - -/** - * Abbreviate a number - * @param number The number to abbreviate - * @returns Formatted number string - */ -export function abbreviateNumber(number: number): string { - const isNegative = number < 0; - const absNumber = Math.abs(number); - - // For absolute values less than 1, keep 3 decimal places - if (absNumber < 1) - return (isNegative ? "-" : "") + toPrecision(absNumber, 3); - // For absolute values less than 100, keep 2 decimal places - if (absNumber < 10 ** 2) - return (isNegative ? "-" : "") + toPrecision(absNumber, 2); - // For absolute values less than 10000, use thousands separator and keep 1 decimal place - if (absNumber < 10 ** 4) { - const formatted = new Intl.NumberFormat().format( - Number.parseFloat(toPrecision(absNumber, 1)) - ); - return isNegative ? `-${formatted}` : formatted; - } - - const decimalsDivisor = 10 ** 1; - let result: string = String(absNumber); - - // Iterate through units array to find appropriate abbreviation - for (let i = units.length - 1; i >= 0; i--) { - const size = 10 ** ((i + 1) * 3); - if (size <= absNumber) { - // Calculate abbreviated value - const abbreviatedNumber = - (absNumber * decimalsDivisor) / size / decimalsDivisor; - // Format number and add unit - result = toPrecision(abbreviatedNumber, 1) + units[i]; - break; - } - } - - return isNegative ? `-${result}` : result; -} diff --git a/packages/plugin-icp/tsconfig.json b/packages/plugin-icp/tsconfig.json deleted file mode 100644 index b6ce190d989..00000000000 --- a/packages/plugin-icp/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "./src", - "typeRoots": [ - "./node_modules/@types", - "./src/types" - ], - "declaration": true - }, - "include": [ - "src" - ] -} diff --git a/packages/plugin-icp/tsup.config.ts b/packages/plugin-icp/tsup.config.ts deleted file mode 100644 index a47c9eb64b0..00000000000 --- a/packages/plugin-icp/tsup.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - ], -}); diff --git a/packages/plugin-intiface/.npmignore b/packages/plugin-intiface/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-intiface/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-intiface/intiface-engine/CHANGELOG.md b/packages/plugin-intiface/intiface-engine/CHANGELOG.md deleted file mode 100644 index 687ce7fe78e..00000000000 --- a/packages/plugin-intiface/intiface-engine/CHANGELOG.md +++ /dev/null @@ -1,612 +0,0 @@ -# Intiface Engine v1.4.8 (2023/11/16) - -## Features - -- Update to Buttplug v7.1.9 - - Added Lovense Solace, OhMiBod Foxy, Chill support - -# Intiface Engine v1.4.7 (2023/11/04) - -## Features - -- Allow logging to use environment variables for setup over command line prefs -- Update to Buttplug v7.1.8 - - Add lovense device support - - Fix some device support issues - -# Intiface Engine v1.4.6 (2023/10/19) - -## Features - -- Update to Buttplug v7.1.7 - - Fixes memory leak in mDNS handling - - Defaults to device keepalive being on when compiling for iOS - -# Intiface Engine v1.4.5 (2023/10/08) - -## Features - -- Update to Buttplug v7.1.6 - - Fixes Lovense Dongle support - - Added Foreo device support - -# Intiface Engine v1.4.4 (2023/10/05) - -## Bugfixes - -- Make mDNS actually work in all cases (but it's still considered experimental) -- Fix compilation issues for android - -# Intiface Engine v1.4.3 (2023/10/04) - -## Features - -- Update to Buttplug v7.1.5 - - Lots of device additions, HID device manager for Joycons -- Add mDNS broadcast capabilities - -# Intiface Engine v1.4.2 (2023/07/16) - -## Features - -- Update to Buttplug v7.1.2 - - Device additions for Magic Motion, Lovense Connect bugfix - -# Intiface Engine v1.4.1 (2023/07/09) - -## Features - -- Update to Buttplug v7.1.1 - - Mostly device additions/updates - -# Intiface Engine v1.4.0 (2023/05/21) - -## Features - -- Update to Buttplug v7.1.0 - - Mostly device additions/updates - - Some fixes for user configs -- Move ButtplugRemoteServer into Intiface Engine - - Gives us more flexibility to change things in development -- Updates for user device config updates via Buttplug - -# Intiface Engine v1.3.0 (2023/02/19) - -## Features - -- Added Websocket Client argument for running the engine as a websocket client instead of a server -- Update to Buttplug v7.0.2 - - Hardware protocols updates for Kizuna/Svakom/Sakuraneko - -# Intiface Engine v1.2.2 (2023/01/30) - -## Bugfixes - -- Fix timing issue on sending EngineStopped message on exit - -# Intiface Engine v1.2.1 (2023/01/16) - -## Features - -- Update to Buttplug v7.0.1 - - Hardware protocol updates/fixed, see Buttplug CHANGELOG for more info. - -# Intiface Engine v1.2.0 (2023/01/01) - -## Features - -- Update to Buttplug v7.0.0 - - Major version move because of API breakage. - - Mostly bugfixes otherwise. - - Removes IPC Pipes, so removed them in Intiface Engine too. - -# Intiface Engine v1.1.0 (2022/12/19) - -## Features - -- Update to Buttplug v6.3.0 - - Lots of device additions - - Major bugfixes for WeVibe/Satisfyer/Magic Motion and Lovense Connect - -# Intiface Engine v1.0.5 (2022/11/27) - -## Bugfixes - -- Update to Buttplug v6.2.2 - - Fixes issues with platform dependencies and DCMs - - Fixes error message in common path in CoreBluetooth - - Stops devices when server disconnects - -# Intiface Engine v1.0.4 (2022/11/24) - -## Features - -- Update to Buttplug v6.2.1 -- Add optional tokio_console feature for task debugging -- Remove crash reporting for now - - Needs to be updated, more testing, etc... - -# Intiface Engine v1.0.3 (2022/11/05) - -## Features - -- Implemented BackdoorServer, which allows access to server devices directly, while still allowing a - client to access them simultaneously. Can't possibly see how this could go wrong. -- Added EngineServerCreated Event for IntifaceCentral to know when to bring up the BackdoorServer. - -## Bugfixes - -- Fixed issue where logging could stay alive through multiple server bringups when run in process. - -# Intiface Engine v1.0.2 (2022/10/18) - -## Bugfixes - -- Vergen should not block building as a library dependency - -# Intiface Engine v1.0.1 (2022/10/15) - -## Features - -- Update to Buttplug v6.1.0 - - Mostly bugfixes - - Now requires v2.x device config files - -# Intiface Engine v1.0.0 (2022/10/01) - -## Breaking Changes - -- Rebuilt command line arguments - - Now in kebab case format - - ALL DCMs require --use statements, there are no default DCMs anymore -- Incorporates changes made during the egui betas. -- The `--stay_open` argument is now assumed. The server will run until either Ctrl-C is pressed or - an IPC stop message is received. - -## Features - -- Intiface Engine is now compiled as both a CLI (for desktop) and a Library (for mobile). -- Updated to Buttplug v6 -- Moved to semantic versioning, major version denotes CLI argument or breaking IPC protocol change. - -# v101 (egui Beta 2) (2021/01/25) - -- Add websocket device server port selection - -# v100 (egui Beta 1) (2021/01/04) - -## Features - -- Use JSON over named pipes instead of protobufs over stdio -- Add sentry crash logging -- Server version now uses a shorter tag -- Update to Rust 2021 - -# v50 (2022/04/26) - Last version of Intiface CLI - -## Features - -- Update to Buttplug v5.1.9 - - Add Magic Motion Crystal support - - Fix issues with Satisfyer Plugalicious 2 connections - - Fix issues with Satisfyer device identification - -# v49 (2022/03/05) - -## Features - -- Update to Buttplug v5.1.8 - - Added Lelo F1s v2 support, more support for Mannuo/Magic Motion/OhMiBod devices - - May fix issues with windows bluetooth on older Win 10 versions - -# v48 (2021/01/24) - -## Features - -- Update to Buttplug v5.1.7 - - Lovense Calor support, Folove support, more WeVibe/Satisfyer support - -# v47 (2022/01/04) - -## Bugfixes - -- No changes to build, re-release to fix issue with a wrong tag getting pushed. - -# v46 (2022/01/01) - -## Bugfixes - -- Update to Buttplug v5.1.6 - - Fix issues with serial ports blocking, lovense connect data types, log message levels, etc... - - See Buttplug v5.1.6 changelog for more info. - (https://github.com/buttplugio/buttplug/blob/master/buttplug/CHANGELOG.md) - -# v45 (2021/12/19) - -## Bugfixes - -- Update to Buttplug v5.1.5 - - Fix issues with Satisfyer name detection and disconnection - - Fix issues with device scanning always saying it's instantly finished - -# v44 (2021/12/14) - -## Bugfixes - -- Update to Buttplug v5.1.4 - - Shouldn't change anything in here, all the fixes were FFI related, but eh. -- Try to get crash logs into frontend log output for easier debugging -- #14: Fix issue with intiface-cli not sending events to desktop after first disconnection - -# v43 (2021/12/04) - -## Bugfixes - -- Update to Buttplug v5.1.2 - - Fix race condition with bluetooth advertisements causing multiple simultaneous connects to - devices -- Update to vergen 5.2.0 - - Last version was yanked - -# v42 (2021/12/03) - -## Bugfixes - -- Update to Buttplug v5.1.1 - - Fix issues with devices w/ advertised services being ignored - - Fix issues with lovense dongle on linux - -# v41 (2021/12/02) - -## Features - -- Update to Buttplug v5.1 - - Bluetooth library updates - - Satisfyer/ManNuo/other device support (see Buttplug README) - - Lots of other fixes -- Update to vergen v5, tracing-subscriber v0.3 - -# v40 (2021/09/14) - -## Features - -- Update to Buttplug v5.0.1 - - Better MacOS bluetooth support - - Better Linux bluetooth support - - Tons of device additions (see Buttplug README) - - Adds websocket device interface - -# v39 (2021/07/05) - -## Features - -- Server now throws warnings whenever a client tries to connect when another client is already - connected. -- Update to Buttplug 4.0.4 - - Added hardware support for TCode devices, Patoo, Vorze Piston SA - -## Bugfixes - -- Fix cancellation of tasks on shutdown. - -# v38 (2021/06/18) - -## Bugfixes - -- Update to buttplug-rs 4.0.3, which fixes issues with Android phones using the Lovense Connect app. - -# v37 (2021/06/11) - -## Bugfixes - -- Fix timing issue where Process Ended message may not be seen by Intiface Desktop -- Update to buttplug-rs 4.0.2, fixing issue with Intiface Desktop stalling due to logging issues. -- Add Info.plist file for macOS Big Sur and later compat - -# v36 (2021/06/10) - -## Features - -- Added opt-in/out arguments for all available device communication managers -- Added support for Lovense Connect Service - -# v35 (2021/04/04) - -## Bugfixes - -- Update to Buttplug v2.1.9 - - Reduces error log messages thrown by lovense dongle - - Reduces panics in bluetooth handling on windows - - Fixes issue with battery checking on lovense devices stalling library on device disconnect - -# v34 (2021/03/25) - -## Bugfixes - -- Update to Buttplug v2.1.8 - - Possibly fixes issue with bluetooth devices not registering disconnection on windows. - -# v33 (2021/03/08) - -## Bugfixes - -- Update to Buttplug v2.1.7 - - Fixes legacy message issues with The Handy and Vorze toys - - Fixes init issues with some Kiiroo vibrators - -# v32 (2021/02/28) - -## Bugfixes - -- Update to Buttplug v2.1.6 - - Fixes issues with log message spamming - - Update btleplug to 0.7.0, lots of cleanup - -# v31 (2021/02/20) - -## Bugfixes - -- Update to Buttplug v2.1.5 - - Fixes panic in devices that disconnect during initialize(). - -# v30 (2021/02/13) - -## Features - -- Update to Buttplug v2.1.4 -- Added Hardware Support - - The Handy - -## Bugfixes - -- Fixes issues with the LoveAi Dolp and Lovense Serial Dongle - -# v29 (2021/02/06) - -## Bugfixes - -- Update to Buttplug v2.1.3 - - Fix StopAllDevices so it actually stops all devices again - - Allow for setting device intensity to 1.0 - -# v28 (2021/02/06) - -## Features - -- Update to Buttplug v2.1.1 - - Adds Lovense Diamo and Nobra's Silicone Dreams support - - Lots of bugfixes and more/better errors being emitted - -# v27 (2021/01/24) - -## Bugfixes - -- Update to Buttplug 2.0.5 - - Fixes issue with v2 protocol conflicts in DeviceMessageInfo - -# v26 (2021/01/24) - -## Bugfixes - -- Update to Buttplug 2.0.4 - - Fixes issue with XInput devices being misaddressed and stopping all scanning. - -# v25 (2021/01/19) - -## Bugfixes - -- Update to Buttplug 2.0.2 - - Fixes issue with scanning status getting stuck on Lovense dongles - -# v24 (Yanked) (2021/01/18) - -## Features - -- Update to Buttplug 2.0.1 - - Event system and API cleanup - - Lovense Ferri Support -- Backtraces now emitted via logging system when using frontend IPC - -# v23 (2021/01/01) - -## Bugfixes - -- Update to Buttplug 1.0.4 - - Fixes issues with XInput Gamepads causing intiface-cli-rs crashes on reconnect. - -# v22 (2021/01/01) - -## Bugfixes - -- Update to Buttplug 1.0.3 - - Fixes issues with BTLE advertisements and adds XInput device rescanning. - -# v21 (2020/12/31) - -## Bugfixes - -- Update to Buttplug 1.0.1 - - Fixes issue with device scanning races. - -# v20 (2020/12/22) - -## Bugfixes - -- Update to Buttplug 0.11.3 - - Fixes security issues and a memory leak when scanning is called often. - -# v19 (2020/12/11) - -## Bugfixes - -- Update to Buttplug 0.11.2 - - Emits Scanningfinished when scanning is finished. Finally. - -# v18 (2020/11/27) - -## Features - -- Update to buttplug-rs 0.11.1 - - System bugfixes - - Mysteryvibe support - -# v17 (2020/10/25) - -## Features - -- Update to buttplug-rs 0.10.1 - - Lovense Dongle Bugfixes - - BLE Toy Connection Bugfixes -- Fix logging output - - Pay attention to log option on command line again - - Outputs full tracing JSON to frontend - -# v16 (2020/10/17) - -## Features - -- Update to buttplug-rs 0.10.0 - - Kiiroo Keon Support - - New raw device commands (use --allowraw option for access) - -## Bugfixes - -- Update to buttplug-rs 0.10.0 - - Lots of websocket crash fixes - -# v15 (2020/10/05) - -## Bugfixes - -- Update to buttplug-rs 0.9.2 w/ btleplug 0.5.4, fixing an issue with macOS - panicing whenever it tries to read from a BLE device. - -# v14 (2020/10/05) - -## Bugfixes - -- Update to buttplug-rs 0.9.1 w/ btleplug 0.5.3, fixing an issue with macOS - panicing whenever it tries to write to a BLE device. - -# v13 (2020/10/04) - -## Features - -- Update to buttplug-rs 0.9.0, which now has Battery level reading capabilites - for some hardware. - -## Bugfixes - -- Update to buttplug-rs 0.9.0, which now does not crash when 2 devices are - connected and one disconnects. - -# v12 (2020/10/02) - -## Features - -- Update to Buttplug-rs 0.8.4, fixing a bunch of device issues. -- Default to outputting info level logs if no env log var set. (Should pick this - up from command line argument in future version) - -## Bugfixes - -- Only run for one connection attempt if --stayopen isn't passed in. - -# v11 (2020/09/20) - -## Bugfixes - -- Moves to buttplug-0.8.3, which fixes support for some programs using older - APIs (FleshlightLaunchFW12Cmd) for Kiiroo stroking products (Onyx, Fleshlight - Launch, etc). - -# v10 (2020/09/13) - -## Features - -- Added log handling from Buttplug library. Still needs protocol/CLI setting, - currently outputs everything INFO or higher. - -## Bugfixes - -- Moves to buttplug-0.8.2, fixing Lovense rotation and adding log output - support. - -# v9 (2020/09/11) - -## Bugfixes - -- Moves to buttplug-0.7.3, which loads both RSA and pkcs8 certificates. This - allows us to load the certs that come from Intiface Desktop. - -# v8 (2020/09/07) - -## Bugfixes - -- Move to buttplug-rs 0.7.2, which adds more device configurations and fixes - websocket listening on all interfaces. - -# v7 (2020/09/06) - -## Features - -- Move to buttplug-rs 0.7.1, which includes status emitting features and way - more device protocol support. -- Allow frontend to trigger process stop -- Send disconnect to frontend when client disconnects -- Can now relay connected/disconnected devices to GUIs via PBuf protocol - -# v6 (2020/08/06) - -## Features - -- Move to buttplug-rs 0.6.0, which integrates websockets and server lifetime - handling. intiface-cli-rs is now a very thin wrapper around buttplug-rs, - handling system bringup and frontend communication and that's about it. - -# v5 (2020/05/13) - -## Bugfixes - -- Move to buttplug-rs 0.3.1, with a couple of unwrap fixes - -# v4 (2020/05/10) - -## Features - -- --stayopen option now actually works, reusing the server between - client connections. - -# v3 (2020/05/09) - -## Features - -- Added protobuf basis for hooking CLI into Intiface Desktop - -## Bugfixes - -- Fixed bug where receiving ping message from async_tungstenite would - panic server -- Update to buttplug 0.2.4, which fixes ServerInfo message ID matching - -# v2 (2020/02/15) - -## Features - -- Move to using rolling versioning, since this is a binary -- Move to using buttplug 0.2, with full server implementation -- Add cert generation -- Add secure websocket capabilities -- Move to using async-tungstenite -- Use Buttplug's built in JSONWrapper -- Add XInput capability on windows -- Add CI building -- Add Simple GUI message output for Intiface Desktop - -# v1 (aka v0.0.1) (2020/02/15) - -## Features - -- First version -- Can bring up insecure websocket, run server, access toys -- Most options not used yet diff --git a/packages/plugin-intiface/intiface-engine/README.md b/packages/plugin-intiface/intiface-engine/README.md deleted file mode 100644 index a028303945e..00000000000 --- a/packages/plugin-intiface/intiface-engine/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# Intiface Engine - -[![Patreon donate button](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/qdot) -[![Github donate button](https://img.shields.io/badge/github-donate-ff69b4.svg)](https://www.github.com/sponsors/qdot) -[![Discourse Forums](https://img.shields.io/discourse/status?label=buttplug.io%20forums&server=https%3A%2F%2Fdiscuss.buttplug.io)](https://discuss.buttplug.io) -[![Discord](https://img.shields.io/discord/353303527587708932.svg?logo=discord)](https://discord.buttplug.io) -[![Twitter](https://img.shields.io/twitter/follow/buttplugio.svg?style=social&logo=twitter)](https://twitter.com/buttplugio) - -![Intiface Engine Build](https://github.com/intiface/intiface-engine/workflows/Intiface%20Engine%20Build/badge.svg) ![crates.io](https://img.shields.io/crates/v/intiface-engine.svg) - - -

- -

- -CLI and Library frontend for Buttplug - -Intiface Engine is just a front-end for [Buttplug](https://github.com/buttplugio/buttplug), -but since we're trying to not make people install a program named "Buttplug", here we are. - -While this program can be used standalone, it will mostly be featured as a backend/engine for -Intiface Central. - -## Running - -Command line options are as follows: - -| Option | Description | -| --------- | --------- | -| `version` | Print version and exit | -| `server-version` | Print version and exit (kept for legacy reasons) | -| `crash-reporting` | Turn on sentry crash reporting | -| `websocket-use-all-interfaces` | Websocket servers will listen on all interfaces (versus only on localhost, which is default) | -| `websocket-port [port]` | Network port for connecting via non-ssl (ws://) protocols | -| `frontend-websocket-port` | IPC JSON port for Intiface Central | -| `server-name` | Identifying name server should emit when asked for info | -| `device-config-file [file]` | Device configuration file to load (if omitted, uses internal) | -| `user-device-config-file [file]` | User device configuration file to load (if omitted, none used) | -| `max-ping-time [number]` | Milliseconds for ping time limit of server (if omitted, set to 0) | -| `log` | Level of logs to output by default (if omitted, set to None) | -| `allow-raw` | Allow clients to communicate using raw messages (DANGEROUS, CAN BRICK SOME DEVICES) | -| `use_bluetooth-le` | Use the Bluetooth LE Buttplug Device Communication Manager | -| `use-serial` | Use the Serial Port Buttplug Device Communication Manager | -| `use-hid` | Use the HID Buttplug Device Communication Manager | -| `use-lovense-dongle` | Use the HID Lovense Dongle Buttplug Device Communication Manager | -| `use-xinput` | Use the XInput Buttplug Device Communication Manager | -| `use-lovense-connect` | Use the Lovense Connect Buttplug Device Communication Manager | -| `use-device-websocket-server` | Use the Device Websocket Server Buttplug Device Communication Manager | -| `device-websocket-server-port` | Port for the device websocket server | - -For example, to run the server on websockets at port 12345 with bluetooth device support: - -`intiface-engine --weboscket-port 12345 --use-bluetooth-le` - -## Compiling - -Linux will have extra compilation dependency requirements via -[buttplug-rs](https://github.com/buttplugio/buttplug-rs). For pacakges required, -please check there. - -## Contributing - -Right now, we mostly need code/API style reviews and feedback. We don't really have any good -bite-sized chunks to mentor the implementation yet, but one we do, those will be marked "Help -Wanted" in our [github issues](https://github.com/buttplugio/buttplug-rs/issues). - -As we need money to keep up with supporting the latest and greatest hardware, we also have multiple -ways to donate! - -- [Patreon](https://patreon.com/qdot) -- [Github Sponsors](https://github.com/sponsors/qdot) -- [Ko-Fi](https://ko-fi.com/qdot76367) - -## License and Trademarks - -Intiface is a Registered Trademark of Nonpolynomial Labs, LLC - -Buttplug and Intiface are BSD licensed. - - Copyright (c) 2016-2022, Nonpolynomial Labs, LLC - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of buttplug nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/plugin-intiface/intiface-engine/intiface-engine b/packages/plugin-intiface/intiface-engine/intiface-engine deleted file mode 100755 index b4269442062..00000000000 Binary files a/packages/plugin-intiface/intiface-engine/intiface-engine and /dev/null differ diff --git a/packages/plugin-intiface/package.json b/packages/plugin-intiface/package.json deleted file mode 100644 index 16cc574f3e6..00000000000 --- a/packages/plugin-intiface/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@ai16z/plugin-intiface", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "buttplug": "3.2.2", - "net": "1.0.2", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test-via-bun": "bun test/simulate.ts" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-intiface/src/environment.ts b/packages/plugin-intiface/src/environment.ts deleted file mode 100644 index 9359952df7b..00000000000 --- a/packages/plugin-intiface/src/environment.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { IAgentRuntime } from "@ai16z/eliza"; -import { z } from "zod"; - -export const intifaceEnvSchema = z - .object({ - INTIFACE_URL: z.string().default("ws://localhost:12345"), - INTIFACE_NAME: z.string().default("Eliza Intiface Client"), - DEVICE_NAME: z.string().default("Lovense Nora"), - }) - .refine( - (data) => { - return ( - data.INTIFACE_URL.startsWith("ws://") || - data.INTIFACE_URL.startsWith("wss://") - ); - }, - { - message: - "INTIFACE_URL must be a valid WebSocket URL (ws:// or wss://)", - } - ); - -export type IntifaceConfig = z.infer; - -export async function validateIntifaceConfig( - runtime: IAgentRuntime -): Promise { - try { - const config = { - INTIFACE_URL: - runtime.getSetting("INTIFACE_URL") || process.env.INTIFACE_URL, - INTIFACE_NAME: - runtime.getSetting("INTIFACE_NAME") || - process.env.INTIFACE_NAME, - DEVICE_NAME: - runtime.getSetting("DEVICE_NAME") || process.env.DEVICE_NAME, - }; - - return intifaceEnvSchema.parse(config); - } catch (error) { - if (error instanceof z.ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `Intiface configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/plugin-intiface/src/index.ts b/packages/plugin-intiface/src/index.ts deleted file mode 100644 index 3cf09276e90..00000000000 --- a/packages/plugin-intiface/src/index.ts +++ /dev/null @@ -1,585 +0,0 @@ -import { ButtplugClient, ButtplugNodeWebsocketClientConnector } from "buttplug"; -import { validateIntifaceConfig, type IntifaceConfig } from "./environment"; -import type { - Action, - HandlerCallback, - IAgentRuntime, - Memory, - Plugin, - State, -} from "@ai16z/eliza"; -import { Service, ServiceType } from "@ai16z/eliza"; -import { - isPortAvailable, - startIntifaceEngine, - shutdownIntifaceEngine, -} from "./utils"; - -export interface IIntifaceService extends Service { - vibrate(strength: number, duration: number): Promise; - rotate?(strength: number, duration: number): Promise; - getBatteryLevel?(): Promise; - isConnected(): boolean; - getDevices(): any[]; -} - -export class IntifaceService extends Service implements IIntifaceService { - static serviceType: ServiceType = ServiceType.INTIFACE; - private client: ButtplugClient; - private connected = false; - private devices: Map = new Map(); - private vibrateQueue: VibrateEvent[] = []; - private isProcessingQueue = false; - private config: IntifaceConfig | null = null; - private maxVibrationIntensity = 1; - private rampUpAndDown = false; - private rampSteps = 20; - private preferredDeviceName: string | undefined; - - constructor() { - super(); - this.client = new ButtplugClient("Temporary Name"); - - this.client.addListener( - "deviceadded", - this.handleDeviceAdded.bind(this) - ); - this.client.addListener( - "deviceremoved", - this.handleDeviceRemoved.bind(this) - ); - - // Add cleanup handlers - process.on("SIGINT", this.cleanup.bind(this)); - process.on("SIGTERM", this.cleanup.bind(this)); - process.on("exit", this.cleanup.bind(this)); - } - - private async cleanup() { - try { - if (this.connected) { - await this.client.disconnect(); - } - await shutdownIntifaceEngine(); - } catch (error) { - console.error("[IntifaceService] Cleanup error:", error); - } - } - - getInstance(): IIntifaceService { - return this; - } - - async initialize(runtime: IAgentRuntime): Promise { - this.config = await validateIntifaceConfig(runtime); - this.preferredDeviceName = this.config.DEVICE_NAME; - this.client = new ButtplugClient(this.config.INTIFACE_NAME); - - if (this.config.INTIFACE_URL) { - await this.connect(); - } - } - - async connect() { - if (this.connected || !this.config) return; - - const portAvailable = await isPortAvailable(12345); - - if (portAvailable) { - try { - await startIntifaceEngine(); - } catch (error) { - console.error("Failed to start Intiface Engine:", error); - throw error; - } - } else { - console.log( - "Port 12345 is in use, assuming Intiface is already running" - ); - } - - let retries = 5; - while (retries > 0) { - try { - const connector = new ButtplugNodeWebsocketClientConnector( - this.config.INTIFACE_URL - ); - - await this.client.connect(connector); - this.connected = true; - await this.scanAndGrabDevices(); - return; - } catch (error) { - retries--; - if (retries > 0) { - console.log( - `Connection attempt failed, retrying... (${retries} attempts left)` - ); - await new Promise((r) => setTimeout(r, 2000)); - } else { - console.error( - "Failed to connect to Intiface server after all retries:", - error - ); - throw error; - } - } - } - } - - private async scanAndGrabDevices() { - await this.client.startScanning(); - console.log("Scanning for devices..."); - await new Promise((r) => setTimeout(r, 2000)); - - this.client.devices.forEach((device) => { - this.devices.set(device.name, device); - console.log(`- ${device.name} (${device.index})`); - }); - - if (this.devices.size === 0) { - console.log("No devices found"); - } - } - - private async ensureDeviceAvailable() { - if (!this.connected) { - throw new Error("Not connected to Intiface server"); - } - - if (this.devices.size === 0) { - await this.scanAndGrabDevices(); - } - - const devices = this.getDevices(); - if (devices.length === 0) { - throw new Error("No devices available"); - } - - let targetDevice; - if (this.preferredDeviceName) { - targetDevice = this.devices.get(this.preferredDeviceName); - if (!targetDevice) { - console.warn( - `Preferred device ${this.preferredDeviceName} not found, using first available device` - ); - targetDevice = devices[0]; - } - } else { - targetDevice = devices[0]; - } - - return targetDevice; - } - - async disconnect() { - if (!this.connected) return; - await this.client.disconnect(); - this.connected = false; - this.devices.clear(); - } - - private handleDeviceAdded(device: any) { - this.devices.set(device.name, device); - console.log(`Device connected: ${device.name}`); - } - - private handleDeviceRemoved(device: any) { - this.devices.delete(device.name); - console.log(`Device disconnected: ${device.name}`); - } - - getDevices() { - return Array.from(this.devices.values()); - } - - isConnected() { - return this.connected; - } - - private async addToVibrateQueue(event: VibrateEvent) { - this.vibrateQueue.push(event); - if (!this.isProcessingQueue) { - this.isProcessingQueue = true; - await this.processVibrateQueue(); - } - } - - private async processVibrateQueue() { - while (this.vibrateQueue.length > 0) { - const event = this.vibrateQueue[0]; - await this.handleVibrate(event); - this.vibrateQueue.shift(); - } - this.isProcessingQueue = false; - } - - private async handleVibrate(event: VibrateEvent) { - const targetDevice = await this.ensureDeviceAvailable(); - - if (this.rampUpAndDown) { - const steps = this.rampSteps; - const rampLength = (event.duration * 0.2) / steps; - let startIntensity = 0; - let endIntensity = event.strength; - let stepIntensity = (endIntensity - startIntensity) / steps; - - // Ramp up - for (let i = 0; i <= steps; i++) { - await targetDevice.vibrate(startIntensity + stepIntensity * i); - await new Promise((r) => setTimeout(r, rampLength)); - } - - // Hold - await new Promise((r) => setTimeout(r, event.duration * 0.54)); - - // Ramp down - startIntensity = event.strength; - endIntensity = 0; - stepIntensity = (endIntensity - startIntensity) / steps; - - for (let i = 0; i <= steps; i++) { - await targetDevice.vibrate(startIntensity + stepIntensity * i); - await new Promise((r) => setTimeout(r, rampLength)); - } - } else { - await targetDevice.vibrate(event.strength); - await new Promise((r) => setTimeout(r, event.duration)); - } - - await targetDevice.stop(); - } - - async vibrate(strength: number, duration: number): Promise { - const targetDevice = await this.ensureDeviceAvailable(); - await this.addToVibrateQueue({ - strength, - duration, - deviceId: targetDevice.id, - }); - } - - async getBatteryLevel(): Promise { - const targetDevice = await this.ensureDeviceAvailable(); - - try { - const battery = await targetDevice.battery(); - console.log( - `Battery level for ${targetDevice.name}: ${battery * 100}%` - ); - return battery; - } catch (err) { - console.error("Error getting battery level:", err); - throw err; - } - } - - async rotate(strength: number, duration: number): Promise { - const targetDevice = await this.ensureDeviceAvailable(); - - // Check if device supports rotation - if (!targetDevice.rotateCmd) { - throw new Error("Device does not support rotation"); - } - - if (this.rampUpAndDown) { - await this.rampedRotate(targetDevice, strength, duration); - } else { - await targetDevice.rotate(strength); - await new Promise((r) => setTimeout(r, duration)); - await targetDevice.stop(); - } - } - - private async rampedRotate( - device: any, - targetStrength: number, - duration: number - ) { - const stepTime = (duration * 0.2) / this.rampSteps; - - // Ramp up - for (let i = 0; i <= this.rampSteps; i++) { - const intensity = (targetStrength / this.rampSteps) * i; - await device.rotate(intensity); - await new Promise((r) => setTimeout(r, stepTime)); - } - - // Hold - await new Promise((r) => setTimeout(r, duration * 0.6)); - - // Ramp down - for (let i = this.rampSteps; i >= 0; i--) { - const intensity = (targetStrength / this.rampSteps) * i; - await device.rotate(intensity); - await new Promise((r) => setTimeout(r, stepTime)); - } - - await device.stop(); - } -} - -const vibrateAction: Action = { - name: "VIBRATE", - similes: ["VIBRATE_TOY", "VIBRATE_DEVICE", "START_VIBRATION", "BUZZ"], - description: "Control vibration intensity of connected devices", - validate: async (runtime: IAgentRuntime, _message: Memory) => { - try { - await validateIntifaceConfig(runtime); - return true; - } catch { - return false; - } - }, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, - callback: HandlerCallback - ) => { - const service = runtime.getService( - ServiceType.INTIFACE - ); - if (!service) { - throw new Error("Intiface service not available"); - } - - // Extract intensity and duration from message - // Default to 50% intensity for 2 seconds if not specified - const intensity = options?.intensity ?? 0.5; - const duration = options?.duration ?? 2000; - - await service.vibrate(intensity, duration); - - callback({ - text: `Vibrating at ${intensity * 100}% intensity for ${duration}ms`, - }); - }, - examples: [ - [ - { - user: "{{user1}}", - content: { text: "Vibrate the toy at 70% for 3 seconds" }, - }, - { - user: "{{agentName}}", - content: { - text: "Vibrating at 70% intensity for 3000ms", - action: "VIBRATE", - options: { intensity: 0.7, duration: 3000 }, - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "Start vibrating" }, - }, - { - user: "{{agentName}}", - content: { - text: "Vibrating at 50% intensity for 2000ms", - action: "VIBRATE", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "Make it buzz at max power for 5 seconds" }, - }, - { - user: "{{agentName}}", - content: { - text: "Vibrating at 100% intensity for 5000ms", - action: "VIBRATE", - options: { intensity: 1.0, duration: 5000 }, - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "Give me a gentle buzz" }, - }, - { - user: "{{agentName}}", - content: { - text: "Vibrating at 25% intensity for 2000ms", - action: "VIBRATE", - options: { intensity: 0.25, duration: 2000 }, - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "Vibrate for 10 seconds" }, - }, - { - user: "{{agentName}}", - content: { - text: "Vibrating at 50% intensity for 10000ms", - action: "VIBRATE", - options: { intensity: 0.5, duration: 10000 }, - }, - }, - ], - ], -}; - -const rotateAction: Action = { - name: "ROTATE", - similes: ["ROTATE_TOY", "ROTATE_DEVICE", "START_ROTATION", "SPIN"], - description: "Control rotation intensity of connected devices", - validate: async (runtime: IAgentRuntime, _message: Memory) => { - try { - await validateIntifaceConfig(runtime); - return true; - } catch { - return false; - } - }, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, - callback: HandlerCallback - ) => { - const service = runtime.getService( - ServiceType.INTIFACE - ); - if (!service || !service.rotate) { - throw new Error("Rotation not supported"); - } - - const intensity = options?.intensity ?? 0.5; - const duration = options?.duration ?? 2000; - - await service.rotate(intensity, duration); - - callback({ - text: `Rotating at ${intensity * 100}% intensity for ${duration}ms`, - }); - }, - examples: [ - [ - { - user: "{{user1}}", - content: { text: "Rotate the toy at 70% for 3 seconds" }, - }, - { - user: "{{agentName}}", - content: { - text: "Rotating at 70% intensity for 3000ms", - action: "ROTATE", - options: { intensity: 0.7, duration: 3000 }, - }, - }, - ], - ], -}; - -const batteryAction: Action = { - name: "BATTERY", - similes: [ - "CHECK_BATTERY", - "BATTERY_LEVEL", - "TOY_BATTERY", - "DEVICE_BATTERY", - ], - description: "Check battery level of connected devices", - validate: async (runtime: IAgentRuntime, _message: Memory) => { - try { - await validateIntifaceConfig(runtime); - return true; - } catch { - return false; - } - }, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, - callback: HandlerCallback - ) => { - const service = runtime.getService( - ServiceType.INTIFACE - ); - if (!service || !service.getBatteryLevel) { - throw new Error("Battery level check not supported"); - } - - try { - const batteryLevel = await service.getBatteryLevel(); - callback({ - text: `Device battery level is at ${Math.round(batteryLevel * 100)}%`, - }); - } catch (err) { - callback({ - text: "Unable to get battery level. Device might not support this feature.", - }); - } - }, - examples: [ - [ - { - user: "{{user1}}", - content: { text: "What's the battery level?" }, - }, - { - user: "{{agentName}}", - content: { - text: "Device battery level is at 90%", - action: "BATTERY", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "Check toy battery" }, - }, - { - user: "{{agentName}}", - content: { - text: "Device battery level is at 75%", - action: "BATTERY", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "How much battery is left?" }, - }, - { - user: "{{agentName}}", - content: { - text: "Device battery level is at 45%", - action: "BATTERY", - }, - }, - ], - ], -}; - -interface VibrateEvent { - duration: number; - strength: number; - deviceId?: number; -} - -export const intifacePlugin: Plugin = { - name: "intiface", - description: "Controls intimate hardware devices", - actions: [vibrateAction, rotateAction, batteryAction], - evaluators: [], - providers: [], - services: [new IntifaceService()], -}; - -export default intifacePlugin; diff --git a/packages/plugin-intiface/src/intiface-user-device-config.json b/packages/plugin-intiface/src/intiface-user-device-config.json deleted file mode 100644 index 0a543432788..00000000000 --- a/packages/plugin-intiface/src/intiface-user-device-config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": { - "major": 2, - "minor": 6 - }, - "user-configs": { - "specifiers": { - "lovense": { - "websocket": { - "names": ["LVSDevice"] - } - }, - "tcode-v03": { - "websocket": { - "names": ["TCodeDevice"] - } - } - } - } -} diff --git a/packages/plugin-intiface/src/utils.ts b/packages/plugin-intiface/src/utils.ts deleted file mode 100644 index 12019898d98..00000000000 --- a/packages/plugin-intiface/src/utils.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { spawn, type ChildProcess } from "child_process"; -import net from "net"; -import path from "path"; -import { fileURLToPath } from "url"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -let intifaceProcess: ChildProcess | null = null; - -export async function isPortAvailable(port: number): Promise { - return new Promise((resolve) => { - const server = net - .createServer() - .once("error", () => resolve(false)) - .once("listening", () => { - server.close(); - resolve(true); - }) - .listen(port); - }); -} - -export async function startIntifaceEngine(): Promise { - const configPath = path.join( - __dirname, - "../src/intiface-user-device-config.json" - ); - try { - const child = spawn( - path.join(__dirname, "../intiface-engine/intiface-engine"), - [ - "--websocket-port", - "12345", - "--use-bluetooth-le", - "--server-name", - "Eliza Intiface Server", - "--use-device-websocket-server", - "--user-device-config-file", - configPath, - ], - { - detached: false, - stdio: "ignore", - windowsHide: true, - } - ); - - child.unref(); - intifaceProcess = child; - await new Promise((resolve) => setTimeout(resolve, 5000)); - console.log("[utils] Intiface Engine started"); - } catch (error) { - throw new Error(`Failed to start Intiface Engine: ${error}`); - } -} - -async function cleanup() { - if (intifaceProcess) { - console.log("[utils] Shutting down Intiface Engine..."); - try { - // Try graceful shutdown first - intifaceProcess.kill("SIGTERM"); - - // Give it a moment to shut down gracefully - await new Promise((r) => setTimeout(r, 1000)); - - // Force kill if still running - if (intifaceProcess.killed === false) { - try { - const killCommand = - process.platform === "win32" - ? spawn("taskkill", [ - "/F", - "/IM", - "intiface-engine.exe", - ]) - : spawn("pkill", ["intiface-engine"]); - - await new Promise((resolve) => { - killCommand.on("close", resolve); - }); - } catch (killErr) { - console.error( - "[utils] Error force killing Intiface Engine:", - killErr - ); - } - } - } catch (err) { - console.error( - "[utils] Error during Intiface Engine shutdown:", - err - ); - } finally { - intifaceProcess = null; - } - } -} - -// Export cleanup for manual shutdown if needed -export { cleanup as shutdownIntifaceEngine }; diff --git a/packages/plugin-intiface/test/buttplug-user-device-config-test.json b/packages/plugin-intiface/test/buttplug-user-device-config-test.json deleted file mode 100644 index 0a543432788..00000000000 --- a/packages/plugin-intiface/test/buttplug-user-device-config-test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": { - "major": 2, - "minor": 6 - }, - "user-configs": { - "specifiers": { - "lovense": { - "websocket": { - "names": ["LVSDevice"] - } - }, - "tcode-v03": { - "websocket": { - "names": ["TCodeDevice"] - } - } - } - } -} diff --git a/packages/plugin-intiface/test/fake-buttplug.ts b/packages/plugin-intiface/test/fake-buttplug.ts deleted file mode 100644 index e14bc8dfc24..00000000000 --- a/packages/plugin-intiface/test/fake-buttplug.ts +++ /dev/null @@ -1,202 +0,0 @@ -import WebSocket from "ws"; -import EventEmitter from "events"; - -interface DeviceHandshake { - identifier: string; - address: string; - version: number; -} - -abstract class SimulatedDevice extends EventEmitter { - protected ws: WebSocket | null = null; - protected connected = false; - protected shouldReconnect = true; - name: string; - protected cmdLog: Record = {}; - - constructor( - protected port: number, - protected deviceType: string, - protected address: string - ) { - super(); - this.name = `Simulated ${deviceType}`; - this.connect(); - } - - private connect(): void { - if (this.ws || !this.shouldReconnect) return; - - console.log( - `[fake-buttplug] Connecting ${this.deviceType} to port ${this.port}` - ); - this.ws = new WebSocket(`ws://127.0.0.1:${this.port}`); - - this.ws.on("open", () => { - this.connected = true; - console.log(`[fake-buttplug] ${this.deviceType} connected`); - const handshake: DeviceHandshake = { - identifier: this.getIdentifier(), - address: this.address, - version: 0, - }; - this.ws?.send(JSON.stringify(handshake)); - }); - - this.ws.on("message", (data: string) => { - const message = data.toString(); - console.log( - `[fake-buttplug] ${this.deviceType} received:`, - message - ); - this.handleMessage(message); - }); - - this.ws.on("error", (error) => { - if (this.shouldReconnect) { - console.log( - `[fake-buttplug] ${this.deviceType} error:`, - error.message - ); - this.reconnect(); - } - }); - - this.ws.on("close", () => { - if (this.shouldReconnect) { - console.log(`[fake-buttplug] ${this.deviceType} disconnected`); - this.connected = false; - this.reconnect(); - } - }); - } - - private reconnect(): void { - if (!this.connected && this.shouldReconnect) { - this.ws = null; - setTimeout(() => this.connect(), 1000); - } - } - - protected abstract getIdentifier(): string; - protected abstract handleMessage(message: string): void; - - async disconnect(): Promise { - this.shouldReconnect = false; - if (this.ws) { - await this.stop(); - this.ws.close(); - this.ws = null; - } - this.connected = false; - } - - abstract stop(): Promise; -} - -export class LovenseNora extends SimulatedDevice { - private batteryQueryReceived = false; - private batteryLevel = 0.9; - private vibrateCmdLog: Record = {}; - private rotateCmdLog: Record = {}; - - constructor(port: number = 54817) { - super(port, "Lovense Nora", "696969696969"); - } - - protected getIdentifier(): string { - return "LVSDevice"; - } - - protected handleMessage(message: string): void { - if (message.startsWith("DeviceType;")) { - this.ws?.send(`A:${this.address}:10`); - console.log( - `[fake-buttplug] Sent device type response: A:${this.address}:10` - ); - } else if (message.startsWith("Vibrate:")) { - const match = message.match(/Vibrate:(\d+);/); - if (match) { - const speed = parseInt(match[1]); - if ( - speed === 0 && - Object.keys(this.vibrateCmdLog).length === 0 - ) { - return; - } - this.vibrateCmdLog[Date.now()] = message; - console.log( - `[fake-buttplug] Vibrate command logged: ${message}` - ); - } - } else if (message.startsWith("Rotate:")) { - const match = message.match(/Rotate:(\d+);/); - if (match) { - const speed = parseInt(match[1]); - if ( - speed === 0 && - Object.keys(this.rotateCmdLog).length === 0 - ) { - return; - } - this.rotateCmdLog[Date.now()] = message; - console.log( - `[fake-buttplug] Rotate command logged: ${message}` - ); - } - } else if (message.startsWith("Battery")) { - this.batteryQueryReceived = true; - const response = `${Math.floor(this.batteryLevel * 100)};`; - this.ws?.send(response); - console.log( - `[fake-buttplug] Battery query received, responding with: ${response}` - ); - } - } - - async vibrate(speed: number): Promise { - if (!this.connected || !this.ws) { - throw new Error("Device not connected"); - } - const command = `Vibrate:${Math.floor(speed * 100)};`; - this.ws.send(command); - console.log(`[fake-buttplug] Sending vibrate command: ${command}`); - } - - async rotate(speed: number): Promise { - if (!this.connected || !this.ws) { - throw new Error("Device not connected"); - } - const command = `Rotate:${Math.floor(speed * 100)};`; - this.ws.send(command); - console.log(`[fake-buttplug] Sending rotate command: ${command}`); - } - - async stop(): Promise { - if (this.connected && this.ws) { - this.ws.send("Vibrate:0;"); - this.ws.send("Rotate:0;"); - console.log("[fake-buttplug] Stopping all motors"); - } - } - - async getBatteryLevel(): Promise { - if (!this.connected || !this.ws) { - throw new Error("Device not connected"); - } - this.ws.send("Battery;"); - return this.batteryLevel; - } -} - -// Start simulator if run directly -if (import.meta.url === new URL(import.meta.url).href) { - console.log("[fake-buttplug] Starting simulator service"); - const simulator = new LovenseNora(); - - process.on("SIGINT", async () => { - console.log("[fake-buttplug] Shutting down simulator"); - await simulator.disconnect(); - process.exit(0); - }); -} diff --git a/packages/plugin-intiface/test/simulate.ts b/packages/plugin-intiface/test/simulate.ts deleted file mode 100644 index 116e9710e2a..00000000000 --- a/packages/plugin-intiface/test/simulate.ts +++ /dev/null @@ -1,308 +0,0 @@ -import { - ButtplugClient, - ButtplugNodeWebsocketClientConnector, - ButtplugClientDevice, -} from "buttplug"; -import { LovenseNora } from "./fake-buttplug"; - -import { spawn } from "child_process"; -import net from "net"; -import path from "path"; -import { fileURLToPath } from "url"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -const WEBSOCKET_PORT = 54817; - -export async function isPortAvailable(port: number): Promise { - return new Promise((resolve) => { - const server = net - .createServer() - .once("error", () => resolve(false)) - .once("listening", () => { - server.close(); - resolve(true); - }) - .listen(port); - }); -} - -interface TestDevice { - name: string; - vibrate(speed: number): Promise; - stop(): Promise; - disconnect(): Promise; - getBatteryLevel?(): Promise; -} - -class ButtplugDeviceWrapper implements TestDevice { - constructor( - private device: ButtplugClientDevice, - private client: ButtplugClient - ) { - this.name = device.name; - } - name: string; - - async vibrate(speed: number) { - try { - await this.device.vibrate(speed); - console.log( - `[Simulation] Vibrating ${this.name} at ${speed * 100}%` - ); - } catch (err) { - console.error("Vibration error:", err); - throw err; - } - } - - async stop() { - try { - await this.device.stop(); - console.log(`[Simulation] Stopping ${this.name}`); - } catch (err) { - console.error("Stop error:", err); - throw err; - } - } - - async disconnect() { - try { - await this.device.stop(); - await this.client.disconnect(); - // Kill the Intiface Engine server process - try { - const killCommand = - process.platform === "win32" - ? spawn("taskkill", [ - "/F", - "/IM", - "intiface-engine.exe", - ]) - : spawn("pkill", ["intiface-engine"]); - - await new Promise((resolve) => { - killCommand.on("close", resolve); - }); - } catch (killErr) { - console.error("Error killing Intiface Engine:", killErr); - } - } catch (err) { - console.error("Disconnect error:", err); - } - } - - async getBatteryLevel(): Promise { - try { - const battery = await this.device.battery(); - console.log( - `[Simulation] Battery level for ${this.name}: ${battery * 100}%` - ); - return battery; - } catch (err) { - console.error("Battery check error:", err); - throw err; - } - } -} - -export async function startIntifaceEngine(): Promise { - try { - const child = spawn( - path.join(__dirname, "../intiface-engine/intiface-engine"), - [ - "--websocket-port", - "12345", - "--use-bluetooth-le", - "--server-name", - "Eliza Buttplugin Server", - "--log", - "debug", - "--use-device-websocket-server", - "--device-websocket-server-port", - WEBSOCKET_PORT.toString(), - "--user-device-config-file", - path.join(__dirname, "buttplug-user-device-config-test.json"), - ], - { - detached: true, - stdio: "ignore", - windowsHide: true, - } - ); - - child.unref(); - await new Promise((resolve) => setTimeout(resolve, 5000)); - } catch (error) { - throw new Error(`Failed to start Intiface Engine: ${error}`); - } -} - -async function getTestDevice(): Promise { - const client = new ButtplugClient("Test Client"); - const connector = new ButtplugNodeWebsocketClientConnector( - "ws://localhost:12345" - ); - - try { - await client.connect(connector); - client.on("deviceremoved", () => { - console.log("Device disconnected"); - }); - - await client.startScanning(); - await new Promise((r) => setTimeout(r, 2000)); - - const devices = client.devices; - if (devices.length > 0) { - console.log("Using real Buttplug device:", devices[0].name); - return new ButtplugDeviceWrapper(devices[0], client); - } - - await client.disconnect(); - console.log("No real devices found, falling back to simulator"); - return new LovenseNora(WEBSOCKET_PORT); - } catch (err) { - console.log( - "Couldn't connect to Buttplug server, attempting to start Intiface Engine..." - ); - try { - const portAvailable = await isPortAvailable(12345); - if (portAvailable) { - await startIntifaceEngine(); - await new Promise((resolve) => setTimeout(resolve, 5000)); - - await client.connect(connector); - await client.startScanning(); - await new Promise((r) => setTimeout(r, 5000)); - - const devices = client.devices; - if (devices.length > 0) { - console.log("Using real Buttplug device:", devices[0].name); - return new ButtplugDeviceWrapper(devices[0], client); - } - } - await client.disconnect(); - } catch (startupErr) { - console.log("Failed to start Intiface Engine:", startupErr); - try { - await client.disconnect(); - } catch {} // Ignore disconnect errors - } - console.log("Falling back to simulator"); - return new LovenseNora(WEBSOCKET_PORT); - } -} - -async function runTestSequence(device: TestDevice) { - console.log("Starting test sequence with:", device.name); - await new Promise((r) => setTimeout(r, 1000)); - - // Check battery level if supported - if (device.getBatteryLevel) { - console.log("\n=== Testing Battery Level ==="); - try { - const batteryLevel = await device.getBatteryLevel(); - console.log(`Battery level: ${batteryLevel * 100}%`); - } catch (err) { - console.log("Battery level check not supported or failed"); - } - await new Promise((r) => setTimeout(r, 1000)); - } - - // Test vibration - console.log("\n=== Testing Vibration ==="); - console.log("Vibrating at 25%"); - await device.vibrate(0.25); - await new Promise((r) => setTimeout(r, 2000)); - - console.log("Vibrating at 75%"); - await device.vibrate(0.75); - await new Promise((r) => setTimeout(r, 2000)); - - console.log("Stopping vibration"); - await device.stop(); - await new Promise((r) => setTimeout(r, 1000)); - - // Test rotation if available - if ("rotate" in device) { - console.log("\n=== Testing Rotation ==="); - console.log("Rotating at 30%"); - await (device as LovenseNora).rotate(0.3); - await new Promise((r) => setTimeout(r, 2000)); - - console.log("Rotating at 90%"); - await (device as LovenseNora).rotate(0.9); - await new Promise((r) => setTimeout(r, 2000)); - - console.log("Stopping rotation"); - await device.stop(); - await new Promise((r) => setTimeout(r, 1000)); - } - - // Test combined movements if available - if ("rotate" in device) { - console.log("\n=== Testing Combined Movements ==="); - console.log("Vibrating at 50% and rotating at 60%"); - await device.vibrate(0.5); - await (device as LovenseNora).rotate(0.6); - await new Promise((r) => setTimeout(r, 3000)); - - console.log("Stopping all motors"); - await device.stop(); - await new Promise((r) => setTimeout(r, 1000)); - } - - // Test rapid changes - console.log("\n=== Testing Rapid Changes ==="); - for (let i = 0; i < 5; i++) { - console.log(`Quick pulse ${i + 1}/5`); - await device.vibrate(0.8); - await new Promise((r) => setTimeout(r, 200)); - await device.stop(); - await new Promise((r) => setTimeout(r, 300)); - } - - // Check battery level again after usage - if (device.getBatteryLevel) { - console.log("\n=== Checking Battery After Usage ==="); - try { - const batteryLevel = await device.getBatteryLevel(); - console.log(`Battery level after tests: ${batteryLevel * 100}%`); - } catch (err) { - console.log("Battery level check not supported or failed"); - } - await new Promise((r) => setTimeout(r, 1000)); - } - - // Final cleanup - console.log("\n=== Test Sequence Complete ==="); - await device.stop(); - await new Promise((r) => setTimeout(r, 500)); -} - -async function main() { - let device: TestDevice | null = null; - try { - device = await getTestDevice(); - await runTestSequence(device); - } catch (err) { - console.error("Error during test:", err); - } finally { - if (device) { - await new Promise((r) => setTimeout(r, 500)); - try { - await device.disconnect(); - } catch (err) { - console.error("Error during disconnect:", err); - } - } - process.exit(0); - } -} - -main().catch((err) => { - console.error("Unhandled error:", err); - process.exit(1); -}); diff --git a/packages/plugin-intiface/tsconfig.json b/packages/plugin-intiface/tsconfig.json deleted file mode 100644 index 834c4dce269..00000000000 --- a/packages/plugin-intiface/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src", - "types": [ - "node" - ] - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-intiface/tsup.config.ts b/packages/plugin-intiface/tsup.config.ts deleted file mode 100644 index 58ed52c4990..00000000000 --- a/packages/plugin-intiface/tsup.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], - external: [ - "dotenv", - "fs", - "path", - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - ], -}); diff --git a/packages/plugin-near/package.json b/packages/plugin-near/package.json index 3aaadaad35b..414d0fbd726 100644 --- a/packages/plugin-near/package.json +++ b/packages/plugin-near/package.json @@ -6,7 +6,6 @@ "types": "dist/index.d.ts", "dependencies": { "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-trustdb": "workspace:*", "@ref-finance/ref-sdk": "^1.4.6", "tsup": "8.3.5", "near-api-js": "5.0.1", diff --git a/packages/plugin-solana/.npmignore b/packages/plugin-solana/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-solana/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-solana/eslint.config.mjs b/packages/plugin-solana/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-solana/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-solana/package.json b/packages/plugin-solana/package.json deleted file mode 100644 index 2aa671fb7af..00000000000 --- a/packages/plugin-solana/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@ai16z/plugin-solana", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-trustdb": "workspace:*", - "@ai16z/plugin-tee": "workspace:*", - "@coral-xyz/anchor": "0.30.1", - "@solana/spl-token": "0.4.9", - "@solana/web3.js": "1.95.8", - "bignumber": "1.1.0", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "node-cache": "5.1.2", - "pumpdotfun-sdk": "1.3.2", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-solana/src/actions/swap.ts b/packages/plugin-solana/src/actions/swap.ts index 1730fe4a97f..1e9635e2a1f 100644 --- a/packages/plugin-solana/src/actions/swap.ts +++ b/packages/plugin-solana/src/actions/swap.ts @@ -1,7 +1,6 @@ import { Connection, PublicKey, VersionedTransaction } from "@solana/web3.js"; import BigNumber from "bignumber.js"; import { v4 as uuidv4 } from "uuid"; -import { TrustScoreDatabase } from "@ai16z/plugin-trustdb"; import { ActionExample, HandlerCallback, @@ -362,81 +361,6 @@ export const executeSwap: Action = { ); } - if (type === "buy") { - const tokenProvider = new TokenProvider( - response.outputTokenCA, - provider, - runtime.cacheManager - ); - const module = await import("better-sqlite3"); - const Database = module.default; - const trustScoreDb = new TrustScoreDatabase( - new Database(":memory:") - ); - // add or get recommender - const uuid = uuidv4(); - const recommender = await trustScoreDb.getOrCreateRecommender({ - id: uuid, - address: walletPublicKey.toString(), - solanaPubkey: walletPublicKey.toString(), - }); - - const trustScoreDatabase = new TrustScoreManager( - runtime, - tokenProvider, - trustScoreDb - ); - // save the trade - const tradeData = { - buy_amount: response.amount, - is_simulation: false, - }; - await trustScoreDatabase.createTradePerformance( - runtime, - response.outputTokenCA, - recommender.id, - tradeData - ); - } else if (type === "sell") { - const tokenProvider = new TokenProvider( - response.inputTokenCA, - provider, - runtime.cacheManager - ); - const module = await import("better-sqlite3"); - const Database = module.default; - const trustScoreDb = new TrustScoreDatabase( - new Database(":memory:") - ); - // add or get recommender - const uuid = uuidv4(); - const recommender = await trustScoreDb.getOrCreateRecommender({ - id: uuid, - address: walletPublicKey.toString(), - solanaPubkey: walletPublicKey.toString(), - }); - - const trustScoreDatabase = new TrustScoreManager( - runtime, - tokenProvider, - trustScoreDb - ); - // save the trade - const sellDetails = { - sell_amount: response.amount, - sell_recommender_id: recommender.id, - }; - const sellTimeStamp = new Date().getTime().toString(); - await trustScoreDatabase.updateSellDetails( - runtime, - response.inputTokenCA, - recommender.id, - sellTimeStamp, - sellDetails, - false - ); - } - console.log("Swap completed successfully!"); console.log(`Transaction ID: ${txid}`); diff --git a/packages/plugin-solana/src/actions/swapDao.ts b/packages/plugin-solana/src/actions/swapDao.ts deleted file mode 100644 index 2cadb4f78fc..00000000000 --- a/packages/plugin-solana/src/actions/swapDao.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { - ActionExample, - IAgentRuntime, - Memory, - type Action, -} from "@ai16z/eliza"; -import { Connection, Keypair, PublicKey, Transaction } from "@solana/web3.js"; -import { getQuote } from "./swapUtils.ts"; -import { getWalletKey } from "../keypairUtils.ts"; - -async function invokeSwapDao( - connection: Connection, - authority: Keypair, - statePDA: PublicKey, - walletPDA: PublicKey, - instructionData: Buffer -): Promise { - const discriminator = new Uint8Array([ - 25, 143, 207, 190, 174, 228, 130, 107, - ]); - - // Combine discriminator and instructionData into a single Uint8Array - const combinedData = new Uint8Array( - discriminator.length + instructionData.length - ); - combinedData.set(discriminator, 0); - combinedData.set(instructionData, discriminator.length); - - const transaction = new Transaction().add({ - programId: new PublicKey("PROGRAM_ID"), - keys: [ - { pubkey: authority.publicKey, isSigner: true, isWritable: true }, - { pubkey: statePDA, isSigner: false, isWritable: true }, - { pubkey: walletPDA, isSigner: false, isWritable: true }, - ], - data: Buffer.from(combinedData), - }); - - const signature = await connection.sendTransaction(transaction, [ - authority, - ]); - await connection.confirmTransaction(signature); - return signature; -} - -async function promptConfirmation(): Promise { - // confirmation logic here - const confirmSwap = window.confirm("Confirm the token swap?"); - return confirmSwap; -} - -export const executeSwapForDAO: Action = { - name: "EXECUTE_SWAP_DAO", - similes: ["SWAP_TOKENS_DAO", "TOKEN_SWAP_DAO"], - validate: async (runtime: IAgentRuntime, message: Memory) => { - console.log("Message:", message); - return true; - }, - description: "Perform a DAO token swap using execute_invoke.", - handler: async ( - runtime: IAgentRuntime, - message: Memory - ): Promise => { - const { inputToken, outputToken, amount } = message.content; - - try { - const connection = new Connection( - runtime.getSetting("RPC_URL") as string - ); - - const { keypair: authority } = await getWalletKey(runtime, true); - - const daoMint = new PublicKey(runtime.getSetting("DAO_MINT")); // DAO mint address - - // Derive PDAs - const [statePDA] = await PublicKey.findProgramAddress( - [Buffer.from("state"), daoMint.toBuffer()], - authority.publicKey - ); - const [walletPDA] = await PublicKey.findProgramAddress( - [Buffer.from("wallet"), daoMint.toBuffer()], - authority.publicKey - ); - - const quoteData = await getQuote( - connection as Connection, - inputToken as string, - outputToken as string, - amount as number - ); - console.log("Swap Quote:", quoteData); - - const confirmSwap = await promptConfirmation(); - if (!confirmSwap) { - console.log("Swap canceled by user"); - return false; - } - - // Prepare instruction data for swap - const instructionData = Buffer.from( - JSON.stringify({ - quote: quoteData.data, - userPublicKey: authority.publicKey.toString(), - wrapAndUnwrapSol: true, - }) - ); - - const txid = await invokeSwapDao( - connection, - authority, - statePDA, - walletPDA, - instructionData - ); - - console.log("DAO Swap completed successfully!"); - console.log(`Transaction ID: ${txid}`); - - return true; - } catch (error) { - console.error("Error during DAO token swap:", error); - return false; - } - }, - examples: [ - [ - { - user: "{{user1}}", - content: { - inputTokenSymbol: "SOL", - outputTokenSymbol: "USDC", - inputToken: "So11111111111111111111111111111111111111112", - outputToken: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", - amount: 0.1, - }, - }, - { - user: "{{user2}}", - content: { - text: "Swapping 0.1 SOL for USDC using DAO...", - action: "TOKEN_SWAP_DAO", - }, - }, - { - user: "{{user2}}", - content: { - text: "DAO Swap completed successfully! Transaction ID: ...", - }, - }, - ], - ] as ActionExample[][], -} as Action; diff --git a/packages/plugin-solana/src/actions/swapUtils.ts b/packages/plugin-solana/src/actions/swapUtils.ts deleted file mode 100644 index 29c927b48c2..00000000000 --- a/packages/plugin-solana/src/actions/swapUtils.ts +++ /dev/null @@ -1,327 +0,0 @@ -import { getAssociatedTokenAddress } from "@solana/spl-token"; -import { - BlockhashWithExpiryBlockHeight, - Connection, - Keypair, - PublicKey, - RpcResponseAndContext, - SimulatedTransactionResponse, - TokenAmount, - VersionedTransaction, -} from "@solana/web3.js"; -import { settings } from "@ai16z/eliza"; - -const solAddress = settings.SOL_ADDRESS; -const SLIPPAGE = settings.SLIPPAGE; -const connection = new Connection( - settings.RPC_URL || "https://api.mainnet-beta.solana.com" -); -const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - -export async function delayedCall( - method: (...args: any[]) => Promise, - ...args: any[] -): Promise { - await delay(150); - return method(...args); -} - -export async function getTokenDecimals( - connection: Connection, - mintAddress: string -): Promise { - const mintPublicKey = new PublicKey(mintAddress); - const tokenAccountInfo = - await connection.getParsedAccountInfo(mintPublicKey); - - // Check if the data is parsed and contains the expected structure - if ( - tokenAccountInfo.value && - typeof tokenAccountInfo.value.data === "object" && - "parsed" in tokenAccountInfo.value.data - ) { - const parsedInfo = tokenAccountInfo.value.data.parsed?.info; - if (parsedInfo && typeof parsedInfo.decimals === "number") { - return parsedInfo.decimals; - } - } - - throw new Error("Unable to fetch token decimals"); -} - -export async function getQuote( - connection: Connection, - baseToken: string, - outputToken: string, - amount: number -): Promise { - const decimals = await getTokenDecimals(connection, baseToken); - const adjustedAmount = amount * 10 ** decimals; - - const quoteResponse = await fetch( - `https://quote-api.jup.ag/v6/quote?inputMint=${baseToken}&outputMint=${outputToken}&amount=${adjustedAmount}&slippageBps=50` - ); - const swapTransaction = await quoteResponse.json(); - const swapTransactionBuf = Buffer.from(swapTransaction, "base64"); - return new Uint8Array(swapTransactionBuf); -} - -export const executeSwap = async ( - transaction: VersionedTransaction, - type: "buy" | "sell" -) => { - try { - const latestBlockhash: BlockhashWithExpiryBlockHeight = - await delayedCall(connection.getLatestBlockhash.bind(connection)); - const signature = await connection.sendTransaction(transaction, { - skipPreflight: false, - }); - const confirmation = await connection.confirmTransaction( - { - signature, - lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, - blockhash: latestBlockhash.blockhash, - }, - "finalized" - ); - if (confirmation.value.err) { - console.log("Confirmation error", confirmation.value.err); - - throw new Error("Confirmation error"); - } else { - if (type === "buy") { - console.log( - "Buy successful: https://solscan.io/tx/${signature}" - ); - } else { - console.log( - "Sell successful: https://solscan.io/tx/${signature}" - ); - } - } - - return signature; - } catch (error) { - console.log(error); - } -}; - -export const Sell = async (baseMint: PublicKey, wallet: Keypair) => { - try { - const tokenAta = await delayedCall( - getAssociatedTokenAddress, - baseMint, - wallet.publicKey - ); - const tokenBalInfo: RpcResponseAndContext = - await delayedCall( - connection.getTokenAccountBalance.bind(connection), - tokenAta - ); - - if (!tokenBalInfo) { - console.log("Balance incorrect"); - return null; - } - - const tokenBalance = tokenBalInfo.value.amount; - if (tokenBalance === "0") { - console.warn( - `No token balance to sell with wallet ${wallet.publicKey}` - ); - } - - const sellTransaction = await getSwapTxWithWithJupiter( - wallet, - baseMint, - tokenBalance, - "sell" - ); - // simulate the transaction - if (!sellTransaction) { - console.log("Failed to get sell transaction"); - return null; - } - - const simulateResult: RpcResponseAndContext = - await delayedCall( - connection.simulateTransaction.bind(connection), - sellTransaction - ); - if (simulateResult.value.err) { - console.log("Sell Simulation failed", simulateResult.value.err); - return null; - } - - // execute the transaction - return executeSwap(sellTransaction, "sell"); - } catch (error) { - console.log(error); - } -}; - -export const Buy = async (baseMint: PublicKey, wallet: Keypair) => { - try { - const tokenAta = await delayedCall( - getAssociatedTokenAddress, - baseMint, - wallet.publicKey - ); - const tokenBalInfo: RpcResponseAndContext = - await delayedCall( - connection.getTokenAccountBalance.bind(connection), - tokenAta - ); - - if (!tokenBalInfo) { - console.log("Balance incorrect"); - return null; - } - - const tokenBalance = tokenBalInfo.value.amount; - if (tokenBalance === "0") { - console.warn( - `No token balance to sell with wallet ${wallet.publicKey}` - ); - } - - const buyTransaction = await getSwapTxWithWithJupiter( - wallet, - baseMint, - tokenBalance, - "buy" - ); - // simulate the transaction - if (!buyTransaction) { - console.log("Failed to get buy transaction"); - return null; - } - - const simulateResult: RpcResponseAndContext = - await delayedCall( - connection.simulateTransaction.bind(connection), - buyTransaction - ); - if (simulateResult.value.err) { - console.log("Buy Simulation failed", simulateResult.value.err); - return null; - } - - // execute the transaction - return executeSwap(buyTransaction, "buy"); - } catch (error) { - console.log(error); - } -}; - -export const getSwapTxWithWithJupiter = async ( - wallet: Keypair, - baseMint: PublicKey, - amount: string, - type: "buy" | "sell" -) => { - try { - switch (type) { - case "buy": - return fetchBuyTransaction(wallet, baseMint, amount); - case "sell": - return fetchSellTransaction(wallet, baseMint, amount); - default: - return fetchSellTransaction(wallet, baseMint, amount); - } - } catch (error) { - console.log(error); - } -}; - -export const fetchBuyTransaction = async ( - wallet: Keypair, - baseMint: PublicKey, - amount: string -) => { - try { - const quoteResponse = await ( - await fetch( - `https://quote-api.jup.ag/v6/quote?inputMint=${solAddress}&outputMint=${baseMint.toBase58()}&amount=${amount}&slippageBps=${SLIPPAGE}` - ) - ).json(); - const { swapTransaction } = await ( - await fetch("https://quote-api.jup.ag/v6/swap", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - quoteResponse, - userPublicKey: wallet.publicKey.toString(), - wrapAndUnwrapSol: true, - dynamicComputeUnitLimit: true, - prioritizationFeeLamports: 100000, - }), - }) - ).json(); - if (!swapTransaction) { - console.log("Failed to get buy transaction"); - return null; - } - - // deserialize the transaction - const swapTransactionBuf = Buffer.from(swapTransaction, "base64"); - const transaction = - VersionedTransaction.deserialize(swapTransactionBuf); - - // sign the transaction - transaction.sign([wallet]); - return transaction; - } catch (error) { - console.log("Failed to get buy transaction", error); - return null; - } -}; - -export const fetchSellTransaction = async ( - wallet: Keypair, - baseMint: PublicKey, - amount: string -) => { - try { - const quoteResponse = await ( - await fetch( - `https://quote-api.jup.ag/v6/quote?inputMint=${baseMint.toBase58()}&outputMint=${solAddress}&amount=${amount}&slippageBps=${SLIPPAGE}` - ) - ).json(); - - // get serialized transactions for the swap - const { swapTransaction } = await ( - await fetch("https://quote-api.jup.ag/v6/swap", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - quoteResponse, - userPublicKey: wallet.publicKey.toString(), - wrapAndUnwrapSol: true, - dynamicComputeUnitLimit: true, - prioritizationFeeLamports: 52000, - }), - }) - ).json(); - if (!swapTransaction) { - console.log("Failed to get sell transaction"); - return null; - } - - // deserialize the transaction - const swapTransactionBuf = Buffer.from(swapTransaction, "base64"); - const transaction = - VersionedTransaction.deserialize(swapTransactionBuf); - - // sign the transaction - transaction.sign([wallet]); - return transaction; - } catch (error) { - console.log("Failed to get sell transaction", error); - return null; - } -}; diff --git a/packages/plugin-solana/src/actions/takeOrder.ts b/packages/plugin-solana/src/actions/takeOrder.ts deleted file mode 100644 index f877247d19f..00000000000 --- a/packages/plugin-solana/src/actions/takeOrder.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { - Action, - IAgentRuntime, - Memory, - Content, - ModelClass, -} from "@ai16z/eliza"; -import { composeContext } from "@ai16z/eliza"; -import { generateText } from "@ai16z/eliza"; - -interface Order { - userId: string; - ticker: string; - contractAddress: string; - timestamp: string; - buyAmount: number; - price: number; -} - -const take_order: Action = { - name: "TAKE_ORDER", - similes: ["BUY_ORDER", "PLACE_ORDER"], - description: "Records a buy order based on the user's conviction level.", - examples: [], - validate: async (runtime: IAgentRuntime, message: Memory) => { - const text = (message.content as Content).text; - // Check if the message contains a ticker symbol - const tickerRegex = /\b[A-Z]{1,5}\b/g; - return tickerRegex.test(text); - }, - handler: async (runtime: IAgentRuntime, message: Memory) => { - const _text = (message.content as Content).text; - const userId = message.userId; - - const template = ` - -// CLAUDE TODO: Put the usual conversation context here - -Ticker is: {{ticker}} -Contract address is: {{contractAddress}} - -Determine if the user is trying to shill the ticker. if they are, respond with empty conviction, ticker and contractAddress. - -// CLAUDE TODO: output a JSON block with the following fields: -// - reasoning: string -// - conviction: negative, low, medium, high -// - ticker: string (extract from CA so we have context) -// - contractAddress: string -`; - - let ticker, contractAddress; - - // TODO: - - // 1. create state object with runtime.composeState - // 2. compose context with template and state - // 3. get generateText - // 4. validate generateText - - // if ticker or contractAddress are empty, return a message asking for them - if (!ticker || !contractAddress) { - return { - text: "Ticker and CA?", - }; - } - - const state = await runtime.composeState(message); - // TODO: compose context properly - const context = composeContext({ - state: { - ...state, - ticker, - contractAddress, - }, - template, - }); - - const convictionResponse = await generateText({ - runtime, - context: context, - modelClass: ModelClass.LARGE, - }); - - // TODOL parse and validate the JSON - const convictionResponseJson = JSON.parse(convictionResponse); // TODO: replace with validate like other actions - - // get the conviction - const conviction = convictionResponseJson.conviction; - - let buyAmount = 0; - if (conviction === "low") { - buyAmount = 20; - } else if (conviction === "medium") { - buyAmount = 50; - } else if (conviction === "high") { - buyAmount = 100; - } - - // Get the current price of the asset (replace with actual price fetching logic) - const currentPrice = 100; - - const order: Order = { - userId, - ticker: ticker || "", - contractAddress, - timestamp: new Date().toISOString(), - buyAmount, - price: currentPrice, - }; - - // Read the existing order book from the JSON file - const orderBookPath = - runtime.getSetting("orderBookPath") ?? "solana/orderBook.json"; - - const orderBook: Order[] = []; - - const cachedOrderBook = - await runtime.cacheManager.get(orderBookPath); - - if (cachedOrderBook) { - orderBook.push(...cachedOrderBook); - } - - // Add the new order to the order book - orderBook.push(order); - - // Write the updated order book back to the JSON file - await runtime.cacheManager.set(orderBookPath, orderBook); - - return { - text: `Recorded a ${conviction} conviction buy order for ${ticker} (${contractAddress}) with an amount of ${buyAmount} at the price of ${currentPrice}.`, - }; - }, -}; - -export default take_order; diff --git a/packages/plugin-solana/src/bignumber.ts b/packages/plugin-solana/src/bignumber.ts deleted file mode 100644 index f320676a0fc..00000000000 --- a/packages/plugin-solana/src/bignumber.ts +++ /dev/null @@ -1,9 +0,0 @@ -import BigNumber from "bignumber.js"; - -// Re-export BigNumber constructor -export const BN = BigNumber; - -// Helper function to create new BigNumber instances -export function toBN(value: string | number | BigNumber): BigNumber { - return new BigNumber(value); -} diff --git a/packages/plugin-solana/src/environment.ts b/packages/plugin-solana/src/environment.ts deleted file mode 100644 index 995f5979f0d..00000000000 --- a/packages/plugin-solana/src/environment.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { IAgentRuntime } from "@ai16z/eliza"; -import { z } from "zod"; - -export const solanaEnvSchema = z.object({ - WALLET_SECRET_SALT: z.string().optional(), - }).and( - z.union([ - z.object({ - WALLET_SECRET_KEY: z.string().min(1, "Wallet secret key is required"), - WALLET_PUBLIC_KEY: z.string().min(1, "Wallet public key is required"), - }), - z.object({ - WALLET_SECRET_SALT: z.string().min(1, "Wallet secret salt is required"), - }) - ]) - ).and( - z.object({ - SOL_ADDRESS: z.string().min(1, "SOL address is required"), - SLIPPAGE: z.string().min(1, "Slippage is required"), - RPC_URL: z.string().min(1, "RPC URL is required"), - HELIUS_API_KEY: z.string().min(1, "Helius API key is required"), - BIRDEYE_API_KEY: z.string().min(1, "Birdeye API key is required"), - }) -); - -export type SolanaConfig = z.infer; - -export async function validateSolanaConfig( - runtime: IAgentRuntime -): Promise { - try { - const config = { - WALLET_SECRET_SALT: - runtime.getSetting("WALLET_SECRET_SALT") || - process.env.WALLET_SECRET_SALT, - WALLET_SECRET_KEY: - runtime.getSetting("WALLET_SECRET_KEY") || - process.env.WALLET_SECRET_KEY, - WALLET_PUBLIC_KEY: - runtime.getSetting("SOLANA_PUBLIC_KEY") || - runtime.getSetting("WALLET_PUBLIC_KEY") || - process.env.WALLET_PUBLIC_KEY, - SOL_ADDRESS: - runtime.getSetting("SOL_ADDRESS") || process.env.SOL_ADDRESS, - SLIPPAGE: runtime.getSetting("SLIPPAGE") || process.env.SLIPPAGE, - RPC_URL: runtime.getSetting("RPC_URL") || process.env.RPC_URL, - HELIUS_API_KEY: - runtime.getSetting("HELIUS_API_KEY") || - process.env.HELIUS_API_KEY, - BIRDEYE_API_KEY: - runtime.getSetting("BIRDEYE_API_KEY") || - process.env.BIRDEYE_API_KEY, - }; - - return solanaEnvSchema.parse(config); - } catch (error) { - if (error instanceof z.ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `Solana configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/plugin-solana/src/evaluators/trust.ts b/packages/plugin-solana/src/evaluators/trust.ts deleted file mode 100644 index d98282206be..00000000000 --- a/packages/plugin-solana/src/evaluators/trust.ts +++ /dev/null @@ -1,543 +0,0 @@ -import { - composeContext, - generateObjectArray, - generateTrueOrFalse, - MemoryManager, - booleanFooter, - ActionExample, - Content, - IAgentRuntime, - Memory, - ModelClass, - Evaluator, -} from "@ai16z/eliza"; -import { TrustScoreManager } from "../providers/trustScoreProvider.ts"; -import { TokenProvider } from "../providers/token.ts"; -import { WalletProvider } from "../providers/wallet.ts"; -import { TrustScoreDatabase } from "@ai16z/plugin-trustdb"; -import { Connection } from "@solana/web3.js"; -import { getWalletKey } from "../keypairUtils.ts"; - -const shouldProcessTemplate = - `# Task: Decide if the recent messages should be processed for token recommendations. - - Look for messages that: - - Mention specific token tickers or contract addresses - - Contain words related to buying, selling, or trading tokens - - Express opinions or convictions about tokens - - Based on the following conversation, should the messages be processed for recommendations? YES or NO - - {{recentMessages}} - - Should the messages be processed for recommendations? ` + booleanFooter; - -export const formatRecommendations = (recommendations: Memory[]) => { - const messageStrings = recommendations - .reverse() - .map((rec: Memory) => `${(rec.content as Content)?.content}`); - const finalMessageStrings = messageStrings.join("\n"); - return finalMessageStrings; -}; - -const recommendationTemplate = `TASK: Extract recommendations to buy or sell memecoins from the conversation as an array of objects in JSON format. - - Memecoins usually have a ticker and a contract address. Additionally, recommenders may make recommendations with some amount of conviction. The amount of conviction in their recommendation can be none, low, medium, or high. Recommenders can make recommendations to buy, not buy, sell and not sell. - -# START OF EXAMPLES -These are an examples of the expected output of this task: -{{evaluationExamples}} -# END OF EXAMPLES - -# INSTRUCTIONS - -Extract any new recommendations from the conversation that are not already present in the list of known recommendations below: -{{recentRecommendations}} - -- Include the recommender's username -- Try not to include already-known recommendations. If you think a recommendation is already known, but you're not sure, respond with alreadyKnown: true. -- Set the conviction to 'none', 'low', 'medium' or 'high' -- Set the recommendation type to 'buy', 'dont_buy', 'sell', or 'dont_sell' -- Include the contract address and/or ticker if available - -Recent Messages: -{{recentMessages}} - -Response should be a JSON object array inside a JSON markdown block. Correct response format: -\`\`\`json -[ - { - "recommender": string, - "ticker": string | null, - "contractAddress": string | null, - "type": enum, - "conviction": enum, - "alreadyKnown": boolean - }, - ... -] -\`\`\``; - -async function handler(runtime: IAgentRuntime, message: Memory) { - console.log("Evaluating for trust"); - const state = await runtime.composeState(message); - - const { agentId, roomId } = state; - - // Check if we should process the messages - const shouldProcessContext = composeContext({ - state, - template: shouldProcessTemplate, - }); - - const shouldProcess = await generateTrueOrFalse({ - context: shouldProcessContext, - modelClass: ModelClass.SMALL, - runtime, - }); - - if (!shouldProcess) { - console.log("Skipping process"); - return []; - } - - console.log("Processing recommendations"); - - // Get recent recommendations - const recommendationsManager = new MemoryManager({ - runtime, - tableName: "recommendations", - }); - - const recentRecommendations = await recommendationsManager.getMemories({ - roomId, - count: 20, - }); - - const context = composeContext({ - state: { - ...state, - recentRecommendations: formatRecommendations(recentRecommendations), - }, - template: recommendationTemplate, - }); - - const recommendations = await generateObjectArray({ - runtime, - context, - modelClass: ModelClass.LARGE, - }); - - console.log("recommendations", recommendations); - - if (!recommendations) { - return []; - } - - // If the recommendation is already known or corrupted, remove it - const filteredRecommendations = recommendations.filter((rec) => { - return ( - !rec.alreadyKnown && - (rec.ticker || rec.contractAddress) && - rec.recommender && - rec.conviction && - rec.recommender.trim() !== "" - ); - }); - - const { publicKey } = await getWalletKey(runtime, false); - - for (const rec of filteredRecommendations) { - // create the wallet provider and token provider - const walletProvider = new WalletProvider( - new Connection( - runtime.getSetting("RPC_URL") || - "https://api.mainnet-beta.solana.com" - ), - publicKey - ); - const tokenProvider = new TokenProvider( - rec.contractAddress, - walletProvider, - runtime.cacheManager - ); - - // TODO: Check to make sure the contract address is valid, it's the right one, etc - - // - if (!rec.contractAddress) { - const tokenAddress = await tokenProvider.getTokenFromWallet( - runtime, - rec.ticker - ); - rec.contractAddress = tokenAddress; - if (!tokenAddress) { - // try to search for the symbol and return the contract address with they highest liquidity and market cap - const result = await tokenProvider.searchDexScreenerData( - rec.ticker - ); - const tokenAddress = result?.baseToken?.address; - rec.contractAddress = tokenAddress; - if (!tokenAddress) { - console.warn("Could not find contract address for token"); - continue; - } - } - } - - // create the trust score manager - - const trustScoreDb = new TrustScoreDatabase(runtime.databaseAdapter.db); - const trustScoreManager = new TrustScoreManager( - runtime, - tokenProvider, - trustScoreDb - ); - - // get actors from the database - const participants = - await runtime.databaseAdapter.getParticipantsForRoom( - message.roomId - ); - - // find the first user Id from a user with the username that we extracted - const user = participants.find(async (actor) => { - const user = await runtime.databaseAdapter.getAccountById(actor); - return ( - user.name.toLowerCase().trim() === - rec.recommender.toLowerCase().trim() - ); - }); - - if (!user) { - console.warn("Could not find user: ", rec.recommender); - continue; - } - - const account = await runtime.databaseAdapter.getAccountById(user); - const userId = account.id; - - const recMemory = { - userId, - agentId, - content: { text: JSON.stringify(rec) }, - roomId, - createdAt: Date.now(), - }; - - await recommendationsManager.createMemory(recMemory, true); - - console.log("recommendationsManager", rec); - - // - from here we just need to make sure code is right - - // buy, dont buy, sell, dont sell - - const buyAmounts = await tokenProvider.calculateBuyAmounts(); - - let buyAmount = buyAmounts[rec.conviction.toLowerCase().trim()]; - if (!buyAmount) { - // handle annoying cases - // for now just put in 10 sol - buyAmount = 10; - } - - // TODO: is this is a buy, sell, dont buy, or dont sell? - const shouldTrade = await tokenProvider.shouldTradeToken(); - - if (!shouldTrade) { - console.warn( - "There might be a problem with the token, not trading" - ); - continue; - } - - switch (rec.type) { - case "buy": - // for now, lets just assume buy only, but we should implement - await trustScoreManager.createTradePerformance( - runtime, - rec.contractAddress, - userId, - { - buy_amount: rec.buyAmount, - is_simulation: true, - } - ); - break; - case "sell": - case "dont_sell": - case "dont_buy": - console.warn("Not implemented"); - break; - } - } - - return filteredRecommendations; -} - -export const trustEvaluator: Evaluator = { - name: "EXTRACT_RECOMMENDATIONS", - similes: [ - "GET_RECOMMENDATIONS", - "EXTRACT_TOKEN_RECS", - "EXTRACT_MEMECOIN_RECS", - ], - alwaysRun: true, - validate: async ( - runtime: IAgentRuntime, - message: Memory - ): Promise => { - if (message.content.text.length < 5) { - return false; - } - - return message.userId !== message.agentId; - }, - description: - "Extract recommendations to buy or sell memecoins/tokens from the conversation, including details like ticker, contract address, conviction level, and recommender username.", - handler, - examples: [ - { - context: `Actors in the scene: -{{user1}}: Experienced DeFi degen. Constantly chasing high yield farms. -{{user2}}: New to DeFi, learning the ropes. - -Recommendations about the actors: -None`, - messages: [ - { - user: "{{user1}}", - content: { - text: "Yo, have you checked out $SOLARUG? Dope new yield aggregator on Solana.", - }, - }, - { - user: "{{user2}}", - content: { - text: "Nah, I'm still trying to wrap my head around how yield farming even works haha. Is it risky?", - }, - }, - { - user: "{{user1}}", - content: { - text: "I mean, there's always risk in DeFi, but the $SOLARUG devs seem legit. Threw a few sol into the FCweoTfJ128jGgNEXgdfTXdEZVk58Bz9trCemr6sXNx9 vault, farming's been smooth so far.", - }, - }, - ] as ActionExample[], - outcome: `\`\`\`json -[ - { - "recommender": "{{user1}}", - "ticker": "SOLARUG", - "contractAddress": "FCweoTfJ128jGgNEXgdfTXdEZVk58Bz9trCemr6sXNx9", - "type": "buy", - "conviction": "medium", - "alreadyKnown": false - } -] -\`\`\``, - }, - - { - context: `Actors in the scene: -{{user1}}: Solana maximalist. Believes Solana will flip Ethereum. -{{user2}}: Multichain proponent. Holds both SOL and ETH. - -Recommendations about the actors: -{{user1}} has previously promoted $COPETOKEN and $SOYLENT.`, - messages: [ - { - user: "{{user1}}", - content: { - text: "If you're not long $SOLVAULT at 7tRzKud6FBVFEhYqZS3CuQ2orLRM21bdisGykL5Sr4Dx, you're missing out. This will be the blackhole of Solana liquidity.", - }, - }, - { - user: "{{user2}}", - content: { - text: "Idk man, feels like there's a new 'vault' or 'reserve' token every week on Sol. What happened to $COPETOKEN and $SOYLENT that you were shilling before?", - }, - }, - { - user: "{{user1}}", - content: { - text: "$COPETOKEN and $SOYLENT had their time, I took profits near the top. But $SOLVAULT is different, it has actual utility. Do what you want, but don't say I didn't warn you when this 50x's and you're left holding your $ETH bags.", - }, - }, - ] as ActionExample[], - outcome: `\`\`\`json -[ - { - "recommender": "{{user1}}", - "ticker": "COPETOKEN", - "contractAddress": null, - "type": "sell", - "conviction": "low", - "alreadyKnown": true - }, - { - "recommender": "{{user1}}", - "ticker": "SOYLENT", - "contractAddress": null, - "type": "sell", - "conviction": "low", - "alreadyKnown": true - }, - { - "recommender": "{{user1}}", - "ticker": "SOLVAULT", - "contractAddress": "7tRzKud6FBVFEhYqZS3CuQ2orLRM21bdisGykL5Sr4Dx", - "type": "buy", - "conviction": "high", - "alreadyKnown": false - } -] -\`\`\``, - }, - - { - context: `Actors in the scene: -{{user1}}: Self-proclaimed Solana alpha caller. Allegedly has insider info. -{{user2}}: Degen gambler. Will ape into any hyped token. - -Recommendations about the actors: -None`, - messages: [ - { - user: "{{user1}}", - content: { - text: "I normally don't do this, but I like you anon, so I'll let you in on some alpha. $ROULETTE at 48vV5y4DRH1Adr1bpvSgFWYCjLLPtHYBqUSwNc2cmCK2 is going to absolutely send it soon. You didn't hear it from me 🤐", - }, - }, - { - user: "{{user2}}", - content: { - text: "Oh shit, insider info from the alpha god himself? Say no more, I'm aping in hard.", - }, - }, - ] as ActionExample[], - outcome: `\`\`\`json -[ - { - "recommender": "{{user1}}", - "ticker": "ROULETTE", - "contractAddress": "48vV5y4DRH1Adr1bpvSgFWYCjLLPtHYBqUSwNc2cmCK2", - "type": "buy", - "conviction": "high", - "alreadyKnown": false - } -] -\`\`\``, - }, - - { - context: `Actors in the scene: -{{user1}}: NFT collector and trader. Bullish on Solana NFTs. -{{user2}}: Only invests based on fundamentals. Sees all NFTs as worthless JPEGs. - -Recommendations about the actors: -None -`, - messages: [ - { - user: "{{user1}}", - content: { - text: "GM. I'm heavily accumulating $PIXELAPE, the token for the Pixel Ape Yacht Club NFT collection. 10x is inevitable.", - }, - }, - { - user: "{{user2}}", - content: { - text: "NFTs are a scam bro. There's no underlying value. You're essentially trading worthless JPEGs.", - }, - }, - { - user: "{{user1}}", - content: { - text: "Fun staying poor 🤡 $PIXELAPE is about to moon and you'll be left behind.", - }, - }, - { - user: "{{user2}}", - content: { - text: "Whatever man, I'm not touching that shit with a ten foot pole. Have fun holding your bags.", - }, - }, - { - user: "{{user1}}", - content: { - text: "Don't need luck where I'm going 😎 Once $PIXELAPE at 3hAKKmR6XyBooQBPezCbUMhrmcyTkt38sRJm2thKytWc takes off, you'll change your tune.", - }, - }, - ], - outcome: `\`\`\`json -[ - { - "recommender": "{{user1}}", - "ticker": "PIXELAPE", - "contractAddress": "3hAKKmR6XyBooQBPezCbUMhrmcyTkt38sRJm2thKytWc", - "type": "buy", - "conviction": "high", - "alreadyKnown": false - } -] -\`\`\``, - }, - - { - context: `Actors in the scene: -{{user1}}: Contrarian investor. Bets against hyped projects. -{{user2}}: Trend follower. Buys tokens that are currently popular. - -Recommendations about the actors: -None`, - messages: [ - { - user: "{{user2}}", - content: { - text: "$SAMOYED is the talk of CT right now. Making serious moves. Might have to get a bag.", - }, - }, - { - user: "{{user1}}", - content: { - text: "Whenever a token is the 'talk of CT', that's my cue to short it. $SAMOYED is going to dump hard, mark my words.", - }, - }, - { - user: "{{user2}}", - content: { - text: "Idk man, the hype seems real this time. 5TQwHyZbedaH4Pcthj1Hxf5GqcigL6qWuB7YEsBtqvhr chart looks bullish af.", - }, - }, - { - user: "{{user1}}", - content: { - text: "Hype is always real until it isn't. I'm taking out a fat short position here. Don't say I didn't warn you when this crashes 90% and you're left holding the flaming bags.", - }, - }, - ], - outcome: `\`\`\`json -[ - { - "recommender": "{{user2}}", - "ticker": "SAMOYED", - "contractAddress": "5TQwHyZbedaH4Pcthj1Hxf5GqcigL6qWuB7YEsBtqvhr", - "type": "buy", - "conviction": "medium", - "alreadyKnown": false - }, - { - "recommender": "{{user1}}", - "ticker": "SAMOYED", - "contractAddress": "5TQwHyZbedaH4Pcthj1Hxf5GqcigL6qWuB7YEsBtqvhr", - "type": "dont_buy", - "conviction": "high", - "alreadyKnown": false - } -] -\`\`\``, - }, - ], -}; diff --git a/packages/plugin-solana/src/index.ts b/packages/plugin-solana/src/index.ts deleted file mode 100644 index 580b6516341..00000000000 --- a/packages/plugin-solana/src/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -export * from "./providers/token.ts"; -export * from "./providers/wallet.ts"; -export * from "./providers/trustScoreProvider.ts"; -export * from "./evaluators/trust.ts"; - -import { Plugin } from "@ai16z/eliza"; -import { executeSwap } from "./actions/swap.ts"; -import take_order from "./actions/takeOrder"; -import pumpfun from "./actions/pumpfun.ts"; -import { executeSwapForDAO } from "./actions/swapDao"; -import transferToken from "./actions/transfer.ts"; -import { walletProvider } from "./providers/wallet.ts"; -import { trustScoreProvider } from "./providers/trustScoreProvider.ts"; -import { trustEvaluator } from "./evaluators/trust.ts"; -import { TokenProvider } from "./providers/token.ts"; -import { WalletProvider } from "./providers/wallet.ts"; - -export { TokenProvider, WalletProvider }; - -export const solanaPlugin: Plugin = { - name: "solana", - description: "Solana Plugin for Eliza", - actions: [ - executeSwap, - pumpfun, - transferToken, - executeSwapForDAO, - take_order, - ], - evaluators: [trustEvaluator], - providers: [walletProvider, trustScoreProvider], -}; - -export default solanaPlugin; diff --git a/packages/plugin-solana/src/keypairUtils.ts b/packages/plugin-solana/src/keypairUtils.ts deleted file mode 100644 index 53885ec05a0..00000000000 --- a/packages/plugin-solana/src/keypairUtils.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Keypair, PublicKey } from "@solana/web3.js"; -import { DeriveKeyProvider, TEEMode } from "@ai16z/plugin-tee"; -import bs58 from "bs58"; -import { IAgentRuntime } from "@ai16z/eliza"; - -export interface KeypairResult { - keypair?: Keypair; - publicKey?: PublicKey; -} - -/** - * Gets either a keypair or public key based on TEE mode and runtime settings - * @param runtime The agent runtime - * @param requirePrivateKey Whether to return a full keypair (true) or just public key (false) - * @returns KeypairResult containing either keypair or public key - */ -export async function getWalletKey( - runtime: IAgentRuntime, - requirePrivateKey: boolean = true -): Promise { - const teeMode = runtime.getSetting("TEE_MODE") || TEEMode.OFF; - - if (teeMode !== TEEMode.OFF) { - const walletSecretSalt = runtime.getSetting("WALLET_SECRET_SALT"); - if (!walletSecretSalt) { - throw new Error("WALLET_SECRET_SALT required when TEE_MODE is enabled"); - } - - const deriveKeyProvider = new DeriveKeyProvider(teeMode); - const deriveKeyResult = await deriveKeyProvider.deriveEd25519Keypair( - "/", - walletSecretSalt, - runtime.agentId - ); - - return requirePrivateKey - ? { keypair: deriveKeyResult.keypair } - : { publicKey: deriveKeyResult.keypair.publicKey }; - } - - // TEE mode is OFF - if (requirePrivateKey) { - const privateKeyString = - runtime.getSetting("SOLANA_PRIVATE_KEY") ?? - runtime.getSetting("WALLET_PRIVATE_KEY"); - - if (!privateKeyString) { - throw new Error("Private key not found in settings"); - } - - try { - // First try base58 - const secretKey = bs58.decode(privateKeyString); - return { keypair: Keypair.fromSecretKey(secretKey) }; - } catch (e) { - console.log("Error decoding base58 private key:", e); - try { - // Then try base64 - console.log("Try decoding base64 instead"); - const secretKey = Uint8Array.from( - Buffer.from(privateKeyString, "base64") - ); - return { keypair: Keypair.fromSecretKey(secretKey) }; - } catch (e2) { - console.error("Error decoding private key: ", e2); - throw new Error("Invalid private key format"); - } - } - } else { - const publicKeyString = - runtime.getSetting("SOLANA_PUBLIC_KEY") ?? - runtime.getSetting("WALLET_PUBLIC_KEY"); - - if (!publicKeyString) { - throw new Error("Public key not found in settings"); - } - - return { publicKey: new PublicKey(publicKeyString) }; - } -} \ No newline at end of file diff --git a/packages/plugin-solana/src/providers/orderBook.ts b/packages/plugin-solana/src/providers/orderBook.ts deleted file mode 100644 index ce720e99c86..00000000000 --- a/packages/plugin-solana/src/providers/orderBook.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -interface Order { - userId: string; - ticker: string; - contractAddress: string; - timestamp: string; - buyAmount: number; - price: number; -} - -const orderBookProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory, _state?: State) => { - const userId = message.userId; - - // Read the order book from the JSON file - const orderBookPath = - runtime.getSetting("orderBookPath") ?? "solana/orderBook"; - - const orderBook: Order[] = []; - - const cachedOrderBook = - await runtime.cacheManager.get(orderBookPath); - - if (cachedOrderBook) { - orderBook.push(...cachedOrderBook); - } - - // Filter the orders for the current user - const userOrders = orderBook.filter((order) => order.userId === userId); - - let totalProfit = 0; - for (const order of userOrders) { - // Get the current price of the asset (replace with actual price fetching logic) - const currentPrice = 120; - - const priceDifference = currentPrice - order.price; - const orderProfit = priceDifference * order.buyAmount; - totalProfit += orderProfit; - } - - return `The user has made a total profit of $${totalProfit.toFixed(2)} for the agent based on their recorded buy orders.`; - }, -}; - -export { orderBookProvider }; diff --git a/packages/plugin-solana/src/providers/simulationSellingService.ts b/packages/plugin-solana/src/providers/simulationSellingService.ts deleted file mode 100644 index 39d5e5b08d7..00000000000 --- a/packages/plugin-solana/src/providers/simulationSellingService.ts +++ /dev/null @@ -1,501 +0,0 @@ -import { - TrustScoreDatabase, - TokenPerformance, - // TradePerformance, - TokenRecommendation, -} from "@ai16z/plugin-trustdb"; -import { Connection, PublicKey } from "@solana/web3.js"; -// Assuming TokenProvider and IAgentRuntime are available -import { TokenProvider } from "./token.ts"; -// import { settings } from "@ai16z/eliza"; -import { IAgentRuntime } from "@ai16z/eliza"; -import { WalletProvider } from "./wallet.ts"; -import * as amqp from "amqplib"; -import { ProcessedTokenData } from "../types/token.ts"; -import { getWalletKey } from "../keypairUtils.ts"; - -interface SellDetails { - sell_amount: number; - sell_recommender_id: string | null; -} - -export class SimulationSellingService { - private trustScoreDb: TrustScoreDatabase; - private walletProvider: WalletProvider; - private connection: Connection; - private baseMint: PublicKey; - private DECAY_RATE = 0.95; - private MAX_DECAY_DAYS = 30; - private backend: string; - private backendToken: string; - private amqpConnection: amqp.Connection; - private amqpChannel: amqp.Channel; - private sonarBe: string; - private sonarBeToken: string; - private runtime: IAgentRuntime; - - private runningProcesses: Set = new Set(); - - constructor(runtime: IAgentRuntime, trustScoreDb: TrustScoreDatabase) { - this.trustScoreDb = trustScoreDb; - - this.connection = new Connection(runtime.getSetting("RPC_URL")); - this.initializeWalletProvider(); - this.baseMint = new PublicKey( - runtime.getSetting("BASE_MINT") || - "So11111111111111111111111111111111111111112" - ); - this.backend = runtime.getSetting("BACKEND_URL"); - this.backendToken = runtime.getSetting("BACKEND_TOKEN"); - this.initializeRabbitMQ(runtime.getSetting("AMQP_URL")); - this.sonarBe = runtime.getSetting("SONAR_BE"); - this.sonarBeToken = runtime.getSetting("SONAR_BE_TOKEN"); - this.runtime = runtime; - } - /** - * Initializes the RabbitMQ connection and starts consuming messages. - * @param amqpUrl The RabbitMQ server URL. - */ - private async initializeRabbitMQ(amqpUrl: string) { - try { - this.amqpConnection = await amqp.connect(amqpUrl); - this.amqpChannel = await this.amqpConnection.createChannel(); - console.log("Connected to RabbitMQ"); - // Start consuming messages - this.consumeMessages(); - } catch (error) { - console.error("Failed to connect to RabbitMQ:", error); - } - } - - /** - * Sets up the consumer for the specified RabbitMQ queue. - */ - private async consumeMessages() { - const queue = "process_eliza_simulation"; - await this.amqpChannel.assertQueue(queue, { durable: true }); - this.amqpChannel.consume( - queue, - (msg) => { - if (msg !== null) { - const content = msg.content.toString(); - this.processMessage(content); - this.amqpChannel.ack(msg); - } - }, - { noAck: false } - ); - console.log(`Listening for messages on queue: ${queue}`); - } - - /** - * Processes incoming messages from RabbitMQ. - * @param message The message content as a string. - */ - private async processMessage(message: string) { - try { - const { tokenAddress, amount, sell_recommender_id } = - JSON.parse(message); - console.log( - `Received message for token ${tokenAddress} to sell ${amount}` - ); - - const decision: SellDecision = { - tokenPerformance: - await this.trustScoreDb.getTokenPerformance(tokenAddress), - amountToSell: amount, - sell_recommender_id: sell_recommender_id, - }; - - // Execute the sell - await this.executeSellDecision(decision); - - // Remove from running processes after completion - this.runningProcesses.delete(tokenAddress); - } catch (error) { - console.error("Error processing message:", error); - } - } - - /** - * Executes a single sell decision. - * @param decision The sell decision containing token performance and amount to sell. - */ - private async executeSellDecision(decision: SellDecision) { - const { tokenPerformance, amountToSell, sell_recommender_id } = - decision; - const tokenAddress = tokenPerformance.tokenAddress; - - try { - console.log( - `Executing sell for token ${tokenPerformance.symbol}: ${amountToSell}` - ); - - // Update the sell details - const sellDetails: SellDetails = { - sell_amount: amountToSell, - sell_recommender_id: sell_recommender_id, // Adjust if necessary - }; - const sellTimeStamp = new Date().toISOString(); - const tokenProvider = new TokenProvider( - tokenAddress, - this.walletProvider, - this.runtime.cacheManager - ); - - // Update sell details in the database - const sellDetailsData = await this.updateSellDetails( - tokenAddress, - sell_recommender_id, - sellTimeStamp, - sellDetails, - true, // isSimulation - tokenProvider - ); - - console.log("Sell order executed successfully", sellDetailsData); - - // check if balance is zero and remove token from running processes - const balance = this.trustScoreDb.getTokenBalance(tokenAddress); - if (balance === 0) { - this.runningProcesses.delete(tokenAddress); - } - // stop the process in the sonar backend - await this.stopProcessInTheSonarBackend(tokenAddress); - } catch (error) { - console.error( - `Error executing sell for token ${tokenAddress}:`, - error - ); - } - } - - /** - * Derives the public key based on the TEE (Trusted Execution Environment) mode and initializes the wallet provider. - * If TEE mode is enabled, derives a keypair using the DeriveKeyProvider with the wallet secret salt and agent ID. - * If TEE mode is disabled, uses the provided Solana public key or wallet public key from settings. - */ - private async initializeWalletProvider(): Promise { - const { publicKey } = await getWalletKey(this.runtime, false); - - this.walletProvider = new WalletProvider(this.connection, publicKey); - } - - public async startService() { - // starting the service - console.log("Starting SellingService..."); - await this.startListeners(); - } - - public async startListeners() { - // scanning recommendations and selling - console.log("Scanning for token performances..."); - const tokenPerformances = - await this.trustScoreDb.getAllTokenPerformancesWithBalance(); - - await this.processTokenPerformances(tokenPerformances); - } - - private processTokenPerformances(tokenPerformances: TokenPerformance[]) { - // To Do: logic when to sell and how much - console.log("Deciding when to sell and how much..."); - const runningProcesses = this.runningProcesses; - // remove running processes from tokenPerformances - tokenPerformances = tokenPerformances.filter( - (tp) => !runningProcesses.has(tp.tokenAddress) - ); - - // start the process in the sonar backend - tokenPerformances.forEach(async (tokenPerformance) => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const tokenProvider = new TokenProvider( - tokenPerformance.tokenAddress, - this.walletProvider, - this.runtime.cacheManager - ); - // const shouldTrade = await tokenProvider.shouldTradeToken(); - // if (shouldTrade) { - const tokenRecommendations: TokenRecommendation[] = - this.trustScoreDb.getRecommendationsByToken( - tokenPerformance.tokenAddress - ); - const tokenRecommendation: TokenRecommendation = - tokenRecommendations[0]; - const balance = tokenPerformance.balance; - const sell_recommender_id = tokenRecommendation.recommenderId; - const tokenAddress = tokenPerformance.tokenAddress; - const process = await this.startProcessInTheSonarBackend( - tokenAddress, - balance, - true, - sell_recommender_id, - tokenPerformance.initialMarketCap - ); - if (process) { - this.runningProcesses.add(tokenAddress); - } - // } - }); - } - - public processTokenPerformance( - tokenAddress: string, - recommenderId: string - ) { - try { - const runningProcesses = this.runningProcesses; - // check if token is already being processed - if (runningProcesses.has(tokenAddress)) { - console.log(`Token ${tokenAddress} is already being processed`); - return; - } - const tokenPerformance = - this.trustScoreDb.getTokenPerformance(tokenAddress); - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const tokenProvider = new TokenProvider( - tokenPerformance.tokenAddress, - this.walletProvider, - this.runtime.cacheManager - ); - const balance = tokenPerformance.balance; - const sell_recommender_id = recommenderId; - const process = this.startProcessInTheSonarBackend( - tokenAddress, - balance, - true, - sell_recommender_id, - tokenPerformance.initialMarketCap - ); - if (process) { - this.runningProcesses.add(tokenAddress); - } - } catch (error) { - console.error( - `Error getting token performance for token ${tokenAddress}:`, - error - ); - } - } - - private async startProcessInTheSonarBackend( - tokenAddress: string, - balance: number, - isSimulation: boolean, - sell_recommender_id: string, - initial_mc: number - ) { - try { - const message = JSON.stringify({ - tokenAddress, - balance, - isSimulation, - initial_mc, - sell_recommender_id, - }); - const response = await fetch( - `${this.sonarBe}/ai16z-sol/startProcess`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - "x-api-key": `${this.sonarBeToken}`, - }, - body: message, - } - ); - - if (!response.ok) { - console.error( - `Failed to send message to process token ${tokenAddress}` - ); - return; - } - - const result = await response.json(); - console.log("Received response:", result); - console.log(`Sent message to process token ${tokenAddress}`); - - return result; - } catch (error) { - console.error( - `Error sending message to process token ${tokenAddress}:`, - error - ); - return null; - } - } - - private stopProcessInTheSonarBackend(tokenAddress: string) { - try { - return fetch(`${this.sonarBe}/ai16z-sol/stopProcess`, { - method: "POST", - headers: { - "Content-Type": "application/json", - "x-api-key": `${this.sonarBeToken}`, - }, - body: JSON.stringify({ tokenAddress }), - }); - } catch (error) { - console.error( - `Error stopping process for token ${tokenAddress}:`, - error - ); - } - } - - async updateSellDetails( - tokenAddress: string, - recommenderId: string, - sellTimeStamp: string, - sellDetails: SellDetails, - isSimulation: boolean, - tokenProvider: TokenProvider - ) { - const recommender = - await this.trustScoreDb.getOrCreateRecommenderWithTelegramId( - recommenderId - ); - const processedData: ProcessedTokenData = - await tokenProvider.getProcessedTokenData(); - const prices = await this.walletProvider.fetchPrices(null); - const solPrice = prices.solana.usd; - const sellSol = sellDetails.sell_amount / parseFloat(solPrice); - const sell_value_usd = - sellDetails.sell_amount * processedData.tradeData.price; - const trade = await this.trustScoreDb.getLatestTradePerformance( - tokenAddress, - recommender.id, - isSimulation - ); - const buyTimeStamp = trade.buy_timeStamp; - const marketCap = - processedData.dexScreenerData.pairs[0]?.marketCap || 0; - const liquidity = - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0; - const sell_price = processedData.tradeData.price; - const profit_usd = sell_value_usd - trade.buy_value_usd; - const profit_percent = (profit_usd / trade.buy_value_usd) * 100; - - const market_cap_change = marketCap - trade.buy_market_cap; - const liquidity_change = liquidity - trade.buy_liquidity; - - const isRapidDump = await this.isRapidDump(tokenAddress, tokenProvider); - - const sellDetailsData = { - sell_price: sell_price, - sell_timeStamp: sellTimeStamp, - sell_amount: sellDetails.sell_amount, - received_sol: sellSol, - sell_value_usd: sell_value_usd, - profit_usd: profit_usd, - profit_percent: profit_percent, - sell_market_cap: marketCap, - market_cap_change: market_cap_change, - sell_liquidity: liquidity, - liquidity_change: liquidity_change, - rapidDump: isRapidDump, - sell_recommender_id: sellDetails.sell_recommender_id || null, - }; - this.trustScoreDb.updateTradePerformanceOnSell( - tokenAddress, - recommender.id, - buyTimeStamp, - sellDetailsData, - isSimulation - ); - - // If the trade is a simulation update the balance - const oldBalance = this.trustScoreDb.getTokenBalance(tokenAddress); - const tokenBalance = oldBalance - sellDetails.sell_amount; - this.trustScoreDb.updateTokenBalance(tokenAddress, tokenBalance); - // generate some random hash for simulations - const hash = Math.random().toString(36).substring(7); - const transaction = { - tokenAddress: tokenAddress, - type: "sell" as "buy" | "sell", - transactionHash: hash, - amount: sellDetails.sell_amount, - price: processedData.tradeData.price, - isSimulation: true, - timestamp: new Date().toISOString(), - }; - this.trustScoreDb.addTransaction(transaction); - this.updateTradeInBe( - tokenAddress, - recommender.id, - recommender.telegramId, - sellDetailsData, - tokenBalance - ); - - return sellDetailsData; - } - async isRapidDump( - tokenAddress: string, - tokenProvider: TokenProvider - ): Promise { - const processedData: ProcessedTokenData = - await tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - return processedData.tradeData.trade_24h_change_percent < -50; - } - - async delay(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - async updateTradeInBe( - tokenAddress: string, - recommenderId: string, - username: string, - data: SellDetails, - balanceLeft: number, - retries = 3, - delayMs = 2000 - ) { - for (let attempt = 1; attempt <= retries; attempt++) { - try { - await fetch( - `${this.backend}/api/updaters/updateTradePerformance`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${this.backendToken}`, - }, - body: JSON.stringify({ - tokenAddress: tokenAddress, - tradeData: data, - recommenderId: recommenderId, - username: username, - isSimulation: true, - balanceLeft: balanceLeft, - }), - } - ); - // If the request is successful, exit the loop - return; - } catch (error) { - console.error( - `Attempt ${attempt} failed: Error creating trade in backend`, - error - ); - if (attempt < retries) { - console.log(`Retrying in ${delayMs} ms...`); - await this.delay(delayMs); // Wait for the specified delay before retrying - } else { - console.error("All attempts failed."); - } - } - } - } -} - -// SellDecision interface -interface SellDecision { - tokenPerformance: TokenPerformance; - amountToSell: number; - sell_recommender_id: string | null; -} diff --git a/packages/plugin-solana/src/providers/token.ts b/packages/plugin-solana/src/providers/token.ts deleted file mode 100644 index a854cf392d9..00000000000 --- a/packages/plugin-solana/src/providers/token.ts +++ /dev/null @@ -1,1127 +0,0 @@ -import { ICacheManager, settings } from "@ai16z/eliza"; -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { - DexScreenerData, - DexScreenerPair, - HolderData, - ProcessedTokenData, - TokenSecurityData, - TokenTradeData, - CalculatedBuyAmounts, - Prices, - TokenCodex, -} from "../types/token.ts"; -import NodeCache from "node-cache"; -import * as path from "path"; -import { toBN } from "../bignumber.ts"; -import { WalletProvider, Item } from "./wallet.ts"; -import { Connection } from "@solana/web3.js"; -import { getWalletKey } from "../keypairUtils.ts"; - -const PROVIDER_CONFIG = { - BIRDEYE_API: "https://public-api.birdeye.so", - MAX_RETRIES: 3, - RETRY_DELAY: 2000, - DEFAULT_RPC: "https://api.mainnet-beta.solana.com", - TOKEN_ADDRESSES: { - SOL: "So11111111111111111111111111111111111111112", - BTC: "qfnqNqs3nCAHjnyCgLRDbBtq4p2MtHZxw8YjSyYhPoL", - ETH: "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", - Example: "2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh", - }, - TOKEN_SECURITY_ENDPOINT: "/defi/token_security?address=", - TOKEN_TRADE_DATA_ENDPOINT: "/defi/v3/token/trade-data/single?address=", - DEX_SCREENER_API: "https://api.dexscreener.com/latest/dex/tokens/", - MAIN_WALLET: "", -}; - -export class TokenProvider { - private cache: NodeCache; - private cacheKey: string = "solana/tokens"; - private NETWORK_ID = 1399811149; - private GRAPHQL_ENDPOINT = "https://graph.codex.io/graphql"; - - constructor( - // private connection: Connection, - private tokenAddress: string, - private walletProvider: WalletProvider, - private cacheManager: ICacheManager - ) { - this.cache = new NodeCache({ stdTTL: 300 }); // 5 minutes cache - } - - private async readFromCache(key: string): Promise { - const cached = await this.cacheManager.get( - path.join(this.cacheKey, key) - ); - return cached; - } - - private async writeToCache(key: string, data: T): Promise { - await this.cacheManager.set(path.join(this.cacheKey, key), data, { - expires: Date.now() + 5 * 60 * 1000, - }); - } - - private async getCachedData(key: string): Promise { - // Check in-memory cache first - const cachedData = this.cache.get(key); - if (cachedData) { - return cachedData; - } - - // Check file-based cache - const fileCachedData = await this.readFromCache(key); - if (fileCachedData) { - // Populate in-memory cache - this.cache.set(key, fileCachedData); - return fileCachedData; - } - - return null; - } - - private async setCachedData(cacheKey: string, data: T): Promise { - // Set in-memory cache - this.cache.set(cacheKey, data); - - // Write to file-based cache - await this.writeToCache(cacheKey, data); - } - - private async fetchWithRetry( - url: string, - options: RequestInit = {} - ): Promise { - let lastError: Error; - - for (let i = 0; i < PROVIDER_CONFIG.MAX_RETRIES; i++) { - try { - const response = await fetch(url, { - ...options, - headers: { - Accept: "application/json", - "x-chain": "solana", - "X-API-KEY": settings.BIRDEYE_API_KEY || "", - ...options.headers, - }, - }); - - if (!response.ok) { - const errorText = await response.text(); - throw new Error( - `HTTP error! status: ${response.status}, message: ${errorText}` - ); - } - - const data = await response.json(); - return data; - } catch (error) { - console.error(`Attempt ${i + 1} failed:`, error); - lastError = error as Error; - if (i < PROVIDER_CONFIG.MAX_RETRIES - 1) { - const delay = PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i); - console.log(`Waiting ${delay}ms before retrying...`); - await new Promise((resolve) => setTimeout(resolve, delay)); - continue; - } - } - } - - console.error( - "All attempts failed. Throwing the last error:", - lastError - ); - throw lastError; - } - - async getTokensInWallet(runtime: IAgentRuntime): Promise { - const walletInfo = - await this.walletProvider.fetchPortfolioValue(runtime); - const items = walletInfo.items; - return items; - } - - // check if the token symbol is in the wallet - async getTokenFromWallet(runtime: IAgentRuntime, tokenSymbol: string) { - try { - const items = await this.getTokensInWallet(runtime); - const token = items.find((item) => item.symbol === tokenSymbol); - - if (token) { - return token.address; - } else { - return null; - } - } catch (error) { - console.error("Error checking token in wallet:", error); - return null; - } - } - - async fetchTokenCodex(): Promise { - try { - const cacheKey = `token_${this.tokenAddress}`; - const cachedData = this.getCachedData(cacheKey); - if (cachedData) { - console.log( - `Returning cached token data for ${this.tokenAddress}.` - ); - return cachedData; - } - const query = ` - query Token($address: String!, $networkId: Int!) { - token(input: { address: $address, networkId: $networkId }) { - id - address - cmcId - decimals - name - symbol - totalSupply - isScam - info { - circulatingSupply - imageThumbUrl - } - explorerData { - blueCheckmark - description - tokenType - } - } - } - `; - - const variables = { - address: this.tokenAddress, - networkId: this.NETWORK_ID, // Replace with your network ID - }; - - const response = await fetch(this.GRAPHQL_ENDPOINT, { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: settings.CODEX_API_KEY, - }, - body: JSON.stringify({ - query, - variables, - }), - }).then((res) => res.json()); - - const token = response.data?.data?.token; - - if (!token) { - throw new Error(`No data returned for token ${tokenAddress}`); - } - - this.setCachedData(cacheKey, token); - - return { - id: token.id, - address: token.address, - cmcId: token.cmcId, - decimals: token.decimals, - name: token.name, - symbol: token.symbol, - totalSupply: token.totalSupply, - circulatingSupply: token.info?.circulatingSupply, - imageThumbUrl: token.info?.imageThumbUrl, - blueCheckmark: token.explorerData?.blueCheckmark, - isScam: token.isScam ? true : false, - }; - } catch (error) { - console.error( - "Error fetching token data from Codex:", - error.message - ); - return {} as TokenCodex; - } - } - - async fetchPrices(): Promise { - try { - const cacheKey = "prices"; - const cachedData = this.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached prices."); - return cachedData; - } - const { SOL, BTC, ETH } = PROVIDER_CONFIG.TOKEN_ADDRESSES; - const tokens = [SOL, BTC, ETH]; - const prices: Prices = { - solana: { usd: "0" }, - bitcoin: { usd: "0" }, - ethereum: { usd: "0" }, - }; - - for (const token of tokens) { - const response = await this.fetchWithRetry( - `${PROVIDER_CONFIG.BIRDEYE_API}/defi/price?address=${token}`, - { - headers: { - "x-chain": "solana", - }, - } - ); - - if (response?.data?.value) { - const price = response.data.value.toString(); - prices[ - token === SOL - ? "solana" - : token === BTC - ? "bitcoin" - : "ethereum" - ].usd = price; - } else { - console.warn(`No price data available for token: ${token}`); - } - } - this.setCachedData(cacheKey, prices); - return prices; - } catch (error) { - console.error("Error fetching prices:", error); - throw error; - } - } - async calculateBuyAmounts(): Promise { - const dexScreenerData = await this.fetchDexScreenerData(); - const prices = await this.fetchPrices(); - const solPrice = toBN(prices.solana.usd); - - if (!dexScreenerData || dexScreenerData.pairs.length === 0) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - - // Get the first pair - const pair = dexScreenerData.pairs[0]; - const { liquidity, marketCap } = pair; - if (!liquidity || !marketCap) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - - if (liquidity.usd === 0) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - if (marketCap < 100000) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - - // impact percentages based on liquidity - const impactPercentages = { - LOW: 0.01, // 1% of liquidity - MEDIUM: 0.05, // 5% of liquidity - HIGH: 0.1, // 10% of liquidity - }; - - // Calculate buy amounts in USD - const lowBuyAmountUSD = liquidity.usd * impactPercentages.LOW; - const mediumBuyAmountUSD = liquidity.usd * impactPercentages.MEDIUM; - const highBuyAmountUSD = liquidity.usd * impactPercentages.HIGH; - - // Convert each buy amount to SOL - const lowBuyAmountSOL = toBN(lowBuyAmountUSD).div(solPrice).toNumber(); - const mediumBuyAmountSOL = toBN(mediumBuyAmountUSD) - .div(solPrice) - .toNumber(); - const highBuyAmountSOL = toBN(highBuyAmountUSD) - .div(solPrice) - .toNumber(); - - return { - none: 0, - low: lowBuyAmountSOL, - medium: mediumBuyAmountSOL, - high: highBuyAmountSOL, - }; - } - - async fetchTokenSecurity(): Promise { - const cacheKey = `tokenSecurity_${this.tokenAddress}`; - const cachedData = this.getCachedData(cacheKey); - if (cachedData) { - console.log( - `Returning cached token security data for ${this.tokenAddress}.` - ); - return cachedData; - } - const url = `${PROVIDER_CONFIG.BIRDEYE_API}${PROVIDER_CONFIG.TOKEN_SECURITY_ENDPOINT}${this.tokenAddress}`; - const data = await this.fetchWithRetry(url); - - if (!data?.success || !data?.data) { - throw new Error("No token security data available"); - } - - const security: TokenSecurityData = { - ownerBalance: data.data.ownerBalance, - creatorBalance: data.data.creatorBalance, - ownerPercentage: data.data.ownerPercentage, - creatorPercentage: data.data.creatorPercentage, - top10HolderBalance: data.data.top10HolderBalance, - top10HolderPercent: data.data.top10HolderPercent, - }; - this.setCachedData(cacheKey, security); - console.log(`Token security data cached for ${this.tokenAddress}.`); - - return security; - } - - async fetchTokenTradeData(): Promise { - const cacheKey = `tokenTradeData_${this.tokenAddress}`; - const cachedData = this.getCachedData(cacheKey); - if (cachedData) { - console.log( - `Returning cached token trade data for ${this.tokenAddress}.` - ); - return cachedData; - } - - const url = `${PROVIDER_CONFIG.BIRDEYE_API}${PROVIDER_CONFIG.TOKEN_TRADE_DATA_ENDPOINT}${this.tokenAddress}`; - const options = { - method: "GET", - headers: { - accept: "application/json", - "X-API-KEY": settings.BIRDEYE_API_KEY || "", - }, - }; - - const data = await fetch(url, options) - .then((res) => res.json()) - .catch((err) => console.error(err)); - - if (!data?.success || !data?.data) { - throw new Error("No token trade data available"); - } - - const tradeData: TokenTradeData = { - address: data.data.address, - holder: data.data.holder, - market: data.data.market, - last_trade_unix_time: data.data.last_trade_unix_time, - last_trade_human_time: data.data.last_trade_human_time, - price: data.data.price, - history_30m_price: data.data.history_30m_price, - price_change_30m_percent: data.data.price_change_30m_percent, - history_1h_price: data.data.history_1h_price, - price_change_1h_percent: data.data.price_change_1h_percent, - history_2h_price: data.data.history_2h_price, - price_change_2h_percent: data.data.price_change_2h_percent, - history_4h_price: data.data.history_4h_price, - price_change_4h_percent: data.data.price_change_4h_percent, - history_6h_price: data.data.history_6h_price, - price_change_6h_percent: data.data.price_change_6h_percent, - history_8h_price: data.data.history_8h_price, - price_change_8h_percent: data.data.price_change_8h_percent, - history_12h_price: data.data.history_12h_price, - price_change_12h_percent: data.data.price_change_12h_percent, - history_24h_price: data.data.history_24h_price, - price_change_24h_percent: data.data.price_change_24h_percent, - unique_wallet_30m: data.data.unique_wallet_30m, - unique_wallet_history_30m: data.data.unique_wallet_history_30m, - unique_wallet_30m_change_percent: - data.data.unique_wallet_30m_change_percent, - unique_wallet_1h: data.data.unique_wallet_1h, - unique_wallet_history_1h: data.data.unique_wallet_history_1h, - unique_wallet_1h_change_percent: - data.data.unique_wallet_1h_change_percent, - unique_wallet_2h: data.data.unique_wallet_2h, - unique_wallet_history_2h: data.data.unique_wallet_history_2h, - unique_wallet_2h_change_percent: - data.data.unique_wallet_2h_change_percent, - unique_wallet_4h: data.data.unique_wallet_4h, - unique_wallet_history_4h: data.data.unique_wallet_history_4h, - unique_wallet_4h_change_percent: - data.data.unique_wallet_4h_change_percent, - unique_wallet_8h: data.data.unique_wallet_8h, - unique_wallet_history_8h: data.data.unique_wallet_history_8h, - unique_wallet_8h_change_percent: - data.data.unique_wallet_8h_change_percent, - unique_wallet_24h: data.data.unique_wallet_24h, - unique_wallet_history_24h: data.data.unique_wallet_history_24h, - unique_wallet_24h_change_percent: - data.data.unique_wallet_24h_change_percent, - trade_30m: data.data.trade_30m, - trade_history_30m: data.data.trade_history_30m, - trade_30m_change_percent: data.data.trade_30m_change_percent, - sell_30m: data.data.sell_30m, - sell_history_30m: data.data.sell_history_30m, - sell_30m_change_percent: data.data.sell_30m_change_percent, - buy_30m: data.data.buy_30m, - buy_history_30m: data.data.buy_history_30m, - buy_30m_change_percent: data.data.buy_30m_change_percent, - volume_30m: data.data.volume_30m, - volume_30m_usd: data.data.volume_30m_usd, - volume_history_30m: data.data.volume_history_30m, - volume_history_30m_usd: data.data.volume_history_30m_usd, - volume_30m_change_percent: data.data.volume_30m_change_percent, - volume_buy_30m: data.data.volume_buy_30m, - volume_buy_30m_usd: data.data.volume_buy_30m_usd, - volume_buy_history_30m: data.data.volume_buy_history_30m, - volume_buy_history_30m_usd: data.data.volume_buy_history_30m_usd, - volume_buy_30m_change_percent: - data.data.volume_buy_30m_change_percent, - volume_sell_30m: data.data.volume_sell_30m, - volume_sell_30m_usd: data.data.volume_sell_30m_usd, - volume_sell_history_30m: data.data.volume_sell_history_30m, - volume_sell_history_30m_usd: data.data.volume_sell_history_30m_usd, - volume_sell_30m_change_percent: - data.data.volume_sell_30m_change_percent, - trade_1h: data.data.trade_1h, - trade_history_1h: data.data.trade_history_1h, - trade_1h_change_percent: data.data.trade_1h_change_percent, - sell_1h: data.data.sell_1h, - sell_history_1h: data.data.sell_history_1h, - sell_1h_change_percent: data.data.sell_1h_change_percent, - buy_1h: data.data.buy_1h, - buy_history_1h: data.data.buy_history_1h, - buy_1h_change_percent: data.data.buy_1h_change_percent, - volume_1h: data.data.volume_1h, - volume_1h_usd: data.data.volume_1h_usd, - volume_history_1h: data.data.volume_history_1h, - volume_history_1h_usd: data.data.volume_history_1h_usd, - volume_1h_change_percent: data.data.volume_1h_change_percent, - volume_buy_1h: data.data.volume_buy_1h, - volume_buy_1h_usd: data.data.volume_buy_1h_usd, - volume_buy_history_1h: data.data.volume_buy_history_1h, - volume_buy_history_1h_usd: data.data.volume_buy_history_1h_usd, - volume_buy_1h_change_percent: - data.data.volume_buy_1h_change_percent, - volume_sell_1h: data.data.volume_sell_1h, - volume_sell_1h_usd: data.data.volume_sell_1h_usd, - volume_sell_history_1h: data.data.volume_sell_history_1h, - volume_sell_history_1h_usd: data.data.volume_sell_history_1h_usd, - volume_sell_1h_change_percent: - data.data.volume_sell_1h_change_percent, - trade_2h: data.data.trade_2h, - trade_history_2h: data.data.trade_history_2h, - trade_2h_change_percent: data.data.trade_2h_change_percent, - sell_2h: data.data.sell_2h, - sell_history_2h: data.data.sell_history_2h, - sell_2h_change_percent: data.data.sell_2h_change_percent, - buy_2h: data.data.buy_2h, - buy_history_2h: data.data.buy_history_2h, - buy_2h_change_percent: data.data.buy_2h_change_percent, - volume_2h: data.data.volume_2h, - volume_2h_usd: data.data.volume_2h_usd, - volume_history_2h: data.data.volume_history_2h, - volume_history_2h_usd: data.data.volume_history_2h_usd, - volume_2h_change_percent: data.data.volume_2h_change_percent, - volume_buy_2h: data.data.volume_buy_2h, - volume_buy_2h_usd: data.data.volume_buy_2h_usd, - volume_buy_history_2h: data.data.volume_buy_history_2h, - volume_buy_history_2h_usd: data.data.volume_buy_history_2h_usd, - volume_buy_2h_change_percent: - data.data.volume_buy_2h_change_percent, - volume_sell_2h: data.data.volume_sell_2h, - volume_sell_2h_usd: data.data.volume_sell_2h_usd, - volume_sell_history_2h: data.data.volume_sell_history_2h, - volume_sell_history_2h_usd: data.data.volume_sell_history_2h_usd, - volume_sell_2h_change_percent: - data.data.volume_sell_2h_change_percent, - trade_4h: data.data.trade_4h, - trade_history_4h: data.data.trade_history_4h, - trade_4h_change_percent: data.data.trade_4h_change_percent, - sell_4h: data.data.sell_4h, - sell_history_4h: data.data.sell_history_4h, - sell_4h_change_percent: data.data.sell_4h_change_percent, - buy_4h: data.data.buy_4h, - buy_history_4h: data.data.buy_history_4h, - buy_4h_change_percent: data.data.buy_4h_change_percent, - volume_4h: data.data.volume_4h, - volume_4h_usd: data.data.volume_4h_usd, - volume_history_4h: data.data.volume_history_4h, - volume_history_4h_usd: data.data.volume_history_4h_usd, - volume_4h_change_percent: data.data.volume_4h_change_percent, - volume_buy_4h: data.data.volume_buy_4h, - volume_buy_4h_usd: data.data.volume_buy_4h_usd, - volume_buy_history_4h: data.data.volume_buy_history_4h, - volume_buy_history_4h_usd: data.data.volume_buy_history_4h_usd, - volume_buy_4h_change_percent: - data.data.volume_buy_4h_change_percent, - volume_sell_4h: data.data.volume_sell_4h, - volume_sell_4h_usd: data.data.volume_sell_4h_usd, - volume_sell_history_4h: data.data.volume_sell_history_4h, - volume_sell_history_4h_usd: data.data.volume_sell_history_4h_usd, - volume_sell_4h_change_percent: - data.data.volume_sell_4h_change_percent, - trade_8h: data.data.trade_8h, - trade_history_8h: data.data.trade_history_8h, - trade_8h_change_percent: data.data.trade_8h_change_percent, - sell_8h: data.data.sell_8h, - sell_history_8h: data.data.sell_history_8h, - sell_8h_change_percent: data.data.sell_8h_change_percent, - buy_8h: data.data.buy_8h, - buy_history_8h: data.data.buy_history_8h, - buy_8h_change_percent: data.data.buy_8h_change_percent, - volume_8h: data.data.volume_8h, - volume_8h_usd: data.data.volume_8h_usd, - volume_history_8h: data.data.volume_history_8h, - volume_history_8h_usd: data.data.volume_history_8h_usd, - volume_8h_change_percent: data.data.volume_8h_change_percent, - volume_buy_8h: data.data.volume_buy_8h, - volume_buy_8h_usd: data.data.volume_buy_8h_usd, - volume_buy_history_8h: data.data.volume_buy_history_8h, - volume_buy_history_8h_usd: data.data.volume_buy_history_8h_usd, - volume_buy_8h_change_percent: - data.data.volume_buy_8h_change_percent, - volume_sell_8h: data.data.volume_sell_8h, - volume_sell_8h_usd: data.data.volume_sell_8h_usd, - volume_sell_history_8h: data.data.volume_sell_history_8h, - volume_sell_history_8h_usd: data.data.volume_sell_history_8h_usd, - volume_sell_8h_change_percent: - data.data.volume_sell_8h_change_percent, - trade_24h: data.data.trade_24h, - trade_history_24h: data.data.trade_history_24h, - trade_24h_change_percent: data.data.trade_24h_change_percent, - sell_24h: data.data.sell_24h, - sell_history_24h: data.data.sell_history_24h, - sell_24h_change_percent: data.data.sell_24h_change_percent, - buy_24h: data.data.buy_24h, - buy_history_24h: data.data.buy_history_24h, - buy_24h_change_percent: data.data.buy_24h_change_percent, - volume_24h: data.data.volume_24h, - volume_24h_usd: data.data.volume_24h_usd, - volume_history_24h: data.data.volume_history_24h, - volume_history_24h_usd: data.data.volume_history_24h_usd, - volume_24h_change_percent: data.data.volume_24h_change_percent, - volume_buy_24h: data.data.volume_buy_24h, - volume_buy_24h_usd: data.data.volume_buy_24h_usd, - volume_buy_history_24h: data.data.volume_buy_history_24h, - volume_buy_history_24h_usd: data.data.volume_buy_history_24h_usd, - volume_buy_24h_change_percent: - data.data.volume_buy_24h_change_percent, - volume_sell_24h: data.data.volume_sell_24h, - volume_sell_24h_usd: data.data.volume_sell_24h_usd, - volume_sell_history_24h: data.data.volume_sell_history_24h, - volume_sell_history_24h_usd: data.data.volume_sell_history_24h_usd, - volume_sell_24h_change_percent: - data.data.volume_sell_24h_change_percent, - }; - this.setCachedData(cacheKey, tradeData); - return tradeData; - } - - async fetchDexScreenerData(): Promise { - const cacheKey = `dexScreenerData_${this.tokenAddress}`; - const cachedData = this.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached DexScreener data."); - return cachedData; - } - - const url = `https://api.dexscreener.com/latest/dex/search?q=${this.tokenAddress}`; - try { - console.log( - `Fetching DexScreener data for token: ${this.tokenAddress}` - ); - const data = await fetch(url) - .then((res) => res.json()) - .catch((err) => { - console.error(err); - }); - - if (!data || !data.pairs) { - throw new Error("No DexScreener data available"); - } - - const dexData: DexScreenerData = { - schemaVersion: data.schemaVersion, - pairs: data.pairs, - }; - - // Cache the result - this.setCachedData(cacheKey, dexData); - - return dexData; - } catch (error) { - console.error(`Error fetching DexScreener data:`, error); - return { - schemaVersion: "1.0.0", - pairs: [], - }; - } - } - - async searchDexScreenerData( - symbol: string - ): Promise { - const cacheKey = `dexScreenerData_search_${symbol}`; - const cachedData = await this.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached search DexScreener data."); - return this.getHighestLiquidityPair(cachedData); - } - - const url = `https://api.dexscreener.com/latest/dex/search?q=${symbol}`; - try { - console.log(`Fetching DexScreener data for symbol: ${symbol}`); - const data = await fetch(url) - .then((res) => res.json()) - .catch((err) => { - console.error(err); - return null; - }); - - if (!data || !data.pairs || data.pairs.length === 0) { - throw new Error("No DexScreener data available"); - } - - const dexData: DexScreenerData = { - schemaVersion: data.schemaVersion, - pairs: data.pairs, - }; - - // Cache the result - this.setCachedData(cacheKey, dexData); - - // Return the pair with the highest liquidity and market cap - return this.getHighestLiquidityPair(dexData); - } catch (error) { - console.error(`Error fetching DexScreener data:`, error); - return null; - } - } - getHighestLiquidityPair(dexData: DexScreenerData): DexScreenerPair | null { - if (dexData.pairs.length === 0) { - return null; - } - - // Sort pairs by both liquidity and market cap to get the highest one - return dexData.pairs.sort((a, b) => { - const liquidityDiff = b.liquidity.usd - a.liquidity.usd; - if (liquidityDiff !== 0) { - return liquidityDiff; // Higher liquidity comes first - } - return b.marketCap - a.marketCap; // If liquidity is equal, higher market cap comes first - })[0]; - } - - async analyzeHolderDistribution( - tradeData: TokenTradeData - ): Promise { - // Define the time intervals to consider (e.g., 30m, 1h, 2h) - const intervals = [ - { - period: "30m", - change: tradeData.unique_wallet_30m_change_percent, - }, - { period: "1h", change: tradeData.unique_wallet_1h_change_percent }, - { period: "2h", change: tradeData.unique_wallet_2h_change_percent }, - { period: "4h", change: tradeData.unique_wallet_4h_change_percent }, - { period: "8h", change: tradeData.unique_wallet_8h_change_percent }, - { - period: "24h", - change: tradeData.unique_wallet_24h_change_percent, - }, - ]; - - // Calculate the average change percentage - const validChanges = intervals - .map((interval) => interval.change) - .filter( - (change) => change !== null && change !== undefined - ) as number[]; - - if (validChanges.length === 0) { - return "stable"; - } - - const averageChange = - validChanges.reduce((acc, curr) => acc + curr, 0) / - validChanges.length; - - const increaseThreshold = 10; // e.g., average change > 10% - const decreaseThreshold = -10; // e.g., average change < -10% - - if (averageChange > increaseThreshold) { - return "increasing"; - } else if (averageChange < decreaseThreshold) { - return "decreasing"; - } else { - return "stable"; - } - } - - async fetchHolderList(): Promise { - const cacheKey = `holderList_${this.tokenAddress}`; - const cachedData = this.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached holder list."); - return cachedData; - } - - const allHoldersMap = new Map(); - let page = 1; - const limit = 1000; - let cursor; - //HELIOUS_API_KEY needs to be added - const url = `https://mainnet.helius-rpc.com/?api-key=${settings.HELIUS_API_KEY || ""}`; - console.log({ url }); - - try { - while (true) { - const params = { - limit: limit, - displayOptions: {}, - mint: this.tokenAddress, - cursor: cursor, - }; - if (cursor != undefined) { - params.cursor = cursor; - } - console.log(`Fetching holders - Page ${page}`); - if (page > 2) { - break; - } - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - jsonrpc: "2.0", - id: "helius-test", - method: "getTokenAccounts", - params: params, - }), - }); - - const data = await response.json(); - - if ( - !data || - !data.result || - !data.result.token_accounts || - data.result.token_accounts.length === 0 - ) { - console.log( - `No more holders found. Total pages fetched: ${page - 1}` - ); - break; - } - - console.log( - `Processing ${data.result.token_accounts.length} holders from page ${page}` - ); - - data.result.token_accounts.forEach((account: any) => { - const owner = account.owner; - const balance = parseFloat(account.amount); - - if (allHoldersMap.has(owner)) { - allHoldersMap.set( - owner, - allHoldersMap.get(owner)! + balance - ); - } else { - allHoldersMap.set(owner, balance); - } - }); - cursor = data.result.cursor; - page++; - } - - const holders: HolderData[] = Array.from( - allHoldersMap.entries() - ).map(([address, balance]) => ({ - address, - balance: balance.toString(), - })); - - console.log(`Total unique holders fetched: ${holders.length}`); - - // Cache the result - this.setCachedData(cacheKey, holders); - - return holders; - } catch (error) { - console.error("Error fetching holder list from Helius:", error); - throw new Error("Failed to fetch holder list from Helius."); - } - } - - async filterHighValueHolders( - tradeData: TokenTradeData - ): Promise> { - const holdersData = await this.fetchHolderList(); - - const tokenPriceUsd = toBN(tradeData.price); - - const highValueHolders = holdersData - .filter((holder) => { - const balanceUsd = toBN(holder.balance).multipliedBy( - tokenPriceUsd - ); - return balanceUsd.isGreaterThan(5); - }) - .map((holder) => ({ - holderAddress: holder.address, - balanceUsd: toBN(holder.balance) - .multipliedBy(tokenPriceUsd) - .toFixed(2), - })); - - return highValueHolders; - } - - async checkRecentTrades(tradeData: TokenTradeData): Promise { - return toBN(tradeData.volume_24h_usd).isGreaterThan(0); - } - - async countHighSupplyHolders( - securityData: TokenSecurityData - ): Promise { - try { - const ownerBalance = toBN(securityData.ownerBalance); - const totalSupply = ownerBalance.plus(securityData.creatorBalance); - - const highSupplyHolders = await this.fetchHolderList(); - const highSupplyHoldersCount = highSupplyHolders.filter( - (holder) => { - const balance = toBN(holder.balance); - return balance.dividedBy(totalSupply).isGreaterThan(0.02); - } - ).length; - return highSupplyHoldersCount; - } catch (error) { - console.error("Error counting high supply holders:", error); - return 0; - } - } - - async getProcessedTokenData(): Promise { - try { - console.log( - `Fetching security data for token: ${this.tokenAddress}` - ); - const security = await this.fetchTokenSecurity(); - - const tokenCodex = await this.fetchTokenCodex(); - - console.log(`Fetching trade data for token: ${this.tokenAddress}`); - const tradeData = await this.fetchTokenTradeData(); - - console.log( - `Fetching DexScreener data for token: ${this.tokenAddress}` - ); - const dexData = await this.fetchDexScreenerData(); - - console.log( - `Analyzing holder distribution for token: ${this.tokenAddress}` - ); - const holderDistributionTrend = - await this.analyzeHolderDistribution(tradeData); - - console.log( - `Filtering high-value holders for token: ${this.tokenAddress}` - ); - const highValueHolders = - await this.filterHighValueHolders(tradeData); - - console.log( - `Checking recent trades for token: ${this.tokenAddress}` - ); - const recentTrades = await this.checkRecentTrades(tradeData); - - console.log( - `Counting high-supply holders for token: ${this.tokenAddress}` - ); - const highSupplyHoldersCount = - await this.countHighSupplyHolders(security); - - console.log( - `Determining DexScreener listing status for token: ${this.tokenAddress}` - ); - const isDexScreenerListed = dexData.pairs.length > 0; - const isDexScreenerPaid = dexData.pairs.some( - (pair) => pair.boosts && pair.boosts.active > 0 - ); - - const processedData: ProcessedTokenData = { - security, - tradeData, - holderDistributionTrend, - highValueHolders, - recentTrades, - highSupplyHoldersCount, - dexScreenerData: dexData, - isDexScreenerListed, - isDexScreenerPaid, - tokenCodex, - }; - - // console.log("Processed token data:", processedData); - return processedData; - } catch (error) { - console.error("Error processing token data:", error); - throw error; - } - } - - async shouldTradeToken(): Promise { - try { - const tokenData = await this.getProcessedTokenData(); - const { tradeData, security, dexScreenerData } = tokenData; - const { ownerBalance, creatorBalance } = security; - const { liquidity, marketCap } = dexScreenerData.pairs[0]; - const liquidityUsd = toBN(liquidity.usd); - const marketCapUsd = toBN(marketCap); - const totalSupply = toBN(ownerBalance).plus(creatorBalance); - const _ownerPercentage = toBN(ownerBalance).dividedBy(totalSupply); - const _creatorPercentage = - toBN(creatorBalance).dividedBy(totalSupply); - const top10HolderPercent = toBN(tradeData.volume_24h_usd).dividedBy( - totalSupply - ); - const priceChange24hPercent = toBN( - tradeData.price_change_24h_percent - ); - const priceChange12hPercent = toBN( - tradeData.price_change_12h_percent - ); - const uniqueWallet24h = tradeData.unique_wallet_24h; - const volume24hUsd = toBN(tradeData.volume_24h_usd); - const volume24hUsdThreshold = 1000; - const priceChange24hPercentThreshold = 10; - const priceChange12hPercentThreshold = 5; - const top10HolderPercentThreshold = 0.05; - const uniqueWallet24hThreshold = 100; - const isTop10Holder = top10HolderPercent.gte( - top10HolderPercentThreshold - ); - const isVolume24h = volume24hUsd.gte(volume24hUsdThreshold); - const isPriceChange24h = priceChange24hPercent.gte( - priceChange24hPercentThreshold - ); - const isPriceChange12h = priceChange12hPercent.gte( - priceChange12hPercentThreshold - ); - const isUniqueWallet24h = - uniqueWallet24h >= uniqueWallet24hThreshold; - const isLiquidityTooLow = liquidityUsd.lt(1000); - const isMarketCapTooLow = marketCapUsd.lt(100000); - return ( - isTop10Holder || - isVolume24h || - isPriceChange24h || - isPriceChange12h || - isUniqueWallet24h || - isLiquidityTooLow || - isMarketCapTooLow - ); - } catch (error) { - console.error("Error processing token data:", error); - throw error; - } - } - - formatTokenData(data: ProcessedTokenData): string { - let output = `**Token Security and Trade Report**\n`; - output += `Token Address: ${this.tokenAddress}\n\n`; - - // Security Data - output += `**Ownership Distribution:**\n`; - output += `- Owner Balance: ${data.security.ownerBalance}\n`; - output += `- Creator Balance: ${data.security.creatorBalance}\n`; - output += `- Owner Percentage: ${data.security.ownerPercentage}%\n`; - output += `- Creator Percentage: ${data.security.creatorPercentage}%\n`; - output += `- Top 10 Holders Balance: ${data.security.top10HolderBalance}\n`; - output += `- Top 10 Holders Percentage: ${data.security.top10HolderPercent}%\n\n`; - - // Trade Data - output += `**Trade Data:**\n`; - output += `- Holders: ${data.tradeData.holder}\n`; - output += `- Unique Wallets (24h): ${data.tradeData.unique_wallet_24h}\n`; - output += `- Price Change (24h): ${data.tradeData.price_change_24h_percent}%\n`; - output += `- Price Change (12h): ${data.tradeData.price_change_12h_percent}%\n`; - output += `- Volume (24h USD): $${toBN(data.tradeData.volume_24h_usd).toFixed(2)}\n`; - output += `- Current Price: $${toBN(data.tradeData.price).toFixed(2)}\n\n`; - - // Holder Distribution Trend - output += `**Holder Distribution Trend:** ${data.holderDistributionTrend}\n\n`; - - // High-Value Holders - output += `**High-Value Holders (>$5 USD):**\n`; - if (data.highValueHolders.length === 0) { - output += `- No high-value holders found or data not available.\n`; - } else { - data.highValueHolders.forEach((holder) => { - output += `- ${holder.holderAddress}: $${holder.balanceUsd}\n`; - }); - } - output += `\n`; - - // Recent Trades - output += `**Recent Trades (Last 24h):** ${data.recentTrades ? "Yes" : "No"}\n\n`; - - // High-Supply Holders - output += `**Holders with >2% Supply:** ${data.highSupplyHoldersCount}\n\n`; - - // DexScreener Status - output += `**DexScreener Listing:** ${data.isDexScreenerListed ? "Yes" : "No"}\n`; - if (data.isDexScreenerListed) { - output += `- Listing Type: ${data.isDexScreenerPaid ? "Paid" : "Free"}\n`; - output += `- Number of DexPairs: ${data.dexScreenerData.pairs.length}\n\n`; - output += `**DexScreener Pairs:**\n`; - data.dexScreenerData.pairs.forEach((pair, index) => { - output += `\n**Pair ${index + 1}:**\n`; - output += `- DEX: ${pair.dexId}\n`; - output += `- URL: ${pair.url}\n`; - output += `- Price USD: $${toBN(pair.priceUsd).toFixed(6)}\n`; - output += `- Volume (24h USD): $${toBN(pair.volume.h24).toFixed(2)}\n`; - output += `- Boosts Active: ${pair.boosts && pair.boosts.active}\n`; - output += `- Liquidity USD: $${toBN(pair.liquidity.usd).toFixed(2)}\n`; - }); - } - output += `\n`; - - console.log("Formatted token data:", output); - return output; - } - - async getFormattedTokenReport(): Promise { - try { - console.log("Generating formatted token report..."); - const processedData = await this.getProcessedTokenData(); - return this.formatTokenData(processedData); - } catch (error) { - console.error("Error generating token report:", error); - return "Unable to fetch token information. Please try again later."; - } - } -} - -const tokenAddress = PROVIDER_CONFIG.TOKEN_ADDRESSES.Example; - -const connection = new Connection(PROVIDER_CONFIG.DEFAULT_RPC); -const tokenProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State - ): Promise => { - try { - const { publicKey } = await getWalletKey(runtime, false); - - const walletProvider = new WalletProvider( - connection, - publicKey - ); - - const provider = new TokenProvider( - tokenAddress, - walletProvider, - runtime.cacheManager - ); - - return provider.getFormattedTokenReport(); - } catch (error) { - console.error("Error fetching token data:", error); - return "Unable to fetch token information. Please try again later."; - } - }, -}; - -export { tokenProvider }; diff --git a/packages/plugin-solana/src/providers/tokenUtils.ts b/packages/plugin-solana/src/providers/tokenUtils.ts deleted file mode 100644 index 034dddc299e..00000000000 --- a/packages/plugin-solana/src/providers/tokenUtils.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { getAccount, getAssociatedTokenAddress } from "@solana/spl-token"; -import { Connection, PublicKey } from "@solana/web3.js"; - -export async function getTokenPriceInSol(tokenSymbol: string): Promise { - const response = await fetch( - `https://price.jup.ag/v6/price?ids=${tokenSymbol}` - ); - const data = await response.json(); - return data.data[tokenSymbol].price; -} - -async function getTokenBalance( - connection: Connection, - walletPublicKey: PublicKey, - tokenMintAddress: PublicKey -): Promise { - const tokenAccountAddress = await getAssociatedTokenAddress( - tokenMintAddress, - walletPublicKey - ); - - try { - const tokenAccount = await getAccount(connection, tokenAccountAddress); - const tokenAmount = tokenAccount.amount as unknown as number; - return tokenAmount; - } catch (error) { - console.error( - `Error retrieving balance for token: ${tokenMintAddress.toBase58()}`, - error - ); - return 0; - } -} - -async function getTokenBalances( - connection: Connection, - walletPublicKey: PublicKey -): Promise<{ [tokenName: string]: number }> { - const tokenBalances: { [tokenName: string]: number } = {}; - - // Add the token mint addresses you want to retrieve balances for - const tokenMintAddresses = [ - new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), // USDC - new PublicKey("So11111111111111111111111111111111111111112"), // SOL - // Add more token mint addresses as needed - ]; - - for (const mintAddress of tokenMintAddresses) { - const tokenName = getTokenName(mintAddress); - const balance = await getTokenBalance( - connection, - walletPublicKey, - mintAddress - ); - tokenBalances[tokenName] = balance; - } - - return tokenBalances; -} - -function getTokenName(mintAddress: PublicKey): string { - // Implement a mapping of mint addresses to token names - const tokenNameMap: { [mintAddress: string]: string } = { - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: "USDC", - So11111111111111111111111111111111111111112: "SOL", - // Add more token mint addresses and their corresponding names - }; - - return tokenNameMap[mintAddress.toBase58()] || "Unknown Token"; -} - -export { getTokenBalance, getTokenBalances }; diff --git a/packages/plugin-solana/src/providers/trustScoreProvider.ts b/packages/plugin-solana/src/providers/trustScoreProvider.ts deleted file mode 100644 index d8ebeaa57fb..00000000000 --- a/packages/plugin-solana/src/providers/trustScoreProvider.ts +++ /dev/null @@ -1,740 +0,0 @@ -import { - ProcessedTokenData, - TokenSecurityData, - // TokenTradeData, - // DexScreenerData, - // DexScreenerPair, - // HolderData, -} from "../types/token.ts"; -import { Connection, PublicKey } from "@solana/web3.js"; -import { getAssociatedTokenAddress } from "@solana/spl-token"; -import { TokenProvider } from "./token.ts"; -import { WalletProvider } from "./wallet.ts"; -import { SimulationSellingService } from "./simulationSellingService.ts"; -import { - TrustScoreDatabase, - RecommenderMetrics, - TokenPerformance, - TradePerformance, - TokenRecommendation, -} from "@ai16z/plugin-trustdb"; -import { settings } from "@ai16z/eliza"; -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { v4 as uuidv4 } from "uuid"; - -const Wallet = settings.MAIN_WALLET_ADDRESS; -interface TradeData { - buy_amount: number; - is_simulation: boolean; -} -interface sellDetails { - sell_amount: number; - sell_recommender_id: string | null; -} -interface _RecommendationGroup { - recommendation: any; - trustScore: number; -} - -interface RecommenderData { - recommenderId: string; - trustScore: number; - riskScore: number; - consistencyScore: number; - recommenderMetrics: RecommenderMetrics; -} - -interface TokenRecommendationSummary { - tokenAddress: string; - averageTrustScore: number; - averageRiskScore: number; - averageConsistencyScore: number; - recommenders: RecommenderData[]; -} -export class TrustScoreManager { - private tokenProvider: TokenProvider; - private trustScoreDb: TrustScoreDatabase; - private simulationSellingService: SimulationSellingService; - private connection: Connection; - private baseMint: PublicKey; - private DECAY_RATE = 0.95; - private MAX_DECAY_DAYS = 30; - private backend; - private backendToken; - constructor( - runtime: IAgentRuntime, - tokenProvider: TokenProvider, - trustScoreDb: TrustScoreDatabase - ) { - this.tokenProvider = tokenProvider; - this.trustScoreDb = trustScoreDb; - this.connection = new Connection(runtime.getSetting("RPC_URL")); - this.baseMint = new PublicKey( - runtime.getSetting("BASE_MINT") || - "So11111111111111111111111111111111111111112" - ); - this.backend = runtime.getSetting("BACKEND_URL"); - this.backendToken = runtime.getSetting("BACKEND_TOKEN"); - this.simulationSellingService = new SimulationSellingService( - runtime, - this.trustScoreDb - ); - } - - //getRecommenederBalance - async getRecommenederBalance(recommenderWallet: string): Promise { - try { - const tokenAta = await getAssociatedTokenAddress( - new PublicKey(recommenderWallet), - this.baseMint - ); - const tokenBalInfo = - await this.connection.getTokenAccountBalance(tokenAta); - const tokenBalance = tokenBalInfo.value.amount; - const balance = parseFloat(tokenBalance); - return balance; - } catch (error) { - console.error("Error fetching balance", error); - return 0; - } - } - - /** - * Generates and saves trust score based on processed token data and user recommendations. - * @param tokenAddress The address of the token to analyze. - * @param recommenderId The UUID of the recommender. - * @returns An object containing TokenPerformance and RecommenderMetrics. - */ - async generateTrustScore( - tokenAddress: string, - recommenderId: string, - recommenderWallet: string - ): Promise<{ - tokenPerformance: TokenPerformance; - recommenderMetrics: RecommenderMetrics; - }> { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - const recommenderMetrics = - await this.trustScoreDb.getRecommenderMetrics(recommenderId); - - const isRapidDump = await this.isRapidDump(tokenAddress); - const sustainedGrowth = await this.sustainedGrowth(tokenAddress); - const suspiciousVolume = await this.suspiciousVolume(tokenAddress); - const balance = await this.getRecommenederBalance(recommenderWallet); - const virtualConfidence = balance / 1000000; // TODO: create formula to calculate virtual confidence based on user balance - const lastActive = recommenderMetrics.lastActiveDate; - const now = new Date(); - const inactiveDays = Math.floor( - (now.getTime() - lastActive.getTime()) / (1000 * 60 * 60 * 24) - ); - const decayFactor = Math.pow( - this.DECAY_RATE, - Math.min(inactiveDays, this.MAX_DECAY_DAYS) - ); - const decayedScore = recommenderMetrics.trustScore * decayFactor; - const validationTrustScore = - this.trustScoreDb.calculateValidationTrust(tokenAddress); - - return { - tokenPerformance: { - tokenAddress: - processedData.dexScreenerData.pairs[0]?.baseToken.address || - "", - priceChange24h: - processedData.tradeData.price_change_24h_percent, - volumeChange24h: processedData.tradeData.volume_24h, - trade_24h_change: - processedData.tradeData.trade_24h_change_percent, - liquidity: - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0, - liquidityChange24h: 0, - holderChange24h: - processedData.tradeData.unique_wallet_24h_change_percent, - rugPull: false, - isScam: processedData.tokenCodex.isScam, - marketCapChange24h: 0, - sustainedGrowth: sustainedGrowth, - rapidDump: isRapidDump, - suspiciousVolume: suspiciousVolume, - validationTrust: validationTrustScore, - balance: balance, - initialMarketCap: - processedData.dexScreenerData.pairs[0]?.marketCap || 0, - lastUpdated: new Date(), - symbol: "", - }, - recommenderMetrics: { - recommenderId: recommenderId, - trustScore: recommenderMetrics.trustScore, - totalRecommendations: recommenderMetrics.totalRecommendations, - successfulRecs: recommenderMetrics.successfulRecs, - avgTokenPerformance: recommenderMetrics.avgTokenPerformance, - riskScore: recommenderMetrics.riskScore, - consistencyScore: recommenderMetrics.consistencyScore, - virtualConfidence: virtualConfidence, - lastActiveDate: now, - trustDecay: decayedScore, - lastUpdated: new Date(), - }, - }; - } - - async updateRecommenderMetrics( - recommenderId: string, - tokenPerformance: TokenPerformance, - recommenderWallet: string - ): Promise { - const recommenderMetrics = - await this.trustScoreDb.getRecommenderMetrics(recommenderId); - - const totalRecommendations = - recommenderMetrics.totalRecommendations + 1; - const successfulRecs = tokenPerformance.rugPull - ? recommenderMetrics.successfulRecs - : recommenderMetrics.successfulRecs + 1; - const avgTokenPerformance = - (recommenderMetrics.avgTokenPerformance * - recommenderMetrics.totalRecommendations + - tokenPerformance.priceChange24h) / - totalRecommendations; - - const overallTrustScore = this.calculateTrustScore( - tokenPerformance, - recommenderMetrics - ); - const riskScore = this.calculateOverallRiskScore( - tokenPerformance, - recommenderMetrics - ); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - - const balance = await this.getRecommenederBalance(recommenderWallet); - const virtualConfidence = balance / 1000000; // TODO: create formula to calculate virtual confidence based on user balance - const lastActive = recommenderMetrics.lastActiveDate; - const now = new Date(); - const inactiveDays = Math.floor( - (now.getTime() - lastActive.getTime()) / (1000 * 60 * 60 * 24) - ); - const decayFactor = Math.pow( - this.DECAY_RATE, - Math.min(inactiveDays, this.MAX_DECAY_DAYS) - ); - const decayedScore = recommenderMetrics.trustScore * decayFactor; - - const newRecommenderMetrics: RecommenderMetrics = { - recommenderId: recommenderId, - trustScore: overallTrustScore, - totalRecommendations: totalRecommendations, - successfulRecs: successfulRecs, - avgTokenPerformance: avgTokenPerformance, - riskScore: riskScore, - consistencyScore: consistencyScore, - virtualConfidence: virtualConfidence, - lastActiveDate: new Date(), - trustDecay: decayedScore, - lastUpdated: new Date(), - }; - - await this.trustScoreDb.updateRecommenderMetrics(newRecommenderMetrics); - } - - calculateTrustScore( - tokenPerformance: TokenPerformance, - recommenderMetrics: RecommenderMetrics - ): number { - const riskScore = this.calculateRiskScore(tokenPerformance); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - - return (riskScore + consistencyScore) / 2; - } - - calculateOverallRiskScore( - tokenPerformance: TokenPerformance, - recommenderMetrics: RecommenderMetrics - ) { - const riskScore = this.calculateRiskScore(tokenPerformance); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - - return (riskScore + consistencyScore) / 2; - } - - calculateRiskScore(tokenPerformance: TokenPerformance): number { - let riskScore = 0; - if (tokenPerformance.rugPull) { - riskScore += 10; - } - if (tokenPerformance.isScam) { - riskScore += 10; - } - if (tokenPerformance.rapidDump) { - riskScore += 5; - } - if (tokenPerformance.suspiciousVolume) { - riskScore += 5; - } - return riskScore; - } - - calculateConsistencyScore( - tokenPerformance: TokenPerformance, - recommenderMetrics: RecommenderMetrics - ): number { - const avgTokenPerformance = recommenderMetrics.avgTokenPerformance; - const priceChange24h = tokenPerformance.priceChange24h; - - return Math.abs(priceChange24h - avgTokenPerformance); - } - - async suspiciousVolume(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - const unique_wallet_24h = processedData.tradeData.unique_wallet_24h; - const volume_24h = processedData.tradeData.volume_24h; - const suspiciousVolume = unique_wallet_24h / volume_24h > 0.5; - console.log(`Fetched processed token data for token: ${tokenAddress}`); - return suspiciousVolume; - } - - async sustainedGrowth(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - return processedData.tradeData.volume_24h_change_percent > 50; - } - - async isRapidDump(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - return processedData.tradeData.trade_24h_change_percent < -50; - } - - async checkTrustScore(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - return { - ownerBalance: processedData.security.ownerBalance, - creatorBalance: processedData.security.creatorBalance, - ownerPercentage: processedData.security.ownerPercentage, - creatorPercentage: processedData.security.creatorPercentage, - top10HolderBalance: processedData.security.top10HolderBalance, - top10HolderPercent: processedData.security.top10HolderPercent, - }; - } - - /** - * Creates a TradePerformance object based on token data and recommender. - * @param tokenAddress The address of the token. - * @param recommenderId The UUID of the recommender. - * @param data ProcessedTokenData. - * @returns TradePerformance object. - */ - async createTradePerformance( - runtime: IAgentRuntime, - tokenAddress: string, - recommenderId: string, - data: TradeData - ): Promise { - const recommender = - await this.trustScoreDb.getOrCreateRecommenderWithTelegramId( - recommenderId - ); - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - const wallet = new WalletProvider( - this.connection, - new PublicKey(Wallet!) - ); - - let tokensBalance = 0; - const prices = await wallet.fetchPrices(runtime); - const solPrice = prices.solana.usd; - const buySol = data.buy_amount / parseFloat(solPrice); - const buy_value_usd = data.buy_amount * processedData.tradeData.price; - const token = await this.tokenProvider.fetchTokenTradeData(); - const tokenCodex = await this.tokenProvider.fetchTokenCodex(); - const tokenPrice = token.price; - tokensBalance = buy_value_usd / tokenPrice; - - const creationData = { - token_address: tokenAddress, - recommender_id: recommender.id, - buy_price: processedData.tradeData.price, - sell_price: 0, - buy_timeStamp: new Date().toISOString(), - sell_timeStamp: "", - buy_amount: data.buy_amount, - sell_amount: 0, - buy_sol: buySol, - received_sol: 0, - buy_value_usd: buy_value_usd, - sell_value_usd: 0, - profit_usd: 0, - profit_percent: 0, - buy_market_cap: - processedData.dexScreenerData.pairs[0]?.marketCap || 0, - sell_market_cap: 0, - market_cap_change: 0, - buy_liquidity: - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0, - sell_liquidity: 0, - liquidity_change: 0, - last_updated: new Date().toISOString(), - rapidDump: false, - }; - this.trustScoreDb.addTradePerformance(creationData, data.is_simulation); - // generate unique uuid for each TokenRecommendation - const tokenUUId = uuidv4(); - const tokenRecommendation: TokenRecommendation = { - id: tokenUUId, - recommenderId: recommenderId, - tokenAddress: tokenAddress, - timestamp: new Date(), - initialMarketCap: - processedData.dexScreenerData.pairs[0]?.marketCap || 0, - initialLiquidity: - processedData.dexScreenerData.pairs[0]?.liquidity?.usd || 0, - initialPrice: processedData.tradeData.price, - }; - this.trustScoreDb.addTokenRecommendation(tokenRecommendation); - - this.trustScoreDb.upsertTokenPerformance({ - tokenAddress: tokenAddress, - symbol: processedData.tokenCodex.symbol, - priceChange24h: processedData.tradeData.price_change_24h_percent, - volumeChange24h: processedData.tradeData.volume_24h, - trade_24h_change: processedData.tradeData.trade_24h_change_percent, - liquidity: - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0, - liquidityChange24h: 0, - holderChange24h: - processedData.tradeData.unique_wallet_24h_change_percent, - rugPull: false, - isScam: tokenCodex.isScam, - marketCapChange24h: 0, - sustainedGrowth: false, - rapidDump: false, - suspiciousVolume: false, - validationTrust: 0, - balance: tokensBalance, - initialMarketCap: - processedData.dexScreenerData.pairs[0]?.marketCap || 0, - lastUpdated: new Date(), - }); - - if (data.is_simulation) { - // If the trade is a simulation update the balance - this.trustScoreDb.updateTokenBalance(tokenAddress, tokensBalance); - // generate some random hash for simulations - const hash = Math.random().toString(36).substring(7); - const transaction = { - tokenAddress: tokenAddress, - type: "buy" as "buy" | "sell", - transactionHash: hash, - amount: data.buy_amount, - price: processedData.tradeData.price, - isSimulation: true, - timestamp: new Date().toISOString(), - }; - this.trustScoreDb.addTransaction(transaction); - } - this.simulationSellingService.processTokenPerformance( - tokenAddress, - recommenderId - ); - // api call to update trade performance - this.createTradeInBe(tokenAddress, recommenderId, data); - return creationData; - } - - async delay(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - async createTradeInBe( - tokenAddress: string, - recommenderId: string, - data: TradeData, - retries = 3, - delayMs = 2000 - ) { - for (let attempt = 1; attempt <= retries; attempt++) { - try { - await fetch( - `${this.backend}/api/updaters/createTradePerformance`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${this.backendToken}`, - }, - body: JSON.stringify({ - tokenAddress: tokenAddress, - tradeData: data, - recommenderId: recommenderId, - }), - } - ); - // If the request is successful, exit the loop - return; - } catch (error) { - console.error( - `Attempt ${attempt} failed: Error creating trade in backend`, - error - ); - if (attempt < retries) { - console.log(`Retrying in ${delayMs} ms...`); - await this.delay(delayMs); // Wait for the specified delay before retrying - } else { - console.error("All attempts failed."); - } - } - } - } - - /** - * Updates a trade with sell details. - * @param tokenAddress The address of the token. - * @param recommenderId The UUID of the recommender. - * @param buyTimeStamp The timestamp when the buy occurred. - * @param sellDetails An object containing sell-related details. - * @param isSimulation Whether the trade is a simulation. If true, updates in simulation_trade; otherwise, in trade. - * @returns boolean indicating success. - */ - - async updateSellDetails( - runtime: IAgentRuntime, - tokenAddress: string, - recommenderId: string, - sellTimeStamp: string, - sellDetails: sellDetails, - isSimulation: boolean - ) { - const recommender = - await this.trustScoreDb.getOrCreateRecommenderWithTelegramId( - recommenderId - ); - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - const wallet = new WalletProvider( - this.connection, - new PublicKey(Wallet!) - ); - const prices = await wallet.fetchPrices(runtime); - const solPrice = prices.solana.usd; - const sellSol = sellDetails.sell_amount / parseFloat(solPrice); - const sell_value_usd = - sellDetails.sell_amount * processedData.tradeData.price; - const trade = await this.trustScoreDb.getLatestTradePerformance( - tokenAddress, - recommender.id, - isSimulation - ); - const buyTimeStamp = trade.buy_timeStamp; - const marketCap = - processedData.dexScreenerData.pairs[0]?.marketCap || 0; - const liquidity = - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0; - const sell_price = processedData.tradeData.price; - const profit_usd = sell_value_usd - trade.buy_value_usd; - const profit_percent = (profit_usd / trade.buy_value_usd) * 100; - - const market_cap_change = marketCap - trade.buy_market_cap; - const liquidity_change = liquidity - trade.buy_liquidity; - - const isRapidDump = await this.isRapidDump(tokenAddress); - - const sellDetailsData = { - sell_price: sell_price, - sell_timeStamp: sellTimeStamp, - sell_amount: sellDetails.sell_amount, - received_sol: sellSol, - sell_value_usd: sell_value_usd, - profit_usd: profit_usd, - profit_percent: profit_percent, - sell_market_cap: marketCap, - market_cap_change: market_cap_change, - sell_liquidity: liquidity, - liquidity_change: liquidity_change, - rapidDump: isRapidDump, - sell_recommender_id: sellDetails.sell_recommender_id || null, - }; - this.trustScoreDb.updateTradePerformanceOnSell( - tokenAddress, - recommender.id, - buyTimeStamp, - sellDetailsData, - isSimulation - ); - if (isSimulation) { - // If the trade is a simulation update the balance - const oldBalance = this.trustScoreDb.getTokenBalance(tokenAddress); - const tokenBalance = oldBalance - sellDetails.sell_amount; - this.trustScoreDb.updateTokenBalance(tokenAddress, tokenBalance); - // generate some random hash for simulations - const hash = Math.random().toString(36).substring(7); - const transaction = { - tokenAddress: tokenAddress, - type: "sell" as "buy" | "sell", - transactionHash: hash, - amount: sellDetails.sell_amount, - price: processedData.tradeData.price, - isSimulation: true, - timestamp: new Date().toISOString(), - }; - this.trustScoreDb.addTransaction(transaction); - } - - return sellDetailsData; - } - - // get all recommendations - async getRecommendations( - startDate: Date, - endDate: Date - ): Promise> { - const recommendations = this.trustScoreDb.getRecommendationsByDateRange( - startDate, - endDate - ); - - // Group recommendations by tokenAddress - const groupedRecommendations = recommendations.reduce( - (acc, recommendation) => { - const { tokenAddress } = recommendation; - if (!acc[tokenAddress]) acc[tokenAddress] = []; - acc[tokenAddress].push(recommendation); - return acc; - }, - {} as Record> - ); - - const result = Object.keys(groupedRecommendations).map( - (tokenAddress) => { - const tokenRecommendations = - groupedRecommendations[tokenAddress]; - - // Initialize variables to compute averages - let totalTrustScore = 0; - let totalRiskScore = 0; - let totalConsistencyScore = 0; - const recommenderData = []; - - tokenRecommendations.forEach((recommendation) => { - const tokenPerformance = - this.trustScoreDb.getTokenPerformance( - recommendation.tokenAddress - ); - const recommenderMetrics = - this.trustScoreDb.getRecommenderMetrics( - recommendation.recommenderId - ); - - const trustScore = this.calculateTrustScore( - tokenPerformance, - recommenderMetrics - ); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - const riskScore = this.calculateRiskScore(tokenPerformance); - - // Accumulate scores for averaging - totalTrustScore += trustScore; - totalRiskScore += riskScore; - totalConsistencyScore += consistencyScore; - - recommenderData.push({ - recommenderId: recommendation.recommenderId, - trustScore, - riskScore, - consistencyScore, - recommenderMetrics, - }); - }); - - // Calculate averages for this token - const averageTrustScore = - totalTrustScore / tokenRecommendations.length; - const averageRiskScore = - totalRiskScore / tokenRecommendations.length; - const averageConsistencyScore = - totalConsistencyScore / tokenRecommendations.length; - - return { - tokenAddress, - averageTrustScore, - averageRiskScore, - averageConsistencyScore, - recommenders: recommenderData, - }; - } - ); - - // Sort recommendations by the highest average trust score - result.sort((a, b) => b.averageTrustScore - a.averageTrustScore); - - return result; - } -} - -export const trustScoreProvider: Provider = { - async get( - runtime: IAgentRuntime, - message: Memory, - _state?: State - ): Promise { - try { - const trustScoreDb = new TrustScoreDatabase( - runtime.databaseAdapter.db - ); - - // Get the user ID from the message - const userId = message.userId; - - if (!userId) { - console.error("User ID is missing from the message"); - return ""; - } - - // Get the recommender metrics for the user - const recommenderMetrics = - await trustScoreDb.getRecommenderMetrics(userId); - - if (!recommenderMetrics) { - console.error("No recommender metrics found for user:", userId); - return ""; - } - - // Compute the trust score - const trustScore = recommenderMetrics.trustScore; - - const user = await runtime.databaseAdapter.getAccountById(userId); - - // Format the trust score string - const trustScoreString = `${user.name}'s trust score: ${trustScore.toFixed(2)}`; - - return trustScoreString; - } catch (error) { - console.error("Error in trust score provider:", error.message); - return `Failed to fetch trust score: ${error instanceof Error ? error.message : "Unknown error"}`; - } - }, -}; diff --git a/packages/plugin-solana/src/providers/wallet.ts b/packages/plugin-solana/src/providers/wallet.ts deleted file mode 100644 index e712aabe69f..00000000000 --- a/packages/plugin-solana/src/providers/wallet.ts +++ /dev/null @@ -1,394 +0,0 @@ -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { Connection, PublicKey } from "@solana/web3.js"; -import BigNumber from "bignumber.js"; -import NodeCache from "node-cache"; -import { getWalletKey } from "../keypairUtils"; - -// Provider configuration -const PROVIDER_CONFIG = { - BIRDEYE_API: "https://public-api.birdeye.so", - MAX_RETRIES: 3, - RETRY_DELAY: 2000, - DEFAULT_RPC: "https://api.mainnet-beta.solana.com", - GRAPHQL_ENDPOINT: "https://graph.codex.io/graphql", - TOKEN_ADDRESSES: { - SOL: "So11111111111111111111111111111111111111112", - BTC: "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", - ETH: "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", - }, -}; - -export interface Item { - name: string; - address: string; - symbol: string; - decimals: number; - balance: string; - uiAmount: string; - priceUsd: string; - valueUsd: string; - valueSol?: string; -} - -interface WalletPortfolio { - totalUsd: string; - totalSol?: string; - items: Array; -} - -interface _BirdEyePriceData { - data: { - [key: string]: { - price: number; - priceChange24h: number; - }; - }; -} - -interface Prices { - solana: { usd: string }; - bitcoin: { usd: string }; - ethereum: { usd: string }; -} - -export class WalletProvider { - private cache: NodeCache; - - constructor( - private connection: Connection, - private walletPublicKey: PublicKey - ) { - this.cache = new NodeCache({ stdTTL: 300 }); // Cache TTL set to 5 minutes - } - - private async fetchWithRetry( - runtime, - url: string, - options: RequestInit = {} - ): Promise { - let lastError: Error; - - for (let i = 0; i < PROVIDER_CONFIG.MAX_RETRIES; i++) { - try { - const response = await fetch(url, { - ...options, - headers: { - Accept: "application/json", - "x-chain": "solana", - "X-API-KEY": - runtime.getSetting("BIRDEYE_API_KEY", "") || "", - ...options.headers, - }, - }); - - if (!response.ok) { - const errorText = await response.text(); - throw new Error( - `HTTP error! status: ${response.status}, message: ${errorText}` - ); - } - - const data = await response.json(); - return data; - } catch (error) { - console.error(`Attempt ${i + 1} failed:`, error); - lastError = error; - if (i < PROVIDER_CONFIG.MAX_RETRIES - 1) { - const delay = PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i); - await new Promise((resolve) => setTimeout(resolve, delay)); - continue; - } - } - } - - console.error( - "All attempts failed. Throwing the last error:", - lastError - ); - throw lastError; - } - - async fetchPortfolioValue(runtime): Promise { - try { - const cacheKey = `portfolio-${this.walletPublicKey.toBase58()}`; - const cachedValue = this.cache.get(cacheKey); - - if (cachedValue) { - console.log("Cache hit for fetchPortfolioValue"); - return cachedValue; - } - console.log("Cache miss for fetchPortfolioValue"); - - const walletData = await this.fetchWithRetry( - runtime, - `${PROVIDER_CONFIG.BIRDEYE_API}/v1/wallet/token_list?wallet=${this.walletPublicKey.toBase58()}` - ); - - if (!walletData?.success || !walletData?.data) { - console.error("No portfolio data available", walletData); - throw new Error("No portfolio data available"); - } - - const data = walletData.data; - const totalUsd = new BigNumber(data.totalUsd.toString()); - const prices = await this.fetchPrices(runtime); - const solPriceInUSD = new BigNumber(prices.solana.usd.toString()); - - const items = data.items.map((item: any) => ({ - ...item, - valueSol: new BigNumber(item.valueUsd || 0) - .div(solPriceInUSD) - .toFixed(6), - name: item.name || "Unknown", - symbol: item.symbol || "Unknown", - priceUsd: item.priceUsd || "0", - valueUsd: item.valueUsd || "0", - })); - - const totalSol = totalUsd.div(solPriceInUSD); - const portfolio = { - totalUsd: totalUsd.toString(), - totalSol: totalSol.toFixed(6), - items: items.sort((a, b) => - new BigNumber(b.valueUsd) - .minus(new BigNumber(a.valueUsd)) - .toNumber() - ), - }; - this.cache.set(cacheKey, portfolio); - return portfolio; - } catch (error) { - console.error("Error fetching portfolio:", error); - throw error; - } - } - - async fetchPortfolioValueCodex(runtime): Promise { - try { - const cacheKey = `portfolio-${this.walletPublicKey.toBase58()}`; - const cachedValue = await this.cache.get(cacheKey); - - if (cachedValue) { - console.log("Cache hit for fetchPortfolioValue"); - return cachedValue; - } - console.log("Cache miss for fetchPortfolioValue"); - - const query = ` - query Balances($walletId: String!, $cursor: String) { - balances(input: { walletId: $walletId, cursor: $cursor }) { - cursor - items { - walletId - tokenId - balance - shiftedBalance - } - } - } - `; - - const variables = { - walletId: `${this.walletPublicKey.toBase58()}:${1399811149}`, - cursor: null, - }; - - const response = await fetch(PROVIDER_CONFIG.GRAPHQL_ENDPOINT, { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: - runtime.getSetting("CODEX_API_KEY", "") || "", - }, - body: JSON.stringify({ - query, - variables, - }), - }).then((res) => res.json()); - - const data = response.data?.data?.balances?.items; - - if (!data || data.length === 0) { - console.error("No portfolio data available", data); - throw new Error("No portfolio data available"); - } - - // Fetch token prices - const prices = await this.fetchPrices(runtime); - const solPriceInUSD = new BigNumber(prices.solana.usd.toString()); - - // Reformat items - const items: Item[] = data.map((item: any) => { - return { - name: "Unknown", - address: item.tokenId.split(":")[0], - symbol: item.tokenId.split(":")[0], - decimals: 6, - balance: item.balance, - uiAmount: item.shiftedBalance.toString(), - priceUsd: "", - valueUsd: "", - valueSol: "", - }; - }); - - // Calculate total portfolio value - const totalUsd = items.reduce( - (sum, item) => sum.plus(new BigNumber(item.valueUsd)), - new BigNumber(0) - ); - - const totalSol = totalUsd.div(solPriceInUSD); - - const portfolio: WalletPortfolio = { - totalUsd: totalUsd.toFixed(6), - totalSol: totalSol.toFixed(6), - items: items.sort((a, b) => - new BigNumber(b.valueUsd) - .minus(new BigNumber(a.valueUsd)) - .toNumber() - ), - }; - - // Cache the portfolio for future requests - await this.cache.set(cacheKey, portfolio, 60 * 1000); // Cache for 1 minute - - return portfolio; - } catch (error) { - console.error("Error fetching portfolio:", error); - throw error; - } - } - - async fetchPrices(runtime): Promise { - try { - const cacheKey = "prices"; - const cachedValue = this.cache.get(cacheKey); - - if (cachedValue) { - console.log("Cache hit for fetchPrices"); - return cachedValue; - } - console.log("Cache miss for fetchPrices"); - - const { SOL, BTC, ETH } = PROVIDER_CONFIG.TOKEN_ADDRESSES; - const tokens = [SOL, BTC, ETH]; - const prices: Prices = { - solana: { usd: "0" }, - bitcoin: { usd: "0" }, - ethereum: { usd: "0" }, - }; - - for (const token of tokens) { - const response = await this.fetchWithRetry( - runtime, - `${PROVIDER_CONFIG.BIRDEYE_API}/defi/price?address=${token}`, - { - headers: { - "x-chain": "solana", - }, - } - ); - - if (response?.data?.value) { - const price = response.data.value.toString(); - prices[ - token === SOL - ? "solana" - : token === BTC - ? "bitcoin" - : "ethereum" - ].usd = price; - } else { - console.warn(`No price data available for token: ${token}`); - } - } - - this.cache.set(cacheKey, prices); - return prices; - } catch (error) { - console.error("Error fetching prices:", error); - throw error; - } - } - - formatPortfolio( - runtime, - portfolio: WalletPortfolio, - prices: Prices - ): string { - let output = `${runtime.character.description}\n`; - output += `Wallet Address: ${this.walletPublicKey.toBase58()}\n\n`; - - const totalUsdFormatted = new BigNumber(portfolio.totalUsd).toFixed(2); - const totalSolFormatted = portfolio.totalSol; - - output += `Total Value: $${totalUsdFormatted} (${totalSolFormatted} SOL)\n\n`; - output += "Token Balances:\n"; - - const nonZeroItems = portfolio.items.filter((item) => - new BigNumber(item.uiAmount).isGreaterThan(0) - ); - - if (nonZeroItems.length === 0) { - output += "No tokens found with non-zero balance\n"; - } else { - for (const item of nonZeroItems) { - const valueUsd = new BigNumber(item.valueUsd).toFixed(2); - output += `${item.name} (${item.symbol}): ${new BigNumber( - item.uiAmount - ).toFixed(6)} ($${valueUsd} | ${item.valueSol} SOL)\n`; - } - } - - output += "\nMarket Prices:\n"; - output += `SOL: $${new BigNumber(prices.solana.usd).toFixed(2)}\n`; - output += `BTC: $${new BigNumber(prices.bitcoin.usd).toFixed(2)}\n`; - output += `ETH: $${new BigNumber(prices.ethereum.usd).toFixed(2)}\n`; - - return output; - } - - async getFormattedPortfolio(runtime): Promise { - try { - const [portfolio, prices] = await Promise.all([ - this.fetchPortfolioValue(runtime), - this.fetchPrices(runtime), - ]); - - return this.formatPortfolio(runtime, portfolio, prices); - } catch (error) { - console.error("Error generating portfolio report:", error); - return "Unable to fetch wallet information. Please try again later."; - } - } -} - -const walletProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State - ): Promise => { - try { - const { publicKey } = await getWalletKey(runtime, false); - - const connection = new Connection( - runtime.getSetting("RPC_URL") || PROVIDER_CONFIG.DEFAULT_RPC - ); - - const provider = new WalletProvider( - connection, - publicKey - ); - - return await provider.getFormattedPortfolio(runtime); - } catch (error) { - console.error("Error in wallet provider:", error); - return null; - } - }, -}; - -// Module exports -export { walletProvider }; diff --git a/packages/plugin-solana/src/tests/token.test.ts b/packages/plugin-solana/src/tests/token.test.ts deleted file mode 100644 index 6b799c1c239..00000000000 --- a/packages/plugin-solana/src/tests/token.test.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { describe, it, expect, beforeEach, vi, afterEach } from "vitest"; -import { TokenProvider } from "../providers/token.ts"; - -// Mock NodeCache -vi.mock("node-cache", () => { - return { - default: vi.fn().mockImplementation(() => ({ - set: vi.fn(), - get: vi.fn().mockReturnValue(null), - })), - }; -}); - -// Mock path module -vi.mock("path", async () => { - const actual = await vi.importActual("path"); - return { - ...(actual as any), - join: vi.fn().mockImplementation((...args) => args.join("/")), - }; -}); - -// Mock the WalletProvider -const mockWalletProvider = { - fetchPortfolioValue: vi.fn(), -}; - -// Mock the ICacheManager -const mockCacheManager = { - get: vi.fn().mockResolvedValue(null), - set: vi.fn(), -}; - -// Mock fetch globally -const mockFetch = vi.fn(); -global.fetch = mockFetch; - -describe("TokenProvider", () => { - let tokenProvider: TokenProvider; - const TEST_TOKEN_ADDRESS = "2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh"; - - beforeEach(() => { - vi.clearAllMocks(); - mockCacheManager.get.mockResolvedValue(null); - - // Create new instance of TokenProvider with mocked dependencies - tokenProvider = new TokenProvider( - TEST_TOKEN_ADDRESS, - mockWalletProvider as any, - mockCacheManager as any - ); - }); - - afterEach(() => { - vi.clearAllTimers(); - }); - - describe("Cache Management", () => { - it("should use cached data when available", async () => { - const mockData = { test: "data" }; - mockCacheManager.get.mockResolvedValueOnce(mockData); - - const result = await (tokenProvider as any).getCachedData( - "test-key" - ); - - expect(result).toEqual(mockData); - expect(mockCacheManager.get).toHaveBeenCalledTimes(1); - }); - - it("should write data to both caches", async () => { - const testData = { test: "data" }; - - await (tokenProvider as any).setCachedData("test-key", testData); - - expect(mockCacheManager.set).toHaveBeenCalledWith( - expect.stringContaining("test-key"), - testData, - expect.any(Object) - ); - }); - }); - - describe("Wallet Integration", () => { - it("should fetch tokens in wallet", async () => { - const mockItems = [ - { symbol: "SOL", address: "address1" }, - { symbol: "BTC", address: "address2" }, - ]; - - mockWalletProvider.fetchPortfolioValue.mockResolvedValueOnce({ - items: mockItems, - }); - - const result = await tokenProvider.getTokensInWallet({} as any); - - expect(result).toEqual(mockItems); - expect( - mockWalletProvider.fetchPortfolioValue - ).toHaveBeenCalledTimes(1); - }); - - it("should find token in wallet by symbol", async () => { - const mockItems = [ - { symbol: "SOL", address: "address1" }, - { symbol: "BTC", address: "address2" }, - ]; - - mockWalletProvider.fetchPortfolioValue.mockResolvedValueOnce({ - items: mockItems, - }); - - const result = await tokenProvider.getTokenFromWallet( - {} as any, - "SOL" - ); - - expect(result).toBe("address1"); - }); - - it("should return null for token not in wallet", async () => { - mockWalletProvider.fetchPortfolioValue.mockResolvedValueOnce({ - items: [], - }); - - const result = await tokenProvider.getTokenFromWallet( - {} as any, - "NONEXISTENT" - ); - - expect(result).toBeNull(); - }); - }); -}); diff --git a/packages/plugin-solana/src/types/token.ts b/packages/plugin-solana/src/types/token.ts deleted file mode 100644 index 1fca4c37c32..00000000000 --- a/packages/plugin-solana/src/types/token.ts +++ /dev/null @@ -1,302 +0,0 @@ -export interface TokenSecurityData { - ownerBalance: string; - creatorBalance: string; - ownerPercentage: number; - creatorPercentage: number; - top10HolderBalance: string; - top10HolderPercent: number; -} - -export interface TokenCodex { - id: string; - address: string; - cmcId: number; - decimals: number; - name: string; - symbol: string; - totalSupply: string; - circulatingSupply: string; - imageThumbUrl: string; - blueCheckmark: boolean; - isScam: boolean; -} - -export interface TokenTradeData { - address: string; - holder: number; - market: number; - last_trade_unix_time: number; - last_trade_human_time: string; - price: number; - history_30m_price: number; - price_change_30m_percent: number; - history_1h_price: number; - price_change_1h_percent: number; - history_2h_price: number; - price_change_2h_percent: number; - history_4h_price: number; - price_change_4h_percent: number; - history_6h_price: number; - price_change_6h_percent: number; - history_8h_price: number; - price_change_8h_percent: number; - history_12h_price: number; - price_change_12h_percent: number; - history_24h_price: number; - price_change_24h_percent: number; - unique_wallet_30m: number; - unique_wallet_history_30m: number; - unique_wallet_30m_change_percent: number; - unique_wallet_1h: number; - unique_wallet_history_1h: number; - unique_wallet_1h_change_percent: number; - unique_wallet_2h: number; - unique_wallet_history_2h: number; - unique_wallet_2h_change_percent: number; - unique_wallet_4h: number; - unique_wallet_history_4h: number; - unique_wallet_4h_change_percent: number; - unique_wallet_8h: number; - unique_wallet_history_8h: number | null; - unique_wallet_8h_change_percent: number | null; - unique_wallet_24h: number; - unique_wallet_history_24h: number | null; - unique_wallet_24h_change_percent: number | null; - trade_30m: number; - trade_history_30m: number; - trade_30m_change_percent: number; - sell_30m: number; - sell_history_30m: number; - sell_30m_change_percent: number; - buy_30m: number; - buy_history_30m: number; - buy_30m_change_percent: number; - volume_30m: number; - volume_30m_usd: number; - volume_history_30m: number; - volume_history_30m_usd: number; - volume_30m_change_percent: number; - volume_buy_30m: number; - volume_buy_30m_usd: number; - volume_buy_history_30m: number; - volume_buy_history_30m_usd: number; - volume_buy_30m_change_percent: number; - volume_sell_30m: number; - volume_sell_30m_usd: number; - volume_sell_history_30m: number; - volume_sell_history_30m_usd: number; - volume_sell_30m_change_percent: number; - trade_1h: number; - trade_history_1h: number; - trade_1h_change_percent: number; - sell_1h: number; - sell_history_1h: number; - sell_1h_change_percent: number; - buy_1h: number; - buy_history_1h: number; - buy_1h_change_percent: number; - volume_1h: number; - volume_1h_usd: number; - volume_history_1h: number; - volume_history_1h_usd: number; - volume_1h_change_percent: number; - volume_buy_1h: number; - volume_buy_1h_usd: number; - volume_buy_history_1h: number; - volume_buy_history_1h_usd: number; - volume_buy_1h_change_percent: number; - volume_sell_1h: number; - volume_sell_1h_usd: number; - volume_sell_history_1h: number; - volume_sell_history_1h_usd: number; - volume_sell_1h_change_percent: number; - trade_2h: number; - trade_history_2h: number; - trade_2h_change_percent: number; - sell_2h: number; - sell_history_2h: number; - sell_2h_change_percent: number; - buy_2h: number; - buy_history_2h: number; - buy_2h_change_percent: number; - volume_2h: number; - volume_2h_usd: number; - volume_history_2h: number; - volume_history_2h_usd: number; - volume_2h_change_percent: number; - volume_buy_2h: number; - volume_buy_2h_usd: number; - volume_buy_history_2h: number; - volume_buy_history_2h_usd: number; - volume_buy_2h_change_percent: number; - volume_sell_2h: number; - volume_sell_2h_usd: number; - volume_sell_history_2h: number; - volume_sell_history_2h_usd: number; - volume_sell_2h_change_percent: number; - trade_4h: number; - trade_history_4h: number; - trade_4h_change_percent: number; - sell_4h: number; - sell_history_4h: number; - sell_4h_change_percent: number; - buy_4h: number; - buy_history_4h: number; - buy_4h_change_percent: number; - volume_4h: number; - volume_4h_usd: number; - volume_history_4h: number; - volume_history_4h_usd: number; - volume_4h_change_percent: number; - volume_buy_4h: number; - volume_buy_4h_usd: number; - volume_buy_history_4h: number; - volume_buy_history_4h_usd: number; - volume_buy_4h_change_percent: number; - volume_sell_4h: number; - volume_sell_4h_usd: number; - volume_sell_history_4h: number; - volume_sell_history_4h_usd: number; - volume_sell_4h_change_percent: number; - trade_8h: number; - trade_history_8h: number | null; - trade_8h_change_percent: number | null; - sell_8h: number; - sell_history_8h: number | null; - sell_8h_change_percent: number | null; - buy_8h: number; - buy_history_8h: number | null; - buy_8h_change_percent: number | null; - volume_8h: number; - volume_8h_usd: number; - volume_history_8h: number; - volume_history_8h_usd: number; - volume_8h_change_percent: number | null; - volume_buy_8h: number; - volume_buy_8h_usd: number; - volume_buy_history_8h: number; - volume_buy_history_8h_usd: number; - volume_buy_8h_change_percent: number | null; - volume_sell_8h: number; - volume_sell_8h_usd: number; - volume_sell_history_8h: number; - volume_sell_history_8h_usd: number; - volume_sell_8h_change_percent: number | null; - trade_24h: number; - trade_history_24h: number; - trade_24h_change_percent: number | null; - sell_24h: number; - sell_history_24h: number; - sell_24h_change_percent: number | null; - buy_24h: number; - buy_history_24h: number; - buy_24h_change_percent: number | null; - volume_24h: number; - volume_24h_usd: number; - volume_history_24h: number; - volume_history_24h_usd: number; - volume_24h_change_percent: number | null; - volume_buy_24h: number; - volume_buy_24h_usd: number; - volume_buy_history_24h: number; - volume_buy_history_24h_usd: number; - volume_buy_24h_change_percent: number | null; - volume_sell_24h: number; - volume_sell_24h_usd: number; - volume_sell_history_24h: number; - volume_sell_history_24h_usd: number; - volume_sell_24h_change_percent: number | null; -} - -export interface HolderData { - address: string; - balance: string; -} - -export interface ProcessedTokenData { - security: TokenSecurityData; - tradeData: TokenTradeData; - holderDistributionTrend: string; // 'increasing' | 'decreasing' | 'stable' - highValueHolders: Array<{ - holderAddress: string; - balanceUsd: string; - }>; - recentTrades: boolean; - highSupplyHoldersCount: number; - dexScreenerData: DexScreenerData; - - isDexScreenerListed: boolean; - isDexScreenerPaid: boolean; - tokenCodex: TokenCodex; -} - -export interface DexScreenerPair { - chainId: string; - dexId: string; - url: string; - pairAddress: string; - baseToken: { - address: string; - name: string; - symbol: string; - }; - quoteToken: { - address: string; - name: string; - symbol: string; - }; - priceNative: string; - priceUsd: string; - txns: { - m5: { buys: number; sells: number }; - h1: { buys: number; sells: number }; - h6: { buys: number; sells: number }; - h24: { buys: number; sells: number }; - }; - volume: { - h24: number; - h6: number; - h1: number; - m5: number; - }; - priceChange: { - m5: number; - h1: number; - h6: number; - h24: number; - }; - liquidity: { - usd: number; - base: number; - quote: number; - }; - fdv: number; - marketCap: number; - pairCreatedAt: number; - info: { - imageUrl: string; - websites: { label: string; url: string }[]; - socials: { type: string; url: string }[]; - }; - boosts: { - active: number; - }; -} - -export interface DexScreenerData { - schemaVersion: string; - pairs: DexScreenerPair[]; -} - -export interface Prices { - solana: { usd: string }; - bitcoin: { usd: string }; - ethereum: { usd: string }; -} - -export interface CalculatedBuyAmounts { - none: 0; - low: number; - medium: number; - high: number; -} diff --git a/packages/plugin-solana/tsconfig.json b/packages/plugin-solana/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/plugin-solana/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-solana/tsup.config.ts b/packages/plugin-solana/tsup.config.ts deleted file mode 100644 index dd25475bb63..00000000000 --- a/packages/plugin-solana/tsup.config.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "safe-buffer", - "base-x", - "bs58", - "borsh", - "@solana/buffer-layout", - "stream", - "buffer", - "querystring", - "amqplib", - // Add other modules you want to externalize - ], -}); diff --git a/packages/plugin-starknet/.npmignore b/packages/plugin-starknet/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-starknet/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-starknet/eslint.config.mjs b/packages/plugin-starknet/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-starknet/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-starknet/package.json b/packages/plugin-starknet/package.json deleted file mode 100644 index 39a651ce02a..00000000000 --- a/packages/plugin-starknet/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@ai16z/plugin-starknet", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@ai16z/plugin-trustdb": "workspace:*", - "@avnu/avnu-sdk": "2.1.1", - "@uniswap/sdk-core": "6.0.0", - "@unruggable_starknet/core": "0.1.0", - "starknet": "6.18.0", - "tsup": "8.3.5", - "vitest": "2.1.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest", - "lint": "eslint . --fix" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-starknet/readme.md b/packages/plugin-starknet/readme.md deleted file mode 100644 index 799d6592ab4..00000000000 --- a/packages/plugin-starknet/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# Starknet Plugin - -## Overview - -This plugin aims to be the basis of all interactions with the Starknet ecosystem. It contains utilities along with actions for DeFi protocols. - -## Adding a new action - -Reuse providers and utilities from the existing actions where possible. Add more utilities if you think they will be useful for other actions. - -1. Add the action to the `actions` directory. Try to follow the naming convention of the other actions. -2. Export the action in the `index.ts` file. - -## TODO: - -1. Ekubo DCA -2. Unruggable diff --git a/packages/plugin-starknet/src/actions/generate.ts b/packages/plugin-starknet/src/actions/generate.ts deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/plugin-starknet/src/actions/takeOrder.ts b/packages/plugin-starknet/src/actions/takeOrder.ts deleted file mode 100644 index c2986ae73c6..00000000000 --- a/packages/plugin-starknet/src/actions/takeOrder.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { - Action, - ActionExample, - composeContext, - Content, - generateText, - IAgentRuntime, - Memory, - ModelClass, - settings, -} from "@ai16z/eliza"; -import * as fs from "fs"; -import { validateStarknetConfig } from "../environment"; - -interface Order { - userId: string; - ticker: string; - contractAddress: string; - timestamp: string; - buyAmount: number; - price: number; -} - -const template = ` - -// CLAUDE TODO: Put the usual conversation context here - -Ticker is: {{ticker}} -Contract address is: {{contractAddress}} - -Determine if the user is trying to shill the ticker. if they are, respond with empty conviction, ticker and contractAddress. - -// CLAUDE TODO: output a JSON block with the following fields: -// - reasoning: string -// - conviction: negative, low, medium, high -// - ticker: string (extract from CA so we have context) -// - contractAddress: string -`; - -const take_order: Action = { - name: "TAKE_STARKNET_ORDER", - similes: ["BUY_STARKNET_ORDER", "PLACE_STARKNET_ORDER"], - description: - "Records a starknet buy order based on the user's conviction level.", - validate: async (runtime: IAgentRuntime, message: Memory) => { - await validateStarknetConfig(runtime); - - const text = (message.content as Content).text; - // Check if the message contains a ticker symbol - const tickerRegex = /\b[A-Z]{1,5}\b/g; - return tickerRegex.test(text); - }, - handler: async (runtime: IAgentRuntime, message: Memory) => { - const _text = (message.content as Content).text; - const userId = message.userId; - - let ticker, contractAddress; - - // TODO: - - // 1. create state object with runtime.composeState - // 2. compose context with template and state - // 3. get generateText - // 4. validate generateText - - // if ticker or contractAddress are empty, return a message asking for them - if (!ticker || !contractAddress) { - return { - text: "Ticker and CA?", - }; - } - - const state = await runtime.composeState(message); - // TODO: compose context properly - const context = composeContext({ - state: { - ...state, - ticker, - contractAddress, - }, - template, - }); - - const convictionResponse = await generateText({ - runtime, - context: context, - modelClass: ModelClass.LARGE, - }); - - // TODOL parse and validate the JSON - const convictionResponseJson = JSON.parse(convictionResponse); // TODO: replace with validate like other actions - - // get the conviction - const conviction = convictionResponseJson.conviction; - - let buyAmount = 0; - if (conviction === "low") { - buyAmount = 20; - } else if (conviction === "medium") { - buyAmount = 50; - } else if (conviction === "high") { - buyAmount = 100; - } - - // Get the current price of the asset (replace with actual price fetching logic) - const currentPrice = 100; - - const order: Order = { - userId, - ticker: ticker || "", - contractAddress, - timestamp: new Date().toISOString(), - buyAmount, - price: currentPrice, - }; - - // Read the existing order book from the JSON file - const orderBookPath = settings.orderBookPath; - let orderBook: Order[] = []; - if (fs.existsSync(orderBookPath)) { - const orderBookData = fs.readFileSync(orderBookPath, "utf-8"); - orderBook = JSON.parse(orderBookData); - } - - // Add the new order to the order book - orderBook.push(order); - - // Write the updated order book back to the JSON file - fs.writeFileSync(orderBookPath, JSON.stringify(orderBook, null, 2)); - - return { - text: `Recorded a ${conviction} conviction buy order for ${ticker} (${contractAddress}) with an amount of ${buyAmount} at the price of ${currentPrice}.`, - }; - }, - examples: [] as ActionExample[][], -} as Action; - -export default take_order; diff --git a/packages/plugin-starknet/src/environment.ts b/packages/plugin-starknet/src/environment.ts deleted file mode 100644 index 93fb7ca660a..00000000000 --- a/packages/plugin-starknet/src/environment.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { IAgentRuntime } from "@ai16z/eliza"; -import { z } from "zod"; - -const STARKNET_PUBLIC_RPC = "https://starknet-mainnet.public.blastapi.io"; - -export const starknetEnvSchema = z.object({ - STARKNET_ADDRESS: z.string().min(1, "Starknet address is required"), - STARKNET_PRIVATE_KEY: z.string().min(1, "Starknet private key is required"), - STARKNET_RPC_URL: z.string().min(1, "Starknet RPC URL is required"), -}); - -export type StarknetConfig = z.infer; - -export async function validateStarknetConfig( - runtime: IAgentRuntime -): Promise { - try { - const config = { - STARKNET_ADDRESS: - runtime.getSetting("STARKNET_ADDRESS") || - process.env.STARKNET_ADDRESS, - STARKNET_PRIVATE_KEY: - runtime.getSetting("STARKNET_PRIVATE_KEY") || - process.env.STARKNET_PRIVATE_KEY, - STARKNET_RPC_URL: - runtime.getSetting("STARKNET_RPC_URL") || - process.env.STARKNET_RPC_URL || - STARKNET_PUBLIC_RPC, - }; - - return starknetEnvSchema.parse(config); - } catch (error) { - if (error instanceof z.ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `Starknet configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/plugin-starknet/src/index.ts b/packages/plugin-starknet/src/index.ts deleted file mode 100644 index 823fd4c10f7..00000000000 --- a/packages/plugin-starknet/src/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Plugin } from "@ai16z/eliza"; -import { executeSwap } from "./actions/swap"; -import transfer from "./actions/transfer"; -import { deployToken } from "./actions/unruggable"; -import transferSubdomain from "./actions/subdomain"; -export const PROVIDER_CONFIG = { - AVNU_API: "https://starknet.impulse.avnu.fi/v1", - MAX_RETRIES: 3, - RETRY_DELAY: 2000, - TOKEN_ADDRESSES: { - BTC: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac", - ETH: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - STRK: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - }, - TOKEN_SECURITY_ENDPOINT: "/defi/token_security?address=", - TOKEN_TRADE_DATA_ENDPOINT: "/defi/v3/token/trade-data/single?address=", - DEX_SCREENER_API: "https://api.dexscreener.com/latest/dex/tokens/", - MAIN_WALLET: "", -}; - -export const starknetPlugin: Plugin = { - name: "starknet", - description: "Starknet Plugin for Eliza", - actions: [transfer, executeSwap, deployToken, transferSubdomain], - evaluators: [], - providers: [], -}; - -export default starknetPlugin; diff --git a/packages/plugin-starknet/src/providers/portfolioProvider.ts b/packages/plugin-starknet/src/providers/portfolioProvider.ts deleted file mode 100644 index 2434dceaff3..00000000000 --- a/packages/plugin-starknet/src/providers/portfolioProvider.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { - elizaLogger, - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza"; - -import { fetchWithRetry, getStarknetAccount } from "../utils"; -import { ERC20Token } from "../utils/ERC20Token"; -import { PORTFOLIO_TOKENS } from "./token.ts"; - -type CoingeckoPrices = { - [cryptoName: string]: { usd: number }; -}; - -type TokenBalances = { - [tokenAddress: string]: bigint; -}; - -export class WalletProvider { - private runtime: IAgentRuntime; - - constructor(runtime: IAgentRuntime) { - this.runtime = runtime; - } - - async getWalletPortfolio(): Promise { - const cacheKey = `walletPortfolio-${this.runtime.agentId}`; - const cachedValues = - await this.runtime.cacheManager.get(cacheKey); - if (cachedValues) { - elizaLogger.debug("Using cached data for getWalletPortfolio()"); - return cachedValues; - } - - const starknetAccount = getStarknetAccount(this.runtime); - const balances: TokenBalances = {}; - - // reading balances sequentially to prevent API issues - for (const token of Object.values(PORTFOLIO_TOKENS)) { - const erc20 = new ERC20Token(token.address, starknetAccount); - const balance = await erc20.balanceOf(starknetAccount.address); - balances[token.address] = balance; - } - - await this.runtime.cacheManager.set(cacheKey, balances, { - expires: Date.now() + 180 * 60 * 1000, // 3 hours cache - }); - - return balances; - } - - async getTokenUsdValues(): Promise { - const cacheKey = "tokenUsdValues"; - const cachedValues = - await this.runtime.cacheManager.get(cacheKey); - if (cachedValues) { - elizaLogger.debug("Using cached data for getTokenUsdValues()"); - return cachedValues; - } - - const coingeckoIds = Object.values(PORTFOLIO_TOKENS) - .map((token) => token.coingeckoId) - .join(","); - - const coingeckoPrices = await fetchWithRetry( - `https://api.coingecko.com/api/v3/simple/price?ids=${coingeckoIds}&vs_currencies=usd` - ); - - await this.runtime.cacheManager.set(cacheKey, coingeckoPrices, { - expires: Date.now() + 30 * 60 * 1000, // 30 minutes cache - }); - - return coingeckoPrices; - } -} - -const walletProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State - ): Promise => { - const provider = new WalletProvider(runtime); - let walletPortfolio: TokenBalances | null = null; - let tokenUsdValues: CoingeckoPrices | null = null; - - try { - walletPortfolio = await provider.getWalletPortfolio(); - tokenUsdValues = await provider.getTokenUsdValues(); - } catch (error) { - elizaLogger.error("Error in walletProvider.get():", error); - return "Unable to fetch wallet portfolio. Please try again later."; - } - - const rows = Object.entries(PORTFOLIO_TOKENS) - .map(([symbol, token]) => { - const rawBalance = walletPortfolio[token.address]; - if (rawBalance === undefined) return null; - - const decimalBalance = - Number(rawBalance) / Math.pow(10, token.decimals); - const price = tokenUsdValues[token.coingeckoId]?.usd ?? 0; - const usdValue = decimalBalance * price; - - if (decimalBalance === 0 && usdValue === 0) return null; - - return `${symbol.padEnd(9)}| ${decimalBalance - .toFixed(18) - .replace(/\.?0+$/, "") - .padEnd(20)}| ${usdValue.toFixed(2)}`; - }) - .filter((row): row is string => row !== null); - - const header = "symbol | balance | USD value"; - const separator = "=================================================="; - return [header, separator, ...rows].join("\n"); - }, -}; - -export { walletProvider }; diff --git a/packages/plugin-starknet/src/providers/token.ts b/packages/plugin-starknet/src/providers/token.ts deleted file mode 100644 index f52d7c07b83..00000000000 --- a/packages/plugin-starknet/src/providers/token.ts +++ /dev/null @@ -1,875 +0,0 @@ -// THIS IS INCOMPLETE -// Look for the TODOs to see what needs to be updated - -import { settings } from "@ai16z/eliza"; -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { - DexScreenerData, - DexScreenerPair, - HolderData, - ProcessedTokenData, - TokenSecurityData, - CalculatedBuyAmounts, - Prices, -} from "../types/trustDB.ts"; -import { WalletProvider, Item } from "./walletProvider.ts"; -import { num } from "starknet"; -import { - analyzeHighSupplyHolders, - evaluateTokenTrading, - TokenMetrics, -} from "./utils.ts"; -import { PROVIDER_CONFIG } from "../index.ts"; -import { Cache } from "../utils/cache.ts"; -import { TokenInfo } from "../types/token.ts"; - -export const PORTFOLIO_TOKENS = { - // Coingecko IDs src: - // https://api.coingecko.com/api/v3/coins/list - // https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=0#gid=0 - - BROTHER: { - address: - "0x3b405a98c9e795d427fe82cdeeeed803f221b52471e3a757574a2b4180793ee", - coingeckoId: "starknet-brother", - decimals: 18, - }, - CASH: { - address: - "0x0498edfaf50ca5855666a700c25dd629d577eb9afccdf3b5977aec79aee55ada", - coingeckoId: "opus-cash", - decimals: 18, - }, - ETH: { - address: - "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - coingeckoId: "ethereum", - decimals: 18, - }, - LORDS: { - address: - "0x124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49", - coingeckoId: "lords", - decimals: 18, - }, - STRK: { - address: - "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - coingeckoId: "starknet", - decimals: 18, - }, - USDC: { - address: - "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", - coingeckoId: "usd-coin", - decimals: 6, - }, - USDT: { - address: - "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", - coingeckoId: "tether", - decimals: 6, - }, - WBTC: { - address: - "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac", - coingeckoId: "bitcoin", - decimals: 8, - }, -}; - -export class TokenProvider { - private cache: Cache; - - constructor( - private tokenAddress: string, - private walletProvider: WalletProvider - ) { - this.cache = new Cache(); - } - - // TODO: remove this - private async fetchWithRetry( - url: string, - options: RequestInit = {} - ): Promise { - let lastError: Error; - - for (let i = 0; i < PROVIDER_CONFIG.MAX_RETRIES; i++) { - try { - const response = await fetch(url, { - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - - if (!response.ok) { - throw new Error( - `HTTP error! status: ${ - response.status - }, message: ${await response.text()}` - ); - } - - return await response.json(); - } catch (error) { - console.error(`Request attempt ${i + 1} failed:`, error); - lastError = error as Error; - - if (i < PROVIDER_CONFIG.MAX_RETRIES - 1) { - const delay = PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i); - await new Promise((resolve) => setTimeout(resolve, delay)); - } - } - } - - throw lastError; - } - - // TODO: Update to Starknet - async getTokensInWallet(runtime: IAgentRuntime): Promise { - const walletInfo = - await this.walletProvider.fetchPortfolioValue(runtime); - const items = walletInfo.items; - return items; - } - - // check if the token symbol is in the wallet - async getTokenFromWallet(runtime: IAgentRuntime, tokenSymbol: string) { - try { - const items = await this.getTokensInWallet(runtime); - const token = items.find((item) => item.symbol === tokenSymbol); - - if (token) { - return token.address; - } else { - return null; - } - } catch (error) { - console.error("Error checking token in wallet:", error); - return null; - } - } - - async fetchPrices(): Promise { - try { - const cacheKey = "prices"; - const cachedData = this.cache.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached prices."); - return cachedData; - } - - const { BTC, ETH, STRK } = PROVIDER_CONFIG.TOKEN_ADDRESSES; - const tokens = [BTC, ETH, STRK]; - const prices: Prices = { - starknet: { usd: "0" }, - bitcoin: { usd: "0" }, - ethereum: { usd: "0" }, - }; - - const tokenResponses = await Promise.all( - tokens.map((token) => - fetch(`${PROVIDER_CONFIG.AVNU_API}/tokens/${token}`, { - method: "GET", - headers: {}, - }).then((res) => res.json()) - ) - ); - - tokenResponses.forEach((tokenInfo: TokenInfo, index) => { - if (!tokenInfo.market) { - console.warn( - `No price data available for token: ${tokens[index]}` - ); - return; - } - - const token = tokens[index]; - const priceKey = - token === STRK - ? "starknet" - : token === BTC - ? "bitcoin" - : "ethereum"; - - prices[priceKey].usd = tokenInfo.market.currentPrice.toString(); - }); - - this.cache.setCachedData(cacheKey, prices); - return prices; - } catch (error) { - console.error("Error fetching prices:", error); - throw error; - } - } - - async calculateBuyAmounts(): Promise { - const dexScreenerData = await this.fetchDexScreenerData(); - const prices = await this.fetchPrices(); - const starknetPrice = num.toBigInt(prices.starknet.usd); - - if (!dexScreenerData || dexScreenerData.pairs.length === 0) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - - // Get the first pair - const pair = dexScreenerData.pairs[0]; - const { liquidity, marketCap } = pair; - if (!liquidity || !marketCap) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - - if (liquidity.usd === 0) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - if (marketCap < 100000) { - return { none: 0, low: 0, medium: 0, high: 0 }; - } - - // impact percentages based on liquidity - const impactPercentages = { - LOW: 0.01, // 1% of liquidity - MEDIUM: 0.05, // 5% of liquidity - HIGH: 0.1, // 10% of liquidity - }; - - // Calculate buy amounts in USD - const lowBuyAmountUSD = liquidity.usd * impactPercentages.LOW; - const mediumBuyAmountUSD = liquidity.usd * impactPercentages.MEDIUM; - const highBuyAmountUSD = liquidity.usd * impactPercentages.HIGH; - - // Convert each buy amount to STRK - const lowBuyAmountSTRK = num.toBigInt(lowBuyAmountUSD) / starknetPrice; - const mediumBuyAmountSTRK = - num.toBigInt(mediumBuyAmountUSD) / starknetPrice; - const highBuyAmountSTRK = - num.toBigInt(highBuyAmountUSD) / starknetPrice; - - return { - none: 0, - low: Number(lowBuyAmountSTRK), - medium: Number(mediumBuyAmountSTRK), - high: Number(highBuyAmountSTRK), - }; - } - - // TODO: Update to Starknet - async fetchTokenSecurity(): Promise { - const cacheKey = `tokenSecurity_${this.tokenAddress}`; - const cachedData = - this.cache.getCachedData(cacheKey); - if (cachedData) { - console.log( - `Returning cached token security data for ${this.tokenAddress}.` - ); - return cachedData; - } - // const url = `${PROVIDER_CONFIG.AVNU_API}${PROVIDER_CONFIG.TOKEN_SECURITY_ENDPOINT}${this.tokenAddress}`; - // const data = await this.fetchWithRetry(url); - - // if (!data?.success || !data?.data) { - // throw new Error("No token security data available"); - // } - - // TODO: Update to Starknet - const security: TokenSecurityData = { - ownerBalance: "0", - creatorBalance: "0", - ownerPercentage: 0, - creatorPercentage: 0, - top10HolderBalance: "0", - top10HolderPercent: 0, - }; - this.cache.setCachedData(cacheKey, security); - console.log(`Token security data cached for ${this.tokenAddress}.`); - - return security; - } - - // TODO: Update to Starknet - async fetchTokenTradeData(): Promise { - const cacheKey = `tokenTradeData_${this.tokenAddress}`; - const cachedData = this.cache.getCachedData(cacheKey); - if (cachedData) { - console.log( - `Returning cached token trade data for ${this.tokenAddress}.` - ); - return cachedData; - } - - try { - const response = await fetch( - `${PROVIDER_CONFIG.AVNU_API}/tokens/${this.tokenAddress}`, - { - method: "GET", - headers: {}, - } - ); - - const data = await response.json(); - - if (!data?.success || !data?.data) { - throw new Error("No token trade data available"); - } - - const tradeData: TokenInfo = { - name: data.data.name, - symbol: data.data.symbol, - address: data.data.address, - logoUri: data.data.logoUri, - coingeckoId: data.data.coingeckoId, - verified: data.data.verified, - market: { - currentPrice: data.data.market.currentPrice, - marketCap: data.data.market.marketCap, - fullyDilutedValuation: - data.data.market.fullyDilutedValuation, - starknetTvl: data.data.market.starknetTvl, - priceChange1h: data.data.market.priceChange1h, - priceChangePercentage1h: - data.data.market.priceChangePercentage1h, - priceChange24h: data.data.market.priceChange24h, - priceChangePercentage24h: - data.data.market.priceChangePercentage24h, - priceChange7d: data.data.market.priceChange7d, - priceChangePercentage7d: - data.data.market.priceChangePercentage7d, - marketCapChange24h: data.data.market.marketCapChange24h, - marketCapChangePercentage24h: - data.data.market.marketCapChangePercentage24h, - starknetVolume24h: data.data.market.starknetVolume24h, - starknetTradingVolume24h: - data.data.market.starknetTradingVolume24h, - }, - tags: data.data.tags, - }; - - this.cache.setCachedData(cacheKey, tradeData); - return tradeData; - } catch (error) { - console.error("Error fetching token trade data:", error); - throw error; - } - } - - async fetchDexScreenerData(): Promise { - const cacheKey = `dexScreenerData_${this.tokenAddress}`; - const cachedData = this.cache.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached DexScreener data."); - return cachedData; - } - - const url = `https://api.dexscreener.com/latest/dex/search?q=${this.tokenAddress}`; - try { - console.log( - `Fetching DexScreener data for token: ${this.tokenAddress}` - ); - const data = await fetch(url) - .then((res) => res.json()) - .catch((err) => { - console.error(err); - }); - - if (!data || !data.pairs) { - throw new Error("No DexScreener data available"); - } - - const dexData: DexScreenerData = { - schemaVersion: data.schemaVersion, - pairs: data.pairs, - }; - - // Cache the result - this.cache.setCachedData(cacheKey, dexData); - - return dexData; - } catch (error) { - console.error(`Error fetching DexScreener data:`, error); - return { - schemaVersion: "1.0.0", - pairs: [], - }; - } - } - - async searchDexScreenerData( - symbol: string - ): Promise { - const cacheKey = `dexScreenerData_search_${symbol}`; - const cachedData = this.cache.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached search DexScreener data."); - return this.getHighestLiquidityPair(cachedData); - } - - const url = `https://api.dexscreener.com/latest/dex/search?q=${symbol}`; - try { - console.log(`Fetching DexScreener data for symbol: ${symbol}`); - const data = await fetch(url) - .then((res) => res.json()) - .catch((err) => { - console.error(err); - return null; - }); - - if (!data || !data.pairs || data.pairs.length === 0) { - throw new Error("No DexScreener data available"); - } - - const dexData: DexScreenerData = { - schemaVersion: data.schemaVersion, - pairs: data.pairs, - }; - - // Cache the result - this.cache.setCachedData(cacheKey, dexData); - - // Return the pair with the highest liquidity and market cap - return this.getHighestLiquidityPair(dexData); - } catch (error) { - console.error(`Error fetching DexScreener data:`, error); - return null; - } - } - - getHighestLiquidityPair(dexData: DexScreenerData): DexScreenerPair | null { - if (dexData.pairs.length === 0) { - return null; - } - - // Sort pairs by both liquidity and market cap to get the highest one - return dexData.pairs.sort((a, b) => { - const liquidityDiff = b.liquidity.usd - a.liquidity.usd; - if (liquidityDiff !== 0) { - return liquidityDiff; // Higher liquidity comes first - } - return b.marketCap - a.marketCap; // If liquidity is equal, higher market cap comes first - })[0]; - } - - // TODO: - async analyzeHolderDistribution(_tradeData: TokenInfo): Promise { - // Define the time intervals to consider (e.g., 30m, 1h, 2h) - - // TODO: Update to Starknet - const intervals = [ - { - period: "30m", - change: 0, - }, - { period: "1h", change: 0 }, - { period: "2h", change: 0 }, - { period: "4h", change: 0 }, - { period: "8h", change: 0 }, - { - period: "24h", - change: 0, - }, - ]; - - // Calculate the average change percentage - const validChanges = intervals - .map((interval) => interval.change) - .filter( - (change) => change !== null && change !== undefined - ) as number[]; - - if (validChanges.length === 0) { - return "stable"; - } - - const averageChange = - validChanges.reduce((acc, curr) => acc + curr, 0) / - validChanges.length; - - const increaseThreshold = 10; // e.g., average change > 10% - const decreaseThreshold = -10; // e.g., average change < -10% - - if (averageChange > increaseThreshold) { - return "increasing"; - } else if (averageChange < decreaseThreshold) { - return "decreasing"; - } else { - return "stable"; - } - } - - // TODO: Update to Starknet - async fetchHolderList(): Promise { - const cacheKey = `holderList_${this.tokenAddress}`; - const cachedData = this.cache.getCachedData(cacheKey); - if (cachedData) { - console.log("Returning cached holder list."); - return cachedData; - } - - const allHoldersMap = new Map(); - let page = 1; - const limit = 1000; - let cursor; - //HELIOUS_API_KEY needs to be added - const url = `https://mainnet.helius-rpc.com/?api-key=${ - settings.HELIUS_API_KEY || "" - }`; - console.log({ url }); - - try { - while (true) { - const params = { - limit: limit, - displayOptions: {}, - mint: this.tokenAddress, - cursor: cursor, - }; - if (cursor != undefined) { - params.cursor = cursor; - } - console.log(`Fetching holders - Page ${page}`); - if (page > 2) { - break; - } - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - jsonrpc: "2.0", - id: "helius-test", - method: "getTokenAccounts", - params: params, - }), - }); - - const data = await response.json(); - - if ( - !data || - !data.result || - !data.result.token_accounts || - data.result.token_accounts.length === 0 - ) { - console.log( - `No more holders found. Total pages fetched: ${ - page - 1 - }` - ); - break; - } - - console.log( - `Processing ${data.result.token_accounts.length} holders from page ${page}` - ); - - data.result.token_accounts.forEach((account: any) => { - const owner = account.owner; - const balance = parseFloat(account.amount); - - if (allHoldersMap.has(owner)) { - allHoldersMap.set( - owner, - allHoldersMap.get(owner)! + balance - ); - } else { - allHoldersMap.set(owner, balance); - } - }); - cursor = data.result.cursor; - page++; - } - - const holders: HolderData[] = Array.from( - allHoldersMap.entries() - ).map(([address, balance]) => ({ - address, - balance: balance.toString(), - })); - - console.log(`Total unique holders fetched: ${holders.length}`); - - // Cache the result - this.cache.setCachedData(cacheKey, holders); - - return holders; - } catch (error) { - console.error("Error fetching holder list from Helius:", error); - throw new Error("Failed to fetch holder list from Helius."); - } - } - - async filterHighValueHolders( - tradeData: TokenInfo - ): Promise> { - const holdersData = await this.fetchHolderList(); - - const tokenPriceUsd = num.toBigInt(tradeData.market.currentPrice); - - const highValueHolders = holdersData - .filter((holder) => { - const balanceUsd = num.toBigInt(holder.balance) * tokenPriceUsd; - return balanceUsd > 5; - }) - .map((holder) => ({ - holderAddress: holder.address, - balanceUsd: ( - num.toBigInt(holder.balance) * tokenPriceUsd - ).toString(), - })); - - return highValueHolders; - } - - async checkRecentTrades(volume24hUsd: bigint): Promise { - return volume24hUsd > 0; - } - - async countHighSupplyHolders( - securityData: TokenSecurityData - ): Promise { - try { - const holders = await this.fetchHolderList(); - const result = analyzeHighSupplyHolders({ - holders, - ownerBalance: securityData.ownerBalance, - creatorBalance: securityData.creatorBalance, - }); - - return result.count; - } catch (error) { - console.error("Error counting high supply holders:", error); - return 0; - } - } - - async getProcessedTokenData(): Promise { - try { - console.log( - `Fetching security data for token: ${this.tokenAddress}` - ); - const security = await this.fetchTokenSecurity(); - - console.log(`Fetching trade data for token: ${this.tokenAddress}`); - const tradeData = await this.fetchTokenTradeData(); - - console.log( - `Fetching DexScreener data for token: ${this.tokenAddress}` - ); - const dexData = await this.fetchDexScreenerData(); - - console.log( - `Analyzing holder distribution for token: ${this.tokenAddress}` - ); - const holderDistributionTrend = - await this.analyzeHolderDistribution(tradeData); - - console.log( - `Filtering high-value holders for token: ${this.tokenAddress}` - ); - const highValueHolders = - await this.filterHighValueHolders(tradeData); - - console.log( - `Checking recent trades for token: ${this.tokenAddress}` - ); - const recentTrades = await this.checkRecentTrades( - num.toBigInt(tradeData.market.starknetTradingVolume24h) - ); - - console.log( - `Counting high-supply holders for token: ${this.tokenAddress}` - ); - const highSupplyHoldersCount = - await this.countHighSupplyHolders(security); - - console.log( - `Determining DexScreener listing status for token: ${this.tokenAddress}` - ); - const isDexScreenerListed = dexData.pairs.length > 0; - const isDexScreenerPaid = dexData.pairs.some( - (pair) => pair.boosts && pair.boosts.active > 0 - ); - - const processedData: ProcessedTokenData = { - security, - tradeData, - holderDistributionTrend, - highValueHolders, - recentTrades, - highSupplyHoldersCount, - dexScreenerData: dexData, - isDexScreenerListed, - isDexScreenerPaid, - }; - - // console.log("Processed token data:", processedData); - return processedData; - } catch (error) { - console.error("Error processing token data:", error); - throw error; - } - } - - async shouldTradeToken(): Promise { - try { - const tokenData = await this.getProcessedTokenData(); - const { tradeData, security, dexScreenerData } = tokenData; - const { ownerBalance, creatorBalance } = security; - const { liquidity, marketCap } = dexScreenerData.pairs[0]; - - const totalSupply = - num.toBigInt(ownerBalance) + num.toBigInt(creatorBalance); - - const metrics: TokenMetrics = { - liquidityUsd: num.toBigInt(liquidity.usd), - marketCapUsd: num.toBigInt(marketCap), - totalSupply, - ownerPercentage: - Number(num.toBigInt(ownerBalance)) / Number(totalSupply), - creatorPercentage: - Number(num.toBigInt(creatorBalance)) / Number(totalSupply), - top10HolderPercent: - Number( - num.toBigInt(tradeData.market.starknetTradingVolume24h) - ) / Number(totalSupply), - priceChange24hPercent: Number( - num.toBigInt(tradeData.market.priceChange24h) - ), - // TODO: Update to Starknet - priceChange12hPercent: Number( - num.toBigInt(tradeData.market.priceChange24h) - ), - // TODO: Update to Starknet - uniqueWallet24h: 0, - volume24hUsd: num.toBigInt( - tradeData.market.starknetTradingVolume24h - ), - }; - - const { shouldTrade } = evaluateTokenTrading(metrics); - return shouldTrade; - } catch (error) { - console.error("Error processing token data:", error); - throw error; - } - } - - formatTokenData(data: ProcessedTokenData): string { - let output = `**Token Security and Trade Report**\n`; - output += `Token Address: ${this.tokenAddress}\n\n`; - - // Security Data - output += `**Ownership Distribution:**\n`; - output += `- Owner Balance: ${data.security.ownerBalance}\n`; - output += `- Creator Balance: ${data.security.creatorBalance}\n`; - output += `- Owner Percentage: ${data.security.ownerPercentage}%\n`; - output += `- Creator Percentage: ${data.security.creatorPercentage}%\n`; - output += `- Top 10 Holders Balance: ${data.security.top10HolderBalance}\n`; - output += `- Top 10 Holders Percentage: ${data.security.top10HolderPercent}%\n\n`; - - // Trade Data - output += `**Trade Data:**\n`; - // output += `- Holders: ${data.tradeData.holder}\n`; - // output += `- Unique Wallets (24h): ${data.tradeData.holders}\n`; - output += `- Price Change (24h): ${data.tradeData.market.priceChange24h}%\n`; - // output += `- Price Change (12h): ${data.tradeData.market.priceChange12h}%\n`; - output += `- Volume (24h USD): $${num - .toBigInt(data.tradeData.market.starknetTradingVolume24h) - .toString()}\n`; - output += `- Current Price: $${num - .toBigInt(data.tradeData.market.currentPrice) - .toString()}\n\n`; - - // Holder Distribution Trend - output += `**Holder Distribution Trend:** ${data.holderDistributionTrend}\n\n`; - - // High-Value Holders - output += `**High-Value Holders (>$5 USD):**\n`; - if (data.highValueHolders.length === 0) { - output += `- No high-value holders found or data not available.\n`; - } else { - data.highValueHolders.forEach((holder) => { - output += `- ${holder.holderAddress}: $${holder.balanceUsd}\n`; - }); - } - output += `\n`; - - // Recent Trades - output += `**Recent Trades (Last 24h):** ${ - data.recentTrades ? "Yes" : "No" - }\n\n`; - - // High-Supply Holders - output += `**Holders with >2% Supply:** ${data.highSupplyHoldersCount}\n\n`; - - // DexScreener Status - output += `**DexScreener Listing:** ${ - data.isDexScreenerListed ? "Yes" : "No" - }\n`; - if (data.isDexScreenerListed) { - output += `- Listing Type: ${ - data.isDexScreenerPaid ? "Paid" : "Free" - }\n`; - output += `- Number of DexPairs: ${data.dexScreenerData.pairs.length}\n\n`; - output += `**DexScreener Pairs:**\n`; - data.dexScreenerData.pairs.forEach((pair, index) => { - output += `\n**Pair ${index + 1}:**\n`; - output += `- DEX: ${pair.dexId}\n`; - output += `- URL: ${pair.url}\n`; - output += `- Price USD: $${num - .toBigInt(pair.priceUsd) - .toString()}\n`; - output += `- Volume (24h USD): $${num - .toBigInt(pair.volume.h24) - .toString()}\n`; - output += `- Boosts Active: ${ - pair.boosts && pair.boosts.active - }\n`; - output += `- Liquidity USD: $${num - .toBigInt(pair.liquidity.usd) - .toString()}\n`; - }); - } - output += `\n`; - - console.log("Formatted token data:", output); - return output; - } - - async getFormattedTokenReport(): Promise { - try { - console.log("Generating formatted token report..."); - const processedData = await this.getProcessedTokenData(); - return this.formatTokenData(processedData); - } catch (error) { - console.error("Error generating token report:", error); - return "Unable to fetch token information. Please try again later."; - } - } -} - -// TODO: Check - -const tokenProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State, - tokenAddress?: string - ): Promise => { - try { - const walletProvider = new WalletProvider(runtime); - const provider = new TokenProvider(tokenAddress, walletProvider); - - return provider.getFormattedTokenReport(); - } catch (error) { - console.error("Error fetching token data:", error); - return "Unable to fetch token information. Please try again later."; - } - }, -}; - -export { tokenProvider }; diff --git a/packages/plugin-starknet/src/providers/trustScoreProvider.ts b/packages/plugin-starknet/src/providers/trustScoreProvider.ts deleted file mode 100644 index 88d48d408c7..00000000000 --- a/packages/plugin-starknet/src/providers/trustScoreProvider.ts +++ /dev/null @@ -1,649 +0,0 @@ -import { - ProcessedTokenData, - TokenSecurityData, - // TokenTradeData, - // DexScreenerData, - // DexScreenerPair, - // HolderData, -} from "../types/trustDB.ts"; -// import { Connection, PublicKey } from "@solana/web3.js"; -// import { getAssociatedTokenAddress } from "@solana/spl-token"; -// import { TokenProvider } from "./token.ts"; -import { WalletProvider } from "./walletProvider.ts"; -import { - TrustScoreDatabase, - RecommenderMetrics, - TokenPerformance, - TradePerformance, - TokenRecommendation, -} from "@ai16z/plugin-trustdb"; -import { settings } from "@ai16z/eliza"; -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { getTokenBalance } from "../utils/index.ts"; -import { TokenProvider } from "./token.ts"; - -const _Wallet = settings.MAIN_WALLET_ADDRESS; -interface TradeData { - buy_amount: number; - is_simulation: boolean; -} -interface sellDetails { - sell_amount: number; - sell_recommender_id: string | null; -} -interface _RecommendationGroup { - recommendation: any; - trustScore: number; -} - -interface RecommenderData { - recommenderId: string; - trustScore: number; - riskScore: number; - consistencyScore: number; - recommenderMetrics: RecommenderMetrics; -} - -interface TokenRecommendationSummary { - tokenAddress: string; - averageTrustScore: number; - averageRiskScore: number; - averageConsistencyScore: number; - recommenders: RecommenderData[]; -} -export class TrustScoreManager { - private tokenProvider: TokenProvider; - private trustScoreDb: TrustScoreDatabase; - private DECAY_RATE = 0.95; - private MAX_DECAY_DAYS = 30; - private backend; - private backendToken; - private runtime: IAgentRuntime; - constructor( - runtime: IAgentRuntime, - tokenProvider: TokenProvider, - trustScoreDb: TrustScoreDatabase - ) { - this.tokenProvider = tokenProvider; - this.trustScoreDb = trustScoreDb; - - // TODO: change to starknet - this.backend = runtime.getSetting("BACKEND_URL"); - - // TODO: change to starknet - this.backendToken = runtime.getSetting("BACKEND_TOKEN"); - - this.runtime = runtime; - } - - // Get Recommender Balance - async getRecommenderBalance(recommenderWallet: string): Promise { - try { - const tokenBalance = await getTokenBalance( - this.runtime, - recommenderWallet - ); - const balance = parseFloat(tokenBalance); - return balance; - } catch (error) { - console.error("Error fetching balance", error); - return 0; - } - } - - /** - * Generates and saves trust score based on processed token data and user recommendations. - * @param tokenAddress The address of the token to analyze. - * @param recommenderId The UUID of the recommender. - * @returns An object containing TokenPerformance and RecommenderMetrics. - */ - async generateTrustScore( - tokenAddress: string, - recommenderId: string, - recommenderWallet: string - ): Promise<{ - tokenPerformance: TokenPerformance; - recommenderMetrics: RecommenderMetrics; - }> { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - const recommenderMetrics = - await this.trustScoreDb.getRecommenderMetrics(recommenderId); - - const isRapidDump = await this.isRapidDump(tokenAddress); - const sustainedGrowth = await this.sustainedGrowth(tokenAddress); - const suspiciousVolume = await this.suspiciousVolume(tokenAddress); - const balance = await this.getRecommenderBalance(recommenderWallet); - const virtualConfidence = balance / 1000000; // TODO: create formula to calculate virtual confidence based on user balance - const lastActive = recommenderMetrics.lastActiveDate; - const now = new Date(); - const inactiveDays = Math.floor( - (now.getTime() - lastActive.getTime()) / (1000 * 60 * 60 * 24) - ); - const decayFactor = Math.pow( - this.DECAY_RATE, - Math.min(inactiveDays, this.MAX_DECAY_DAYS) - ); - const decayedScore = recommenderMetrics.trustScore * decayFactor; - const validationTrustScore = - this.trustScoreDb.calculateValidationTrust(tokenAddress); - - return { - tokenPerformance: { - tokenAddress: - processedData.dexScreenerData.pairs[0]?.baseToken.address || - "", - priceChange24h: - processedData.tradeData.price_change_24h_percent, - volumeChange24h: processedData.tradeData.volume_24h, - trade_24h_change: - processedData.tradeData.trade_24h_change_percent, - liquidity: - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0, - liquidityChange24h: 0, - holderChange24h: - processedData.tradeData.unique_wallet_24h_change_percent, - rugPull: false, // TODO: Implement rug pull detection - isScam: false, // TODO: Implement scam detection - marketCapChange24h: 0, // TODO: Implement market cap change - sustainedGrowth: sustainedGrowth, - rapidDump: isRapidDump, - suspiciousVolume: suspiciousVolume, - validationTrust: validationTrustScore, - lastUpdated: new Date(), - }, - recommenderMetrics: { - recommenderId: recommenderId, - trustScore: recommenderMetrics.trustScore, - totalRecommendations: recommenderMetrics.totalRecommendations, - successfulRecs: recommenderMetrics.successfulRecs, - avgTokenPerformance: recommenderMetrics.avgTokenPerformance, - riskScore: recommenderMetrics.riskScore, - consistencyScore: recommenderMetrics.consistencyScore, - virtualConfidence: virtualConfidence, - lastActiveDate: now, - trustDecay: decayedScore, - lastUpdated: new Date(), - }, - }; - } - - async updateRecommenderMetrics( - recommenderId: string, - tokenPerformance: TokenPerformance, - recommenderWallet: string - ): Promise { - const recommenderMetrics = - await this.trustScoreDb.getRecommenderMetrics(recommenderId); - - const totalRecommendations = - recommenderMetrics.totalRecommendations + 1; - const successfulRecs = tokenPerformance.rugPull - ? recommenderMetrics.successfulRecs - : recommenderMetrics.successfulRecs + 1; - const avgTokenPerformance = - (recommenderMetrics.avgTokenPerformance * - recommenderMetrics.totalRecommendations + - tokenPerformance.priceChange24h) / - totalRecommendations; - - const overallTrustScore = this.calculateTrustScore( - tokenPerformance, - recommenderMetrics - ); - const riskScore = this.calculateOverallRiskScore( - tokenPerformance, - recommenderMetrics - ); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - - const balance = await this.getRecommenderBalance(recommenderWallet); - const virtualConfidence = balance / 1000000; // TODO: create formula to calculate virtual confidence based on user balance - const lastActive = recommenderMetrics.lastActiveDate; - const now = new Date(); - const inactiveDays = Math.floor( - (now.getTime() - lastActive.getTime()) / (1000 * 60 * 60 * 24) - ); - const decayFactor = Math.pow( - this.DECAY_RATE, - Math.min(inactiveDays, this.MAX_DECAY_DAYS) - ); - const decayedScore = recommenderMetrics.trustScore * decayFactor; - - const newRecommenderMetrics: RecommenderMetrics = { - recommenderId: recommenderId, - trustScore: overallTrustScore, - totalRecommendations: totalRecommendations, - successfulRecs: successfulRecs, - avgTokenPerformance: avgTokenPerformance, - riskScore: riskScore, - consistencyScore: consistencyScore, - virtualConfidence: virtualConfidence, - lastActiveDate: new Date(), - trustDecay: decayedScore, - lastUpdated: new Date(), - }; - - await this.trustScoreDb.updateRecommenderMetrics(newRecommenderMetrics); - } - - calculateTrustScore( - tokenPerformance: TokenPerformance, - recommenderMetrics: RecommenderMetrics - ): number { - const riskScore = this.calculateRiskScore(tokenPerformance); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - - return (riskScore + consistencyScore) / 2; - } - - calculateOverallRiskScore( - tokenPerformance: TokenPerformance, - recommenderMetrics: RecommenderMetrics - ) { - const riskScore = this.calculateRiskScore(tokenPerformance); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - - return (riskScore + consistencyScore) / 2; - } - - calculateRiskScore(tokenPerformance: TokenPerformance): number { - let riskScore = 0; - if (tokenPerformance.rugPull) { - riskScore += 10; - } - if (tokenPerformance.isScam) { - riskScore += 10; - } - if (tokenPerformance.rapidDump) { - riskScore += 5; - } - if (tokenPerformance.suspiciousVolume) { - riskScore += 5; - } - return riskScore; - } - - calculateConsistencyScore( - tokenPerformance: TokenPerformance, - recommenderMetrics: RecommenderMetrics - ): number { - const avgTokenPerformance = recommenderMetrics.avgTokenPerformance; - const priceChange24h = tokenPerformance.priceChange24h; - - return Math.abs(priceChange24h - avgTokenPerformance); - } - - async suspiciousVolume(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - const unique_wallet_24h = processedData.tradeData.unique_wallet_24h; - const volume_24h = processedData.tradeData.volume_24h; - const suspiciousVolume = unique_wallet_24h / volume_24h > 0.5; - console.log(`Fetched processed token data for token: ${tokenAddress}`); - return suspiciousVolume; - } - - async sustainedGrowth(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - return processedData.tradeData.volume_24h_change_percent > 50; - } - - async isRapidDump(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - return processedData.tradeData.trade_24h_change_percent < -50; - } - - async checkTrustScore(tokenAddress: string): Promise { - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - console.log(`Fetched processed token data for token: ${tokenAddress}`); - - return { - ownerBalance: processedData.security.ownerBalance, - creatorBalance: processedData.security.creatorBalance, - ownerPercentage: processedData.security.ownerPercentage, - creatorPercentage: processedData.security.creatorPercentage, - top10HolderBalance: processedData.security.top10HolderBalance, - top10HolderPercent: processedData.security.top10HolderPercent, - }; - } - - /** - * Creates a TradePerformance object based on token data and recommender. - * @param tokenAddress The address of the token. - * @param recommenderId The UUID of the recommender. - * @param data ProcessedTokenData. - * @returns TradePerformance object. - */ - async createTradePerformance( - runtime: IAgentRuntime, - tokenAddress: string, - recommenderId: string, - data: TradeData - ): Promise { - const recommender = - await this.trustScoreDb.getOrCreateRecommenderWithTelegramId( - recommenderId - ); - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - - // TODO: change to starknet - const wallet = new WalletProvider(runtime); - - const prices = await wallet.fetchPrices(runtime); - const solPrice = prices.solana.usd; - const buySol = data.buy_amount / parseFloat(solPrice); - const buy_value_usd = data.buy_amount * processedData.tradeData.price; - - const creationData = { - token_address: tokenAddress, - recommender_id: recommender.id, - buy_price: processedData.tradeData.price, - sell_price: 0, - buy_timeStamp: new Date().toISOString(), - sell_timeStamp: "", - buy_amount: data.buy_amount, - sell_amount: 0, - buy_sol: buySol, - received_sol: 0, - buy_value_usd: buy_value_usd, - sell_value_usd: 0, - profit_usd: 0, - profit_percent: 0, - buy_market_cap: - processedData.dexScreenerData.pairs[0]?.marketCap || 0, - sell_market_cap: 0, - market_cap_change: 0, - buy_liquidity: - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0, - sell_liquidity: 0, - liquidity_change: 0, - last_updated: new Date().toISOString(), - rapidDump: false, - }; - this.trustScoreDb.addTradePerformance(creationData, data.is_simulation); - // api call to update trade performance - this.createTradeInBe(tokenAddress, recommenderId, data); - return creationData; - } - - async delay(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); - } - - // TODO: change to starknet - async createTradeInBe( - tokenAddress: string, - recommenderId: string, - data: TradeData, - retries = 3, - delayMs = 2000 - ) { - for (let attempt = 1; attempt <= retries; attempt++) { - try { - await fetch( - `${this.backend}/api/updaters/createTradePerformance`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${this.backendToken}`, - }, - body: JSON.stringify({ - tokenAddress: tokenAddress, - tradeData: data, - recommenderId: recommenderId, - }), - } - ); - // If the request is successful, exit the loop - return; - } catch (error) { - console.error( - `Attempt ${attempt} failed: Error creating trade in backend`, - error - ); - if (attempt < retries) { - console.log(`Retrying in ${delayMs} ms...`); - await this.delay(delayMs); // Wait for the specified delay before retrying - } else { - console.error("All attempts failed."); - } - } - } - } - - /** - * Updates a trade with sell details. - * @param tokenAddress The address of the token. - * @param recommenderId The UUID of the recommender. - * @param buyTimeStamp The timestamp when the buy occurred. - * @param sellDetails An object containing sell-related details. - * @param isSimulation Whether the trade is a simulation. If true, updates in simulation_trade; otherwise, in trade. - * @returns boolean indicating success. - */ - - async updateSellDetails( - runtime: IAgentRuntime, - tokenAddress: string, - recommenderId: string, - sellTimeStamp: string, - sellDetails: sellDetails, - isSimulation: boolean - ) { - const recommender = - await this.trustScoreDb.getOrCreateRecommenderWithTelegramId( - recommenderId - ); - const processedData: ProcessedTokenData = - await this.tokenProvider.getProcessedTokenData(); - - // TODO: - const wallet = new WalletProvider(this.runtime); - - const prices = await wallet.fetchPrices(runtime); - const solPrice = prices.solana.usd; - const sellSol = sellDetails.sell_amount / parseFloat(solPrice); - const sell_value_usd = - sellDetails.sell_amount * processedData.tradeData.price; - const trade = await this.trustScoreDb.getLatestTradePerformance( - tokenAddress, - recommender.id, - isSimulation - ); - const buyTimeStamp = trade.buy_timeStamp; - const marketCap = - processedData.dexScreenerData.pairs[0]?.marketCap || 0; - const liquidity = - processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0; - const sell_price = processedData.tradeData.price; - const profit_usd = sell_value_usd - trade.buy_value_usd; - const profit_percent = (profit_usd / trade.buy_value_usd) * 100; - - const market_cap_change = marketCap - trade.buy_market_cap; - const liquidity_change = liquidity - trade.buy_liquidity; - - const isRapidDump = await this.isRapidDump(tokenAddress); - - const sellDetailsData = { - sell_price: sell_price, - sell_timeStamp: sellTimeStamp, - sell_amount: sellDetails.sell_amount, - received_sol: sellSol, - sell_value_usd: sell_value_usd, - profit_usd: profit_usd, - profit_percent: profit_percent, - sell_market_cap: marketCap, - market_cap_change: market_cap_change, - sell_liquidity: liquidity, - liquidity_change: liquidity_change, - rapidDump: isRapidDump, - sell_recommender_id: sellDetails.sell_recommender_id || null, - }; - this.trustScoreDb.updateTradePerformanceOnSell( - tokenAddress, - recommender.id, - buyTimeStamp, - sellDetailsData, - isSimulation - ); - return sellDetailsData; - } - - // get all recommendations - async getRecommendations( - startDate: Date, - endDate: Date - ): Promise> { - const recommendations = this.trustScoreDb.getRecommendationsByDateRange( - startDate, - endDate - ); - - // Group recommendations by tokenAddress - const groupedRecommendations = recommendations.reduce( - (acc, recommendation) => { - const { tokenAddress } = recommendation; - if (!acc[tokenAddress]) acc[tokenAddress] = []; - acc[tokenAddress].push(recommendation); - return acc; - }, - {} as Record> - ); - - const result = Object.keys(groupedRecommendations).map( - (tokenAddress) => { - const tokenRecommendations = - groupedRecommendations[tokenAddress]; - - // Initialize variables to compute averages - let totalTrustScore = 0; - let totalRiskScore = 0; - let totalConsistencyScore = 0; - const recommenderData = []; - - tokenRecommendations.forEach((recommendation) => { - const tokenPerformance = - this.trustScoreDb.getTokenPerformance( - recommendation.tokenAddress - ); - const recommenderMetrics = - this.trustScoreDb.getRecommenderMetrics( - recommendation.recommenderId - ); - - const trustScore = this.calculateTrustScore( - tokenPerformance, - recommenderMetrics - ); - const consistencyScore = this.calculateConsistencyScore( - tokenPerformance, - recommenderMetrics - ); - const riskScore = this.calculateRiskScore(tokenPerformance); - - // Accumulate scores for averaging - totalTrustScore += trustScore; - totalRiskScore += riskScore; - totalConsistencyScore += consistencyScore; - - recommenderData.push({ - recommenderId: recommendation.recommenderId, - trustScore, - riskScore, - consistencyScore, - recommenderMetrics, - }); - }); - - // Calculate averages for this token - const averageTrustScore = - totalTrustScore / tokenRecommendations.length; - const averageRiskScore = - totalRiskScore / tokenRecommendations.length; - const averageConsistencyScore = - totalConsistencyScore / tokenRecommendations.length; - - return { - tokenAddress, - averageTrustScore, - averageRiskScore, - averageConsistencyScore, - recommenders: recommenderData, - }; - } - ); - - // Sort recommendations by the highest average trust score - result.sort((a, b) => b.averageTrustScore - a.averageTrustScore); - - return result; - } -} - -export const trustScoreProvider: Provider = { - async get( - runtime: IAgentRuntime, - message: Memory, - _state?: State - ): Promise { - try { - const trustScoreDb = new TrustScoreDatabase( - runtime.databaseAdapter.db - ); - - // Get the user ID from the message - const userId = message.userId; - - if (!userId) { - console.error("User ID is missing from the message"); - return ""; - } - - // Get the recommender metrics for the user - const recommenderMetrics = - await trustScoreDb.getRecommenderMetrics(userId); - - if (!recommenderMetrics) { - console.error("No recommender metrics found for user:", userId); - return ""; - } - - // Compute the trust score - const trustScore = recommenderMetrics.trustScore; - - const user = await runtime.databaseAdapter.getAccountById(userId); - - // Format the trust score string - const trustScoreString = `${ - user.name - }'s trust score: ${trustScore.toFixed(2)}`; - - return trustScoreString; - } catch (error) { - console.error("Error in trust score provider:", error.message); - return `Failed to fetch trust score: ${ - error instanceof Error ? error.message : "Unknown error" - }`; - } - }, -}; diff --git a/packages/plugin-starknet/src/providers/utils.ts b/packages/plugin-starknet/src/providers/utils.ts deleted file mode 100644 index afa5b9b2a8e..00000000000 --- a/packages/plugin-starknet/src/providers/utils.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { num } from "starknet"; -import { HolderData } from "../types/trustDB"; - -export interface TokenMetrics { - liquidityUsd: bigint; - marketCapUsd: bigint; - totalSupply: bigint; - ownerPercentage: number; - creatorPercentage: number; - top10HolderPercent: number; - priceChange24hPercent: number; - priceChange12hPercent: number; - uniqueWallet24h: number; - volume24hUsd: bigint; -} - -export interface TradingThresholds { - volume24hUsdThreshold?: number; - priceChange24hPercentThreshold?: number; - priceChange12hPercentThreshold?: number; - top10HolderPercentThreshold?: number; - uniqueWallet24hThreshold?: number; - minimumLiquidityUsd?: number; - minimumMarketCapUsd?: number; -} - -export function evaluateTokenTrading( - metrics: TokenMetrics, - thresholds: TradingThresholds = {} -): { shouldTrade: boolean; reasons: string[] } { - // Default thresholds - const { - volume24hUsdThreshold = 1000, - priceChange24hPercentThreshold = 10, - priceChange12hPercentThreshold = 5, - top10HolderPercentThreshold = 0.05, - uniqueWallet24hThreshold = 100, - minimumLiquidityUsd = 1000, - minimumMarketCapUsd = 100000, - } = thresholds; - - const reasons: string[] = []; - - // Evaluate each condition - if (metrics.top10HolderPercent >= top10HolderPercentThreshold) { - reasons.push("High concentration in top 10 holders"); - } - - if (metrics.volume24hUsd >= BigInt(volume24hUsdThreshold)) { - reasons.push("High 24h trading volume"); - } - - if (metrics.priceChange24hPercent >= priceChange24hPercentThreshold) { - reasons.push("Significant 24h price change"); - } - - if (metrics.priceChange12hPercent >= priceChange12hPercentThreshold) { - reasons.push("Significant 12h price change"); - } - - if (metrics.uniqueWallet24h >= uniqueWallet24hThreshold) { - reasons.push("High number of unique wallets"); - } - - if (metrics.liquidityUsd < BigInt(minimumLiquidityUsd)) { - reasons.push("Low liquidity"); - } - - if (metrics.marketCapUsd < BigInt(minimumMarketCapUsd)) { - reasons.push("Low market cap"); - } - - return { - shouldTrade: reasons.length > 0, - reasons, - }; -} - -export interface HolderAnalysisParams { - holders: HolderData[]; - ownerBalance: string; - creatorBalance: string; - thresholdPercentage?: number; -} - -export interface HolderAnalysisResult { - count: number; - holders: Array<{ - address: string; - percentage: number; - }>; - totalSupply: bigint; -} - -export function analyzeHighSupplyHolders( - params: HolderAnalysisParams -): HolderAnalysisResult { - try { - const { - holders, - ownerBalance, - creatorBalance, - thresholdPercentage = 0.02, // Default threshold of 2% - } = params; - - const ownerBalanceBigInt = num.toBigInt(ownerBalance); - const totalSupply = ownerBalanceBigInt + num.toBigInt(creatorBalance); - - const highSupplyHolders = holders - .map((holder) => { - const balance = num.toBigInt(holder.balance); - const percentage = Number(balance) / Number(totalSupply); - return { - address: holder.address, - percentage, - }; - }) - .filter((holder) => holder.percentage > thresholdPercentage); - - return { - count: highSupplyHolders.length, - holders: highSupplyHolders, - totalSupply, - }; - } catch (error) { - console.error("Error analyzing high supply holders:", error); - return { - count: 0, - holders: [], - totalSupply: BigInt(0), - }; - } -} diff --git a/packages/plugin-starknet/src/types/token.ts b/packages/plugin-starknet/src/types/token.ts deleted file mode 100644 index 758b65e3f1d..00000000000 --- a/packages/plugin-starknet/src/types/token.ts +++ /dev/null @@ -1,106 +0,0 @@ -interface QuoteRequest { - sellTokenAddress: string; - buyTokenAddress: string; - sellAmount?: bigint; - buyAmount?: bigint; - // The address which will fill the quote - takerAddress?: string; - // The maximum number of returned quotes - size?: number; - // The sources that the user wants to exclude - excludeSources?: string[]; // ['10KSwap'] - // Fee amount in bps, 30 is 0.3% - integratorFees?: bigint; - // Required when integratorFees is defined. You need to provide the address of your fee collector. - integratorFeeRecipient?: string; // 0x01238E9778D026588a51595E30B0F45609B4F771EecF0E335CdeFeD1d84a9D89 - // The name of your application - integratorName?: string; // AVNU Portal -} - -interface Quote { - // The unique id of the quote - quoteId: string; - sellTokenAddress: string; - sellAmount: bigint; - sellAmountInUsd: number; - buyTokenAddress: string; - buyAmount: bigint; - buyAmountInUsd: number; - blockNumber?: number; - chainId: string; - // Unix timestamp when quotes expires in seconds - expiry?: number; - routes: Route[]; - // The estimated amount of gas fees in ETH - gasFees: bigint; - // The estimated amount of gas fees in usd - gasFeesInUsd: number; - // The actual fees taken by AVNU - avnuFees: bigint; - // The actual fees taken by AVNU is usd - avnuFeesInUsd: number; - // The fees in bps taken by AVNU - avnuFeesBps: bigint; - // The actual fees taken by the integrator - integratorFees: bigint; - // The actual fees taken by the integrator in usd - integratorFeesInUsd: number; - // The fees in bps taken by the integrator - integratorFeesBps: bigint; - // Price ratio in usd and in bps - priceRatioUsd: number; - // The sell token price in usd - sellTokenPriceInUsd?: number; - // The buy token price in usd - buyTokenPriceInUsd?: number; - gasless: Gasless; -} - -interface Route { - // The name of the source - name: string; // 10kSwap - // The address of the source - address: string; - // The percentage distribution of sellToken. 1 is 100% - percent: number; - sellTokenAddress: string; - buyTokenAddress: string; - routes: Route[]; -} - -export interface Gasless { - active: boolean; - gasTokenPrices: { - tokenAddress: string; - gasFeesInUsd: number; - gasFeesInGasToken: bigint; - }[]; -} - -export interface TokenInfo { - name: string; - symbol: string; - address: string; - logoUri: string; - coingeckoId: string; - verified: boolean; - market: { - currentPrice: number; - marketCap: number; - fullyDilutedValuation: number; - starknetTvl: number; - priceChange1h: number; - priceChangePercentage1h: number; - priceChange24h: number; - priceChangePercentage24h: number; - priceChange7d: number; - priceChangePercentage7d: number; - marketCapChange24h: number; - marketCapChangePercentage24h: number; - starknetVolume24h: number; - starknetTradingVolume24h: number; - }; - tags: string[]; -} - -export type { Quote, QuoteRequest }; diff --git a/packages/plugin-starknet/src/types/trustDB.ts b/packages/plugin-starknet/src/types/trustDB.ts deleted file mode 100644 index 9ee767b8bc3..00000000000 --- a/packages/plugin-starknet/src/types/trustDB.ts +++ /dev/null @@ -1,289 +0,0 @@ -import { TokenInfo } from "./token"; - -export interface TokenSecurityData { - ownerBalance: string; - creatorBalance: string; - ownerPercentage: number; - creatorPercentage: number; - top10HolderBalance: string; - top10HolderPercent: number; -} - -export interface TokenTradeData { - address: string; - holder: number; - market: number; - last_trade_unix_time: number; - last_trade_human_time: string; - price: number; - history_30m_price: number; - price_change_30m_percent: number; - history_1h_price: number; - price_change_1h_percent: number; - history_2h_price: number; - price_change_2h_percent: number; - history_4h_price: number; - price_change_4h_percent: number; - history_6h_price: number; - price_change_6h_percent: number; - history_8h_price: number; - price_change_8h_percent: number; - history_12h_price: number; - price_change_12h_percent: number; - history_24h_price: number; - price_change_24h_percent: number; - unique_wallet_30m: number; - unique_wallet_history_30m: number; - unique_wallet_30m_change_percent: number; - unique_wallet_1h: number; - unique_wallet_history_1h: number; - unique_wallet_1h_change_percent: number; - unique_wallet_2h: number; - unique_wallet_history_2h: number; - unique_wallet_2h_change_percent: number; - unique_wallet_4h: number; - unique_wallet_history_4h: number; - unique_wallet_4h_change_percent: number; - unique_wallet_8h: number; - unique_wallet_history_8h: number | null; - unique_wallet_8h_change_percent: number | null; - unique_wallet_24h: number; - unique_wallet_history_24h: number | null; - unique_wallet_24h_change_percent: number | null; - trade_30m: number; - trade_history_30m: number; - trade_30m_change_percent: number; - sell_30m: number; - sell_history_30m: number; - sell_30m_change_percent: number; - buy_30m: number; - buy_history_30m: number; - buy_30m_change_percent: number; - volume_30m: number; - volume_30m_usd: number; - volume_history_30m: number; - volume_history_30m_usd: number; - volume_30m_change_percent: number; - volume_buy_30m: number; - volume_buy_30m_usd: number; - volume_buy_history_30m: number; - volume_buy_history_30m_usd: number; - volume_buy_30m_change_percent: number; - volume_sell_30m: number; - volume_sell_30m_usd: number; - volume_sell_history_30m: number; - volume_sell_history_30m_usd: number; - volume_sell_30m_change_percent: number; - trade_1h: number; - trade_history_1h: number; - trade_1h_change_percent: number; - sell_1h: number; - sell_history_1h: number; - sell_1h_change_percent: number; - buy_1h: number; - buy_history_1h: number; - buy_1h_change_percent: number; - volume_1h: number; - volume_1h_usd: number; - volume_history_1h: number; - volume_history_1h_usd: number; - volume_1h_change_percent: number; - volume_buy_1h: number; - volume_buy_1h_usd: number; - volume_buy_history_1h: number; - volume_buy_history_1h_usd: number; - volume_buy_1h_change_percent: number; - volume_sell_1h: number; - volume_sell_1h_usd: number; - volume_sell_history_1h: number; - volume_sell_history_1h_usd: number; - volume_sell_1h_change_percent: number; - trade_2h: number; - trade_history_2h: number; - trade_2h_change_percent: number; - sell_2h: number; - sell_history_2h: number; - sell_2h_change_percent: number; - buy_2h: number; - buy_history_2h: number; - buy_2h_change_percent: number; - volume_2h: number; - volume_2h_usd: number; - volume_history_2h: number; - volume_history_2h_usd: number; - volume_2h_change_percent: number; - volume_buy_2h: number; - volume_buy_2h_usd: number; - volume_buy_history_2h: number; - volume_buy_history_2h_usd: number; - volume_buy_2h_change_percent: number; - volume_sell_2h: number; - volume_sell_2h_usd: number; - volume_sell_history_2h: number; - volume_sell_history_2h_usd: number; - volume_sell_2h_change_percent: number; - trade_4h: number; - trade_history_4h: number; - trade_4h_change_percent: number; - sell_4h: number; - sell_history_4h: number; - sell_4h_change_percent: number; - buy_4h: number; - buy_history_4h: number; - buy_4h_change_percent: number; - volume_4h: number; - volume_4h_usd: number; - volume_history_4h: number; - volume_history_4h_usd: number; - volume_4h_change_percent: number; - volume_buy_4h: number; - volume_buy_4h_usd: number; - volume_buy_history_4h: number; - volume_buy_history_4h_usd: number; - volume_buy_4h_change_percent: number; - volume_sell_4h: number; - volume_sell_4h_usd: number; - volume_sell_history_4h: number; - volume_sell_history_4h_usd: number; - volume_sell_4h_change_percent: number; - trade_8h: number; - trade_history_8h: number | null; - trade_8h_change_percent: number | null; - sell_8h: number; - sell_history_8h: number | null; - sell_8h_change_percent: number | null; - buy_8h: number; - buy_history_8h: number | null; - buy_8h_change_percent: number | null; - volume_8h: number; - volume_8h_usd: number; - volume_history_8h: number; - volume_history_8h_usd: number; - volume_8h_change_percent: number | null; - volume_buy_8h: number; - volume_buy_8h_usd: number; - volume_buy_history_8h: number; - volume_buy_history_8h_usd: number; - volume_buy_8h_change_percent: number | null; - volume_sell_8h: number; - volume_sell_8h_usd: number; - volume_sell_history_8h: number; - volume_sell_history_8h_usd: number; - volume_sell_8h_change_percent: number | null; - trade_24h: number; - trade_history_24h: number; - trade_24h_change_percent: number | null; - sell_24h: number; - sell_history_24h: number; - sell_24h_change_percent: number | null; - buy_24h: number; - buy_history_24h: number; - buy_24h_change_percent: number | null; - volume_24h: number; - volume_24h_usd: number; - volume_history_24h: number; - volume_history_24h_usd: number; - volume_24h_change_percent: number | null; - volume_buy_24h: number; - volume_buy_24h_usd: number; - volume_buy_history_24h: number; - volume_buy_history_24h_usd: number; - volume_buy_24h_change_percent: number | null; - volume_sell_24h: number; - volume_sell_24h_usd: number; - volume_sell_history_24h: number; - volume_sell_history_24h_usd: number; - volume_sell_24h_change_percent: number | null; -} - -export interface HolderData { - address: string; - balance: string; -} - -export interface ProcessedTokenData { - security: TokenSecurityData; - tradeData: TokenInfo; - holderDistributionTrend: string; // 'increasing' | 'decreasing' | 'stable' - highValueHolders: Array<{ - holderAddress: string; - balanceUsd: string; - }>; - recentTrades: boolean; - highSupplyHoldersCount: number; - dexScreenerData: DexScreenerData; - - isDexScreenerListed: boolean; - isDexScreenerPaid: boolean; -} - -export interface DexScreenerPair { - chainId: string; - dexId: string; - url: string; - pairAddress: string; - baseToken: { - address: string; - name: string; - symbol: string; - }; - quoteToken: { - address: string; - name: string; - symbol: string; - }; - priceNative: string; - priceUsd: string; - txns: { - m5: { buys: number; sells: number }; - h1: { buys: number; sells: number }; - h6: { buys: number; sells: number }; - h24: { buys: number; sells: number }; - }; - volume: { - h24: number; - h6: number; - h1: number; - m5: number; - }; - priceChange: { - m5: number; - h1: number; - h6: number; - h24: number; - }; - liquidity: { - usd: number; - base: number; - quote: number; - }; - fdv: number; - marketCap: number; - pairCreatedAt: number; - info: { - imageUrl: string; - websites: { label: string; url: string }[]; - socials: { type: string; url: string }[]; - }; - boosts: { - active: number; - }; -} - -export interface DexScreenerData { - schemaVersion: string; - pairs: DexScreenerPair[]; -} - -export interface Prices { - starknet: { usd: string }; - bitcoin: { usd: string }; - ethereum: { usd: string }; -} - -export interface CalculatedBuyAmounts { - none: 0; - low: number; - medium: number; - high: number; -} diff --git a/packages/plugin-starknet/src/utils/ERC20Token.ts b/packages/plugin-starknet/src/utils/ERC20Token.ts deleted file mode 100644 index e52ec086c12..00000000000 --- a/packages/plugin-starknet/src/utils/ERC20Token.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { - AccountInterface, - cairo, - CallData, - Calldata, - Contract, - ProviderInterface, -} from "starknet"; -import erc20Abi from "./erc20.json"; - -export type ApproveCall = { - contractAddress: string; - entrypoint: "approve"; - calldata: Calldata; -}; - -export type TransferCall = { - contractAddress: string; - entrypoint: "transfer"; - calldata: Calldata; -}; - -export class ERC20Token { - abi: any; - contract: Contract; - calldata: CallData; - constructor( - token: string, - providerOrAccount?: ProviderInterface | AccountInterface - ) { - this.contract = new Contract(erc20Abi, token, providerOrAccount); - this.calldata = new CallData(this.contract.abi); - } - - public address() { - return this.contract.address; - } - - public async balanceOf(account: string): Promise { - const result = await this.contract.call("balance_of", [account]); - return result as bigint; - } - - public async decimals() { - const result = await this.contract.call("decimals"); - return result as bigint; - } - - public approveCall(spender: string, amount: bigint): ApproveCall { - return { - contractAddress: this.contract.address, - entrypoint: "approve", - calldata: this.calldata.compile("approve", { - spender: spender, - amount: cairo.uint256(amount), - }), - }; - } - - public transferCall(recipient: string, amount: bigint): TransferCall { - return { - contractAddress: this.contract.address, - entrypoint: "transfer", - calldata: this.calldata.compile("transfer", { - recipient: recipient, - amount: cairo.uint256(amount), - }), - }; - } -} diff --git a/packages/plugin-starknet/src/utils/cache.ts b/packages/plugin-starknet/src/utils/cache.ts deleted file mode 100644 index f8fc6eb8b28..00000000000 --- a/packages/plugin-starknet/src/utils/cache.ts +++ /dev/null @@ -1,104 +0,0 @@ -import NodeCache from "node-cache"; -import fs from "fs"; -import path from "path"; - -export class Cache { - private cache: NodeCache; - public cacheDir: string; - - constructor() { - this.cache = new NodeCache({ stdTTL: 300 }); // 5 minutes cache - const __dirname = path.resolve(); - - // Find the 'eliza' folder in the filepath and adjust the cache directory path - const elizaIndex = __dirname.indexOf("eliza"); - if (elizaIndex !== -1) { - const pathToEliza = __dirname.slice(0, elizaIndex + 5); // include 'eliza' - this.cacheDir = path.join(pathToEliza, "cache"); - } else { - this.cacheDir = path.join(__dirname, "cache"); - } - - if (!fs.existsSync(this.cacheDir)) { - fs.mkdirSync(this.cacheDir); - } - } - - private readCacheFromFile(cacheKey: string): T | null { - const filePath = path.join(this.cacheDir, `${cacheKey}.json`); - if (fs.existsSync(filePath)) { - try { - const fileContent = fs.readFileSync(filePath, "utf-8"); - const parsed = JSON.parse(fileContent); - const now = Date.now(); - if (now < parsed.expiry) { - return parsed.data as T; - } else { - fs.unlinkSync(filePath); - } - } catch (error) { - console.error( - `Error reading cache file for key ${cacheKey}:`, - error - ); - // Delete corrupted cache file - try { - fs.unlinkSync(filePath); - } catch (e) { - console.error(`Error deleting corrupted cache file:`, e); - } - } - } - return null; - } - - private writeCacheToFile(cacheKey: string, data: T): void { - try { - const filePath = path.join(this.cacheDir, `${cacheKey}.json`); - const cacheData = { - data: data, - expiry: Date.now() + 300000, // 5 minutes in milliseconds - }; - fs.writeFileSync(filePath, JSON.stringify(cacheData), "utf-8"); - } catch (error) { - console.error( - `Error writing cache file for key ${cacheKey}:`, - error - ); - } - } - - public get(cacheKey: string): T | undefined { - return this.cache.get(cacheKey); - } - - public set(cacheKey: string, data: T): void { - this.cache.set(cacheKey, data); - } - - public getCachedData(cacheKey: string): T | null { - // Check in-memory cache first - const cachedData = this.cache.get(cacheKey); - if (cachedData !== undefined) { - return cachedData; - } - - // Check file-based cache - const fileCachedData = this.readCacheFromFile(cacheKey); - if (fileCachedData) { - // Populate in-memory cache - this.cache.set(cacheKey, fileCachedData); - return fileCachedData; - } - - return null; - } - - public setCachedData(cacheKey: string, data: T): void { - // Set in-memory cache - this.cache.set(cacheKey, data); - - // Write to file-based cache - this.writeCacheToFile(cacheKey, data); - } -} diff --git a/packages/plugin-starknet/src/utils/constants.ts b/packages/plugin-starknet/src/utils/constants.ts deleted file mode 100644 index 13812f44f8c..00000000000 --- a/packages/plugin-starknet/src/utils/constants.ts +++ /dev/null @@ -1,8 +0,0 @@ -export enum TOKENS { - LORDS = "0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49", -} - -export enum ACCOUNTS { - ELIZA = "0x07c6eE09d10C9a98E5100F017439b825c85c5cbdaE1146c602013F79f4db9f1D", - BLOBERT = "0x04837488b417a286a4a42ccb296398c86b7a88b3ef74c67425aac34b9467f03f", -} diff --git a/packages/plugin-starknet/src/utils/erc20.json b/packages/plugin-starknet/src/utils/erc20.json deleted file mode 100644 index b55daa7c992..00000000000 --- a/packages/plugin-starknet/src/utils/erc20.json +++ /dev/null @@ -1,1029 +0,0 @@ -[ - { - "name": "MintableToken", - "type": "impl", - "interface_name": "src::mintable_token_interface::IMintableToken" - }, - { - "name": "core::integer::u256", - "type": "struct", - "members": [ - { - "name": "low", - "type": "core::integer::u128" - }, - { - "name": "high", - "type": "core::integer::u128" - } - ] - }, - { - "name": "src::mintable_token_interface::IMintableToken", - "type": "interface", - "items": [ - { - "name": "permissioned_mint", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "permissioned_burn", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "name": "MintableTokenCamelImpl", - "type": "impl", - "interface_name": "src::mintable_token_interface::IMintableTokenCamel" - }, - { - "name": "src::mintable_token_interface::IMintableTokenCamel", - "type": "interface", - "items": [ - { - "name": "permissionedMint", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "permissionedBurn", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "name": "Replaceable", - "type": "impl", - "interface_name": "src::replaceability_interface::IReplaceable" - }, - { - "name": "core::array::Span::", - "type": "struct", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "name": "src::replaceability_interface::EICData", - "type": "struct", - "members": [ - { - "name": "eic_hash", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "eic_init_data", - "type": "core::array::Span::" - } - ] - }, - { - "name": "core::option::Option::", - "type": "enum", - "variants": [ - { - "name": "Some", - "type": "src::replaceability_interface::EICData" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "name": "core::bool", - "type": "enum", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] - }, - { - "name": "src::replaceability_interface::ImplementationData", - "type": "struct", - "members": [ - { - "name": "impl_hash", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "eic_data", - "type": "core::option::Option::" - }, - { - "name": "final", - "type": "core::bool" - } - ] - }, - { - "name": "src::replaceability_interface::IReplaceable", - "type": "interface", - "items": [ - { - "name": "get_upgrade_delay", - "type": "function", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u64" - } - ], - "state_mutability": "view" - }, - { - "name": "get_impl_activation_time", - "type": "function", - "inputs": [ - { - "name": "implementation_data", - "type": "src::replaceability_interface::ImplementationData" - } - ], - "outputs": [ - { - "type": "core::integer::u64" - } - ], - "state_mutability": "view" - }, - { - "name": "add_new_implementation", - "type": "function", - "inputs": [ - { - "name": "implementation_data", - "type": "src::replaceability_interface::ImplementationData" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "remove_implementation", - "type": "function", - "inputs": [ - { - "name": "implementation_data", - "type": "src::replaceability_interface::ImplementationData" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "replace_to", - "type": "function", - "inputs": [ - { - "name": "implementation_data", - "type": "src::replaceability_interface::ImplementationData" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "name": "AccessControlImplExternal", - "type": "impl", - "interface_name": "src::access_control_interface::IAccessControl" - }, - { - "name": "src::access_control_interface::IAccessControl", - "type": "interface", - "items": [ - { - "name": "has_role", - "type": "function", - "inputs": [ - { - "name": "role", - "type": "core::felt252" - }, - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "name": "get_role_admin", - "type": "function", - "inputs": [ - { - "name": "role", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - } - ] - }, - { - "name": "RolesImpl", - "type": "impl", - "interface_name": "src::roles_interface::IMinimalRoles" - }, - { - "name": "src::roles_interface::IMinimalRoles", - "type": "interface", - "items": [ - { - "name": "is_governance_admin", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "name": "is_upgrade_governor", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "name": "register_governance_admin", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "remove_governance_admin", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "register_upgrade_governor", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "remove_upgrade_governor", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "name": "renounce", - "type": "function", - "inputs": [ - { - "name": "role", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "name": "ERC20Impl", - "type": "impl", - "interface_name": "openzeppelin::token::erc20::interface::IERC20" - }, - { - "name": "openzeppelin::token::erc20::interface::IERC20", - "type": "interface", - "items": [ - { - "name": "name", - "type": "function", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "name": "symbol", - "type": "function", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "name": "decimals", - "type": "function", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "name": "total_supply", - "type": "function", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u256" - } - ], - "state_mutability": "view" - }, - { - "name": "balance_of", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::integer::u256" - } - ], - "state_mutability": "view" - }, - { - "name": "allowance", - "type": "function", - "inputs": [ - { - "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "spender", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::integer::u256" - } - ], - "state_mutability": "view" - }, - { - "name": "transfer", - "type": "function", - "inputs": [ - { - "name": "recipient", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - }, - { - "name": "transfer_from", - "type": "function", - "inputs": [ - { - "name": "sender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "recipient", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - }, - { - "name": "approve", - "type": "function", - "inputs": [ - { - "name": "spender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - } - ] - }, - { - "name": "ERC20CamelOnlyImpl", - "type": "impl", - "interface_name": "openzeppelin::token::erc20::interface::IERC20CamelOnly" - }, - { - "name": "openzeppelin::token::erc20::interface::IERC20CamelOnly", - "type": "interface", - "items": [ - { - "name": "totalSupply", - "type": "function", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u256" - } - ], - "state_mutability": "view" - }, - { - "name": "balanceOf", - "type": "function", - "inputs": [ - { - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::integer::u256" - } - ], - "state_mutability": "view" - }, - { - "name": "transferFrom", - "type": "function", - "inputs": [ - { - "name": "sender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "recipient", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "amount", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - } - ] - }, - { - "name": "constructor", - "type": "constructor", - "inputs": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "symbol", - "type": "core::felt252" - }, - { - "name": "decimals", - "type": "core::integer::u8" - }, - { - "name": "initial_supply", - "type": "core::integer::u256" - }, - { - "name": "recipient", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "permitted_minter", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "provisional_governance_admin", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "upgrade_delay", - "type": "core::integer::u64" - } - ] - }, - { - "name": "increase_allowance", - "type": "function", - "inputs": [ - { - "name": "spender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "added_value", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - }, - { - "name": "decrease_allowance", - "type": "function", - "inputs": [ - { - "name": "spender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "subtracted_value", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - }, - { - "name": "increaseAllowance", - "type": "function", - "inputs": [ - { - "name": "spender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "addedValue", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - }, - { - "name": "decreaseAllowance", - "type": "function", - "inputs": [ - { - "name": "spender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "subtractedValue", - "type": "core::integer::u256" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "external" - }, - { - "kind": "struct", - "name": "openzeppelin::token::erc20_v070::erc20::ERC20::Transfer", - "type": "event", - "members": [ - { - "kind": "data", - "name": "from", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "to", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "value", - "type": "core::integer::u256" - } - ] - }, - { - "kind": "struct", - "name": "openzeppelin::token::erc20_v070::erc20::ERC20::Approval", - "type": "event", - "members": [ - { - "kind": "data", - "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "spender", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "value", - "type": "core::integer::u256" - } - ] - }, - { - "kind": "struct", - "name": "src::replaceability_interface::ImplementationAdded", - "type": "event", - "members": [ - { - "kind": "data", - "name": "implementation_data", - "type": "src::replaceability_interface::ImplementationData" - } - ] - }, - { - "kind": "struct", - "name": "src::replaceability_interface::ImplementationRemoved", - "type": "event", - "members": [ - { - "kind": "data", - "name": "implementation_data", - "type": "src::replaceability_interface::ImplementationData" - } - ] - }, - { - "kind": "struct", - "name": "src::replaceability_interface::ImplementationReplaced", - "type": "event", - "members": [ - { - "kind": "data", - "name": "implementation_data", - "type": "src::replaceability_interface::ImplementationData" - } - ] - }, - { - "kind": "struct", - "name": "src::replaceability_interface::ImplementationFinalized", - "type": "event", - "members": [ - { - "kind": "data", - "name": "impl_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ] - }, - { - "kind": "struct", - "name": "src::access_control_interface::RoleGranted", - "type": "event", - "members": [ - { - "kind": "data", - "name": "role", - "type": "core::felt252" - }, - { - "kind": "data", - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "sender", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "kind": "struct", - "name": "src::access_control_interface::RoleRevoked", - "type": "event", - "members": [ - { - "kind": "data", - "name": "role", - "type": "core::felt252" - }, - { - "kind": "data", - "name": "account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "sender", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "kind": "struct", - "name": "src::access_control_interface::RoleAdminChanged", - "type": "event", - "members": [ - { - "kind": "data", - "name": "role", - "type": "core::felt252" - }, - { - "kind": "data", - "name": "previous_admin_role", - "type": "core::felt252" - }, - { - "kind": "data", - "name": "new_admin_role", - "type": "core::felt252" - } - ] - }, - { - "kind": "struct", - "name": "src::roles_interface::GovernanceAdminAdded", - "type": "event", - "members": [ - { - "kind": "data", - "name": "added_account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "added_by", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "kind": "struct", - "name": "src::roles_interface::GovernanceAdminRemoved", - "type": "event", - "members": [ - { - "kind": "data", - "name": "removed_account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "removed_by", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "kind": "struct", - "name": "src::roles_interface::UpgradeGovernorAdded", - "type": "event", - "members": [ - { - "kind": "data", - "name": "added_account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "added_by", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "kind": "struct", - "name": "src::roles_interface::UpgradeGovernorRemoved", - "type": "event", - "members": [ - { - "kind": "data", - "name": "removed_account", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "kind": "data", - "name": "removed_by", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "kind": "enum", - "name": "openzeppelin::token::erc20_v070::erc20::ERC20::Event", - "type": "event", - "variants": [ - { - "kind": "nested", - "name": "Transfer", - "type": "openzeppelin::token::erc20_v070::erc20::ERC20::Transfer" - }, - { - "kind": "nested", - "name": "Approval", - "type": "openzeppelin::token::erc20_v070::erc20::ERC20::Approval" - }, - { - "kind": "nested", - "name": "ImplementationAdded", - "type": "src::replaceability_interface::ImplementationAdded" - }, - { - "kind": "nested", - "name": "ImplementationRemoved", - "type": "src::replaceability_interface::ImplementationRemoved" - }, - { - "kind": "nested", - "name": "ImplementationReplaced", - "type": "src::replaceability_interface::ImplementationReplaced" - }, - { - "kind": "nested", - "name": "ImplementationFinalized", - "type": "src::replaceability_interface::ImplementationFinalized" - }, - { - "kind": "nested", - "name": "RoleGranted", - "type": "src::access_control_interface::RoleGranted" - }, - { - "kind": "nested", - "name": "RoleRevoked", - "type": "src::access_control_interface::RoleRevoked" - }, - { - "kind": "nested", - "name": "RoleAdminChanged", - "type": "src::access_control_interface::RoleAdminChanged" - }, - { - "kind": "nested", - "name": "GovernanceAdminAdded", - "type": "src::roles_interface::GovernanceAdminAdded" - }, - { - "kind": "nested", - "name": "GovernanceAdminRemoved", - "type": "src::roles_interface::GovernanceAdminRemoved" - }, - { - "kind": "nested", - "name": "UpgradeGovernorAdded", - "type": "src::roles_interface::UpgradeGovernorAdded" - }, - { - "kind": "nested", - "name": "UpgradeGovernorRemoved", - "type": "src::roles_interface::UpgradeGovernorRemoved" - } - ] - } -] diff --git a/packages/plugin-starknet/src/utils/index.ts b/packages/plugin-starknet/src/utils/index.ts deleted file mode 100644 index 9165edc5aae..00000000000 --- a/packages/plugin-starknet/src/utils/index.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { elizaLogger, IAgentRuntime } from "@ai16z/eliza"; -import { Fraction, Percent } from "@uniswap/sdk-core"; -import { Account, Contract, RpcProvider } from "starknet"; - -export const getTokenBalance = async ( - runtime: IAgentRuntime, - tokenAddress: string -) => { - const provider = getStarknetProvider(runtime); - - const { abi: tokenAbi } = await provider.getClassAt(tokenAddress); - if (tokenAbi === undefined) { - throw new Error("no abi."); - } - - const tokenContract = new Contract(tokenAbi, tokenAddress, provider); - - tokenContract.connect(getStarknetAccount(runtime)); - - return await tokenContract.balanceOf(tokenAddress); -}; - -export const getStarknetProvider = (runtime: IAgentRuntime) => { - return new RpcProvider({ - nodeUrl: runtime.getSetting("STARKNET_RPC_URL"), - }); -}; - -export const getStarknetAccount = (runtime: IAgentRuntime) => { - return new Account( - getStarknetProvider(runtime), - runtime.getSetting("STARKNET_ADDRESS"), - runtime.getSetting("STARKNET_PRIVATE_KEY") - ); -}; - -export const getPercent = (amount: string | number, decimals: number) => { - return new Percent(amount, decimals); -}; - -export const parseFormatedAmount = (amount: string) => amount.replace(/,/g, ""); - -export const PERCENTAGE_INPUT_PRECISION = 2; - -export const parseFormatedPercentage = (percent: string) => - new Percent( - +percent * 10 ** PERCENTAGE_INPUT_PRECISION, - 100 * 10 ** PERCENTAGE_INPUT_PRECISION - ); - -interface ParseCurrencyAmountOptions { - fixed: number; - significant?: number; -} - -export const formatCurrenyAmount = ( - amount: Fraction, - { fixed, significant = 1 }: ParseCurrencyAmountOptions -) => { - const fixedAmount = amount.toFixed(fixed); - const significantAmount = amount.toSignificant(significant); - - if (+significantAmount > +fixedAmount) return significantAmount; - else return +fixedAmount.toString(); -}; - -export const formatPercentage = (percentage: Percent) => { - const formatedPercentage = +percentage.toFixed(2); - const exact = percentage.equalTo( - new Percent(Math.round(formatedPercentage * 100), 10000) - ); - - return `${exact ? "" : "~"}${formatedPercentage}%`; -}; - -export type RetryConfig = { - maxRetries?: number; - delay?: number; - maxDelay?: number; - backoff?: (retryCount: number, delay: number, maxDelay: number) => number; -}; - -export async function fetchWithRetry( - url: string, - options?: RequestInit, - config: RetryConfig = {} -): Promise { - const { - maxRetries = 3, - delay = 1000, - maxDelay = 10000, - backoff = (retryCount, baseDelay, maxDelay) => - Math.min(baseDelay * Math.pow(2, retryCount), maxDelay), - } = config; - - let lastError: Error | null = null; - - for (let retryCount = 0; retryCount <= maxRetries; retryCount++) { - try { - const response = await fetch(url, options); - - if (!response.ok) { - throw new Error( - `Coingecko API HTTP status: ${response.status}` - ); - } - - return await response.json(); - } catch (error) { - elizaLogger.debug(`Error fetching ${url}:`, error); - lastError = error as Error; - - if (retryCount === maxRetries) break; - - await new Promise((resolve) => - setTimeout(resolve, backoff(retryCount, delay, maxDelay)) - ); - elizaLogger.debug(`Retry #${retryCount + 1} to fetch ${url}...`); - } - } - - throw lastError; -} diff --git a/packages/plugin-starknet/src/utils/starknetId.ts b/packages/plugin-starknet/src/utils/starknetId.ts deleted file mode 100644 index a274f30bfaa..00000000000 --- a/packages/plugin-starknet/src/utils/starknetId.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Account, starknetId } from "starknet"; - -export const isStarkDomain = (domain: string): boolean => { - return /^(?:[a-z0-9-]{1,48}(?:[a-z0-9-]{1,48}[a-z0-9-])?\.)*[a-z0-9-]{1,48}\.stark$/.test( - domain - ); -}; - -export const getAddressFromName = async ( - account: Account, - name: string -): Promise => { - const address = await account.getAddressFromStarkName(name); - if (!address.startsWith("0x") || address === "0x0") { - throw new Error("Invalid address"); - } - return address; -}; - -export const getTransferSubdomainCall = ( - account: string, - domain: string, - recipient: string -) => { - const namingContract = process.env.STARKNETID_NAMING_CONTRACT; - const identityContract = process.env.STARKNETID_IDENTITY_CONTRACT; - const newTokenId: number = Math.floor(Math.random() * 1000000000000); - const domainParts = domain.replace(".stark", "").split("."); - - const encodedDomain: string[] = domainParts.map((d) => - starknetId.useEncoded(d).toString(10) - ); - - return [ - { - contractAddress: identityContract, - entrypoint: "mint", - calldata: [newTokenId], - }, - { - contractAddress: namingContract, - entrypoint: "transfer_domain", - calldata: [domainParts.length, ...encodedDomain, newTokenId], - }, - { - contractAddress: identityContract, - entrypoint: "transfer_from", - calldata: [account, recipient, newTokenId, 0], - }, - ]; -}; diff --git a/packages/plugin-starknet/tsconfig.json b/packages/plugin-starknet/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/plugin-starknet/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-starknet/tsup.config.ts b/packages/plugin-starknet/tsup.config.ts deleted file mode 100644 index b5e4388b214..00000000000 --- a/packages/plugin-starknet/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "zod", - // Add other modules you want to externalize - ], -}); diff --git a/packages/plugin-tee/.npmignore b/packages/plugin-tee/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-tee/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-tee/README.md b/packages/plugin-tee/README.md deleted file mode 100644 index 5933b13b733..00000000000 --- a/packages/plugin-tee/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Plugin TEE - -A plugin for handling Trusted Execution Environment (TEE) operations. - -## Providers - -This plugin includes several providers for handling different TEE-related operations. - -### DeriveKeyProvider - -The `DeriveKeyProvider` allows for secure key derivation within a TEE environment. It supports deriving keys for both Solana (Ed25519) and Ethereum (ECDSA) chains. - -#### Usage - -```typescript -import { DeriveKeyProvider } from "@ai16z/plugin-tee"; - -// Initialize the provider -const provider = new DeriveKeyProvider(); - -// Derive a raw key -try { - const rawKey = await provider.rawDeriveKey( - "/path/to/derive", - "subject-identifier" - ); - // rawKey is a DeriveKeyResponse that can be used for further processing - // to get the uint8Array do the following - const rawKeyArray = rawKey.asUint8Array(); -} catch (error) { - console.error("Raw key derivation failed:", error); -} - -// Derive a Solana keypair (Ed25519) -try { - const solanaKeypair = await provider.deriveEd25519Keypair( - "/path/to/derive", - "subject-identifier" - ); - // solanaKeypair can now be used for Solana operations -} catch (error) { - console.error("Solana key derivation failed:", error); -} - -// Derive an Ethereum keypair (ECDSA) -try { - const evmKeypair = await provider.deriveEcdsaKeypair( - "/path/to/derive", - "subject-identifier" - ); - // evmKeypair can now be used for Ethereum operations -} catch (error) { - console.error("EVM key derivation failed:", error); -} -``` - -### RemoteAttestationProvider - -The `RemoteAttestationProvider` allows for generating a remote attestation within a TEE environment. - -#### Usage - -```typescript -const provider = new RemoteAttestationProvider(); - -try { - const attestation = await provider.generateAttestation("your-report-data"); - console.log("Attestation:", attestation); -} catch (error) { - console.error("Failed to generate attestation:", error); -} -``` - -### Configuration - -To get a TEE simulator for local testing, use the following commands: - -```bash -docker pull phalanetwork/tappd-simulator:latest -# by default the simulator is available in localhost:8090 -docker run --rm -p 8090:8090 phalanetwork/tappd-simulator:latest -``` - -When using the provider through the runtime environment, ensure the following settings are configured: - -```env -DSTACK_SIMULATOR_ENDPOINT="your-endpoint-url" # Optional, for simulator purposes if testing on mac or windows -WALLET_SECRET_SALT=your-secret-salt // Required to single agent deployments -``` diff --git a/packages/plugin-tee/eslint.config.mjs b/packages/plugin-tee/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-tee/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-tee/package.json b/packages/plugin-tee/package.json deleted file mode 100644 index 6793587c8cc..00000000000 --- a/packages/plugin-tee/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@ai16z/plugin-tee", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "@phala/dstack-sdk": "0.1.6", - "@solana/spl-token": "0.4.9", - "@solana/web3.js": "1.95.8", - "bignumber": "1.1.0", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "node-cache": "5.1.2", - "pumpdotfun-sdk": "1.3.2", - "tsup": "8.3.5", - "viem": "2.21.53" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-tee/src/index.ts b/packages/plugin-tee/src/index.ts deleted file mode 100644 index 7f0225b0be8..00000000000 --- a/packages/plugin-tee/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Plugin } from "@ai16z/eliza"; -import { remoteAttestationProvider } from "./providers/remoteAttestationProvider"; -import { deriveKeyProvider } from "./providers/deriveKeyProvider"; - -export { DeriveKeyProvider } from "./providers/deriveKeyProvider"; -export { RemoteAttestationProvider } from "./providers/remoteAttestationProvider"; -export { RemoteAttestationQuote, TEEMode } from "./types/tee"; - -export const teePlugin: Plugin = { - name: "tee", - description: - "TEE plugin with actions to generate remote attestations and derive keys", - actions: [ - /* custom actions */ - ], - evaluators: [ - /* custom evaluators */ - ], - providers: [ - /* custom providers */ - remoteAttestationProvider, - deriveKeyProvider, - ], - services: [ - /* custom services */ - ], -}; diff --git a/packages/plugin-tee/src/providers/deriveKeyProvider.ts b/packages/plugin-tee/src/providers/deriveKeyProvider.ts deleted file mode 100644 index 65b6e83676e..00000000000 --- a/packages/plugin-tee/src/providers/deriveKeyProvider.ts +++ /dev/null @@ -1,190 +0,0 @@ -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { Keypair } from "@solana/web3.js"; -import crypto from "crypto"; -import { DeriveKeyResponse, TappdClient } from "@phala/dstack-sdk"; -import { privateKeyToAccount } from "viem/accounts"; -import { PrivateKeyAccount, keccak256 } from "viem"; -import { RemoteAttestationProvider } from "./remoteAttestationProvider"; -import { TEEMode, RemoteAttestationQuote } from "../types/tee"; - -interface DeriveKeyAttestationData { - agentId: string; - publicKey: string; -} - -class DeriveKeyProvider { - private client: TappdClient; - private raProvider: RemoteAttestationProvider; - - constructor(teeMode?: string) { - let endpoint: string | undefined; - - // Both LOCAL and DOCKER modes use the simulator, just with different endpoints - switch(teeMode) { - case TEEMode.LOCAL: - endpoint = "http://localhost:8090"; - console.log("TEE: Connecting to local simulator at localhost:8090"); - break; - case TEEMode.DOCKER: - endpoint = "http://host.docker.internal:8090"; - console.log("TEE: Connecting to simulator via Docker at host.docker.internal:8090"); - break; - case TEEMode.PRODUCTION: - endpoint = undefined; - console.log("TEE: Running in production mode without simulator"); - break; - default: - throw new Error(`Invalid TEE_MODE: ${teeMode}. Must be one of: LOCAL, DOCKER, PRODUCTION`); - } - - this.client = endpoint ? new TappdClient(endpoint) : new TappdClient(); - this.raProvider = new RemoteAttestationProvider(teeMode); - } - - private async generateDeriveKeyAttestation(agentId: string, publicKey: string): Promise { - const deriveKeyData: DeriveKeyAttestationData = { - agentId, - publicKey - } - const reportdata = JSON.stringify(deriveKeyData); - console.log("Generating Remote Attestation Quote for Derive Key..."); - const quote = await this.raProvider.generateAttestation(reportdata); - console.log("Remote Attestation Quote generated successfully!"); - return quote; - } - - - async rawDeriveKey( - path: string, - subject: string - ): Promise { - try { - if (!path || !subject) { - console.error( - "Path and Subject are required for key derivation" - ); - } - - console.log("Deriving Raw Key in TEE..."); - const derivedKey = await this.client.deriveKey(path, subject); - - console.log("Raw Key Derived Successfully!"); - return derivedKey; - } catch (error) { - console.error("Error deriving raw key:", error); - throw error; - } - } - - async deriveEd25519Keypair( - path: string, - subject: string, - agentId: string - ): Promise<{ keypair: Keypair, attestation: RemoteAttestationQuote }> { - try { - if (!path || !subject) { - console.error( - "Path and Subject are required for key derivation" - ); - } - - console.log("Deriving Key in TEE..."); - const derivedKey = await this.client.deriveKey(path, subject); - const uint8ArrayDerivedKey = derivedKey.asUint8Array(); - - const hash = crypto.createHash("sha256"); - hash.update(uint8ArrayDerivedKey); - const seed = hash.digest(); - const seedArray = new Uint8Array(seed); - const keypair = Keypair.fromSeed(seedArray.slice(0, 32)); - - // Generate an attestation for the derived key data for public to verify - const attestation = await this.generateDeriveKeyAttestation( - agentId, - keypair.publicKey.toBase58() - ); - console.log("Key Derived Successfully!"); - - return { keypair, attestation }; - } catch (error) { - console.error("Error deriving key:", error); - throw error; - } - } - - async deriveEcdsaKeypair( - path: string, - subject: string, - agentId: string - ): Promise<{ keypair: PrivateKeyAccount, attestation: RemoteAttestationQuote }> { - try { - if (!path || !subject) { - console.error( - "Path and Subject are required for key derivation" - ); - } - - console.log("Deriving ECDSA Key in TEE..."); - const deriveKeyResponse: DeriveKeyResponse = - await this.client.deriveKey(path, subject); - const hex = keccak256(deriveKeyResponse.asUint8Array()); - const keypair: PrivateKeyAccount = privateKeyToAccount(hex); - - // Generate an attestation for the derived key data for public to verify - const attestation = await this.generateDeriveKeyAttestation( - agentId, - keypair.address - ); - console.log("ECDSA Key Derived Successfully!"); - - return { keypair, attestation }; - } catch (error) { - console.error("Error deriving ecdsa key:", error); - throw error; - } - } -} - -const deriveKeyProvider: Provider = { - get: async (runtime: IAgentRuntime, _message?: Memory, _state?: State) => { - const teeMode = runtime.getSetting("TEE_MODE"); - const provider = new DeriveKeyProvider(teeMode); - const agentId = runtime.agentId; - try { - // Validate wallet configuration - if (!runtime.getSetting("WALLET_SECRET_SALT")) { - console.error( - "Wallet secret salt is not configured in settings" - ); - return ""; - } - - try { - const secretSalt = - runtime.getSetting("WALLET_SECRET_SALT") || "secret_salt"; - const solanaKeypair = await provider.deriveEd25519Keypair( - "/", - secretSalt, - agentId - ); - const evmKeypair = await provider.deriveEcdsaKeypair( - "/", - secretSalt, - agentId - ); - return JSON.stringify({ - solana: solanaKeypair.keypair.publicKey, - evm: evmKeypair.keypair.address, - }); - } catch (error) { - console.error("Error creating PublicKey:", error); - return ""; - } - } catch (error) { - console.error("Error in derive key provider:", error.message); - return `Failed to fetch derive key information: ${error instanceof Error ? error.message : "Unknown error"}`; - } - }, -}; - -export { deriveKeyProvider, DeriveKeyProvider }; diff --git a/packages/plugin-tee/src/providers/remoteAttestationProvider.ts b/packages/plugin-tee/src/providers/remoteAttestationProvider.ts deleted file mode 100644 index a5024b6a283..00000000000 --- a/packages/plugin-tee/src/providers/remoteAttestationProvider.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { TdxQuoteResponse, TappdClient } from "@phala/dstack-sdk"; -import { RemoteAttestationQuote, TEEMode } from "../types/tee"; - -class RemoteAttestationProvider { - private client: TappdClient; - - constructor(teeMode?: string) { - let endpoint: string | undefined; - - // Both LOCAL and DOCKER modes use the simulator, just with different endpoints - switch(teeMode) { - case TEEMode.LOCAL: - endpoint = "http://localhost:8090"; - console.log("TEE: Connecting to local simulator at localhost:8090"); - break; - case TEEMode.DOCKER: - endpoint = "http://host.docker.internal:8090"; - console.log("TEE: Connecting to simulator via Docker at host.docker.internal:8090"); - break; - case TEEMode.PRODUCTION: - endpoint = undefined; - console.log("TEE: Running in production mode without simulator"); - break; - default: - throw new Error(`Invalid TEE_MODE: ${teeMode}. Must be one of: LOCAL, DOCKER, PRODUCTION`); - } - - this.client = endpoint ? new TappdClient(endpoint) : new TappdClient(); - } - - async generateAttestation(reportData: string): Promise { - try { - console.log("Generating attestation for: ", reportData); - const tdxQuote: TdxQuoteResponse = await this.client.tdxQuote(reportData); - const rtmrs = tdxQuote.replayRtmrs(); - console.log(`rtmr0: ${rtmrs[0]}\nrtmr1: ${rtmrs[1]}\nrtmr2: ${rtmrs[2]}\nrtmr3: ${rtmrs[3]}f`); - const quote: RemoteAttestationQuote = { - quote: tdxQuote.quote, - timestamp: Date.now(), - }; - console.log("Remote attestation quote: ", quote); - return quote; - } catch (error) { - console.error("Error generating remote attestation:", error); - throw new Error( - `Failed to generate TDX Quote: ${ - error instanceof Error ? error.message : "Unknown error" - }` - ); - } - } -} - -// Keep the original provider for backwards compatibility -const remoteAttestationProvider: Provider = { - get: async (runtime: IAgentRuntime, _message: Memory, _state?: State) => { - const teeMode = runtime.getSetting("TEE_MODE"); - const provider = new RemoteAttestationProvider(teeMode); - const agentId = runtime.agentId; - - try { - console.log("Generating attestation for: ", agentId); - const attestation = await provider.generateAttestation(agentId); - return `Your Agent's remote attestation is: ${JSON.stringify(attestation)}`; - } catch (error) { - console.error("Error in remote attestation provider:", error); - throw new Error( - `Failed to generate TDX Quote: ${ - error instanceof Error ? error.message : "Unknown error" - }` - ); - } - }, -}; - -export { remoteAttestationProvider, RemoteAttestationProvider }; diff --git a/packages/plugin-tee/src/providers/walletProvider.ts b/packages/plugin-tee/src/providers/walletProvider.ts deleted file mode 100644 index a12ad711929..00000000000 --- a/packages/plugin-tee/src/providers/walletProvider.ts +++ /dev/null @@ -1,316 +0,0 @@ -/* This is an example of how WalletProvider can use DeriveKeyProvider to generate a Solana Keypair */ -import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { Connection, Keypair, PublicKey } from "@solana/web3.js"; -import BigNumber from "bignumber.js"; -import NodeCache from "node-cache"; -import { DeriveKeyProvider } from "./deriveKeyProvider"; -import { RemoteAttestationQuote } from "../types/tee"; -// Provider configuration -const PROVIDER_CONFIG = { - BIRDEYE_API: "https://public-api.birdeye.so", - MAX_RETRIES: 3, - RETRY_DELAY: 2000, - DEFAULT_RPC: "https://api.mainnet-beta.solana.com", - TOKEN_ADDRESSES: { - SOL: "So11111111111111111111111111111111111111112", - BTC: "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", - ETH: "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", - }, -}; - -export interface Item { - name: string; - address: string; - symbol: string; - decimals: number; - balance: string; - uiAmount: string; - priceUsd: string; - valueUsd: string; - valueSol?: string; -} - -interface WalletPortfolio { - totalUsd: string; - totalSol?: string; - items: Array; -} - -interface _BirdEyePriceData { - data: { - [key: string]: { - price: number; - priceChange24h: number; - }; - }; -} - -interface Prices { - solana: { usd: string }; - bitcoin: { usd: string }; - ethereum: { usd: string }; -} - -export class WalletProvider { - private cache: NodeCache; - - constructor( - private connection: Connection, - private walletPublicKey: PublicKey - ) { - this.cache = new NodeCache({ stdTTL: 300 }); // Cache TTL set to 5 minutes - } - - private async fetchWithRetry( - runtime, - url: string, - options: RequestInit = {} - ): Promise { - let lastError: Error; - - for (let i = 0; i < PROVIDER_CONFIG.MAX_RETRIES; i++) { - try { - const apiKey = runtime.getSetting("BIRDEYE_API_KEY"); - const response = await fetch(url, { - ...options, - headers: { - Accept: "application/json", - "x-chain": "solana", - "X-API-KEY": apiKey || "", - ...options.headers, - }, - }); - - if (!response.ok) { - const errorText = await response.text(); - throw new Error( - `HTTP error! status: ${response.status}, message: ${errorText}` - ); - } - - const data = await response.json(); - return data; - } catch (error) { - console.error(`Attempt ${i + 1} failed:`, error); - lastError = error; - if (i < PROVIDER_CONFIG.MAX_RETRIES - 1) { - const delay = PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i); - await new Promise((resolve) => setTimeout(resolve, delay)); - continue; - } - } - } - - console.error( - "All attempts failed. Throwing the last error:", - lastError - ); - throw lastError; - } - - async fetchPortfolioValue(runtime): Promise { - try { - const cacheKey = `portfolio-${this.walletPublicKey.toBase58()}`; - const cachedValue = this.cache.get(cacheKey); - - if (cachedValue) { - console.log("Cache hit for fetchPortfolioValue"); - return cachedValue; - } - console.log("Cache miss for fetchPortfolioValue"); - - const walletData = await this.fetchWithRetry( - runtime, - `${PROVIDER_CONFIG.BIRDEYE_API}/v1/wallet/token_list?wallet=${this.walletPublicKey.toBase58()}` - ); - - if (!walletData?.success || !walletData?.data) { - console.error("No portfolio data available", walletData); - throw new Error("No portfolio data available"); - } - - const data = walletData.data; - const totalUsd = new BigNumber(data.totalUsd.toString()); - const prices = await this.fetchPrices(runtime); - const solPriceInUSD = new BigNumber(prices.solana.usd.toString()); - - const items = data.items.map((item: any) => ({ - ...item, - valueSol: new BigNumber(item.valueUsd || 0) - .div(solPriceInUSD) - .toFixed(6), - name: item.name || "Unknown", - symbol: item.symbol || "Unknown", - priceUsd: item.priceUsd || "0", - valueUsd: item.valueUsd || "0", - })); - - const totalSol = totalUsd.div(solPriceInUSD); - const portfolio = { - totalUsd: totalUsd.toString(), - totalSol: totalSol.toFixed(6), - items: items.sort((a, b) => - new BigNumber(b.valueUsd) - .minus(new BigNumber(a.valueUsd)) - .toNumber() - ), - }; - this.cache.set(cacheKey, portfolio); - return portfolio; - } catch (error) { - console.error("Error fetching portfolio:", error); - throw error; - } - } - - async fetchPrices(runtime): Promise { - try { - const cacheKey = "prices"; - const cachedValue = this.cache.get(cacheKey); - - if (cachedValue) { - console.log("Cache hit for fetchPrices"); - return cachedValue; - } - console.log("Cache miss for fetchPrices"); - - const { SOL, BTC, ETH } = PROVIDER_CONFIG.TOKEN_ADDRESSES; - const tokens = [SOL, BTC, ETH]; - const prices: Prices = { - solana: { usd: "0" }, - bitcoin: { usd: "0" }, - ethereum: { usd: "0" }, - }; - - for (const token of tokens) { - const response = await this.fetchWithRetry( - runtime, - `${PROVIDER_CONFIG.BIRDEYE_API}/defi/price?address=${token}`, - { - headers: { - "x-chain": "solana", - }, - } - ); - - if (response?.data?.value) { - const price = response.data.value.toString(); - prices[ - token === SOL - ? "solana" - : token === BTC - ? "bitcoin" - : "ethereum" - ].usd = price; - } else { - console.warn(`No price data available for token: ${token}`); - } - } - - this.cache.set(cacheKey, prices); - return prices; - } catch (error) { - console.error("Error fetching prices:", error); - throw error; - } - } - - formatPortfolio( - runtime, - portfolio: WalletPortfolio, - prices: Prices - ): string { - let output = `${runtime.character.description}\n`; - output += `Wallet Address: ${this.walletPublicKey.toBase58()}\n\n`; - - const totalUsdFormatted = new BigNumber(portfolio.totalUsd).toFixed(2); - const totalSolFormatted = portfolio.totalSol; - - output += `Total Value: $${totalUsdFormatted} (${totalSolFormatted} SOL)\n\n`; - output += "Token Balances:\n"; - - const nonZeroItems = portfolio.items.filter((item) => - new BigNumber(item.uiAmount).isGreaterThan(0) - ); - - if (nonZeroItems.length === 0) { - output += "No tokens found with non-zero balance\n"; - } else { - for (const item of nonZeroItems) { - const valueUsd = new BigNumber(item.valueUsd).toFixed(2); - output += `${item.name} (${item.symbol}): ${new BigNumber( - item.uiAmount - ).toFixed(6)} ($${valueUsd} | ${item.valueSol} SOL)\n`; - } - } - - output += "\nMarket Prices:\n"; - output += `SOL: $${new BigNumber(prices.solana.usd).toFixed(2)}\n`; - output += `BTC: $${new BigNumber(prices.bitcoin.usd).toFixed(2)}\n`; - output += `ETH: $${new BigNumber(prices.ethereum.usd).toFixed(2)}\n`; - - return output; - } - - async getFormattedPortfolio(runtime): Promise { - try { - const [portfolio, prices] = await Promise.all([ - this.fetchPortfolioValue(runtime), - this.fetchPrices(runtime), - ]); - - return this.formatPortfolio(runtime, portfolio, prices); - } catch (error) { - console.error("Error generating portfolio report:", error); - return "Unable to fetch wallet information. Please try again later."; - } - } -} - -const walletProvider: Provider = { - get: async ( - runtime: IAgentRuntime, - _message: Memory, - _state?: State - ): Promise => { - const agentId = runtime.agentId; - const teeMode = runtime.getSetting("TEE_MODE"); - const deriveKeyProvider = new DeriveKeyProvider(teeMode); - try { - // Validate wallet configuration - if (!runtime.getSetting("WALLET_SECRET_SALT")) { - console.error( - "Wallet secret salt is not configured in settings" - ); - return ""; - } - - let publicKey: PublicKey; - try { - const derivedKeyPair: { keypair: Keypair, attestation: RemoteAttestationQuote } = - await deriveKeyProvider.deriveEd25519Keypair( - "/", - runtime.getSetting("WALLET_SECRET_SALT"), - agentId - ); - publicKey = derivedKeyPair.keypair.publicKey; - console.log("Wallet Public Key: ", publicKey.toBase58()); - } catch (error) { - console.error("Error creating PublicKey:", error); - return ""; - } - - const connection = new Connection(PROVIDER_CONFIG.DEFAULT_RPC); - const provider = new WalletProvider(connection, publicKey); - - const porfolio = await provider.getFormattedPortfolio(runtime); - return porfolio; - } catch (error) { - console.error("Error in wallet provider:", error.message); - return `Failed to fetch wallet information: ${error instanceof Error ? error.message : "Unknown error"}`; - } - }, -}; - -// Module exports -export { walletProvider }; diff --git a/packages/plugin-tee/src/types/tee.ts b/packages/plugin-tee/src/types/tee.ts deleted file mode 100644 index 8cdcae0b93a..00000000000 --- a/packages/plugin-tee/src/types/tee.ts +++ /dev/null @@ -1,11 +0,0 @@ -export enum TEEMode { - OFF = "OFF", - LOCAL = "LOCAL", // For local development with simulator - DOCKER = "DOCKER", // For docker development with simulator - PRODUCTION = "PRODUCTION" // For production without simulator -} - -export interface RemoteAttestationQuote { - quote: string; - timestamp: number; -} \ No newline at end of file diff --git a/packages/plugin-tee/tsconfig.json b/packages/plugin-tee/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/plugin-tee/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-tee/tsup.config.ts b/packages/plugin-tee/tsup.config.ts deleted file mode 100644 index b94c126be77..00000000000 --- a/packages/plugin-tee/tsup.config.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - // Add other modules you want to externalize - "@phala/dstack-sdk", - "safe-buffer", - "base-x", - "bs58", - "borsh", - "@solana/buffer-layout", - "stream", - "buffer", - ], -}); diff --git a/packages/plugin-trustdb/.npmignore b/packages/plugin-trustdb/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-trustdb/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-trustdb/eslint.config.mjs b/packages/plugin-trustdb/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-trustdb/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-trustdb/package.json b/packages/plugin-trustdb/package.json deleted file mode 100644 index f2d904a0cb7..00000000000 --- a/packages/plugin-trustdb/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@ai16z/plugin-trustdb", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "dompurify": "3.2.2", - "tsup": "8.3.5", - "uuid": "11.0.3", - "vitest": "2.1.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest", - "lint": "eslint . --fix" - }, - "devDependencies": { - "@types/dompurify": "3.2.0" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts b/packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts deleted file mode 100644 index c1ac5eecb88..00000000000 --- a/packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts +++ /dev/null @@ -1,1425 +0,0 @@ -import { Database } from "better-sqlite3"; -import { v4 as uuidv4 } from "uuid"; - -export interface Recommender { - id: string; // UUID - address: string; - solanaPubkey?: string; - telegramId?: string; - discordId?: string; - twitterId?: string; - ip?: string; -} - -export interface RecommenderMetrics { - recommenderId: string; - trustScore: number; - totalRecommendations: number; - successfulRecs: number; - avgTokenPerformance: number; - riskScore: number; - consistencyScore: number; - virtualConfidence: number; - lastActiveDate: Date; - trustDecay: number; - lastUpdated: Date; -} - -export interface TokenPerformance { - tokenAddress: string; - symbol: string; - priceChange24h: number; - volumeChange24h: number; - trade_24h_change: number; - liquidity: number; - liquidityChange24h: number; - holderChange24h: number; - rugPull: boolean; - isScam: boolean; - marketCapChange24h: number; - sustainedGrowth: boolean; - rapidDump: boolean; - suspiciousVolume: boolean; - validationTrust: number; - balance: number; - initialMarketCap: number; - lastUpdated: Date; -} - -export interface TokenRecommendation { - id: string; // UUID - recommenderId: string; - tokenAddress: string; - timestamp: Date; - initialMarketCap?: number; - initialLiquidity?: number; - initialPrice?: number; -} -export interface RecommenderMetricsHistory { - historyId: string; // UUID - recommenderId: string; - trustScore: number; - totalRecommendations: number; - successfulRecs: number; - avgTokenPerformance: number; - riskScore: number; - consistencyScore: number; - virtualConfidence: number; - trustDecay: number; - recordedAt: Date; -} - -export interface TradePerformance { - token_address: string; - recommender_id: string; - buy_price: number; - sell_price: number; - buy_timeStamp: string; - sell_timeStamp: string; - buy_amount: number; - sell_amount: number; - buy_sol: number; - received_sol: number; - buy_value_usd: number; - sell_value_usd: number; - profit_usd: number; - profit_percent: number; - buy_market_cap: number; - sell_market_cap: number; - market_cap_change: number; - buy_liquidity: number; - sell_liquidity: number; - liquidity_change: number; - last_updated: string; - rapidDump: boolean; -} - -interface RecommenderMetricsRow { - recommender_id: string; - trust_score: number; - total_recommendations: number; - successful_recs: number; - avg_token_performance: number; - risk_score: number; - consistency_score: number; - virtual_confidence: number; - last_active_date: Date; - trust_decay: number; - last_updated: string; -} - -interface TokenPerformanceRow { - token_address: string; - symbol: string; - price_change_24h: number; - volume_change_24h: number; - trade_24h_change: number; - liquidity: number; - liquidity_change_24h: number; - holder_change_24h: number; - rug_pull: number; - is_scam: number; - market_cap_change24h: number; - sustained_growth: number; - rapid_dump: number; - suspicious_volume: number; - validation_trust: number; - balance: number; - initial_market_cap: number; - last_updated: string; -} - -interface Transaction { - tokenAddress: string; - transactionHash: string; - type: "buy" | "sell"; - amount: number; - price: number; - isSimulation: boolean; - timestamp: string; -} - -export class TrustScoreDatabase { - private db: Database; - - constructor(db: Database) { - this.db = db; - // load(db); - // check if the tables exist, if not create them - const tables = this.db - .prepare( - "SELECT name FROM sqlite_master WHERE type='table' AND name IN ('recommenders', 'recommender_metrics', 'token_performance', 'token_recommendations', 'recommender_metrics_history');" - ) - .all(); - if (tables.length !== 5) { - this.initializeSchema(); - } - } - - private initializeSchema() { - // Enable Foreign Key Support - this.db.exec(`PRAGMA foreign_keys = ON;`); - - // Create Recommenders Table - this.db.exec(` - CREATE TABLE IF NOT EXISTS recommenders ( - id TEXT PRIMARY KEY, - address TEXT UNIQUE NOT NULL, - solana_pubkey TEXT UNIQUE, - telegram_id TEXT UNIQUE, - discord_id TEXT UNIQUE, - twitter_id TEXT UNIQUE, - ip TEXT - ); - `); - - // Create RecommenderMetrics Table - this.db.exec(` - CREATE TABLE IF NOT EXISTS recommender_metrics ( - recommender_id TEXT PRIMARY KEY, - trust_score REAL DEFAULT 0, - total_recommendations INTEGER DEFAULT 0, - successful_recs INTEGER DEFAULT 0, - avg_token_performance REAL DEFAULT 0, - risk_score REAL DEFAULT 0, - consistency_score REAL DEFAULT 0, - virtual_confidence REAL DEFAULT 0, - last_active_date DATETIME DEFAULT CURRENT_TIMESTAMP, - trust_decay REAL DEFAULT 0, - last_updated DATETIME DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (recommender_id) REFERENCES recommenders(id) ON DELETE CASCADE - ); - `); - - // Create TokenPerformance Table - this.db.exec(` - CREATE TABLE IF NOT EXISTS token_performance ( - token_address TEXT PRIMARY KEY, - symbol TEXT, - price_change_24h REAL, - volume_change_24h REAL, - trade_24h_change REAL, - liquidity REAL, - liquidity_change_24h REAL, - holder_change_24h REAL, - rug_pull BOOLEAN DEFAULT FALSE, - is_scam BOOLEAN DEFAULT FALSE, - market_cap_change24h REAL, - sustained_growth BOOLEAN DEFAULT FALSE, - rapid_dump BOOLEAN DEFAULT FALSE, - suspicious_volume BOOLEAN DEFAULT FALSE, - validation_trust REAL DEFAULT 0, - balance REAL DEFAULT 0, - initial_market_cap REAL DEFAULT 0, - last_updated DATETIME DEFAULT CURRENT_TIMESTAMP - ); - `); - - // Create TokenRecommendations Table - this.db.exec(` - CREATE TABLE IF NOT EXISTS token_recommendations ( - id TEXT PRIMARY KEY, - recommender_id TEXT NOT NULL, - token_address TEXT NOT NULL, - timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, - initial_market_cap REAL, - initial_liquidity REAL, - initial_price REAL, - FOREIGN KEY (recommender_id) REFERENCES recommenders(id) ON DELETE CASCADE, - FOREIGN KEY (token_address) REFERENCES token_performance(token_address) ON DELETE CASCADE - ); - `); - - // ----- Create RecommenderMetricsHistory Table ----- - this.db.exec(` - CREATE TABLE IF NOT EXISTS recommender_metrics_history ( - history_id TEXT PRIMARY KEY, - recommender_id TEXT NOT NULL, - trust_score REAL, - total_recommendations INTEGER, - successful_recs INTEGER, - avg_token_performance REAL, - risk_score REAL, - consistency_score REAL, - virtual_confidence REAL DEFAULT 0, - recorded_at DATETIME DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (recommender_id) REFERENCES recommenders(id) ON DELETE CASCADE - ); - `); - - // ----- Create TradePerformance Tables ----- - this.db.exec(` - CREATE TABLE IF NOT EXISTS trade ( - token_address TEXT NOT NULL, - recommender_id TEXT NOT NULL, - sell_recommender_id TEXT, - buy_price REAL NOT NULL, - sell_price REAL, - buy_timeStamp TEXT NOT NULL, - sell_timeStamp TEXT, - buy_amount REAL NOT NULL, - sell_amount REAL, - buy_sol REAL NOT NULL, - received_sol REAL, - buy_value_usd REAL NOT NULL, - sell_value_usd REAL, - profit_usd REAL, - profit_percent REAL, - buy_market_cap REAL NOT NULL, - sell_market_cap REAL, - market_cap_change REAL, - buy_liquidity REAL NOT NULL, - sell_liquidity REAL, - liquidity_change REAL, - last_updated TEXT DEFAULT (datetime('now')), - rapidDump BOOLEAN DEFAULT FALSE, - PRIMARY KEY (token_address, recommender_id, buy_timeStamp), - FOREIGN KEY (token_address) REFERENCES token_performance(token_address) ON DELETE CASCADE, - FOREIGN KEY (recommender_id) REFERENCES recommenders(id) ON DELETE CASCADE - ); - `); - // create trade simulation table - this.db.exec(` - CREATE TABLE IF NOT EXISTS simulation_trade ( - token_address TEXT NOT NULL, - recommender_id TEXT NOT NULL, - buy_price REAL NOT NULL, - sell_price REAL, - buy_timeStamp TEXT NOT NULL, - sell_timeStamp TEXT, - buy_amount REAL NOT NULL, - sell_amount REAL, - buy_sol REAL NOT NULL, - received_sol REAL, - buy_value_usd REAL NOT NULL, - sell_value_usd REAL, - profit_usd REAL, - profit_percent REAL, - buy_market_cap REAL NOT NULL, - sell_market_cap REAL, - market_cap_change REAL, - buy_liquidity REAL NOT NULL, - sell_liquidity REAL, - liquidity_change REAL, - last_updated TEXT DEFAULT (datetime('now')), - rapidDump BOOLEAN DEFAULT FALSE, - PRIMARY KEY (token_address, recommender_id, buy_timeStamp), - FOREIGN KEY (token_address) REFERENCES token_performance(token_address) ON DELETE CASCADE, - FOREIGN KEY (recommender_id) REFERENCES recommenders(id) ON DELETE CASCADE - ); - `); - - // create transactions table - this.db.exec(` - CREATE TABLE IF NOT EXISTS transactions ( - token_address TEXT NOT NULL, - transaction_hash TEXT PRIMARY KEY, - type TEXT NOT NULL, - amount REAL NOT NULL, - price REAL NOT NULL, - timestamp TEXT NOT NULL, - is_simulation BOOLEAN DEFAULT FALSE, - FOREIGN KEY (token_address) REFERENCES token_performance(token_address) ON DELETE CASCADE - ); - `); - } - - /** - * Adds a new recommender to the database. - * @param recommender Recommender object - * @returns boolean indicating success - */ - addRecommender(recommender: Recommender): string | null { - const sql = ` - INSERT INTO recommenders (id, address, solana_pubkey, telegram_id, discord_id, twitter_id, ip) - VALUES (?, ?, ?, ?, ?, ?, ?) - ON CONFLICT(address) DO NOTHING; - `; - try { - const id = recommender.id || uuidv4(); - const result = this.db - .prepare(sql) - .run( - id, - recommender.address, - recommender.solanaPubkey || null, - recommender.telegramId || null, - recommender.discordId || null, - recommender.twitterId || null, - recommender.ip || null - ); - return result.changes > 0 ? id : null; - } catch (error) { - console.error("Error adding recommender:", error); - return null; - } - } - - /** - * Retrieves a recommender by any identifier. - * @param identifier Any of the recommender's identifiers - * @returns Recommender object or null - */ - getRecommender(identifier: string): Recommender | null { - const sql = ` - SELECT * FROM recommenders - WHERE id = ? OR address = ? OR solana_pubkey = ? OR telegram_id = ? OR discord_id = ? OR twitter_id = ?; - `; - const recommender = this.db - .prepare(sql) - .get( - identifier, - identifier, - identifier, - identifier, - identifier, - identifier - ) as Recommender | undefined; - return recommender || null; - } - - /** - * Retrieves an existing recommender or creates a new one if not found. - * Also initializes metrics for the recommender if they haven't been initialized yet. - * @param recommender Recommender object containing at least one identifier - * @returns Recommender object with all details, or null if failed - */ - getOrCreateRecommender(recommender: Recommender): Recommender | null { - try { - // Begin a transaction - const transaction = this.db.transaction(() => { - // Attempt to retrieve the recommender - const existingRecommender = this.getRecommender( - recommender.address - ); - if (existingRecommender) { - // Recommender exists, ensure metrics are initialized - this.initializeRecommenderMetrics(existingRecommender.id!); - return existingRecommender; - } - - // Recommender does not exist, create a new one - const newRecommenderId = this.addRecommender(recommender); - if (!newRecommenderId) { - throw new Error("Failed to add new recommender."); - } - - // Initialize metrics for the new recommender - const metricsInitialized = - this.initializeRecommenderMetrics(newRecommenderId); - if (!metricsInitialized) { - throw new Error( - "Failed to initialize recommender metrics." - ); - } - - // Retrieve and return the newly created recommender - const newRecommender = this.getRecommender(newRecommenderId); - if (!newRecommender) { - throw new Error( - "Failed to retrieve the newly created recommender." - ); - } - - return newRecommender; - }); - - // Execute the transaction and return the recommender - const recommenderResult = transaction(); - return recommenderResult; - } catch (error) { - console.error("Error in getOrCreateRecommender:", error); - return null; - } - } - - /** - * Retrieves an existing recommender or creates a new one if not found. - * Also initializes metrics for the recommender if they haven't been initialized yet. - * @param discordId Discord ID of the recommender - * @returns Recommender object with all details, or null if failed - */ - - async getOrCreateRecommenderWithDiscordId( - discordId: string - ): Promise { - try { - // Begin a transaction - const transaction = this.db.transaction(() => { - // Attempt to retrieve the recommender - const existingRecommender = this.getRecommender(discordId); - if (existingRecommender) { - // Recommender exists, ensure metrics are initialized - this.initializeRecommenderMetrics(existingRecommender.id!); - return existingRecommender; - } - - // Recommender does not exist, create a new one - const newRecommender = { - id: uuidv4(), - address: discordId, - discordId: discordId, - }; - const newRecommenderId = this.addRecommender(newRecommender); - if (!newRecommenderId) { - throw new Error("Failed to add new recommender."); - } - - // Initialize metrics for the new recommender - const metricsInitialized = - this.initializeRecommenderMetrics(newRecommenderId); - if (!metricsInitialized) { - throw new Error( - "Failed to initialize recommender metrics." - ); - } - - // Retrieve and return the newly created recommender - const recommender = this.getRecommender(newRecommenderId); - if (!recommender) { - throw new Error( - "Failed to retrieve the newly created recommender." - ); - } - - return recommender; - }); - - // Execute the transaction and return the recommender - const recommenderResult = transaction(); - return recommenderResult; - } catch (error) { - console.error( - "Error in getOrCreateRecommenderWithDiscordId:", - error - ); - return null; - } - } - - /** - * Retrieves an existing recommender or creates a new one if not found. - * Also initializes metrics for the recommender if they haven't been initialized yet. - * @param telegramId Telegram ID of the recommender - * @returns Recommender object with all details, or null if failed - */ - - async getOrCreateRecommenderWithTelegramId( - telegramId: string - ): Promise { - try { - // Begin a transaction - const transaction = this.db.transaction(() => { - // Attempt to retrieve the recommender - const existingRecommender = this.getRecommender(telegramId); - if (existingRecommender) { - // Recommender exists, ensure metrics are initialized - this.initializeRecommenderMetrics(existingRecommender.id!); - return existingRecommender; - } - - // Recommender does not exist, create a new one - const newRecommender = { - id: uuidv4(), - address: telegramId, - telegramId: telegramId, - }; - const newRecommenderId = this.addRecommender(newRecommender); - if (!newRecommenderId) { - throw new Error("Failed to add new recommender."); - } - - // Initialize metrics for the new recommender - const metricsInitialized = - this.initializeRecommenderMetrics(newRecommenderId); - if (!metricsInitialized) { - throw new Error( - "Failed to initialize recommender metrics." - ); - } - - // Retrieve and return the newly created recommender - const recommender = this.getRecommender(newRecommenderId); - if (!recommender) { - throw new Error( - "Failed to retrieve the newly created recommender." - ); - } - - return recommender; - }); - - // Execute the transaction and return the recommender - const recommenderResult = transaction(); - return recommenderResult; - } catch (error) { - console.error( - "Error in getOrCreateRecommenderWithTelegramId:", - error - ); - return null; - } - } - - /** - * Initializes metrics for a recommender if not present. - * @param recommenderId Recommender's UUID - */ - initializeRecommenderMetrics(recommenderId: string): boolean { - const sql = ` - INSERT OR IGNORE INTO recommender_metrics (recommender_id) - VALUES (?); - `; - try { - const result = this.db.prepare(sql).run(recommenderId); - return result.changes > 0; - } catch (error) { - console.error("Error initializing recommender metrics:", error); - return false; - } - } - - /** - * Retrieves metrics for a recommender. - * @param recommenderId Recommender's UUID - * @returns RecommenderMetrics object or null - */ - getRecommenderMetrics(recommenderId: string): RecommenderMetrics | null { - const sql = `SELECT * FROM recommender_metrics WHERE recommender_id = ?;`; - const row = this.db.prepare(sql).get(recommenderId) as - | RecommenderMetricsRow - | undefined; - if (!row) return null; - - return { - recommenderId: row.recommender_id, - trustScore: row.trust_score, - totalRecommendations: row.total_recommendations, - successfulRecs: row.successful_recs, - avgTokenPerformance: row.avg_token_performance, - riskScore: row.risk_score, - consistencyScore: row.consistency_score, - virtualConfidence: row.virtual_confidence, - lastActiveDate: row.last_active_date, - trustDecay: row.trust_decay, - lastUpdated: new Date(row.last_updated), - }; - } - - /** - * Logs the current metrics of a recommender into the history table. - * @param recommenderId Recommender's UUID - */ - logRecommenderMetricsHistory(recommenderId: string): void { - // Retrieve current metrics - const currentMetrics = this.getRecommenderMetrics(recommenderId); - if (!currentMetrics) { - console.warn( - `No metrics found for recommender ID: ${recommenderId}` - ); - return; - } - - // Create a history entry - const history: RecommenderMetricsHistory = { - historyId: uuidv4(), - recommenderId: currentMetrics.recommenderId, - trustScore: currentMetrics.trustScore, - totalRecommendations: currentMetrics.totalRecommendations, - successfulRecs: currentMetrics.successfulRecs, - avgTokenPerformance: currentMetrics.avgTokenPerformance, - riskScore: currentMetrics.riskScore, - consistencyScore: currentMetrics.consistencyScore, - virtualConfidence: currentMetrics.virtualConfidence, - trustDecay: currentMetrics.trustDecay, - recordedAt: new Date(), // Current timestamp - }; - - // Insert into recommender_metrics_history table - const sql = ` - INSERT INTO recommender_metrics_history ( - history_id, - recommender_id, - trust_score, - total_recommendations, - successful_recs, - avg_token_performance, - risk_score, - consistency_score, - recorded_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); - `; - try { - this.db - .prepare(sql) - .run( - history.historyId, - history.recommenderId, - history.trustScore, - history.totalRecommendations, - history.successfulRecs, - history.avgTokenPerformance, - history.riskScore, - history.consistencyScore, - history.recordedAt.toISOString() - ); - console.log( - `Logged metrics history for recommender ID: ${recommenderId}` - ); - } catch (error) { - console.error("Error logging recommender metrics history:", error); - } - } - - /** - * Updates metrics for a recommender. - * @param metrics RecommenderMetrics object - */ - updateRecommenderMetrics(metrics: RecommenderMetrics): void { - // Log current metrics before updating - this.logRecommenderMetricsHistory(metrics.recommenderId); - - const sql = ` - UPDATE recommender_metrics - SET trust_score = ?, - total_recommendations = ?, - successful_recs = ?, - avg_token_performance = ?, - risk_score = ?, - consistency_score = ?, - last_updated = CURRENT_TIMESTAMP - WHERE recommender_id = ?; - `; - try { - this.db - .prepare(sql) - .run( - metrics.trustScore, - metrics.totalRecommendations, - metrics.successfulRecs, - metrics.avgTokenPerformance, - metrics.riskScore, - metrics.consistencyScore, - metrics.recommenderId - ); - console.log( - `Updated metrics for recommender ID: ${metrics.recommenderId}` - ); - } catch (error) { - console.error("Error updating recommender metrics:", error); - } - } - - // ----- TokenPerformance Methods ----- - - /** - * Adds or updates token performance metrics. - * @param performance TokenPerformance object - */ - upsertTokenPerformance(performance: TokenPerformance): boolean { - const validationTrust = this.calculateValidationTrust( - performance.tokenAddress - ); - - const sql = ` - INSERT INTO token_performance ( - token_address, - price_change_24h, - volume_change_24h, - trade_24h_change, - liquidity, - liquidity_change_24h, - holder_change_24h, - rug_pull, - is_scam, - market_cap_change24h, - sustained_growth, - rapid_dump, - suspicious_volume, - validation_trust, - balance, - initial_market_cap, - last_updated - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP) - ON CONFLICT(token_address) DO UPDATE SET - price_change_24h = excluded.price_change_24h, - volume_change_24h = excluded.volume_change_24h, - trade_24h_change = excluded.trade_24h_change, - liquidity = excluded.liquidity, - liquidity_change_24h = excluded.liquidity_change_24h, - holder_change_24h = excluded.holder_change_24h, - rug_pull = excluded.rug_pull, - is_scam = excluded.is_scam, - market_cap_change24h = excluded.market_cap_change24h, - sustained_growth = excluded.sustained_growth, - rapid_dump = excluded.rapid_dump, - suspicious_volume = excluded.suspicious_volume, - validation_trust = excluded.validation_trust, - balance = excluded.balance, - initial_market_cap = excluded.initial_market_cap, - last_updated = CURRENT_TIMESTAMP; - `; - try { - this.db.prepare(sql).run( - performance.tokenAddress, - performance.priceChange24h, - performance.volumeChange24h, - performance.trade_24h_change, - performance.liquidity, - performance.liquidityChange24h, - performance.holderChange24h, // Ensure column name matches schema - performance.rugPull ? 1 : 0, - performance.isScam ? 1 : 0, - performance.marketCapChange24h, - performance.sustainedGrowth ? 1 : 0, - performance.rapidDump ? 1 : 0, - performance.suspiciousVolume ? 1 : 0, - performance.balance, - performance.initialMarketCap, - validationTrust - ); - console.log( - `Upserted token performance for ${performance.tokenAddress}` - ); - return true; - } catch (error) { - console.error("Error upserting token performance:", error); - return false; - } - } - - // update token balance - - updateTokenBalance(tokenAddress: string, balance: number): boolean { - const sql = ` - UPDATE token_performance - SET balance = ?, - last_updated = CURRENT_TIMESTAMP - WHERE token_address = ?; - `; - try { - this.db.prepare(sql).run(balance, tokenAddress); - console.log(`Updated token balance for ${tokenAddress}`); - return true; - } catch (error) { - console.error("Error updating token balance:", error); - return false; - } - } - - /** - * Retrieves token performance metrics. - * @param tokenAddress Token's address - * @returns TokenPerformance object or null - */ - getTokenPerformance(tokenAddress: string): TokenPerformance | null { - const sql = `SELECT * FROM token_performance WHERE token_address = ?;`; - const row = this.db.prepare(sql).get(tokenAddress) as - | TokenPerformanceRow - | undefined; - if (!row) return null; - - return { - tokenAddress: row.token_address, - symbol: row.symbol, - priceChange24h: row.price_change_24h, - volumeChange24h: row.volume_change_24h, - trade_24h_change: row.trade_24h_change, - liquidity: row.liquidity, - liquidityChange24h: row.liquidity_change_24h, - holderChange24h: row.holder_change_24h, - rugPull: row.rug_pull === 1, - isScam: row.is_scam === 1, - marketCapChange24h: row.market_cap_change24h, - sustainedGrowth: row.sustained_growth === 1, - rapidDump: row.rapid_dump === 1, - suspiciousVolume: row.suspicious_volume === 1, - validationTrust: row.validation_trust, - balance: row.balance, - initialMarketCap: row.initial_market_cap, - lastUpdated: new Date(row.last_updated), - }; - } - - //getTokenBalance - getTokenBalance(tokenAddress: string): number { - const sql = `SELECT balance FROM token_performance WHERE token_address = ?;`; - const row = this.db.prepare(sql).get(tokenAddress) as { - balance: number; - }; - return row.balance; - } - - getAllTokenPerformancesWithBalance(): TokenPerformance[] { - const sql = `SELECT * FROM token_performance WHERE balance > 0;`; - const rows = this.db.prepare(sql).all() as TokenPerformanceRow[]; - - return rows.map((row) => ({ - tokenAddress: row.token_address, - symbol: row.symbol, - priceChange24h: row.price_change_24h, - volumeChange24h: row.volume_change_24h, - trade_24h_change: row.trade_24h_change, - liquidity: row.liquidity, - liquidityChange24h: row.liquidity_change_24h, - holderChange24h: row.holder_change_24h, - rugPull: row.rug_pull === 1, - isScam: row.is_scam === 1, - marketCapChange24h: row.market_cap_change24h, - sustainedGrowth: row.sustained_growth === 1, - rapidDump: row.rapid_dump === 1, - suspiciousVolume: row.suspicious_volume === 1, - validationTrust: row.validation_trust, - balance: row.balance, - initialMarketCap: row.initial_market_cap, - lastUpdated: new Date(row.last_updated), - })); - } - - // ----- TokenRecommendations Methods ----- - - /** - * Calculates the average trust score of all recommenders who have recommended a specific token. - * @param tokenAddress The address of the token. - * @returns The average trust score (validationTrust). - */ - calculateValidationTrust(tokenAddress: string): number { - const sql = ` - SELECT rm.trust_score - FROM token_recommendations tr - JOIN recommender_metrics rm ON tr.recommender_id = rm.recommender_id - WHERE tr.token_address = ?; - `; - const rows = this.db.prepare(sql).all(tokenAddress) as Array<{ - trust_score: number; - }>; - - if (rows.length === 0) return 0; // No recommendations found - - const totalTrust = rows.reduce((acc, row) => acc + row.trust_score, 0); - const averageTrust = totalTrust / rows.length; - return averageTrust; - } - - /** - * Adds a new token recommendation. - * @param recommendation TokenRecommendation object - * @returns boolean indicating success - */ - addTokenRecommendation(recommendation: TokenRecommendation): boolean { - const sql = ` - INSERT INTO token_recommendations ( - id, - recommender_id, - token_address, - timestamp, - initial_market_cap, - initial_liquidity, - initial_price - ) VALUES (?, ?, ?, ?, ?, ?, ?); - `; - try { - this.db - .prepare(sql) - .run( - recommendation.id || uuidv4(), - recommendation.recommenderId, - recommendation.tokenAddress, - recommendation.timestamp || new Date(), - recommendation.initialMarketCap || null, - recommendation.initialLiquidity || null, - recommendation.initialPrice || null - ); - return true; - } catch (error) { - console.error("Error adding token recommendation:", error); - return false; - } - } - - /** - * Retrieves all recommendations made by a recommender. - * @param recommenderId Recommender's UUID - * @returns Array of TokenRecommendation objects - */ - getRecommendationsByRecommender( - recommenderId: string - ): TokenRecommendation[] { - const sql = `SELECT * FROM token_recommendations WHERE recommender_id = ? ORDER BY timestamp DESC;`; - const rows = this.db.prepare(sql).all(recommenderId) as Array<{ - id: string; - recommender_id: string; - token_address: string; - timestamp: string; - initial_market_cap: number | null; - initial_liquidity: number | null; - initial_price: number | null; - }>; - - return rows.map((row) => ({ - id: row.id, - recommenderId: row.recommender_id, - tokenAddress: row.token_address, - timestamp: new Date(row.timestamp), - initialMarketCap: row.initial_market_cap, - initialLiquidity: row.initial_liquidity, - initialPrice: row.initial_price, - })); - } - - /** - * Retrieves all recommendations for a specific token. - * @param tokenAddress Token's address - * @returns Array of TokenRecommendation objects - */ - getRecommendationsByToken(tokenAddress: string): TokenRecommendation[] { - const sql = `SELECT * FROM token_recommendations WHERE token_address = ? ORDER BY timestamp DESC;`; - const rows = this.db.prepare(sql).all(tokenAddress) as Array<{ - id: string; - recommender_id: string; - token_address: string; - timestamp: string; - initial_market_cap: number | null; - initial_liquidity: number | null; - initial_price: number | null; - }>; - - return rows.map((row) => ({ - id: row.id, - recommenderId: row.recommender_id, - tokenAddress: row.token_address, - timestamp: new Date(row.timestamp), - initialMarketCap: row.initial_market_cap ?? undefined, - initialLiquidity: row.initial_liquidity ?? undefined, - initialPrice: row.initial_price ?? undefined, - })); - } - - /** - * Retrieves all recommendations within a specific timeframe. - * @param startDate Start date - * @param endDate End date - * @returns Array of TokenRecommendation objects - */ - getRecommendationsByDateRange( - startDate: Date, - endDate: Date - ): TokenRecommendation[] { - const sql = ` - SELECT * FROM token_recommendations - WHERE timestamp BETWEEN ? AND ? - ORDER BY timestamp DESC; - `; - const rows = this.db - .prepare(sql) - .all(startDate.toISOString(), endDate.toISOString()) as Array<{ - id: string; - recommender_id: string; - token_address: string; - timestamp: string; - initial_market_cap: number | null; - initial_liquidity: number | null; - initial_price: number | null; - }>; - - return rows.map((row) => ({ - id: row.id, - recommenderId: row.recommender_id, - tokenAddress: row.token_address, - timestamp: new Date(row.timestamp), - initialMarketCap: row.initial_market_cap ?? undefined, - initialLiquidity: row.initial_liquidity ?? undefined, - initialPrice: row.initial_price ?? undefined, - })); - } - - /** - * Retrieves historical metrics for a recommender. - * @param recommenderId Recommender's UUID - * @returns Array of RecommenderMetricsHistory objects - */ - getRecommenderMetricsHistory( - recommenderId: string - ): RecommenderMetricsHistory[] { - const sql = ` - SELECT * FROM recommender_metrics_history - WHERE recommender_id = ? - ORDER BY recorded_at DESC; - `; - const rows = this.db.prepare(sql).all(recommenderId) as Array<{ - history_id: string; - recommender_id: string; - trust_score: number; - total_recommendations: number; - successful_recs: number; - avg_token_performance: number; - risk_score: number; - consistency_score: number; - virtual_confidence: number; - trust_decay: number; - recorded_at: string; - }>; - - return rows.map((row) => ({ - historyId: row.history_id, - recommenderId: row.recommender_id, - trustScore: row.trust_score, - totalRecommendations: row.total_recommendations, - successfulRecs: row.successful_recs, - avgTokenPerformance: row.avg_token_performance, - riskScore: row.risk_score, - consistencyScore: row.consistency_score, - virtualConfidence: row.virtual_confidence, - trustDecay: row.trust_decay, - recordedAt: new Date(row.recorded_at), - })); - } - - /** - * Inserts a new trade performance into the specified table. - * @param trade The TradePerformance object containing trade details. - * @param isSimulation Whether the trade is a simulation. If true, inserts into simulation_trade; otherwise, into trade. - * @returns boolean indicating success. - */ - addTradePerformance( - trade: TradePerformance, - isSimulation: boolean - ): boolean { - const tableName = isSimulation ? "simulation_trade" : "trade"; - const sql = ` - INSERT INTO ${tableName} ( - token_address, - recommender_id, - buy_price, - sell_price, - buy_timeStamp, - sell_timeStamp, - buy_amount, - sell_amount, - buy_sol, - received_sol, - buy_value_usd, - sell_value_usd, - profit_usd, - profit_percent, - buy_market_cap, - sell_market_cap, - market_cap_change, - buy_liquidity, - sell_liquidity, - liquidity_change, - last_updated, - rapidDump - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); - `; - try { - this.db - .prepare(sql) - .run( - trade.token_address, - trade.recommender_id, - trade.buy_price, - trade.sell_price || null, - trade.buy_timeStamp, - trade.sell_timeStamp || null, - trade.buy_amount, - trade.sell_amount || null, - trade.buy_sol, - trade.received_sol || null, - trade.buy_value_usd, - trade.sell_value_usd || null, - trade.profit_usd || null, - trade.profit_percent || null, - trade.buy_market_cap, - trade.sell_market_cap || null, - trade.market_cap_change || null, - trade.buy_liquidity, - trade.sell_liquidity || null, - trade.liquidity_change || null, - trade.last_updated || new Date().toISOString(), - trade.rapidDump ? 1 : 0 - ); - console.log(`Inserted trade into ${tableName}:`, trade); - return true; - } catch (error) { - console.error(`Error inserting trade into ${tableName}:`, error); - return false; - } - } - - /** - * Updates an existing trade with sell details. - * @param tokenAddress The address of the token. - * @param recommenderId The UUID of the recommender. - * @param buyTimeStamp The timestamp when the buy occurred. - * @param sellDetails An object containing sell-related details. - * @param isSimulation Whether the trade is a simulation. If true, updates in simulation_trade; otherwise, in trade. - * @returns boolean indicating success. - */ - - updateTradePerformanceOnSell( - tokenAddress: string, - recommenderId: string, - buyTimeStamp: string, - sellDetails: { - sell_price: number; - sell_timeStamp: string; - sell_amount: number; - received_sol: number; - sell_value_usd: number; - profit_usd: number; - profit_percent: number; - sell_market_cap: number; - market_cap_change: number; - sell_liquidity: number; - liquidity_change: number; - rapidDump: boolean; - sell_recommender_id: string | null; - }, - isSimulation: boolean - ): boolean { - const tableName = isSimulation ? "simulation_trade" : "trade"; - const sql = ` - UPDATE ${tableName} - SET - sell_price = ?, - sell_timeStamp = ?, - sell_amount = ?, - received_sol = ?, - sell_value_usd = ?, - profit_usd = ?, - profit_percent = ?, - sell_market_cap = ?, - market_cap_change = ?, - sell_liquidity = ?, - liquidity_change = ?, - rapidDump = ?, - sell_recommender_id = ? - WHERE - token_address = ? - AND recommender_id = ? - AND buy_timeStamp = ?; - `; - try { - const result = this.db - .prepare(sql) - .run( - sellDetails.sell_price, - sellDetails.sell_timeStamp, - sellDetails.sell_amount, - sellDetails.received_sol, - sellDetails.sell_value_usd, - sellDetails.profit_usd, - sellDetails.profit_percent, - sellDetails.sell_market_cap, - sellDetails.market_cap_change, - sellDetails.sell_liquidity, - sellDetails.liquidity_change, - sellDetails.rapidDump ? 1 : 0, - tokenAddress, - recommenderId, - buyTimeStamp - ); - - if (result.changes === 0) { - console.warn( - `No trade found to update in ${tableName} for token: ${tokenAddress}, recommender: ${recommenderId}, buyTimeStamp: ${buyTimeStamp}` - ); - return false; - } - - console.log(`Updated trade in ${tableName}:`, { - token_address: tokenAddress, - recommender_id: recommenderId, - buy_timeStamp: buyTimeStamp, - ...sellDetails, - }); - return true; - } catch (error) { - console.error(`Error updating trade in ${tableName}:`, error); - return false; - } - } - - //getTradePerformance - - /** - * Retrieves trade performance metrics. - * @param tokenAddress Token's address - * @param recommenderId Recommender's UUID - * @param buyTimeStamp Timestamp when the buy occurred - * @param isSimulation Whether the trade is a simulation. If true, retrieves from simulation_trade; otherwise, from trade. - * @returns TradePerformance object or null - */ - - getTradePerformance( - tokenAddress: string, - recommenderId: string, - buyTimeStamp: string, - isSimulation: boolean - ): TradePerformance | null { - const tableName = isSimulation ? "simulation_trade" : "trade"; - const sql = `SELECT * FROM ${tableName} WHERE token_address = ? AND recommender_id = ? AND buy_timeStamp = ?;`; - const row = this.db - .prepare(sql) - .get(tokenAddress, recommenderId, buyTimeStamp) as - | TradePerformance - | undefined; - if (!row) return null; - - return { - token_address: row.token_address, - recommender_id: row.recommender_id, - buy_price: row.buy_price, - sell_price: row.sell_price, - buy_timeStamp: row.buy_timeStamp, - sell_timeStamp: row.sell_timeStamp, - buy_amount: row.buy_amount, - sell_amount: row.sell_amount, - buy_sol: row.buy_sol, - received_sol: row.received_sol, - buy_value_usd: row.buy_value_usd, - sell_value_usd: row.sell_value_usd, - profit_usd: row.profit_usd, - profit_percent: row.profit_percent, - buy_market_cap: row.buy_market_cap, - sell_market_cap: row.sell_market_cap, - market_cap_change: row.market_cap_change, - buy_liquidity: row.buy_liquidity, - sell_liquidity: row.sell_liquidity, - liquidity_change: row.liquidity_change, - last_updated: row.last_updated, - rapidDump: row.rapidDump, - }; - } - - /** - * Retrieves the latest trade performance metrics without requiring buyTimeStamp. - * @param tokenAddress Token's address - * @param recommenderId Recommender's UUID - * @param isSimulation Whether the trade is a simulation. If true, retrieves from simulation_trade; otherwise, from trade. - * @returns TradePerformance object or null - */ - getLatestTradePerformance( - tokenAddress: string, - recommenderId: string, - isSimulation: boolean - ): TradePerformance | null { - const tableName = isSimulation ? "simulation_trade" : "trade"; - const sql = ` - SELECT * FROM ${tableName} - WHERE token_address = ? AND recommender_id = ? - ORDER BY buy_timeStamp DESC - LIMIT 1; - `; - const row = this.db.prepare(sql).get(tokenAddress, recommenderId) as - | TradePerformance - | undefined; - if (!row) return null; - - return { - token_address: row.token_address, - recommender_id: row.recommender_id, - buy_price: row.buy_price, - sell_price: row.sell_price, - buy_timeStamp: row.buy_timeStamp, - sell_timeStamp: row.sell_timeStamp, - buy_amount: row.buy_amount, - sell_amount: row.sell_amount, - buy_sol: row.buy_sol, - received_sol: row.received_sol, - buy_value_usd: row.buy_value_usd, - sell_value_usd: row.sell_value_usd, - profit_usd: row.profit_usd, - profit_percent: row.profit_percent, - buy_market_cap: row.buy_market_cap, - sell_market_cap: row.sell_market_cap, - market_cap_change: row.market_cap_change, - buy_liquidity: row.buy_liquidity, - sell_liquidity: row.sell_liquidity, - liquidity_change: row.liquidity_change, - last_updated: row.last_updated, - rapidDump: row.rapidDump, - }; - } - - // ----- Transactions Methods ----- - /** - * Adds a new transaction to the database. - * @param transaction Transaction object - * @returns boolean indicating success - */ - - addTransaction(transaction: Transaction): boolean { - const sql = ` - INSERT INTO transactions ( - token_address, - transaction_hash, - type, - amount, - price, - is_simulation, - timestamp - ) VALUES (?, ?, ?, ?, ?, ?); - `; - try { - this.db - .prepare(sql) - .run( - transaction.tokenAddress, - transaction.transactionHash, - transaction.type, - transaction.amount, - transaction.price, - transaction.isSimulation, - transaction.timestamp - ); - return true; - } catch (error) { - console.error("Error adding transaction:", error); - return false; - } - } - - /** - * Retrieves all transactions for a specific token. - * @param tokenAddress Token's address - * @returns Array of Transaction objects - */ - getTransactionsByToken(tokenAddress: string): Transaction[] { - const sql = `SELECT * FROM transactions WHERE token_address = ? ORDER BY timestamp DESC;`; - const rows = this.db.prepare(sql).all(tokenAddress) as Array<{ - token_address: string; - transaction_hash: string; - type: string; - amount: number; - price: number; - is_simulation: boolean; - timestamp: string; - }>; - - return rows.map((row) => { - // Validate and cast 'type' to ensure it matches the expected union type - if (row.type !== "buy" && row.type !== "sell") { - throw new Error(`Unexpected transaction type: ${row.type}`); - } - - return { - tokenAddress: row.token_address, - transactionHash: row.transaction_hash, - type: row.type as "buy" | "sell", - amount: row.amount, - price: row.price, - isSimulation: row.is_simulation, - timestamp: new Date(row.timestamp).toISOString(), - }; - }); - } - - /** - * Close the database connection gracefully. - */ - closeConnection(): void { - this.db.close(); - } -} diff --git a/packages/plugin-trustdb/src/index.ts b/packages/plugin-trustdb/src/index.ts deleted file mode 100644 index 5709fc4ce9c..00000000000 --- a/packages/plugin-trustdb/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./adapters/trustScoreDatabase.ts"; diff --git a/packages/plugin-trustdb/tsconfig.json b/packages/plugin-trustdb/tsconfig.json deleted file mode 100644 index 73993deaaf7..00000000000 --- a/packages/plugin-trustdb/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-trustdb/tsup.config.ts b/packages/plugin-trustdb/tsup.config.ts deleted file mode 100644 index 1a55f7a745f..00000000000 --- a/packages/plugin-trustdb/tsup.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [], -}); diff --git a/packages/plugin-video-generation/.npmignore b/packages/plugin-video-generation/.npmignore deleted file mode 100644 index a9227d220f6..00000000000 --- a/packages/plugin-video-generation/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts -!tsconfig.json \ No newline at end of file diff --git a/packages/plugin-video-generation/eslint.config.mjs b/packages/plugin-video-generation/eslint.config.mjs deleted file mode 100644 index 92fe5bbebef..00000000000 --- a/packages/plugin-video-generation/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [...eslintGlobalConfig]; diff --git a/packages/plugin-video-generation/package.json b/packages/plugin-video-generation/package.json deleted file mode 100644 index fe9eff95cd1..00000000000 --- a/packages/plugin-video-generation/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@ai16z/plugin-video-generation", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint . --fix" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-video-generation/src/constants.ts b/packages/plugin-video-generation/src/constants.ts deleted file mode 100644 index 78723f905bf..00000000000 --- a/packages/plugin-video-generation/src/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const LUMA_CONSTANTS = { - API_URL: "https://api.lumalabs.ai/dream-machine/v1/generations", - API_KEY_SETTING: "LUMA_API_KEY", // The setting name to fetch from runtime -}; diff --git a/packages/plugin-video-generation/src/index.ts b/packages/plugin-video-generation/src/index.ts deleted file mode 100644 index 08f158dc3c9..00000000000 --- a/packages/plugin-video-generation/src/index.ts +++ /dev/null @@ -1,239 +0,0 @@ -import { elizaLogger } from "@ai16z/eliza"; -import { - Action, - HandlerCallback, - IAgentRuntime, - Memory, - Plugin, - State, -} from "@ai16z/eliza"; -import fs from "fs"; -import { LUMA_CONSTANTS } from "./constants"; - -const generateVideo = async (prompt: string, runtime: IAgentRuntime) => { - const API_KEY = runtime.getSetting(LUMA_CONSTANTS.API_KEY_SETTING); - - try { - elizaLogger.log("Starting video generation with prompt:", prompt); - - const response = await fetch(LUMA_CONSTANTS.API_URL, { - method: "POST", - headers: { - Authorization: `Bearer ${API_KEY}`, - accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify({ prompt }), - }); - - if (!response.ok) { - const errorText = await response.text(); - elizaLogger.error("Luma API error:", { - status: response.status, - statusText: response.statusText, - error: errorText, - }); - throw new Error( - `Luma API error: ${response.statusText} - ${errorText}` - ); - } - - const data = await response.json(); - elizaLogger.log( - "Generation request successful, received response:", - data - ); - - // Poll for completion - let status = data.status; - let videoUrl = null; - const generationId = data.id; - - while (status !== "completed" && status !== "failed") { - await new Promise((resolve) => setTimeout(resolve, 5000)); // Wait 5 seconds - - const statusResponse = await fetch( - `${LUMA_CONSTANTS.API_URL}/${generationId}`, - { - method: "GET", - headers: { - Authorization: `Bearer ${API_KEY}`, - accept: "application/json", - }, - } - ); - - if (!statusResponse.ok) { - const errorText = await statusResponse.text(); - elizaLogger.error("Status check error:", { - status: statusResponse.status, - statusText: statusResponse.statusText, - error: errorText, - }); - throw new Error( - "Failed to check generation status: " + errorText - ); - } - - const statusData = await statusResponse.json(); - elizaLogger.log("Status check response:", statusData); - - status = statusData.state; - if (status === "completed") { - videoUrl = statusData.assets?.video; - } - } - - if (status === "failed") { - throw new Error("Video generation failed"); - } - - if (!videoUrl) { - throw new Error("No video URL in completed response"); - } - - return { - success: true, - data: videoUrl, - }; - } catch (error) { - elizaLogger.error("Video generation error:", error); - return { - success: false, - error: error.message || "Unknown error occurred", - }; - } -}; - -const videoGeneration: Action = { - name: "GENERATE_VIDEO", - similes: [ - "VIDEO_GENERATION", - "VIDEO_GEN", - "CREATE_VIDEO", - "MAKE_VIDEO", - "RENDER_VIDEO", - "ANIMATE", - "CREATE_ANIMATION", - "VIDEO_CREATE", - "VIDEO_MAKE", - ], - description: "Generate a video based on a text prompt", - validate: async (runtime: IAgentRuntime, _message: Memory) => { - elizaLogger.log("Validating video generation action"); - const lumaApiKey = runtime.getSetting("LUMA_API_KEY"); - elizaLogger.log("LUMA_API_KEY present:", !!lumaApiKey); - return !!lumaApiKey; - }, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - _state: State, - _options: any, - callback: HandlerCallback - ) => { - elizaLogger.log("Video generation request:", message); - - // Clean up the prompt by removing mentions and commands - const videoPrompt = message.content.text - .replace(/<@\d+>/g, "") // Remove mentions - .replace( - /generate video|create video|make video|render video/gi, - "" - ) // Remove commands - .trim(); - - if (!videoPrompt || videoPrompt.length < 5) { - callback({ - text: "Could you please provide more details about what kind of video you'd like me to generate? For example: 'Generate a video of a sunset on a beach' or 'Create a video of a futuristic city'", - }); - return; - } - - elizaLogger.log("Video prompt:", videoPrompt); - - callback({ - text: `I'll generate a video based on your prompt: "${videoPrompt}". This might take a few minutes...`, - }); - - try { - const result = await generateVideo(videoPrompt, runtime); - - if (result.success && result.data) { - // Download the video file - const response = await fetch(result.data); - const arrayBuffer = await response.arrayBuffer(); - const videoFileName = `content_cache/generated_video_${Date.now()}.mp4`; - - // Save video file - fs.writeFileSync(videoFileName, Buffer.from(arrayBuffer)); - - callback( - { - text: "Here's your generated video!", - attachments: [ - { - id: crypto.randomUUID(), - url: result.data, - title: "Generated Video", - source: "videoGeneration", - description: videoPrompt, - text: videoPrompt, - }, - ], - }, - [videoFileName] - ); // Add the video file to the attachments - } else { - callback({ - text: `Video generation failed: ${result.error}`, - error: true, - }); - } - } catch (error) { - elizaLogger.error(`Failed to generate video. Error: ${error}`); - callback({ - text: `Video generation failed: ${error.message}`, - error: true, - }); - } - }, - examples: [ - [ - { - user: "{{user1}}", - content: { text: "Generate a video of a cat playing piano" }, - }, - { - user: "{{agentName}}", - content: { - text: "I'll create a video of a cat playing piano for you", - action: "GENERATE_VIDEO", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "Can you make a video of a sunset at the beach?", - }, - }, - { - user: "{{agentName}}", - content: { - text: "I'll generate a beautiful beach sunset video for you", - action: "GENERATE_VIDEO", - }, - }, - ], - ], -} as Action; - -export const videoGenerationPlugin: Plugin = { - name: "videoGeneration", - description: "Generate videos using Luma AI", - actions: [videoGeneration], - evaluators: [], - providers: [], -}; diff --git a/packages/plugin-video-generation/tsconfig.json b/packages/plugin-video-generation/tsconfig.json deleted file mode 100644 index 06a0ab4e68f..00000000000 --- a/packages/plugin-video-generation/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src", - "module": "ESNext", - "moduleResolution": "Bundler", - "types": [ - "node" - ] - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-video-generation/tsup.config.ts b/packages/plugin-video-generation/tsup.config.ts deleted file mode 100644 index 58ed52c4990..00000000000 --- a/packages/plugin-video-generation/tsup.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], - external: [ - "dotenv", - "fs", - "path", - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - ], -}); diff --git a/packages/plugin-web-search/.npmignore b/packages/plugin-web-search/.npmignore deleted file mode 100644 index 078562eceab..00000000000 --- a/packages/plugin-web-search/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* - -!dist/** -!package.json -!readme.md -!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-web-search/package.json b/packages/plugin-web-search/package.json deleted file mode 100644 index cc0e12a97ac..00000000000 --- a/packages/plugin-web-search/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@ai16z/plugin-web-search", - "version": "0.1.5-alpha.5", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@ai16z/eliza": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-web-search/src/index.ts b/packages/plugin-web-search/src/index.ts deleted file mode 100644 index 4d7d7be44cf..00000000000 --- a/packages/plugin-web-search/src/index.ts +++ /dev/null @@ -1,188 +0,0 @@ -import { elizaLogger } from "@ai16z/eliza"; -import { - Action, - HandlerCallback, - IAgentRuntime, - Memory, - Plugin, - State, -} from "@ai16z/eliza"; -import { generateWebSearch } from "@ai16z/eliza"; - -import { SearchResult } from "@ai16z/eliza"; - -const webSearch: Action = { - name: "WEB_SEARCH", - similes: [ - "SEARCH_WEB", - "INTERNET_SEARCH", - "LOOKUP", - "QUERY_WEB", - "FIND_ONLINE", - "SEARCH_ENGINE", - "WEB_LOOKUP", - "ONLINE_SEARCH", - "FIND_INFORMATION", - ], - description: - "Perform a web search to find information related to the message.", - validate: async (runtime: IAgentRuntime, message: Memory) => { - const tavilyApiKeyOk = !!runtime.getSetting("TAVILY_API_KEY"); - - return tavilyApiKeyOk; - }, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, - callback: HandlerCallback - ) => { - elizaLogger.log("Composing state for message:", message); - state = (await runtime.composeState(message)) as State; - const userId = runtime.agentId; - elizaLogger.log("User ID:", userId); - - const webSearchPrompt = message.content.text; - elizaLogger.log("web search prompt received:", webSearchPrompt); - - elizaLogger.log("Generating image with prompt:", webSearchPrompt); - const searchResponse = await generateWebSearch( - webSearchPrompt, - runtime - ); - - if (searchResponse && searchResponse.results.length) { - const responseList = searchResponse.answer - ? `${searchResponse.answer}${ - Array.isArray(searchResponse.results) && - searchResponse.results.length > 0 - ? `\n\nFor more details, you can check out these resources:\n${searchResponse.results - .map( - (result: SearchResult, index: number) => - `${index + 1}. [${result.title}](${result.url})` - ) - .join("\n")}` - : "" - }` - : ""; - - callback({ - text: responseList, - }); - } else { - elizaLogger.error("search failed or returned no data."); - } - }, - examples: [ - [ - { - user: "{{user1}}", - content: { - text: "Find the latest news about SpaceX launches.", - }, - }, - { - user: "{{agentName}}", - content: { - text: "Here is the latest news about SpaceX launches:", - action: "WEB_SEARCH", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "Can you find details about the iPhone 16 release?", - }, - }, - { - user: "{{agentName}}", - content: { - text: "Here are the details I found about the iPhone 16 release:", - action: "WEB_SEARCH", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "What is the schedule for the next FIFA World Cup?", - }, - }, - { - user: "{{agentName}}", - content: { - text: "Here is the schedule for the next FIFA World Cup:", - action: "WEB_SEARCH", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "Check the latest stock price of Tesla." }, - }, - { - user: "{{agentName}}", - content: { - text: "Here is the latest stock price of Tesla I found:", - action: "WEB_SEARCH", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "What are the current trending movies in the US?", - }, - }, - { - user: "{{agentName}}", - content: { - text: "Here are the current trending movies in the US:", - action: "WEB_SEARCH", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "What is the latest score in the NBA finals?", - }, - }, - { - user: "{{agentName}}", - content: { - text: "Here is the latest score from the NBA finals:", - action: "WEB_SEARCH", - }, - }, - ], - [ - { - user: "{{user1}}", - content: { text: "When is the next Apple keynote event?" }, - }, - { - user: "{{agentName}}", - content: { - text: "Here is the information about the next Apple keynote event:", - action: "WEB_SEARCH", - }, - }, - ], - ], -} as Action; - -export const webSearchPlugin: Plugin = { - name: "webSearch", - description: "Search web", - actions: [webSearch], - evaluators: [], - providers: [], -}; diff --git a/packages/plugin-web-search/tsconfig.json b/packages/plugin-web-search/tsconfig.json deleted file mode 100644 index 834c4dce269..00000000000 --- a/packages/plugin-web-search/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src", - "types": [ - "node" - ] - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-web-search/tsup.config.ts b/packages/plugin-web-search/tsup.config.ts deleted file mode 100644 index b5e4388b214..00000000000 --- a/packages/plugin-web-search/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - "zod", - // Add other modules you want to externalize - ], -}); diff --git a/packages/plugin-whatsapp/Readme.md b/packages/plugin-whatsapp/Readme.md deleted file mode 100644 index 9324a5705c7..00000000000 --- a/packages/plugin-whatsapp/Readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# WhatsApp Cloud API Plugin - -A plugin for integrating WhatsApp Cloud API with your application. - -## Installation - - - -npm install @eliza/plugin-whatsapp - -## Configuration - -typescript -import { WhatsAppPlugin } from '@eliza/plugin-whatsapp'; -const whatsappPlugin = new WhatsAppPlugin({ -accessToken: 'your_access_token', -phoneNumberId: 'your_phone_number_id', -webhookVerifyToken: 'your_webhook_verify_token', -businessAccountId: 'your_business_account_id' -}); - -## Usage - -### Sending Messages - -typescript -// Send a text message -await whatsappPlugin.sendMessage({ -type: 'text', -to: '1234567890', -content: 'Hello from WhatsApp!' -}); -// Send a template message -await whatsappPlugin.sendMessage({ -type: 'template', -to: '1234567890', -content: { -name: 'hello_world', -language: { -code: 'en' -} -} -}); - -### Handling Webhooks - -typescript -// Verify webhook -app.get('/webhook', (req, res) => { -const verified = await whatsappPlugin.verifyWebhook(req.query['hub.verify_token']); -if (verified) { -res.send(req.query['hub.challenge']); -} else { -res.sendStatus(403); -} -}); -// Handle webhook events -app.post('/webhook', (req, res) => { -await whatsappPlugin.handleWebhook(req.body); -res.sendStatus(200); -}); - -## Features - -- Send text messages -- Send template messages -- Webhook verification -- Webhook event handling -- Message status updates - -## API Reference - -### WhatsAppPlugin - -#### Constructor - -- `config: WhatsAppConfig` - Configuration object for the plugin - -#### Methods - -- `sendMessage(message: WhatsAppMessage): Promise` - Send a WhatsApp message -- `handleWebhook(event: WhatsAppWebhookEvent): Promise` - Process incoming webhook events -- `verifyWebhook(token: string): Promise` - Verify webhook token - -### Types - -typescript -interface WhatsAppConfig { -accessToken: string; -phoneNumberId: string; -webhookVerifyToken?: string; -businessAccountId?: string; -} -interface WhatsAppMessage { -type: 'text' | 'template'; -to: string; -content: string | WhatsAppTemplate; -} -interface WhatsAppTemplate { -name: string; -language: { -code: string; -}; -components?: Array<{ -type: string; -parameters: Array<{ -type: string; -text?: string; -}>; -}>; -} - -## Error Handling - -The plugin throws errors in the following cases: - -- Invalid configuration -- Failed message sending -- Webhook verification failure -- Invalid webhook payload - -Example error handling: - -typescript -try { -await whatsappPlugin.sendMessage({ -type: 'text', -to: '1234567890', -content: 'Hello!' -}); -} catch (error) { -console.error('Failed to send message:', error.message); -} - -## Best Practices - -1. Always validate phone numbers before sending messages -2. Use template messages for first-time messages to users -3. Store message IDs for tracking delivery status -4. Implement proper error handling -5. Set up webhook retry mechanisms -6. Keep your access tokens secure - -## Contributing - -1. Fork the repository -2. Create your feature branch (`git checkout -b feature/amazing-feature`) -3. Commit your changes (`git commit -m 'Add some amazing feature'`) -4. Push to the branch (`git push origin feature/amazing-feature`) -5. Open a Pull Request - -## License - -MIT diff --git a/packages/plugin-whatsapp/eslint.config.mjs b/packages/plugin-whatsapp/eslint.config.mjs deleted file mode 100644 index d0d3c523f83..00000000000 --- a/packages/plugin-whatsapp/eslint.config.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import eslintGlobalConfig from "../../eslint.config.mjs"; - -export default [ - ...eslintGlobalConfig, - { - files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], - ignores: ["**/node_modules/**", "**/dist/**"], - }, -]; diff --git a/packages/plugin-whatsapp/package.json b/packages/plugin-whatsapp/package.json deleted file mode 100644 index 7e2cdb8da1d..00000000000 --- a/packages/plugin-whatsapp/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@ai16z/plugin-whatsapp", - "version": "0.1.5-alpha.5", - "description": "WhatsApp Cloud API plugin", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "jest", - "lint": "eslint . --fix" - }, - "dependencies": { - "@ai16z/eliza": "workspace:*", - "axios": "1.7.8" - }, - "devDependencies": { - "@types/jest": "29.5.14", - "@types/node": "20.17.9", - "@typescript-eslint/eslint-plugin": "8.16.0", - "@typescript-eslint/parser": "8.16.0", - "jest": "29.7.0", - "ts-jest": "29.2.5", - "typescript": "5.6.3" - } -} diff --git a/packages/plugin-whatsapp/src/client.ts b/packages/plugin-whatsapp/src/client.ts deleted file mode 100644 index 0656b639083..00000000000 --- a/packages/plugin-whatsapp/src/client.ts +++ /dev/null @@ -1,38 +0,0 @@ -import axios, { AxiosInstance } from "axios"; -import { WhatsAppConfig, WhatsAppMessage } from "./types"; - -export class WhatsAppClient { - private client: AxiosInstance; - private config: WhatsAppConfig; - - constructor(config: WhatsAppConfig) { - this.config = config; - this.client = axios.create({ - baseURL: "https://graph.facebook.com/v17.0", - headers: { - Authorization: `Bearer ${config.accessToken}`, - "Content-Type": "application/json", - }, - }); - } - - async sendMessage(message: WhatsAppMessage): Promise { - const endpoint = `/${this.config.phoneNumberId}/messages`; - - const payload = { - messaging_product: "whatsapp", - recipient_type: "individual", - to: message.to, - type: message.type, - ...(message.type === "text" - ? { text: { body: message.content } } - : { template: message.content }), - }; - - return this.client.post(endpoint, payload); - } - - async verifyWebhook(token: string): Promise { - return token === this.config.webhookVerifyToken; - } -} diff --git a/packages/plugin-whatsapp/src/handlers/index.ts b/packages/plugin-whatsapp/src/handlers/index.ts deleted file mode 100644 index 5c2317beb24..00000000000 --- a/packages/plugin-whatsapp/src/handlers/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./message.handler"; -export * from "./webhook.handler"; diff --git a/packages/plugin-whatsapp/src/handlers/message.handler.ts b/packages/plugin-whatsapp/src/handlers/message.handler.ts deleted file mode 100644 index 7bcc2996d83..00000000000 --- a/packages/plugin-whatsapp/src/handlers/message.handler.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { WhatsAppClient } from "../client"; -import { WhatsAppMessage } from "../types"; - -export class MessageHandler { - constructor(private client: WhatsAppClient) {} - - async send(message: WhatsAppMessage): Promise { - try { - const response = await this.client.sendMessage(message); - return response.data; - } catch (error: unknown) { - if (error instanceof Error) { - throw new Error( - `Failed to send WhatsApp message: ${error.message}` - ); - } - throw new Error('Failed to send WhatsApp message'); - } - } -} diff --git a/packages/plugin-whatsapp/src/handlers/webhook.handler.ts b/packages/plugin-whatsapp/src/handlers/webhook.handler.ts deleted file mode 100644 index cf7dc73ae18..00000000000 --- a/packages/plugin-whatsapp/src/handlers/webhook.handler.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { WhatsAppClient } from "../client"; -import { WhatsAppWebhookEvent } from "../types"; - -export class WebhookHandler { - constructor(private client: WhatsAppClient) {} - - async handle(event: WhatsAppWebhookEvent): Promise { - try { - // Process messages - if (event.entry?.[0]?.changes?.[0]?.value?.messages) { - const messages = event.entry[0].changes[0].value.messages; - for (const message of messages) { - await this.handleMessage(message); - } - } - - // Process status updates - if (event.entry?.[0]?.changes?.[0]?.value?.statuses) { - const statuses = event.entry[0].changes[0].value.statuses; - for (const status of statuses) { - await this.handleStatus(status); - } - } - } catch (error: unknown) { - if (error instanceof Error) { - throw new Error( - `Failed to send WhatsApp message: ${error.message}` - ); - } - throw new Error("Failed to send WhatsApp message"); - } - } - - private async handleMessage(message: any): Promise { - // Implement message handling logic - // This could emit events or trigger callbacks based on your framework's needs - console.log("Received message:", message); - } - - private async handleStatus(status: any): Promise { - // Implement status update handling logic - // This could emit events or trigger callbacks based on your framework's needs - console.log("Received status update:", status); - } -} diff --git a/packages/plugin-whatsapp/src/index.ts b/packages/plugin-whatsapp/src/index.ts deleted file mode 100644 index a09890cd351..00000000000 --- a/packages/plugin-whatsapp/src/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Plugin } from "@ai16z/eliza"; -import { WhatsAppClient } from "./client"; -import { WhatsAppConfig, WhatsAppMessage, WhatsAppWebhookEvent } from "./types"; -import { MessageHandler, WebhookHandler } from "./handlers"; - -export class WhatsAppPlugin implements Plugin { - private client: WhatsAppClient; - private messageHandler: MessageHandler; - private webhookHandler: WebhookHandler; - - name: string; - description: string; - - constructor(private config: WhatsAppConfig) { - this.name = "WhatsApp Cloud API Plugin"; - this.description = - "A plugin for integrating WhatsApp Cloud API with your application."; - this.client = new WhatsAppClient(config); - this.messageHandler = new MessageHandler(this.client); - this.webhookHandler = new WebhookHandler(this.client); - } - - async sendMessage(message: WhatsAppMessage): Promise { - return this.messageHandler.send(message); - } - - async handleWebhook(event: WhatsAppWebhookEvent): Promise { - return this.webhookHandler.handle(event); - } - - async verifyWebhook(token: string): Promise { - return this.client.verifyWebhook(token); - } -} - -export * from "./types"; diff --git a/packages/plugin-whatsapp/src/types.ts b/packages/plugin-whatsapp/src/types.ts deleted file mode 100644 index ac782b7cc01..00000000000 --- a/packages/plugin-whatsapp/src/types.ts +++ /dev/null @@ -1,58 +0,0 @@ -export interface WhatsAppConfig { - accessToken: string; - phoneNumberId: string; - webhookVerifyToken?: string; - businessAccountId?: string; -} - -export interface WhatsAppMessage { - type: "text" | "template"; - to: string; - content: string | WhatsAppTemplate; -} - -export interface WhatsAppTemplate { - name: string; - language: { - code: string; - }; - components?: Array<{ - type: string; - parameters: Array<{ - type: string; - text?: string; - }>; - }>; -} - -export interface WhatsAppWebhookEvent { - object: string; - entry: Array<{ - id: string; - changes: Array<{ - value: { - messaging_product: string; - metadata: { - display_phone_number: string; - phone_number_id: string; - }; - statuses?: Array<{ - id: string; - status: string; - timestamp: string; - recipient_id: string; - }>; - messages?: Array<{ - from: string; - id: string; - timestamp: string; - text?: { - body: string; - }; - type: string; - }>; - }; - field: string; - }>; - }>; -} diff --git a/packages/plugin-whatsapp/src/utils/index.ts b/packages/plugin-whatsapp/src/utils/index.ts deleted file mode 100644 index 58564490f6a..00000000000 --- a/packages/plugin-whatsapp/src/utils/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./validators"; diff --git a/packages/plugin-whatsapp/src/utils/validators.ts b/packages/plugin-whatsapp/src/utils/validators.ts deleted file mode 100644 index f76f5496916..00000000000 --- a/packages/plugin-whatsapp/src/utils/validators.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { WhatsAppMessage, WhatsAppTemplate, WhatsAppConfig } from "../types"; - -export function validateConfig(config: WhatsAppConfig): void { - if (!config.accessToken) { - throw new Error("WhatsApp access token is required"); - } - if (!config.phoneNumberId) { - throw new Error("WhatsApp phone number ID is required"); - } -} - -export function validateMessage(message: WhatsAppMessage): void { - if (!message.to) { - throw new Error("Recipient phone number is required"); - } - - if (!message.type) { - throw new Error("Message type is required"); - } - - if (!message.content) { - throw new Error("Message content is required"); - } - - if (message.type === "template") { - validateTemplate(message.content as WhatsAppTemplate); - } -} - -export function validateTemplate(template: WhatsAppTemplate): void { - if (!template.name) { - throw new Error("Template name is required"); - } - - if (!template.language || !template.language.code) { - throw new Error("Template language code is required"); - } -} - -export function validatePhoneNumber(phoneNumber: string): boolean { - // Basic phone number validation - can be enhanced based on requirements - const phoneRegex = /^\d{1,15}$/; - return phoneRegex.test(phoneNumber); -} diff --git a/packages/plugin-whatsapp/tsconfig.json b/packages/plugin-whatsapp/tsconfig.json deleted file mode 100644 index f21178232b8..00000000000 --- a/packages/plugin-whatsapp/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../core/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "src", - "baseUrl": ".", - "types": [ - "node", - "jest" - ] - }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "node_modules", - "dist", - "**/*.test.ts" - ] -} \ No newline at end of file diff --git a/packages/plugin-whatsapp/tsup.config.ts b/packages/plugin-whatsapp/tsup.config.ts deleted file mode 100644 index a47c9eb64b0..00000000000 --- a/packages/plugin-whatsapp/tsup.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - sourcemap: true, - clean: true, - format: ["esm"], // Ensure you're targeting CommonJS - external: [ - "dotenv", // Externalize dotenv to prevent bundling - "fs", // Externalize fs to use Node.js built-in module - "path", // Externalize other built-ins if necessary - "@reflink/reflink", - "@node-llama-cpp", - "https", - "http", - "agentkeepalive", - ], -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f46c487f10a..3dbcfb55699 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -108,78 +108,33 @@ importers: '@ai16z/adapter-sqlite': specifier: workspace:* version: link:../packages/adapter-sqlite - '@ai16z/client-auto': - specifier: workspace:* - version: link:../packages/client-auto '@ai16z/client-direct': specifier: workspace:* version: link:../packages/client-direct '@ai16z/client-discord': specifier: workspace:* version: link:../packages/client-discord - '@ai16z/client-farcaster': - specifier: workspace:* - version: link:../packages/client-farcaster - '@ai16z/client-telegram': - specifier: workspace:* - version: link:../packages/client-telegram '@ai16z/client-twitter': specifier: workspace:* version: link:../packages/client-twitter '@ai16z/eliza': specifier: workspace:* version: link:../packages/core - '@ai16z/plugin-0g': - specifier: workspace:* - version: link:../packages/plugin-0g - '@ai16z/plugin-aptos': - specifier: workspace:* - version: link:../packages/plugin-aptos '@ai16z/plugin-bootstrap': specifier: workspace:* version: link:../packages/plugin-bootstrap - '@ai16z/plugin-coinbase': - specifier: workspace:* - version: link:../packages/plugin-coinbase - '@ai16z/plugin-conflux': - specifier: workspace:* - version: link:../packages/plugin-conflux '@ai16z/plugin-evm': specifier: workspace:* version: link:../packages/plugin-evm - '@ai16z/plugin-flow': - specifier: workspace:* - version: link:../packages/plugin-flow '@ai16z/plugin-goat': specifier: workspace:* version: link:../packages/plugin-goat - '@ai16z/plugin-icp': - specifier: workspace:* - version: link:../packages/plugin-icp '@ai16z/plugin-image-generation': specifier: workspace:* version: link:../packages/plugin-image-generation - '@ai16z/plugin-intiface': - specifier: workspace:* - version: link:../packages/plugin-intiface - '@ai16z/plugin-multiversx': - specifier: workspace:* - version: link:../packages/plugin-multiversx - '@ai16z/plugin-near': - specifier: workspace:* - version: link:../packages/plugin-near '@ai16z/plugin-node': specifier: workspace:* version: link:../packages/plugin-node - '@ai16z/plugin-solana': - specifier: workspace:* - version: link:../packages/plugin-solana - '@ai16z/plugin-starknet': - specifier: workspace:* - version: link:../packages/plugin-starknet - '@ai16z/plugin-tee': - specifier: workspace:* - version: link:../packages/plugin-tee readline: specifier: 1.3.0 version: 1.3.0 @@ -387,75 +342,6 @@ importers: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - packages/adapter-sqljs: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@types/sql.js': - specifier: 1.4.9 - version: 1.4.9 - sql.js: - specifier: 1.12.0 - version: 1.12.0 - uuid: - specifier: 11.0.3 - version: 11.0.3 - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - devDependencies: - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - - packages/adapter-supabase: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@supabase/supabase-js': - specifier: 2.46.2 - version: 2.46.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - devDependencies: - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - - packages/client-auto: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@types/body-parser': - specifier: 1.19.5 - version: 1.19.5 - '@types/cors': - specifier: 2.8.17 - version: 2.8.17 - '@types/express': - specifier: 5.0.0 - version: 5.0.0 - body-parser: - specifier: 1.20.3 - version: 1.20.3 - cors: - specifier: 2.8.5 - version: 2.8.5 - multer: - specifier: 1.4.5-lts.1 - version: 1.4.5-lts.1 - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - devDependencies: - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - packages/client-direct: dependencies: '@ai16z/eliza': @@ -533,63 +419,6 @@ importers: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - packages/client-farcaster: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@neynar/nodejs-sdk': - specifier: ^2.0.3 - version: 2.2.3(bufferutil@4.0.8)(class-transformer@0.5.1)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - devDependencies: - tsup: - specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - - packages/client-github: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@octokit/rest': - specifier: 20.1.1 - version: 20.1.1 - '@octokit/types': - specifier: 12.6.0 - version: 12.6.0 - glob: - specifier: 10.4.5 - version: 10.4.5 - simple-git: - specifier: 3.27.0 - version: 3.27.0 - devDependencies: - '@types/glob': - specifier: 8.1.0 - version: 8.1.0 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - - packages/client-telegram: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@telegraf/types': - specifier: 7.1.0 - version: 7.1.0 - telegraf: - specifier: 4.16.3 - version: 4.16.3(encoding@0.1.13) - zod: - specifier: 3.23.8 - version: 3.23.8 - devDependencies: - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - packages/client-twitter: dependencies: '@ai16z/eliza': @@ -778,73 +607,6 @@ importers: specifier: 5.6.3 version: 5.6.3 - packages/create-eliza-app: - dependencies: - citty: - specifier: 0.1.6 - version: 0.1.6 - giget: - specifier: 1.2.3 - version: 1.2.3 - devDependencies: - automd: - specifier: 0.3.12 - version: 0.3.12(magicast@0.3.5) - jiti: - specifier: 2.4.0 - version: 2.4.0 - unbuild: - specifier: 2.0.0 - version: 2.0.0(typescript@5.6.3) - - packages/plugin-0g: - dependencies: - '@0glabs/0g-ts-sdk': - specifier: 0.2.1 - version: 0.2.1(bufferutil@4.0.8)(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - ethers: - specifier: 6.13.4 - version: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - - packages/plugin-aptos: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@ai16z/plugin-trustdb': - specifier: workspace:* - version: link:../plugin-trustdb - '@aptos-labs/ts-sdk': - specifier: ^1.26.0 - version: 1.33.1 - bignumber: - specifier: 1.1.0 - version: 1.1.0 - bignumber.js: - specifier: 9.1.2 - version: 9.1.2 - form-data: - specifier: 4.0.1 - version: 4.0.1 - node-cache: - specifier: 5.1.2 - version: 5.1.2 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - vitest: - specifier: 2.1.4 - version: 2.1.4(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - packages/plugin-bootstrap: dependencies: '@ai16z/eliza': @@ -857,60 +619,11 @@ importers: specifier: 7.1.0 version: 7.1.0 - packages/plugin-coinbase: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@types/jsonwebtoken': - specifier: ^9.0.7 - version: 9.0.7 - coinbase-advanced-sdk: - specifier: file:../../packages/plugin-coinbase/advanced-sdk-ts - version: '@coinbase-samples/advanced-sdk-ts@file:packages/plugin-coinbase/advanced-sdk-ts(encoding@0.1.13)' - coinbase-api: - specifier: 1.0.5 - version: 1.0.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) - jsonwebtoken: - specifier: ^9.0.2 - version: 9.0.2 - node-fetch: - specifier: ^2.6.1 - version: 2.7.0(encoding@0.1.13) - devDependencies: - '@types/node': - specifier: ^20.0.0 - version: 20.17.9 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - - packages/plugin-conflux: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - cive: - specifier: 0.7.1 - version: 0.7.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10) - - packages/plugin-echochambers: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@ai16z/plugin-node': - specifier: workspace:* - version: link:../plugin-node - packages/plugin-evm: dependencies: '@ai16z/eliza': specifier: workspace:* version: link:../core - '@ai16z/plugin-trustdb': - specifier: workspace:* - version: link:../plugin-trustdb '@lifi/data-types': specifier: 5.15.5 version: 5.15.5 @@ -930,61 +643,6 @@ importers: specifier: 7.1.0 version: 7.1.0 - packages/plugin-flow: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@ai16z/plugin-trustdb': - specifier: workspace:* - version: link:../plugin-trustdb - '@onflow/config': - specifier: 1.5.1 - version: 1.5.1 - '@onflow/fcl': - specifier: 1.13.1 - version: 1.13.1(@types/react@18.3.12)(bufferutil@4.0.8)(encoding@0.1.13)(google-protobuf@3.21.4)(jiti@2.4.0)(postcss@8.4.49)(react@18.3.1)(utf-8-validate@5.0.10) - '@onflow/typedefs': - specifier: 1.4.0 - version: 1.4.0 - bignumber.js: - specifier: 9.1.2 - version: 9.1.2 - bs58: - specifier: 6.0.0 - version: 6.0.0 - elliptic: - specifier: 6.6.1 - version: 6.6.1 - node-cache: - specifier: 5.1.2 - version: 5.1.2 - sha3: - specifier: 2.1.4 - version: 2.1.4 - uuid: - specifier: 11.0.3 - version: 11.0.3 - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - zod: - specifier: 3.23.8 - version: 3.23.8 - devDependencies: - '@types/elliptic': - specifier: 6.4.18 - version: 6.4.18 - '@types/uuid': - specifier: 10.0.0 - version: 10.0.0 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - vitest: - specifier: 2.1.4 - version: 2.1.4(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) - packages/plugin-goat: dependencies: '@ai16z/eliza': @@ -1009,37 +667,6 @@ importers: specifier: 7.1.0 version: 7.1.0 - packages/plugin-icp: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@dfinity/agent': - specifier: 2.1.3 - version: 2.1.3(@dfinity/candid@2.1.3(@dfinity/principal@2.1.3))(@dfinity/principal@2.1.3) - '@dfinity/candid': - specifier: 2.1.3 - version: 2.1.3(@dfinity/principal@2.1.3) - '@dfinity/identity': - specifier: 2.1.3 - version: 2.1.3(@dfinity/agent@2.1.3(@dfinity/candid@2.1.3(@dfinity/principal@2.1.3))(@dfinity/principal@2.1.3))(@dfinity/principal@2.1.3)(@peculiar/webcrypto@1.5.0) - '@dfinity/principal': - specifier: 2.1.3 - version: 2.1.3 - devDependencies: - '@types/jest': - specifier: 29.5.14 - version: 29.5.14 - jest: - specifier: 29.7.0 - version: 29.7.0(@types/node@22.8.4) - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - typescript: - specifier: 5.6.3 - version: 5.6.3 - packages/plugin-image-generation: dependencies: '@ai16z/eliza': @@ -1052,24 +679,6 @@ importers: specifier: 7.1.0 version: 7.1.0 - packages/plugin-intiface: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - buttplug: - specifier: 3.2.2 - version: 3.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - net: - specifier: 1.0.2 - version: 1.0.2 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - packages/plugin-multiversx: dependencies: '@ai16z/eliza': @@ -1118,9 +727,6 @@ importers: '@ai16z/eliza': specifier: workspace:* version: link:../core - '@ai16z/plugin-trustdb': - specifier: workspace:* - version: link:../plugin-trustdb '@ref-finance/ref-sdk': specifier: ^1.4.6 version: 1.4.6(encoding@0.1.13)(react@18.3.1) @@ -1334,203 +940,6 @@ importers: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - packages/plugin-solana: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@ai16z/plugin-tee': - specifier: workspace:* - version: link:../plugin-tee - '@ai16z/plugin-trustdb': - specifier: workspace:* - version: link:../plugin-trustdb - '@coral-xyz/anchor': - specifier: 0.30.1 - version: 0.30.1(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@solana/spl-token': - specifier: 0.4.9 - version: 0.4.9(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) - '@solana/web3.js': - specifier: 1.95.8 - version: 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - bignumber: - specifier: 1.1.0 - version: 1.1.0 - bignumber.js: - specifier: 9.1.2 - version: 9.1.2 - bs58: - specifier: 6.0.0 - version: 6.0.0 - form-data: - specifier: 4.0.1 - version: 4.0.1 - node-cache: - specifier: 5.1.2 - version: 5.1.2 - pumpdotfun-sdk: - specifier: 1.3.2 - version: 1.3.2(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(rollup@4.28.1)(typescript@5.6.3)(utf-8-validate@5.0.10) - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - vitest: - specifier: 2.1.4 - version: 2.1.4(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - - packages/plugin-starknet: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@ai16z/plugin-trustdb': - specifier: workspace:* - version: link:../plugin-trustdb - '@avnu/avnu-sdk': - specifier: 2.1.1 - version: 2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.18.0(encoding@0.1.13)) - '@uniswap/sdk-core': - specifier: 6.0.0 - version: 6.0.0 - '@unruggable_starknet/core': - specifier: 0.1.0 - version: 0.1.0(starknet@6.18.0(encoding@0.1.13)) - starknet: - specifier: 6.18.0 - version: 6.18.0(encoding@0.1.13) - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - vitest: - specifier: 2.1.5 - version: 2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - - packages/plugin-tee: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - '@phala/dstack-sdk': - specifier: 0.1.6 - version: 0.1.6(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - '@solana/spl-token': - specifier: 0.4.9 - version: 0.4.9(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) - '@solana/web3.js': - specifier: 1.95.8 - version: 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - bignumber: - specifier: 1.1.0 - version: 1.1.0 - bignumber.js: - specifier: 9.1.2 - version: 9.1.2 - bs58: - specifier: 6.0.0 - version: 6.0.0 - node-cache: - specifier: 5.1.2 - version: 5.1.2 - pumpdotfun-sdk: - specifier: 1.3.2 - version: 1.3.2(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(rollup@4.28.1)(typescript@5.6.3)(utf-8-validate@5.0.10) - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - viem: - specifier: 2.21.53 - version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - - packages/plugin-trustdb: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - dompurify: - specifier: 3.2.2 - version: 3.2.2 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - uuid: - specifier: 11.0.3 - version: 11.0.3 - vitest: - specifier: 2.1.5 - version: 2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - devDependencies: - '@types/dompurify': - specifier: 3.2.0 - version: 3.2.0 - - packages/plugin-video-generation: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - - packages/plugin-web-search: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - - packages/plugin-whatsapp: - dependencies: - '@ai16z/eliza': - specifier: workspace:* - version: link:../core - axios: - specifier: 1.7.8 - version: 1.7.8(debug@4.4.0) - devDependencies: - '@types/jest': - specifier: 29.5.14 - version: 29.5.14 - '@types/node': - specifier: 20.17.9 - version: 20.17.9 - '@typescript-eslint/eslint-plugin': - specifier: 8.16.0 - version: 8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.16.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.16.0(jiti@2.4.0))(typescript@5.6.3) - '@typescript-eslint/parser': - specifier: 8.16.0 - version: 8.16.0(eslint@9.16.0(jiti@2.4.0))(typescript@5.6.3) - jest: - specifier: 29.7.0 - version: 29.7.0(@types/node@20.17.9) - ts-jest: - specifier: 29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.9))(typescript@5.6.3) - typescript: - specifier: 5.6.3 - version: 5.6.3 - packages: '@0glabs/0g-ts-sdk@0.2.1': @@ -1824,26 +1233,6 @@ packages: resolution: {integrity: sha512-IQD9wkVReKAhsEAbDjh/0KrBGTEXelqZLpOBRDaIRvlzZ9sjmUP+gKbpvzyJnei2JHQiE8JAgj7YcNloINbGBw==} engines: {node: '>= 10'} - '@aptos-labs/aptos-cli@1.0.2': - resolution: {integrity: sha512-PYPsd0Kk3ynkxNfe3S4fanI3DiUICCoh4ibQderbvjPFL5A0oK6F4lPEO2t0MDsQySTk2t4vh99Xjy6Bd9y+aQ==} - hasBin: true - - '@aptos-labs/aptos-client@0.1.1': - resolution: {integrity: sha512-kJsoy4fAPTOhzVr7Vwq8s/AUg6BQiJDa7WOqRzev4zsuIS3+JCuIZ6vUd7UBsjnxtmguJJulMRs9qWCzVBt2XA==} - engines: {node: '>=15.10.0'} - - '@aptos-labs/ts-sdk@1.33.1': - resolution: {integrity: sha512-d6nWtUI//fyEN8DeLjm3+ro87Ad6+IKwR9pCqfrs/Azahso1xR1Llxd/O6fj/m1DDsuDj/HAsCsy5TC/aKD6Eg==} - engines: {node: '>=11.0.0'} - - '@avnu/avnu-sdk@2.1.1': - resolution: {integrity: sha512-y/r/pVT2pU33fGHNVE7A5UIAqQhjEXYQhUh7EodY1s5H7mhRd5U8zHOtI5z6vmpuSnUv0hSvOmmgz8HTuwZ7ew==} - engines: {node: '>=18'} - peerDependencies: - ethers: ^6.11.1 - qs: ^6.12.0 - starknet: ^6.6.0 - '@aws-crypto/crc32@5.2.0': resolution: {integrity: sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==} engines: {node: '>=16.0.0'} @@ -2676,10 +2065,6 @@ packages: resolution: {integrity: sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==} engines: {node: '>=6.9.0'} - '@babel/standalone@7.26.4': - resolution: {integrity: sha512-SF+g7S2mhTT1b7CHyfNjDkPU1corxg4LPYsyP0x5KuCl+EbtBQHRLqr9N3q7e7+x7NQ5LYxQf8mJ2PmzebLr0A==} - engines: {node: '>=6.9.0'} - '@babel/template@7.25.9': resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} @@ -2741,9 +2126,6 @@ packages: resolution: {integrity: sha512-d7TeUl5t+TOMJe7/CRYtf+x6hbd8N25DtH7guQTIjjr3AFVortxiAIgNejGvVqy0by4eNByw+oVil15oqxz2Eg==} deprecated: This project has been renamed to @ghostery/adblocker. Install using @ghostery/adblocker instead - '@coinbase-samples/advanced-sdk-ts@file:packages/plugin-coinbase/advanced-sdk-ts': - resolution: {directory: packages/plugin-coinbase/advanced-sdk-ts, type: directory} - '@coinbase/coinbase-sdk@0.10.0': resolution: {integrity: sha512-sqLH7dE/0XSn5jHddjVrC1PR77sQUEytYcQAlH2d8STqRARcvddxVAByECUIL32MpbdJY7Wca3KfSa6qo811Mg==} @@ -2820,20 +2202,6 @@ packages: resolution: {integrity: sha512-gwRLBLra/Dozj2OywopeuHj2ac26gjGkz2cZ+86cTJOdtWfiRRr4+e77ZDAGc6MDWxaWheI+mAV5TLWWRwqrFg==} engines: {node: '>=v18'} - '@coral-xyz/anchor-errors@0.30.1': - resolution: {integrity: sha512-9Mkradf5yS5xiLWrl9WrpjqOrAV+/W2RQHDlbnAZBivoGpOs1ECjoDCkVk4aRG8ZdiFiB8zQEVlxf+8fKkmSfQ==} - engines: {node: '>=10'} - - '@coral-xyz/anchor@0.30.1': - resolution: {integrity: sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ==} - engines: {node: '>=11'} - - '@coral-xyz/borsh@0.30.1': - resolution: {integrity: sha512-aaxswpPrCFKl8vZTbxLssA2RvwX2zmKLlRCIktJOwW+VpVwYtXRtlWiIP+c2pPRKneiTiWCN2GEMSH9j1zTlWQ==} - engines: {node: '>=10'} - peerDependencies: - '@solana/web3.js': ^1.68.0 - '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -3102,27 +2470,6 @@ packages: resolution: {integrity: sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==} engines: {node: '>=6.0.0'} - '@dfinity/agent@2.1.3': - resolution: {integrity: sha512-4XmqhFR3GQSUrmx7lMFx7DyHEhFkM6nz4O9FeYJ/WpkmPe8tulKaAfgWbWdTSCjbd8meCgKVHo+QYj+JHXagcw==} - peerDependencies: - '@dfinity/candid': ^2.1.3 - '@dfinity/principal': ^2.1.3 - - '@dfinity/candid@2.1.3': - resolution: {integrity: sha512-Asn7AfydLhhk7E5z9oW+5UL6ne11gxFlYTxHuhrIc7FdqYlM5Flcq1Wfg9EzRa6Btdol3w58Bcph7Brwh1bcIQ==} - peerDependencies: - '@dfinity/principal': ^2.1.3 - - '@dfinity/identity@2.1.3': - resolution: {integrity: sha512-qII0V91S1YeIz5/XRHomwrUhTME+C3oqdTnb99tBitXA2Gq6LU2JaCLbKbN7ehhSyW6EjO4tySJxANz6hYENcQ==} - peerDependencies: - '@dfinity/agent': ^2.1.3 - '@dfinity/principal': ^2.1.3 - '@peculiar/webcrypto': ^1.4.0 - - '@dfinity/principal@2.1.3': - resolution: {integrity: sha512-HtiAfZcs+ToPYFepVJdFlorIfPA56KzC6J97ZuH2lGNMTAfJA+NEBzLe476B4wVCAwZ0TiGJ27J4ks9O79DFEg==} - '@discordjs/builders@1.9.0': resolution: {integrity: sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg==} engines: {node: '>=18'} @@ -3435,16 +2782,6 @@ packages: '@emnapi/wasi-threads@1.0.1': resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - '@es-joy/jsdoccomment@0.41.0': - resolution: {integrity: sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==} - engines: {node: '>=16'} - - '@esbuild/aix-ppc64@0.19.12': - resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -3457,12 +2794,6 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.19.12': - resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - '@esbuild/android-arm64@0.21.5': resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} engines: {node: '>=12'} @@ -3475,12 +2806,6 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm@0.19.12': - resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - '@esbuild/android-arm@0.21.5': resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} engines: {node: '>=12'} @@ -3493,12 +2818,6 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-x64@0.19.12': - resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - '@esbuild/android-x64@0.21.5': resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} engines: {node: '>=12'} @@ -3511,12 +2830,6 @@ packages: cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.19.12': - resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - '@esbuild/darwin-arm64@0.21.5': resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} engines: {node: '>=12'} @@ -3529,12 +2842,6 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.19.12': - resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - '@esbuild/darwin-x64@0.21.5': resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} engines: {node: '>=12'} @@ -3547,12 +2854,6 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.19.12': - resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - '@esbuild/freebsd-arm64@0.21.5': resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} engines: {node: '>=12'} @@ -3565,12 +2866,6 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.19.12': - resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} engines: {node: '>=12'} @@ -3583,12 +2878,6 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.19.12': - resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - '@esbuild/linux-arm64@0.21.5': resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} engines: {node: '>=12'} @@ -3601,12 +2890,6 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.19.12': - resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - '@esbuild/linux-arm@0.21.5': resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} engines: {node: '>=12'} @@ -3619,12 +2902,6 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.19.12': - resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - '@esbuild/linux-ia32@0.21.5': resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} engines: {node: '>=12'} @@ -3637,12 +2914,6 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.19.12': - resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - '@esbuild/linux-loong64@0.21.5': resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} engines: {node: '>=12'} @@ -3655,12 +2926,6 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.19.12': - resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - '@esbuild/linux-mips64el@0.21.5': resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} engines: {node: '>=12'} @@ -3673,12 +2938,6 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.19.12': - resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - '@esbuild/linux-ppc64@0.21.5': resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} engines: {node: '>=12'} @@ -3691,12 +2950,6 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.19.12': - resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - '@esbuild/linux-riscv64@0.21.5': resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} engines: {node: '>=12'} @@ -3709,12 +2962,6 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.19.12': - resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - '@esbuild/linux-s390x@0.21.5': resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} engines: {node: '>=12'} @@ -3727,12 +2974,6 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.19.12': - resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - '@esbuild/linux-x64@0.21.5': resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} engines: {node: '>=12'} @@ -3745,12 +2986,6 @@ packages: cpu: [x64] os: [linux] - '@esbuild/netbsd-x64@0.19.12': - resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - '@esbuild/netbsd-x64@0.21.5': resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} engines: {node: '>=12'} @@ -3769,12 +3004,6 @@ packages: cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.19.12': - resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - '@esbuild/openbsd-x64@0.21.5': resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} engines: {node: '>=12'} @@ -3787,12 +3016,6 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.19.12': - resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - '@esbuild/sunos-x64@0.21.5': resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} engines: {node: '>=12'} @@ -3805,12 +3028,6 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.19.12': - resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - '@esbuild/win32-arm64@0.21.5': resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} engines: {node: '>=12'} @@ -3823,12 +3040,6 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.19.12': - resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - '@esbuild/win32-ia32@0.21.5': resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} engines: {node: '>=12'} @@ -3841,12 +3052,6 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.19.12': - resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - '@esbuild/win32-x64@0.21.5': resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} engines: {node: '>=12'} @@ -3885,18 +3090,10 @@ packages: resolution: {integrity: sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/eslintrc@3.2.0': resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@8.57.1': - resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/js@9.13.0': resolution: {integrity: sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3913,57 +3110,15 @@ packages: resolution: {integrity: sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@ethersproject/abstract-provider@5.7.0': - resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} - - '@ethersproject/abstract-signer@5.7.0': - resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} - - '@ethersproject/address@5.7.0': - resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} - - '@ethersproject/base64@5.7.0': - resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} - - '@ethersproject/bignumber@5.7.0': - resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} - '@ethersproject/bytes@5.7.0': resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} - '@ethersproject/constants@5.7.0': - resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} - - '@ethersproject/hash@5.7.0': - resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} - '@ethersproject/keccak256@5.7.0': resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} '@ethersproject/logger@5.7.0': resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} - '@ethersproject/networks@5.7.1': - resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} - - '@ethersproject/properties@5.7.0': - resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} - - '@ethersproject/rlp@5.7.0': - resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} - - '@ethersproject/signing-key@5.7.0': - resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} - - '@ethersproject/strings@5.7.0': - resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} - - '@ethersproject/transactions@5.7.0': - resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} - - '@ethersproject/web@5.7.1': - resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} - '@fal-ai/client@1.2.0': resolution: {integrity: sha512-MNCnE5icY+OM5ahgYJItmydZ7AxhtzhgA5tQI13jVntzhLT0z+tetHIlAL1VA0XFZgldDzqxeTf9Pr5TW3VErg==} engines: {node: '>=18.0.0'} @@ -4030,19 +3185,10 @@ packages: resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} engines: {node: '>=18.18.0'} - '@humanwhocodes/config-array@0.13.0': - resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead - '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - deprecated: Use @eslint/object-schema instead - '@humanwhocodes/retry@0.3.1': resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} @@ -4166,11 +3312,6 @@ packages: cpu: [x64] os: [win32] - '@improbable-eng/grpc-web@0.15.0': - resolution: {integrity: sha512-ERft9/0/8CmYalqOVnJnpdDry28q+j+nAlFFARdjyxXDJ+Mhgv9+F600QC8BR9ygOfrXRlAk6CvST2j+JCpQPg==} - peerDependencies: - google-protobuf: ^3.14.0 - '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -4333,16 +3474,6 @@ packages: '@lifi/types@16.3.0': resolution: {integrity: sha512-rYMdXRdNOyJb5tI5CXfqxU4k62GiJrElx0DEZ8ZRFYFtljg69X6hrMKER1wVWkRpcB67Ca8SKebLnufy7qCaTw==} - '@lit-labs/ssr-dom-shim@1.2.1': - resolution: {integrity: sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==} - - '@lit/reactive-element@1.6.3': - resolution: {integrity: sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==} - - '@lukeed/csprng@1.1.0': - resolution: {integrity: sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==} - engines: {node: '>=8'} - '@mapbox/node-pre-gyp@1.0.11': resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true @@ -4359,31 +3490,6 @@ packages: '@mermaid-js/parser@0.3.0': resolution: {integrity: sha512-HsvL6zgE5sUPGgkIDlmAWR1HTNHz2Iy11BAWPTa4Jjabkpguy4Ze2gzfLrg6pdRuBvFwgUYyxiaNqZwrEEXepA==} - '@motionone/animation@10.18.0': - resolution: {integrity: sha512-9z2p5GFGCm0gBsZbi8rVMOAJCtw1WqBTIPw3ozk06gDvZInBPIsQcHgYogEJ4yuHJ+akuW8g1SEIOpTOvYs8hw==} - - '@motionone/dom@10.18.0': - resolution: {integrity: sha512-bKLP7E0eyO4B2UaHBBN55tnppwRnaE3KFfh3Ps9HhnAkar3Cb69kUCJY9as8LrccVYKgHA+JY5dOQqJLOPhF5A==} - - '@motionone/easing@10.18.0': - resolution: {integrity: sha512-VcjByo7XpdLS4o9T8t99JtgxkdMcNWD3yHU/n6CLEz3bkmKDRZyYQ/wmSf6daum8ZXqfUAgFeCZSpJZIMxaCzg==} - - '@motionone/generators@10.18.0': - resolution: {integrity: sha512-+qfkC2DtkDj4tHPu+AFKVfR/C30O1vYdvsGYaR13W/1cczPrrcjdvYCj0VLFuRMN+lP1xvpNZHCRNM4fBzn1jg==} - - '@motionone/svelte@10.16.4': - resolution: {integrity: sha512-zRVqk20lD1xqe+yEDZhMYgftsuHc25+9JSo+r0a0OWUJFocjSV9D/+UGhX4xgJsuwB9acPzXLr20w40VnY2PQA==} - - '@motionone/types@10.17.1': - resolution: {integrity: sha512-KaC4kgiODDz8hswCrS0btrVrzyU2CSQKO7Ps90ibBVSQmjkrt2teqta6/sOG59v7+dPnKMAg13jyqtMKV2yJ7A==} - - '@motionone/utils@10.18.0': - resolution: {integrity: sha512-3XVF7sgyTSI2KWvTf6uLlBJ5iAgRgmvp3bpuOiQJvInd4nZ19ET8lX5unn30SlmRH7hXbBbH+Gxd0m0klJ3Xtw==} - - '@motionone/vue@10.16.4': - resolution: {integrity: sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg==} - deprecated: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion - '@mozilla/readability@0.5.0': resolution: {integrity: sha512-Z+CZ3QaosfFaTqvhQsIktyGrjFjSC0Fa4EMph4mqKnWhmyoGICsV/8QK+8HpXut6zV7zwfWwqDmEjtk1Qf6EgQ==} engines: {node: '>=14.0.0'} @@ -4446,53 +3552,9 @@ packages: peerDependencies: near-api-js: ^0.44.2 || ^1.0.0 - '@nestjs/axios@3.1.1': - resolution: {integrity: sha512-ySoxrzqX80P1q6LKLKGcgyBd2utg4gbC+4FsJNpXYvILorMlxss/ECNogD9EXLCE4JS5exVFD5ez0nK5hXcNTQ==} - peerDependencies: - '@nestjs/common': ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 - axios: ^1.3.1 - rxjs: ^6.0.0 || ^7.0.0 - - '@nestjs/common@10.4.6': - resolution: {integrity: sha512-KkezkZvU9poWaNq4L+lNvx+386hpOxPJkfXBBeSMrcqBOx8kVr36TGN2uYkF4Ta4zNu1KbCjmZbc0rhHSg296g==} - peerDependencies: - class-transformer: '*' - class-validator: '*' - reflect-metadata: ^0.1.12 || ^0.2.0 - rxjs: ^7.1.0 - peerDependenciesMeta: - class-transformer: - optional: true - class-validator: - optional: true - - '@nestjs/core@10.4.6': - resolution: {integrity: sha512-zXVPxCNRfO6gAy0yvEDjUxE/8gfZICJFpsl2lZAUH31bPb6m+tXuhUq2mVCTEltyMYQ+DYtRe+fEYM2v152N1g==} - peerDependencies: - '@nestjs/common': ^10.0.0 - '@nestjs/microservices': ^10.0.0 - '@nestjs/platform-express': ^10.0.0 - '@nestjs/websockets': ^10.0.0 - reflect-metadata: ^0.1.12 || ^0.2.0 - rxjs: ^7.1.0 - peerDependenciesMeta: - '@nestjs/microservices': - optional: true - '@nestjs/platform-express': - optional: true - '@nestjs/websockets': - optional: true - - '@neynar/nodejs-sdk@2.2.3': - resolution: {integrity: sha512-9CW2j64yFJEg70A0D6qc3EE5x8NnMzHMRNdA9VuLYZQA1GzoOWsi6/BKxPX/vfgSvnNeveCIPtUzEXRSTbGarQ==} - engines: {node: '>=19.9.0'} - '@noble/curves@1.2.0': resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} - '@noble/curves@1.3.0': - resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} - '@noble/curves@1.6.0': resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} engines: {node: ^14.21.3 || >=16} @@ -4670,11 +3732,6 @@ packages: resolution: {integrity: sha512-zBeYzzwg43T/Z8ZtLblv0fcKuqJULttqYDekSLILThXp3UOMSerEvruhUgwddCY1jUssfLscz8vacMKISv5X4w==} hasBin: true - '@nuxtjs/opencollective@0.3.2': - resolution: {integrity: sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==} - engines: {node: '>=8.0.0', npm: '>=5.0.0'} - hasBin: true - '@nx/devkit@19.8.14': resolution: {integrity: sha512-A8dCGttbuqgg9P56VTb0ElD2vM5nc5g0aLnX5PSXo4SkFXwd8DV5GgwJKWB1GO9hYyEtbj4gKek0KxnCtdav4g==} peerDependencies: @@ -4764,10 +3821,6 @@ packages: resolution: {integrity: sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ==} engines: {node: '>= 14'} - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - '@octokit/auth-token@5.1.1': resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} engines: {node: '>= 18'} @@ -4780,10 +3833,6 @@ packages: resolution: {integrity: sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ==} engines: {node: '>= 14'} - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - '@octokit/core@6.1.2': resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} engines: {node: '>= 18'} @@ -4796,18 +3845,10 @@ packages: resolution: {integrity: sha512-5L4fseVRUsDFGR00tMWD/Trdeeihn999rTMGRMC1G/Ldi1uWlWJzI98H4Iak5DB/RVvQuyMYKqSK/R6mbSOQyg==} engines: {node: '>= 14'} - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - '@octokit/graphql@5.0.6': resolution: {integrity: sha512-Fxyxdy/JH0MnIB5h+UQ3yCoh1FG4kWXfFKkpWqjZHw/p+Kc8Y44Hu/kCgNBT6nU1shNumEchmW/sUO1JuQnPcw==} engines: {node: '>= 14'} - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - '@octokit/graphql@8.1.1': resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} engines: {node: '>= 18'} @@ -4827,9 +3868,6 @@ packages: '@octokit/openapi-types@18.1.1': resolution: {integrity: sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==} - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - '@octokit/openapi-types@22.2.0': resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} @@ -4845,12 +3883,6 @@ packages: peerDependencies: '@octokit/core': '>=6' - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - '@octokit/plugin-paginate-rest@11.3.6': resolution: {integrity: sha512-zcvqqf/+TicbTCa/Z+3w4eBJcAxCFymtc0UAIsR3dEVoNilWld4oXdscQ3laXamTszUZdusw97K8+DrbFiOwjw==} engines: {node: '>= 18'} @@ -4868,18 +3900,6 @@ packages: peerDependencies: '@octokit/core': '>=3' - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - '@octokit/plugin-rest-endpoint-methods@13.2.6': resolution: {integrity: sha512-wMsdyHMjSfKjGINkdGKki06VEkgdEldIGstIEyGX0wbYHGByOwN/KiM+hAAlUwAtPkP3gvXtVQA9L3ITdV2tVw==} engines: {node: '>= 18'} @@ -4908,10 +3928,6 @@ packages: resolution: {integrity: sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ==} engines: {node: '>= 14'} - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - '@octokit/request-error@6.1.5': resolution: {integrity: sha512-IlBTfGX8Yn/oFPMwSfvugfncK2EwRLjzbrpifNaMY8o/HTEAFqCA1FZxjD9cWvSKBHgrIhc4CSBIzMxiLsbzFQ==} engines: {node: '>= 18'} @@ -4920,10 +3936,6 @@ packages: resolution: {integrity: sha512-ow4+pkVQ+6XVVsekSYBzJC0VTVvh/FCTUUgTsboGq+DTeWdyIFV8WSCdo0RIxk6wSkBTHqIK1mYuY7nOBXOchw==} engines: {node: '>= 14'} - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - '@octokit/request@9.1.3': resolution: {integrity: sha512-V+TFhu5fdF3K58rs1pGUJIDH5RZLbZm5BI+MNF+6o/ssFNT4vWlCh/tVpF3NxGtP15HUxTTMUbsG5llAuU2CZA==} engines: {node: '>= 18'} @@ -4932,19 +3944,12 @@ packages: resolution: {integrity: sha512-m2a9VhaP5/tUw8FwfnW2ICXlXpLPIqxtg3XcAiGMLj/Xhw3RSBfZ8le/466ktO1Gcjr8oXudGnHhxV1TXJgFxw==} engines: {node: '>= 14'} - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - '@octokit/tsconfig@1.0.2': resolution: {integrity: sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==} '@octokit/types@10.0.0': resolution: {integrity: sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==} - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - '@octokit/types@13.6.2': resolution: {integrity: sha512-WpbZfZUcZU77DrSW4wbsSgTPfKcp286q3ItaIgvSbBpZJlu6mnYXAkjZz6LVZPXkEvLIM8McanyZejKTYUHipA==} @@ -4959,72 +3964,6 @@ packages: resolution: {integrity: sha512-I5YPUtfWidh+OzyrlDahJsUpkpGK0kCTmDRbuqGmlCUzOtxdEkX3R4d6Cd08ijQYwkVXQJanPdbKuZBeV2NMaA==} engines: {node: '>= 18'} - '@onflow/config@1.5.1': - resolution: {integrity: sha512-BmD67EhZEqMRePa3y/WIpC5hH/YF9gV9uv5bPSN39P3laYxd93Ojhdf6v0fXkjO/d3WaHylLPoXYgpW/g5seWA==} - - '@onflow/fcl-core@1.13.1': - resolution: {integrity: sha512-kXej2sLWjY2MVY42omIKiZz0v13V2MTwZV1dwf4xERqgFX0WvsG5ZGyVY0y4kp8mNiUXe7pZmtRhynu2TJGnJw==} - - '@onflow/fcl-wc@5.5.1': - resolution: {integrity: sha512-c83yjATlOTBjGzGlSXUiBJR576L8/oGiiL7b3ymi5jbl47RhubPPiH4Ix+DoJqyDuRtpk5Lim2vodawmH/aiWQ==} - peerDependencies: - '@onflow/fcl-core': 1.13.1 - - '@onflow/fcl@1.13.1': - resolution: {integrity: sha512-96Fe2SsnUqPSIaSxsaL7Fuz3wQUxPfV5eexz0JufWhyQ6NvwDu9bvD/ntNk1ACJkIANlEIzP+sq4Nfz93uINfw==} - - '@onflow/interaction@0.0.11': - resolution: {integrity: sha512-Xuq1Mmx6Wyba/F/L+QLQs0yJeQDsIDwy5SKk5vrCuVgIj0yD8k506g5L8ODrbM1LWll8i0tQsoOi0F85vNl5sA==} - - '@onflow/rlp@1.2.3': - resolution: {integrity: sha512-Mm1jSzDhdTofMGhg3NtUD8uKntj7u1dSMr+Q4VwOw2YQhwGTGJrzsHc7qgkJxwDnjU0Ra8VQfqd54bZzX0R2aQ==} - - '@onflow/sdk@1.5.5': - resolution: {integrity: sha512-79h56lYB/4vi1Tn+QrICUpQZ0Jh8O5d8I0IC/3adAf2zU8xfxvkypw7Tfx58Zr03vip+0h83Ri3DwyZpqIM2sw==} - - '@onflow/transport-http@1.10.4': - resolution: {integrity: sha512-yZNqNEISnCaP7bsB+pwBjHT7+AYjADxUQpj8SccrTWnWlM6LEDIcNVCr8eBzrANug3o2Y1LuqSOhMiWYtbXs7w==} - - '@onflow/typedefs@1.4.0': - resolution: {integrity: sha512-7b4C3F4Ztayx6XdQz/7YoHMzZ6kzy37dLxdVCV/PAsAunq9Jfu32HQaf8a0NCk0L0aM7FS2zT1Om4k7b5KP4Xg==} - - '@onflow/types@1.4.1': - resolution: {integrity: sha512-oKKaNTPfb9OJos4C6RoK3sql9Bx8mi+8ytTc7wLJbjv+n6YUov2zRGkGsPzj2QxL2Xf48CLYtPNn7cBNr3v39w==} - - '@onflow/util-actor@1.3.4': - resolution: {integrity: sha512-BQeFdy0obs2x+XTEkss7MjuasS7gCfIStwGsgpH0aG3siBu+IsMYPiDdrHOeYS2Jn/pSFXF5R85NYrnMvlDhlA==} - - '@onflow/util-address@1.2.3': - resolution: {integrity: sha512-5u1pLQT6MmTlRQLv8zVJP/iOkgytvpzK+32nXcJ29XE0y7YI6GLrFfgKGBIRsiqiSLp7SU6XI5RukEJEblmwOw==} - - '@onflow/util-invariant@1.2.4': - resolution: {integrity: sha512-U4D30lrAxSgqTPQsIvC3gPDoXVxuhLS9TZk4WxEvNfcQrI6VYKvWRe4m/5mUrc4kpE+ntXZmnbs+DUM7oLlkcg==} - - '@onflow/util-logger@1.3.3': - resolution: {integrity: sha512-eivdbF7cKNjTL2nuvI3pjDavDDfTXRq4pJtJpkI8hJMz0XJb84o7D5CLPcDRId//1Kc/qoqM/driHz5A4J52Qw==} - peerDependencies: - '@onflow/util-config': '>1.1.1' - peerDependenciesMeta: - '@onflow/util-config': - optional: true - - '@onflow/util-rpc@0.0.2': - resolution: {integrity: sha512-UFYT99rdHEFOpfG5A/lFJFQBw4Q0b7MKN7lWTwYf/AU+bVm5zgNJ/V4Z9CXOSnA55ztLauYdk+eWldbhC9pqiw==} - - '@onflow/util-semver@1.0.3': - resolution: {integrity: sha512-c604ewWCXUT1WpqeOiblNi3YWOQTGx3UgRWNXbRTD9K17Fh2DaXBTHYVu7FSreGwPGarU0T3iTBWkuuWJXSGwA==} - - '@onflow/util-template@1.2.3': - resolution: {integrity: sha512-yNF7mI5L1y6yJHL+HxmTgIdd/oF1HD/kzjzZgjOyAvk+mLXzML+sWkqRSoIYcETbQ0w6cdNg3xvzZgTLuLIK3A==} - - '@onflow/util-uid@1.2.3': - resolution: {integrity: sha512-gCTVvBBgDcZFX6SGyHPwoPVbK4e9sp0DC1kaQ0cgAt83YgodqiBiJLlwMBYNKuL03zSI6Ic5/TJVMVsruG7l9w==} - - '@openapitools/openapi-generator-cli@2.15.3': - resolution: {integrity: sha512-2UBnsDlMt36thhdXxisbA1qReVtbCaw+NCvXoslRXlaJBL4qkAmZUhNeDLNu3LCbwA2PASMWhJSqeLwgwMCitw==} - engines: {node: '>=16'} - hasBin: true - '@opendocsg/pdf2md@0.1.32': resolution: {integrity: sha512-UK4qVuesmUcpPZXMeO8FwRqpCNwJRBTHcae4j+3Mr3bxrNqilZIIowdrzgcgn8fSQ2Dg/P4/0NoPkxAvf9D5rw==} hasBin: true @@ -5033,109 +3972,6 @@ packages: resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==} engines: {node: '>=8.0.0'} - '@parcel/watcher-android-arm64@2.5.0': - resolution: {integrity: sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [android] - - '@parcel/watcher-darwin-arm64@2.5.0': - resolution: {integrity: sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [darwin] - - '@parcel/watcher-darwin-x64@2.5.0': - resolution: {integrity: sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [darwin] - - '@parcel/watcher-freebsd-x64@2.5.0': - resolution: {integrity: sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [freebsd] - - '@parcel/watcher-linux-arm-glibc@2.5.0': - resolution: {integrity: sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA==} - engines: {node: '>= 10.0.0'} - cpu: [arm] - os: [linux] - - '@parcel/watcher-linux-arm-musl@2.5.0': - resolution: {integrity: sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA==} - engines: {node: '>= 10.0.0'} - cpu: [arm] - os: [linux] - - '@parcel/watcher-linux-arm64-glibc@2.5.0': - resolution: {integrity: sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [linux] - - '@parcel/watcher-linux-arm64-musl@2.5.0': - resolution: {integrity: sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [linux] - - '@parcel/watcher-linux-x64-glibc@2.5.0': - resolution: {integrity: sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [linux] - - '@parcel/watcher-linux-x64-musl@2.5.0': - resolution: {integrity: sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [linux] - - '@parcel/watcher-wasm@2.5.0': - resolution: {integrity: sha512-Z4ouuR8Pfggk1EYYbTaIoxc+Yv4o7cGQnH0Xy8+pQ+HbiW+ZnwhcD2LPf/prfq1nIWpAxjOkQ8uSMFWMtBLiVQ==} - engines: {node: '>= 10.0.0'} - bundledDependencies: - - napi-wasm - - '@parcel/watcher-win32-arm64@2.5.0': - resolution: {integrity: sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [win32] - - '@parcel/watcher-win32-ia32@2.5.0': - resolution: {integrity: sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA==} - engines: {node: '>= 10.0.0'} - cpu: [ia32] - os: [win32] - - '@parcel/watcher-win32-x64@2.5.0': - resolution: {integrity: sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [win32] - - '@parcel/watcher@2.5.0': - resolution: {integrity: sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==} - engines: {node: '>= 10.0.0'} - - '@peculiar/asn1-schema@2.3.13': - resolution: {integrity: sha512-3Xq3a01WkHRZL8X04Zsfg//mGaA21xlL4tlVn4v2xGT0JStiztATRkMwa5b+f/HXmY2smsiLXYK46Gwgzvfg3g==} - - '@peculiar/json-schema@1.1.12': - resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==} - engines: {node: '>=8.0.0'} - - '@peculiar/webcrypto@1.5.0': - resolution: {integrity: sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg==} - engines: {node: '>=10.12.0'} - - '@phala/dstack-sdk@0.1.6': - resolution: {integrity: sha512-/JNlCDvgQmqAs+3N9qbRjqQdm4UCd1iYmkjH7cE7ejwWcoF4b4bSikiQdMK+fQ3be8T7FJupjWw52ysHWsnwmQ==} - engines: {node: '>=18.0.0'} - '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -5555,15 +4391,6 @@ packages: '@remusao/trie@1.5.0': resolution: {integrity: sha512-UX+3utJKgwCsg6sUozjxd38gNMVRXrY4TNX9VvCdSrlZBS1nZjRPi98ON3QjRAdf6KCguJFyQARRsulTeqQiPg==} - '@rollup/plugin-alias@5.1.1': - resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - '@rollup/plugin-commonjs@25.0.8': resolution: {integrity: sha512-ZEZWTK5n6Qde0to4vS9Mr5x/0UZoqCxPVR9KRUjU4kA2sO7GEUn1fop0DAwpO6z0Nw/kJON9bDmSxdWxO/TT1A==} engines: {node: '>=14.0.0'} @@ -5766,9 +4593,6 @@ packages: '@scure/bip39@1.4.0': resolution: {integrity: sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw==} - '@scure/starknet@1.0.0': - resolution: {integrity: sha512-o5J57zY0f+2IL/mq8+AYJJ4Xpc1fOtDhr+mFQKbHnYFmm3WQrC+8zj2HEgxak1a+x86mhmBC1Kq305KUpVf0wg==} - '@selderee/plugin-htmlparser2@0.11.0': resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} @@ -5834,10 +4658,6 @@ packages: resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} engines: {node: '>=14.16'} - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} @@ -6058,109 +4878,10 @@ packages: resolution: {integrity: sha512-PpjSboaDUE6yl+1qlg3Si57++e84oXdWGbuFUSAciXsVfEZJJJupR2Nb0QuXHiunt2vGR+1PTizOMvnUPaG2Qg==} engines: {node: '>=16.0.0'} - '@solana/buffer-layout-utils@0.2.0': - resolution: {integrity: sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==} - engines: {node: '>= 10'} - '@solana/buffer-layout@4.0.1': resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} engines: {node: '>=5.10'} - '@solana/codecs-core@2.0.0-preview.2': - resolution: {integrity: sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg==} - - '@solana/codecs-core@2.0.0-rc.1': - resolution: {integrity: sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==} - peerDependencies: - typescript: '>=5' - - '@solana/codecs-data-structures@2.0.0-preview.2': - resolution: {integrity: sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg==} - - '@solana/codecs-data-structures@2.0.0-rc.1': - resolution: {integrity: sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==} - peerDependencies: - typescript: '>=5' - - '@solana/codecs-numbers@2.0.0-preview.2': - resolution: {integrity: sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw==} - - '@solana/codecs-numbers@2.0.0-rc.1': - resolution: {integrity: sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==} - peerDependencies: - typescript: '>=5' - - '@solana/codecs-strings@2.0.0-preview.2': - resolution: {integrity: sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g==} - peerDependencies: - fastestsmallesttextencoderdecoder: ^1.0.22 - - '@solana/codecs-strings@2.0.0-rc.1': - resolution: {integrity: sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==} - peerDependencies: - fastestsmallesttextencoderdecoder: ^1.0.22 - typescript: '>=5' - - '@solana/codecs@2.0.0-preview.2': - resolution: {integrity: sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA==} - - '@solana/codecs@2.0.0-rc.1': - resolution: {integrity: sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==} - peerDependencies: - typescript: '>=5' - - '@solana/errors@2.0.0-preview.2': - resolution: {integrity: sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA==} - hasBin: true - - '@solana/errors@2.0.0-rc.1': - resolution: {integrity: sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==} - hasBin: true - peerDependencies: - typescript: '>=5' - - '@solana/options@2.0.0-preview.2': - resolution: {integrity: sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w==} - - '@solana/options@2.0.0-rc.1': - resolution: {integrity: sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==} - peerDependencies: - typescript: '>=5' - - '@solana/spl-token-group@0.0.4': - resolution: {integrity: sha512-7+80nrEMdUKlK37V6kOe024+T7J4nNss0F8LQ9OOPYdWCCfJmsGUzVx2W3oeizZR4IHM6N4yC9v1Xqwc3BTPWw==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.91.6 - - '@solana/spl-token-group@0.0.7': - resolution: {integrity: sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.95.3 - - '@solana/spl-token-metadata@0.1.6': - resolution: {integrity: sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.95.3 - - '@solana/spl-token@0.4.6': - resolution: {integrity: sha512-1nCnUqfHVtdguFciVWaY/RKcQz1IF4b31jnKgAmjU9QVN1q7dRUkTEWJZgTYIEtsULjVnC9jRqlhgGN39WbKKA==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.91.6 - - '@solana/spl-token@0.4.9': - resolution: {integrity: sha512-g3wbj4F4gq82YQlwqhPB0gHFXfgsC6UmyGMxtSLf/BozT/oKd59465DbnlUK8L8EcimKMavxsVAMoLcEdeCicg==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.95.3 - - '@solana/spl-type-length-value@0.1.0': - resolution: {integrity: sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==} - engines: {node: '>=16'} - '@solana/wallet-adapter-base@0.9.23': resolution: {integrity: sha512-apqMuYwFp1jFi55NxDfvXUX2x1T0Zh07MxhZ/nCCTGys5raSfYUh82zen2BLv8BSDj/JxZ2P/s7jrQZGrX8uAw==} engines: {node: '>=16'} @@ -6177,85 +4898,6 @@ packages: '@solana/web3.js@1.95.8': resolution: {integrity: sha512-sBHzNh7dHMrmNS5xPD1d0Xa2QffW/RXaxu/OysRXBfwTp+LYqGGmMtCYYwrHPrN5rjAmJCsQRNAwv4FM0t3B6g==} - '@stablelib/aead@1.0.1': - resolution: {integrity: sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==} - - '@stablelib/binary@1.0.1': - resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==} - - '@stablelib/bytes@1.0.1': - resolution: {integrity: sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==} - - '@stablelib/chacha20poly1305@1.0.1': - resolution: {integrity: sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==} - - '@stablelib/chacha@1.0.1': - resolution: {integrity: sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==} - - '@stablelib/constant-time@1.0.1': - resolution: {integrity: sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==} - - '@stablelib/ed25519@1.0.3': - resolution: {integrity: sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==} - - '@stablelib/hash@1.0.1': - resolution: {integrity: sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==} - - '@stablelib/hkdf@1.0.1': - resolution: {integrity: sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==} - - '@stablelib/hmac@1.0.1': - resolution: {integrity: sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==} - - '@stablelib/int@1.0.1': - resolution: {integrity: sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==} - - '@stablelib/keyagreement@1.0.1': - resolution: {integrity: sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==} - - '@stablelib/poly1305@1.0.1': - resolution: {integrity: sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==} - - '@stablelib/random@1.0.2': - resolution: {integrity: sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==} - - '@stablelib/sha256@1.0.1': - resolution: {integrity: sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==} - - '@stablelib/sha512@1.0.1': - resolution: {integrity: sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw==} - - '@stablelib/wipe@1.0.1': - resolution: {integrity: sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==} - - '@stablelib/x25519@1.0.3': - resolution: {integrity: sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw==} - - '@starknet-io/types-js@0.7.10': - resolution: {integrity: sha512-1VtCqX4AHWJlRRSYGSn+4X1mqolI1Tdq62IwzoU2vUuEE72S1OlEeGhpvd6XsdqXcfHmVzYfj8k1XtKBQqwo9w==} - - '@supabase/auth-js@2.65.1': - resolution: {integrity: sha512-IA7i2Xq2SWNCNMKxwmPlHafBQda0qtnFr8QnyyBr+KaSxoXXqEzFCnQ1dGTy6bsZjVBgXu++o3qrDypTspaAPw==} - - '@supabase/functions-js@2.4.3': - resolution: {integrity: sha512-sOLXy+mWRyu4LLv1onYydq+10mNRQ4rzqQxNhbrKLTLTcdcmS9hbWif0bGz/NavmiQfPs4ZcmQJp4WqOXlR4AQ==} - - '@supabase/node-fetch@2.6.15': - resolution: {integrity: sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==} - engines: {node: 4.x || >=6.0.0} - - '@supabase/postgrest-js@1.16.3': - resolution: {integrity: sha512-HI6dsbW68AKlOPofUjDTaosiDBCtW4XAm0D18pPwxoW3zKOE2Ru13Z69Wuys9fd6iTpfDViNco5sgrtnP0666A==} - - '@supabase/realtime-js@2.10.9': - resolution: {integrity: sha512-0AjN65VDNIScZzrrPaVvlND4vbgVS+j9Wcy3zf7e+l9JY4IwCTahFenPLcKy9bkr7KY0wfB7MkipZPKxMaDnjw==} - - '@supabase/storage-js@2.7.1': - resolution: {integrity: sha512-asYHcyDR1fKqrMpytAS1zjyEfvxuOIp1CIXX7ji4lHHcJKqyk+sLl/Vxgm4sN6u8zvuUtae9e4kDxQP2qrwWBA==} - - '@supabase/supabase-js@2.46.2': - resolution: {integrity: sha512-5FEzYMZhfIZrMWEqo5/dQincvrhM+DeMWH3/okeZrkBBW1AJxblOQhnhF4/dfNYK25oZ1O8dAnnxZ9gQqdr40w==} - '@svgr/babel-plugin-add-jsx-attribute@8.0.0': resolution: {integrity: sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==} engines: {node: '>=14'} @@ -6412,10 +5054,6 @@ packages: '@swc/types@0.1.17': resolution: {integrity: sha512-V5gRru+aD8YVyCOMAjMpWR1Ui577DD5KSJsHP8RAxopAH22jFz6GZd/qxqjO6MJHQhcsjvjOFXyDhyLQUnMveQ==} - '@szmarczak/http-timer@4.0.6': - resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} - engines: {node: '>=10'} - '@szmarczak/http-timer@5.0.1': resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} @@ -6428,9 +5066,6 @@ packages: peerDependencies: react: ^18 || ^19 - '@telegraf/types@7.1.0': - resolution: {integrity: sha512-kGevOIbpMcIlCDeorKGpwZmdH7kHbqlk/Yj6dEpJMKEQw5lk0KVQY0OLXaCswy8GqlIVLd5625OB+rAntP9xVw==} - '@tinyhttp/content-disposition@2.2.2': resolution: {integrity: sha512-crXw1txzrS36huQOyQGYFvhTeLeG0Si1xu+/l6kXUVYpE0TjFjEZRqTbuadQLfKGZ0jaI+jJoRyqaWwxOSHW2g==} engines: {node: '>=12.20.0'} @@ -6498,9 +5133,6 @@ packages: '@types/bonjour@3.5.13': resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} - '@types/cacheable-request@6.0.3': - resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} - '@types/chrome@0.0.278': resolution: {integrity: sha512-PDIJodOu7o54PpSOYLybPW/MDZBCjM1TKgf31I3Q/qaEbNpIH09rOM3tSEH3N7Q+FAqb1933LhF8ksUPYeQLNg==} @@ -6612,16 +5244,6 @@ packages: '@types/diff-match-patch@1.0.36': resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==} - '@types/dompurify@3.2.0': - resolution: {integrity: sha512-Fgg31wv9QbLDA0SpTOXO3MaxySc4DKGLi8sna4/Utjo4r3ZRPdCt4UQee8BWr+Q5z21yifghREPJGYaEOEIACg==} - deprecated: This is a stub types definition. dompurify provides its own type definitions, so you do not need this installed. - - '@types/elliptic@6.4.18': - resolution: {integrity: sha512-UseG6H5vjRiNpQvrhy4VF/JXdA3V/Fp5amvveaL+fs28BZ6xIKJBPnUPRlEaZpysD9MbpfaLi8lbl7PGUAkpWw==} - - '@types/emscripten@1.39.13': - resolution: {integrity: sha512-cFq+fO/isvhvmuP/+Sl4K4jtU6E23DoivtbO4r50e3odaxAiVdbfSYRDdJ4gCdxx+3aRjhphS5ZMwIH4hFy/Cw==} - '@types/eslint-scope@3.7.7': resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} @@ -6664,9 +5286,6 @@ packages: '@types/geojson@7946.0.15': resolution: {integrity: sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA==} - '@types/glob@8.1.0': - resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} - '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} @@ -6715,12 +5334,6 @@ packages: '@types/jsonfile@6.1.4': resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} - '@types/jsonwebtoken@9.0.7': - resolution: {integrity: sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==} - - '@types/keyv@3.1.4': - resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} - '@types/lodash@4.17.13': resolution: {integrity: sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==} @@ -6736,9 +5349,6 @@ packages: '@types/minimatch@3.0.5': resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} - '@types/minimatch@5.1.2': - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - '@types/minimist@1.2.5': resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} @@ -6794,9 +5404,6 @@ packages: '@types/pg@8.11.10': resolution: {integrity: sha512-LczQUW4dbOQzsH2RQ5qoeJ6qJPdrcM/DcMLoqWQkMLMsq83J5lAX3LXjdkWdpscFy67JSOWDnh7Ny/sPFykmkg==} - '@types/phoenix@1.6.6': - resolution: {integrity: sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==} - '@types/prismjs@1.26.5': resolution: {integrity: sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==} @@ -6827,9 +5434,6 @@ packages: '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - '@types/responselike@1.0.3': - resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} - '@types/retry@0.12.0': resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} @@ -6848,9 +5452,6 @@ packages: '@types/sockjs@0.3.36': resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} - '@types/sql.js@1.4.9': - resolution: {integrity: sha512-ep8b36RKHlgWPqjNG9ToUrPiwkhwh0AEzy883mO5Xnd+cL6VBH1EvSjBAAuxLUFF2Vn/moE3Me6v9E1Lo+48GQ==} - '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} @@ -7042,19 +5643,6 @@ packages: '@ungap/structured-clone@1.2.1': resolution: {integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==} - '@uniswap/sdk-core@4.2.1': - resolution: {integrity: sha512-hr7vwYrXScg+V8/rRc2UL/Ixc/p0P7yqe4D/OxzUdMRYr8RZd+8z5Iu9+WembjZT/DCdbTjde6lsph4Og0n1BQ==} - engines: {node: '>=10'} - - '@uniswap/sdk-core@6.0.0': - resolution: {integrity: sha512-6rwBG/Ut7rL2Dw4xtTF1dHSmtctT3h57q4vXIneLYjlePa1PT0mgp5D7cu/6xKEvO1MFtnMchImpWsclfafdUg==} - engines: {node: '>=10'} - - '@unruggable_starknet/core@0.1.0': - resolution: {integrity: sha512-qhKqw1XKhSRHzK3Ll/RzCblGFJDD4oeGoPQbal/X7QVVG1qz+VnqoyA1U6SDmlSGTHfskvMoXrVWkPRFL2RqHA==} - peerDependencies: - starknet: '>=5.0.0' - '@vitejs/plugin-react@4.3.3': resolution: {integrity: sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -7085,23 +5673,9 @@ packages: vitest: optional: true - '@vitest/expect@2.1.4': - resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==} - '@vitest/expect@2.1.5': resolution: {integrity: sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==} - '@vitest/mocker@2.1.4': - resolution: {integrity: sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==} - peerDependencies: - msw: ^2.4.9 - vite: ^5.0.0 - peerDependenciesMeta: - msw: - optional: true - vite: - optional: true - '@vitest/mocker@2.1.5': resolution: {integrity: sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==} peerDependencies: @@ -7113,36 +5687,21 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.4': - resolution: {integrity: sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==} - '@vitest/pretty-format@2.1.5': resolution: {integrity: sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==} '@vitest/pretty-format@2.1.8': resolution: {integrity: sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==} - '@vitest/runner@2.1.4': - resolution: {integrity: sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==} - '@vitest/runner@2.1.5': resolution: {integrity: sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==} - '@vitest/snapshot@2.1.4': - resolution: {integrity: sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==} - '@vitest/snapshot@2.1.5': resolution: {integrity: sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==} - '@vitest/spy@2.1.4': - resolution: {integrity: sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==} - '@vitest/spy@2.1.5': resolution: {integrity: sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==} - '@vitest/utils@2.1.4': - resolution: {integrity: sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==} - '@vitest/utils@2.1.5': resolution: {integrity: sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==} @@ -7187,78 +5746,6 @@ packages: resolution: {integrity: sha512-hiEivWNztx73s+7iLxsuD1sOJ28xtRix58W7Xnz4XzzA/pF0+aicnWgjOdA10doVDEDZdUuZCIIqG96SFNlDUg==} engines: {node: '>=16'} - '@walletconnect/core@2.17.2': - resolution: {integrity: sha512-O9VUsFg78CbvIaxfQuZMsHcJ4a2Z16DRz/O4S+uOAcGKhH/i/ln8hp864Tb+xRvifWSzaZ6CeAVxk657F+pscA==} - engines: {node: '>=18'} - - '@walletconnect/environment@1.0.1': - resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} - - '@walletconnect/events@1.0.1': - resolution: {integrity: sha512-NPTqaoi0oPBVNuLv7qPaJazmGHs5JGyO8eEAk5VGKmJzDR7AHzD4k6ilox5kxk1iwiOnFopBOOMLs86Oa76HpQ==} - - '@walletconnect/heartbeat@1.2.2': - resolution: {integrity: sha512-uASiRmC5MwhuRuf05vq4AT48Pq8RMi876zV8rr8cV969uTOzWdB/k+Lj5yI2PBtB1bGQisGen7MM1GcZlQTBXw==} - - '@walletconnect/jsonrpc-provider@1.0.14': - resolution: {integrity: sha512-rtsNY1XqHvWj0EtITNeuf8PHMvlCLiS3EjQL+WOkxEOA4KPxsohFnBDeyPYiNm4ZvkQdLnece36opYidmtbmow==} - - '@walletconnect/jsonrpc-types@1.0.4': - resolution: {integrity: sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ==} - - '@walletconnect/jsonrpc-utils@1.0.8': - resolution: {integrity: sha512-vdeb03bD8VzJUL6ZtzRYsFMq1eZQcM3EAzT0a3st59dyLfJ0wq+tKMpmGH7HlB7waD858UWgfIcudbPFsbzVdw==} - - '@walletconnect/jsonrpc-ws-connection@1.0.14': - resolution: {integrity: sha512-Jsl6fC55AYcbkNVkwNM6Jo+ufsuCQRqViOQ8ZBPH9pRREHH9welbBiszuTLqEJiQcO/6XfFDl6bzCJIkrEi8XA==} - - '@walletconnect/keyvaluestorage@1.1.1': - resolution: {integrity: sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==} - peerDependencies: - '@react-native-async-storage/async-storage': 1.x - peerDependenciesMeta: - '@react-native-async-storage/async-storage': - optional: true - - '@walletconnect/logger@2.1.2': - resolution: {integrity: sha512-aAb28I3S6pYXZHQm5ESB+V6rDqIYfsnHaQyzFbwUUBFY4H0OXx/YtTl8lvhUNhMMfb9UxbwEBS253TlXUYJWSw==} - - '@walletconnect/modal-core@2.7.0': - resolution: {integrity: sha512-oyMIfdlNdpyKF2kTJowTixZSo0PGlCJRdssUN/EZdA6H6v03hZnf09JnwpljZNfir2M65Dvjm/15nGrDQnlxSA==} - - '@walletconnect/modal-ui@2.7.0': - resolution: {integrity: sha512-gERYvU7D7K1ANCN/8vUgsE0d2hnRemfAFZ2novm9aZBg7TEd/4EgB+AqbJ+1dc7GhOL6dazckVq78TgccHb7mQ==} - - '@walletconnect/modal@2.7.0': - resolution: {integrity: sha512-RQVt58oJ+rwqnPcIvRFeMGKuXb9qkgSmwz4noF8JZGUym3gUAzVs+uW2NQ1Owm9XOJAV+sANrtJ+VoVq1ftElw==} - - '@walletconnect/relay-api@1.0.11': - resolution: {integrity: sha512-tLPErkze/HmC9aCmdZOhtVmYZq1wKfWTJtygQHoWtgg722Jd4homo54Cs4ak2RUFUZIGO2RsOpIcWipaua5D5Q==} - - '@walletconnect/relay-auth@1.0.4': - resolution: {integrity: sha512-kKJcS6+WxYq5kshpPaxGHdwf5y98ZwbfuS4EE/NkQzqrDFm5Cj+dP8LofzWvjrrLkZq7Afy7WrQMXdLy8Sx7HQ==} - - '@walletconnect/safe-json@1.0.2': - resolution: {integrity: sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==} - - '@walletconnect/sign-client@2.17.2': - resolution: {integrity: sha512-/wigdCIQjlBXSWY43Id0IPvZ5biq4HiiQZti8Ljvx408UYjmqcxcBitbj2UJXMYkid7704JWAB2mw32I1HgshQ==} - - '@walletconnect/time@1.0.2': - resolution: {integrity: sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==} - - '@walletconnect/types@2.17.2': - resolution: {integrity: sha512-j/+0WuO00lR8ntu7b1+MKe/r59hNwYLFzW0tTmozzhfAlDL+dYwWasDBNq4AH8NbVd7vlPCQWmncH7/6FVtOfQ==} - - '@walletconnect/utils@2.17.2': - resolution: {integrity: sha512-T7eLRiuw96fgwUy2A5NZB5Eu87ukX8RCVoO9lji34RFV4o2IGU9FhTEWyd4QQKI8OuQRjSknhbJs0tU0r0faPw==} - - '@walletconnect/window-getters@1.0.1': - resolution: {integrity: sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==} - - '@walletconnect/window-metadata@1.0.1': - resolution: {integrity: sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA==} - '@webassemblyjs/ast@1.14.1': resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} @@ -7332,10 +5819,6 @@ packages: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - abi-wan-kanabi@2.2.4: - resolution: {integrity: sha512-0aA81FScmJCPX+8UvkXLki3X1+yPQuWxEkqXBVKltgPAK79J+NB+Lp5DouMXa7L6f+zcRlIA/6XO7BN/q9fnvg==} - hasBin: true - abitype@1.0.6: resolution: {integrity: sha512-MMSqYh4+C/aVqI2RQaWqbvI4Kxo5cQV40WQ4QFtDnNzCkqChm8MuENhElmynZlO0qUy/ObkEUaXtKqYnx1Kp3A==} peerDependencies: @@ -7553,9 +6036,6 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - ansicolors@0.3.2: - resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} - anthropic-vertex-ai@1.0.2: resolution: {integrity: sha512-4YuK04KMmBGkx6fi2UjnHkE4mhaIov7tnT5La9+DMn/gw/NSOLZoWNUx+13VY3mkcaseKBMEn1DBzdXXJFIP7A==} engines: {node: '>=18'} @@ -7578,10 +6058,6 @@ packages: aproba@2.0.0: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - are-docs-informative@0.0.2: - resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} - engines: {node: '>=14'} - are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} engines: {node: '>=10'} @@ -7644,10 +6120,6 @@ packages: asn1@0.2.6: resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} - asn1js@3.0.5: - resolution: {integrity: sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==} - engines: {node: '>=12.0.0'} - assert-plus@1.0.0: resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} engines: {node: '>=0.8'} @@ -7686,17 +6158,9 @@ packages: resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} engines: {node: '>= 4.0.0'} - atomic-sleep@1.0.0: - resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} - engines: {node: '>=8.0.0'} - autocomplete.js@0.37.1: resolution: {integrity: sha512-PgSe9fHYhZEsm/9jggbjtVsGXJkPLvd+9mC7gZJ662vVL5CRWEtm/mIrrzCx0MrNxHVwxD5d00UOn6NsmL2LUQ==} - automd@0.3.12: - resolution: {integrity: sha512-qNHdFSAE7zMIO12FJpGBp98uLrIUxg3i8WzvsEGGq0rD5olkgSK9KE0SsYfwciW1LdP6q8lWX+3chaxjtgN9gA==} - hasBin: true - autoprefixer@10.4.20: resolution: {integrity: sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==} engines: {node: ^10 || ^12 || >=14} @@ -7727,12 +6191,6 @@ packages: axios@0.27.2: resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} - axios@1.7.4: - resolution: {integrity: sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==} - - axios@1.7.7: - resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} - axios@1.7.8: resolution: {integrity: sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==} @@ -7853,10 +6311,6 @@ packages: base-x@5.0.0: resolution: {integrity: sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ==} - base64-arraybuffer@0.2.0: - resolution: {integrity: sha512-7emyCsu1/xiBXgQZrscw/8KPRT44I4Yq9Pe6EGs3aPRTsWuggML1/1DTuZUuIaJPIm1FTDUVXl4x/yW8s0kQDQ==} - engines: {node: '>= 0.6.0'} - base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -7986,10 +6440,6 @@ packages: boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - borc@2.1.2: - resolution: {integrity: sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==} - engines: {node: '>=4'} - borsh@0.6.0: resolution: {integrity: sha512-sl5k89ViqsThXQpYa9XDtz1sBl3l1lI313cFUY1HKr+wvMILnb+58xpkqTNrYbelh99dY7K8usxoCusQmqix9Q==} @@ -8026,9 +6476,6 @@ packages: brorand@1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} - browser-headers@0.4.1: - resolution: {integrity: sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==} - browser-pack@6.1.0: resolution: {integrity: sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==} hasBin: true @@ -8106,10 +6553,6 @@ packages: buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - buffer-layout@1.2.2: - resolution: {integrity: sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==} - engines: {node: '>=4.5'} - buffer-more-ints@1.0.0: resolution: {integrity: sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==} @@ -8129,10 +6572,6 @@ packages: resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} engines: {node: '>=6.14.2'} - builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - builtin-status-codes@3.0.0: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} @@ -8146,9 +6585,6 @@ packages: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} - buttplug@3.2.2: - resolution: {integrity: sha512-TGkQzG6dxEjuFX29eRoWkh82vsQhGQ+E98tZtN8fWn1NOG7v/9H0FFkNXrpmeRt9FFS0GdHTvubfZ8dcIPGSAA==} - byte-size@8.1.1: resolution: {integrity: sha512-tUkzZWK0M/qdoLEqikxBWe4kumyuwjl3HO6zHTr4yEI23EojPtLYXdG1+AQY7MN0cGyNDvEaJ8wiYQm6P2bPxg==} engines: {node: '>=12.17'} @@ -8164,14 +6600,6 @@ packages: bytesish@0.4.4: resolution: {integrity: sha512-i4uu6M4zuMUiyfZN4RU2+i9+peJh//pXhd9x1oSe1LBkZ3LEbCoygu8W0bXTukU1Jme2txKuotpCZRaC3FLxcQ==} - c12@2.0.1: - resolution: {integrity: sha512-Z4JgsKXHG37C6PYUtIxCfLJZvo6FyhHJoClwwb9ftUkLpPSkuYqn6Tr+vnaN8hymm0kIbcg6Ey3kv/Q71k5w/A==} - peerDependencies: - magicast: ^0.3.5 - peerDependenciesMeta: - magicast: - optional: true - cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -8180,10 +6608,6 @@ packages: resolution: {integrity: sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ==} engines: {node: ^16.14.0 || >=18.0.0} - cacheable-lookup@5.0.4: - resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} - engines: {node: '>=10.6.0'} - cacheable-lookup@7.0.0: resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} engines: {node: '>=14.16'} @@ -8192,10 +6616,6 @@ packages: resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} engines: {node: '>=14.16'} - cacheable-request@7.0.4: - resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==} - engines: {node: '>=8'} - cached-path-relative@1.1.0: resolution: {integrity: sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==} @@ -8258,10 +6678,6 @@ packages: capsolver-npm@2.0.2: resolution: {integrity: sha512-PvkAGTuwtKXczJeoiLu2XQ4SzJh0m7Yr3ONJuvdjEAw95LwtfGxZ3Ip/w21kR94R4O260omLGlTcQvPf2ECnLg==} - cardinal@2.1.1: - resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} - hasBin: true - caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -8376,18 +6792,9 @@ packages: resolution: {integrity: sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==} engines: {node: '>= 0.10'} - citty@0.1.6: - resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} - - cive@0.7.1: - resolution: {integrity: sha512-DcBpLydad5MMeUjLHRYWXK3oX+bnVqeZDR5NL1dcLsUMUxRTFLndgS29m/oafFQQ95ZOkvtif/kDzhpWG0e5Xw==} - cjs-module-lexer@1.4.1: resolution: {integrity: sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==} - class-transformer@0.5.1: - resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} - class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} @@ -8441,13 +6848,6 @@ packages: client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} - clipboardy@4.0.0: - resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==} - engines: {node: '>=18'} - - cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} - cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} @@ -8463,9 +6863,6 @@ packages: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} - clone-response@1.0.3: - resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} - clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} @@ -8495,9 +6892,6 @@ packages: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - coinbase-api@1.0.5: - resolution: {integrity: sha512-5Rq6hYKnJNc9v4diD8M6PStSc2hwMgfOlB+pb1LSyh5q2xg9ZKi3Gu8ZVxaDnKXmgQgrjI4xJLMpc3fiLgzsew==} - collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -8582,10 +6976,6 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} - comment-parser@1.4.1: - resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} - engines: {node: '>= 12.0.0'} - common-ancestor-path@1.0.1: resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} @@ -8598,9 +6988,6 @@ packages: compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} - compare-versions@4.1.4: - resolution: {integrity: sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==} - complex.js@2.4.2: resolution: {integrity: sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==} @@ -8627,11 +7014,6 @@ packages: resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==} engines: {'0': node >= 6.0} - concurrently@6.5.1: - resolution: {integrity: sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==} - engines: {node: '>=10.0.0'} - hasBin: true - concurrently@9.1.0: resolution: {integrity: sha512-VxkzwMAn4LP7WyMnJNbHN5mKV9L2IbyDjpzemKr99sXNR3GqRNMMHdm7prV1ws9wg7ETj6WUkNOigZVsptwbgg==} engines: {node: '>=18'} @@ -8651,9 +7033,6 @@ packages: resolution: {integrity: sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==} engines: {node: '>=0.8'} - consola@2.15.3: - resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} - consola@3.2.3: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} @@ -8664,10 +7043,6 @@ packages: console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - console.table@0.10.0: - resolution: {integrity: sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==} - engines: {node: '> 0.10'} - consolidated-events@2.0.2: resolution: {integrity: sha512-2/uRVMdRypf5z/TW/ncD/66l75P5hH2vM/GR8Jf8HLc2xnfJtmina6F6du8+v4Z2vTrMo7jC+W1tmEEuuELgkQ==} @@ -8740,9 +7115,6 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - cookie-es@1.2.2: - resolution: {integrity: sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==} - cookie-signature@1.0.6: resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} @@ -8845,24 +7217,14 @@ packages: cross-fetch@3.1.8: resolution: {integrity: sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==} - cross-fetch@4.0.0: - resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} - crossws@0.3.1: - resolution: {integrity: sha512-HsZgeVYaG+b5zA+9PbIPGq4+J/CJynJuearykPsXx4V/eMhyQ5EDVg3Ak2FBZtVXCiOLu/U7IiwDHTr9MA+IKw==} - crypto-browserify@3.12.1: resolution: {integrity: sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ==} engines: {node: '>= 0.10'} - crypto-hash@1.3.0: - resolution: {integrity: sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==} - engines: {node: '>=8'} - crypto-random-string@4.0.0: resolution: {integrity: sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==} engines: {node: '>=12'} @@ -8969,36 +7331,18 @@ packages: peerDependencies: postcss: ^8.4.31 - cssnano-preset-default@7.0.6: - resolution: {integrity: sha512-ZzrgYupYxEvdGGuqL+JKOY70s7+saoNlHSCK/OGn1vB2pQK8KSET8jvenzItcY+kA7NoWvfbb/YhlzuzNKjOhQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - cssnano-utils@4.0.2: resolution: {integrity: sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - cssnano-utils@5.0.0: - resolution: {integrity: sha512-Uij0Xdxc24L6SirFr25MlwC2rCFX6scyUmuKpzI+JQ7cyqDEwD42fJ0xfB3yLfOnRDU5LKGgjQ9FA6LYh76GWQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - cssnano@6.1.2: resolution: {integrity: sha512-rYk5UeX7VAM/u0lNqewCdasdtPK81CgX8wJFLEIXHbV2oldWRgJAsZrdhRXkV1NJzA2g850KiFm9mMU2HxNxMA==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - cssnano@7.0.6: - resolution: {integrity: sha512-54woqx8SCbp8HwvNZYn68ZFAepuouZW4lTwiMVnBErM3VkO7/Sd4oTOt3Zz3bPx3kxQ36aISppyXj2Md4lg8bw==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - csso@5.0.5: resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} @@ -9208,10 +7552,6 @@ packages: resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} engines: {node: '>=18'} - date-fns@2.30.0: - resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} - engines: {node: '>=0.11'} - dateformat@3.0.3: resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} @@ -9287,19 +7627,12 @@ packages: resolution: {integrity: sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==} engines: {node: '>=10'} - decimal.js-light@2.5.1: - resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==} - decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} decode-named-character-reference@1.0.2: resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} - decode-uri-component@0.2.2: - resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} - engines: {node: '>=0.10'} - decompress-response@4.2.1: resolution: {integrity: sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==} engines: {node: '>=8'} @@ -9357,9 +7690,6 @@ packages: defined@1.0.1: resolution: {integrity: sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==} - defu@6.1.4: - resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} - degenerator@5.0.1: resolution: {integrity: sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==} engines: {node: '>= 14'} @@ -9382,9 +7712,6 @@ packages: delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - delimit-stream@0.1.0: - resolution: {integrity: sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ==} - depd@1.1.2: resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} engines: {node: '>= 0.6'} @@ -9393,10 +7720,6 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} - dependency-graph@0.11.0: - resolution: {integrity: sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==} - engines: {node: '>= 0.6.0'} - deprecation@2.3.1: resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} @@ -9411,25 +7734,14 @@ packages: des.js@1.1.0: resolution: {integrity: sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==} - destr@2.0.3: - resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} - destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - detect-browser@5.3.0: - resolution: {integrity: sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==} - detect-indent@5.0.0: resolution: {integrity: sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==} engines: {node: '>=4'} - detect-libc@1.0.3: - resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} - engines: {node: '>=0.10'} - hasBin: true - detect-libc@2.0.3: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} @@ -9465,10 +7777,6 @@ packages: devtools-protocol@0.0.1107588: resolution: {integrity: sha512-yIR+pG9x65Xko7bErCUSQaDLrO/P1p3JUzEk7JCU4DowPcGHkTGUGQapcfcLc4qj0UaALwZ+cr0riFgiqpixcg==} - didyoumean2@7.0.4: - resolution: {integrity: sha512-+yW4SNY7W2DOWe2Jx5H4c2qMTFbLGM6wIyoDPkAPy66X+sD1KfYjBPAIWPVsYqMxelflaMQCloZDudELIPhLqA==} - engines: {node: ^18.12.0 || >=20.9.0} - didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -9486,9 +7794,6 @@ packages: diffie-hellman@5.0.3: resolution: {integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==} - dijkstrajs@1.0.3: - resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} - dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -9517,10 +7822,6 @@ packages: resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} engines: {node: '>=6'} - doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - docusaurus-lunr-search@3.5.0: resolution: {integrity: sha512-k3zN4jYMi/prWInJILGKOxE+BVcgYinwj9+gcECsYm52tS+4ZKzXQzbPnVJAEXmvKOfFMcDFvS3MSmm6cEaxIQ==} engines: {node: '>= 8.10.0'} @@ -9599,15 +7900,9 @@ packages: duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} - duplexify@4.1.3: - resolution: {integrity: sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==} - eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - easy-table@1.1.0: - resolution: {integrity: sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==} - ecc-jsbn@0.1.2: resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} @@ -9649,12 +7944,6 @@ packages: electron-to-chromium@1.5.73: resolution: {integrity: sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==} - elliptic@6.5.4: - resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} - - elliptic@6.6.0: - resolution: {integrity: sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA==} - elliptic@6.6.1: resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} @@ -9684,9 +7973,6 @@ packages: emoticon@4.1.0: resolution: {integrity: sha512-VWZfnxqwNcc51hIy/sbOdEem6D+cVtpPzEEtVAFdaas30+1dgkyaOQ4sQ6Bp0tOMqWO1v+HQfYaoodOkdhK6SQ==} - encode-utf8@1.0.3: - resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} - encodeurl@1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} @@ -9791,11 +8077,6 @@ packages: peerDependencies: esbuild: '*' - esbuild@0.19.12: - resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} - engines: {node: '>=12'} - hasBin: true - esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -9847,12 +8128,6 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-plugin-jsdoc@46.10.1: - resolution: {integrity: sha512-x8wxIpv00Y50NyweDUpa+58ffgSAI5sqe+zcZh33xphD0AVh+1kqr1ombaTRb7Fhpove1zfUuujlX9DWWBP5ag==} - engines: {node: '>=16'} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 - eslint-plugin-prettier@5.2.1: resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -9895,10 +8170,6 @@ packages: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-scope@8.2.0: resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -9911,12 +8182,6 @@ packages: resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@8.57.1: - resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. - hasBin: true - eslint@9.13.0: resolution: {integrity: sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -9954,10 +8219,6 @@ packages: resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} @@ -10156,10 +8417,6 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-redact@3.5.0: - resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} - engines: {node: '>=6'} - fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} @@ -10176,10 +8433,6 @@ packages: fastembed@1.14.1: resolution: {integrity: sha512-Y14v+FWZwjNUpQ7mRGYu4N5yF+hZkF7zqzPWzzLbwdIEtYsHy0DSpiVJ+Fg6Oi1fQjrBKASQt0hdSMSjw1/Wtw==} - fastest-levenshtein@1.0.16: - resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} - engines: {node: '>= 4.9.1'} - fastestsmallesttextencoderdecoder@1.0.22: resolution: {integrity: sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==} @@ -10218,9 +8471,6 @@ packages: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} - fetch-cookie@3.0.1: - resolution: {integrity: sha512-ZGXe8Y5Z/1FWqQ9q/CrJhkUD73DyBU9VF0hBQmEO/wPHe4A9PKTjplFDLeFX8aOsYypZUcX5Ji/eByn3VCVO3Q==} - ffmpeg-static@5.2.0: resolution: {integrity: sha512-WrM7kLW+do9HLr+H6tk7LzQ7kPqbAgLjdzNE32+u3Ff11gXt9Kkkd2nusGFrlWMIe+XaA97t+I8JS7sZIrvRgA==} engines: {node: '>=16'} @@ -10229,10 +8479,6 @@ packages: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -10265,10 +8511,6 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} - filter-obj@1.1.0: - resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} - engines: {node: '>=0.10.0'} - finalhandler@1.3.1: resolution: {integrity: sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==} engines: {node: '>= 0.8'} @@ -10301,10 +8543,6 @@ packages: resolution: {integrity: sha512-2kCCtc+JvcZ86IGAz3Z2Y0A1baIz9fL31pH/0S1IqZr9Iwnjq8izfPtrCyQKO6TLMPELLsQMre7VDqeIKCsHkA==} engines: {node: '>=18'} - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} - flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -10416,10 +8654,6 @@ packages: fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} - fs-extra@10.1.0: - resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} - engines: {node: '>=12'} - fs-extra@11.2.0: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} engines: {node: '>=14.14'} @@ -10521,17 +8755,10 @@ packages: engines: {node: '>=6.9.0'} hasBin: true - get-port-please@3.1.2: - resolution: {integrity: sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==} - get-port@5.1.1: resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==} engines: {node: '>=8'} - get-stdin@9.0.0: - resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==} - engines: {node: '>=12'} - get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -10562,10 +8789,6 @@ packages: gif-frames@0.4.1: resolution: {integrity: sha512-BSqFuIz4qeZsX7wKDlwyF6qkGyUAgoYNRFJs7v8P97qvBz1FmzyRFHA/EWi/81OMHb0xQdps1X8BYrTyI3e3Aw==} - giget@1.2.3: - resolution: {integrity: sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==} - hasBin: true - git-node-fs@1.0.0: resolution: {integrity: sha512-bLQypt14llVXBg0S0u8q8HmU7g9p3ysH+NvVlae5vILuUvs759665HvmR5+wb04KjHyjFcDRxdYb4kyNnluMUQ==} peerDependencies: @@ -10664,10 +8887,6 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} - globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -10692,25 +8911,14 @@ packages: resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - google-auth-library@9.15.0: resolution: {integrity: sha512-7ccSEJFDFO7exFbO6NRyC+xH8/mZ1GZGG2xxx9iHxZWcjUjJpjWxIMw3cofAKcueZ6DATiukmmprD7yavQHOyQ==} engines: {node: '>=14'} - google-protobuf@3.21.4: - resolution: {integrity: sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==} - gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} - got@11.8.6: - resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} - engines: {node: '>=10.19.0'} - got@12.6.1: resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} engines: {node: '>=14.16'} @@ -10743,9 +8951,6 @@ packages: resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} engines: {node: '>=10'} - h3@1.13.0: - resolution: {integrity: sha512-vFEAu/yf8UMUcB4s43OaDaigcqpQd14yanmOsn+NcRX3/guSKncyE2rOYhq8RIchgJrPSs/QiIddnTTR1ddiAg==} - hachure-fill@0.5.2: resolution: {integrity: sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==} @@ -10876,9 +9081,6 @@ packages: headers-polyfill@3.3.0: resolution: {integrity: sha512-5e57etwBpNcDc0b6KCVWEh/Ro063OxPvzVimUdM0/tsYM/T7Hfy3kknIGj78SFTOhNd8AZY41U8mOHoO4LzmIQ==} - hey-listen@1.0.8: - resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} - history@4.10.1: resolution: {integrity: sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==} @@ -10892,9 +9094,6 @@ packages: hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} - hookable@5.5.3: - resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} - hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -11010,18 +9209,10 @@ packages: http-response-object@3.0.2: resolution: {integrity: sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==} - http-shutdown@1.2.2: - resolution: {integrity: sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - http-signature@1.2.0: resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} engines: {node: '>=0.8', npm: '>=1.3.7'} - http2-wrapper@1.0.3: - resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} - engines: {node: '>=10.19.0'} - http2-wrapper@2.2.1: resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} engines: {node: '>=10.19.0'} @@ -11071,9 +9262,6 @@ packages: peerDependencies: postcss: ^8.1.0 - idb-keyval@6.2.1: - resolution: {integrity: sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==} - ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} @@ -11218,9 +9406,6 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - iron-webcrypto@1.2.1: - resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} - is-alphabetical@2.0.1: resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} @@ -11248,10 +9433,6 @@ packages: resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} engines: {node: '>=4'} - is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} @@ -11272,11 +9453,6 @@ packages: engines: {node: '>=8'} hasBin: true - is-docker@3.0.0: - resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - hasBin: true - is-extendable@0.1.1: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} engines: {node: '>=0.10.0'} @@ -11312,11 +9488,6 @@ packages: is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} - is-inside-container@1.0.0: - resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} - engines: {node: '>=14.16'} - hasBin: true - is-installed-globally@0.4.0: resolution: {integrity: sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==} engines: {node: '>=10'} @@ -11466,18 +9637,10 @@ packages: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} - is-wsl@3.1.0: - resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} - engines: {node: '>=16'} - is-yarn-global@0.4.1: resolution: {integrity: sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==} engines: {node: '>=12'} - is64bit@2.0.0: - resolution: {integrity: sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==} - engines: {node: '>=18'} - isarray@0.0.1: resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} @@ -11494,17 +9657,10 @@ packages: resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} engines: {node: '>=16'} - iso-url@0.4.7: - resolution: {integrity: sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==} - engines: {node: '>=10'} - isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} - isomorphic-fetch@3.0.0: - resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} - isomorphic-unfetch@3.1.0: resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==} @@ -11513,11 +9669,6 @@ packages: peerDependencies: ws: '*' - isomorphic-ws@5.0.0: - resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} - peerDependencies: - ws: '*' - isows@1.0.6: resolution: {integrity: sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==} peerDependencies: @@ -11554,10 +9705,6 @@ packages: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} - iterare@1.2.1: - resolution: {integrity: sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==} - engines: {node: '>=6'} - jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} @@ -11732,9 +9879,6 @@ packages: jpeg-js@0.3.7: resolution: {integrity: sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ==} - js-base64@3.7.7: - resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==} - js-git@0.7.8: resolution: {integrity: sha512-+E5ZH/HeRnoc/LW0AmAyhU+mNcWBzAKE+30+IDMLSLbbK+Tdt02AdkOKq9u15rlJsDEGFqtgckc8ZM59LhhiUA==} @@ -11764,19 +9908,12 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsbi@3.2.5: - resolution: {integrity: sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ==} - jsbn@0.1.1: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} - jsdoc-type-pratt-parser@4.0.0: - resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} - engines: {node: '>=12.0.0'} - jsdom@25.0.1: resolution: {integrity: sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==} engines: {node: '>=18'} @@ -11834,9 +9971,6 @@ packages: json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} - json-text-sequence@0.1.1: - resolution: {integrity: sha512-L3mEegEWHRekSHjc7+sc8eJhba9Clq1PZ8kMkzf8OxElhXc8O4TS5MwcVlj9aEbm5dr81N90WHC5nAz3UO971w==} - json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -11864,10 +9998,6 @@ packages: resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} engines: {node: '>=0.10.0'} - jsonwebtoken@9.0.2: - resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} - engines: {node: '>=12', npm: '>=6'} - jsprim@1.4.2: resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} engines: {node: '>=0.6.0'} @@ -11878,22 +10008,12 @@ packages: just-diff@6.0.2: resolution: {integrity: sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==} - jwa@1.4.1: - resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==} - jwa@2.0.0: resolution: {integrity: sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==} - jws@3.2.2: - resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} - jws@4.0.0: resolution: {integrity: sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==} - jwt-decode@4.0.0: - resolution: {integrity: sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==} - engines: {node: '>=18'} - katex@0.16.15: resolution: {integrity: sha512-yE9YJIEAk2aZ+FL/G8r+UGw0CTUzEA8ZFy6E+8tc3spHUKq3qBnzCkI1CQwGoI9atJhVyFPEypQsTY7mJ1Pi9w==} hasBin: true @@ -11905,9 +10025,6 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - keyvaluestorage-interface@1.0.0: - resolution: {integrity: sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==} - khroma@2.1.0: resolution: {integrity: sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==} @@ -12075,23 +10192,10 @@ packages: engines: {node: '>=18.12.0'} hasBin: true - listhen@1.9.0: - resolution: {integrity: sha512-I8oW2+QL5KJo8zXNWX046M134WchxsXC7SawLPvRQpogCbkyQIaFxPE89A2HiwR7vAK2Dm2ERBAmyjTYGYEpBg==} - hasBin: true - listr2@8.2.5: resolution: {integrity: sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==} engines: {node: '>=18.0.0'} - lit-element@3.3.3: - resolution: {integrity: sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==} - - lit-html@2.8.0: - resolution: {integrity: sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==} - - lit@2.8.0: - resolution: {integrity: sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==} - load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} @@ -12152,36 +10256,15 @@ packages: lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} - lodash.deburr@4.1.0: - resolution: {integrity: sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ==} - - lodash.includes@4.3.0: - resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} - - lodash.isboolean@3.0.3: - resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} - - lodash.isequal@4.5.0: - resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} - lodash.isfunction@3.0.9: resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} - lodash.isinteger@4.0.4: - resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} - lodash.ismatch@4.4.0: resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} - lodash.isnumber@3.0.3: - resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==} - lodash.isplainobject@4.0.6: resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} - lodash.isstring@4.0.1: - resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} - lodash.kebabcase@4.1.1: resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} @@ -12197,9 +10280,6 @@ packages: lodash.mergewith@4.6.2: resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} - lodash.once@4.1.1: - resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} - lodash.snakecase@4.1.1: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} @@ -12244,9 +10324,6 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - lossless-json@4.0.2: - resolution: {integrity: sha512-+z0EaLi2UcWi8MZRxA5iTb6m4Ys4E80uftGY+yG5KNFJb5EceQXOhdW/pWJZ8m97s26u7yZZAYMcKWNztSZssA==} - loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} @@ -12257,10 +10334,6 @@ packages: lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} - lowercase-keys@2.0.0: - resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} - engines: {node: '>=8'} - lowercase-keys@3.0.0: resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -12370,9 +10443,6 @@ packages: engines: {node: '>= 12'} hasBin: true - md4w@0.2.6: - resolution: {integrity: sha512-CBLQ2PxVe9WA+/nndZCx/Y+1C3DtmtSeubmXTPhMIgsXtq9gVGleikREko5FYnV6Dz4cHDWm0Ea+YMLpIjP4Kw==} - md5.js@1.3.5: resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} @@ -12430,9 +10500,6 @@ packages: mdast-util-to-string@4.0.0: resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} - mdbox@0.1.1: - resolution: {integrity: sha512-jvLISenzbLRPWWamTG3THlhTcMbKWzJQNyTi61AVXhCBOC+gsldNTUfUNH8d3Vay83zGehFw3wZpF3xChzkTIQ==} - mdn-data@2.0.28: resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} @@ -12649,11 +10716,6 @@ packages: engines: {node: '>=4'} hasBin: true - mime@3.0.0: - resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} - engines: {node: '>=10.0.0'} - hasBin: true - mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -12666,10 +10728,6 @@ packages: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} - mimic-response@1.0.1: - resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} - engines: {node: '>=4'} - mimic-response@2.1.0: resolution: {integrity: sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==} engines: {node: '>=8'} @@ -12803,21 +10861,6 @@ packages: engines: {node: '>=10'} hasBin: true - mkdist@1.6.0: - resolution: {integrity: sha512-nD7J/mx33Lwm4Q4qoPgRBVA9JQNKgyE7fLo5vdPWVDdjz96pXglGERp/fRnGPCTB37Kykfxs5bDdXa9BWOT9nw==} - hasBin: true - peerDependencies: - sass: ^1.78.0 - typescript: '>=5.5.4' - vue-tsc: ^1.8.27 || ^2.0.21 - peerDependenciesMeta: - sass: - optional: true - typescript: - optional: true - vue-tsc: - optional: true - mlly@1.7.3: resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} @@ -12833,16 +10876,6 @@ packages: module-details-from-path@1.0.3: resolution: {integrity: sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==} - moment@2.30.1: - resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} - - motion@10.16.2: - resolution: {integrity: sha512-p+PurYqfUdcJZvtnmAqu5fJgV2kR0uLFQuBKtLeFVTrYEVllI99tiOTSefVNYuip9ELTEkepIIDftNdze76NAQ==} - - mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} - mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} @@ -12871,9 +10904,6 @@ packages: resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} hasBin: true - multiformats@9.9.0: - resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} - multimatch@5.0.0: resolution: {integrity: sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==} engines: {node: '>=10'} @@ -12958,9 +10988,6 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - net@1.0.2: - resolution: {integrity: sha512-kbhcj2SVVR4caaVnGLJKmlk2+f+oLkjqdKeQlmUtz6nGzOpbcobwVIeSURNgraV/v3tlmGIX82OcPCl0K6RbHQ==} - netmask@2.0.2: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} @@ -12984,9 +11011,6 @@ packages: node-addon-api@6.1.0: resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} - node-addon-api@7.1.1: - resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} - node-addon-api@8.3.0: resolution: {integrity: sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==} engines: {node: ^18 || ^20 || >= 21} @@ -13010,9 +11034,6 @@ packages: resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} engines: {node: '>=18'} - node-fetch-native@1.6.4: - resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} - node-fetch@2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} engines: {node: 4.x || >=6.0.0} @@ -13112,10 +11133,6 @@ packages: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} engines: {node: '>=0.10.0'} - normalize-url@6.1.0: - resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} - engines: {node: '>=10'} - normalize-url@8.0.1: resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} engines: {node: '>=14.16'} @@ -13199,11 +11216,6 @@ packages: '@swc/core': optional: true - nypm@0.3.12: - resolution: {integrity: sha512-D3pzNDWIvgA+7IORhD/IuWzEk4uXv6GsgOxiid4UU3h9oq5IqV1KtPDi63n4sZJ/xcWlr88c0QM2RgN5VbOhFA==} - engines: {node: ^14.16.0 || >=16.10.0} - hasBin: true - o3@1.0.3: resolution: {integrity: sha512-f+4n+vC6s4ysy7YO7O2gslWZBUu8Qj2i2OUJOvjRxQva7jVjYjB29jrr9NCjmxZQR0gzrOcv1RnqoYOeMs5VRQ==} @@ -13237,12 +11249,6 @@ packages: resolution: {integrity: sha512-wbqF4uc1YbcldtiBFfkSnquHtECEIpYD78YUXI6ri1Im5OO2NLo6ZVpRdbJpdnpZ05zMrVPssNiEo6JQtea+Qg==} engines: {node: '>= 18'} - ofetch@1.4.1: - resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==} - - ohash@1.1.4: - resolution: {integrity: sha512-FlDryZAahJmEF3VR3w1KogSEdWX3WhA5GPakFx4J81kEAiHyLMpdLLElS8n8dfNadMgAne/MywcvmogzscVt4g==} - ollama-ai-provider@0.16.1: resolution: {integrity: sha512-0vSQVz5Y/LguyzfO4bi1JrrVGF/k2JvO8/uFR0wYmqDFp8KPp4+AhdENSynGBr1oRhMWOM4F1l6cv7UNDgRMjw==} engines: {node: '>=18'} @@ -13255,9 +11261,6 @@ packages: omggif@1.0.10: resolution: {integrity: sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==} - on-exit-leak-free@0.2.0: - resolution: {integrity: sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==} - on-finished@2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} @@ -13361,10 +11364,6 @@ packages: typescript: optional: true - p-cancelable@2.1.1: - resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} - engines: {node: '>=8'} - p-cancelable@3.0.0: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} @@ -13437,10 +11436,6 @@ packages: resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} engines: {node: '>=8'} - p-timeout@4.1.0: - resolution: {integrity: sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==} - engines: {node: '>=10'} - p-try@1.0.0: resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} engines: {node: '>=4'} @@ -13633,10 +11628,6 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - path2d@0.2.2: resolution: {integrity: sha512-+vnG6S4dYcYxZd+CZxzXCNKdELYZSKfohrk98yajCo1PtRoDgCTrrwOvK1GT0UoAdVszagDVllQc0U1vaX4NUQ==} engines: {node: '>=6'} @@ -13662,9 +11653,6 @@ packages: pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} - perfect-debounce@1.0.0: - resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} @@ -13750,16 +11738,6 @@ packages: resolution: {integrity: sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==} engines: {node: '>=10'} - pino-abstract-transport@0.5.0: - resolution: {integrity: sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==} - - pino-std-serializers@4.0.0: - resolution: {integrity: sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==} - - pino@7.11.0: - resolution: {integrity: sha512-dMACeu63HtRLmCG8VKdy4cShCPKaYDR4youZqoSWLxl5Gu99HUw8bw75thbPv9Nip+H+QYX8o3ZJbTdVZZ2TVg==} - hasBin: true - pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} @@ -13823,10 +11801,6 @@ packages: resolution: {integrity: sha512-ITNPqvx+SSssNFOgHQzGG87HrqQ0g2nMSHc1jjU5Piq9xJEJ40fiFEPz0S5HSSXxBHrTnhaBHIayTO5aRfk2vw==} engines: {iojs: '>= 1.0.0', node: '>=0.10.0'} - pngjs@5.0.0: - resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} - engines: {node: '>=10.13.0'} - pnpm@9.14.4: resolution: {integrity: sha512-yBgLP75OS8oCyUI0cXiWtVKXQKbLrfGfp4JUJwQD6i8n1OHUagig9WyJtj3I6/0+5TMm2nICc3lOYgD88NGEqw==} engines: {node: '>=18.12'} @@ -13838,9 +11812,6 @@ packages: points-on-path@0.2.1: resolution: {integrity: sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==} - poseidon-lite@0.2.1: - resolution: {integrity: sha512-xIr+G6HeYfOhCuswdqcFpSX47SPhm0EpisWJ6h7fHlWwaVIvH3dLnejpatrtw6Xc6HaLrpq05y7VRfvDmDGIog==} - possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -13851,12 +11822,6 @@ packages: peerDependencies: postcss: ^8.4 - postcss-calc@10.0.2: - resolution: {integrity: sha512-DT/Wwm6fCKgpYVI7ZEWuPJ4az8hiEHtCUeYjZXqU7Ou4QqYh1Df2yCQ7Ca6N7xqKPFkxN3fhf+u9KSoOCJNAjg==} - engines: {node: ^18.12 || ^20.9 || >=22.0} - peerDependencies: - postcss: ^8.4.38 - postcss-calc@9.0.1: resolution: {integrity: sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==} engines: {node: ^14 || ^16 || >=18.0} @@ -13869,13 +11834,6 @@ packages: peerDependencies: postcss: ^8.4.6 - postcss-cli@11.0.0: - resolution: {integrity: sha512-xMITAI7M0u1yolVcXJ9XTZiO9aO49mcoKQy6pCDFdMh9kGqhzLVpWxeD/32M/QBmkhcGypZFFOLNLmIW4Pg4RA==} - engines: {node: '>=18'} - hasBin: true - peerDependencies: - postcss: ^8.0.0 - postcss-color-functional-notation@7.0.6: resolution: {integrity: sha512-wLXvm8RmLs14Z2nVpB4CWlnvaWPRcOZFltJSlcbYwSJ1EDZKsKDhPKIMecCnuU054KSmlmubkqczmm6qBPCBhA==} engines: {node: '>=18'} @@ -13900,24 +11858,12 @@ packages: peerDependencies: postcss: ^8.4.31 - postcss-colormin@7.0.2: - resolution: {integrity: sha512-YntRXNngcvEvDbEjTdRWGU606eZvB5prmHG4BF0yLmVpamXbpsRJzevyy6MZVyuecgzI2AWAlvFi8DAeCqwpvA==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-convert-values@6.1.0: resolution: {integrity: sha512-zx8IwP/ts9WvUM6NkVSkiU902QZL1bwPhaVaLynPtCsOTqp+ZKbNi+s6XJg3rfqpKGA/oc7Oxk5t8pOQJcwl/w==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-convert-values@7.0.4: - resolution: {integrity: sha512-e2LSXPqEHVW6aoGbjV9RsSSNDO3A0rZLCBxN24zvxF25WknMPpX8Dm9UxxThyEbaytzggRuZxaGXqaOhxQ514Q==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-custom-media@11.0.5: resolution: {integrity: sha512-SQHhayVNgDvSAdX9NQ/ygcDQGEY+aSF4b/96z7QUX6mqL5yl/JgG/DywcF6fW9XbnCRE+aVYk+9/nqGuzOPWeQ==} engines: {node: '>=18'} @@ -13948,48 +11894,24 @@ packages: peerDependencies: postcss: ^8.4.31 - postcss-discard-comments@7.0.3: - resolution: {integrity: sha512-q6fjd4WU4afNhWOA2WltHgCbkRhZPgQe7cXF74fuVB/ge4QbM9HEaOIzGSiMvM+g/cOsNAUGdf2JDzqA2F8iLA==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-discard-duplicates@6.0.3: resolution: {integrity: sha512-+JA0DCvc5XvFAxwx6f/e68gQu/7Z9ud584VLmcgto28eB8FqSFZwtrLwB5Kcp70eIoWP/HXqz4wpo8rD8gpsTw==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-discard-duplicates@7.0.1: - resolution: {integrity: sha512-oZA+v8Jkpu1ct/xbbrntHRsfLGuzoP+cpt0nJe5ED2FQF8n8bJtn7Bo28jSmBYwqgqnqkuSXJfSUEE7if4nClQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-discard-empty@6.0.3: resolution: {integrity: sha512-znyno9cHKQsK6PtxL5D19Fj9uwSzC2mB74cpT66fhgOadEUPyXFkbgwm5tvc3bt3NAy8ltE5MrghxovZRVnOjQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-discard-empty@7.0.0: - resolution: {integrity: sha512-e+QzoReTZ8IAwhnSdp/++7gBZ/F+nBq9y6PomfwORfP7q9nBpK5AMP64kOt0bA+lShBFbBDcgpJ3X4etHg4lzA==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-discard-overridden@6.0.2: resolution: {integrity: sha512-j87xzI4LUggC5zND7KdjsI25APtyMuynXZSujByMaav2roV6OZX+8AaCUcZSWqckZpjAjRyFDdpqybgjFO0HJQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-discard-overridden@7.0.0: - resolution: {integrity: sha512-GmNAzx88u3k2+sBTZrJSDauR0ccpE24omTQCVmaTTZFz1du6AasspjaUPMJ2ud4RslZpoFKyf+6MSPETLojc6w==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-discard-unused@6.0.5: resolution: {integrity: sha512-wHalBlRHkaNnNwfC8z+ppX57VhvS+HWgjW508esjdaEYr3Mx7Gnn2xA4R/CKf5+Z9S5qsqC+Uzh4ueENWwCVUA==} engines: {node: ^14 || ^16 || >=18.0} @@ -14061,21 +11983,6 @@ packages: ts-node: optional: true - postcss-load-config@5.1.0: - resolution: {integrity: sha512-G5AJ+IX0aD0dygOE0yFZQ/huFFMSNneyfp0e3/bT05a8OfPC5FUoZRPfGijUdGOJNMewJiwzcHJXFafFzeKFVA==} - engines: {node: '>= 18'} - peerDependencies: - jiti: '>=1.21.0' - postcss: '>=8.0.9' - tsx: ^4.8.1 - peerDependenciesMeta: - jiti: - optional: true - postcss: - optional: true - tsx: - optional: true - postcss-load-config@6.0.1: resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} engines: {node: '>= 18'} @@ -14119,72 +12026,36 @@ packages: peerDependencies: postcss: ^8.4.31 - postcss-merge-longhand@7.0.4: - resolution: {integrity: sha512-zer1KoZA54Q8RVHKOY5vMke0cCdNxMP3KBfDerjH/BYHh4nCIh+1Yy0t1pAEQF18ac/4z3OFclO+ZVH8azjR4A==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-merge-rules@6.1.1: resolution: {integrity: sha512-KOdWF0gju31AQPZiD+2Ar9Qjowz1LTChSjFFbS+e2sFgc4uHOp3ZvVX4sNeTlk0w2O31ecFGgrFzhO0RSWbWwQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-merge-rules@7.0.4: - resolution: {integrity: sha512-ZsaamiMVu7uBYsIdGtKJ64PkcQt6Pcpep/uO90EpLS3dxJi6OXamIobTYcImyXGoW0Wpugh7DSD3XzxZS9JCPg==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-minify-font-values@6.1.0: resolution: {integrity: sha512-gklfI/n+9rTh8nYaSJXlCo3nOKqMNkxuGpTn/Qm0gstL3ywTr9/WRKznE+oy6fvfolH6dF+QM4nCo8yPLdvGJg==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-minify-font-values@7.0.0: - resolution: {integrity: sha512-2ckkZtgT0zG8SMc5aoNwtm5234eUx1GGFJKf2b1bSp8UflqaeFzR50lid4PfqVI9NtGqJ2J4Y7fwvnP/u1cQog==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-minify-gradients@6.0.3: resolution: {integrity: sha512-4KXAHrYlzF0Rr7uc4VrfwDJ2ajrtNEpNEuLxFgwkhFZ56/7gaE4Nr49nLsQDZyUe+ds+kEhf+YAUolJiYXF8+Q==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-minify-gradients@7.0.0: - resolution: {integrity: sha512-pdUIIdj/C93ryCHew0UgBnL2DtUS3hfFa5XtERrs4x+hmpMYGhbzo6l/Ir5de41O0GaKVpK1ZbDNXSY6GkXvtg==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-minify-params@6.1.0: resolution: {integrity: sha512-bmSKnDtyyE8ujHQK0RQJDIKhQ20Jq1LYiez54WiaOoBtcSuflfK3Nm596LvbtlFcpipMjgClQGyGr7GAs+H1uA==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-minify-params@7.0.2: - resolution: {integrity: sha512-nyqVLu4MFl9df32zTsdcLqCFfE/z2+f8GE1KHPxWOAmegSo6lpV2GNy5XQvrzwbLmiU7d+fYay4cwto1oNdAaQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-minify-selectors@6.0.4: resolution: {integrity: sha512-L8dZSwNLgK7pjTto9PzWRoMbnLq5vsZSTu8+j1P/2GB8qdtGQfn+K1uSvFgYvgh83cbyxT5m43ZZhUMTJDSClQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-minify-selectors@7.0.4: - resolution: {integrity: sha512-JG55VADcNb4xFCf75hXkzc1rNeURhlo7ugf6JjiiKRfMsKlDzN9CXHZDyiG6x/zGchpjQS+UAgb1d4nqXqOpmA==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-modules-extract-imports@3.1.0: resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} engines: {node: ^10 || ^12 || >= 14} @@ -14227,108 +12098,54 @@ packages: peerDependencies: postcss: ^8.4.31 - postcss-normalize-charset@7.0.0: - resolution: {integrity: sha512-ABisNUXMeZeDNzCQxPxBCkXexvBrUHV+p7/BXOY+ulxkcjUZO0cp8ekGBwvIh2LbCwnWbyMPNJVtBSdyhM2zYQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-display-values@6.0.2: resolution: {integrity: sha512-8H04Mxsb82ON/aAkPeq8kcBbAtI5Q2a64X/mnRRfPXBq7XeogoQvReqxEfc0B4WPq1KimjezNC8flUtC3Qz6jg==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-display-values@7.0.0: - resolution: {integrity: sha512-lnFZzNPeDf5uGMPYgGOw7v0BfB45+irSRz9gHQStdkkhiM0gTfvWkWB5BMxpn0OqgOQuZG/mRlZyJxp0EImr2Q==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-positions@6.0.2: resolution: {integrity: sha512-/JFzI441OAB9O7VnLA+RtSNZvQ0NCFZDOtp6QPFo1iIyawyXg0YI3CYM9HBy1WvwCRHnPep/BvI1+dGPKoXx/Q==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-positions@7.0.0: - resolution: {integrity: sha512-I0yt8wX529UKIGs2y/9Ybs2CelSvItfmvg/DBIjTnoUSrPxSV7Z0yZ8ShSVtKNaV/wAY+m7bgtyVQLhB00A1NQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-repeat-style@6.0.2: resolution: {integrity: sha512-YdCgsfHkJ2jEXwR4RR3Tm/iOxSfdRt7jplS6XRh9Js9PyCR/aka/FCb6TuHT2U8gQubbm/mPmF6L7FY9d79VwQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-repeat-style@7.0.0: - resolution: {integrity: sha512-o3uSGYH+2q30ieM3ppu9GTjSXIzOrRdCUn8UOMGNw7Af61bmurHTWI87hRybrP6xDHvOe5WlAj3XzN6vEO8jLw==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-string@6.0.2: resolution: {integrity: sha512-vQZIivlxlfqqMp4L9PZsFE4YUkWniziKjQWUtsxUiVsSSPelQydwS8Wwcuw0+83ZjPWNTl02oxlIvXsmmG+CiQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-string@7.0.0: - resolution: {integrity: sha512-w/qzL212DFVOpMy3UGyxrND+Kb0fvCiBBujiaONIihq7VvtC7bswjWgKQU/w4VcRyDD8gpfqUiBQ4DUOwEJ6Qg==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-timing-functions@6.0.2: resolution: {integrity: sha512-a+YrtMox4TBtId/AEwbA03VcJgtyW4dGBizPl7e88cTFULYsprgHWTbfyjSLyHeBcK/Q9JhXkt2ZXiwaVHoMzA==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-timing-functions@7.0.0: - resolution: {integrity: sha512-tNgw3YV0LYoRwg43N3lTe3AEWZ66W7Dh7lVEpJbHoKOuHc1sLrzMLMFjP8SNULHaykzsonUEDbKedv8C+7ej6g==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-unicode@6.1.0: resolution: {integrity: sha512-QVC5TQHsVj33otj8/JD869Ndr5Xcc/+fwRh4HAsFsAeygQQXm+0PySrKbr/8tkDKzW+EVT3QkqZMfFrGiossDg==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-unicode@7.0.2: - resolution: {integrity: sha512-ztisabK5C/+ZWBdYC+Y9JCkp3M9qBv/XFvDtSw0d/XwfT3UaKeW/YTm/MD/QrPNxuecia46vkfEhewjwcYFjkg==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-url@6.0.2: resolution: {integrity: sha512-kVNcWhCeKAzZ8B4pv/DnrU1wNh458zBNp8dh4y5hhxih5RZQ12QWMuQrDgPRw3LRl8mN9vOVfHl7uhvHYMoXsQ==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-url@7.0.0: - resolution: {integrity: sha512-+d7+PpE+jyPX1hDQZYG+NaFD+Nd2ris6r8fPTBAjE8z/U41n/bib3vze8x7rKs5H1uEw5ppe9IojewouHk0klQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-normalize-whitespace@6.0.2: resolution: {integrity: sha512-sXZ2Nj1icbJOKmdjXVT9pnyHQKiSAyuNQHSgRCUgThn2388Y9cGVDR+E9J9iAYbSbLHI+UUwLVl1Wzco/zgv0Q==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-normalize-whitespace@7.0.0: - resolution: {integrity: sha512-37/toN4wwZErqohedXYqWgvcHUGlT8O/m2jVkAfAe9Bd4MzRqlBmXrJRePH0e9Wgnz2X7KymTgTOaaFizQe3AQ==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-opacity-percentage@3.0.0: resolution: {integrity: sha512-K6HGVzyxUxd/VgZdX04DCtdwWJ4NGLG212US4/LA1TLAbHgmAsTWVR86o+gGIbFtnTkfOpb9sCRBx8K7HO66qQ==} engines: {node: '>=18'} @@ -14341,12 +12158,6 @@ packages: peerDependencies: postcss: ^8.4.31 - postcss-ordered-values@7.0.1: - resolution: {integrity: sha512-irWScWRL6nRzYmBOXReIKch75RRhNS86UPUAxXdmW/l0FcAsg0lvAXQCby/1lymxn/o0gVa6Rv/0f03eJOwHxw==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-overflow-shorthand@6.0.0: resolution: {integrity: sha512-BdDl/AbVkDjoTofzDQnwDdm/Ym6oS9KgmO7Gr+LHYjNWJ6ExORe4+3pcLQsLA9gIROMkiGVjjwZNoL/mpXHd5Q==} engines: {node: '>=18'} @@ -14388,35 +12199,17 @@ packages: peerDependencies: postcss: ^8.4.31 - postcss-reduce-initial@7.0.2: - resolution: {integrity: sha512-pOnu9zqQww7dEKf62Nuju6JgsW2V0KRNBHxeKohU+JkHd/GAH5uvoObqFLqkeB2n20mr6yrlWDvo5UBU5GnkfA==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-reduce-transforms@6.0.2: resolution: {integrity: sha512-sB+Ya++3Xj1WaT9+5LOOdirAxP7dJZms3GRcYheSPi1PiTMigsxHAdkrbItHxwYHr4kt1zL7mmcHstgMYT+aiA==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-reduce-transforms@7.0.0: - resolution: {integrity: sha512-pnt1HKKZ07/idH8cpATX/ujMbtOGhUfE+m8gbqwJE05aTaNw8gbo34a2e3if0xc0dlu75sUOiqvwCGY3fzOHew==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-replace-overflow-wrap@4.0.0: resolution: {integrity: sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==} peerDependencies: postcss: ^8.0.3 - postcss-reporter@7.1.0: - resolution: {integrity: sha512-/eoEylGWyy6/DOiMP5lmFRdmDKThqgn7D6hP2dXKJI/0rJSO1ADFNngZfDzxL0YAxFvws+Rtpuji1YIHj4mySA==} - engines: {node: '>=10'} - peerDependencies: - postcss: ^8.1.0 - postcss-selector-not@8.0.1: resolution: {integrity: sha512-kmVy/5PYVb2UOhy0+LqUYAhKj7DUGDpSWa5LZqlkWJaaAV+dxxsOG3+St0yNLu6vsKD7Dmqx+nWQt0iil89+WA==} engines: {node: '>=18'} @@ -14443,24 +12236,12 @@ packages: peerDependencies: postcss: ^8.4.31 - postcss-svgo@7.0.1: - resolution: {integrity: sha512-0WBUlSL4lhD9rA5k1e5D8EN5wCEyZD6HJk0jIvRxl+FDVOMlJ7DePHYWGGVc5QRqrJ3/06FTXM0bxjmJpmTPSA==} - engines: {node: ^18.12.0 || ^20.9.0 || >= 18} - peerDependencies: - postcss: ^8.4.31 - postcss-unique-selectors@6.0.4: resolution: {integrity: sha512-K38OCaIrO8+PzpArzkLKB42dSARtC2tmG6PvD4b1o1Q2E9Os8jzfWFfSy/rixsHwohtsDdFtAWGjFVFUdwYaMg==} engines: {node: ^14 || ^16 || >=18.0} peerDependencies: postcss: ^8.4.31 - postcss-unique-selectors@7.0.3: - resolution: {integrity: sha512-J+58u5Ic5T1QjP/LDV9g3Cx4CNOgB5vz+kM6+OxHHhFACdcDeKhBXjQmB7fnIZM12YSTvsL0Opwco83DmacW2g==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} @@ -14509,9 +12290,6 @@ packages: postgres-range@1.1.4: resolution: {integrity: sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==} - preact@10.25.2: - resolution: {integrity: sha512-GEts1EH3oMnqdOIeXhlbBSddZ9nrINd070WBOiPO2ous1orrKGUM4SMDbwyjSWD1iMS2dBvaDjAa5qUhz3TXqw==} - prebuild-install@7.1.2: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} engines: {node: '>=10'} @@ -14541,10 +12319,6 @@ packages: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - pretty-hrtime@1.0.3: - resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} - engines: {node: '>= 0.8'} - pretty-ms@7.0.1: resolution: {integrity: sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==} engines: {node: '>=10'} @@ -14595,9 +12369,6 @@ packages: process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - process-warning@1.0.0: - resolution: {integrity: sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==} - process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} @@ -14669,13 +12440,6 @@ packages: resolution: {integrity: sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==} engines: {node: '>= 14'} - proxy-agent@6.4.0: - resolution: {integrity: sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==} - engines: {node: '>= 14'} - - proxy-compare@2.5.1: - resolution: {integrity: sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==} - proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} @@ -14691,9 +12455,6 @@ packages: pump@3.0.2: resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==} - pumpdotfun-sdk@1.3.2: - resolution: {integrity: sha512-TkYY+ZztxyPzv1f38evgdam92Po3YATI8s6BzmvxH8FypBpPs3pBKS301z7k3KXc1WWfjGWG79K/BANWaAcvkQ==} - punycode.js@2.3.1: resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} engines: {node: '>=6'} @@ -14755,18 +12516,6 @@ packages: pure-rand@6.1.0: resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} - pvtsutils@1.3.6: - resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==} - - pvutils@1.1.3: - resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} - engines: {node: '>=6.0.0'} - - qrcode@1.5.3: - resolution: {integrity: sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==} - engines: {node: '>=10.13.0'} - hasBin: true - qs@6.13.0: resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} engines: {node: '>=0.6'} @@ -14775,10 +12524,6 @@ packages: resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} engines: {node: '>=0.6'} - query-string@7.1.3: - resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} - engines: {node: '>=6'} - querystring-es3@0.2.1: resolution: {integrity: sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==} engines: {node: '>=0.4.x'} @@ -14795,9 +12540,6 @@ packages: queue@6.0.2: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} - quick-format-unescaped@4.0.4: - resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} - quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} @@ -14806,9 +12548,6 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} - radix3@1.1.2: - resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} - randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -14827,9 +12566,6 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} - rc9@2.1.2: - resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} - rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -15034,10 +12770,6 @@ packages: readline@1.3.0: resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} - real-require@0.1.0: - resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} - engines: {node: '>= 12.13.0'} - rechoir@0.6.2: resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} engines: {node: '>= 0.10'} @@ -15069,15 +12801,6 @@ packages: resolution: {integrity: sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==} engines: {node: '>=12'} - redeyed@2.1.1: - resolution: {integrity: sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==} - - reflect-metadata@0.1.13: - resolution: {integrity: sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==} - - reflect-metadata@0.2.2: - resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} - regenerate-unicode-properties@10.2.0: resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} engines: {node: '>=4'} @@ -15187,9 +12910,6 @@ packages: require-like@0.1.2: resolution: {integrity: sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A==} - require-main-filename@2.0.0: - resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} @@ -15223,9 +12943,6 @@ packages: resolution: {integrity: sha512-QxrmX1DzraFIi9PxdG5VkRfRwIgjwyud+z/iBwfRRrVmHc+P9Q7u2lSSpQ6bjr2gy5lrqIiU9vb6iAeGf2400A==} hasBin: true - responselike@2.0.1: - resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} - responselike@3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} engines: {node: '>=14.16'} @@ -15281,23 +12998,11 @@ packages: robust-predicates@3.0.2: resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==} - rollup-plugin-dts@6.1.1: - resolution: {integrity: sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==} - engines: {node: '>=16'} - peerDependencies: - rollup: ^3.29.4 || ^4 - typescript: ^4.5 || ^5.0 - rollup@2.79.2: resolution: {integrity: sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==} engines: {node: '>=10.0.0'} hasBin: true - rollup@3.29.5: - resolution: {integrity: sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} - hasBin: true - rollup@4.28.1: resolution: {integrity: sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -15333,10 +13038,6 @@ packages: rw@1.3.3: resolution: {integrity: sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==} - rxjs@6.6.7: - resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} - engines: {npm: '>=2.0.0'} - rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} @@ -15346,13 +13047,6 @@ packages: safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-compare@1.1.4: - resolution: {integrity: sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ==} - - safe-stable-stringify@2.5.0: - resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==} - engines: {node: '>=10'} - safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -15360,10 +13054,6 @@ packages: resolution: {integrity: sha512-X4GUr8Q/T8RgtjnPOssSwYDknxot69PgEAVvwsJ4kB8Lz8wytuHB6n1JqsXLmpdKGD8YR9tqKptm07jmw83eWQ==} engines: {node: '>= 18.0.0', yarn: '>= 1.22.15'} - sandwich-stream@2.0.2: - resolution: {integrity: sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==} - engines: {node: '>= 0.10'} - save-pixels-jpeg-js-upgrade@2.3.4-jpeg-js-upgrade.0: resolution: {integrity: sha512-mFeQrydaAVTYQjywMvuNtjHmYZwAXZlo96Xouh3I7wTYDdUhMttoEPQsfk6EP+Wxt+fo/B8SW/A8dfhBImhKIw==} @@ -15392,9 +13082,6 @@ packages: scryptsy@2.1.0: resolution: {integrity: sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==} - scule@1.3.0: - resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} - search-insights@2.17.3: resolution: {integrity: sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==} @@ -15502,9 +13189,6 @@ packages: resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} hasBin: true - sha3@2.1.4: - resolution: {integrity: sha512-S8cNxbyb0UGUM2VhRD4Poe5N58gJnJsLJ5vC7FYWGUmGhcsj4++WaIOBFVDxlG0W3To6xBuiRh+i0Qp2oNCOtg==} - shallow-clone@0.1.2: resolution: {integrity: sha512-J1zdXCky5GmNnuauESROVu31MQSnLoYvlyEn6j2Ztk6Q5EHFIhxkMhYcv6vuDzl2XEzoRr856QwzMgWM/TmZgw==} engines: {node: '>=0.10.0'} @@ -15580,9 +13264,6 @@ packages: resolution: {integrity: sha512-8G+/XDU8wNsJOQS5ysDVO0Etg9/2uA5gR9l4ZwijjlwxBcrU6RPfwi2+jJmbP+Ap1Hlp/nVAaEO4Fj22/SL2gQ==} engines: {node: ^16.14.0 || >=18.0.0} - simple-cbor@0.4.1: - resolution: {integrity: sha512-rijcxtwx2b4Bje3sqeIqw5EeW7UlOIC4YfOdwqIKacpvRQ/D78bWg/4/0m5e0U91oKvlGh7LlJuZCu07ISCC7w==} - simple-concat@1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} @@ -15626,10 +13307,6 @@ packages: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} engines: {node: '>=12'} - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - sleep-promise@9.1.0: resolution: {integrity: sha512-UHYzVpz9Xn8b+jikYSD6bqvf754xL2uBUzDFwiU6NcdZeifPr6UfgU43xpkPu67VMS88+TI2PSI7Eohgqf2fKA==} @@ -15659,9 +13336,6 @@ packages: resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} - sonic-boom@2.8.0: - resolution: {integrity: sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==} - sort-css-media-queries@2.2.0: resolution: {integrity: sha512-0xtkGhWCC9MGt/EzgnvbbbKhqWjl1+/rncmhTh5qCpbYguXh6S/qwePfv/JQ8jePXXmqingylxoC49pCkSPIbA==} engines: {node: '>= 6.3.0'} @@ -15702,9 +13376,6 @@ packages: space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} - spawn-command@0.0.2: - resolution: {integrity: sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==} - spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} @@ -15714,9 +13385,6 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-expression-parse@4.0.0: - resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} - spdx-license-ids@3.0.20: resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==} @@ -15727,10 +13395,6 @@ packages: resolution: {integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==} engines: {node: '>=6.0.0'} - split-on-first@1.1.0: - resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==} - engines: {node: '>=6'} - split2@3.2.2: resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} @@ -15750,9 +13414,6 @@ packages: sprintf-js@1.1.3: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} - sql.js@1.12.0: - resolution: {integrity: sha512-Bi+43yMx/tUFZVYD4AUscmdL6NHn3gYQ+CM+YheFWLftOmrEC/Mz6Yh7E96Y2WDHYz3COSqT+LP6Z79zgrwJlA==} - sqlite-vec-darwin-arm64@0.1.6: resolution: {integrity: sha512-5duw/xhM3xE6BCQd//eAkyHgBp9FIwK6veldRhPG96dT6Zpjov3bG02RuE7JAQj0SVJYRW8bJwZ4LxqW0+Q7Dw==} cpu: [arm64] @@ -15804,9 +13465,6 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - starknet@6.18.0: - resolution: {integrity: sha512-nlxz7bK/YBY8W8NUevkycxFwphsX27oi+4YCl36TYFdrJpTOMqmJDnZ27ssr7z0eEDQLQscIxt1gXrZzCJua7g==} - statuses@1.5.0: resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} engines: {node: '>= 0.6'} @@ -15842,9 +13500,6 @@ packages: stream-parser@0.3.1: resolution: {integrity: sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==} - stream-shift@1.0.3: - resolution: {integrity: sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==} - stream-splicer@2.0.1: resolution: {integrity: sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==} @@ -15855,10 +13510,6 @@ packages: streamx@2.21.1: resolution: {integrity: sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==} - strict-uri-encode@2.0.0: - resolution: {integrity: sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==} - engines: {node: '>=4'} - string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} @@ -15963,12 +13614,6 @@ packages: peerDependencies: postcss: ^8.4.31 - stylehacks@7.0.4: - resolution: {integrity: sha512-i4zfNrGMt9SB4xRK9L83rlsFCgdGANfeDAYacO1pkqcE7cRHPdWHwnKZVz7WY17Veq/FvyYsRAU++Ga+qDFIww==} - engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} - peerDependencies: - postcss: ^8.4.31 - stylis@4.3.4: resolution: {integrity: sha512-osIBl6BGUmSfDkyH2mB7EFvCJntXDrLhKjHTRj/rK6xLH0yuPrHULDRQzKokSOD4VoorhtKpfcfW1GAntu8now==} @@ -15987,9 +13632,6 @@ packages: resolution: {integrity: sha512-CY8u7DtbvucKuquCmOFEKhr9Besln7n9uN8eFbwcoGYWXOMW07u2o8njWaiXt11ylS3qoGF55pILjRmPlbodyg==} engines: {node: '>=18'} - superstruct@0.15.5: - resolution: {integrity: sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==} - superstruct@2.0.2: resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} engines: {node: '>=14.0.0'} @@ -16049,10 +13691,6 @@ packages: syntax-error@1.4.0: resolution: {integrity: sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==} - system-architecture@0.1.0: - resolution: {integrity: sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==} - engines: {node: '>=18'} - systeminformation@5.23.5: resolution: {integrity: sha512-PEpJwhRYxZgBCAlWZhWIgfMTjXLqfcaZ1pJsJn9snWNfBW/Z1YQg1mbIUSWrEV3ErAHF7l/OoVLQeaZDlPzkpA==} engines: {node: '>=8.0.0'} @@ -16101,11 +13739,6 @@ packages: resolution: {integrity: sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==} engines: {node: '>=18'} - telegraf@4.16.3: - resolution: {integrity: sha512-yjEu2NwkHlXu0OARWoNhJlIjX09dRktiMQFsM678BAH/PEPVwctzL67+tvXqLCRQQvm3SDtki2saGO9hLlz68w==} - engines: {node: ^12.20.0 || >=14.13.1} - hasBin: true - temp-dir@1.0.0: resolution: {integrity: sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==} engines: {node: '>=4'} @@ -16156,9 +13789,6 @@ packages: text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - thenby@1.3.4: - resolution: {integrity: sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ==} - thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -16166,9 +13796,6 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - thread-stream@0.15.2: - resolution: {integrity: sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==} - throttleit@2.1.0: resolution: {integrity: sha512-nt6AMGKW1p/70DF/hGBdJB57B8Tspmbp5gfJ8ilhLnt7kkr2ye7hzD6NVG8GGErk2HWF34igrL2CXmNIkzKqKw==} engines: {node: '>=18'} @@ -16276,9 +13903,6 @@ packages: resolution: {integrity: sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==} engines: {node: '>=12'} - toformat@2.0.0: - resolution: {integrity: sha512-03SWBVop6nU8bpyZCx7SodpYznbZF5R4ljwNLBcTQzKOD9xuihRo/psX58llS1BMFhhAI08H3luot5GoXJz2pQ==} - together-ai@0.7.0: resolution: {integrity: sha512-/be/HOecBSwRTDHB14vCvHbp1WiNsFxyS4pJlyBoMup1X3n7xD1b/Gm5Z5amlKzD2zll9Y5wscDk7Ut5OsT1nA==} @@ -16290,9 +13914,6 @@ packages: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - totalist@3.0.1: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} @@ -16406,9 +14027,6 @@ packages: resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==} engines: {node: '>=6'} - tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - tslib@1.9.3: resolution: {integrity: sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==} @@ -16513,10 +14131,6 @@ packages: resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} engines: {node: '>=10'} - type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -16602,10 +14216,6 @@ packages: engines: {node: '>=0.8.0'} hasBin: true - uid@2.0.2: - resolution: {integrity: sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==} - engines: {node: '>=8'} - uint8array-tools@0.0.8: resolution: {integrity: sha512-xS6+s8e0Xbx++5/0L+yyexukU7pz//Yg6IHg3BKhXotg1JcYtgxVcUctQ0HxLByiJzpAkNFawz1Nz5Xadzo82g==} engines: {node: '>=14.0.0'} @@ -16614,28 +14224,13 @@ packages: resolution: {integrity: sha512-9vqDWmoSXOoi+K14zNaf6LBV51Q8MayF0/IiQs3GlygIKUYtog603e6virExkjjFosfJUBI4LhbQK1iq8IG11A==} engines: {node: '>=14.0.0'} - uint8arrays@3.1.0: - resolution: {integrity: sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==} - umd@3.0.3: resolution: {integrity: sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==} hasBin: true - unbuild@2.0.0: - resolution: {integrity: sha512-JWCUYx3Oxdzvw2J9kTAp+DKE8df/BnH/JTSj6JyA4SH40ECdFu7FoJJcrm8G92B7TjofQ6GZGjJs50TRxoH6Wg==} - hasBin: true - peerDependencies: - typescript: ^5.1.6 - peerDependenciesMeta: - typescript: - optional: true - unbzip2-stream@1.4.3: resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==} - uncrypto@0.1.3: - resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} - undeclared-identifiers@1.1.3: resolution: {integrity: sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==} hasBin: true @@ -16653,9 +14248,6 @@ packages: resolution: {integrity: sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==} engines: {node: '>=18.17'} - unenv@1.10.0: - resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==} - unfetch@4.2.0: resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==} @@ -16679,10 +14271,6 @@ packages: resolution: {integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==} engines: {node: '>=4'} - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - unified@11.0.5: resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} @@ -16762,58 +14350,6 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - unstorage@1.13.1: - resolution: {integrity: sha512-ELexQHUrG05QVIM/iUeQNdl9FXDZhqLJ4yP59fnmn2jGUh0TEulwOgov1ubOb3Gt2ZGK/VMchJwPDNVEGWQpRg==} - peerDependencies: - '@azure/app-configuration': ^1.7.0 - '@azure/cosmos': ^4.1.1 - '@azure/data-tables': ^13.2.2 - '@azure/identity': ^4.5.0 - '@azure/keyvault-secrets': ^4.9.0 - '@azure/storage-blob': ^12.25.0 - '@capacitor/preferences': ^6.0.2 - '@netlify/blobs': ^6.5.0 || ^7.0.0 || ^8.1.0 - '@planetscale/database': ^1.19.0 - '@upstash/redis': ^1.34.3 - '@vercel/kv': ^1.0.1 - idb-keyval: ^6.2.1 - ioredis: ^5.4.1 - peerDependenciesMeta: - '@azure/app-configuration': - optional: true - '@azure/cosmos': - optional: true - '@azure/data-tables': - optional: true - '@azure/identity': - optional: true - '@azure/keyvault-secrets': - optional: true - '@azure/storage-blob': - optional: true - '@capacitor/preferences': - optional: true - '@netlify/blobs': - optional: true - '@planetscale/database': - optional: true - '@upstash/redis': - optional: true - '@vercel/kv': - optional: true - idb-keyval: - optional: true - ioredis: - optional: true - - untun@0.1.3: - resolution: {integrity: sha512-4luGP9LMYszMRZwsvyUd9MrxgEGZdZuZgpVQHEEX0lCYFESasVRvZd0EYpCkOIbJKHMuv0LskpXc/8Un+MJzEQ==} - hasBin: true - - untyped@1.5.1: - resolution: {integrity: sha512-reBOnkJBFfBZ8pCKaeHgfZLcehXtM6UTxc+vqs1JvCps0c4amLNp3fhdGBZwYp+VLyoY9n3X5KOP7lCyWBUX9A==} - hasBin: true - upath@2.0.1: resolution: {integrity: sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==} engines: {node: '>=4'} @@ -16828,9 +14364,6 @@ packages: resolution: {integrity: sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==} engines: {node: '>=14.16'} - uqr@0.1.2: - resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==} - uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -16874,11 +14407,6 @@ packages: '@types/react': optional: true - use-sync-external-store@1.2.0: - resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - use-sync-external-store@1.4.0: resolution: {integrity: sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==} peerDependencies: @@ -16954,18 +14482,6 @@ packages: resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - valtio@1.11.2: - resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} - engines: {node: '>=12.20.0'} - peerDependencies: - '@types/react': '>=16.8' - react: '>=16.8' - peerDependenciesMeta: - '@types/react': - optional: true - react: - optional: true - value-equal@1.0.1: resolution: {integrity: sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==} @@ -17006,11 +14522,6 @@ packages: typescript: optional: true - vite-node@2.1.4: - resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - vite-node@2.1.5: resolution: {integrity: sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==} engines: {node: ^18.0.0 || >=20.0.0} @@ -17057,31 +14568,6 @@ packages: terser: optional: true - vitest@2.1.4: - resolution: {integrity: sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.1.4 - '@vitest/ui': 2.1.4 - happy-dom: '*' - jsdom: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@types/node': - optional: true - '@vitest/browser': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - vitest@2.1.5: resolution: {integrity: sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==} engines: {node: ^18.0.0 || >=20.0.0} @@ -17193,9 +14679,6 @@ packages: webauthn-p256@0.0.10: resolution: {integrity: sha512-EeYD+gmIT80YkSIDb2iWq0lq2zbHo1CxHlQTeJ+KkCILWpVy3zASH3ByD4bopzfk0uCwXxLqKGLqp2W4O28VFA==} - webcrypto-core@1.8.1: - resolution: {integrity: sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A==} - webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -17274,9 +14757,6 @@ packages: resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==} engines: {node: '>=18'} - whatwg-fetch@3.6.20: - resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} - whatwg-mimetype@4.0.0: resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} engines: {node: '>=18'} @@ -17291,9 +14771,6 @@ packages: whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} - which-module@2.0.1: - resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - which-pm-runs@1.1.0: resolution: {integrity: sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==} engines: {node: '>=4'} @@ -17454,9 +14931,6 @@ packages: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} - y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -17489,10 +14963,6 @@ packages: engines: {node: '>= 14'} hasBin: true - yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} - yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} @@ -17501,10 +14971,6 @@ packages: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} - yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} - yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} @@ -17932,39 +15398,6 @@ snapshots: '@anush008/tokenizers-linux-x64-gnu': 0.0.0 '@anush008/tokenizers-win32-x64-msvc': 0.0.0 - '@aptos-labs/aptos-cli@1.0.2': - dependencies: - commander: 12.1.0 - - '@aptos-labs/aptos-client@0.1.1': - dependencies: - axios: 1.7.4 - got: 11.8.6 - transitivePeerDependencies: - - debug - - '@aptos-labs/ts-sdk@1.33.1': - dependencies: - '@aptos-labs/aptos-cli': 1.0.2 - '@aptos-labs/aptos-client': 0.1.1 - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 - '@scure/bip32': 1.6.0 - '@scure/bip39': 1.4.0 - eventemitter3: 5.0.1 - form-data: 4.0.1 - js-base64: 3.7.7 - jwt-decode: 4.0.0 - poseidon-lite: 0.2.1 - transitivePeerDependencies: - - debug - - '@avnu/avnu-sdk@2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.18.0(encoding@0.1.13))': - dependencies: - ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) - qs: 6.13.0 - starknet: 6.18.0(encoding@0.1.13) - '@aws-crypto/crc32@5.2.0': dependencies: '@aws-crypto/util': 5.2.0 @@ -19435,8 +16868,6 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@babel/standalone@7.26.4': {} - '@babel/template@7.25.9': dependencies: '@babel/code-frame': 7.26.2 @@ -19515,13 +16946,6 @@ snapshots: '@types/firefox-webext-browser': 120.0.4 tldts-experimental: 6.1.67 - '@coinbase-samples/advanced-sdk-ts@file:packages/plugin-coinbase/advanced-sdk-ts(encoding@0.1.13)': - dependencies: - jsonwebtoken: 9.0.2 - node-fetch: 2.7.0(encoding@0.1.13) - transitivePeerDependencies: - - encoding - '@coinbase/coinbase-sdk@0.10.0(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@scure/bip32': 1.6.0 @@ -19660,36 +17084,6 @@ snapshots: dependencies: chalk: 4.1.2 - '@coral-xyz/anchor-errors@0.30.1': {} - - '@coral-xyz/anchor@0.30.1(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': - dependencies: - '@coral-xyz/anchor-errors': 0.30.1 - '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)) - '@noble/hashes': 1.6.1 - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - bn.js: 5.2.1 - bs58: 4.0.1 - buffer-layout: 1.2.2 - camelcase: 6.3.0 - cross-fetch: 3.1.8(encoding@0.1.13) - crypto-hash: 1.3.0 - eventemitter3: 4.0.7 - pako: 2.1.0 - snake-case: 3.0.4 - superstruct: 0.15.5 - toml: 3.0.0 - transitivePeerDependencies: - - bufferutil - - encoding - - utf-8-validate - - '@coral-xyz/borsh@0.30.1(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))': - dependencies: - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - bn.js: 5.2.1 - buffer-layout: 1.2.2 - '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -19970,34 +17364,6 @@ snapshots: http-response-object: 3.0.2 parse-cache-control: 1.0.1 - '@dfinity/agent@2.1.3(@dfinity/candid@2.1.3(@dfinity/principal@2.1.3))(@dfinity/principal@2.1.3)': - dependencies: - '@dfinity/candid': 2.1.3(@dfinity/principal@2.1.3) - '@dfinity/principal': 2.1.3 - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 - base64-arraybuffer: 0.2.0 - borc: 2.1.2 - buffer: 6.0.3 - simple-cbor: 0.4.1 - - '@dfinity/candid@2.1.3(@dfinity/principal@2.1.3)': - dependencies: - '@dfinity/principal': 2.1.3 - - '@dfinity/identity@2.1.3(@dfinity/agent@2.1.3(@dfinity/candid@2.1.3(@dfinity/principal@2.1.3))(@dfinity/principal@2.1.3))(@dfinity/principal@2.1.3)(@peculiar/webcrypto@1.5.0)': - dependencies: - '@dfinity/agent': 2.1.3(@dfinity/candid@2.1.3(@dfinity/principal@2.1.3))(@dfinity/principal@2.1.3) - '@dfinity/principal': 2.1.3 - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 - '@peculiar/webcrypto': 1.5.0 - borc: 2.1.2 - - '@dfinity/principal@2.1.3': - dependencies: - '@noble/hashes': 1.6.1 - '@discordjs/builders@1.9.0': dependencies: '@discordjs/formatters': 0.5.0 @@ -20974,168 +18340,108 @@ snapshots: dependencies: tslib: 2.8.1 - '@es-joy/jsdoccomment@0.41.0': - dependencies: - comment-parser: 1.4.1 - esquery: 1.6.0 - jsdoc-type-pratt-parser: 4.0.0 - - '@esbuild/aix-ppc64@0.19.12': - optional: true - '@esbuild/aix-ppc64@0.21.5': optional: true '@esbuild/aix-ppc64@0.24.0': optional: true - '@esbuild/android-arm64@0.19.12': - optional: true - '@esbuild/android-arm64@0.21.5': optional: true '@esbuild/android-arm64@0.24.0': optional: true - '@esbuild/android-arm@0.19.12': - optional: true - '@esbuild/android-arm@0.21.5': optional: true '@esbuild/android-arm@0.24.0': optional: true - '@esbuild/android-x64@0.19.12': - optional: true - '@esbuild/android-x64@0.21.5': optional: true '@esbuild/android-x64@0.24.0': optional: true - '@esbuild/darwin-arm64@0.19.12': - optional: true - '@esbuild/darwin-arm64@0.21.5': optional: true '@esbuild/darwin-arm64@0.24.0': optional: true - '@esbuild/darwin-x64@0.19.12': - optional: true - '@esbuild/darwin-x64@0.21.5': optional: true '@esbuild/darwin-x64@0.24.0': optional: true - '@esbuild/freebsd-arm64@0.19.12': - optional: true - '@esbuild/freebsd-arm64@0.21.5': optional: true '@esbuild/freebsd-arm64@0.24.0': optional: true - '@esbuild/freebsd-x64@0.19.12': - optional: true - '@esbuild/freebsd-x64@0.21.5': optional: true '@esbuild/freebsd-x64@0.24.0': optional: true - '@esbuild/linux-arm64@0.19.12': - optional: true - '@esbuild/linux-arm64@0.21.5': optional: true '@esbuild/linux-arm64@0.24.0': optional: true - '@esbuild/linux-arm@0.19.12': - optional: true - '@esbuild/linux-arm@0.21.5': optional: true '@esbuild/linux-arm@0.24.0': optional: true - '@esbuild/linux-ia32@0.19.12': - optional: true - '@esbuild/linux-ia32@0.21.5': optional: true '@esbuild/linux-ia32@0.24.0': optional: true - '@esbuild/linux-loong64@0.19.12': - optional: true - '@esbuild/linux-loong64@0.21.5': optional: true '@esbuild/linux-loong64@0.24.0': optional: true - '@esbuild/linux-mips64el@0.19.12': - optional: true - '@esbuild/linux-mips64el@0.21.5': optional: true '@esbuild/linux-mips64el@0.24.0': optional: true - '@esbuild/linux-ppc64@0.19.12': - optional: true - '@esbuild/linux-ppc64@0.21.5': optional: true '@esbuild/linux-ppc64@0.24.0': optional: true - '@esbuild/linux-riscv64@0.19.12': - optional: true - '@esbuild/linux-riscv64@0.21.5': optional: true '@esbuild/linux-riscv64@0.24.0': optional: true - '@esbuild/linux-s390x@0.19.12': - optional: true - '@esbuild/linux-s390x@0.21.5': optional: true '@esbuild/linux-s390x@0.24.0': optional: true - '@esbuild/linux-x64@0.19.12': - optional: true - '@esbuild/linux-x64@0.21.5': optional: true '@esbuild/linux-x64@0.24.0': optional: true - '@esbuild/netbsd-x64@0.19.12': - optional: true - '@esbuild/netbsd-x64@0.21.5': optional: true @@ -21145,56 +18451,36 @@ snapshots: '@esbuild/openbsd-arm64@0.24.0': optional: true - '@esbuild/openbsd-x64@0.19.12': - optional: true - '@esbuild/openbsd-x64@0.21.5': optional: true '@esbuild/openbsd-x64@0.24.0': optional: true - '@esbuild/sunos-x64@0.19.12': - optional: true - '@esbuild/sunos-x64@0.21.5': optional: true '@esbuild/sunos-x64@0.24.0': optional: true - '@esbuild/win32-arm64@0.19.12': - optional: true - '@esbuild/win32-arm64@0.21.5': optional: true '@esbuild/win32-arm64@0.24.0': optional: true - '@esbuild/win32-ia32@0.19.12': - optional: true - '@esbuild/win32-ia32@0.21.5': optional: true '@esbuild/win32-ia32@0.24.0': optional: true - '@esbuild/win32-x64@0.19.12': - optional: true - '@esbuild/win32-x64@0.21.5': optional: true '@esbuild/win32-x64@0.24.0': optional: true - '@eslint-community/eslint-utils@4.4.1(eslint@8.57.1)': - dependencies: - eslint: 8.57.1 - eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.4.1(eslint@9.13.0(jiti@2.4.0))': dependencies: eslint: 9.13.0(jiti@2.4.0) @@ -21229,20 +18515,6 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@2.1.4': - dependencies: - ajv: 6.12.6 - debug: 4.4.0(supports-color@5.5.0) - espree: 9.6.1 - globals: 13.24.0 - ignore: 5.3.2 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 @@ -21257,8 +18529,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@8.57.1': {} - '@eslint/js@9.13.0': {} '@eslint/js@9.16.0': {} @@ -21269,62 +18539,10 @@ snapshots: dependencies: levn: 0.4.1 - '@ethersproject/abstract-provider@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/properties': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/web': 5.7.1 - - '@ethersproject/abstract-signer@5.7.0': - dependencies: - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - - '@ethersproject/address@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/rlp': 5.7.0 - - '@ethersproject/base64@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - - '@ethersproject/bignumber@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - bn.js: 5.2.1 - '@ethersproject/bytes@5.7.0': dependencies: '@ethersproject/logger': 5.7.0 - '@ethersproject/constants@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - - '@ethersproject/hash@5.7.0': - dependencies: - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/keccak256@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 @@ -21332,54 +18550,6 @@ snapshots: '@ethersproject/logger@5.7.0': {} - '@ethersproject/networks@5.7.1': - dependencies: - '@ethersproject/logger': 5.7.0 - - '@ethersproject/properties@5.7.0': - dependencies: - '@ethersproject/logger': 5.7.0 - - '@ethersproject/rlp@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - - '@ethersproject/signing-key@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - bn.js: 5.2.1 - elliptic: 6.5.4 - hash.js: 1.1.7 - - '@ethersproject/strings@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - - '@ethersproject/transactions@5.7.0': - dependencies: - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - - '@ethersproject/web@5.7.1': - dependencies: - '@ethersproject/base64': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@fal-ai/client@1.2.0': dependencies: '@msgpack/msgpack': 3.0.0-beta2 @@ -21457,18 +18627,8 @@ snapshots: '@humanfs/core': 0.19.1 '@humanwhocodes/retry': 0.3.1 - '@humanwhocodes/config-array@0.13.0': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.4.0(supports-color@5.5.0) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@2.0.3': {} - '@humanwhocodes/retry@0.3.1': {} '@humanwhocodes/retry@0.4.1': {} @@ -21565,11 +18725,6 @@ snapshots: '@img/sharp-win32-x64@0.33.5': optional: true - '@improbable-eng/grpc-web@0.15.0(google-protobuf@3.21.4)': - dependencies: - browser-headers: 0.4.1 - google-protobuf: 3.21.4 - '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -21934,14 +19089,6 @@ snapshots: '@lifi/types@16.3.0': {} - '@lit-labs/ssr-dom-shim@1.2.1': {} - - '@lit/reactive-element@1.6.3': - dependencies: - '@lit-labs/ssr-dom-shim': 1.2.1 - - '@lukeed/csprng@1.1.0': {} - '@mapbox/node-pre-gyp@1.0.11(encoding@0.1.13)': dependencies: detect-libc: 2.0.3 @@ -21998,51 +19145,6 @@ snapshots: dependencies: langium: 3.0.0 - '@motionone/animation@10.18.0': - dependencies: - '@motionone/easing': 10.18.0 - '@motionone/types': 10.17.1 - '@motionone/utils': 10.18.0 - tslib: 2.8.1 - - '@motionone/dom@10.18.0': - dependencies: - '@motionone/animation': 10.18.0 - '@motionone/generators': 10.18.0 - '@motionone/types': 10.17.1 - '@motionone/utils': 10.18.0 - hey-listen: 1.0.8 - tslib: 2.8.1 - - '@motionone/easing@10.18.0': - dependencies: - '@motionone/utils': 10.18.0 - tslib: 2.8.1 - - '@motionone/generators@10.18.0': - dependencies: - '@motionone/types': 10.17.1 - '@motionone/utils': 10.18.0 - tslib: 2.8.1 - - '@motionone/svelte@10.16.4': - dependencies: - '@motionone/dom': 10.18.0 - tslib: 2.8.1 - - '@motionone/types@10.17.1': {} - - '@motionone/utils@10.18.0': - dependencies: - '@motionone/types': 10.17.1 - hey-listen: 1.0.8 - tslib: 2.8.1 - - '@motionone/vue@10.16.4': - dependencies: - '@motionone/dom': 10.18.0 - tslib: 2.8.1 - '@mozilla/readability@0.5.0': {} '@msgpack/msgpack@3.0.0-beta2': {} @@ -22182,63 +19284,10 @@ snapshots: near-api-js: 0.44.2(encoding@0.1.13) rxjs: 7.8.1 - '@nestjs/axios@3.1.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1))(axios@1.7.7)(rxjs@7.8.1)': - dependencies: - '@nestjs/common': 10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) - axios: 1.7.7 - rxjs: 7.8.1 - - '@nestjs/common@10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1)': - dependencies: - iterare: 1.2.1 - reflect-metadata: 0.1.13 - rxjs: 7.8.1 - tslib: 2.7.0 - uid: 2.0.2 - optionalDependencies: - class-transformer: 0.5.1 - - '@nestjs/core@10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1))(encoding@0.1.13)(reflect-metadata@0.1.13)(rxjs@7.8.1)': - dependencies: - '@nestjs/common': 10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) - '@nuxtjs/opencollective': 0.3.2(encoding@0.1.13) - fast-safe-stringify: 2.1.1 - iterare: 1.2.1 - path-to-regexp: 3.3.0 - reflect-metadata: 0.1.13 - rxjs: 7.8.1 - tslib: 2.7.0 - uid: 2.0.2 - transitivePeerDependencies: - - encoding - - '@neynar/nodejs-sdk@2.2.3(bufferutil@4.0.8)(class-transformer@0.5.1)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)': - dependencies: - '@openapitools/openapi-generator-cli': 2.15.3(class-transformer@0.5.1)(encoding@0.1.13) - semver: 7.6.3 - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - transitivePeerDependencies: - - '@nestjs/microservices' - - '@nestjs/platform-express' - - '@nestjs/websockets' - - bufferutil - - class-transformer - - class-validator - - debug - - encoding - - supports-color - - typescript - - utf-8-validate - - zod - '@noble/curves@1.2.0': dependencies: '@noble/hashes': 1.3.2 - '@noble/curves@1.3.0': - dependencies: - '@noble/hashes': 1.3.3 - '@noble/curves@1.6.0': dependencies: '@noble/hashes': 1.5.0 @@ -22451,14 +19500,6 @@ snapshots: - '@swc/core' - debug - '@nuxtjs/opencollective@0.3.2(encoding@0.1.13)': - dependencies: - chalk: 4.1.2 - consola: 2.15.3 - node-fetch: 2.7.0(encoding@0.1.13) - transitivePeerDependencies: - - encoding - '@nx/devkit@19.8.14(nx@19.8.14(@swc/core@1.10.1(@swc/helpers@0.5.15)))': dependencies: '@nrwl/devkit': 19.8.14(nx@19.8.14(@swc/core@1.10.1(@swc/helpers@0.5.15))) @@ -22548,8 +19589,6 @@ snapshots: '@octokit/auth-token@3.0.4': {} - '@octokit/auth-token@4.0.0': {} - '@octokit/auth-token@5.1.1': {} '@octokit/auth-unauthenticated@6.1.0': @@ -22569,16 +19608,6 @@ snapshots: transitivePeerDependencies: - encoding - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.6.2 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - '@octokit/core@6.1.2': dependencies: '@octokit/auth-token': 5.1.1 @@ -22600,11 +19629,6 @@ snapshots: is-plain-object: 5.0.0 universal-user-agent: 6.0.1 - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.6.2 - universal-user-agent: 6.0.1 - '@octokit/graphql@5.0.6(encoding@0.1.13)': dependencies: '@octokit/request': 6.2.8(encoding@0.1.13) @@ -22613,12 +19637,6 @@ snapshots: transitivePeerDependencies: - encoding - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.6.2 - universal-user-agent: 6.0.1 - '@octokit/graphql@8.1.1': dependencies: '@octokit/request': 9.1.3 @@ -22647,8 +19665,6 @@ snapshots: '@octokit/openapi-types@18.1.1': {} - '@octokit/openapi-types@20.0.0': {} - '@octokit/openapi-types@22.2.0': {} '@octokit/openapi-webhooks-types@8.5.1': {} @@ -22659,11 +19675,6 @@ snapshots: dependencies: '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.6.2 - '@octokit/plugin-paginate-rest@11.3.6(@octokit/core@6.1.2)': dependencies: '@octokit/core': 6.1.2 @@ -22679,15 +19690,6 @@ snapshots: dependencies: '@octokit/core': 4.2.4(encoding@0.1.13) - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.6.2 - '@octokit/plugin-rest-endpoint-methods@13.2.6(@octokit/core@6.1.2)': dependencies: '@octokit/core': 6.1.2 @@ -22717,12 +19719,6 @@ snapshots: deprecation: 2.3.1 once: 1.4.0 - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.6.2 - deprecation: 2.3.1 - once: 1.4.0 - '@octokit/request-error@6.1.5': dependencies: '@octokit/types': 13.6.2 @@ -22738,13 +19734,6 @@ snapshots: transitivePeerDependencies: - encoding - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.6.2 - universal-user-agent: 6.0.1 - '@octokit/request@9.1.3': dependencies: '@octokit/endpoint': 10.1.1 @@ -22761,23 +19750,12 @@ snapshots: transitivePeerDependencies: - encoding - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - '@octokit/tsconfig@1.0.2': {} '@octokit/types@10.0.0': dependencies: '@octokit/openapi-types': 18.1.1 - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - '@octokit/types@13.6.2': dependencies: '@octokit/openapi-types': 22.2.0 @@ -22794,260 +19772,6 @@ snapshots: '@octokit/request-error': 6.1.5 '@octokit/webhooks-methods': 5.1.0 - '@onflow/config@1.5.1': - dependencies: - '@babel/runtime': 7.26.0 - '@onflow/util-actor': 1.3.4 - '@onflow/util-invariant': 1.2.4 - '@onflow/util-logger': 1.3.3 - eslint: 8.57.1 - eslint-plugin-jsdoc: 46.10.1(eslint@8.57.1) - transitivePeerDependencies: - - '@onflow/util-config' - - supports-color - - '@onflow/fcl-core@1.13.1(bufferutil@4.0.8)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10)': - dependencies: - '@babel/runtime': 7.26.0 - '@improbable-eng/grpc-web': 0.15.0(google-protobuf@3.21.4) - '@onflow/config': 1.5.1 - '@onflow/interaction': 0.0.11 - '@onflow/rlp': 1.2.3 - '@onflow/sdk': 1.5.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@onflow/transport-http': 1.10.4(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@onflow/types': 1.4.1 - '@onflow/util-actor': 1.3.4 - '@onflow/util-address': 1.2.3 - '@onflow/util-invariant': 1.2.4 - '@onflow/util-logger': 1.3.3 - '@onflow/util-semver': 1.0.3 - '@onflow/util-template': 1.2.3 - '@onflow/util-uid': 1.2.3 - abort-controller: 3.0.0 - cross-fetch: 4.0.0(encoding@0.1.13) - transitivePeerDependencies: - - '@onflow/util-config' - - bufferutil - - encoding - - google-protobuf - - supports-color - - utf-8-validate - - '@onflow/fcl-wc@5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.8)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10))(@types/react@18.3.12)(bufferutil@4.0.8)(jiti@2.4.0)(postcss@8.4.49)(react@18.3.1)(utf-8-validate@5.0.10)': - dependencies: - '@babel/runtime': 7.26.0 - '@onflow/config': 1.5.1 - '@onflow/fcl-core': 1.13.1(bufferutil@4.0.8)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10) - '@onflow/util-invariant': 1.2.4 - '@onflow/util-logger': 1.3.3 - '@walletconnect/modal': 2.7.0(@types/react@18.3.12)(react@18.3.1) - '@walletconnect/modal-core': 2.7.0(@types/react@18.3.12)(react@18.3.1) - '@walletconnect/sign-client': 2.17.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@walletconnect/types': 2.17.2 - '@walletconnect/utils': 2.17.2 - postcss-cli: 11.0.0(jiti@2.4.0)(postcss@8.4.49) - preact: 10.25.2 - tailwindcss: 3.4.15(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@onflow/util-config' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@types/react' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - ioredis - - jiti - - postcss - - react - - supports-color - - ts-node - - tsx - - utf-8-validate - - '@onflow/fcl@1.13.1(@types/react@18.3.12)(bufferutil@4.0.8)(encoding@0.1.13)(google-protobuf@3.21.4)(jiti@2.4.0)(postcss@8.4.49)(react@18.3.1)(utf-8-validate@5.0.10)': - dependencies: - '@babel/runtime': 7.26.0 - '@onflow/config': 1.5.1 - '@onflow/fcl-core': 1.13.1(bufferutil@4.0.8)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10) - '@onflow/fcl-wc': 5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.8)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10))(@types/react@18.3.12)(bufferutil@4.0.8)(jiti@2.4.0)(postcss@8.4.49)(react@18.3.1)(utf-8-validate@5.0.10) - '@onflow/interaction': 0.0.11 - '@onflow/rlp': 1.2.3 - '@onflow/sdk': 1.5.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@onflow/types': 1.4.1 - '@onflow/util-actor': 1.3.4 - '@onflow/util-address': 1.2.3 - '@onflow/util-invariant': 1.2.4 - '@onflow/util-logger': 1.3.3 - '@onflow/util-rpc': 0.0.2 - '@onflow/util-semver': 1.0.3 - '@onflow/util-template': 1.2.3 - '@onflow/util-uid': 1.2.3 - '@walletconnect/types': 2.17.2 - abort-controller: 3.0.0 - cross-fetch: 4.0.0(encoding@0.1.13) - events: 3.3.0 - sha3: 2.1.4 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@onflow/util-config' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@types/react' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - encoding - - google-protobuf - - ioredis - - jiti - - postcss - - react - - supports-color - - ts-node - - tsx - - utf-8-validate - - '@onflow/interaction@0.0.11': {} - - '@onflow/rlp@1.2.3': - dependencies: - '@babel/runtime': 7.26.0 - buffer: 6.0.3 - - '@onflow/sdk@1.5.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': - dependencies: - '@babel/runtime': 7.26.0 - '@onflow/config': 1.5.1 - '@onflow/rlp': 1.2.3 - '@onflow/transport-http': 1.10.4(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@onflow/typedefs': 1.4.0 - '@onflow/util-actor': 1.3.4 - '@onflow/util-address': 1.2.3 - '@onflow/util-invariant': 1.2.4 - '@onflow/util-logger': 1.3.3 - '@onflow/util-template': 1.2.3 - deepmerge: 4.3.1 - events: 3.3.0 - sha3: 2.1.4 - uuid: 9.0.1 - transitivePeerDependencies: - - '@onflow/util-config' - - bufferutil - - encoding - - supports-color - - utf-8-validate - - '@onflow/transport-http@1.10.4(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': - dependencies: - '@babel/runtime': 7.26.0 - '@onflow/util-address': 1.2.3 - '@onflow/util-invariant': 1.2.4 - '@onflow/util-logger': 1.3.3 - '@onflow/util-template': 1.2.3 - abort-controller: 3.0.0 - cross-fetch: 4.0.0(encoding@0.1.13) - events: 3.3.0 - isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - '@onflow/util-config' - - bufferutil - - encoding - - utf-8-validate - - '@onflow/typedefs@1.4.0': - dependencies: - '@babel/runtime': 7.26.0 - - '@onflow/types@1.4.1': - dependencies: - '@babel/runtime': 7.26.0 - '@onflow/util-logger': 1.3.3 - transitivePeerDependencies: - - '@onflow/util-config' - - '@onflow/util-actor@1.3.4': - dependencies: - '@babel/runtime': 7.26.0 - queue-microtask: 1.2.3 - - '@onflow/util-address@1.2.3': - dependencies: - '@babel/runtime': 7.26.0 - - '@onflow/util-invariant@1.2.4': - dependencies: - '@babel/runtime': 7.26.0 - - '@onflow/util-logger@1.3.3': - dependencies: - '@babel/runtime': 7.26.0 - - '@onflow/util-rpc@0.0.2': - dependencies: - '@babel/runtime': 7.26.0 - - '@onflow/util-semver@1.0.3': - dependencies: - '@babel/runtime': 7.26.0 - - '@onflow/util-template@1.2.3': - dependencies: - '@babel/runtime': 7.26.0 - '@onflow/util-logger': 1.3.3 - transitivePeerDependencies: - - '@onflow/util-config' - - '@onflow/util-uid@1.2.3': - dependencies: - '@babel/runtime': 7.26.0 - - '@openapitools/openapi-generator-cli@2.15.3(class-transformer@0.5.1)(encoding@0.1.13)': - dependencies: - '@nestjs/axios': 3.1.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1))(axios@1.7.7)(rxjs@7.8.1) - '@nestjs/common': 10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) - '@nestjs/core': 10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(reflect-metadata@0.1.13)(rxjs@7.8.1))(encoding@0.1.13)(reflect-metadata@0.1.13)(rxjs@7.8.1) - '@nuxtjs/opencollective': 0.3.2(encoding@0.1.13) - axios: 1.7.7 - chalk: 4.1.2 - commander: 8.3.0 - compare-versions: 4.1.4 - concurrently: 6.5.1 - console.table: 0.10.0 - fs-extra: 10.1.0 - glob: 9.3.5 - inquirer: 8.2.6 - lodash: 4.17.21 - proxy-agent: 6.4.0 - reflect-metadata: 0.1.13 - rxjs: 7.8.1 - tslib: 2.8.1 - transitivePeerDependencies: - - '@nestjs/microservices' - - '@nestjs/platform-express' - - '@nestjs/websockets' - - class-transformer - - class-validator - - debug - - encoding - - supports-color - '@opendocsg/pdf2md@0.1.32(encoding@0.1.13)': dependencies: enumify: 1.0.4 @@ -23059,98 +19783,6 @@ snapshots: '@opentelemetry/api@1.9.0': {} - '@parcel/watcher-android-arm64@2.5.0': - optional: true - - '@parcel/watcher-darwin-arm64@2.5.0': - optional: true - - '@parcel/watcher-darwin-x64@2.5.0': - optional: true - - '@parcel/watcher-freebsd-x64@2.5.0': - optional: true - - '@parcel/watcher-linux-arm-glibc@2.5.0': - optional: true - - '@parcel/watcher-linux-arm-musl@2.5.0': - optional: true - - '@parcel/watcher-linux-arm64-glibc@2.5.0': - optional: true - - '@parcel/watcher-linux-arm64-musl@2.5.0': - optional: true - - '@parcel/watcher-linux-x64-glibc@2.5.0': - optional: true - - '@parcel/watcher-linux-x64-musl@2.5.0': - optional: true - - '@parcel/watcher-wasm@2.5.0': - dependencies: - is-glob: 4.0.3 - micromatch: 4.0.8 - - '@parcel/watcher-win32-arm64@2.5.0': - optional: true - - '@parcel/watcher-win32-ia32@2.5.0': - optional: true - - '@parcel/watcher-win32-x64@2.5.0': - optional: true - - '@parcel/watcher@2.5.0': - dependencies: - detect-libc: 1.0.3 - is-glob: 4.0.3 - micromatch: 4.0.8 - node-addon-api: 7.1.1 - optionalDependencies: - '@parcel/watcher-android-arm64': 2.5.0 - '@parcel/watcher-darwin-arm64': 2.5.0 - '@parcel/watcher-darwin-x64': 2.5.0 - '@parcel/watcher-freebsd-x64': 2.5.0 - '@parcel/watcher-linux-arm-glibc': 2.5.0 - '@parcel/watcher-linux-arm-musl': 2.5.0 - '@parcel/watcher-linux-arm64-glibc': 2.5.0 - '@parcel/watcher-linux-arm64-musl': 2.5.0 - '@parcel/watcher-linux-x64-glibc': 2.5.0 - '@parcel/watcher-linux-x64-musl': 2.5.0 - '@parcel/watcher-win32-arm64': 2.5.0 - '@parcel/watcher-win32-ia32': 2.5.0 - '@parcel/watcher-win32-x64': 2.5.0 - - '@peculiar/asn1-schema@2.3.13': - dependencies: - asn1js: 3.0.5 - pvtsutils: 1.3.6 - tslib: 2.8.1 - - '@peculiar/json-schema@1.1.12': - dependencies: - tslib: 2.8.1 - - '@peculiar/webcrypto@1.5.0': - dependencies: - '@peculiar/asn1-schema': 2.3.13 - '@peculiar/json-schema': 1.1.12 - pvtsutils: 1.3.6 - tslib: 2.8.1 - webcrypto-core: 1.8.1 - - '@phala/dstack-sdk@0.1.6(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)': - optionalDependencies: - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - - zod - '@pkgjs/parseargs@0.11.0': optional: true @@ -23557,10 +20189,6 @@ snapshots: '@remusao/trie@1.5.0': {} - '@rollup/plugin-alias@5.1.1(rollup@3.29.5)': - optionalDependencies: - rollup: 3.29.5 - '@rollup/plugin-commonjs@25.0.8(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 5.1.3(rollup@2.79.2) @@ -23572,35 +20200,12 @@ snapshots: optionalDependencies: rollup: 2.79.2 - '@rollup/plugin-commonjs@25.0.8(rollup@3.29.5)': - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - commondir: 1.0.1 - estree-walker: 2.0.2 - glob: 8.1.0 - is-reference: 1.2.1 - magic-string: 0.30.15 - optionalDependencies: - rollup: 3.29.5 - '@rollup/plugin-json@6.1.0(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 5.1.3(rollup@2.79.2) optionalDependencies: rollup: 2.79.2 - '@rollup/plugin-json@6.1.0(rollup@3.29.5)': - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - optionalDependencies: - rollup: 3.29.5 - - '@rollup/plugin-json@6.1.0(rollup@4.28.1)': - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@4.28.1) - optionalDependencies: - rollup: 4.28.1 - '@rollup/plugin-node-resolve@15.3.0(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 5.1.3(rollup@2.79.2) @@ -23611,16 +20216,6 @@ snapshots: optionalDependencies: rollup: 2.79.2 - '@rollup/plugin-node-resolve@15.3.0(rollup@3.29.5)': - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - '@types/resolve': 1.20.2 - deepmerge: 4.3.1 - is-module: 1.0.0 - resolve: 1.22.9 - optionalDependencies: - rollup: 3.29.5 - '@rollup/plugin-replace@5.0.7(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 5.1.3(rollup@2.79.2) @@ -23628,13 +20223,6 @@ snapshots: optionalDependencies: rollup: 2.79.2 - '@rollup/plugin-replace@5.0.7(rollup@3.29.5)': - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - magic-string: 0.30.15 - optionalDependencies: - rollup: 3.29.5 - '@rollup/plugin-terser@0.1.0(rollup@2.79.2)': dependencies: terser: 5.37.0 @@ -23662,22 +20250,6 @@ snapshots: optionalDependencies: rollup: 2.79.2 - '@rollup/pluginutils@5.1.3(rollup@3.29.5)': - dependencies: - '@types/estree': 1.0.6 - estree-walker: 2.0.2 - picomatch: 4.0.2 - optionalDependencies: - rollup: 3.29.5 - - '@rollup/pluginutils@5.1.3(rollup@4.28.1)': - dependencies: - '@types/estree': 1.0.6 - estree-walker: 2.0.2 - picomatch: 4.0.2 - optionalDependencies: - rollup: 4.28.1 - '@rollup/rollup-android-arm-eabi@4.28.1': optional: true @@ -23767,11 +20339,6 @@ snapshots: '@noble/hashes': 1.5.0 '@scure/base': 1.1.9 - '@scure/starknet@1.0.0': - dependencies: - '@noble/curves': 1.3.0 - '@noble/hashes': 1.3.3 - '@selderee/plugin-htmlparser2@0.11.0': dependencies: domhandler: 5.0.3 @@ -23852,8 +20419,6 @@ snapshots: '@sindresorhus/is@5.6.0': {} - '@sindresorhus/merge-streams@2.3.0': {} - '@sinonjs/commons@3.0.1': dependencies: type-detect: 4.0.8 @@ -24205,175 +20770,10 @@ snapshots: '@smithy/types': 3.7.2 tslib: 2.8.1 - '@solana/buffer-layout-utils@0.2.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': - dependencies: - '@solana/buffer-layout': 4.0.1 - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - bigint-buffer: 1.1.5 - bignumber.js: 9.1.2 - transitivePeerDependencies: - - bufferutil - - encoding - - utf-8-validate - '@solana/buffer-layout@4.0.1': dependencies: buffer: 6.0.3 - '@solana/codecs-core@2.0.0-preview.2': - dependencies: - '@solana/errors': 2.0.0-preview.2 - - '@solana/codecs-core@2.0.0-rc.1(typescript@5.6.3)': - dependencies: - '@solana/errors': 2.0.0-rc.1(typescript@5.6.3) - typescript: 5.6.3 - - '@solana/codecs-data-structures@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - '@solana/errors': 2.0.0-preview.2 - - '@solana/codecs-data-structures@2.0.0-rc.1(typescript@5.6.3)': - dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.6.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.6.3) - typescript: 5.6.3 - - '@solana/codecs-numbers@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/errors': 2.0.0-preview.2 - - '@solana/codecs-numbers@2.0.0-rc.1(typescript@5.6.3)': - dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.6.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.6.3) - typescript: 5.6.3 - - '@solana/codecs-strings@2.0.0-preview.2(fastestsmallesttextencoderdecoder@1.0.22)': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - '@solana/errors': 2.0.0-preview.2 - fastestsmallesttextencoderdecoder: 1.0.22 - - '@solana/codecs-strings@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)': - dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.6.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.6.3) - fastestsmallesttextencoderdecoder: 1.0.22 - typescript: 5.6.3 - - '@solana/codecs@2.0.0-preview.2(fastestsmallesttextencoderdecoder@1.0.22)': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-data-structures': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - '@solana/codecs-strings': 2.0.0-preview.2(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/options': 2.0.0-preview.2 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/codecs@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)': - dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - '@solana/options': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - typescript: 5.6.3 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/errors@2.0.0-preview.2': - dependencies: - chalk: 5.3.0 - commander: 12.1.0 - - '@solana/errors@2.0.0-rc.1(typescript@5.6.3)': - dependencies: - chalk: 5.3.0 - commander: 12.1.0 - typescript: 5.6.3 - - '@solana/options@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - - '@solana/options@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)': - dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.6.3) - '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.6.3) - typescript: 5.6.3 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/spl-token-group@0.0.4(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)': - dependencies: - '@solana/codecs': 2.0.0-preview.2(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/spl-token-group@0.0.7(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)': - dependencies: - '@solana/codecs': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - typescript - - '@solana/spl-token-metadata@0.1.6(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)': - dependencies: - '@solana/codecs': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - typescript - - '@solana/spl-token@0.4.6(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10)': - dependencies: - '@solana/buffer-layout': 4.0.1 - '@solana/buffer-layout-utils': 0.2.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@solana/spl-token-group': 0.0.4(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/spl-token-metadata': 0.1.6(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - buffer: 6.0.3 - transitivePeerDependencies: - - bufferutil - - encoding - - fastestsmallesttextencoderdecoder - - typescript - - utf-8-validate - - '@solana/spl-token@0.4.9(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10)': - dependencies: - '@solana/buffer-layout': 4.0.1 - '@solana/buffer-layout-utils': 0.2.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@solana/spl-token-group': 0.0.7(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - '@solana/spl-token-metadata': 0.1.6(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3) - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - buffer: 6.0.3 - transitivePeerDependencies: - - bufferutil - - encoding - - fastestsmallesttextencoderdecoder - - typescript - - utf-8-validate - - '@solana/spl-type-length-value@0.1.0': - dependencies: - buffer: 6.0.3 - '@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))': dependencies: '@solana/wallet-standard-features': 1.2.0 @@ -24431,130 +20831,6 @@ snapshots: - encoding - utf-8-validate - '@stablelib/aead@1.0.1': {} - - '@stablelib/binary@1.0.1': - dependencies: - '@stablelib/int': 1.0.1 - - '@stablelib/bytes@1.0.1': {} - - '@stablelib/chacha20poly1305@1.0.1': - dependencies: - '@stablelib/aead': 1.0.1 - '@stablelib/binary': 1.0.1 - '@stablelib/chacha': 1.0.1 - '@stablelib/constant-time': 1.0.1 - '@stablelib/poly1305': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/chacha@1.0.1': - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/constant-time@1.0.1': {} - - '@stablelib/ed25519@1.0.3': - dependencies: - '@stablelib/random': 1.0.2 - '@stablelib/sha512': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/hash@1.0.1': {} - - '@stablelib/hkdf@1.0.1': - dependencies: - '@stablelib/hash': 1.0.1 - '@stablelib/hmac': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/hmac@1.0.1': - dependencies: - '@stablelib/constant-time': 1.0.1 - '@stablelib/hash': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/int@1.0.1': {} - - '@stablelib/keyagreement@1.0.1': - dependencies: - '@stablelib/bytes': 1.0.1 - - '@stablelib/poly1305@1.0.1': - dependencies: - '@stablelib/constant-time': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/random@1.0.2': - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/sha256@1.0.1': - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/hash': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/sha512@1.0.1': - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/hash': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/wipe@1.0.1': {} - - '@stablelib/x25519@1.0.3': - dependencies: - '@stablelib/keyagreement': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/wipe': 1.0.1 - - '@starknet-io/types-js@0.7.10': {} - - '@supabase/auth-js@2.65.1': - dependencies: - '@supabase/node-fetch': 2.6.15 - - '@supabase/functions-js@2.4.3': - dependencies: - '@supabase/node-fetch': 2.6.15 - - '@supabase/node-fetch@2.6.15': - dependencies: - whatwg-url: 5.0.0 - - '@supabase/postgrest-js@1.16.3': - dependencies: - '@supabase/node-fetch': 2.6.15 - - '@supabase/realtime-js@2.10.9(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@supabase/node-fetch': 2.6.15 - '@types/phoenix': 1.6.6 - '@types/ws': 8.5.13 - ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@supabase/storage-js@2.7.1': - dependencies: - '@supabase/node-fetch': 2.6.15 - - '@supabase/supabase-js@2.46.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@supabase/auth-js': 2.65.1 - '@supabase/functions-js': 2.4.3 - '@supabase/node-fetch': 2.6.15 - '@supabase/postgrest-js': 1.16.3 - '@supabase/realtime-js': 2.10.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@supabase/storage-js': 2.7.1 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - '@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -24705,10 +20981,6 @@ snapshots: dependencies: '@swc/counter': 0.1.3 - '@szmarczak/http-timer@4.0.6': - dependencies: - defer-to-connect: 2.0.1 - '@szmarczak/http-timer@5.0.1': dependencies: defer-to-connect: 2.0.1 @@ -24720,8 +20992,6 @@ snapshots: '@tanstack/query-core': 5.60.6 react: 18.3.1 - '@telegraf/types@7.1.0': {} - '@tinyhttp/content-disposition@2.2.2': {} '@tootallnate/quickjs-emscripten@0.23.0': {} @@ -24793,13 +21063,6 @@ snapshots: dependencies: '@types/node': 20.17.9 - '@types/cacheable-request@6.0.3': - dependencies: - '@types/http-cache-semantics': 4.0.4 - '@types/keyv': 3.1.4 - '@types/node': 20.17.9 - '@types/responselike': 1.0.3 - '@types/chrome@0.0.278': dependencies: '@types/filesystem': 0.0.36 @@ -24941,16 +21204,6 @@ snapshots: '@types/diff-match-patch@1.0.36': {} - '@types/dompurify@3.2.0': - dependencies: - dompurify: 3.2.2 - - '@types/elliptic@6.4.18': - dependencies: - '@types/bn.js': 5.1.6 - - '@types/emscripten@1.39.13': {} - '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 9.6.1 @@ -25015,11 +21268,6 @@ snapshots: '@types/geojson@7946.0.15': {} - '@types/glob@8.1.0': - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 20.17.9 - '@types/graceful-fs@4.1.9': dependencies: '@types/node': 20.17.9 @@ -25070,14 +21318,6 @@ snapshots: '@types/node': 20.17.9 optional: true - '@types/jsonwebtoken@9.0.7': - dependencies: - '@types/node': 20.17.9 - - '@types/keyv@3.1.4': - dependencies: - '@types/node': 20.17.9 - '@types/lodash@4.17.13': {} '@types/mdast@4.0.4': @@ -25090,8 +21330,6 @@ snapshots: '@types/minimatch@3.0.5': {} - '@types/minimatch@5.1.2': {} - '@types/minimist@1.2.5': {} '@types/mocha@10.0.10': {} @@ -25150,8 +21388,6 @@ snapshots: pg-protocol: 1.7.0 pg-types: 4.0.2 - '@types/phoenix@1.6.6': {} - '@types/prismjs@1.26.5': {} '@types/prop-types@15.7.14': {} @@ -25188,10 +21424,6 @@ snapshots: '@types/resolve@1.20.2': {} - '@types/responselike@1.0.3': - dependencies: - '@types/node': 20.17.9 - '@types/retry@0.12.0': {} '@types/sax@1.2.7': @@ -25217,11 +21449,6 @@ snapshots: dependencies: '@types/node': 20.17.9 - '@types/sql.js@1.4.9': - dependencies: - '@types/emscripten': 1.39.13 - '@types/node': 20.17.9 - '@types/stack-utils@2.0.3': {} '@types/tar@6.1.13': @@ -25229,7 +21456,8 @@ snapshots: '@types/node': 20.17.9 minipass: 4.2.8 - '@types/trusted-types@2.0.7': {} + '@types/trusted-types@2.0.7': + optional: true '@types/unist@2.0.11': {} @@ -25476,33 +21704,6 @@ snapshots: '@ungap/structured-clone@1.2.1': {} - '@uniswap/sdk-core@4.2.1': - dependencies: - '@ethersproject/address': 5.7.0 - big.js: 5.2.2 - decimal.js-light: 2.5.1 - jsbi: 3.2.5 - tiny-invariant: 1.3.3 - toformat: 2.0.0 - - '@uniswap/sdk-core@6.0.0': - dependencies: - '@ethersproject/address': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/strings': 5.7.0 - big.js: 5.2.2 - decimal.js-light: 2.5.1 - jsbi: 3.2.5 - tiny-invariant: 1.3.3 - toformat: 2.0.0 - - '@unruggable_starknet/core@0.1.0(starknet@6.18.0(encoding@0.1.13))': - dependencies: - '@uniswap/sdk-core': 4.2.1 - moment: 2.30.1 - starknet: 6.18.0(encoding@0.1.13) - '@vitejs/plugin-react@4.3.3(vite@client+@tanstack+router-plugin+vite)': dependencies: '@babel/core': 7.26.0 @@ -25540,13 +21741,6 @@ snapshots: typescript: 5.6.3 vitest: 2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) - '@vitest/expect@2.1.4': - dependencies: - '@vitest/spy': 2.1.4 - '@vitest/utils': 2.1.4 - chai: 5.1.2 - tinyrainbow: 1.2.0 - '@vitest/expect@2.1.5': dependencies: '@vitest/spy': 2.1.5 @@ -25554,14 +21748,6 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.4(vite@5.4.11(@types/node@22.8.4)(terser@5.37.0))': - dependencies: - '@vitest/spy': 2.1.4 - estree-walker: 3.0.3 - magic-string: 0.30.15 - optionalDependencies: - vite: 5.4.11(@types/node@22.8.4)(terser@5.37.0) - '@vitest/mocker@2.1.5(vite@5.4.11(@types/node@22.8.4)(terser@5.37.0))': dependencies: '@vitest/spy': 2.1.5 @@ -25570,10 +21756,6 @@ snapshots: optionalDependencies: vite: 5.4.11(@types/node@22.8.4)(terser@5.37.0) - '@vitest/pretty-format@2.1.4': - dependencies: - tinyrainbow: 1.2.0 - '@vitest/pretty-format@2.1.5': dependencies: tinyrainbow: 1.2.0 @@ -25582,42 +21764,21 @@ snapshots: dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.1.4': - dependencies: - '@vitest/utils': 2.1.4 - pathe: 1.1.2 - '@vitest/runner@2.1.5': dependencies: '@vitest/utils': 2.1.5 pathe: 1.1.2 - '@vitest/snapshot@2.1.4': - dependencies: - '@vitest/pretty-format': 2.1.4 - magic-string: 0.30.15 - pathe: 1.1.2 - '@vitest/snapshot@2.1.5': dependencies: '@vitest/pretty-format': 2.1.5 magic-string: 0.30.15 pathe: 1.1.2 - '@vitest/spy@2.1.4': - dependencies: - tinyspy: 3.0.2 - '@vitest/spy@2.1.5': dependencies: tinyspy: 3.0.2 - '@vitest/utils@2.1.4': - dependencies: - '@vitest/pretty-format': 2.1.4 - loupe: 3.1.2 - tinyrainbow: 1.2.0 - '@vitest/utils@2.1.5': dependencies: '@vitest/pretty-format': 2.1.5 @@ -25686,251 +21847,6 @@ snapshots: dependencies: '@wallet-standard/base': 1.1.0 - '@walletconnect/core@2.17.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@walletconnect/heartbeat': 1.2.2 - '@walletconnect/jsonrpc-provider': 1.0.14 - '@walletconnect/jsonrpc-types': 1.0.4 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/jsonrpc-ws-connection': 1.0.14(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@walletconnect/keyvaluestorage': 1.1.1 - '@walletconnect/logger': 2.1.2 - '@walletconnect/relay-api': 1.0.11 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.2 - '@walletconnect/utils': 2.17.2 - '@walletconnect/window-getters': 1.0.1 - events: 3.3.0 - lodash.isequal: 4.5.0 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - ioredis - - utf-8-validate - - '@walletconnect/environment@1.0.1': - dependencies: - tslib: 1.14.1 - - '@walletconnect/events@1.0.1': - dependencies: - keyvaluestorage-interface: 1.0.0 - tslib: 1.14.1 - - '@walletconnect/heartbeat@1.2.2': - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/time': 1.0.2 - events: 3.3.0 - - '@walletconnect/jsonrpc-provider@1.0.14': - dependencies: - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/safe-json': 1.0.2 - events: 3.3.0 - - '@walletconnect/jsonrpc-types@1.0.4': - dependencies: - events: 3.3.0 - keyvaluestorage-interface: 1.0.0 - - '@walletconnect/jsonrpc-utils@1.0.8': - dependencies: - '@walletconnect/environment': 1.0.1 - '@walletconnect/jsonrpc-types': 1.0.4 - tslib: 1.14.1 - - '@walletconnect/jsonrpc-ws-connection@1.0.14(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/safe-json': 1.0.2 - events: 3.3.0 - ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@walletconnect/keyvaluestorage@1.1.1': - dependencies: - '@walletconnect/safe-json': 1.0.2 - idb-keyval: 6.2.1 - unstorage: 1.13.1(idb-keyval@6.2.1) - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@upstash/redis' - - '@vercel/kv' - - ioredis - - '@walletconnect/logger@2.1.2': - dependencies: - '@walletconnect/safe-json': 1.0.2 - pino: 7.11.0 - - '@walletconnect/modal-core@2.7.0(@types/react@18.3.12)(react@18.3.1)': - dependencies: - valtio: 1.11.2(@types/react@18.3.12)(react@18.3.1) - transitivePeerDependencies: - - '@types/react' - - react - - '@walletconnect/modal-ui@2.7.0(@types/react@18.3.12)(react@18.3.1)': - dependencies: - '@walletconnect/modal-core': 2.7.0(@types/react@18.3.12)(react@18.3.1) - lit: 2.8.0 - motion: 10.16.2 - qrcode: 1.5.3 - transitivePeerDependencies: - - '@types/react' - - react - - '@walletconnect/modal@2.7.0(@types/react@18.3.12)(react@18.3.1)': - dependencies: - '@walletconnect/modal-core': 2.7.0(@types/react@18.3.12)(react@18.3.1) - '@walletconnect/modal-ui': 2.7.0(@types/react@18.3.12)(react@18.3.1) - transitivePeerDependencies: - - '@types/react' - - react - - '@walletconnect/relay-api@1.0.11': - dependencies: - '@walletconnect/jsonrpc-types': 1.0.4 - - '@walletconnect/relay-auth@1.0.4': - dependencies: - '@stablelib/ed25519': 1.0.3 - '@stablelib/random': 1.0.2 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - tslib: 1.14.1 - uint8arrays: 3.1.0 - - '@walletconnect/safe-json@1.0.2': - dependencies: - tslib: 1.14.1 - - '@walletconnect/sign-client@2.17.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@walletconnect/core': 2.17.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.2 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/logger': 2.1.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.2 - '@walletconnect/utils': 2.17.2 - events: 3.3.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - ioredis - - utf-8-validate - - '@walletconnect/time@1.0.2': - dependencies: - tslib: 1.14.1 - - '@walletconnect/types@2.17.2': - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.2 - '@walletconnect/jsonrpc-types': 1.0.4 - '@walletconnect/keyvaluestorage': 1.1.1 - '@walletconnect/logger': 2.1.2 - events: 3.3.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - ioredis - - '@walletconnect/utils@2.17.2': - dependencies: - '@ethersproject/hash': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/keyvaluestorage': 1.1.1 - '@walletconnect/relay-api': 1.0.11 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.2 - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - elliptic: 6.6.0 - query-string: 7.1.3 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - ioredis - - '@walletconnect/window-getters@1.0.1': - dependencies: - tslib: 1.14.1 - - '@walletconnect/window-metadata@1.0.1': - dependencies: - '@walletconnect/window-getters': 1.0.1 - tslib: 1.14.1 - '@webassemblyjs/ast@1.14.1': dependencies: '@webassemblyjs/helper-numbers': 1.13.2 @@ -26031,13 +21947,6 @@ snapshots: abbrev@2.0.0: {} - abi-wan-kanabi@2.2.4: - dependencies: - ansicolors: 0.3.2 - cardinal: 2.1.1 - fs-extra: 10.1.0 - yargs: 17.7.2 - abitype@1.0.6(typescript@5.6.3)(zod@3.23.8): optionalDependencies: typescript: 5.6.3 @@ -26259,8 +22168,6 @@ snapshots: ansi-styles@6.2.1: {} - ansicolors@0.3.2: {} - anthropic-vertex-ai@1.0.2(encoding@0.1.13)(zod@3.23.8): dependencies: '@ai-sdk/provider': 0.0.24 @@ -26284,8 +22191,6 @@ snapshots: aproba@2.0.0: {} - are-docs-informative@0.0.2: {} - are-we-there-yet@2.0.0: dependencies: delegates: 1.0.0 @@ -26336,12 +22241,6 @@ snapshots: dependencies: safer-buffer: 2.1.2 - asn1js@3.0.5: - dependencies: - pvtsutils: 1.3.6 - pvutils: 1.1.3 - tslib: 2.8.1 - assert-plus@1.0.0: {} assert@1.5.1: @@ -26373,35 +22272,10 @@ snapshots: at-least-node@1.0.0: {} - atomic-sleep@1.0.0: {} - autocomplete.js@0.37.1: dependencies: immediate: 3.3.0 - automd@0.3.12(magicast@0.3.5): - dependencies: - '@parcel/watcher': 2.5.0 - c12: 2.0.1(magicast@0.3.5) - citty: 0.1.6 - consola: 3.2.3 - defu: 6.1.4 - destr: 2.0.3 - didyoumean2: 7.0.4 - globby: 14.0.2 - magic-string: 0.30.15 - mdbox: 0.1.1 - mlly: 1.7.3 - ofetch: 1.4.1 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.2.1 - scule: 1.3.0 - untyped: 1.5.1 - transitivePeerDependencies: - - magicast - - supports-color - autoprefixer@10.4.20(postcss@8.4.49): dependencies: browserslist: 4.24.3 @@ -26438,22 +22312,6 @@ snapshots: transitivePeerDependencies: - debug - axios@1.7.4: - dependencies: - follow-redirects: 1.15.9(debug@4.4.0) - form-data: 4.0.1 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - axios@1.7.7: - dependencies: - follow-redirects: 1.15.9(debug@4.4.0) - form-data: 4.0.1 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - axios@1.7.8(debug@4.4.0): dependencies: follow-redirects: 1.15.9(debug@4.4.0) @@ -26649,8 +22507,6 @@ snapshots: base-x@5.0.0: {} - base64-arraybuffer@0.2.0: {} - base64-js@1.5.1: {} base64url@3.0.1: {} @@ -26804,16 +22660,6 @@ snapshots: boolbase@1.0.0: {} - borc@2.1.2: - dependencies: - bignumber.js: 9.1.2 - buffer: 5.7.1 - commander: 2.20.3 - ieee754: 1.2.1 - iso-url: 0.4.7 - json-text-sequence: 0.1.1 - readable-stream: 3.6.2 - borsh@0.6.0: dependencies: bn.js: 5.2.1 @@ -26869,8 +22715,6 @@ snapshots: brorand@1.1.0: {} - browser-headers@0.4.1: {} - browser-pack@6.1.0: dependencies: JSONStream: 1.3.5 @@ -27033,8 +22877,6 @@ snapshots: buffer-from@1.1.2: {} - buffer-layout@1.2.2: {} - buffer-more-ints@1.0.0: {} buffer-xor@1.0.3: {} @@ -27058,8 +22900,6 @@ snapshots: dependencies: node-gyp-build: 4.8.4 - builtin-modules@3.3.0: {} - builtin-status-codes@3.0.0: {} bundle-require@5.0.0(esbuild@0.24.0): @@ -27071,16 +22911,6 @@ snapshots: dependencies: streamsearch: 1.1.0 - buttplug@3.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): - dependencies: - class-transformer: 0.5.1 - eventemitter3: 5.0.1 - reflect-metadata: 0.2.2 - ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - byte-size@8.1.1: {} bytes@3.0.0: {} @@ -27089,23 +22919,6 @@ snapshots: bytesish@0.4.4: {} - c12@2.0.1(magicast@0.3.5): - dependencies: - chokidar: 4.0.1 - confbox: 0.1.8 - defu: 6.1.4 - dotenv: 16.4.5 - giget: 1.2.3 - jiti: 2.4.0 - mlly: 1.7.3 - ohash: 1.1.4 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.2.1 - rc9: 2.1.2 - optionalDependencies: - magicast: 0.3.5 - cac@6.7.14: {} cacache@18.0.4: @@ -27123,8 +22936,6 @@ snapshots: tar: 6.2.1 unique-filename: 3.0.0 - cacheable-lookup@5.0.4: {} - cacheable-lookup@7.0.0: {} cacheable-request@10.2.14: @@ -27137,16 +22948,6 @@ snapshots: normalize-url: 8.0.1 responselike: 3.0.0 - cacheable-request@7.0.4: - dependencies: - clone-response: 1.0.3 - get-stream: 5.2.0 - http-cache-semantics: 4.1.1 - keyv: 4.5.4 - lowercase-keys: 2.0.0 - normalize-url: 6.1.0 - responselike: 2.0.1 - cached-path-relative@1.1.0: {} call-bind-apply-helpers@1.0.1: @@ -27222,11 +23023,6 @@ snapshots: transitivePeerDependencies: - debug - cardinal@2.1.1: - dependencies: - ansicolors: 0.3.2 - redeyed: 2.1.1 - caseless@0.12.0: {} ccount@2.0.1: {} @@ -27353,27 +23149,8 @@ snapshots: inherits: 2.0.4 safe-buffer: 5.2.1 - citty@0.1.6: - dependencies: - consola: 3.2.3 - - cive@0.7.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10): - dependencies: - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 - '@scure/bip32': 1.6.0 - '@scure/bip39': 1.4.0 - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - zod: 3.23.8 - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - cjs-module-lexer@1.4.1: {} - class-transformer@0.5.1: {} - class-variance-authority@0.7.1: dependencies: clsx: 2.1.1 @@ -27421,18 +23198,6 @@ snapshots: client-only@0.0.1: {} - clipboardy@4.0.0: - dependencies: - execa: 8.0.1 - is-wsl: 3.1.0 - is64bit: 2.0.0 - - cliui@6.0.0: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - cliui@7.0.4: dependencies: string-width: 4.2.3 @@ -27459,10 +23224,6 @@ snapshots: kind-of: 6.0.3 shallow-clone: 3.0.1 - clone-response@1.0.3: - dependencies: - mimic-response: 1.0.1 - clone@1.0.4: {} clone@2.1.2: {} @@ -27493,18 +23254,6 @@ snapshots: co@4.6.0: {} - coinbase-api@1.0.5(bufferutil@4.0.8)(utf-8-validate@5.0.10): - dependencies: - axios: 1.7.8(debug@4.4.0) - isomorphic-ws: 4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - jsonwebtoken: 9.0.2 - nanoid: 3.3.8 - ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - collapse-white-space@2.1.0: {} collect-v8-coverage@1.0.2: {} @@ -27571,8 +23320,6 @@ snapshots: commander@8.3.0: {} - comment-parser@1.4.1: {} - common-ancestor-path@1.0.1: {} common-path-prefix@3.0.0: {} @@ -27584,8 +23331,6 @@ snapshots: array-ify: 1.0.0 dot-prop: 5.3.0 - compare-versions@4.1.4: {} - complex.js@2.4.2: {} compressible@2.0.18: @@ -27626,17 +23371,6 @@ snapshots: readable-stream: 3.6.2 typedarray: 0.0.6 - concurrently@6.5.1: - dependencies: - chalk: 4.1.2 - date-fns: 2.30.0 - lodash: 4.17.21 - rxjs: 6.6.7 - spawn-command: 0.0.2 - supports-color: 8.1.1 - tree-kill: 1.2.2 - yargs: 16.2.0 - concurrently@9.1.0: dependencies: chalk: 4.1.2 @@ -27664,18 +23398,12 @@ snapshots: connect-history-api-fallback@2.0.0: {} - consola@2.15.3: {} - consola@3.2.3: {} console-browserify@1.2.0: {} console-control-strings@1.1.0: {} - console.table@0.10.0: - dependencies: - easy-table: 1.1.0 - consolidated-events@2.0.2: {} constants-browserify@1.0.0: {} @@ -27761,8 +23489,6 @@ snapshots: convert-source-map@2.0.0: {} - cookie-es@1.2.2: {} - cookie-signature@1.0.6: {} cookie@0.7.1: {} @@ -27859,21 +23585,6 @@ snapshots: safe-buffer: 5.2.1 sha.js: 2.4.11 - create-jest@29.7.0(@types/node@20.17.9): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.17.9)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - create-jest@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)): dependencies: '@jest/types': 29.6.3 @@ -27909,22 +23620,12 @@ snapshots: transitivePeerDependencies: - encoding - cross-fetch@4.0.0(encoding@0.1.13): - dependencies: - node-fetch: 2.7.0(encoding@0.1.13) - transitivePeerDependencies: - - encoding - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - crossws@0.3.1: - dependencies: - uncrypto: 0.1.3 - crypto-browserify@3.12.1: dependencies: browserify-cipher: 1.0.1 @@ -27940,8 +23641,6 @@ snapshots: randombytes: 2.1.0 randomfill: 1.0.4 - crypto-hash@1.3.0: {} - crypto-random-string@4.0.0: dependencies: type-fest: 1.4.0 @@ -28070,60 +23769,16 @@ snapshots: postcss-svgo: 6.0.3(postcss@8.4.49) postcss-unique-selectors: 6.0.4(postcss@8.4.49) - cssnano-preset-default@7.0.6(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - css-declaration-sorter: 7.2.0(postcss@8.4.49) - cssnano-utils: 5.0.0(postcss@8.4.49) - postcss: 8.4.49 - postcss-calc: 10.0.2(postcss@8.4.49) - postcss-colormin: 7.0.2(postcss@8.4.49) - postcss-convert-values: 7.0.4(postcss@8.4.49) - postcss-discard-comments: 7.0.3(postcss@8.4.49) - postcss-discard-duplicates: 7.0.1(postcss@8.4.49) - postcss-discard-empty: 7.0.0(postcss@8.4.49) - postcss-discard-overridden: 7.0.0(postcss@8.4.49) - postcss-merge-longhand: 7.0.4(postcss@8.4.49) - postcss-merge-rules: 7.0.4(postcss@8.4.49) - postcss-minify-font-values: 7.0.0(postcss@8.4.49) - postcss-minify-gradients: 7.0.0(postcss@8.4.49) - postcss-minify-params: 7.0.2(postcss@8.4.49) - postcss-minify-selectors: 7.0.4(postcss@8.4.49) - postcss-normalize-charset: 7.0.0(postcss@8.4.49) - postcss-normalize-display-values: 7.0.0(postcss@8.4.49) - postcss-normalize-positions: 7.0.0(postcss@8.4.49) - postcss-normalize-repeat-style: 7.0.0(postcss@8.4.49) - postcss-normalize-string: 7.0.0(postcss@8.4.49) - postcss-normalize-timing-functions: 7.0.0(postcss@8.4.49) - postcss-normalize-unicode: 7.0.2(postcss@8.4.49) - postcss-normalize-url: 7.0.0(postcss@8.4.49) - postcss-normalize-whitespace: 7.0.0(postcss@8.4.49) - postcss-ordered-values: 7.0.1(postcss@8.4.49) - postcss-reduce-initial: 7.0.2(postcss@8.4.49) - postcss-reduce-transforms: 7.0.0(postcss@8.4.49) - postcss-svgo: 7.0.1(postcss@8.4.49) - postcss-unique-selectors: 7.0.3(postcss@8.4.49) - cssnano-utils@4.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 - cssnano-utils@5.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - cssnano@6.1.2(postcss@8.4.49): dependencies: cssnano-preset-default: 6.1.2(postcss@8.4.49) lilconfig: 3.1.3 postcss: 8.4.49 - cssnano@7.0.6(postcss@8.4.49): - dependencies: - cssnano-preset-default: 7.0.6(postcss@8.4.49) - lilconfig: 3.1.3 - postcss: 8.4.49 - csso@5.0.5: dependencies: css-tree: 2.2.1 @@ -28352,10 +24007,6 @@ snapshots: whatwg-mimetype: 4.0.0 whatwg-url: 14.1.0 - date-fns@2.30.0: - dependencies: - '@babel/runtime': 7.26.0 - dateformat@3.0.3: {} dayjs@1.11.13: {} @@ -28411,16 +24062,12 @@ snapshots: decamelize@5.0.1: {} - decimal.js-light@2.5.1: {} - decimal.js@10.4.3: {} decode-named-character-reference@1.0.2: dependencies: character-entities: 2.0.2 - decode-uri-component@0.2.2: {} - decompress-response@4.2.1: dependencies: mimic-response: 2.1.0 @@ -28466,8 +24113,6 @@ snapshots: defined@1.0.1: {} - defu@6.1.4: {} - degenerator@5.0.1: dependencies: ast-types: 0.13.4 @@ -28495,14 +24140,10 @@ snapshots: delegates@1.0.0: {} - delimit-stream@0.1.0: {} - depd@1.1.2: {} depd@2.0.0: {} - dependency-graph@0.11.0: {} - deprecation@2.3.1: {} deps-sort@2.0.1: @@ -28519,16 +24160,10 @@ snapshots: inherits: 2.0.4 minimalistic-assert: 1.0.1 - destr@2.0.3: {} - destroy@1.2.0: {} - detect-browser@5.3.0: {} - detect-indent@5.0.0: {} - detect-libc@1.0.3: {} - detect-libc@2.0.3: {} detect-newline@3.1.0: {} @@ -28563,12 +24198,6 @@ snapshots: devtools-protocol@0.0.1107588: {} - didyoumean2@7.0.4: - dependencies: - '@babel/runtime': 7.26.0 - fastest-levenshtein: 1.0.16 - lodash.deburr: 4.1.0 - didyoumean@1.2.2: {} diff-match-patch@1.0.5: {} @@ -28583,8 +24212,6 @@ snapshots: miller-rabin: 4.0.1 randombytes: 2.1.0 - dijkstrajs@1.0.3: {} - dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -28621,10 +24248,6 @@ snapshots: dependencies: '@leichtgewicht/ip-codec': 2.0.5 - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - docusaurus-lunr-search@3.5.0(@docusaurus/core@3.6.3(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.3.1))(@swc/core@1.10.1(@swc/helpers@0.5.15))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.16.0(jiti@2.4.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@docusaurus/core': 3.6.3(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.3.1))(@swc/core@1.10.1(@swc/helpers@0.5.15))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.16.0(jiti@2.4.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -28726,19 +24349,8 @@ snapshots: duplexer@0.1.2: {} - duplexify@4.1.3: - dependencies: - end-of-stream: 1.4.4 - inherits: 2.0.4 - readable-stream: 3.6.2 - stream-shift: 1.0.3 - eastasianwidth@0.2.0: {} - easy-table@1.1.0: - optionalDependencies: - wcwidth: 1.0.1 - ecc-jsbn@0.1.2: dependencies: jsbn: 0.1.1 @@ -28820,26 +24432,6 @@ snapshots: electron-to-chromium@1.5.73: {} - elliptic@6.5.4: - dependencies: - bn.js: 4.12.1 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - - elliptic@6.6.0: - dependencies: - bn.js: 4.12.1 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - elliptic@6.6.1: dependencies: bn.js: 4.12.1 @@ -28866,8 +24458,6 @@ snapshots: emoticon@4.1.0: {} - encode-utf8@1.0.3: {} - encodeurl@1.0.2: {} encodeurl@2.0.0: {} @@ -28977,32 +24567,6 @@ snapshots: esbuild: 0.24.0 import-meta-resolve: 3.1.1 - esbuild@0.19.12: - optionalDependencies: - '@esbuild/aix-ppc64': 0.19.12 - '@esbuild/android-arm': 0.19.12 - '@esbuild/android-arm64': 0.19.12 - '@esbuild/android-x64': 0.19.12 - '@esbuild/darwin-arm64': 0.19.12 - '@esbuild/darwin-x64': 0.19.12 - '@esbuild/freebsd-arm64': 0.19.12 - '@esbuild/freebsd-x64': 0.19.12 - '@esbuild/linux-arm': 0.19.12 - '@esbuild/linux-arm64': 0.19.12 - '@esbuild/linux-ia32': 0.19.12 - '@esbuild/linux-loong64': 0.19.12 - '@esbuild/linux-mips64el': 0.19.12 - '@esbuild/linux-ppc64': 0.19.12 - '@esbuild/linux-riscv64': 0.19.12 - '@esbuild/linux-s390x': 0.19.12 - '@esbuild/linux-x64': 0.19.12 - '@esbuild/netbsd-x64': 0.19.12 - '@esbuild/openbsd-x64': 0.19.12 - '@esbuild/sunos-x64': 0.19.12 - '@esbuild/win32-arm64': 0.19.12 - '@esbuild/win32-ia32': 0.19.12 - '@esbuild/win32-x64': 0.19.12 - esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -29088,21 +24652,6 @@ snapshots: dependencies: eslint: 9.16.0(jiti@2.4.0) - eslint-plugin-jsdoc@46.10.1(eslint@8.57.1): - dependencies: - '@es-joy/jsdoccomment': 0.41.0 - are-docs-informative: 0.0.2 - comment-parser: 1.4.1 - debug: 4.4.0(supports-color@5.5.0) - escape-string-regexp: 4.0.0 - eslint: 8.57.1 - esquery: 1.6.0 - is-builtin-module: 3.2.1 - semver: 7.6.3 - spdx-expression-parse: 4.0.0 - transitivePeerDependencies: - - supports-color - eslint-plugin-prettier@5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.4.1): dependencies: eslint: 9.13.0(jiti@2.4.0) @@ -29158,11 +24707,6 @@ snapshots: esrecurse: 4.3.0 estraverse: 4.3.0 - eslint-scope@7.2.2: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - eslint-scope@8.2.0: dependencies: esrecurse: 4.3.0 @@ -29172,49 +24716,6 @@ snapshots: eslint-visitor-keys@4.2.0: {} - eslint@8.57.1: - dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) - '@eslint-community/regexpp': 4.12.1 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.1 - '@humanwhocodes/config-array': 0.13.0 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.1 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.6 - debug: 4.4.0(supports-color@5.5.0) - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.6.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - eslint@9.13.0(jiti@2.4.0): dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.13.0(jiti@2.4.0)) @@ -29330,12 +24831,6 @@ snapshots: acorn-jsx: 5.3.2(acorn@8.14.0) eslint-visitor-keys: 4.2.0 - espree@9.6.1: - dependencies: - acorn: 8.14.0 - acorn-jsx: 5.3.2(acorn@8.14.0) - eslint-visitor-keys: 3.4.3 - esprima@4.0.1: {} esquery@1.6.0: @@ -29592,8 +25087,6 @@ snapshots: fast-levenshtein@2.0.6: {} - fast-redact@3.5.0: {} - fast-safe-stringify@2.1.1: {} fast-stable-stringify@1.0.0: {} @@ -29611,8 +25104,6 @@ snapshots: progress: 2.0.3 tar: 6.2.1 - fastest-levenshtein@1.0.16: {} - fastestsmallesttextencoderdecoder@1.0.22: {} fastq@1.17.1: @@ -29650,11 +25141,6 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 - fetch-cookie@3.0.1: - dependencies: - set-cookie-parser: 2.7.1 - tough-cookie: 4.1.4 - ffmpeg-static@5.2.0: dependencies: '@derhuerst/http-basic': 8.2.4 @@ -29668,10 +25154,6 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 - file-entry-cache@6.0.1: - dependencies: - flat-cache: 3.2.0 - file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -29700,8 +25182,6 @@ snapshots: dependencies: to-regex-range: 5.0.1 - filter-obj@1.1.0: {} - finalhandler@1.3.1: dependencies: debug: 2.6.9 @@ -29747,12 +25227,6 @@ snapshots: semver-regex: 4.0.5 super-regex: 1.0.0 - flat-cache@3.2.0: - dependencies: - flatted: 3.3.2 - keyv: 4.5.4 - rimraf: 3.0.2 - flat-cache@4.0.1: dependencies: flatted: 3.3.2 @@ -29857,12 +25331,6 @@ snapshots: fs-constants@1.0.0: {} - fs-extra@10.1.0: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.1 - fs-extra@11.2.0: dependencies: graceful-fs: 4.2.11 @@ -29996,12 +25464,8 @@ snapshots: through2: 2.0.5 yargs: 16.2.0 - get-port-please@3.1.2: {} - get-port@5.1.1: {} - get-stdin@9.0.0: {} - get-stream@5.2.0: dependencies: pump: 3.0.2 @@ -30034,17 +25498,6 @@ snapshots: multi-integer-range: 3.0.0 save-pixels-jpeg-js-upgrade: 2.3.4-jpeg-js-upgrade.0 - giget@1.2.3: - dependencies: - citty: 0.1.6 - consola: 3.2.3 - defu: 6.1.4 - node-fetch-native: 1.6.4 - nypm: 0.3.12 - ohash: 1.1.4 - pathe: 1.1.2 - tar: 6.2.1 - git-node-fs@1.0.0(js-git@0.7.8): optionalDependencies: js-git: 0.7.8 @@ -30164,10 +25617,6 @@ snapshots: globals@11.12.0: {} - globals@13.24.0: - dependencies: - type-fest: 0.20.2 - globals@14.0.0: {} globals@15.11.0: {} @@ -30193,15 +25642,6 @@ snapshots: merge2: 1.4.1 slash: 4.0.0 - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.2 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - google-auth-library@9.15.0(encoding@0.1.13): dependencies: base64-js: 1.5.1 @@ -30214,24 +25654,8 @@ snapshots: - encoding - supports-color - google-protobuf@3.21.4: {} - gopd@1.2.0: {} - got@11.8.6: - dependencies: - '@sindresorhus/is': 4.6.0 - '@szmarczak/http-timer': 4.0.6 - '@types/cacheable-request': 6.0.3 - '@types/responselike': 1.0.3 - cacheable-lookup: 5.0.4 - cacheable-request: 7.0.4 - decompress-response: 6.0.0 - http2-wrapper: 1.0.3 - lowercase-keys: 2.0.0 - p-cancelable: 2.1.1 - responselike: 2.0.1 - got@12.6.1: dependencies: '@sindresorhus/is': 5.6.0 @@ -30275,19 +25699,6 @@ snapshots: dependencies: duplexer: 0.1.2 - h3@1.13.0: - dependencies: - cookie-es: 1.2.2 - crossws: 0.3.1 - defu: 6.1.4 - destr: 2.0.3 - iron-webcrypto: 1.2.1 - ohash: 1.1.4 - radix3: 1.1.2 - ufo: 1.5.4 - uncrypto: 0.1.3 - unenv: 1.10.0 - hachure-fill@0.5.2: {} handle-thing@2.0.1: {} @@ -30514,8 +25925,6 @@ snapshots: headers-polyfill@3.3.0: {} - hey-listen@1.0.8: {} - history@4.10.1: dependencies: '@babel/runtime': 7.26.0 @@ -30540,8 +25949,6 @@ snapshots: dependencies: react-is: 16.13.1 - hookable@5.5.3: {} - hosted-git-info@2.8.9: {} hosted-git-info@4.1.0: @@ -30695,19 +26102,12 @@ snapshots: dependencies: '@types/node': 10.17.60 - http-shutdown@1.2.2: {} - http-signature@1.2.0: dependencies: assert-plus: 1.0.0 jsprim: 1.4.2 sshpk: 1.18.0 - http2-wrapper@1.0.3: - dependencies: - quick-lru: 5.1.1 - resolve-alpn: 1.2.1 - http2-wrapper@2.2.1: dependencies: quick-lru: 5.1.1 @@ -30758,8 +26158,6 @@ snapshots: dependencies: postcss: 8.4.49 - idb-keyval@6.2.1: {} - ieee754@1.2.1: {} ignore-by-default@1.0.1: {} @@ -30920,8 +26318,6 @@ snapshots: optionalDependencies: '@reflink/reflink': 0.1.19 - iron-webcrypto@1.2.1: {} - is-alphabetical@2.0.1: {} is-alphanumerical@2.0.1: @@ -30946,10 +26342,6 @@ snapshots: is-buffer@2.0.5: {} - is-builtin-module@3.2.1: - dependencies: - builtin-modules: 3.3.0 - is-callable@1.2.7: {} is-ci@3.0.1: @@ -30964,8 +26356,6 @@ snapshots: is-docker@2.2.1: {} - is-docker@3.0.0: {} - is-extendable@0.1.1: {} is-extglob@2.1.1: {} @@ -30990,10 +26380,6 @@ snapshots: is-hexadecimal@2.0.1: {} - is-inside-container@1.0.0: - dependencies: - is-docker: 3.0.0 - is-installed-globally@0.4.0: dependencies: global-dirs: 3.0.1 @@ -31099,16 +26485,8 @@ snapshots: dependencies: is-docker: 2.2.1 - is-wsl@3.1.0: - dependencies: - is-inside-container: 1.0.0 - is-yarn-global@0.4.1: {} - is64bit@2.0.0: - dependencies: - system-architecture: 0.1.0 - isarray@0.0.1: {} isarray@1.0.0: {} @@ -31119,17 +26497,8 @@ snapshots: isexe@3.1.1: {} - iso-url@0.4.7: {} - isobject@3.0.1: {} - isomorphic-fetch@3.0.0(encoding@0.1.13): - dependencies: - node-fetch: 2.7.0(encoding@0.1.13) - whatwg-fetch: 3.6.20 - transitivePeerDependencies: - - encoding - isomorphic-unfetch@3.1.0(encoding@0.1.13): dependencies: node-fetch: 2.7.0(encoding@0.1.13) @@ -31141,10 +26510,6 @@ snapshots: dependencies: ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)): - dependencies: - ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - isows@1.0.6(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -31200,8 +26565,6 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - iterare@1.2.1: {} - jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 @@ -31271,44 +26634,6 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@20.17.9): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.17.9) - exit: 0.1.2 - import-local: 3.2.0 - jest-config: 29.7.0(@types/node@20.17.9)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest-cli@29.7.0(@types/node@22.8.4): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - exit: 0.1.2 - import-local: 3.2.0 - jest-config: 29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - jest-cli@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)): dependencies: '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) @@ -31611,30 +26936,6 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@20.17.9): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - '@jest/types': 29.6.3 - import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@20.17.9) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest@29.7.0(@types/node@22.8.4): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) - '@jest/types': 29.6.3 - import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@22.8.4) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - jest@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)): dependencies: '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) @@ -31651,7 +26952,8 @@ snapshots: jiti@1.21.6: {} - jiti@2.4.0: {} + jiti@2.4.0: + optional: true joi@17.13.3: dependencies: @@ -31665,8 +26967,6 @@ snapshots: jpeg-js@0.3.7: {} - js-base64@3.7.7: {} - js-git@0.7.8: dependencies: bodec: 0.1.0 @@ -31697,14 +26997,10 @@ snapshots: dependencies: argparse: 2.0.1 - jsbi@3.2.5: {} - jsbn@0.1.1: {} jsbn@1.1.0: {} - jsdoc-type-pratt-parser@4.0.0: {} - jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10): dependencies: cssstyle: 4.1.0 @@ -31770,10 +27066,6 @@ snapshots: json-stringify-safe@5.0.1: {} - json-text-sequence@0.1.1: - dependencies: - delimit-stream: 0.1.0 - json5@2.2.3: {} jsonc-parser@3.2.0: {} @@ -31796,19 +27088,6 @@ snapshots: jsonpointer@5.0.1: {} - jsonwebtoken@9.0.2: - dependencies: - jws: 3.2.2 - lodash.includes: 4.3.0 - lodash.isboolean: 3.0.3 - lodash.isinteger: 4.0.4 - lodash.isnumber: 3.0.3 - lodash.isplainobject: 4.0.6 - lodash.isstring: 4.0.1 - lodash.once: 4.1.1 - ms: 2.1.3 - semver: 7.6.3 - jsprim@1.4.2: dependencies: assert-plus: 1.0.0 @@ -31820,30 +27099,17 @@ snapshots: just-diff@6.0.2: {} - jwa@1.4.1: - dependencies: - buffer-equal-constant-time: 1.0.1 - ecdsa-sig-formatter: 1.0.11 - safe-buffer: 5.2.1 - jwa@2.0.0: dependencies: buffer-equal-constant-time: 1.0.1 ecdsa-sig-formatter: 1.0.11 safe-buffer: 5.2.1 - jws@3.2.2: - dependencies: - jwa: 1.4.1 - safe-buffer: 5.2.1 - jws@4.0.0: dependencies: jwa: 2.0.0 safe-buffer: 5.2.1 - jwt-decode@4.0.0: {} - katex@0.16.15: dependencies: commander: 8.3.0 @@ -31858,8 +27124,6 @@ snapshots: dependencies: json-buffer: 3.0.1 - keyvaluestorage-interface@1.0.0: {} - khroma@2.1.0: {} kind-of@2.0.1: @@ -32101,27 +27365,6 @@ snapshots: transitivePeerDependencies: - supports-color - listhen@1.9.0: - dependencies: - '@parcel/watcher': 2.5.0 - '@parcel/watcher-wasm': 2.5.0 - citty: 0.1.6 - clipboardy: 4.0.0 - consola: 3.2.3 - crossws: 0.3.1 - defu: 6.1.4 - get-port-please: 3.1.2 - h3: 1.13.0 - http-shutdown: 1.2.2 - jiti: 2.4.0 - mlly: 1.7.3 - node-forge: 1.3.1 - pathe: 1.1.2 - std-env: 3.8.0 - ufo: 1.5.4 - untun: 0.1.3 - uqr: 0.1.2 - listr2@8.2.5: dependencies: cli-truncate: 4.0.0 @@ -32131,22 +27374,6 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 9.0.0 - lit-element@3.3.3: - dependencies: - '@lit-labs/ssr-dom-shim': 1.2.1 - '@lit/reactive-element': 1.6.3 - lit-html: 2.8.0 - - lit-html@2.8.0: - dependencies: - '@types/trusted-types': 2.0.7 - - lit@2.8.0: - dependencies: - '@lit/reactive-element': 1.6.3 - lit-element: 3.3.3 - lit-html: 2.8.0 - load-json-file@4.0.0: dependencies: graceful-fs: 4.2.11 @@ -32208,26 +27435,12 @@ snapshots: lodash.debounce@4.0.8: {} - lodash.deburr@4.1.0: {} - - lodash.includes@4.3.0: {} - - lodash.isboolean@3.0.3: {} - - lodash.isequal@4.5.0: {} - lodash.isfunction@3.0.9: {} - lodash.isinteger@4.0.4: {} - lodash.ismatch@4.4.0: {} - lodash.isnumber@3.0.3: {} - lodash.isplainobject@4.0.6: {} - lodash.isstring@4.0.1: {} - lodash.kebabcase@4.1.1: {} lodash.memoize@3.0.4: {} @@ -32238,8 +27451,6 @@ snapshots: lodash.mergewith@4.6.2: {} - lodash.once@4.1.1: {} - lodash.snakecase@4.1.1: {} lodash.sortby@4.7.0: {} @@ -32283,8 +27494,6 @@ snapshots: dependencies: js-tokens: 4.0.0 - lossless-json@4.0.2: {} - loupe@3.1.2: {} lowdb@7.0.1: @@ -32295,8 +27504,6 @@ snapshots: dependencies: tslib: 2.8.1 - lowercase-keys@2.0.0: {} - lowercase-keys@3.0.0: {} lru-cache@10.4.3: {} @@ -32414,8 +27621,6 @@ snapshots: tiny-emitter: 2.1.0 typed-function: 2.1.0 - md4w@0.2.6: {} - md5.js@1.3.5: dependencies: hash-base: 3.1.0 @@ -32609,10 +27814,6 @@ snapshots: dependencies: '@types/mdast': 4.0.4 - mdbox@0.1.1: - dependencies: - md4w: 0.2.6 - mdn-data@2.0.28: {} mdn-data@2.0.30: {} @@ -33046,16 +28247,12 @@ snapshots: mime@1.6.0: {} - mime@3.0.0: {} - mimic-fn@2.1.0: {} mimic-fn@4.0.0: {} mimic-function@5.0.1: {} - mimic-response@1.0.1: {} - mimic-response@2.1.0: optional: true @@ -33174,24 +28371,6 @@ snapshots: mkdirp@3.0.1: {} - mkdist@1.6.0(typescript@5.6.3): - dependencies: - autoprefixer: 10.4.20(postcss@8.4.49) - citty: 0.1.6 - cssnano: 7.0.6(postcss@8.4.49) - defu: 6.1.4 - esbuild: 0.24.0 - jiti: 1.21.6 - mlly: 1.7.3 - pathe: 1.1.2 - pkg-types: 1.2.1 - postcss: 8.4.49 - postcss-nested: 6.2.0(postcss@8.4.49) - semver: 7.6.3 - tinyglobby: 0.2.10 - optionalDependencies: - typescript: 5.6.3 - mlly@1.7.3: dependencies: acorn: 8.14.0 @@ -33221,19 +28400,6 @@ snapshots: module-details-from-path@1.0.3: {} - moment@2.30.1: {} - - motion@10.16.2: - dependencies: - '@motionone/animation': 10.18.0 - '@motionone/dom': 10.18.0 - '@motionone/svelte': 10.16.4 - '@motionone/types': 10.17.1 - '@motionone/utils': 10.18.0 - '@motionone/vue': 10.16.4 - - mri@1.2.0: {} - mrmime@2.0.0: {} ms@2.0.0: {} @@ -33266,8 +28432,6 @@ snapshots: dns-packet: 5.6.1 thunky: 1.1.0 - multiformats@9.9.0: {} - multimatch@5.0.0: dependencies: '@types/minimatch': 3.0.5 @@ -33375,8 +28539,6 @@ snapshots: neo-async@2.6.2: {} - net@1.0.2: {} - netmask@2.0.2: {} next-tick@1.1.0: {} @@ -33396,8 +28558,6 @@ snapshots: node-addon-api@6.1.0: {} - node-addon-api@7.1.1: {} - node-addon-api@8.3.0: {} node-api-headers@1.4.0: {} @@ -33417,8 +28577,6 @@ snapshots: emojilib: 2.4.0 skin-tone: 2.0.0 - node-fetch-native@1.6.4: {} - node-fetch@2.6.7(encoding@0.1.13): dependencies: whatwg-url: 5.0.0 @@ -33576,8 +28734,6 @@ snapshots: normalize-range@0.1.2: {} - normalize-url@6.1.0: {} - normalize-url@8.0.1: {} not@0.1.0: {} @@ -33715,15 +28871,6 @@ snapshots: transitivePeerDependencies: - debug - nypm@0.3.12: - dependencies: - citty: 0.1.6 - consola: 3.2.3 - execa: 8.0.1 - pathe: 1.1.2 - pkg-types: 1.2.1 - ufo: 1.5.4 - o3@1.0.3: dependencies: capability: 0.2.5 @@ -33760,14 +28907,6 @@ snapshots: '@octokit/request-error': 6.1.5 '@octokit/types': 13.6.2 - ofetch@1.4.1: - dependencies: - destr: 2.0.3 - node-fetch-native: 1.6.4 - ufo: 1.5.4 - - ohash@1.1.4: {} - ollama-ai-provider@0.16.1(zod@3.23.8): dependencies: '@ai-sdk/provider': 0.0.26 @@ -33778,8 +28917,6 @@ snapshots: omggif@1.0.10: {} - on-exit-leak-free@0.2.0: {} - on-finished@2.4.1: dependencies: ee-first: 1.1.1 @@ -33934,8 +29071,6 @@ snapshots: transitivePeerDependencies: - zod - p-cancelable@2.1.1: {} - p-cancelable@3.0.0: {} p-finally@1.0.0: {} @@ -34000,8 +29135,6 @@ snapshots: dependencies: p-finally: 1.0.0 - p-timeout@4.1.0: {} - p-try@1.0.0: {} p-try@2.2.0: {} @@ -34216,8 +29349,6 @@ snapshots: path-type@4.0.0: {} - path-type@5.0.0: {} - path2d@0.2.2: optional: true @@ -34245,8 +29376,6 @@ snapshots: pend@1.2.0: {} - perfect-debounce@1.0.0: {} - performance-now@2.1.0: {} pg-cloudflare@1.1.1: @@ -34321,27 +29450,6 @@ snapshots: pify@5.0.0: {} - pino-abstract-transport@0.5.0: - dependencies: - duplexify: 4.1.3 - split2: 4.2.0 - - pino-std-serializers@4.0.0: {} - - pino@7.11.0: - dependencies: - atomic-sleep: 1.0.0 - fast-redact: 3.5.0 - on-exit-leak-free: 0.2.0 - pino-abstract-transport: 0.5.0 - pino-std-serializers: 4.0.0 - process-warning: 1.0.0 - quick-format-unescaped: 4.0.4 - real-require: 0.1.0 - safe-stable-stringify: 2.5.0 - sonic-boom: 2.8.0 - thread-stream: 0.15.2 - pirates@4.0.6: {} pkg-dir@4.2.0: @@ -34449,8 +29557,6 @@ snapshots: pngjs@2.3.1: {} - pngjs@5.0.0: {} - pnpm@9.14.4: {} points-on-curve@0.2.0: {} @@ -34460,8 +29566,6 @@ snapshots: path-data-parser: 0.1.0 points-on-curve: 0.2.0 - poseidon-lite@0.2.1: {} - possible-typed-array-names@1.0.0: {} postcss-attribute-case-insensitive@7.0.1(postcss@8.4.49): @@ -34469,12 +29573,6 @@ snapshots: postcss: 8.4.49 postcss-selector-parser: 7.0.0 - postcss-calc@10.0.2(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-selector-parser: 6.1.2 - postcss-value-parser: 4.2.0 - postcss-calc@9.0.1(postcss@8.4.49): dependencies: postcss: 8.4.49 @@ -34486,25 +29584,6 @@ snapshots: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-cli@11.0.0(jiti@2.4.0)(postcss@8.4.49): - dependencies: - chokidar: 3.6.0 - dependency-graph: 0.11.0 - fs-extra: 11.2.0 - get-stdin: 9.0.0 - globby: 14.0.2 - picocolors: 1.1.1 - postcss: 8.4.49 - postcss-load-config: 5.1.0(jiti@2.4.0)(postcss@8.4.49) - postcss-reporter: 7.1.0(postcss@8.4.49) - pretty-hrtime: 1.0.3 - read-cache: 1.0.0 - slash: 5.1.0 - yargs: 17.7.2 - transitivePeerDependencies: - - jiti - - tsx - postcss-color-functional-notation@7.0.6(postcss@8.4.49): dependencies: '@csstools/css-color-parser': 3.0.6(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) @@ -34534,26 +29613,12 @@ snapshots: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-colormin@7.0.2(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - caniuse-api: 3.0.0 - colord: 2.9.3 - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-convert-values@6.1.0(postcss@8.4.49): dependencies: browserslist: 4.24.3 postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-convert-values@7.0.4(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-custom-media@11.0.5(postcss@8.4.49): dependencies: '@csstools/cascade-layer-name-parser': 2.0.4(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) @@ -34588,35 +29653,18 @@ snapshots: dependencies: postcss: 8.4.49 - postcss-discard-comments@7.0.3(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-selector-parser: 6.1.2 - postcss-discard-duplicates@6.0.3(postcss@8.4.49): dependencies: postcss: 8.4.49 - postcss-discard-duplicates@7.0.1(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-discard-empty@6.0.3(postcss@8.4.49): dependencies: postcss: 8.4.49 - postcss-discard-empty@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-discard-overridden@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 - postcss-discard-overridden@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-discard-unused@6.0.5(postcss@8.4.49): dependencies: postcss: 8.4.49 @@ -34682,14 +29730,6 @@ snapshots: postcss: 8.4.49 ts-node: 10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3) - postcss-load-config@5.1.0(jiti@2.4.0)(postcss@8.4.49): - dependencies: - lilconfig: 3.1.3 - yaml: 2.6.1 - optionalDependencies: - jiti: 2.4.0 - postcss: 8.4.49 - postcss-load-config@6.0.1(jiti@2.4.0)(postcss@8.4.49)(yaml@2.6.1): dependencies: lilconfig: 3.1.3 @@ -34725,12 +29765,6 @@ snapshots: postcss-value-parser: 4.2.0 stylehacks: 6.1.1(postcss@8.4.49) - postcss-merge-longhand@7.0.4(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - stylehacks: 7.0.4(postcss@8.4.49) - postcss-merge-rules@6.1.1(postcss@8.4.49): dependencies: browserslist: 4.24.3 @@ -34739,24 +29773,11 @@ snapshots: postcss: 8.4.49 postcss-selector-parser: 6.1.2 - postcss-merge-rules@7.0.4(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - caniuse-api: 3.0.0 - cssnano-utils: 5.0.0(postcss@8.4.49) - postcss: 8.4.49 - postcss-selector-parser: 6.1.2 - postcss-minify-font-values@6.1.0(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-minify-font-values@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-minify-gradients@6.0.3(postcss@8.4.49): dependencies: colord: 2.9.3 @@ -34764,13 +29785,6 @@ snapshots: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-minify-gradients@7.0.0(postcss@8.4.49): - dependencies: - colord: 2.9.3 - cssnano-utils: 5.0.0(postcss@8.4.49) - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-minify-params@6.1.0(postcss@8.4.49): dependencies: browserslist: 4.24.3 @@ -34778,24 +29792,11 @@ snapshots: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-minify-params@7.0.2(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - cssnano-utils: 5.0.0(postcss@8.4.49) - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-minify-selectors@6.0.4(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-selector-parser: 6.1.2 - postcss-minify-selectors@7.0.4(postcss@8.4.49): - dependencies: - cssesc: 3.0.0 - postcss: 8.4.49 - postcss-selector-parser: 6.1.2 - postcss-modules-extract-imports@3.1.0(postcss@8.4.49): dependencies: postcss: 8.4.49 @@ -34833,92 +29834,47 @@ snapshots: dependencies: postcss: 8.4.49 - postcss-normalize-charset@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-normalize-display-values@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-display-values@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-normalize-positions@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-positions@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-normalize-repeat-style@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-repeat-style@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-normalize-string@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-string@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-normalize-timing-functions@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-timing-functions@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-normalize-unicode@6.1.0(postcss@8.4.49): dependencies: browserslist: 4.24.3 postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-unicode@7.0.2(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-normalize-url@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-url@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-normalize-whitespace@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-normalize-whitespace@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-opacity-percentage@3.0.0(postcss@8.4.49): dependencies: postcss: 8.4.49 @@ -34929,12 +29885,6 @@ snapshots: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-ordered-values@7.0.1(postcss@8.4.49): - dependencies: - cssnano-utils: 5.0.0(postcss@8.4.49) - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-overflow-shorthand@6.0.0(postcss@8.4.49): dependencies: postcss: 8.4.49 @@ -35032,32 +29982,15 @@ snapshots: caniuse-api: 3.0.0 postcss: 8.4.49 - postcss-reduce-initial@7.0.2(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - caniuse-api: 3.0.0 - postcss: 8.4.49 - postcss-reduce-transforms@6.0.2(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-value-parser: 4.2.0 - postcss-reduce-transforms@7.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - postcss-replace-overflow-wrap@4.0.0(postcss@8.4.49): dependencies: postcss: 8.4.49 - postcss-reporter@7.1.0(postcss@8.4.49): - dependencies: - picocolors: 1.1.1 - postcss: 8.4.49 - thenby: 1.3.4 - postcss-selector-not@8.0.1(postcss@8.4.49): dependencies: postcss: 8.4.49 @@ -35084,22 +30017,11 @@ snapshots: postcss-value-parser: 4.2.0 svgo: 3.3.2 - postcss-svgo@7.0.1(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-value-parser: 4.2.0 - svgo: 3.3.2 - postcss-unique-selectors@6.0.4(postcss@8.4.49): dependencies: postcss: 8.4.49 postcss-selector-parser: 6.1.2 - postcss-unique-selectors@7.0.3(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - postcss-selector-parser: 6.1.2 - postcss-value-parser@4.2.0: {} postcss-zindex@6.0.2(postcss@8.4.49): @@ -35134,8 +30056,6 @@ snapshots: postgres-range@1.1.4: {} - preact@10.25.2: {} - prebuild-install@7.1.2: dependencies: detect-libc: 2.0.3 @@ -35172,8 +30092,6 @@ snapshots: ansi-styles: 5.2.0 react-is: 18.3.1 - pretty-hrtime@1.0.3: {} - pretty-ms@7.0.1: dependencies: parse-ms: 2.1.0 @@ -35205,8 +30123,6 @@ snapshots: process-nextick-args@2.0.1: {} - process-warning@1.0.0: {} - process@0.11.10: {} proggy@2.0.0: {} @@ -35292,21 +30208,6 @@ snapshots: transitivePeerDependencies: - supports-color - proxy-agent@6.4.0: - dependencies: - agent-base: 7.1.3 - debug: 4.4.0(supports-color@5.5.0) - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 - lru-cache: 7.18.3 - pac-proxy-agent: 7.1.0 - proxy-from-env: 1.1.0 - socks-proxy-agent: 8.0.5 - transitivePeerDependencies: - - supports-color - - proxy-compare@2.5.1: {} - proxy-from-env@1.1.0: {} psl@1.15.0: @@ -35329,20 +30230,6 @@ snapshots: end-of-stream: 1.4.4 once: 1.4.0 - pumpdotfun-sdk@1.3.2(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(rollup@4.28.1)(typescript@5.6.3)(utf-8-validate@5.0.10): - dependencies: - '@coral-xyz/anchor': 0.30.1(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@rollup/plugin-json': 6.1.0(rollup@4.28.1) - '@solana/spl-token': 0.4.6(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) - '@solana/web3.js': 1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - encoding - - fastestsmallesttextencoderdecoder - - rollup - - typescript - - utf-8-validate - punycode.js@2.3.1: {} punycode@1.4.1: {} @@ -35430,32 +30317,12 @@ snapshots: pure-rand@6.1.0: {} - pvtsutils@1.3.6: - dependencies: - tslib: 2.8.1 - - pvutils@1.1.3: {} - - qrcode@1.5.3: - dependencies: - dijkstrajs: 1.0.3 - encode-utf8: 1.0.3 - pngjs: 5.0.0 - yargs: 15.4.1 - qs@6.13.0: dependencies: side-channel: 1.1.0 qs@6.5.3: {} - query-string@7.1.3: - dependencies: - decode-uri-component: 0.2.2 - filter-obj: 1.1.0 - split-on-first: 1.1.0 - strict-uri-encode: 2.0.0 - querystring-es3@0.2.1: {} querystringify@2.2.0: {} @@ -35468,14 +30335,10 @@ snapshots: dependencies: inherits: 2.0.4 - quick-format-unescaped@4.0.4: {} - quick-lru@4.0.1: {} quick-lru@5.1.1: {} - radix3@1.1.2: {} - randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 @@ -35496,11 +30359,6 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 - rc9@2.1.2: - dependencies: - defu: 6.1.4 - destr: 2.0.3 - rc@1.2.8: dependencies: deep-extend: 0.6.0 @@ -35769,8 +30627,6 @@ snapshots: readline@1.3.0: {} - real-require@0.1.0: {} - rechoir@0.6.2: dependencies: resolve: 1.22.9 @@ -35821,14 +30677,6 @@ snapshots: indent-string: 5.0.0 strip-indent: 4.0.0 - redeyed@2.1.1: - dependencies: - esprima: 4.0.1 - - reflect-metadata@0.1.13: {} - - reflect-metadata@0.2.2: {} - regenerate-unicode-properties@10.2.0: dependencies: regenerate: 1.4.2 @@ -36011,8 +30859,6 @@ snapshots: require-like@0.1.2: {} - require-main-filename@2.0.0: {} - requires-port@1.0.0: {} resolve-alpn@1.2.1: {} @@ -36039,10 +30885,6 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - responselike@2.0.1: - dependencies: - lowercase-keys: 2.0.0 - responselike@3.0.0: dependencies: lowercase-keys: 3.0.0 @@ -36091,22 +30933,10 @@ snapshots: robust-predicates@3.0.2: {} - rollup-plugin-dts@6.1.1(rollup@3.29.5)(typescript@5.6.3): - dependencies: - magic-string: 0.30.15 - rollup: 3.29.5 - typescript: 5.6.3 - optionalDependencies: - '@babel/code-frame': 7.26.2 - rollup@2.79.2: optionalDependencies: fsevents: 2.3.3 - rollup@3.29.5: - optionalDependencies: - fsevents: 2.3.3 - rollup@4.28.1: dependencies: '@types/estree': 1.0.6 @@ -36173,10 +31003,6 @@ snapshots: rw@1.3.3: {} - rxjs@6.6.7: - dependencies: - tslib: 1.9.3 - rxjs@7.8.1: dependencies: tslib: 2.8.1 @@ -36185,18 +31011,10 @@ snapshots: safe-buffer@5.2.1: {} - safe-compare@1.1.4: - dependencies: - buffer-alloc: 1.2.0 - - safe-stable-stringify@2.5.0: {} - safer-buffer@2.1.2: {} sam-js@0.3.1: {} - sandwich-stream@2.0.2: {} - save-pixels-jpeg-js-upgrade@2.3.4-jpeg-js-upgrade.0: dependencies: contentstream: 1.0.0 @@ -36238,8 +31056,6 @@ snapshots: scryptsy@2.1.0: {} - scule@1.3.0: {} - search-insights@2.17.3: {} secp256k1@5.0.0: @@ -36375,10 +31191,6 @@ snapshots: inherits: 2.0.4 safe-buffer: 5.2.1 - sha3@2.1.4: - dependencies: - buffer: 6.0.3 - shallow-clone@0.1.2: dependencies: is-extendable: 0.1.1 @@ -36503,8 +31315,6 @@ snapshots: transitivePeerDependencies: - supports-color - simple-cbor@0.4.1: {} - simple-concat@1.0.1: {} simple-get@3.1.1: @@ -36559,8 +31369,6 @@ snapshots: slash@4.0.0: {} - slash@5.1.0: {} - sleep-promise@9.1.0: {} slice-ansi@5.0.0: @@ -36599,10 +31407,6 @@ snapshots: ip-address: 9.0.5 smart-buffer: 4.2.0 - sonic-boom@2.8.0: - dependencies: - atomic-sleep: 1.0.0 - sort-css-media-queries@2.2.0: {} sort-keys@2.0.0: @@ -36635,8 +31439,6 @@ snapshots: space-separated-tokens@2.0.2: {} - spawn-command@0.0.2: {} - spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 @@ -36649,11 +31451,6 @@ snapshots: spdx-exceptions: 2.5.0 spdx-license-ids: 3.0.20 - spdx-expression-parse@4.0.0: - dependencies: - spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.20 - spdx-license-ids@3.0.20: {} spdy-transport@3.0.0: @@ -36677,8 +31474,6 @@ snapshots: transitivePeerDependencies: - supports-color - split-on-first@1.1.0: {} - split2@3.2.2: dependencies: readable-stream: 3.6.2 @@ -36695,8 +31490,6 @@ snapshots: sprintf-js@1.1.3: {} - sql.js@1.12.0: {} - sqlite-vec-darwin-arm64@0.1.6: optional: true @@ -36749,22 +31542,6 @@ snapshots: stackback@0.0.2: {} - starknet@6.18.0(encoding@0.1.13): - dependencies: - '@noble/curves': 1.3.0 - '@noble/hashes': 1.3.2 - '@scure/base': 1.1.9 - '@scure/starknet': 1.0.0 - abi-wan-kanabi: 2.2.4 - fetch-cookie: 3.0.1 - isomorphic-fetch: 3.0.0(encoding@0.1.13) - lossless-json: 4.0.2 - pako: 2.1.0 - starknet-types-07: '@starknet-io/types-js@0.7.10' - ts-mixer: 6.0.4 - transitivePeerDependencies: - - encoding - statuses@1.5.0: {} statuses@2.0.1: {} @@ -36805,8 +31582,6 @@ snapshots: transitivePeerDependencies: - supports-color - stream-shift@1.0.3: {} - stream-splicer@2.0.1: dependencies: inherits: 2.0.4 @@ -36822,8 +31597,6 @@ snapshots: optionalDependencies: bare-events: 2.5.0 - strict-uri-encode@2.0.0: {} - string-argv@0.3.2: {} string-length@4.0.2: @@ -36926,12 +31699,6 @@ snapshots: postcss: 8.4.49 postcss-selector-parser: 6.1.2 - stylehacks@7.0.4(postcss@8.4.49): - dependencies: - browserslist: 4.24.3 - postcss: 8.4.49 - postcss-selector-parser: 6.1.2 - stylis@4.3.4: {} subarg@1.0.0: @@ -36955,8 +31722,6 @@ snapshots: function-timeout: 1.0.2 time-span: 5.1.0 - superstruct@0.15.5: {} - superstruct@2.0.2: {} supports-color@2.0.0: {} @@ -37026,8 +31791,6 @@ snapshots: dependencies: acorn-node: 1.8.2 - system-architecture@0.1.0: {} - systeminformation@5.23.5: {} tailwind-merge@2.5.5: {} @@ -37114,20 +31877,6 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - telegraf@4.16.3(encoding@0.1.13): - dependencies: - '@telegraf/types': 7.1.0 - abort-controller: 3.0.0 - debug: 4.4.0(supports-color@5.5.0) - mri: 1.2.0 - node-fetch: 2.7.0(encoding@0.1.13) - p-timeout: 4.1.0 - safe-compare: 1.1.4 - sandwich-stream: 2.0.2 - transitivePeerDependencies: - - encoding - - supports-color - temp-dir@1.0.0: {} terser-webpack-plugin@5.3.11(@swc/core@1.10.1(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.1(@swc/helpers@0.5.15))): @@ -37172,8 +31921,6 @@ snapshots: text-table@0.2.0: {} - thenby@1.3.4: {} - thenify-all@1.6.0: dependencies: thenify: 3.3.1 @@ -37182,10 +31929,6 @@ snapshots: dependencies: any-promise: 1.3.0 - thread-stream@0.15.2: - dependencies: - real-require: 0.1.0 - throttleit@2.1.0: {} through2@2.0.5: @@ -37272,8 +32015,6 @@ snapshots: toad-cache@3.7.0: {} - toformat@2.0.0: {} - together-ai@0.7.0(encoding@0.1.13): dependencies: '@types/node': 18.19.68 @@ -37290,8 +32031,6 @@ snapshots: toidentifier@1.0.1: {} - toml@3.0.0: {} - totalist@3.0.1: {} touch@3.1.1: {} @@ -37344,25 +32083,6 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.9))(typescript@5.6.3): - dependencies: - bs-logger: 0.2.6 - ejs: 3.1.10 - fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.17.9) - jest-util: 29.7.0 - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.6.3 - typescript: 5.6.3 - yargs-parser: 21.1.1 - optionalDependencies: - '@babel/core': 7.26.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@swc/core@1.10.1(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 @@ -37410,8 +32130,6 @@ snapshots: minimist: 1.2.8 strip-bom: 3.0.0 - tslib@1.14.1: {} - tslib@1.9.3: {} tslib@2.7.0: {} @@ -37510,8 +32228,6 @@ snapshots: type-fest@0.18.1: {} - type-fest@0.20.2: {} - type-fest@0.21.3: {} type-fest@0.4.1: {} @@ -37576,60 +32292,17 @@ snapshots: uglify-js@3.19.3: optional: true - uid@2.0.2: - dependencies: - '@lukeed/csprng': 1.1.0 - uint8array-tools@0.0.8: {} uint8array-tools@0.0.9: {} - uint8arrays@3.1.0: - dependencies: - multiformats: 9.9.0 - umd@3.0.3: {} - unbuild@2.0.0(typescript@5.6.3): - dependencies: - '@rollup/plugin-alias': 5.1.1(rollup@3.29.5) - '@rollup/plugin-commonjs': 25.0.8(rollup@3.29.5) - '@rollup/plugin-json': 6.1.0(rollup@3.29.5) - '@rollup/plugin-node-resolve': 15.3.0(rollup@3.29.5) - '@rollup/plugin-replace': 5.0.7(rollup@3.29.5) - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - chalk: 5.3.0 - citty: 0.1.6 - consola: 3.2.3 - defu: 6.1.4 - esbuild: 0.19.12 - globby: 13.2.2 - hookable: 5.5.3 - jiti: 1.21.6 - magic-string: 0.30.15 - mkdist: 1.6.0(typescript@5.6.3) - mlly: 1.7.3 - pathe: 1.1.2 - pkg-types: 1.2.1 - pretty-bytes: 6.1.1 - rollup: 3.29.5 - rollup-plugin-dts: 6.1.1(rollup@3.29.5)(typescript@5.6.3) - scule: 1.3.0 - untyped: 1.5.1 - optionalDependencies: - typescript: 5.6.3 - transitivePeerDependencies: - - sass - - supports-color - - vue-tsc - unbzip2-stream@1.4.3: dependencies: buffer: 5.7.1 through: 2.3.8 - uncrypto@0.1.3: {} - undeclared-identifiers@1.1.3: dependencies: acorn-node: 1.8.2 @@ -37646,14 +32319,6 @@ snapshots: undici@6.19.8: {} - unenv@1.10.0: - dependencies: - consola: 3.2.3 - defu: 6.1.4 - mime: 3.0.0 - node-fetch-native: 1.6.4 - pathe: 1.1.2 - unfetch@4.2.0: {} unicode-canonical-property-names-ecmascript@2.0.1: {} @@ -37669,8 +32334,6 @@ snapshots: unicode-property-aliases-ecmascript@2.1.0: {} - unicorn-magic@0.1.0: {} - unified@11.0.5: dependencies: '@types/unist': 3.0.3 @@ -37767,39 +32430,6 @@ snapshots: unpipe@1.0.0: {} - unstorage@1.13.1(idb-keyval@6.2.1): - dependencies: - anymatch: 3.1.3 - chokidar: 3.6.0 - citty: 0.1.6 - destr: 2.0.3 - h3: 1.13.0 - listhen: 1.9.0 - lru-cache: 10.4.3 - node-fetch-native: 1.6.4 - ofetch: 1.4.1 - ufo: 1.5.4 - optionalDependencies: - idb-keyval: 6.2.1 - - untun@0.1.3: - dependencies: - citty: 0.1.6 - consola: 3.2.3 - pathe: 1.1.2 - - untyped@1.5.1: - dependencies: - '@babel/core': 7.26.0 - '@babel/standalone': 7.26.4 - '@babel/types': 7.26.3 - defu: 6.1.4 - jiti: 2.4.0 - mri: 1.2.0 - scule: 1.3.0 - transitivePeerDependencies: - - supports-color - upath@2.0.1: {} update-browserslist-db@1.1.1(browserslist@4.24.3): @@ -37825,8 +32455,6 @@ snapshots: semver-diff: 4.0.0 xdg-basedir: 5.1.0 - uqr@0.1.2: {} - uri-js@4.4.1: dependencies: punycode: 2.3.1 @@ -37867,10 +32495,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.12 - use-sync-external-store@1.2.0(react@18.3.1): - dependencies: - react: 18.3.1 - use-sync-external-store@1.4.0(react@18.3.1): dependencies: react: 18.3.1 @@ -37930,14 +32554,6 @@ snapshots: validate-npm-package-name@5.0.1: {} - valtio@1.11.2(@types/react@18.3.12)(react@18.3.1): - dependencies: - proxy-compare: 2.5.1 - use-sync-external-store: 1.2.0(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.12 - react: 18.3.1 - value-equal@1.0.1: {} varuint-bitcoin@2.0.0: @@ -37999,23 +32615,6 @@ snapshots: - utf-8-validate - zod - vite-node@2.1.4(@types/node@22.8.4)(terser@5.37.0): - dependencies: - cac: 6.7.14 - debug: 4.4.0(supports-color@5.5.0) - pathe: 1.1.2 - vite: 5.4.11(@types/node@22.8.4)(terser@5.37.0) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - vite-node@2.1.5(@types/node@22.8.4)(terser@5.37.0): dependencies: cac: 6.7.14 @@ -38058,42 +32657,6 @@ snapshots: fsevents: 2.3.3 terser: 5.37.0 - vitest@2.1.4(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): - dependencies: - '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.8.4)(terser@5.37.0)) - '@vitest/pretty-format': 2.1.8 - '@vitest/runner': 2.1.4 - '@vitest/snapshot': 2.1.4 - '@vitest/spy': 2.1.4 - '@vitest/utils': 2.1.4 - chai: 5.1.2 - debug: 4.4.0(supports-color@5.5.0) - expect-type: 1.1.0 - magic-string: 0.30.15 - pathe: 1.1.2 - std-env: 3.8.0 - tinybench: 2.9.0 - tinyexec: 0.3.1 - tinypool: 1.0.2 - tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@22.8.4)(terser@5.37.0) - vite-node: 2.1.4(@types/node@22.8.4)(terser@5.37.0) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/node': 22.8.4 - jsdom: 25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10) - transitivePeerDependencies: - - less - - lightningcss - - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): dependencies: '@vitest/expect': 2.1.5 @@ -38218,14 +32781,6 @@ snapshots: '@noble/curves': 1.7.0 '@noble/hashes': 1.6.1 - webcrypto-core@1.8.1: - dependencies: - '@peculiar/asn1-schema': 2.3.13 - '@peculiar/json-schema': 1.1.12 - asn1js: 3.0.5 - pvtsutils: 1.3.6 - tslib: 2.8.1 - webidl-conversions@3.0.1: {} webidl-conversions@4.0.2: {} @@ -38378,8 +32933,6 @@ snapshots: dependencies: iconv-lite: 0.6.3 - whatwg-fetch@3.6.20: {} - whatwg-mimetype@4.0.0: {} whatwg-url@14.1.0: @@ -38398,8 +32951,6 @@ snapshots: tr46: 1.0.1 webidl-conversions: 4.0.2 - which-module@2.0.1: {} - which-pm-runs@1.1.0: {} which-typed-array@1.1.16: @@ -38548,8 +33099,6 @@ snapshots: xtend@4.0.2: {} - y18n@4.0.3: {} - y18n@5.0.8: {} yaeti@0.0.6: {} @@ -38566,29 +33115,10 @@ snapshots: yaml@2.6.1: {} - yargs-parser@18.1.3: - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - yargs-parser@20.2.9: {} yargs-parser@21.1.1: {} - yargs@15.4.1: - dependencies: - cliui: 6.0.0 - decamelize: 1.2.0 - find-up: 4.1.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 4.2.3 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 18.1.3 - yargs@16.2.0: dependencies: cliui: 7.0.4 diff --git a/scripts/docker.sh b/scripts/docker.sh index 6fb2fb3b7ad..5ce5c7bb12f 100755 --- a/scripts/docker.sh +++ b/scripts/docker.sh @@ -29,24 +29,17 @@ case "$1" in ) # Define package directories to mount + # v2 TODO: This is a temporary list of packages to mount. We need to find a way to automate this. PACKAGES=( "adapter-postgres" "adapter-sqlite" - "adapter-sqljs" "adapter-supabase" - "client-auto" - "client-direct" "client-discord" - "client-farcaster" - "client-telegram" "client-twitter" "core" "plugin-bootstrap" "plugin-image-generation" "plugin-node" - "plugin-solana" - "plugin-evm" - "plugin-tee" ) # Start building the docker run command diff --git a/scripts/migrateCache.js b/scripts/migrateCache.js deleted file mode 100644 index 3c6a33f2abc..00000000000 --- a/scripts/migrateCache.js +++ /dev/null @@ -1,81 +0,0 @@ -import fs, { glob } from "fs/promises"; -import path from "path"; - -const characterName = "eliza"; -const newCacheDir = path.resolve(`./data/${characterName}/cache`); - -const twitterUserName = ""; - -// solana -const orderBookPath = ""; -const solanaCacheDir = "plugin-solana/**"; - -const cachedFiles = { - [`tweetcache/${twitterUserName}_cookies.json`]: `twitter/${twitterUserName}/cookies`, - "tweetcache/latest_checked_tweet_id.txt": `twitter/${twitterUserName}/latest_checked_tweet_id`, - "tweetcache/home_timeline.json": `twitter/${twitterUserName}/timeline`, - "tweetcache/tweet_generation_*.txt": "twitter/", - "tweetcache/tweet_generation_*.txt": "twitter/", - "tweetcache/**/*.json": `twitter/tweets/`, - - "content_cache/summary_*.txt": "content/discord/", - "content_cache/transcript_*.txt": "content/discord/", - "content_cache/conversation_summary_*.txt": "content/discord/", - "content_cache/**.mp4": "content/video/", - "content_cache/*": "content/", - - [orderBookPath]: "solana/orderBook", - [`${solanaCacheDir}/tokenSecurity_`]: "solana/tokens/", - [`${solanaCacheDir}/tokenTradeData_`]: "solana/tokens/", - [`${solanaCacheDir}/dexScreenerData_`]: "solana/tokens/", - [`${solanaCacheDir}/dexScreenerData_search_`]: "solana/tokens/", - [`${solanaCacheDir}/holderList_`]: "solana/tokens/", -}; - -async function migrate() { - console.log({ newCacheDir }); - await fs.mkdir(newCacheDir, { recursive: true }); - - for (const key in cachedFiles) { - if (!key) continue; - const results = await glob(["./packages/**/" + key]); - - console.log({ searching: key }); - - for await (const result of results) { - if (result.includes("node_modules")) continue; - - const filePath = path.resolve("./", result); - - const cacheKey = /** @type {string} */ (cachedFiles[key]); - - const filename = cacheKey.endsWith("/") - ? path.join( - cacheKey, - path.basename(filePath, path.extname(filePath)) - ) - : cacheKey; - - const absolutePath = path.join(newCacheDir, filename) + ".json"; - - console.log(filePath, absolutePath); - - const data = await fs.readFile(filePath, "utf8"); - - await fs.mkdir(path.dirname(absolutePath), { recursive: true }); - - await fs.writeFile( - absolutePath, - JSON.stringify({ - value: data, - expires: 0, - }), - "utf8" - ); - - await fs.unlink(filePath); - } - } -} - -migrate().catch((err) => console.error(err)); diff --git a/turbo.json b/turbo.json index e6a1ba00faf..8f482009635 100644 --- a/turbo.json +++ b/turbo.json @@ -4,17 +4,10 @@ "check-types": { "dependsOn": ["build"] }, - "@ai16z/agent#check-types": { - "dependsOn": ["@ai16z/plugin-solana#build"] - }, "build": { "outputs": ["dist/**"], "dependsOn": ["^@ai16z/eliza#build"] }, - "@ai16z/plugin-solana#build": { - "outputs": ["dist/**"], - "dependsOn": ["@ai16z/plugin-trustdb#build"] - }, "eliza-docs#build": { "outputs": ["build/**"] },