This commit is contained in:
biccsdev
2025-01-04 18:23:33 -06:00
parent 4a86c2a688
commit b3555ebded
6 changed files with 78 additions and 10 deletions

View File

@@ -1,5 +0,0 @@
OPENAI_API_KEY=
RPC_URL=
SOLANA_PRIVATE_KEY=
JUPITER_REFERRAL_ACCOUNT=
JUPITER_FEE_BPS=

View File

@@ -3,7 +3,7 @@ import { SolanaAgentKit, createSolanaTools } from "solana-agent-kit";
export const agentKit = new SolanaAgentKit(
process.env.SOLANA_PRIVATE_KEY!,
process.env.RPC_URL!,
process.env.OPENAI_API_KEY!,
{ OPENAI_API_KEY: process.env.OPENAI_API_KEY! },
);
export const solanaTools = createSolanaTools(agentKit);

View File

@@ -59,6 +59,7 @@
"form-data": "^4.0.1",
"langchain": "^0.3.8",
"openai": "^4.77.0",
"solana-agent-kit": "^1.3.6",
"typedoc": "^0.27.6",
"zod": "^3.24.1"
},

75
pnpm-lock.yaml generated
View File

@@ -136,7 +136,9 @@ importers:
openai:
specifier: ^4.77.0
version: 4.77.3(zod@3.24.1)
version: 4.77.3(zod@3.24.1)
solana-agent-kit:
specifier: ^1.3.6
version: 1.3.6(@noble/hashes@1.7.0)(axios@1.7.9)(borsh@2.0.0)(buffer@6.0.3)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.0.0)(sodium-native@3.4.1)(typescript@5.7.2)(utf-8-validate@5.0.10)
typedoc:
specifier: ^0.27.6
version: 0.27.6(typescript@5.7.2)
@@ -3112,6 +3114,10 @@ packages:
peerDependencies:
sodium-native: ^3.2.0
solana-agent-kit@1.3.6:
resolution: {integrity: sha512-dF7GcZw3ifWRkBkI57DZUlo0xhNlbr2WLm8Wce57DkAXDfzZxrui4NTcCifWODST3R5ypi3VerBch5MfK1PsUA==}
engines: {node: '>=22.0.0', pnpm: '>=8.0.0'}
space-separated-tokens@2.0.2:
resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==}
@@ -7803,7 +7809,72 @@ snapshots:
typedarray-to-buffer: 3.1.5
xsalsa20: 1.2.0
space-separated-tokens@2.0.2: {}
solana-agent-kit@1.3.6(@noble/hashes@1.7.0)(axios@1.7.9)(borsh@2.0.0)(buffer@6.0.3)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.0.0)(sodium-native@3.4.1)(typescript@5.7.2)(utf-8-validate@5.0.10):
dependencies:
'@ai-sdk/openai': 1.0.11(zod@3.24.1)
'@bonfida/spl-name-service': 3.0.7(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)
'@cks-systems/manifest-sdk': 0.1.73(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)
'@coral-xyz/anchor': 0.29.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)
'@langchain/core': 0.3.27(openai@4.77.3(zod@3.24.1))
'@langchain/groq': 0.1.2(@langchain/core@0.3.27(openai@4.77.3(zod@3.24.1)))
'@langchain/langgraph': 0.2.38(@langchain/core@0.3.27(openai@4.77.3(zod@3.24.1)))
'@langchain/openai': 0.3.16(@langchain/core@0.3.27(openai@4.77.3(zod@3.24.1)))
'@lightprotocol/compressed-token': 0.17.1(@lightprotocol/stateless.js@0.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)
'@lightprotocol/stateless.js': 0.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)
'@metaplex-foundation/mpl-core': 1.1.1(@metaplex-foundation/umi@0.9.2)(@noble/hashes@1.7.0)
'@metaplex-foundation/mpl-token-metadata': 3.3.0(@metaplex-foundation/umi@0.9.2)
'@metaplex-foundation/mpl-toolbox': 0.9.4(@metaplex-foundation/umi@0.9.2)
'@metaplex-foundation/umi': 0.9.2
'@metaplex-foundation/umi-bundle-defaults': 0.9.2(@metaplex-foundation/umi@0.9.2)(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))
'@metaplex-foundation/umi-web3js-adapters': 0.9.2(@metaplex-foundation/umi@0.9.2)(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))
'@onsol/tldparser': 0.6.7(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bn.js@5.2.1)(borsh@2.0.0)(buffer@6.0.3)(bufferutil@4.0.9)(utf-8-validate@5.0.10)
'@orca-so/common-sdk': 0.6.4(@solana/spl-token@0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10))(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(decimal.js@10.4.3)
'@orca-so/whirlpools-sdk': 0.13.13(@coral-xyz/anchor@0.29.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@orca-so/common-sdk@0.6.4(@solana/spl-token@0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10))(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(decimal.js@10.4.3))(@solana/spl-token@0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10))(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(decimal.js@10.4.3)
'@pythnetwork/price-service-client': 1.9.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)
'@raydium-io/raydium-sdk-v2': 0.1.95-alpha(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)
'@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)
'@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)
'@tensor-oss/tensorswap-sdk': 4.5.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)
'@tiplink/api': 0.3.1(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(sodium-native@3.4.1)(utf-8-validate@5.0.10)
ai: 4.0.22(react@19.0.0)(zod@3.24.1)
bn.js: 5.2.1
bs58: 6.0.0
chai: 5.1.2
decimal.js: 10.4.3
dotenv: 16.4.7
form-data: 4.0.1
langchain: 0.3.9(@langchain/core@0.3.27(openai@4.77.3(zod@3.24.1)))(@langchain/groq@0.1.2(@langchain/core@0.3.27(openai@4.77.3(zod@3.24.1))))(axios@1.7.9)(openai@4.77.3(zod@3.24.1))
openai: 4.77.3(zod@3.24.1)
typedoc: 0.27.6(typescript@5.7.2)
zod: 3.24.1
transitivePeerDependencies:
- '@langchain/anthropic'
- '@langchain/aws'
- '@langchain/cerebras'
- '@langchain/cohere'
- '@langchain/google-genai'
- '@langchain/google-vertexai'
- '@langchain/mistralai'
- '@langchain/ollama'
- '@noble/hashes'
- axios
- borsh
- buffer
- bufferutil
- cheerio
- debug
- encoding
- fastestsmallesttextencoderdecoder
- handlebars
- jiti
- peggy
- react
- sodium-native
- supports-color
- typeorm
- typescript
- utf-8-validate
space-separated-tokens@2.0.2: {}
spok@1.5.5:

View File

@@ -10,7 +10,7 @@ import { SolanaAgentKit, createSolanaTools } from "../../src";
const agent = new SolanaAgentKit(
process.env.SOLANA_PRIVATE_KEY!,
process.env.RPC_URL!,
process.env.OPENAI_API_KEY!,
{ OPENAI_API_KEY: process.env.OPENAI_API_KEY! },
);
const optionsWithBase58: StoreInitOptions = {

View File

@@ -22,7 +22,8 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.test.ts"]