diff --git a/README.md b/README.md index 2dd01d8..8b7ae7d 100644 --- a/README.md +++ b/README.md @@ -104,9 +104,7 @@ import { PublicKey } from '@solana/web3.js'; const signature = await lendAsset( agent, - new PublicKey('asset-mint'), 100, // amount - "lulo-api-key" ); ``` diff --git a/src/agent/index.ts b/src/agent/index.ts index b165ccc..59ee62d 100644 --- a/src/agent/index.ts +++ b/src/agent/index.ts @@ -13,7 +13,7 @@ import { getLendingDetails, getTPS, } from "../tools"; -import { CollectionOptions, LuloDepositAssetMint } from "../types"; +import { CollectionOptions } from "../types"; import { DEFAULT_OPTIONS } from "../constants"; /** @@ -96,12 +96,8 @@ export class SolanaAgentKit { return trade(this, outputMint, inputAmount, inputMint, slippageBps); } - async lendAssets( - asset: LuloDepositAssetMint, - amount: number, - LULO_API_KEY: string, - ) { - return lendAsset(this, asset, amount, LULO_API_KEY); + async lendAssets(amount: number) { + return lendAsset(this, amount); } async fetchLendingDetails(LULO_API_KEY: string) { diff --git a/src/langchain/index.ts b/src/langchain/index.ts index 3819a5c..b52a8b5 100644 --- a/src/langchain/index.ts +++ b/src/langchain/index.ts @@ -193,7 +193,7 @@ export class SolanaGetWalletAddressTool extends Tool { export class SolanaLendAssetTool extends Tool { name = "solana_lend_asset"; description = - "Lend idle assets for yield using Lulo. Input should be JSON with: {asset: string, amount: number, luloApiKey: string}"; + "Lend idle assets for yield using Lulo. Input should be JSON with: {amount: number}"; constructor(private solanaKit: SolanaAgentKit) { super(); @@ -201,13 +201,9 @@ export class SolanaLendAssetTool extends Tool { async _call(input: string): Promise { try { - const { asset, amount, luloApiKey } = JSON.parse(input); + const { amount } = JSON.parse(input); - const tx = await this.solanaKit.lendAssets( - new PublicKey(asset), - amount, - luloApiKey, - ); + const tx = await this.solanaKit.lendAssets(amount); return `Asset lent successfully. Transaction: ${tx}`; } catch (error: any) {