mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-21 15:10:42 +00:00
fix
This commit is contained in:
@@ -104,9 +104,7 @@ import { PublicKey } from '@solana/web3.js';
|
||||
|
||||
const signature = await lendAsset(
|
||||
agent,
|
||||
new PublicKey('asset-mint'),
|
||||
100, // amount
|
||||
"lulo-api-key"
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<string> {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user