|
1 | | -**dexai** |
| 1 | +# wallioai-kit |
2 | 2 |
|
3 | | -A npm package for DexAi. |
| 3 | +## 🚀 Overview |
| 4 | +**wallioai-kit** is a powerful NPM package that enables AI agents to seamlessly interact with blockchain assets. It provides **wallet management, cross-chain bridging, DeFi lending and borrowing, and real-time market data** through an intuitive API. |
| 5 | + |
| 6 | +Compatible with any AI language model (**ChatGPT, ClaudeAI, DeepSeek, and more**), wallioai-kit allows AI-powered applications to **autonomously manage wallets, execute transactions, bridge assets, and optimize DeFi strategies**. |
| 7 | + |
| 8 | +It powers the **[Wallio AI Agent](https://wallio.xyz)**, making **crypto transactions as easy as natural language commands**. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## 📦 Installation |
| 13 | +```sh |
| 14 | +npm install wallioai-kit |
| 15 | +``` |
| 16 | + |
| 17 | +## 👨💻 Usage |
| 18 | +```js |
| 19 | +import { Wallio } from "wallioai-kit"; |
| 20 | +import { |
| 21 | + walletAdapterProvider, |
| 22 | + dlnAdapterProvider, |
| 23 | +} from "wallioai-kit/adapters"; |
| 24 | +import { ViemAccount } from "wallioai-kit/accounts"; |
| 25 | +import { generateLangChainTools } from "wallioai-kit/tools"; |
| 26 | +import { privateKeyToAccount } from "viem/accounts"; |
| 27 | +import { createWalletClient } from "viem"; |
| 28 | +import { sonic } from "viem/chains"; |
| 29 | +import { ChatOpenAI } from "@langchain/openai"; |
| 30 | + |
| 31 | +const account = privateKeyToAccount(""); |
| 32 | +const client = createWalletClient({ |
| 33 | + account, |
| 34 | + chain: sonic, |
| 35 | + transport: http(""), |
| 36 | +}); |
| 37 | + |
| 38 | +const walletProvider = new ViemAccount(client); |
| 39 | +const wallio = await Wallio.init({ |
| 40 | + account: walletProvider, |
| 41 | + adapters: [ |
| 42 | + walletAdapterProvider(), |
| 43 | + dlnAdapterProvider(), |
| 44 | + ], |
| 45 | +}); |
| 46 | +const tools = await generateLangChainTools(wallio); |
| 47 | + |
| 48 | +const chat = new ChatOpenAI({ |
| 49 | + model: "gpt-4o", |
| 50 | + temperature: 0, |
| 51 | + apiKey: OPEN_AI_KEY, |
| 52 | +}); |
| 53 | + |
| 54 | +const agent = createReactAgent({ |
| 55 | + llm: chat, |
| 56 | + tools, |
| 57 | + prompt: new SystemMessage(`Modifier`), |
| 58 | +}); |
| 59 | + |
| 60 | +``` |
0 commit comments