Skip to content

Commit

Permalink
add first commits
Browse files Browse the repository at this point in the history
  • Loading branch information
youssefea committed Dec 13, 2024
1 parent 5edf5b2 commit 7703f48
Show file tree
Hide file tree
Showing 13 changed files with 881 additions and 309 deletions.
4 changes: 4 additions & 0 deletions goat.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
"name": "[Plugin] 💰 coingecko",
"path": "./typescript/packages/plugins/coingecko"
},
{
"name": "[Plugin] 💰 superfluid",
"path": "./typescript/packages/plugins/superfluid"
},
{
"name": "[Wallet] 🍀 crossmint",
"path": "./typescript/packages/wallets/crossmint"
Expand Down
33 changes: 17 additions & 16 deletions typescript/examples/vercel-ai/viem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import { sepolia } from "viem/chains";

import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { PEPE, USDC, erc20 } from "@goat-sdk/plugin-erc20";
import { superfluid } from "@goat-sdk/plugin-superfluid";

import { sendETH } from "@goat-sdk/core";
import { viem } from "@goat-sdk/wallet-viem";

require("dotenv").config();

const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const account = privateKeyToAccount(
process.env.WALLET_PRIVATE_KEY as `0x${string}`
);

const walletClient = createWalletClient({
account: account,
Expand All @@ -23,19 +26,17 @@ const walletClient = createWalletClient({
});

(async () => {
const tools = await getOnChainTools({
wallet: viem(walletClient),
plugins: [
sendETH(),
erc20({ tokens: [USDC, PEPE] })],
});

const result = await generateText({
model: openai("gpt-4o-mini"),
tools: tools,
maxSteps: 5,
prompt: "Get my balance in USDC",
});

console.log(result.text);
const tools = await getOnChainTools({
wallet: viem(walletClient),
plugins: [sendETH(), erc20({ tokens: [USDC, PEPE] }), superfluid()],
});

const result = await generateText({
model: openai("gpt-4o-mini"),
tools: tools,
maxSteps: 5,
prompt: " make sure you are on OP Sepolia (11155420), create a new flow for the super token fDAIx of the address 0xD6FAF98BeFA647403cc56bDB598690660D5257d2 and the receiver should be the address 0x6caf4a402452f5108890dc50b58646c2a8730123 and the flow rate is 5555 wei/second ",
});

console.log(result.text);
})();
1 change: 1 addition & 0 deletions typescript/examples/vercel-ai/viem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@goat-sdk/adapter-vercel-ai": "workspace:*",
"@goat-sdk/core": "workspace:*",
"@goat-sdk/plugin-erc20": "workspace:*",
"@goat-sdk/plugin-superfluid": "workspace:*",
"@goat-sdk/wallet-viem": "workspace:*",
"ai": "^4.0.3",
"dotenv": "^16.4.5",
Expand Down
13 changes: 10 additions & 3 deletions typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"vitest": "2.1.5"
},
"engines": {
"node": ">=20.12.2",
"node": ">=20.12.2 <21",
"npm": "please-use-pnpm",
"pnpm": ">=8",
"yarn": "please-use-pnpm"
Expand All @@ -41,6 +41,13 @@
"bugs": {
"url": "https://github.com/crossmint/goat/issues"
},
"keywords": ["ai", "agents", "web3"],
"packageManager": "[email protected]"
"keywords": [
"ai",
"agents",
"web3"
],
"packageManager": "[email protected]",
"dependencies": {
"@goat-sdk/core": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion typescript/packages/plugins/superfluid/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@goat-sdk/plugin-erc20",
"name": "@goat-sdk/plugin-superfluid",
"version": "0.1.7",
"files": ["dist/**/*", "README.md", "package.json"],
"scripts": {
Expand Down
Loading

0 comments on commit 7703f48

Please sign in to comment.